@circle-fin/user-controlled-wallets 10.5.4 → 10.5.5
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.
|
@@ -1,46 +1,22 @@
|
|
|
1
|
-
"use strict";var gr=require("util"),at=require("stream"),Sc=require("path"),Sl=require("http"),wl=require("https"),Al=require("url"),ch=require("fs"),Or=require("crypto"),Ep=require("http2"),lh=require("assert"),Cp=require("tty"),uh=require("os"),ar=require("zlib"),ph=require("events");function Tp(e,t){return function(){return e.apply(t,arguments)}}const{toString:dh}=Object.prototype,{getPrototypeOf:wc}=Object,{iterator:Ac,toStringTag:Sp}=Symbol,Ic=(e=>t=>{const a=dh.call(t);return e[a]||(e[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),Vt=e=>(e=e.toLowerCase(),t=>Ic(t)===e),Bc=e=>t=>typeof t===e,{isArray:Dr}=Array,Fr=Bc("undefined");function sa(e){return e!==null&&!Fr(e)&&e.constructor!==null&&!Fr(e.constructor)&&wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wp=Vt("ArrayBuffer");function fh(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&wp(e.buffer),t}const hh=Bc("string"),wt=Bc("function"),Ap=Bc("number"),ia=e=>e!==null&&typeof e=="object",mh=e=>e===!0||e===!1,Rc=e=>{if(Ic(e)!=="object")return!1;const t=wc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Sp in e)&&!(Ac in e)},vh=e=>{if(!ia(e)||sa(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},gh=Vt("Date"),xh=Vt("File"),yh=e=>!!(e&&typeof e.uri<"u"),bh=e=>e&&typeof e.getParts<"u",Eh=Vt("Blob"),Ch=Vt("FileList"),Th=e=>ia(e)&&wt(e.pipe);function Sh(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ip=Sh(),Bp=typeof Ip.FormData<"u"?Ip.FormData:void 0,wh=e=>{if(!e)return!1;if(Bp&&e instanceof Bp)return!0;const t=wc(e);if(!t||t===Object.prototype||!wt(e.append))return!1;const a=Ic(e);return a==="formdata"||a==="object"&&wt(e.toString)&&e.toString()==="[object FormData]"},Ah=Vt("URLSearchParams"),[Ih,Bh,Rh,kh]=["ReadableStream","Request","Response","Headers"].map(Vt),_h=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function oa(e,t,{allOwnKeys:a=!1}={}){if(e===null||typeof e>"u")return;let r,n;if(typeof e!="object"&&(e=[e]),Dr(e))for(r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else{if(sa(e))return;const i=a?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let o;for(r=0;r<s;r++)o=i[r],t.call(null,e[o],o,e)}}function Rp(e,t){if(sa(e))return null;t=t.toLowerCase();const a=Object.keys(e);let r=a.length,n;for(;r-- >0;)if(n=a[r],t===n.toLowerCase())return n;return null}const xr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kp=e=>!Fr(e)&&e!==xr;function Il(){const{caseless:e,skipUndefined:t}=kp(this)&&this||{},a={},r=(n,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=e&&Rp(a,i)||i;Rc(a[s])&&Rc(n)?a[s]=Il(a[s],n):Rc(n)?a[s]=Il({},n):Dr(n)?a[s]=n.slice():(!t||!Fr(n))&&(a[s]=n)};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&oa(arguments[n],r);return a}const Uh=(e,t,a,{allOwnKeys:r}={})=>(oa(t,(n,i)=>{a&&wt(n)?Object.defineProperty(e,i,{value:Tp(n,a),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Nh=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Lh=(e,t,a,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),a&&Object.assign(e.prototype,a)},Ph=(e,t,a,r)=>{let n,i,s;const o={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),i=n.length;i-- >0;)s=n[i],(!r||r(s,e,t))&&!o[s]&&(t[s]=e[s],o[s]=!0);e=a!==!1&&wc(e)}while(e&&(!a||a(e,t))&&e!==Object.prototype);return t},Oh=(e,t,a)=>{e=String(e),(a===void 0||a>e.length)&&(a=e.length),a-=t.length;const r=e.indexOf(t,a);return r!==-1&&r===a},Dh=e=>{if(!e)return null;if(Dr(e))return e;let t=e.length;if(!Ap(t))return null;const a=new Array(t);for(;t-- >0;)a[t]=e[t];return a},Fh=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&wc(Uint8Array)),qh=(e,t)=>{const r=(e&&e[Ac]).call(e);let n;for(;(n=r.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},Vh=(e,t)=>{let a;const r=[];for(;(a=e.exec(t))!==null;)r.push(a);return r},Mh=Vt("HTMLFormElement"),jh=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,r,n){return r.toUpperCase()+n}),_p=(({hasOwnProperty:e})=>(t,a)=>e.call(t,a))(Object.prototype),Kh=Vt("RegExp"),Up=(e,t)=>{const a=Object.getOwnPropertyDescriptors(e),r={};oa(a,(n,i)=>{let s;(s=t(n,i,e))!==!1&&(r[i]=s||n)}),Object.defineProperties(e,r)},zh=e=>{Up(e,(t,a)=>{if(wt(e)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const r=e[a];if(wt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},Hh=(e,t)=>{const a={},r=n=>{n.forEach(i=>{a[i]=!0})};return Dr(e)?r(e):r(String(e).split(t)),a},$h=()=>{},Gh=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Wh(e){return!!(e&&wt(e.append)&&e[Sp]==="FormData"&&e[Ac])}const Xh=e=>{const t=new Array(10),a=(r,n)=>{if(ia(r)){if(t.indexOf(r)>=0)return;if(sa(r))return r;if(!("toJSON"in r)){t[n]=r;const i=Dr(r)?[]:{};return oa(r,(s,o)=>{const c=a(s,n+1);!Fr(c)&&(i[o]=c)}),t[n]=void 0,i}}return r};return a(e,0)},Qh=Vt("AsyncFunction"),Yh=e=>e&&(ia(e)||wt(e))&&wt(e.then)&&wt(e.catch),Np=((e,t)=>e?setImmediate:t?((a,r)=>(xr.addEventListener("message",({source:n,data:i})=>{n===xr&&i===a&&r.length&&r.shift()()},!1),n=>{r.push(n),xr.postMessage(a,"*")}))(`axios@${Math.random()}`,[]):a=>setTimeout(a))(typeof setImmediate=="function",wt(xr.postMessage)),Jh=typeof queueMicrotask<"u"?queueMicrotask.bind(xr):typeof process<"u"&&process.nextTick||Np,Zh=e=>e!=null&&wt(e[Ac]);var A={isArray:Dr,isArrayBuffer:wp,isBuffer:sa,isFormData:wh,isArrayBufferView:fh,isString:hh,isNumber:Ap,isBoolean:mh,isObject:ia,isPlainObject:Rc,isEmptyObject:vh,isReadableStream:Ih,isRequest:Bh,isResponse:Rh,isHeaders:kh,isUndefined:Fr,isDate:gh,isFile:xh,isReactNativeBlob:yh,isReactNative:bh,isBlob:Eh,isRegExp:Kh,isFunction:wt,isStream:Th,isURLSearchParams:Ah,isTypedArray:Fh,isFileList:Ch,forEach:oa,merge:Il,extend:Uh,trim:_h,stripBOM:Nh,inherits:Lh,toFlatObject:Ph,kindOf:Ic,kindOfTest:Vt,endsWith:Oh,toArray:Dh,forEachEntry:qh,matchAll:Vh,isHTMLForm:Mh,hasOwnProperty:_p,hasOwnProp:_p,reduceDescriptors:Up,freezeMethods:zh,toObjectSet:Hh,toCamelCase:jh,noop:$h,toFiniteNumber:Gh,findKey:Rp,global:xr,isContextDefined:kp,isSpecCompliantForm:Wh,toJSONObject:Xh,isAsyncFn:Qh,isThenable:Yh,setImmediate:Np,asap:Jh,isIterable:Zh};let D=class ih extends Error{static from(t,a,r,n,i,s){const o=new ih(t.message,a||t.code,r,n,i);return o.cause=t,o.name=t.name,t.status!=null&&o.status==null&&(o.status=t.status),s&&Object.assign(o,s),o}constructor(t,a,r,n,i){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,a&&(this.code=a),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}};D.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",D.ERR_BAD_OPTION="ERR_BAD_OPTION",D.ECONNABORTED="ECONNABORTED",D.ETIMEDOUT="ETIMEDOUT",D.ERR_NETWORK="ERR_NETWORK",D.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",D.ERR_DEPRECATED="ERR_DEPRECATED",D.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",D.ERR_BAD_REQUEST="ERR_BAD_REQUEST",D.ERR_CANCELED="ERR_CANCELED",D.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",D.ERR_INVALID_URL="ERR_INVALID_URL",D.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var em=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pp=at.Stream,tm=gr,rm=Mt;function Mt(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}tm.inherits(Mt,Pp),Mt.create=function(e,t){var a=new this;t=t||{};for(var r in t)a[r]=t[r];a.source=e;var n=e.emit;return e.emit=function(){return a._handleEmit(arguments),n.apply(e,arguments)},e.on("error",function(){}),a.pauseStream&&e.pause(),a},Object.defineProperty(Mt.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),Mt.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},Mt.prototype.resume=function(){this._released||this.release(),this.source.resume()},Mt.prototype.pause=function(){this.source.pause()},Mt.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},Mt.prototype.pipe=function(){var e=Pp.prototype.pipe.apply(this,arguments);return this.resume(),e},Mt.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)},Mt.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}};var am=gr,Op=at.Stream,Dp=rm,nm=Qe;function Qe(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}am.inherits(Qe,Op),Qe.create=function(e){var t=new this;e=e||{};for(var a in e)t[a]=e[a];return t},Qe.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)},Qe.prototype.append=function(e){var t=Qe.isStreamLike(e);if(t){if(!(e instanceof Dp)){var a=Dp.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=a}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},Qe.prototype.pipe=function(e,t){return Op.prototype.pipe.call(this,e,t),this.resume(),e},Qe.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}},Qe.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(a){var r=Qe.isStreamLike(a);r&&(a.on("data",this._checkDataSize.bind(this)),this._handleErrors(a)),this._pipeNext(a)}.bind(this))},Qe.prototype._pipeNext=function(e){this._currentStream=e;var t=Qe.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var a=e;this.write(a),this._getNext()},Qe.prototype._handleErrors=function(e){var t=this;e.on("error",function(a){t._emitError(a)})},Qe.prototype.write=function(e){this.emit("data",e)},Qe.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))},Qe.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")},Qe.prototype.end=function(){this._reset(),this.emit("end")},Qe.prototype.destroy=function(){this._reset(),this.emit("close")},Qe.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},Qe.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},Qe.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},Qe.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var Fp={},sm={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}};/*!
|
|
2
|
-
* mime-db
|
|
3
|
-
|
|
4
|
-
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
5
|
-
*
|
|
6
|
-
*/var im=sm;/*!
|
|
7
|
-
* mime-types
|
|
8
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
9
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
10
|
-
* MIT Licensed
|
|
11
|
-
*/(function(e){var t=im,a=Sc.extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,n=/^text\//i;e.charset=i,e.charsets={lookup:i},e.contentType=s,e.extension=o,e.extensions=Object.create(null),e.lookup=c,e.types=Object.create(null),l(e.extensions,e.types);function i(u){if(!u||typeof u!="string")return!1;var p=r.exec(u),d=p&&t[p[1].toLowerCase()];return d&&d.charset?d.charset:p&&n.test(p[1])?"UTF-8":!1}function s(u){if(!u||typeof u!="string")return!1;var p=u.indexOf("/")===-1?e.lookup(u):u;if(!p)return!1;if(p.indexOf("charset")===-1){var d=e.charset(p);d&&(p+="; charset="+d.toLowerCase())}return p}function o(u){if(!u||typeof u!="string")return!1;var p=r.exec(u),d=p&&e.extensions[p[1].toLowerCase()];return!d||!d.length?!1:d[0]}function c(u){if(!u||typeof u!="string")return!1;var p=a("x."+u).toLowerCase().substr(1);return p&&e.types[p]||!1}function l(u,p){var d=["nginx","apache",void 0,"iana"];Object.keys(t).forEach(function(h){var y=t[h],b=y.extensions;if(!(!b||!b.length)){u[h]=b;for(var E=0;E<b.length;E++){var I=b[E];if(p[I]){var R=d.indexOf(t[p[I]].source),k=d.indexOf(y.source);if(p[I]!=="application/octet-stream"&&(R>k||R===k&&p[I].substr(0,12)==="application/"))continue}p[I]=h}}})}})(Fp);var om=cm;function cm(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}var qp=om,Vp=lm;function lm(e){var t=!1;return qp(function(){t=!0}),function(r,n){t?e(r,n):qp(function(){e(r,n)})}}var Mp=um;function um(e){Object.keys(e.jobs).forEach(pm.bind(e)),e.jobs={}}function pm(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}var jp=Vp,dm=Mp,Kp=fm;function fm(e,t,a,r){var n=a.keyedList?a.keyedList[a.index]:a.index;a.jobs[n]=hm(t,n,e[n],function(i,s){n in a.jobs&&(delete a.jobs[n],i?dm(a):a.results[n]=s,r(i,a.results))})}function hm(e,t,a,r){var n;return e.length==2?n=e(a,jp(r)):n=e(a,t,jp(r)),n}var zp=mm;function mm(e,t){var a=!Array.isArray(e),r={index:0,keyedList:a||t?Object.keys(e):null,jobs:{},results:a?{}:[],size:a?Object.keys(e).length:e.length};return t&&r.keyedList.sort(a?t:function(n,i){return t(e[n],e[i])}),r}var vm=Mp,gm=Vp,Hp=xm;function xm(e){Object.keys(this.jobs).length&&(this.index=this.size,vm(this),gm(e)(null,this.results))}var ym=Kp,bm=zp,Em=Hp,Cm=Tm;function Tm(e,t,a){for(var r=bm(e);r.index<(r.keyedList||e).length;)ym(e,t,r,function(n,i){if(n){a(n,i);return}if(Object.keys(r.jobs).length===0){a(null,r.results);return}}),r.index++;return Em.bind(r,a)}var kc={exports:{}},$p=Kp,Sm=zp,wm=Hp;kc.exports=Am,kc.exports.ascending=Gp,kc.exports.descending=Im;function Am(e,t,a,r){var n=Sm(e,a);return $p(e,t,n,function i(s,o){if(s){r(s,o);return}if(n.index++,n.index<(n.keyedList||e).length){$p(e,t,n,i);return}r(null,n.results)}),wm.bind(n,r)}function Gp(e,t){return e<t?-1:e>t?1:0}function Im(e,t){return-1*Gp(e,t)}var Wp=kc.exports,Bm=Wp,Rm=km;function km(e,t,a){return Bm(e,t,null,a)}var _m={parallel:Cm,serial:Rm,serialOrdered:Wp},Xp=Object,Um=Error,Nm=EvalError,Lm=RangeError,Pm=ReferenceError,Om=SyntaxError,Bl,Qp;function Rl(){return Qp||(Qp=1,Bl=TypeError),Bl}var Dm=URIError,Fm=Math.abs,qm=Math.floor,Vm=Math.max,Mm=Math.min,jm=Math.pow,Km=Math.round,zm=Number.isNaN||function(t){return t!==t},Hm=zm,$m=function(t){return Hm(t)||t===0?t:t<0?-1:1},Gm=Object.getOwnPropertyDescriptor,_c=Gm;if(_c)try{_c([],"length")}catch{_c=null}var Yp=_c,Uc=Object.defineProperty||!1;if(Uc)try{Uc({},"a",{value:1})}catch{Uc=!1}var Wm=Uc,kl,Jp;function Zp(){return Jp||(Jp=1,kl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},a=Symbol("test"),r=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var n=42;t[a]=n;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==a||!Object.prototype.propertyIsEnumerable.call(t,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,a);if(o.value!==n||o.enumerable!==!0)return!1}return!0}),kl}var _l,ed;function Xm(){if(ed)return _l;ed=1;var e=typeof Symbol<"u"&&Symbol,t=Zp();return _l=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},_l}var Ul,td;function rd(){return td||(td=1,Ul=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ul}var Nl,ad;function nd(){if(ad)return Nl;ad=1;var e=Xp;return Nl=e.getPrototypeOf||null,Nl}var Qm="Function.prototype.bind called on incompatible ",Ym=Object.prototype.toString,Jm=Math.max,Zm="[object Function]",sd=function(t,a){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var i=0;i<a.length;i+=1)r[i+t.length]=a[i];return r},ev=function(t,a){for(var r=[],n=a||0,i=0;n<t.length;n+=1,i+=1)r[i]=t[n];return r},tv=function(e,t){for(var a="",r=0;r<e.length;r+=1)a+=e[r],r+1<e.length&&(a+=t);return a},rv=function(t){var a=this;if(typeof a!="function"||Ym.apply(a)!==Zm)throw new TypeError(Qm+a);for(var r=ev(arguments,1),n,i=function(){if(this instanceof n){var u=a.apply(this,sd(r,arguments));return Object(u)===u?u:this}return a.apply(t,sd(r,arguments))},s=Jm(0,a.length-r.length),o=[],c=0;c<s;c++)o[c]="$"+c;if(n=Function("binder","return function ("+tv(o,",")+"){ return binder.apply(this,arguments); }")(i),a.prototype){var l=function(){};l.prototype=a.prototype,n.prototype=new l,l.prototype=null}return n},av=rv,Nc=Function.prototype.bind||av,Ll,id;function Pl(){return id||(id=1,Ll=Function.prototype.call),Ll}var Ol,od;function cd(){return od||(od=1,Ol=Function.prototype.apply),Ol}var Dl,ld;function nv(){return ld||(ld=1,Dl=typeof Reflect<"u"&&Reflect&&Reflect.apply),Dl}var Fl,ud;function sv(){if(ud)return Fl;ud=1;var e=Nc,t=cd(),a=Pl(),r=nv();return Fl=r||e.call(a,t),Fl}var ql,pd;function iv(){if(pd)return ql;pd=1;var e=Nc,t=Rl(),a=Pl(),r=sv();return ql=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return r(e,a,i)},ql}var Vl,dd;function ov(){if(dd)return Vl;dd=1;var e=iv(),t=Yp,a;try{a=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!a&&t&&t(Object.prototype,"__proto__"),n=Object,i=n.getPrototypeOf;return Vl=r&&typeof r.get=="function"?e([r.get]):typeof i=="function"?function(o){return i(o==null?o:n(o))}:!1,Vl}var Ml,fd;function cv(){if(fd)return Ml;fd=1;var e=rd(),t=nd(),a=ov();return Ml=e?function(n){return e(n)}:t?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return t(n)}:a?function(n){return a(n)}:null,Ml}var lv=Function.prototype.call,uv=Object.prototype.hasOwnProperty,pv=Nc,jl=pv.call(lv,uv),de,dv=Xp,fv=Um,hv=Nm,mv=Lm,vv=Pm,qr=Om,Vr=Rl(),gv=Dm,xv=Fm,yv=qm,bv=Vm,Ev=Mm,Cv=jm,Tv=Km,Sv=$m,hd=Function,Kl=function(e){try{return hd('"use strict"; return ('+e+").constructor;")()}catch{}},ca=Yp,wv=Wm,zl=function(){throw new Vr},Av=ca?(function(){try{return arguments.callee,zl}catch{try{return ca(arguments,"callee").get}catch{return zl}}})():zl,Mr=Xm()(),nt=cv(),Iv=nd(),Bv=rd(),md=cd(),la=Pl(),jr={},Rv=typeof Uint8Array>"u"||!nt?de:nt(Uint8Array),yr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?de:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?de:ArrayBuffer,"%ArrayIteratorPrototype%":Mr&&nt?nt([][Symbol.iterator]()):de,"%AsyncFromSyncIteratorPrototype%":de,"%AsyncFunction%":jr,"%AsyncGenerator%":jr,"%AsyncGeneratorFunction%":jr,"%AsyncIteratorPrototype%":jr,"%Atomics%":typeof Atomics>"u"?de:Atomics,"%BigInt%":typeof BigInt>"u"?de:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?de:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?de:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?de:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":fv,"%eval%":eval,"%EvalError%":hv,"%Float16Array%":typeof Float16Array>"u"?de:Float16Array,"%Float32Array%":typeof Float32Array>"u"?de:Float32Array,"%Float64Array%":typeof Float64Array>"u"?de:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?de:FinalizationRegistry,"%Function%":hd,"%GeneratorFunction%":jr,"%Int8Array%":typeof Int8Array>"u"?de:Int8Array,"%Int16Array%":typeof Int16Array>"u"?de:Int16Array,"%Int32Array%":typeof Int32Array>"u"?de:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Mr&&nt?nt(nt([][Symbol.iterator]())):de,"%JSON%":typeof JSON=="object"?JSON:de,"%Map%":typeof Map>"u"?de:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Mr||!nt?de:nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":dv,"%Object.getOwnPropertyDescriptor%":ca,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?de:Promise,"%Proxy%":typeof Proxy>"u"?de:Proxy,"%RangeError%":mv,"%ReferenceError%":vv,"%Reflect%":typeof Reflect>"u"?de:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?de:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Mr||!nt?de:nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?de:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Mr&&nt?nt(""[Symbol.iterator]()):de,"%Symbol%":Mr?Symbol:de,"%SyntaxError%":qr,"%ThrowTypeError%":Av,"%TypedArray%":Rv,"%TypeError%":Vr,"%Uint8Array%":typeof Uint8Array>"u"?de:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?de:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?de:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?de:Uint32Array,"%URIError%":gv,"%WeakMap%":typeof WeakMap>"u"?de:WeakMap,"%WeakRef%":typeof WeakRef>"u"?de:WeakRef,"%WeakSet%":typeof WeakSet>"u"?de:WeakSet,"%Function.prototype.call%":la,"%Function.prototype.apply%":md,"%Object.defineProperty%":wv,"%Object.getPrototypeOf%":Iv,"%Math.abs%":xv,"%Math.floor%":yv,"%Math.max%":bv,"%Math.min%":Ev,"%Math.pow%":Cv,"%Math.round%":Tv,"%Math.sign%":Sv,"%Reflect.getPrototypeOf%":Bv};if(nt)try{null.error}catch(e){var kv=nt(nt(e));yr["%Error.prototype%"]=kv}var _v=function e(t){var a;if(t==="%AsyncFunction%")a=Kl("async function () {}");else if(t==="%GeneratorFunction%")a=Kl("function* () {}");else if(t==="%AsyncGeneratorFunction%")a=Kl("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(a=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&nt&&(a=nt(n.prototype))}return yr[t]=a,a},vd={__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"]},ua=Nc,Lc=jl,Uv=ua.call(la,Array.prototype.concat),Nv=ua.call(md,Array.prototype.splice),gd=ua.call(la,String.prototype.replace),Pc=ua.call(la,String.prototype.slice),Lv=ua.call(la,RegExp.prototype.exec),Pv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ov=/\\(\\)?/g,Dv=function(t){var a=Pc(t,0,1),r=Pc(t,-1);if(a==="%"&&r!=="%")throw new qr("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&a!=="%")throw new qr("invalid intrinsic syntax, expected opening `%`");var n=[];return gd(t,Pv,function(i,s,o,c){n[n.length]=o?gd(c,Ov,"$1"):s||i}),n},Fv=function(t,a){var r=t,n;if(Lc(vd,r)&&(n=vd[r],r="%"+n[0]+"%"),Lc(yr,r)){var i=yr[r];if(i===jr&&(i=_v(r)),typeof i>"u"&&!a)throw new Vr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new qr("intrinsic "+t+" does not exist!")},qv=function(t,a){if(typeof t!="string"||t.length===0)throw new Vr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new Vr('"allowMissing" argument must be a boolean');if(Lv(/^%?[^%]*%?$/,t)===null)throw new qr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Dv(t),n=r.length>0?r[0]:"",i=Fv("%"+n+"%",a),s=i.name,o=i.value,c=!1,l=i.alias;l&&(n=l[0],Nv(r,Uv([0,1],l)));for(var u=1,p=!0;u<r.length;u+=1){var d=r[u],g=Pc(d,0,1),h=Pc(d,-1);if((g==='"'||g==="'"||g==="`"||h==='"'||h==="'"||h==="`")&&g!==h)throw new qr("property names with quotes must have matching quotes");if((d==="constructor"||!p)&&(c=!0),n+="."+d,s="%"+n+"%",Lc(yr,s))o=yr[s];else if(o!=null){if(!(d in o)){if(!a)throw new Vr("base intrinsic for "+t+" exists, but the property is not available.");return}if(ca&&u+1>=r.length){var y=ca(o,d);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?o=y.get:o=o[d]}else p=Lc(o,d),o=o[d];p&&!c&&(yr[s]=o)}}return o},Hl,xd;function Vv(){if(xd)return Hl;xd=1;var e=Zp();return Hl=function(){return e()&&!!Symbol.toStringTag},Hl}var Mv=qv,yd=Mv("%Object.defineProperty%",!0),jv=Vv()(),Kv=jl,zv=Rl(),Oc=jv?Symbol.toStringTag:null,Hv=function(t,a){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,n=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!="boolean"||typeof n<"u"&&typeof n!="boolean")throw new zv("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Oc&&(r||!Kv(t,Oc))&&(yd?yd(t,Oc,{configurable:!n,enumerable:!1,value:a,writable:!1}):t[Oc]=a)},$v=function(e,t){return Object.keys(t).forEach(function(a){e[a]=e[a]||t[a]}),e},$l=nm,Gv=gr,Gl=Sc,Wv=Sl,Xv=wl,Qv=Al.parse,Yv=ch,Jv=at.Stream,Zv=Or,Wl=Fp,eg=_m,tg=Hv,nr=jl,Xl=$v;function Ie(e){if(!(this instanceof Ie))return new Ie(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],$l.call(this),e=e||{};for(var t in e)this[t]=e[t]}Gv.inherits(Ie,$l),Ie.LINE_BREAK=`\r
|
|
12
|
-
`,Ie.DEFAULT_CONTENT_TYPE="application/octet-stream",Ie.prototype.append=function(e,t,a){a=a||{},typeof a=="string"&&(a={filename:a});var r=$l.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var n=this._multiPartHeader(e,t,a),i=this._multiPartFooter();r(n),r(t),r(i),this._trackLength(n,t,a)},Ie.prototype._trackLength=function(e,t,a){var r=0;a.knownLength!=null?r+=Number(a.knownLength):Buffer.isBuffer(t)?r=t.length:typeof t=="string"&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+Ie.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&nr(t,"httpVersion"))&&!(t instanceof Jv))&&(a.knownLength||this._valuesToMeasure.push(t))},Ie.prototype._lengthRetriever=function(e,t){nr(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Yv.stat(e.path,function(a,r){if(a){t(a);return}var n=r.size-(e.start?e.start:0);t(null,n)}):nr(e,"httpVersion")?t(null,Number(e.headers["content-length"])):nr(e,"httpModule")?(e.on("response",function(a){e.pause(),t(null,Number(a.headers["content-length"]))}),e.resume()):t("Unknown stream")},Ie.prototype._multiPartHeader=function(e,t,a){if(typeof a.header=="string")return a.header;var r=this._getContentDisposition(t,a),n=this._getContentType(t,a),i="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(r||[]),"Content-Type":[].concat(n||[])};typeof a.header=="object"&&Xl(s,a.header);var o;for(var c in s)if(nr(s,c)){if(o=s[c],o==null)continue;Array.isArray(o)||(o=[o]),o.length&&(i+=c+": "+o.join("; ")+Ie.LINE_BREAK)}return"--"+this.getBoundary()+Ie.LINE_BREAK+i+Ie.LINE_BREAK},Ie.prototype._getContentDisposition=function(e,t){var a;if(typeof t.filepath=="string"?a=Gl.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?a=Gl.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&nr(e,"httpVersion")&&(a=Gl.basename(e.client._httpMessage.path||"")),a)return'filename="'+a+'"'},Ie.prototype._getContentType=function(e,t){var a=t.contentType;return!a&&e&&e.name&&(a=Wl.lookup(e.name)),!a&&e&&e.path&&(a=Wl.lookup(e.path)),!a&&e&&e.readable&&nr(e,"httpVersion")&&(a=e.headers["content-type"]),!a&&(t.filepath||t.filename)&&(a=Wl.lookup(t.filepath||t.filename)),!a&&e&&typeof e=="object"&&(a=Ie.DEFAULT_CONTENT_TYPE),a},Ie.prototype._multiPartFooter=function(){return function(e){var t=Ie.LINE_BREAK,a=this._streams.length===0;a&&(t+=this._lastBoundary()),e(t)}.bind(this)},Ie.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ie.LINE_BREAK},Ie.prototype.getHeaders=function(e){var t,a={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)nr(e,t)&&(a[t.toLowerCase()]=e[t]);return a},Ie.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e},Ie.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Ie.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),a=0,r=this._streams.length;a<r;a++)typeof this._streams[a]!="function"&&(Buffer.isBuffer(this._streams[a])?e=Buffer.concat([e,this._streams[a]]):e=Buffer.concat([e,Buffer.from(this._streams[a])]),(typeof this._streams[a]!="string"||this._streams[a].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(Ie.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Ie.prototype._generateBoundary=function(){this._boundary="--------------------------"+Zv.randomBytes(12).toString("hex")},Ie.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Ie.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Ie.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}eg.parallel(this._valuesToMeasure,this._lengthRetriever,function(a,r){if(a){e(a);return}r.forEach(function(n){t+=n}),e(null,t)})},Ie.prototype.submit=function(e,t){var a,r,n={method:"post"};return typeof e=="string"?(e=Qv(e),r=Xl({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},n)):(r=Xl(e,n),r.port||(r.port=r.protocol==="https:"?443:80)),r.headers=this.getHeaders(e.headers),r.protocol==="https:"?a=Xv.request(r):a=Wv.request(r),this.getLength(function(i,s){if(i&&i!=="Unknown stream"){this._error(i);return}if(s&&a.setHeader("Content-Length",s),this.pipe(a),t){var o,c=function(l,u){return a.removeListener("error",c),a.removeListener("response",o),t.call(this,l,u)};o=c.bind(this,null),a.on("error",c),a.on("response",o)}}.bind(this)),a},Ie.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Ie.prototype.toString=function(){return"[object FormData]"},tg(Ie.prototype,"FormData");var rg=Ie,bd=Lp(rg);function Ql(e){return A.isPlainObject(e)||A.isArray(e)}function Ed(e){return A.endsWith(e,"[]")?e.slice(0,-2):e}function Yl(e,t,a){return e?e.concat(t).map(function(n,i){return n=Ed(n),!a&&i?"["+n+"]":n}).join(a?".":""):t}function ag(e){return A.isArray(e)&&!e.some(Ql)}const ng=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function Dc(e,t,a){if(!A.isObject(e))throw new TypeError("target must be an object");t=t||new(bd||FormData),a=A.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,E){return!A.isUndefined(E[b])});const r=a.metaTokens,n=a.visitor||p,i=a.dots,s=a.indexes,o=a.Blob||typeof Blob<"u"&&Blob,c=a.maxDepth===void 0?100:a.maxDepth,l=o&&A.isSpecCompliantForm(t);if(!A.isFunction(n))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(A.isDate(y))return y.toISOString();if(A.isBoolean(y))return y.toString();if(!l&&A.isBlob(y))throw new D("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(y)||A.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y,b,E){let I=y;if(A.isReactNative(t)&&A.isReactNativeBlob(y))return t.append(Yl(E,b,i),u(y)),!1;if(y&&!E&&typeof y=="object"){if(A.endsWith(b,"{}"))b=r?b:b.slice(0,-2),y=JSON.stringify(y);else if(A.isArray(y)&&ag(y)||(A.isFileList(y)||A.endsWith(b,"[]"))&&(I=A.toArray(y)))return b=Ed(b),I.forEach(function(k,U){!(A.isUndefined(k)||k===null)&&t.append(s===!0?Yl([b],U,i):s===null?b:b+"[]",u(k))}),!1}return Ql(y)?!0:(t.append(Yl(E,b,i),u(y)),!1)}const d=[],g=Object.assign(ng,{defaultVisitor:p,convertValue:u,isVisitable:Ql});function h(y,b,E=0){if(!A.isUndefined(y)){if(E>c)throw new D("Object is too deeply nested ("+E+" levels). Max depth: "+c,D.ERR_FORM_DATA_DEPTH_EXCEEDED);if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(y),A.forEach(y,function(R,k){(!(A.isUndefined(R)||R===null)&&n.call(t,R,A.isString(k)?k.trim():k,b,g))===!0&&h(R,b?b.concat(k):[k],E+1)}),d.pop()}}if(!A.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Cd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function Td(e,t){this._pairs=[],e&&Dc(e,this,t)}const Sd=Td.prototype;Sd.append=function(t,a){this._pairs.push([t,a])},Sd.toString=function(t){const a=t?function(r){return t.call(this,r,Cd)}:Cd;return this._pairs.map(function(n){return a(n[0])+"="+a(n[1])},"").join("&")};function sg(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Jl(e,t,a){if(!t)return e;const r=a&&a.encode||sg,n=A.isFunction(a)?{serialize:a}:a,i=n&&n.serialize;let s;if(i?s=i(t,n):s=A.isURLSearchParams(t)?t.toString():new Td(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class wd{constructor(){this.handlers=[]}use(t,a,r){return this.handlers.push({fulfilled:t,rejected:a,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(r){r!==null&&t(r)})}}var Fc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ig=Al.URLSearchParams;const Zl="abcdefghijklmnopqrstuvwxyz",Ad="0123456789",Id={DIGIT:Ad,ALPHA:Zl,ALPHA_DIGIT:Zl+Zl.toUpperCase()+Ad},og=(e=16,t=Id.ALPHA_DIGIT)=>{let a="";const{length:r}=t,n=new Uint32Array(e);Or.randomFillSync(n);for(let i=0;i<e;i++)a+=t[n[i]%r];return a};var cg={isNode:!0,classes:{URLSearchParams:ig,FormData:bd,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:Id,generateString:og,protocols:["http","https","file","data"]};const eu=typeof window<"u"&&typeof document<"u",tu=typeof navigator=="object"&&navigator||void 0,lg=eu&&(!tu||["ReactNative","NativeScript","NS"].indexOf(tu.product)<0),ug=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",pg=eu&&window.location.href||"http://localhost";var dg=Object.freeze({__proto__:null,hasBrowserEnv:eu,hasStandardBrowserEnv:lg,hasStandardBrowserWebWorkerEnv:ug,navigator:tu,origin:pg}),Ye={...dg,...cg};function fg(e,t){return Dc(e,new Ye.classes.URLSearchParams,{visitor:function(a,r,n,i){return Ye.isNode&&A.isBuffer(a)?(this.append(r,a.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function hg(e){return A.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function mg(e){const t={},a=Object.keys(e);let r;const n=a.length;let i;for(r=0;r<n;r++)i=a[r],t[i]=e[i];return t}function Bd(e){function t(a,r,n,i){let s=a[i++];if(s==="__proto__")return!0;const o=Number.isFinite(+s),c=i>=a.length;return s=!s&&A.isArray(n)?n.length:s,c?(A.hasOwnProp(n,s)?n[s]=A.isArray(n[s])?n[s].concat(r):[n[s],r]:n[s]=r,!o):((!n[s]||!A.isObject(n[s]))&&(n[s]=[]),t(a,r,n[s],i)&&A.isArray(n[s])&&(n[s]=mg(n[s])),!o)}if(A.isFormData(e)&&A.isFunction(e.entries)){const a={};return A.forEachEntry(e,(r,n)=>{t(hg(r),n,a,0)}),a}return null}const Kr=(e,t)=>e!=null&&A.hasOwnProp(e,t)?e[t]:void 0;function vg(e,t,a){if(A.isString(e))try{return(t||JSON.parse)(e),A.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(a||JSON.stringify)(e)}const pa={transitional:Fc,adapter:["xhr","http","fetch"],transformRequest:[function(t,a){const r=a.getContentType()||"",n=r.indexOf("application/json")>-1,i=A.isObject(t);if(i&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return n?JSON.stringify(Bd(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){const c=Kr(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return fg(t,c).toString();if((o=A.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=Kr(this,"env"),u=l&&l.FormData;return Dc(o?{"files[]":t}:t,u&&new u,c)}}return i||n?(a.setContentType("application/json",!1),vg(t)):t}],transformResponse:[function(t){const a=Kr(this,"transitional")||pa.transitional,r=a&&a.forcedJSONParsing,n=Kr(this,"responseType"),i=n==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(r&&!n||i)){const o=!(a&&a.silentJSONParsing)&&i;try{return JSON.parse(t,Kr(this,"parseReviver"))}catch(c){if(o)throw c.name==="SyntaxError"?D.from(c,D.ERR_BAD_RESPONSE,this,null,Kr(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ye.classes.FormData,Blob:Ye.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],e=>{pa.headers[e]={}});const gg=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var xg=e=>{const t={};let a,r,n;return e&&e.split(`
|
|
13
|
-
`).forEach(function(s){n=s.indexOf(":"),a=s.substring(0,n).trim().toLowerCase(),r=s.substring(n+1).trim(),!(!a||t[a]&&gg[a])&&(a==="set-cookie"?t[a]?t[a].push(r):t[a]=[r]:t[a]=t[a]?t[a]+", "+r:r)}),t};const Rd=Symbol("internals"),yg=/[^\x09\x20-\x7E\x80-\xFF]/g;function bg(e){let t=0,a=e.length;for(;t<a;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;a>t;){const r=e.charCodeAt(a-1);if(r!==9&&r!==32)break;a-=1}return t===0&&a===e.length?e:e.slice(t,a)}function da(e){return e&&String(e).trim().toLowerCase()}function Eg(e){return bg(e.replace(yg,""))}function qc(e){return e===!1||e==null?e:A.isArray(e)?e.map(qc):Eg(String(e))}function Cg(e){const t=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=a.exec(e);)t[r[1]]=r[2];return t}const Tg=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ru(e,t,a,r,n){if(A.isFunction(r))return r.call(this,t,a);if(n&&(t=a),!!A.isString(t)){if(A.isString(r))return t.indexOf(r)!==-1;if(A.isRegExp(r))return r.test(t)}}function Sg(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,a,r)=>a.toUpperCase()+r)}function wg(e,t){const a=A.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+a,{value:function(n,i,s){return this[r].call(this,t,n,i,s)},configurable:!0})})}let lt=class{constructor(t){t&&this.set(t)}set(t,a,r){const n=this;function i(o,c,l){const u=da(c);if(!u)throw new Error("header name must be a non-empty string");const p=A.findKey(n,u);(!p||n[p]===void 0||l===!0||l===void 0&&n[p]!==!1)&&(n[p||c]=qc(o))}const s=(o,c)=>A.forEach(o,(l,u)=>i(l,u,c));if(A.isPlainObject(t)||t instanceof this.constructor)s(t,a);else if(A.isString(t)&&(t=t.trim())&&!Tg(t))s(xg(t),a);else if(A.isObject(t)&&A.isIterable(t)){let o={},c,l;for(const u of t){if(!A.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(c=o[l])?A.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(o,a)}else t!=null&&i(a,t,r);return this}get(t,a){if(t=da(t),t){const r=A.findKey(this,t);if(r){const n=this[r];if(!a)return n;if(a===!0)return Cg(n);if(A.isFunction(a))return a.call(this,n,r);if(A.isRegExp(a))return a.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,a){if(t=da(t),t){const r=A.findKey(this,t);return!!(r&&this[r]!==void 0&&(!a||ru(this,this[r],r,a)))}return!1}delete(t,a){const r=this;let n=!1;function i(s){if(s=da(s),s){const o=A.findKey(r,s);o&&(!a||ru(r,r[o],o,a))&&(delete r[o],n=!0)}}return A.isArray(t)?t.forEach(i):i(t),n}clear(t){const a=Object.keys(this);let r=a.length,n=!1;for(;r--;){const i=a[r];(!t||ru(this,this[i],i,t,!0))&&(delete this[i],n=!0)}return n}normalize(t){const a=this,r={};return A.forEach(this,(n,i)=>{const s=A.findKey(r,i);if(s){a[s]=qc(n),delete a[i];return}const o=t?Sg(i):String(i).trim();o!==i&&delete a[i],a[o]=qc(n),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const a=Object.create(null);return A.forEach(this,(r,n)=>{r!=null&&r!==!1&&(a[n]=t&&A.isArray(r)?r.join(", "):r)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,a])=>t+": "+a).join(`
|
|
14
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...a){const r=new this(t);return a.forEach(n=>r.set(n)),r}static accessor(t){const r=(this[Rd]=this[Rd]={accessors:{}}).accessors,n=this.prototype;function i(s){const o=da(s);r[o]||(wg(n,s),r[o]=!0)}return A.isArray(t)?t.forEach(i):i(t),this}};lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(lt.prototype,({value:e},t)=>{let a=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[a]=r}}}),A.freezeMethods(lt);function au(e,t){const a=this||pa,r=t||a,n=lt.from(r.headers);let i=r.data;return A.forEach(e,function(o){i=o.call(a,i,n.normalize(),t?t.status:void 0)}),n.normalize(),i}function kd(e){return!!(e&&e.__CANCEL__)}let br=class extends D{constructor(t,a,r){super(t??"canceled",D.ERR_CANCELED,a,r),this.name="CanceledError",this.__CANCEL__=!0}};function zr(e,t,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?e(a):t(new D("Request failed with status code "+a.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function Ag(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ig(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function nu(e,t,a){let r=!Ag(t);return e&&(r||a===!1)?Ig(e,t):t}var Bg={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Rg(e){try{return new URL(e)}catch{return null}}function kg(e){var t=(typeof e=="string"?Rg(e):e)||{},a=t.protocol,r=t.host,n=t.port;if(typeof r!="string"||!r||typeof a!="string"||(a=a.split(":",1)[0],r=r.replace(/:\d*$/,""),n=parseInt(n)||Bg[a]||0,!_g(r,n)))return"";var i=su(a+"_proxy")||su("all_proxy");return i&&i.indexOf("://")===-1&&(i=a+"://"+i),i}function _g(e,t){var a=su("no_proxy").toLowerCase();return a?a==="*"?!1:a.split(/[,\s]/).every(function(r){if(!r)return!0;var n=r.match(/^(.+):(\d+)$/),i=n?n[1]:r,s=n?parseInt(n[2]):0;return s&&s!==t?!0:/^[.*]/.test(i)?(i.charAt(0)==="*"&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function su(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var iu={exports:{}},Vc={exports:{}},Mc={exports:{}},ou,_d;function Ug(){if(_d)return ou;_d=1;var e=1e3,t=e*60,a=t*60,r=a*24,n=r*7,i=r*365.25;ou=function(u,p){p=p||{};var d=typeof u;if(d==="string"&&u.length>0)return s(u);if(d==="number"&&isFinite(u))return p.long?c(u):o(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function s(u){if(u=String(u),!(u.length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(p){var d=parseFloat(p[1]),g=(p[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return d*i;case"weeks":case"week":case"w":return d*n;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*a;case"minutes":case"minute":case"mins":case"min":case"m":return d*t;case"seconds":case"second":case"secs":case"sec":case"s":return d*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function o(u){var p=Math.abs(u);return p>=r?Math.round(u/r)+"d":p>=a?Math.round(u/a)+"h":p>=t?Math.round(u/t)+"m":p>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var p=Math.abs(u);return p>=r?l(u,p,r,"day"):p>=a?l(u,p,a,"hour"):p>=t?l(u,p,t,"minute"):p>=e?l(u,p,e,"second"):u+" ms"}function l(u,p,d,g){var h=p>=d*1.5;return Math.round(u/d)+" "+g+(h?"s":"")}return ou}var cu,Ud;function Nd(){if(Ud)return cu;Ud=1;function e(t){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=c,r.humanize=Ug(),r.destroy=u,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function a(p){let d=0;for(let g=0;g<p.length;g++)d=(d<<5)-d+p.charCodeAt(g),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=a;function r(p){let d,g=null,h,y;function b(...E){if(!b.enabled)return;const I=b,R=Number(new Date),k=R-(d||R);I.diff=k,I.prev=d,I.curr=R,d=R,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let U=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(q,H)=>{if(q==="%%")return"%";U++;const Y=r.formatters[H];if(typeof Y=="function"){const ve=E[U];q=Y.call(I,ve),E.splice(U,1),U--}return q}),r.formatArgs.call(I,E),(I.log||r.log).apply(I,E)}return b.namespace=p,b.useColors=r.useColors(),b.color=r.selectColor(p),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(h!==r.namespaces&&(h=r.namespaces,y=r.enabled(p)),y),set:E=>{g=E}}),typeof r.init=="function"&&r.init(b),b}function n(p,d){const g=r(this.namespace+(typeof d>"u"?":":d)+p);return g.log=this.log,g}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];const d=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const g of d)g[0]==="-"?r.skips.push(g.slice(1)):r.names.push(g)}function s(p,d){let g=0,h=0,y=-1,b=0;for(;g<p.length;)if(h<d.length&&(d[h]===p[g]||d[h]==="*"))d[h]==="*"?(y=h,b=g,h++):(g++,h++);else if(y!==-1)h=y+1,b++,g=b;else return!1;for(;h<d.length&&d[h]==="*";)h++;return h===d.length}function o(){const p=[...r.names,...r.skips.map(d=>"-"+d)].join(",");return r.enable(""),p}function c(p){for(const d of r.skips)if(s(p,d))return!1;for(const d of r.names)if(s(p,d))return!0;return!1}function l(p){return p instanceof Error?p.stack||p.message:p}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return cu=e,cu}var Ld;function Ng(){return Ld||(Ld=1,(function(e,t){t.formatArgs=r,t.save=n,t.load=i,t.useColors=a,t.storage=s(),t.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function a(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let c;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(c=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(c[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let u=0,p=0;c[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(u++,d==="%c"&&(p=u))}),c.splice(p,0,l)}t.log=console.debug||console.log||(()=>{});function n(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function i(){let c;try{c=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function s(){try{return localStorage}catch{}}e.exports=Nd()(t);const{formatters:o}=e.exports;o.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Mc,Mc.exports)),Mc.exports}var jc={exports:{}},lu,Pd;function Lg(){return Pd||(Pd=1,lu=(e,t=process.argv)=>{const a=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(a+e),n=t.indexOf("--");return r!==-1&&(n===-1||r<n)}),lu}var uu,Od;function Pg(){if(Od)return uu;Od=1;const e=uh,t=Cp,a=Lg(),{env:r}=process;let n;a("no-color")||a("no-colors")||a("color=false")||a("color=never")?n=0:(a("color")||a("colors")||a("color=true")||a("color=always"))&&(n=1),"FORCE_COLOR"in r&&(r.FORCE_COLOR==="true"?n=1:r.FORCE_COLOR==="false"?n=0:n=r.FORCE_COLOR.length===0?1:Math.min(parseInt(r.FORCE_COLOR,10),3));function i(c){return c===0?!1:{level:c,hasBasic:!0,has256:c>=2,has16m:c>=3}}function s(c,l){if(n===0)return 0;if(a("color=16m")||a("color=full")||a("color=truecolor"))return 3;if(a("color=256"))return 2;if(c&&!l&&n===void 0)return 0;const u=n||0;if(r.TERM==="dumb")return u;if(process.platform==="win32"){const p=e.release().split(".");return Number(p[0])>=10&&Number(p[2])>=10586?Number(p[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(p=>p in r)||r.CI_NAME==="codeship"?1:u;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if(r.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in r){const p=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return p>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:u}function o(c){const l=s(c,c&&c.isTTY);return i(l)}return uu={supportsColor:o,stdout:i(s(!0,t.isatty(1))),stderr:i(s(!0,t.isatty(2)))},uu}var Dd;function Og(){return Dd||(Dd=1,(function(e,t){const a=Cp,r=gr;t.init=u,t.log=o,t.formatArgs=i,t.save=c,t.load=l,t.useColors=n,t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const d=Pg();d&&(d.stderr||d).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(d=>/^debug_/i.test(d)).reduce((d,g)=>{const h=g.substring(6).toLowerCase().replace(/_([a-z])/g,(b,E)=>E.toUpperCase());let y=process.env[g];return/^(yes|on|true|enabled)$/i.test(y)?y=!0:/^(no|off|false|disabled)$/i.test(y)?y=!1:y==="null"?y=null:y=Number(y),d[h]=y,d},{});function n(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:a.isatty(process.stderr.fd)}function i(d){const{namespace:g,useColors:h}=this;if(h){const y=this.color,b="\x1B[3"+(y<8?y:"8;5;"+y),E=` ${b};1m${g} \x1B[0m`;d[0]=E+d[0].split(`
|
|
15
|
-
`).join(`
|
|
16
|
-
`+E),d.push(b+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else d[0]=s()+g+" "+d[0]}function s(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function o(...d){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...d)+`
|
|
17
|
-
`)}function c(d){d?process.env.DEBUG=d:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(d){d.inspectOpts={};const g=Object.keys(t.inspectOpts);for(let h=0;h<g.length;h++)d.inspectOpts[g[h]]=t.inspectOpts[g[h]]}e.exports=Nd()(t);const{formatters:p}=e.exports;p.o=function(d){return this.inspectOpts.colors=this.useColors,r.inspect(d,this.inspectOpts).split(`
|
|
18
|
-
`).map(g=>g.trim()).join(" ")},p.O=function(d){return this.inspectOpts.colors=this.useColors,r.inspect(d,this.inspectOpts)}})(jc,jc.exports)),jc.exports}var Fd;function Dg(){return Fd||(Fd=1,typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Vc.exports=Ng():Vc.exports=Og()),Vc.exports}var fa,Fg=function(){if(!fa){try{fa=Dg()("follow-redirects")}catch{}typeof fa!="function"&&(fa=function(){})}fa.apply(null,arguments)},ha=Al,ma=ha.URL,qg=Sl,Vg=wl,pu=at.Writable,du=lh,qd=Fg;(function(){var t=typeof process<"u",a=typeof window<"u"&&typeof document<"u",r=Cr(Error.captureStackTrace);!t&&(a||!r)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var fu=!1;try{du(new ma(""))}catch(e){fu=e.code==="ERR_INVALID_URL"}var Mg=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],hu=["abort","aborted","connect","error","socket","timeout"],mu=Object.create(null);hu.forEach(function(e){mu[e]=function(t,a,r){this._redirectable.emit(e,t,a,r)}});var vu=va("ERR_INVALID_URL","Invalid URL",TypeError),gu=va("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),jg=va("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",gu),Kg=va("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),zg=va("ERR_STREAM_WRITE_AFTER_END","write after end"),Hg=pu.prototype.destroy||Md;function At(e,t){pu.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var a=this;this._onNativeResponse=function(r){try{a._processResponse(r)}catch(n){a.emit("error",n instanceof gu?n:new gu({cause:n}))}},this._performRequest()}At.prototype=Object.create(pu.prototype),At.prototype.abort=function(){Eu(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},At.prototype.destroy=function(e){return Eu(this._currentRequest,e),Hg.call(this,e),this},At.prototype.write=function(e,t,a){if(this._ending)throw new zg;if(!Er(e)&&!Wg(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Cr(t)&&(a=t,t=null),e.length===0){a&&a();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,a)):(this.emit("error",new Kg),this.abort())},At.prototype.end=function(e,t,a){if(Cr(e)?(a=e,e=t=null):Cr(t)&&(a=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,a);else{var r=this,n=this._currentRequest;this.write(e,t,function(){r._ended=!0,n.end(null,null,a)}),this._ending=!0}},At.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},At.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},At.prototype.setTimeout=function(e,t){var a=this;function r(s){s.setTimeout(e),s.removeListener("timeout",s.destroy),s.addListener("timeout",s.destroy)}function n(s){a._timeout&&clearTimeout(a._timeout),a._timeout=setTimeout(function(){a.emit("timeout"),i()},e),r(s)}function i(){a._timeout&&(clearTimeout(a._timeout),a._timeout=null),a.removeListener("abort",i),a.removeListener("error",i),a.removeListener("response",i),a.removeListener("close",i),t&&a.removeListener("timeout",t),a.socket||a._currentRequest.removeListener("socket",n)}return t&&this.on("timeout",t),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",r),this.on("abort",i),this.on("error",i),this.on("response",i),this.on("close",i),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){At.prototype[e]=function(t,a){return this._currentRequest[e](t,a)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(At.prototype,e,{get:function(){return this._currentRequest[e]}})}),At.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},At.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var a=e.slice(0,-1);this._options.agent=this._options.agents[a]}var r=this._currentRequest=t.request(this._options,this._onNativeResponse);r._redirectable=this;for(var n of hu)r.on(n,mu[n]);if(this._currentUrl=/^\//.test(this._options.path)?ha.format(this._options):this._options.path,this._isRedirect){var i=0,s=this,o=this._requestBodyBuffers;(function c(l){if(r===s._currentRequest)if(l)s.emit("error",l);else if(i<o.length){var u=o[i++];r.finished||r.write(u.data,u.encoding,c)}else s._ended&&r.end()})()}},At.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var a=e.headers.location;if(!a||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Eu(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new jg;var r,n=this._options.beforeRedirect;n&&(r=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var i=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],bu(/^content-/i,this._options.headers));var s=bu(/^host$/i,this._options.headers),o=xu(this._currentUrl),c=s||o.host,l=/^\w+:/.test(a)?this._currentUrl:ha.format(Object.assign(o,{host:c})),u=$g(a,l);if(qd("redirecting to",u.href),this._isRedirect=!0,yu(u,this._options),(u.protocol!==o.protocol&&u.protocol!=="https:"||u.host!==c&&!Gg(u.host,c))&&bu(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Cr(n)){var p={headers:e.headers,statusCode:t},d={url:l,method:i,headers:r};n(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function Vd(e){var t={maxRedirects:21,maxBodyLength:10485760},a={};return Object.keys(e).forEach(function(r){var n=r+":",i=a[n]=e[r],s=t[r]=Object.create(i);function o(l,u,p){return Xg(l)?l=yu(l):Er(l)?l=yu(xu(l)):(p=u,u=jd(l),l={protocol:n}),Cr(u)&&(p=u,u=null),u=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},l,u),u.nativeProtocols=a,!Er(u.host)&&!Er(u.hostname)&&(u.hostname="::1"),du.equal(u.protocol,n,"protocol mismatch"),qd("options",u),new At(u,p)}function c(l,u,p){var d=s.request(l,u,p);return d.end(),d}Object.defineProperties(s,{request:{value:o,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function Md(){}function xu(e){var t;if(fu)t=new ma(e);else if(t=jd(ha.parse(e)),!Er(t.protocol))throw new vu({input:e});return t}function $g(e,t){return fu?new ma(e,t):xu(ha.resolve(t,e))}function jd(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new vu({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new vu({input:e.href||e});return e}function yu(e,t){var a=t||{};for(var r of Mg)a[r]=e[r];return a.hostname.startsWith("[")&&(a.hostname=a.hostname.slice(1,-1)),a.port!==""&&(a.port=Number(a.port)),a.path=a.search?a.pathname+a.search:a.pathname,a}function bu(e,t){var a;for(var r in t)e.test(r)&&(a=t[r],delete t[r]);return a===null||typeof a>"u"?void 0:String(a).trim()}function va(e,t,a){function r(n){Cr(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return r.prototype=new(a||Error),Object.defineProperties(r.prototype,{constructor:{value:r,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),r}function Eu(e,t){for(var a of hu)e.removeListener(a,mu[a]);e.on("error",Md),e.destroy(t)}function Gg(e,t){du(Er(e)&&Er(t));var a=e.length-t.length-1;return a>0&&e[a]==="."&&e.endsWith(t)}function Er(e){return typeof e=="string"||e instanceof String}function Cr(e){return typeof e=="function"}function Wg(e){return typeof e=="object"&&"length"in e}function Xg(e){return ma&&e instanceof ma}iu.exports=Vd({http:qg,https:Vg}),iu.exports.wrap=Vd;var Qg=iu.exports,Yg=Lp(Qg);const Kc="1.15.2";function Kd(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const Jg=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Zg(e,t,a){const r=a&&a.Blob||Ye.classes.Blob,n=Kd(e);if(t===void 0&&r&&(t=!0),n==="data"){e=n.length?e.slice(n.length+1):e;const i=Jg.exec(e);if(!i)throw new D("Invalid URL",D.ERR_INVALID_URL);const s=i[1],o=i[2],c=i[3],l=Buffer.from(decodeURIComponent(c),o?"base64":"utf8");if(t){if(!r)throw new D("Blob is not supported",D.ERR_NOT_SUPPORT);return new r([l],{type:s})}return l}throw new D("Unsupported protocol "+n,D.ERR_NOT_SUPPORT)}const Cu=Symbol("internals");class zd extends at.Transform{constructor(t){t=A.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(r,n)=>!A.isUndefined(n[r])),super({readableHighWaterMark:t.chunkSize});const a=this[Cu]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",r=>{r==="progress"&&(a.isCaptured||(a.isCaptured=!0))})}_read(t){const a=this[Cu];return a.onReadCallback&&a.onReadCallback(),super._read(t)}_transform(t,a,r){const n=this[Cu],i=n.maxRate,s=this.readableHighWaterMark,o=n.timeWindow,c=1e3/o,l=i/c,u=n.minChunkSize!==!1?Math.max(n.minChunkSize,l*.01):0,p=(g,h)=>{const y=Buffer.byteLength(g);n.bytesSeen+=y,n.bytes+=y,n.isCaptured&&this.emit("progress",n.bytesSeen),this.push(g)?process.nextTick(h):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(h)}},d=(g,h)=>{const y=Buffer.byteLength(g);let b=null,E=s,I,R=0;if(i){const k=Date.now();(!n.ts||(R=k-n.ts)>=o)&&(n.ts=k,I=l-n.bytes,n.bytes=I<0?-I:0,R=0),I=l-n.bytes}if(i){if(I<=0)return setTimeout(()=>{h(null,g)},o-R);I<E&&(E=I)}E&&y>E&&y-E>u&&(b=g.subarray(E),g=g.subarray(0,E)),p(g,b?()=>{process.nextTick(h,null,b)}:h)};d(t,function g(h,y){if(h)return r(h);y?d(y,g):r(null)})}}const{asyncIterator:Hd}=Symbol,$d=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Hd]?yield*e[Hd]():yield e},ex=Ye.ALPHABET.ALPHA_DIGIT+"-_",ga=typeof TextEncoder=="function"?new TextEncoder:new gr.TextEncoder,Tr=`\r
|
|
19
|
-
`,tx=ga.encode(Tr),rx=2;class ax{constructor(t,a){const{escapeName:r}=this.constructor,n=A.isString(a);let i=`Content-Disposition: form-data; name="${r(t)}"${!n&&a.name?`; filename="${r(a.name)}"`:""}${Tr}`;if(n)a=ga.encode(String(a).replace(/\r?\n|\r\n?/g,Tr));else{const s=String(a.type||"application/octet-stream").replace(/[\r\n]/g,"");i+=`Content-Type: ${s}${Tr}`}this.headers=ga.encode(i+Tr),this.contentLength=n?a.byteLength:a.size,this.size=this.headers.byteLength+this.contentLength+rx,this.name=t,this.value=a}async*encode(){yield this.headers;const{value:t}=this;A.isTypedArray(t)?yield t:yield*$d(t),yield tx}static escapeName(t){return String(t).replace(/[\r\n"]/g,a=>({"\r":"%0D","\n":"%0A",'"':"%22"})[a])}}const nx=(e,t,a)=>{const{tag:r="form-data-boundary",size:n=25,boundary:i=r+"-"+Ye.generateString(n,ex)}=a||{};if(!A.isFormData(e))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");const s=ga.encode("--"+i+Tr),o=ga.encode("--"+i+"--"+Tr);let c=o.byteLength;const l=Array.from(e.entries()).map(([p,d])=>{const g=new ax(p,d);return c+=g.size,g});c+=s.byteLength*l.length,c=A.toFiniteNumber(c);const u={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(c)&&(u["Content-Length"]=c),t&&t(u),at.Readable.from((async function*(){for(const p of l)yield s,yield*p.encode();yield o})())};class sx extends at.Transform{__transform(t,a,r){this.push(t),r()}_transform(t,a,r){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){const n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,a)}this.__transform(t,a,r)}}const ix=(e,t)=>A.isAsyncFn(e)?function(...a){const r=a.pop();e.apply(this,a).then(n=>{try{t?r(null,...t(n)):r(null,n)}catch(i){r(i)}},r)}:e,ox=new Set(["localhost"]),Gd=e=>{const t=e.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(a=>/^\d+$/.test(a)&&Number(a)>=0&&Number(a)<=255)},cx=e=>{if(e==="::1")return!0;const t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return Gd(t[1]);const a=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(a){const n=parseInt(a[1],16);return n>=32512&&n<=32767}const r=e.split(":");if(r.length===8){for(let n=0;n<7;n++)if(!/^0+$/.test(r[n]))return!1;return/^0*1$/.test(r[7])}return!1},Wd=e=>e?ox.has(e)||Gd(e)?!0:cx(e):!1,lx={http:80,https:443,ws:80,wss:443,ftp:21},ux=e=>{let t=e,a=0;if(t.charAt(0)==="["){const i=t.indexOf("]");if(i!==-1){const s=t.slice(1,i),o=t.slice(i+1);return o.charAt(0)===":"&&/^\d+$/.test(o.slice(1))&&(a=Number.parseInt(o.slice(1),10)),[s,a]}}const r=t.indexOf(":"),n=t.lastIndexOf(":");return r!==-1&&r===n&&/^\d+$/.test(t.slice(n+1))&&(a=Number.parseInt(t.slice(n+1),10),t=t.slice(0,n)),[t,a]},Xd=e=>e&&(e.charAt(0)==="["&&e.charAt(e.length-1)==="]"&&(e=e.slice(1,-1)),e.replace(/\.+$/,""));function px(e){let t;try{t=new URL(e)}catch{return!1}const a=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!a)return!1;if(a==="*")return!0;const r=Number.parseInt(t.port,10)||lx[t.protocol.split(":",1)[0]]||0,n=Xd(t.hostname.toLowerCase());return a.split(/[\s,]+/).some(i=>{if(!i)return!1;let[s,o]=ux(i);return s=Xd(s),!s||o&&o!==r?!1:(s.charAt(0)==="*"&&(s=s.slice(1)),s.charAt(0)==="."?n.endsWith(s):n===s||Wd(n)&&Wd(s))})}function dx(e,t){e=e||10;const a=new Array(e),r=new Array(e);let n=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[i];s||(s=l),a[n]=c,r[n]=l;let p=i,d=0;for(;p!==n;)d+=a[p++],p=p%e;if(n=(n+1)%e,n===i&&(i=(i+1)%e),l-s<t)return;const g=u&&l-u;return g?Math.round(d*1e3/g):void 0}}function fx(e,t){let a=0,r=1e3/t,n,i;const s=(l,u=Date.now())=>{a=u,n=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),p=u-a;p>=r?s(l,u):(n=l,i||(i=setTimeout(()=>{i=null,s(n)},r-p)))},()=>n&&s(n)]}const Hr=(e,t,a=3)=>{let r=0;const n=dx(50,250);return fx(i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,c=o!=null?Math.min(s,o):s,l=Math.max(0,c-r),u=n(l);r=Math.max(r,c);const p={loaded:c,total:o,progress:o?c/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o?(o-c)/u:void 0,event:i,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(p)},a)},zc=(e,t)=>{const a=e!=null;return[r=>t[0]({lengthComputable:a,total:e,loaded:r}),t[1]]},Hc=e=>(...t)=>A.asap(()=>e(...t));function hx(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const a=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(a)){let i=r.length;const s=r.length;for(let d=0;d<s;d++)if(r.charCodeAt(d)===37&&d+2<s){const g=r.charCodeAt(d+1),h=r.charCodeAt(d+2);(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(i-=2,d+=2)}let o=0,c=s-1;const l=d=>d>=2&&r.charCodeAt(d-2)===37&&r.charCodeAt(d-1)===51&&(r.charCodeAt(d)===68||r.charCodeAt(d)===100);c>=0&&(r.charCodeAt(c)===61?(o++,c--):l(c)&&(o++,c-=3)),o===1&&c>=0&&(r.charCodeAt(c)===61||l(c))&&o++;const p=Math.floor(i/4)*3-(o||0);return p>0?p:0}return Buffer.byteLength(r,"utf8")}const Qd={flush:ar.constants.Z_SYNC_FLUSH,finishFlush:ar.constants.Z_SYNC_FLUSH},mx={flush:ar.constants.BROTLI_OPERATION_FLUSH,finishFlush:ar.constants.BROTLI_OPERATION_FLUSH},Yd=A.isFunction(ar.createBrotliDecompress),{http:vx,https:gx}=Yg,xx=/https:?/,Jd=Symbol("axios.http.socketListener"),$c=Symbol("axios.http.currentReq"),Zd=Ye.protocols.map(e=>e+":"),ef=(e,[t,a])=>(e.on("end",a).on("error",a),t);class yx{constructor(){this.sessions=Object.create(null)}getSession(t,a){a=Object.assign({sessionTimeout:1e3},a);let r=this.sessions[t];if(r){let u=r.length;for(let p=0;p<u;p++){const[d,g]=r[p];if(!d.destroyed&&!d.closed&&gr.isDeepStrictEqual(g,a))return d}}const n=Ep.connect(t,a);let i;const s=()=>{if(i)return;i=!0;let u=r,p=u.length,d=p;for(;d--;)if(u[d][0]===n){p===1?delete this.sessions[t]:u.splice(d,1),n.closed||n.close();return}},o=n.request,{sessionTimeout:c}=a;if(c!=null){let u,p=0;n.request=function(){const d=o.apply(this,arguments);return p++,u&&(clearTimeout(u),u=null),d.once("close",()=>{--p||(u=setTimeout(()=>{u=null,s()},c))}),d}}n.once("close",s);let l=[n,a];return r?r.push(l):r=this.sessions[t]=[l],n}}const bx=new yx;function Ex(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function tf(e,t,a){let r=t;if(!r&&r!==!1){const n=kg(a);n&&(px(a)||(r=new URL(n)))}if(r){if(r.username&&(r.auth=(r.username||"")+":"+(r.password||"")),r.auth){if(!!(r.auth.username||r.auth.password))r.auth=(r.auth.username||"")+":"+(r.auth.password||"");else if(typeof r.auth=="object")throw new D("Invalid proxy authorization",D.ERR_BAD_OPTION,{proxy:r});const s=Buffer.from(r.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+s}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=r.hostname||r.host;e.hostname=n,e.host=n,e.port=r.port,e.path=a,r.protocol&&(e.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`)}e.beforeRedirects.proxy=function(i){tf(i,t,i.href)}}const Cx=typeof process<"u"&&A.kindOf(process)==="process",Tx=e=>new Promise((t,a)=>{let r,n;const i=(c,l)=>{n||(n=!0,r&&r(c,l))},s=c=>{i(c),t(c)},o=c=>{i(c,!0),a(c)};e(s,o,c=>r=c).catch(o)}),Sx=({address:e,family:t})=>{if(!A.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},rf=(e,t)=>Sx(A.isObject(e)?e:{address:e,family:t}),wx={request(e,t){const a=e.protocol+"//"+e.hostname+":"+(e.port||(e.protocol==="https:"?443:80)),{http2Options:r,headers:n}=e,i=bx.getSession(a,r),{HTTP2_HEADER_SCHEME:s,HTTP2_HEADER_METHOD:o,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:l}=Ep.constants,u={[s]:e.protocol.replace(":",""),[o]:e.method,[c]:e.path};A.forEach(n,(d,g)=>{g.charAt(0)!==":"&&(u[g]=d)});const p=i.request(u);return p.once("response",d=>{const g=p;d=Object.assign({},d);const h=d[l];delete d[l],g.headers=d,g.statusCode=+h,t(g)}),p}};var Ax=Cx&&function(t){return Tx(async function(r,n,i){const s=j=>A.hasOwnProp(t,j)?t[j]:void 0;let o=s("data"),c=s("lookup"),l=s("family"),u=s("httpVersion");u===void 0&&(u=1);let p=s("http2Options");const d=s("responseType"),g=s("responseEncoding"),h=t.method.toUpperCase();let y,b=!1,E;if(u=+u,Number.isNaN(u))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(u!==1&&u!==2)throw TypeError(`Unsupported protocol version '${u}'`);const I=u===2;if(c){const j=ix(c,V=>A.isArray(V)?V:[V]);c=(V,ee,ce)=>{j(V,ee,(se,Ne,De)=>{if(se)return ce(se);const pe=A.isArray(Ne)?Ne.map($e=>rf($e)):[rf(Ne,De)];ee.all?ce(se,pe):ce(se,pe[0].address,pe[0].family)})}}const R=new ph.EventEmitter;function k(j){try{R.emit("abort",!j||j.type?new br(null,t,E):j)}catch(V){console.warn("emit error",V)}}R.once("abort",n);const U=()=>{t.cancelToken&&t.cancelToken.unsubscribe(k),t.signal&&t.signal.removeEventListener("abort",k),R.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(k),t.signal&&(t.signal.aborted?k():t.signal.addEventListener("abort",k))),i((j,V)=>{if(y=!0,V){b=!0,U();return}const{data:ee}=j;if(ee instanceof at.Readable||ee instanceof at.Duplex){const ce=at.finished(ee,()=>{ce(),U()})}else U()});const L=nu(t.baseURL,t.url,t.allowAbsoluteUrls),q=new URL(L,Ye.hasBrowserEnv?Ye.origin:void 0),H=q.protocol||Zd[0];if(H==="data:"){if(t.maxContentLength>-1){const V=String(t.url||L||"");if(hx(V)>t.maxContentLength)return n(new D("maxContentLength size of "+t.maxContentLength+" exceeded",D.ERR_BAD_RESPONSE,t))}let j;if(h!=="GET")return zr(r,n,{status:405,statusText:"method not allowed",headers:{},config:t});try{j=Zg(t.url,d==="blob",{Blob:t.env&&t.env.Blob})}catch(V){throw D.from(V,D.ERR_BAD_REQUEST,t)}return d==="text"?(j=j.toString(g),(!g||g==="utf8")&&(j=A.stripBOM(j))):d==="stream"&&(j=at.Readable.from(j)),zr(r,n,{data:j,status:200,statusText:"OK",headers:new lt,config:t})}if(Zd.indexOf(H)===-1)return n(new D("Unsupported protocol "+H,D.ERR_BAD_REQUEST,t));const Y=lt.from(t.headers).normalize();Y.set("User-Agent","axios/"+Kc,!1);const{onUploadProgress:ve,onDownloadProgress:Ae}=t,ke=t.maxRate;let Ke,Ve;if(A.isSpecCompliantForm(o)){const j=Y.getContentType(/boundary=([-_\w\d]{10,70})/i);o=nx(o,V=>{Y.set(V)},{tag:`axios-${Kc}-boundary`,boundary:j&&j[1]||void 0})}else if(A.isFormData(o)&&A.isFunction(o.getHeaders)&&o.getHeaders!==Object.prototype.getHeaders){if(Y.set(o.getHeaders()),!Y.hasContentLength())try{const j=await gr.promisify(o.getLength).call(o);Number.isFinite(j)&&j>=0&&Y.setContentLength(j)}catch{}}else if(A.isBlob(o)||A.isFile(o))o.size&&Y.setContentType(o.type||"application/octet-stream"),Y.setContentLength(o.size||0),o=at.Readable.from($d(o));else if(o&&!A.isStream(o)){if(!Buffer.isBuffer(o))if(A.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(A.isString(o))o=Buffer.from(o,"utf-8");else return n(new D("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",D.ERR_BAD_REQUEST,t));if(Y.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return n(new D("Request body larger than maxBodyLength limit",D.ERR_BAD_REQUEST,t))}const Ue=A.toFiniteNumber(Y.getContentLength());A.isArray(ke)?(Ke=ke[0],Ve=ke[1]):Ke=Ve=ke,o&&(ve||Ke)&&(A.isStream(o)||(o=at.Readable.from(o,{objectMode:!1})),o=at.pipeline([o,new zd({maxRate:A.toFiniteNumber(Ke)})],A.noop),ve&&o.on("progress",ef(o,zc(Ue,Hr(Hc(ve),!1,3)))));let ie;const G=s("auth");if(G){const j=G.username||"",V=G.password||"";ie=j+":"+V}if(!ie&&q.username){const j=q.username,V=q.password;ie=j+":"+V}ie&&Y.delete("authorization");let tt;try{tt=Jl(q.pathname+q.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(j){const V=new Error(j.message);return V.config=t,V.url=t.url,V.exists=!0,n(V)}Y.set("Accept-Encoding","gzip, compress, deflate"+(Yd?", br":""),!1);const ze=Object.assign(Object.create(null),{path:tt,method:h,headers:Y.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:ie,protocol:H,family:l,beforeRedirect:Ex,beforeRedirects:Object.create(null),http2Options:p});if(!A.isUndefined(c)&&(ze.lookup=c),t.socketPath){if(typeof t.socketPath!="string")return n(new D("socketPath must be a string",D.ERR_BAD_OPTION_VALUE,t));if(t.allowedSocketPaths!=null){const j=Array.isArray(t.allowedSocketPaths)?t.allowedSocketPaths:[t.allowedSocketPaths],V=Sc.resolve(t.socketPath);if(!j.some(ce=>typeof ce=="string"&&Sc.resolve(ce)===V))return n(new D(`socketPath "${t.socketPath}" is not permitted by allowedSocketPaths`,D.ERR_BAD_OPTION_VALUE,t))}ze.socketPath=t.socketPath}else ze.hostname=q.hostname.startsWith("[")?q.hostname.slice(1,-1):q.hostname,ze.port=q.port,tf(ze,t.proxy,H+"//"+q.hostname+(q.port?":"+q.port:"")+ze.path);let Pe;const ue=xx.test(ze.protocol);if(ze.agent=ue?t.httpsAgent:t.httpAgent,I)Pe=wx;else{const j=s("transport");if(j)Pe=j;else if(t.maxRedirects===0)Pe=ue?wl:Sl;else{t.maxRedirects&&(ze.maxRedirects=t.maxRedirects);const V=s("beforeRedirect");V&&(ze.beforeRedirects.config=V),Pe=ue?gx:vx}}if(t.maxBodyLength>-1?ze.maxBodyLength=t.maxBodyLength:ze.maxBodyLength=1/0,ze.insecureHTTPParser=!!s("insecureHTTPParser"),E=Pe.request(ze,function(V){if(E.destroyed)return;const ee=[V],ce=A.toFiniteNumber(V.headers["content-length"]);if(Ae||Ve){const pe=new zd({maxRate:A.toFiniteNumber(Ve)});Ae&&pe.on("progress",ef(pe,zc(ce,Hr(Hc(Ae),!0,3)))),ee.push(pe)}let se=V;const Ne=V.req||E;if(t.decompress!==!1&&V.headers["content-encoding"])switch((h==="HEAD"||V.statusCode===204)&&delete V.headers["content-encoding"],(V.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":ee.push(ar.createUnzip(Qd)),delete V.headers["content-encoding"];break;case"deflate":ee.push(new sx),ee.push(ar.createUnzip(Qd)),delete V.headers["content-encoding"];break;case"br":Yd&&(ee.push(ar.createBrotliDecompress(mx)),delete V.headers["content-encoding"])}se=ee.length>1?at.pipeline(ee,A.noop):ee[0];const De={status:V.statusCode,statusText:V.statusMessage,headers:new lt(V.headers),config:t,request:Ne};if(d==="stream"){if(t.maxContentLength>-1){const pe=t.maxContentLength,$e=se;async function*Xe(){let we=0;for await(const rt of $e){if(we+=rt.length,we>pe)throw new D("maxContentLength size of "+pe+" exceeded",D.ERR_BAD_RESPONSE,t,Ne);yield rt}}se=at.Readable.from(Xe(),{objectMode:!1})}De.data=se,zr(r,n,De)}else{const pe=[];let $e=0;se.on("data",function(we){pe.push(we),$e+=we.length,t.maxContentLength>-1&&$e>t.maxContentLength&&(b=!0,se.destroy(),k(new D("maxContentLength size of "+t.maxContentLength+" exceeded",D.ERR_BAD_RESPONSE,t,Ne)))}),se.on("aborted",function(){if(b)return;const we=new D("stream has been aborted",D.ERR_BAD_RESPONSE,t,Ne);se.destroy(we),n(we)}),se.on("error",function(we){E.destroyed||n(D.from(we,null,t,Ne))}),se.on("end",function(){try{let we=pe.length===1?pe[0]:Buffer.concat(pe);d!=="arraybuffer"&&(we=we.toString(g),(!g||g==="utf8")&&(we=A.stripBOM(we))),De.data=we}catch(we){return n(D.from(we,null,t,De.request,De))}zr(r,n,De)})}R.once("abort",pe=>{se.destroyed||(se.emit("error",pe),se.destroy())})}),R.once("abort",j=>{E.close?E.close():E.destroy(j)}),E.on("error",function(V){n(D.from(V,null,t,E))}),E.on("socket",function(V){V.setKeepAlive(!0,1e3*60),V[Jd]||(V.on("error",function(ce){const se=V[$c];se&&!se.destroyed&&se.destroy(ce)}),V[Jd]=!0),V[$c]=E,E.once("close",function(){V[$c]===E&&(V[$c]=null)})}),t.timeout){const j=parseInt(t.timeout,10);if(Number.isNaN(j)){k(new D("error trying to parse `config.timeout` to int",D.ERR_BAD_OPTION_VALUE,t,E));return}E.setTimeout(j,function(){if(y)return;let ee=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const ce=t.transitional||Fc;t.timeoutErrorMessage&&(ee=t.timeoutErrorMessage),k(new D(ee,ce.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,t,E))})}else E.setTimeout(0);if(A.isStream(o)){let j=!1,V=!1;o.on("end",()=>{j=!0}),o.once("error",ce=>{V=!0,E.destroy(ce)}),o.on("close",()=>{!j&&!V&&k(new br("Request stream has been aborted",t,E))});let ee=o;if(t.maxBodyLength>-1&&t.maxRedirects===0){const ce=t.maxBodyLength;let se=0;ee=at.pipeline([o,new at.Transform({transform(Ne,De,pe){if(se+=Ne.length,se>ce)return pe(new D("Request body larger than maxBodyLength limit",D.ERR_BAD_REQUEST,t,E));pe(null,Ne)}})],A.noop),ee.on("error",Ne=>{E.destroyed||E.destroy(Ne)})}ee.pipe(E)}else o&&E.write(o),E.end()})},Ix=Ye.hasStandardBrowserEnv?((e,t)=>a=>(a=new URL(a,Ye.origin),e.protocol===a.protocol&&e.host===a.host&&(t||e.port===a.port)))(new URL(Ye.origin),Ye.navigator&&/(msie|trident)/i.test(Ye.navigator.userAgent)):()=>!0,Bx=Ye.hasStandardBrowserEnv?{write(e,t,a,r,n,i,s){if(typeof document>"u")return;const o=[`${e}=${encodeURIComponent(t)}`];A.isNumber(a)&&o.push(`expires=${new Date(a).toUTCString()}`),A.isString(r)&&o.push(`path=${r}`),A.isString(n)&&o.push(`domain=${n}`),i===!0&&o.push("secure"),A.isString(s)&&o.push(`SameSite=${s}`),document.cookie=o.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};const af=e=>e instanceof lt?{...e}:e;function Sr(e,t){t=t||{};const a=Object.create(null);Object.defineProperty(a,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(l,u,p,d){return A.isPlainObject(l)&&A.isPlainObject(u)?A.merge.call({caseless:d},l,u):A.isPlainObject(u)?A.merge({},u):A.isArray(u)?u.slice():u}function n(l,u,p,d){if(A.isUndefined(u)){if(!A.isUndefined(l))return r(void 0,l,p,d)}else return r(l,u,p,d)}function i(l,u){if(!A.isUndefined(u))return r(void 0,u)}function s(l,u){if(A.isUndefined(u)){if(!A.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function o(l,u,p){if(A.hasOwnProp(t,p))return r(l,u);if(A.hasOwnProp(e,p))return r(void 0,l)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:o,headers:(l,u,p)=>n(af(l),af(u),p,!0)};return A.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const p=A.hasOwnProp(c,u)?c[u]:n,d=A.hasOwnProp(e,u)?e[u]:void 0,g=A.hasOwnProp(t,u)?t[u]:void 0,h=p(d,g,u);A.isUndefined(h)&&p!==o||(a[u]=h)}),a}var nf=e=>{const t=Sr({},e),a=d=>A.hasOwnProp(t,d)?t[d]:void 0,r=a("data");let n=a("withXSRFToken");const i=a("xsrfHeaderName"),s=a("xsrfCookieName");let o=a("headers");const c=a("auth"),l=a("baseURL"),u=a("allowAbsoluteUrls"),p=a("url");if(t.headers=o=lt.from(o),t.url=Jl(nu(l,p,u),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),A.isFormData(r)){if(Ye.hasStandardBrowserEnv||Ye.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(A.isFunction(r.getHeaders)){const d=r.getHeaders(),g=["content-type","content-length"];Object.entries(d).forEach(([h,y])=>{g.includes(h.toLowerCase())&&o.set(h,y)})}}if(Ye.hasStandardBrowserEnv&&(A.isFunction(n)&&(n=n(t)),n===!0||n==null&&Ix(t.url))){const g=i&&s&&Bx.read(s);g&&o.set(i,g)}return t};const Rx=typeof XMLHttpRequest<"u";var kx=Rx&&function(e){return new Promise(function(a,r){const n=nf(e);let i=n.data;const s=lt.from(n.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:l}=n,u,p,d,g,h;function y(){g&&g(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(n.method.toUpperCase(),n.url,!0),b.timeout=n.timeout;function E(){if(!b)return;const R=lt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),U={data:!o||o==="text"||o==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:R,config:e,request:b};zr(function(q){a(q),y()},function(q){r(q),y()},U),b=null}"onloadend"in b?b.onloadend=E:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(E)},b.onabort=function(){b&&(r(new D("Request aborted",D.ECONNABORTED,e,b)),b=null)},b.onerror=function(k){const U=k&&k.message?k.message:"Network Error",L=new D(U,D.ERR_NETWORK,e,b);L.event=k||null,r(L),b=null},b.ontimeout=function(){let k=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const U=n.transitional||Fc;n.timeoutErrorMessage&&(k=n.timeoutErrorMessage),r(new D(k,U.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,e,b)),b=null},i===void 0&&s.setContentType(null),"setRequestHeader"in b&&A.forEach(s.toJSON(),function(k,U){b.setRequestHeader(U,k)}),A.isUndefined(n.withCredentials)||(b.withCredentials=!!n.withCredentials),o&&o!=="json"&&(b.responseType=n.responseType),l&&([d,h]=Hr(l,!0),b.addEventListener("progress",d)),c&&b.upload&&([p,g]=Hr(c),b.upload.addEventListener("progress",p),b.upload.addEventListener("loadend",g)),(n.cancelToken||n.signal)&&(u=R=>{b&&(r(!R||R.type?new br(null,e,b):R),b.abort(),b=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const I=Kd(n.url);if(I&&Ye.protocols.indexOf(I)===-1){r(new D("Unsupported protocol "+I+":",D.ERR_BAD_REQUEST,e));return}b.send(i||null)})};const _x=(e,t)=>{const{length:a}=e=e?e.filter(Boolean):[];if(t||a){let r=new AbortController,n;const i=function(l){if(!n){n=!0,o();const u=l instanceof Error?l:this.reason;r.abort(u instanceof D?u:new br(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new D(`timeout of ${t}ms exceeded`,D.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>A.asap(o),c}},Ux=function*(e,t){let a=e.byteLength;if(!t||a<t){yield e;return}let r=0,n;for(;r<a;)n=r+t,yield e.slice(r,n),r=n},Nx=async function*(e,t){for await(const a of Lx(e))yield*Ux(a,t)},Lx=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:a,value:r}=await t.read();if(a)break;yield r}}finally{await t.cancel()}},sf=(e,t,a,r)=>{const n=Nx(e,t);let i=0,s,o=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await n.next();if(l){o(),c.close();return}let p=u.byteLength;if(a){let d=i+=p;a(d)}c.enqueue(new Uint8Array(u))}catch(l){throw o(l),l}},cancel(c){return o(c),n.return()}},{highWaterMark:2})},of=64*1024,{isFunction:Gc}=A,Px=(({Request:e,Response:t})=>({Request:e,Response:t}))(A.global),{ReadableStream:cf,TextEncoder:lf}=A.global,uf=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ox=e=>{e=A.merge.call({skipUndefined:!0},Px,e);const{fetch:t,Request:a,Response:r}=e,n=t?Gc(t):typeof fetch=="function",i=Gc(a),s=Gc(r);if(!n)return!1;const o=n&&Gc(cf),c=n&&(typeof lf=="function"?(h=>y=>h.encode(y))(new lf):async h=>new Uint8Array(await new a(h).arrayBuffer())),l=i&&o&&uf(()=>{let h=!1;const y=new a(Ye.origin,{body:new cf,method:"POST",get duplex(){return h=!0,"half"}}),b=y.headers.has("Content-Type");return y.body!=null&&y.body.cancel(),h&&!b}),u=s&&o&&uf(()=>A.isReadableStream(new r("").body)),p={stream:u&&(h=>h.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!p[h]&&(p[h]=(y,b)=>{let E=y&&y[h];if(E)return E.call(y);throw new D(`Response type '${h}' is not supported`,D.ERR_NOT_SUPPORT,b)})});const d=async h=>{if(h==null)return 0;if(A.isBlob(h))return h.size;if(A.isSpecCompliantForm(h))return(await new a(Ye.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(A.isArrayBufferView(h)||A.isArrayBuffer(h))return h.byteLength;if(A.isURLSearchParams(h)&&(h=h+""),A.isString(h))return(await c(h)).byteLength},g=async(h,y)=>{const b=A.toFiniteNumber(h.getContentLength());return b??d(y)};return async h=>{let{url:y,method:b,data:E,signal:I,cancelToken:R,timeout:k,onDownloadProgress:U,onUploadProgress:L,responseType:q,headers:H,withCredentials:Y="same-origin",fetchOptions:ve}=nf(h),Ae=t||fetch;q=q?(q+"").toLowerCase():"text";let ke=_x([I,R&&R.toAbortSignal()],k),Ke=null;const Ve=ke&&ke.unsubscribe&&(()=>{ke.unsubscribe()});let Ue;try{if(L&&l&&b!=="get"&&b!=="head"&&(Ue=await g(H,E))!==0){let ue=new a(y,{method:"POST",body:E,duplex:"half"}),j;if(A.isFormData(E)&&(j=ue.headers.get("content-type"))&&H.setContentType(j),ue.body){const[V,ee]=zc(Ue,Hr(Hc(L)));E=sf(ue.body,of,V,ee)}}A.isString(Y)||(Y=Y?"include":"omit");const ie=i&&"credentials"in a.prototype;if(A.isFormData(E)){const ue=H.getContentType();ue&&/^multipart\/form-data/i.test(ue)&&!/boundary=/i.test(ue)&&H.delete("content-type")}const G={...ve,signal:ke,method:b.toUpperCase(),headers:H.normalize().toJSON(),body:E,duplex:"half",credentials:ie?Y:void 0};Ke=i&&new a(y,G);let tt=await(i?Ae(Ke,ve):Ae(y,G));const ze=u&&(q==="stream"||q==="response");if(u&&(U||ze&&Ve)){const ue={};["status","statusText","headers"].forEach(ce=>{ue[ce]=tt[ce]});const j=A.toFiniteNumber(tt.headers.get("content-length")),[V,ee]=U&&zc(j,Hr(Hc(U),!0))||[];tt=new r(sf(tt.body,of,V,()=>{ee&&ee(),Ve&&Ve()}),ue)}q=q||"text";let Pe=await p[A.findKey(p,q)||"text"](tt,h);return!ze&&Ve&&Ve(),await new Promise((ue,j)=>{zr(ue,j,{data:Pe,headers:lt.from(tt.headers),status:tt.status,statusText:tt.statusText,config:h,request:Ke})})}catch(ie){throw Ve&&Ve(),ie&&ie.name==="TypeError"&&/Load failed|fetch/i.test(ie.message)?Object.assign(new D("Network Error",D.ERR_NETWORK,h,Ke,ie&&ie.response),{cause:ie.cause||ie}):D.from(ie,ie&&ie.code,h,Ke,ie&&ie.response)}}},Dx=new Map,pf=e=>{let t=e&&e.env||{};const{fetch:a,Request:r,Response:n}=t,i=[r,n,a];let s=i.length,o=s,c,l,u=Dx;for(;o--;)c=i[o],l=u.get(c),l===void 0&&u.set(c,l=o?new Map:Ox(t)),u=l;return l};pf();const Tu={http:Ax,xhr:kx,fetch:{get:pf}};A.forEach(Tu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const df=e=>`- ${e}`,Fx=e=>A.isFunction(e)||e===null||e===!1;function qx(e,t){e=A.isArray(e)?e:[e];const{length:a}=e;let r,n;const i={};for(let s=0;s<a;s++){r=e[s];let o;if(n=r,!Fx(r)&&(n=Tu[(o=String(r)).toLowerCase()],n===void 0))throw new D(`Unknown adapter '${o}'`);if(n&&(A.isFunction(n)||(n=n.get(t))))break;i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=a?s.length>1?`since :
|
|
20
|
-
`+s.map(df).join(`
|
|
21
|
-
`):" "+df(s[0]):"as no adapter specified";throw new D("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n}var ff={getAdapter:qx,adapters:Tu};function Su(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new br(null,e)}function hf(e){return Su(e),e.headers=lt.from(e.headers),e.data=au.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ff.getAdapter(e.adapter||pa.adapter,e)(e).then(function(r){return Su(e),r.data=au.call(e,e.transformResponse,r),r.headers=lt.from(r.headers),r},function(r){return kd(r)||(Su(e),r&&r.response&&(r.response.data=au.call(e,e.transformResponse,r.response),r.response.headers=lt.from(r.response.headers))),Promise.reject(r)})}const Wc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const mf={};Wc.transitional=function(t,a,r){function n(i,s){return"[Axios v"+Kc+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,o)=>{if(t===!1)throw new D(n(s," has been removed"+(a?" in "+a:"")),D.ERR_DEPRECATED);return a&&!mf[s]&&(mf[s]=!0,console.warn(n(s," has been deprecated since v"+a+" and will be removed in the near future"))),t?t(i,s,o):!0}},Wc.spelling=function(t){return(a,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Vx(e,t,a){if(typeof e!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let n=r.length;for(;n-- >0;){const i=r[n],s=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(s){const o=e[i],c=o===void 0||s(o,i,e);if(c!==!0)throw new D("option "+i+" must be "+c,D.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}}var Xc={assertOptions:Vx,validators:Wc};const Nt=Xc.validators;let wr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new wd,response:new wd}}async request(t,a){try{return await this._request(t,a)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const i=(()=>{if(!n.stack)return"";const s=n.stack.indexOf(`
|
|
22
|
-
`);return s===-1?"":n.stack.slice(s+1)})();try{if(!r.stack)r.stack=i;else if(i){const s=i.indexOf(`
|
|
23
|
-
`),o=s===-1?-1:i.indexOf(`
|
|
24
|
-
`,s+1),c=o===-1?"":i.slice(o+1);String(r.stack).endsWith(c)||(r.stack+=`
|
|
25
|
-
`+i)}}catch{}}throw r}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=Sr(this.defaults,a);const{transitional:r,paramsSerializer:n,headers:i}=a;r!==void 0&&Xc.assertOptions(r,{silentJSONParsing:Nt.transitional(Nt.boolean),forcedJSONParsing:Nt.transitional(Nt.boolean),clarifyTimeoutError:Nt.transitional(Nt.boolean),legacyInterceptorReqResOrdering:Nt.transitional(Nt.boolean)},!1),n!=null&&(A.isFunction(n)?a.paramsSerializer={serialize:n}:Xc.assertOptions(n,{encode:Nt.function,serialize:Nt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),Xc.assertOptions(a,{baseUrl:Nt.spelling("baseURL"),withXsrfToken:Nt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=i&&A.merge(i.common,i[a.method]);i&&A.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),a.headers=lt.concat(s,i);const o=[];let c=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(a)===!1)return;c=c&&y.synchronous;const b=a.transitional||Fc;b&&b.legacyInterceptorReqResOrdering?o.unshift(y.fulfilled,y.rejected):o.push(y.fulfilled,y.rejected)});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,p=0,d;if(!c){const h=[hf.bind(this),void 0];for(h.unshift(...o),h.push(...l),d=h.length,u=Promise.resolve(a);p<d;)u=u.then(h[p++],h[p++]);return u}d=o.length;let g=a;for(;p<d;){const h=o[p++],y=o[p++];try{g=h(g)}catch(b){y.call(this,b);break}}try{u=hf.call(this,g)}catch(h){return Promise.reject(h)}for(p=0,d=l.length;p<d;)u=u.then(l[p++],l[p++]);return u}getUri(t){t=Sr(this.defaults,t);const a=nu(t.baseURL,t.url,t.allowAbsoluteUrls);return Jl(a,t.params,t.paramsSerializer)}};A.forEach(["delete","get","head","options"],function(t){wr.prototype[t]=function(a,r){return this.request(Sr(r||{},{method:t,url:a,data:(r||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function a(r){return function(i,s,o){return this.request(Sr(o||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}wr.prototype[t]=a(),wr.prototype[t+"Form"]=a(!0)});let Mx=class oh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const r=this;this.promise.then(n=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i;const s=new Promise(o=>{r.subscribe(o),i=o}).then(n);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,o){r.reason||(r.reason=new br(i,s,o),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=r=>{t.abort(r)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new oh(function(n){t=n}),cancel:t}}};function jx(e){return function(a){return e.apply(null,a)}}function Kx(e){return A.isObject(e)&&e.isAxiosError===!0}const wu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(wu).forEach(([e,t])=>{wu[t]=e});function vf(e){const t=new wr(e),a=Tp(wr.prototype.request,t);return A.extend(a,wr.prototype,t,{allOwnKeys:!0}),A.extend(a,t,null,{allOwnKeys:!0}),a.create=function(n){return vf(Sr(e,n))},a}const Ze=vf(pa);Ze.Axios=wr,Ze.CanceledError=br,Ze.CancelToken=Mx,Ze.isCancel=kd,Ze.VERSION=Kc,Ze.toFormData=Dc,Ze.AxiosError=D,Ze.Cancel=Ze.CanceledError,Ze.all=function(t){return Promise.all(t)},Ze.spread=jx,Ze.isAxiosError=Kx,Ze.mergeConfig=Sr,Ze.AxiosHeaders=lt,Ze.formToJSON=e=>Bd(A.isHTMLForm(e)?new FormData(e):e),Ze.getAdapter=ff.getAdapter,Ze.HttpStatusCode=wu,Ze.default=Ze;var J=Ze;const{Axios:U2,AxiosError:N2,CanceledError:L2,isCancel:P2,CancelToken:O2,VERSION:D2,all:F2,Cancel:q2,isAxiosError:re,spread:V2,toFormData:M2,AxiosHeaders:j2,HttpStatusCode:K2,formToJSON:z2,getAdapter:H2,mergeConfig:$2}=J,mt="https://api.circle.com".replace(/\/+$/,"");let zx=class extends Error{constructor(t,a){super(a),this.field=t,this.name="RequiredError"}};const vt={},gt="https://example.com",zt=function(e,t,a){if(a==null)throw new zx(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},It=async function(e,t){if(t&&t.accessToken){const a=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+a}};function Au(e,t,a=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>Au(e,r,a)):Object.keys(t).forEach(r=>Au(e,t[r],`${a}${a!==""?".":""}${r}`)):e.has(a)?e.append(a,t):e.set(a,t))}const xt=function(e,...t){const a=new URLSearchParams(e.search);Au(a,t),e.search=a.toString()},Ar=function(e,t,a){const r=typeof e!="string";return(r&&a&&a.isJsonMime?a.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},yt=function(e){return e.pathname+e.search+e.hash},bt=function(e,t,a,r){return(n=t,i=a)=>{const s={...e.options,url:(r?.basePath||n.defaults.baseURL||i)+e.url};return n.request(s)}},Hx=function(e){return{getEntityConfig:async(t={})=>{const a="/v1/w3s/config/entity",r=new URL(a,gt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await It(s,e),xt(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:yt(r),options:i}},getPublicKey:async(t={})=>{const a="/v1/w3s/config/entity/publicKey",r=new URL(a,gt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await It(s,e),xt(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:yt(r),options:i}}}},$x=function(e){const t=Hx(e);return{async getEntityConfig(a){const r=await t.getEntityConfig(a),n=e?.serverIndex??0,i=vt["DeveloperAccountApi.getEntityConfig"]?.[n]?.url;return(s,o)=>bt(r,J,mt,e)(s,i||o)},async getPublicKey(a){const r=await t.getPublicKey(a),n=e?.serverIndex??0,i=vt["DeveloperAccountApi.getPublicKey"]?.[n]?.url;return(s,o)=>bt(r,J,mt,e)(s,i||o)}}},Gx=function(e,t,a){const r=$x(e);return{getEntityConfig(n){return r.getEntityConfig(n).then(i=>i(a,t))},getPublicKey(n){return r.getPublicKey(n).then(i=>i(a,t))}}},Wx=function(e){return{requestTestnetTokens:async(t,a,r={})=>{const n="/v1/faucet/drips",i=new URL(n,gt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await It(c,e),t!=null&&(c["X-Request-Id"]=String(t)),c["Content-Type"]="application/json",xt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Ar(a,o,e),{url:yt(i),options:o}}}},Xx=function(e){const t=Wx(e);return{async requestTestnetTokens(a,r,n){const i=await t.requestTestnetTokens(a,r,n),s=e?.serverIndex??0,o=vt["FaucetApi.requestTestnetTokens"]?.[s]?.url;return(c,l)=>bt(i,J,mt,e)(c,o||l)}}},Qx=function(e,t,a){const r=Xx(e);return{requestTestnetTokens(n,i,s){return r.requestTestnetTokens(n,i,s).then(o=>o(a,t))}}},Yx=function(e){return{ping:async(t={})=>{const a="/ping",r=new URL(a,gt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={};xt(r,{});let o=n&&n.headers?n.headers:{};return i.headers={...s,...o,...t.headers},{url:yt(r),options:i}}}},Jx=function(e){const t=Yx(e);return{async ping(a){const r=await t.ping(a),n=e?.serverIndex??0,i=vt["HealthApi.ping"]?.[n]?.url;return(s,o)=>bt(r,J,mt,e)(s,i||o)}}},Zx=function(e,t,a){const r=Jx(e);return{ping(n){return r.ping(n).then(i=>i(a,t))}}},ey=function(e){return{createMonitoredTokens:async(t,a={})=>{zt("createMonitoredTokens","createMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens",n=new URL(r,gt);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await It(o,e),o["Content-Type"]="application/json",xt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Ar(t,s,e),{url:yt(n),options:s}},deleteMonitoredTokens:async(t,a={})=>{zt("deleteMonitoredTokens","deleteMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens/delete",n=new URL(r,gt);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await It(o,e),o["Content-Type"]="application/json",xt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Ar(t,s,e),{url:yt(n),options:s}},listMonitoredTokens:async(t,a,r,n,i,s,o,c,l={})=>{const u="/v1/w3s/config/entity/monitoredTokens",p=new URL(u,gt);let d;e&&(d=e.baseOptions);const g={method:"GET",...d,...l},h={},y={};await It(h,e),t!==void 0&&(y.blockchain=t),a!==void 0&&(y.tokenAddress=a),r!==void 0&&(y.symbol=r),n!==void 0&&(y.from=n instanceof Date?n.toISOString():n),i!==void 0&&(y.to=i instanceof Date?i.toISOString():i),s!==void 0&&(y.pageBefore=s),o!==void 0&&(y.pageAfter=o),c!==void 0&&(y.pageSize=c),xt(p,y);let b=d&&d.headers?d.headers:{};return g.headers={...h,...b,...l.headers},{url:yt(p),options:g}},updateMonitoredTokens:async(t,a={})=>{zt("updateMonitoredTokens","updateMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens",n=new URL(r,gt);let i;e&&(i=e.baseOptions);const s={method:"PUT",...i,...a},o={},c={};await It(o,e),o["Content-Type"]="application/json",xt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Ar(t,s,e),{url:yt(n),options:s}},updateMonitoredTokensScope:async(t,a={})=>{zt("updateMonitoredTokensScope","updateMonitoredTokensScopeRequest",t);const r="/v1/w3s/config/entity/monitoredTokens/scope",n=new URL(r,gt);let i;e&&(i=e.baseOptions);const s={method:"PUT",...i,...a},o={},c={};await It(o,e),o["Content-Type"]="application/json",xt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Ar(t,s,e),{url:yt(n),options:s}}}},ty=function(e){const t=ey(e);return{async createMonitoredTokens(a,r){const n=await t.createMonitoredTokens(a,r),i=e?.serverIndex??0,s=vt["MonitorTokensApi.createMonitoredTokens"]?.[i]?.url;return(o,c)=>bt(n,J,mt,e)(o,s||c)},async deleteMonitoredTokens(a,r){const n=await t.deleteMonitoredTokens(a,r),i=e?.serverIndex??0,s=vt["MonitorTokensApi.deleteMonitoredTokens"]?.[i]?.url;return(o,c)=>bt(n,J,mt,e)(o,s||c)},async listMonitoredTokens(a,r,n,i,s,o,c,l,u){const p=await t.listMonitoredTokens(a,r,n,i,s,o,c,l,u),d=e?.serverIndex??0,g=vt["MonitorTokensApi.listMonitoredTokens"]?.[d]?.url;return(h,y)=>bt(p,J,mt,e)(h,g||y)},async updateMonitoredTokens(a,r){const n=await t.updateMonitoredTokens(a,r),i=e?.serverIndex??0,s=vt["MonitorTokensApi.updateMonitoredTokens"]?.[i]?.url;return(o,c)=>bt(n,J,mt,e)(o,s||c)},async updateMonitoredTokensScope(a,r){const n=await t.updateMonitoredTokensScope(a,r),i=e?.serverIndex??0,s=vt["MonitorTokensApi.updateMonitoredTokensScope"]?.[i]?.url;return(o,c)=>bt(n,J,mt,e)(o,s||c)}}},ry=function(e,t,a){const r=ty(e);return{createMonitoredTokens(n,i){return r.createMonitoredTokens(n,i).then(s=>s(a,t))},deleteMonitoredTokens(n,i){return r.deleteMonitoredTokens(n,i).then(s=>s(a,t))},listMonitoredTokens(n,i,s,o,c,l,u,p,d){return r.listMonitoredTokens(n,i,s,o,c,l,u,p,d).then(g=>g(a,t))},updateMonitoredTokens(n,i){return r.updateMonitoredTokens(n,i).then(s=>s(a,t))},updateMonitoredTokensScope(n,i){return r.updateMonitoredTokensScope(n,i).then(s=>s(a,t))}}},ay=function(e){return{createSubscription:async(t,a,r={})=>{zt("createSubscription","createSubscriptionRequest",t);const n="/v2/notifications/subscriptions",i=new URL(n,gt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await It(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",xt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Ar(t,o,e),{url:yt(i),options:o}},deleteSubscription:async(t,a,r={})=>{zt("deleteSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,gt);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},c={},l={};await It(c,e),a!=null&&(c["X-Request-Id"]=String(a)),xt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:yt(i),options:o}},getNotificationSignature:async(t,a,r={})=>{zt("getNotificationSignature","id",t);const n="/v2/notifications/publicKey/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,gt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await It(c,e),a!=null&&(c["X-Request-Id"]=String(a)),xt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:yt(i),options:o}},getSubscription:async(t,a,r={})=>{zt("getSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,gt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await It(c,e),a!=null&&(c["X-Request-Id"]=String(a)),xt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:yt(i),options:o}},getSubscriptions:async(t={})=>{const a="/v2/notifications/subscriptions",r=new URL(a,gt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await It(s,e),xt(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:yt(r),options:i}},updateSubscription:async(t,a,r,n={})=>{zt("updateSubscription","id",t),zt("updateSubscription","updateSubscriptionRequest",a);const i="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,gt);let o;e&&(o=e.baseOptions);const c={method:"PATCH",...o,...n},l={},u={};await It(l,e),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",xt(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ar(a,c,e),{url:yt(s),options:c}}}},ny=function(e){const t=ay(e);return{async createSubscription(a,r,n){const i=await t.createSubscription(a,r,n),s=e?.serverIndex??0,o=vt["WebhookSubscriptionsApi.createSubscription"]?.[s]?.url;return(c,l)=>bt(i,J,mt,e)(c,o||l)},async deleteSubscription(a,r,n){const i=await t.deleteSubscription(a,r,n),s=e?.serverIndex??0,o=vt["WebhookSubscriptionsApi.deleteSubscription"]?.[s]?.url;return(c,l)=>bt(i,J,mt,e)(c,o||l)},async getNotificationSignature(a,r,n){const i=await t.getNotificationSignature(a,r,n),s=e?.serverIndex??0,o=vt["WebhookSubscriptionsApi.getNotificationSignature"]?.[s]?.url;return(c,l)=>bt(i,J,mt,e)(c,o||l)},async getSubscription(a,r,n){const i=await t.getSubscription(a,r,n),s=e?.serverIndex??0,o=vt["WebhookSubscriptionsApi.getSubscription"]?.[s]?.url;return(c,l)=>bt(i,J,mt,e)(c,o||l)},async getSubscriptions(a){const r=await t.getSubscriptions(a),n=e?.serverIndex??0,i=vt["WebhookSubscriptionsApi.getSubscriptions"]?.[n]?.url;return(s,o)=>bt(r,J,mt,e)(s,i||o)},async updateSubscription(a,r,n,i){const s=await t.updateSubscription(a,r,n,i),o=e?.serverIndex??0,c=vt["WebhookSubscriptionsApi.updateSubscription"]?.[o]?.url;return(l,u)=>bt(s,J,mt,e)(l,c||u)}}},sy=function(e,t,a){const r=ny(e);return{createSubscription(n,i,s){return r.createSubscription(n,i,s).then(o=>o(a,t))},deleteSubscription(n,i,s){return r.deleteSubscription(n,i,s).then(o=>o(a,t))},getNotificationSignature(n,i,s){return r.getNotificationSignature(n,i,s).then(o=>o(a,t))},getSubscription(n,i,s){return r.getSubscription(n,i,s).then(o=>o(a,t))},getSubscriptions(n){return r.getSubscriptions(n).then(i=>i(a,t))},updateSubscription(n,i,s,o){return r.updateSubscription(n,i,s,o).then(c=>c(a,t))}}};var iy=Object.defineProperty,oy=(e,t,a)=>t in e?iy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,sr=(e,t,a)=>oy(e,typeof t!="symbol"?t+"":t,a);let cy=class{constructor(t={}){sr(this,"apiKey"),sr(this,"username"),sr(this,"password"),sr(this,"accessToken"),sr(this,"basePath"),sr(this,"serverIndex"),sr(this,"baseOptions"),sr(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(a.test(t)||t.toLowerCase()==="application/json-patch+json")}};var ly=Object.defineProperty,uy=(e,t,a)=>t in e?ly(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,xa=(e,t,a)=>uy(e,typeof t!="symbol"?t+"":t,a);class py{constructor(t,a,r={}){xa(this,"DeveloperAccount"),xa(this,"Faucet"),xa(this,"Health"),xa(this,"MonitorTokens"),xa(this,"WebhookSubscriptions");const n=new cy({basePath:t,baseOptions:{headers:{...r,Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json","User-Agent":`${a.userAgent?a.userAgent+" / ":""}CircleNodeJS / Configurations / ${a.version}`}}});this.DeveloperAccount=Gx(n),this.Faucet=Qx(n),this.Health=Zx(n),this.MonitorTokens=ry(n),this.WebhookSubscriptions=sy(n)}}const ge="https://api.circle.com".replace(/\/+$/,"");class dy extends Error{constructor(t,a){super(a),this.field=t,this.name="RequiredError"}}const xe={},ye="https://example.com",W=function(e,t,a){if(a==null)throw new dy(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},be=async function(e,t){if(t&&t.accessToken){const a=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+a}};function Iu(e,t,a=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>Iu(e,r,a)):Object.keys(t).forEach(r=>Iu(e,t[r],`${a}${a!==""?".":""}${r}`)):e.has(a)?e.append(a,t):e.set(a,t))}const Ee=function(e,...t){const a=new URLSearchParams(e.search);Iu(a,t),e.search=a.toString()},Ge=function(e,t,a){const r=typeof e!="string";return(r&&a&&a.isJsonMime?a.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},Ce=function(e){return e.pathname+e.search+e.hash},Te=function(e,t,a,r){return(n=t,i=a)=>{const s={...e.options,url:(r?.basePath||n.defaults.baseURL||i)+e.url};return n.request(s)}},fy=function(e){return{createUser:async(t,a={})=>{W("createUser","createUserRequest",t);const r="/v1/w3s/users",n=new URL(r,ye);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await be(o,e),o["Content-Type"]="application/json",Ee(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Ge(t,s,e),{url:Ce(n),options:s}},createUserPinChallenge:async(t,a,r,n={})=>{W("createUserPinChallenge","xUserToken",t),W("createUserPinChallenge","setPinRequest",a);const i="/v1/w3s/user/pin",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},createUserPinRestoreChallenge:async(t,a,r,n={})=>{W("createUserPinRestoreChallenge","xUserToken",t),W("createUserPinRestoreChallenge","setPinRequest",a);const i="/v1/w3s/user/pin/restore",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},getUserToken:async(t,a,r={})=>{W("getUserToken","userTokenRequest",t);const n="/v1/w3s/users/token",i=new URL(n,ye);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await be(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",Ee(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Ge(t,o,e),{url:Ce(i),options:o}},updateUserPinChallenge:async(t,a,r={})=>{W("updateUserPinChallenge","xUserToken",t),W("updateUserPinChallenge","setPinRequest",a);const n="/v1/w3s/user/pin",i=new URL(n,ye);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...r},c={},l={};await be(c,e),t!=null&&(c["X-User-Token"]=String(t)),c["Content-Type"]="application/json",Ee(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Ge(a,o,e),{url:Ce(i),options:o}}}},hy=function(e){const t=fy(e);return{async createUser(a,r){const n=await t.createUser(a,r),i=e?.serverIndex??0,s=xe["PINAuthenticationApi.createUser"]?.[i]?.url;return(o,c)=>Te(n,J,ge,e)(o,s||c)},async createUserPinChallenge(a,r,n,i){const s=await t.createUserPinChallenge(a,r,n,i),o=e?.serverIndex??0,c=xe["PINAuthenticationApi.createUserPinChallenge"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async createUserPinRestoreChallenge(a,r,n,i){const s=await t.createUserPinRestoreChallenge(a,r,n,i),o=e?.serverIndex??0,c=xe["PINAuthenticationApi.createUserPinRestoreChallenge"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async getUserToken(a,r,n){const i=await t.getUserToken(a,r,n),s=e?.serverIndex??0,o=xe["PINAuthenticationApi.getUserToken"]?.[s]?.url;return(c,l)=>Te(i,J,ge,e)(c,o||l)},async updateUserPinChallenge(a,r,n){const i=await t.updateUserPinChallenge(a,r,n),s=e?.serverIndex??0,o=xe["PINAuthenticationApi.updateUserPinChallenge"]?.[s]?.url;return(c,l)=>Te(i,J,ge,e)(c,o||l)}}},my=function(e,t,a){const r=hy(e);return{createUser(n,i){return r.createUser(n,i).then(s=>s(a,t))},createUserPinChallenge(n,i,s,o){return r.createUserPinChallenge(n,i,s,o).then(c=>c(a,t))},createUserPinRestoreChallenge(n,i,s,o){return r.createUserPinRestoreChallenge(n,i,s,o).then(c=>c(a,t))},getUserToken(n,i,s){return r.getUserToken(n,i,s).then(o=>o(a,t))},updateUserPinChallenge(n,i,s){return r.updateUserPinChallenge(n,i,s).then(o=>o(a,t))}}},vy=function(e){return{signUserMessage:async(t,a,r,n={})=>{W("signUserMessage","xUserToken",t),W("signUserMessage","signMessageRequest",a);const i="/v1/w3s/user/sign/message",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},signUserTransaction:async(t,a,r,n={})=>{W("signUserTransaction","xUserToken",t),W("signUserTransaction","signUserTransactionRequest",a);const i="/v1/w3s/user/sign/transaction",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},signUserTypedData:async(t,a,r,n={})=>{W("signUserTypedData","xUserToken",t),W("signUserTypedData","signTypedDataRequest",a);const i="/v1/w3s/user/sign/typedData",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}}}},gy=function(e){const t=vy(e);return{async signUserMessage(a,r,n,i){const s=await t.signUserMessage(a,r,n,i),o=e?.serverIndex??0,c=xe["SigningApi.signUserMessage"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async signUserTransaction(a,r,n,i){const s=await t.signUserTransaction(a,r,n,i),o=e?.serverIndex??0,c=xe["SigningApi.signUserTransaction"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async signUserTypedData(a,r,n,i){const s=await t.signUserTypedData(a,r,n,i),o=e?.serverIndex??0,c=xe["SigningApi.signUserTypedData"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)}}},xy=function(e,t,a){const r=gy(e);return{signUserMessage(n,i,s,o){return r.signUserMessage(n,i,s,o).then(c=>c(a,t))},signUserTransaction(n,i,s,o){return r.signUserTransaction(n,i,s,o).then(c=>c(a,t))},signUserTypedData(n,i,s,o){return r.signUserTypedData(n,i,s,o).then(c=>c(a,t))}}},yy=function(e){return{createDeviceTokenEmailLogin:async(t,a,r={})=>{W("createDeviceTokenEmailLogin","deviceTokenEmailRequest",t);const n="/v1/w3s/users/email/token",i=new URL(n,ye);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await be(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",Ee(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Ge(t,o,e),{url:Ce(i),options:o}},createDeviceTokenSocialLogin:async(t,a,r={})=>{W("createDeviceTokenSocialLogin","deviceTokenSocialRequest",t);const n="/v1/w3s/users/social/token",i=new URL(n,ye);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await be(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",Ee(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Ge(t,o,e),{url:Ce(i),options:o}},refreshUserToken:async(t,a,r,n={})=>{W("refreshUserToken","xUserToken",t),W("refreshUserToken","refreshUserTokenRequest",a);const i="/v1/w3s/users/token/refresh",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},resendOTP:async(t,a,r,n={})=>{W("resendOTP","xUserToken",t),W("resendOTP","resendOTPRequest",a);const i="/v1/w3s/users/email/resendOTP",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}}}},by=function(e){const t=yy(e);return{async createDeviceTokenEmailLogin(a,r,n){const i=await t.createDeviceTokenEmailLogin(a,r,n),s=e?.serverIndex??0,o=xe["SocialEmailAuthenticationApi.createDeviceTokenEmailLogin"]?.[s]?.url;return(c,l)=>Te(i,J,ge,e)(c,o||l)},async createDeviceTokenSocialLogin(a,r,n){const i=await t.createDeviceTokenSocialLogin(a,r,n),s=e?.serverIndex??0,o=xe["SocialEmailAuthenticationApi.createDeviceTokenSocialLogin"]?.[s]?.url;return(c,l)=>Te(i,J,ge,e)(c,o||l)},async refreshUserToken(a,r,n,i){const s=await t.refreshUserToken(a,r,n,i),o=e?.serverIndex??0,c=xe["SocialEmailAuthenticationApi.refreshUserToken"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async resendOTP(a,r,n,i){const s=await t.resendOTP(a,r,n,i),o=e?.serverIndex??0,c=xe["SocialEmailAuthenticationApi.resendOTP"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)}}},Ey=function(e,t,a){const r=by(e);return{createDeviceTokenEmailLogin(n,i,s){return r.createDeviceTokenEmailLogin(n,i,s).then(o=>o(a,t))},createDeviceTokenSocialLogin(n,i,s){return r.createDeviceTokenSocialLogin(n,i,s).then(o=>o(a,t))},refreshUserToken(n,i,s,o){return r.refreshUserToken(n,i,s,o).then(c=>c(a,t))},resendOTP(n,i,s,o){return r.resendOTP(n,i,s,o).then(c=>c(a,t))}}},Cy=function(e){return{getTokenId:async(t,a={})=>{W("getTokenId","id",t);const r="/v1/w3s/tokens/{id}".replace("{id}",encodeURIComponent(String(t))),n=new URL(r,ye);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...a},o={},c={};await be(o,e),Ee(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},{url:Ce(n),options:s}}}},Ty=function(e){const t=Cy(e);return{async getTokenId(a,r){const n=await t.getTokenId(a,r),i=e?.serverIndex??0,s=xe["TokenLookupApi.getTokenId"]?.[i]?.url;return(o,c)=>Te(n,J,ge,e)(o,s||c)}}},Sy=function(e,t,a){const r=Ty(e);return{getTokenId(n,i){return r.getTokenId(n,i).then(s=>s(a,t))}}},wy=function(e){return{createTransactionEstimateFee:async(t,a,r,n={})=>{W("createTransactionEstimateFee","xUserToken",t),W("createTransactionEstimateFee","estimateContractExecutionTransactionFeeRequest",a);const i="/v1/w3s/transactions/contractExecution/estimateFee",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},createTransferEstimateFee:async(t,a,r,n={})=>{W("createTransferEstimateFee","xUserToken",t),W("createTransferEstimateFee","estimateTransferTransactionFeeRequest",a);const i="/v1/w3s/transactions/transfer/estimateFee",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},createUserTransactionAccelerateChallenge:async(t,a,r,n,i={})=>{W("createUserTransactionAccelerateChallenge","xUserToken",t),W("createUserTransactionAccelerateChallenge","id",a),W("createUserTransactionAccelerateChallenge","accelerateTransactionForEndUserRequest",r);const s="/v1/w3s/user/transactions/{id}/accelerate".replace("{id}",encodeURIComponent(String(a))),o=new URL(s,ye);let c;e&&(c=e.baseOptions);const l={method:"POST",...c,...i},u={},p={};await be(u,e),t!=null&&(u["X-User-Token"]=String(t)),n!=null&&(u["X-Request-Id"]=String(n)),u["Content-Type"]="application/json",Ee(o,p);let d=c&&c.headers?c.headers:{};return l.headers={...u,...d,...i.headers},l.data=Ge(r,l,e),{url:Ce(o),options:l}},createUserTransactionCancelChallenge:async(t,a,r,n,i={})=>{W("createUserTransactionCancelChallenge","xUserToken",t),W("createUserTransactionCancelChallenge","id",a),W("createUserTransactionCancelChallenge","cancelTransactionForEndUserRequest",r);const s="/v1/w3s/user/transactions/{id}/cancel".replace("{id}",encodeURIComponent(String(a))),o=new URL(s,ye);let c;e&&(c=e.baseOptions);const l={method:"POST",...c,...i},u={},p={};await be(u,e),t!=null&&(u["X-User-Token"]=String(t)),n!=null&&(u["X-Request-Id"]=String(n)),u["Content-Type"]="application/json",Ee(o,p);let d=c&&c.headers?c.headers:{};return l.headers={...u,...d,...i.headers},l.data=Ge(r,l,e),{url:Ce(o),options:l}},createUserTransactionContractExecutionChallenge:async(t,a,r,n={})=>{W("createUserTransactionContractExecutionChallenge","xUserToken",t),W("createUserTransactionContractExecutionChallenge","createContractExecutionTransactionForEndUserRequest",a);const i="/v1/w3s/user/transactions/contractExecution",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},createUserTransactionTransferChallenge:async(t,a,r,n={})=>{W("createUserTransactionTransferChallenge","xUserToken",t),W("createUserTransactionTransferChallenge","createTransferTransactionForEndUserRequest",a);const i="/v1/w3s/user/transactions/transfer",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},createUserTransactionWalletUpgradeChallenge:async(t,a,r,n={})=>{W("createUserTransactionWalletUpgradeChallenge","xUserToken",t),W("createUserTransactionWalletUpgradeChallenge","createWalletUpgradeTransactionForEndUserRequest",a);const i="/v1/w3s/user/transactions/walletUpgrade",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},createValidateAddress:async(t,a={})=>{W("createValidateAddress","validateAddressRequest",t);const r="/v1/w3s/transactions/validateAddress",n=new URL(r,ye);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await be(o,e),o["Content-Type"]="application/json",Ee(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Ge(t,s,e),{url:Ce(n),options:s}},getLowestNonceTransaction:async(t,a,r,n={})=>{const i="/v1/w3s/transactions/lowestNonceTransaction",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await be(l,e),t!==void 0&&(u.blockchain=t),a!==void 0&&(u.address=a),r!==void 0&&(u.walletId=r),Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},{url:Ce(s),options:c}},getTransaction:async(t,a,r,n,i={})=>{W("getTransaction","id",t),W("getTransaction","xUserToken",a);const s="/v1/w3s/transactions/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,ye);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...i},u={},p={};await be(u,e),r!==void 0&&(p.txType=r),a!=null&&(u["X-User-Token"]=String(a)),n!=null&&(u["X-Request-Id"]=String(n)),Ee(o,p);let d=c&&c.headers?c.headers:{};return l.headers={...u,...d,...i.headers},{url:Ce(o),options:l}},listTransactions:async(t,a,r,n,i,s,o,c,l,u,p,d,g,h,y,b,E,I={})=>{W("listTransactions","xUserToken",t);const R="/v1/w3s/transactions",k=new URL(R,ye);let U;e&&(U=e.baseOptions);const L={method:"GET",...U,...I},q={},H={};await be(q,e),a!==void 0&&(H.blockchain=a),r!==void 0&&(H.destinationAddress=r),n!==void 0&&(H.includeAll=n),i!==void 0&&(H.operation=i),s!==void 0&&(H.state=s),o!==void 0&&(H.txHash=o),c!==void 0&&(H.txType=c),l!==void 0&&(H.userId=l),u!==void 0&&(H.walletIds=u),p!==void 0&&(H.from=p instanceof Date?p.toISOString():p),d!==void 0&&(H.to=d instanceof Date?d.toISOString():d),g!==void 0&&(H.pageBefore=g),h!==void 0&&(H.pageAfter=h),y!==void 0&&(H.pageSize=y),b!==void 0&&(H.order=b),t!=null&&(q["X-User-Token"]=String(t)),E!=null&&(q["X-Request-Id"]=String(E)),Ee(k,H);let Y=U&&U.headers?U.headers:{};return L.headers={...q,...Y,...I.headers},{url:Ce(k),options:L}}}},Ay=function(e){const t=wy(e);return{async createTransactionEstimateFee(a,r,n,i){const s=await t.createTransactionEstimateFee(a,r,n,i),o=e?.serverIndex??0,c=xe["TransactionsApi.createTransactionEstimateFee"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async createTransferEstimateFee(a,r,n,i){const s=await t.createTransferEstimateFee(a,r,n,i),o=e?.serverIndex??0,c=xe["TransactionsApi.createTransferEstimateFee"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async createUserTransactionAccelerateChallenge(a,r,n,i,s){const o=await t.createUserTransactionAccelerateChallenge(a,r,n,i,s),c=e?.serverIndex??0,l=xe["TransactionsApi.createUserTransactionAccelerateChallenge"]?.[c]?.url;return(u,p)=>Te(o,J,ge,e)(u,l||p)},async createUserTransactionCancelChallenge(a,r,n,i,s){const o=await t.createUserTransactionCancelChallenge(a,r,n,i,s),c=e?.serverIndex??0,l=xe["TransactionsApi.createUserTransactionCancelChallenge"]?.[c]?.url;return(u,p)=>Te(o,J,ge,e)(u,l||p)},async createUserTransactionContractExecutionChallenge(a,r,n,i){const s=await t.createUserTransactionContractExecutionChallenge(a,r,n,i),o=e?.serverIndex??0,c=xe["TransactionsApi.createUserTransactionContractExecutionChallenge"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async createUserTransactionTransferChallenge(a,r,n,i){const s=await t.createUserTransactionTransferChallenge(a,r,n,i),o=e?.serverIndex??0,c=xe["TransactionsApi.createUserTransactionTransferChallenge"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async createUserTransactionWalletUpgradeChallenge(a,r,n,i){const s=await t.createUserTransactionWalletUpgradeChallenge(a,r,n,i),o=e?.serverIndex??0,c=xe["TransactionsApi.createUserTransactionWalletUpgradeChallenge"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async createValidateAddress(a,r){const n=await t.createValidateAddress(a,r),i=e?.serverIndex??0,s=xe["TransactionsApi.createValidateAddress"]?.[i]?.url;return(o,c)=>Te(n,J,ge,e)(o,s||c)},async getLowestNonceTransaction(a,r,n,i){const s=await t.getLowestNonceTransaction(a,r,n,i),o=e?.serverIndex??0,c=xe["TransactionsApi.getLowestNonceTransaction"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async getTransaction(a,r,n,i,s){const o=await t.getTransaction(a,r,n,i,s),c=e?.serverIndex??0,l=xe["TransactionsApi.getTransaction"]?.[c]?.url;return(u,p)=>Te(o,J,ge,e)(u,l||p)},async listTransactions(a,r,n,i,s,o,c,l,u,p,d,g,h,y,b,E,I,R){const k=await t.listTransactions(a,r,n,i,s,o,c,l,u,p,d,g,h,y,b,E,I,R),U=e?.serverIndex??0,L=xe["TransactionsApi.listTransactions"]?.[U]?.url;return(q,H)=>Te(k,J,ge,e)(q,L||H)}}},Iy=function(e,t,a){const r=Ay(e);return{createTransactionEstimateFee(n,i,s,o){return r.createTransactionEstimateFee(n,i,s,o).then(c=>c(a,t))},createTransferEstimateFee(n,i,s,o){return r.createTransferEstimateFee(n,i,s,o).then(c=>c(a,t))},createUserTransactionAccelerateChallenge(n,i,s,o,c){return r.createUserTransactionAccelerateChallenge(n,i,s,o,c).then(l=>l(a,t))},createUserTransactionCancelChallenge(n,i,s,o,c){return r.createUserTransactionCancelChallenge(n,i,s,o,c).then(l=>l(a,t))},createUserTransactionContractExecutionChallenge(n,i,s,o){return r.createUserTransactionContractExecutionChallenge(n,i,s,o).then(c=>c(a,t))},createUserTransactionTransferChallenge(n,i,s,o){return r.createUserTransactionTransferChallenge(n,i,s,o).then(c=>c(a,t))},createUserTransactionWalletUpgradeChallenge(n,i,s,o){return r.createUserTransactionWalletUpgradeChallenge(n,i,s,o).then(c=>c(a,t))},createValidateAddress(n,i){return r.createValidateAddress(n,i).then(s=>s(a,t))},getLowestNonceTransaction(n,i,s,o){return r.getLowestNonceTransaction(n,i,s,o).then(c=>c(a,t))},getTransaction(n,i,s,o,c){return r.getTransaction(n,i,s,o,c).then(l=>l(a,t))},listTransactions(n,i,s,o,c,l,u,p,d,g,h,y,b,E,I,R,k,U){return r.listTransactions(n,i,s,o,c,l,u,p,d,g,h,y,b,E,I,R,k,U).then(L=>L(a,t))}}},By=function(e){return{createUserWithPinChallenge:async(t,a,r,n={})=>{W("createUserWithPinChallenge","xUserToken",t),W("createUserWithPinChallenge","setPinAndInitWalletRequest",a);const i="/v1/w3s/user/initialize",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},getUser:async(t,a,r={})=>{W("getUser","id",t);const n="/v1/w3s/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,ye);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await be(c,e),a!=null&&(c["X-Request-Id"]=String(a)),Ee(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:Ce(i),options:o}},getUserByToken:async(t,a,r={})=>{W("getUserByToken","xUserToken",t);const n="/v1/w3s/user",i=new URL(n,ye);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await be(c,e),t!=null&&(c["X-User-Token"]=String(t)),a!=null&&(c["X-Request-Id"]=String(a)),Ee(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:Ce(i),options:o}},getUserChallenge:async(t,a,r,n={})=>{W("getUserChallenge","xUserToken",t),W("getUserChallenge","id",a);const i="/v1/w3s/user/challenges/{id}".replace("{id}",encodeURIComponent(String(a))),s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},{url:Ce(s),options:c}},listUserChallenges:async(t,a,r,n={})=>{W("listUserChallenges","xUserToken",t);const i="/v1/w3s/user/challenges",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await be(l,e),a!==void 0&&(u.status=a),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},{url:Ce(s),options:c}},listUsers:async(t,a,r,n,i,s,o,c,l,u={})=>{const p="/v1/w3s/users",d=new URL(p,ye);let g;e&&(g=e.baseOptions);const h={method:"GET",...g,...u},y={},b={};await be(y,e),t!==void 0&&(b.pinStatus=t),a!==void 0&&(b.securityQuestionStatus=a),r!==void 0&&(b.from=r instanceof Date?r.toISOString():r),n!==void 0&&(b.to=n instanceof Date?n.toISOString():n),i!==void 0&&(b.pageBefore=i),s!==void 0&&(b.pageAfter=s),o!==void 0&&(b.pageSize=o),c!==void 0&&(b.order=c),l!=null&&(y["X-Request-Id"]=String(l)),Ee(d,b);let E=g&&g.headers?g.headers:{};return h.headers={...y,...E,...u.headers},{url:Ce(d),options:h}}}},Ry=function(e){const t=By(e);return{async createUserWithPinChallenge(a,r,n,i){const s=await t.createUserWithPinChallenge(a,r,n,i),o=e?.serverIndex??0,c=xe["UsersApi.createUserWithPinChallenge"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async getUser(a,r,n){const i=await t.getUser(a,r,n),s=e?.serverIndex??0,o=xe["UsersApi.getUser"]?.[s]?.url;return(c,l)=>Te(i,J,ge,e)(c,o||l)},async getUserByToken(a,r,n){const i=await t.getUserByToken(a,r,n),s=e?.serverIndex??0,o=xe["UsersApi.getUserByToken"]?.[s]?.url;return(c,l)=>Te(i,J,ge,e)(c,o||l)},async getUserChallenge(a,r,n,i){const s=await t.getUserChallenge(a,r,n,i),o=e?.serverIndex??0,c=xe["UsersApi.getUserChallenge"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async listUserChallenges(a,r,n,i){const s=await t.listUserChallenges(a,r,n,i),o=e?.serverIndex??0,c=xe["UsersApi.listUserChallenges"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async listUsers(a,r,n,i,s,o,c,l,u,p){const d=await t.listUsers(a,r,n,i,s,o,c,l,u,p),g=e?.serverIndex??0,h=xe["UsersApi.listUsers"]?.[g]?.url;return(y,b)=>Te(d,J,ge,e)(y,h||b)}}},ky=function(e,t,a){const r=Ry(e);return{createUserWithPinChallenge(n,i,s,o){return r.createUserWithPinChallenge(n,i,s,o).then(c=>c(a,t))},getUser(n,i,s){return r.getUser(n,i,s).then(o=>o(a,t))},getUserByToken(n,i,s){return r.getUserByToken(n,i,s).then(o=>o(a,t))},getUserChallenge(n,i,s,o){return r.getUserChallenge(n,i,s,o).then(c=>c(a,t))},listUserChallenges(n,i,s,o){return r.listUserChallenges(n,i,s,o).then(c=>c(a,t))},listUsers(n,i,s,o,c,l,u,p,d,g){return r.listUsers(n,i,s,o,c,l,u,p,d,g).then(h=>h(a,t))}}},_y=function(e){return{createUserWallet:async(t,a,r,n={})=>{W("createUserWallet","xUserToken",t),W("createUserWallet","createEndUserWalletRequest",a);const i="/v1/w3s/user/wallets",s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await be(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(a,c,e),{url:Ce(s),options:c}},getWallet:async(t,a,r,n={})=>{W("getWallet","id",t),W("getWallet","xUserToken",a);const i="/v1/w3s/wallets/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await be(l,e),a!=null&&(l["X-User-Token"]=String(a)),r!=null&&(l["X-Request-Id"]=String(r)),Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},{url:Ce(s),options:c}},listWalletBalance:async(t,a,r,n,i,s,o,c,l,u,p={})=>{W("listWalletBalance","xUserToken",t),W("listWalletBalance","id",a);const d="/v1/w3s/wallets/{id}/balances".replace("{id}",encodeURIComponent(String(a))),g=new URL(d,ye);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...p},b={},E={};await be(b,e),r!==void 0&&(E.includeAll=r),n!==void 0&&(E.name=n),i!==void 0&&(E.tokenAddress=i),s!==void 0&&(E.standard=s),o!==void 0&&(E.pageBefore=o),c!==void 0&&(E.pageAfter=c),l!==void 0&&(E.pageSize=l),t!=null&&(b["X-User-Token"]=String(t)),u!=null&&(b["X-Request-Id"]=String(u)),Ee(g,E);let I=h&&h.headers?h.headers:{};return y.headers={...b,...I,...p.headers},{url:Ce(g),options:y}},listWalletNfts:async(t,a,r,n,i,s,o,c,l,u,p={})=>{W("listWalletNfts","xUserToken",t),W("listWalletNfts","id",a);const d="/v1/w3s/wallets/{id}/nfts".replace("{id}",encodeURIComponent(String(a))),g=new URL(d,ye);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...p},b={},E={};await be(b,e),r!==void 0&&(E.includeAll=r),n!==void 0&&(E.name=n),i!==void 0&&(E.tokenAddress=i),s!==void 0&&(E.standard=s),o!==void 0&&(E.pageBefore=o),c!==void 0&&(E.pageAfter=c),l!==void 0&&(E.pageSize=l),t!=null&&(b["X-User-Token"]=String(t)),u!=null&&(b["X-Request-Id"]=String(u)),Ee(g,E);let I=h&&h.headers?h.headers:{};return y.headers={...b,...I,...p.headers},{url:Ce(g),options:y}},listWallets:async(t,a,r,n,i,s,o,c,l,u,p,d,g,h={})=>{W("listWallets","xUserToken",t);const y="/v1/w3s/wallets",b=new URL(y,ye);let E;e&&(E=e.baseOptions);const I={method:"GET",...E,...h},R={},k={};await be(R,e),a!==void 0&&(k.address=a),r!==void 0&&(k.blockchain=r),n!==void 0&&(k.scaCore=n),i!==void 0&&(k.walletSetId=i),s!==void 0&&(k.refId=s),o!==void 0&&(k.from=o instanceof Date?o.toISOString():o),c!==void 0&&(k.to=c instanceof Date?c.toISOString():c),l!==void 0&&(k.pageBefore=l),u!==void 0&&(k.pageAfter=u),p!==void 0&&(k.pageSize=p),d!==void 0&&(k.order=d),t!=null&&(R["X-User-Token"]=String(t)),g!=null&&(R["X-Request-Id"]=String(g)),Ee(b,k);let U=E&&E.headers?E.headers:{};return I.headers={...R,...U,...h.headers},{url:Ce(b),options:I}},updateWallet:async(t,a,r,n={})=>{W("updateWallet","id",t),W("updateWallet","xUserToken",a),W("updateWallet","updateWalletRequest",r);const i="/v1/w3s/wallets/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,ye);let o;e&&(o=e.baseOptions);const c={method:"PUT",...o,...n},l={},u={};await be(l,e),a!=null&&(l["X-User-Token"]=String(a)),l["Content-Type"]="application/json",Ee(s,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ge(r,c,e),{url:Ce(s),options:c}}}},Uy=function(e){const t=_y(e);return{async createUserWallet(a,r,n,i){const s=await t.createUserWallet(a,r,n,i),o=e?.serverIndex??0,c=xe["WalletsApi.createUserWallet"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async getWallet(a,r,n,i){const s=await t.getWallet(a,r,n,i),o=e?.serverIndex??0,c=xe["WalletsApi.getWallet"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)},async listWalletBalance(a,r,n,i,s,o,c,l,u,p,d){const g=await t.listWalletBalance(a,r,n,i,s,o,c,l,u,p,d),h=e?.serverIndex??0,y=xe["WalletsApi.listWalletBalance"]?.[h]?.url;return(b,E)=>Te(g,J,ge,e)(b,y||E)},async listWalletNfts(a,r,n,i,s,o,c,l,u,p,d){const g=await t.listWalletNfts(a,r,n,i,s,o,c,l,u,p,d),h=e?.serverIndex??0,y=xe["WalletsApi.listWalletNfts"]?.[h]?.url;return(b,E)=>Te(g,J,ge,e)(b,y||E)},async listWallets(a,r,n,i,s,o,c,l,u,p,d,g,h,y){const b=await t.listWallets(a,r,n,i,s,o,c,l,u,p,d,g,h,y),E=e?.serverIndex??0,I=xe["WalletsApi.listWallets"]?.[E]?.url;return(R,k)=>Te(b,J,ge,e)(R,I||k)},async updateWallet(a,r,n,i){const s=await t.updateWallet(a,r,n,i),o=e?.serverIndex??0,c=xe["WalletsApi.updateWallet"]?.[o]?.url;return(l,u)=>Te(s,J,ge,e)(l,c||u)}}},Ny=function(e,t,a){const r=Uy(e);return{createUserWallet(n,i,s,o){return r.createUserWallet(n,i,s,o).then(c=>c(a,t))},getWallet(n,i,s,o){return r.getWallet(n,i,s,o).then(c=>c(a,t))},listWalletBalance(n,i,s,o,c,l,u,p,d,g,h){return r.listWalletBalance(n,i,s,o,c,l,u,p,d,g,h).then(y=>y(a,t))},listWalletNfts(n,i,s,o,c,l,u,p,d,g,h){return r.listWalletNfts(n,i,s,o,c,l,u,p,d,g,h).then(y=>y(a,t))},listWallets(n,i,s,o,c,l,u,p,d,g,h,y,b,E){return r.listWallets(n,i,s,o,c,l,u,p,d,g,h,y,b,E).then(I=>I(a,t))},updateWallet(n,i,s,o){return r.updateWallet(n,i,s,o).then(c=>c(a,t))}}};var Ly=Object.defineProperty,Py=(e,t,a)=>t in e?Ly(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ir=(e,t,a)=>Py(e,typeof t!="symbol"?t+"":t,a);class Oy{constructor(t={}){ir(this,"apiKey"),ir(this,"username"),ir(this,"password"),ir(this,"accessToken"),ir(this,"basePath"),ir(this,"serverIndex"),ir(this,"baseOptions"),ir(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(a.test(t)||t.toLowerCase()==="application/json-patch+json")}}const Dy={Eth:"ETH",EthSepolia:"ETH-SEPOLIA",Avax:"AVAX",AvaxFuji:"AVAX-FUJI",Matic:"MATIC",MaticAmoy:"MATIC-AMOY",Sol:"SOL",SolDevnet:"SOL-DEVNET",Arb:"ARB",ArbSepolia:"ARB-SEPOLIA",Near:"NEAR",NearTestnet:"NEAR-TESTNET",Evm:"EVM",EvmTestnet:"EVM-TESTNET",Uni:"UNI",UniSepolia:"UNI-SEPOLIA",Base:"BASE",BaseSepolia:"BASE-SEPOLIA",Op:"OP",OpSepolia:"OP-SEPOLIA",Aptos:"APTOS",AptosTestnet:"APTOS-TESTNET",ArcTestnet:"ARC-TESTNET",Monad:"MONAD",MonadTestnet:"MONAD-TESTNET"};var Fy=Object.defineProperty,qy=(e,t,a)=>t in e?Fy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Ir=(e,t,a)=>qy(e,typeof t!="symbol"?t+"":t,a);class Vy{constructor(t,a,r={}){Ir(this,"PINAuthentication"),Ir(this,"Signing"),Ir(this,"SocialEmailAuthentication"),Ir(this,"TokenLookup"),Ir(this,"Transactions"),Ir(this,"Users"),Ir(this,"Wallets");const n=new Oy({basePath:t,baseOptions:{headers:{...r,Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json","User-Agent":`${a.userAgent?a.userAgent+" / ":""}CircleNodeJS / UserControlledWallets / ${a.version}`}}});this.PINAuthentication=my(n),this.Signing=xy(n),this.SocialEmailAuthentication=Ey(n),this.TokenLookup=Sy(n),this.Transactions=Iy(n),this.Users=ky(n),this.Wallets=Ny(n)}}var My=Object.defineProperty,gf=e=>{throw TypeError(e)},jy=(e,t,a)=>t in e?My(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,$r=(e,t,a)=>jy(e,typeof t!="symbol"?t+"":t,a),xf=(e,t,a)=>t.has(e)||gf("Cannot "+a),Ky=(e,t,a)=>(xf(e,t,"read from private field"),a?a.call(e):t.get(e)),zy=(e,t,a)=>t.has(e)?gf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),Hy=(e,t,a,r)=>(xf(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a),Qc;class ya extends Error{constructor({message:t,code:a,url:r,method:n,error:i}){super(t),$r(this,"code"),$r(this,"message"),$r(this,"url"),$r(this,"method"),zy(this,Qc),this.message=t??new.target.message,this.code=a??new.target.code,this.url=r,this.method=n,Hy(this,Qc,i)}get error(){return Ky(this,Qc)}}Qc=new WeakMap,$r(ya,"code","UNKNOWN"),$r(ya,"message","HTTP Error");var $y=Object.defineProperty,Gy=(e,t,a)=>t in e?$y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Bu=(e,t,a)=>Gy(e,typeof t!="symbol"?t+"":t,a);class C extends ya{constructor({message:t,code:a,url:r,method:n,status:i,error:s}){super({message:t,code:a,url:r,method:n,error:s}),Bu(this,"status"),this.status=i}}Bu(C,"code",-1),Bu(C,"message","HTTP Response Error");var Wy=Object.defineProperty,Xy=(e,t,a)=>t in e?Wy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,yf=(e,t,a)=>Xy(e,typeof t!="symbol"?t+"":t,a);class Lt extends ya{}yf(Lt,"code","UNKNOWN"),yf(Lt,"message","Unknown HTTP request error");var Qy=Object.defineProperty,Yy=(e,t,a)=>t in e?Qy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,bf=(e,t,a)=>Yy(e,typeof t!="symbol"?t+"":t,a);class ba extends C{}bf(ba,"code",400),bf(ba,"message","Bad Request");var Jy=Object.defineProperty,Zy=(e,t,a)=>t in e?Jy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Ef=(e,t,a)=>Zy(e,typeof t!="symbol"?t+"":t,a);class Ea extends C{}Ef(Ea,"code",401),Ef(Ea,"message","Unauthorized");var e1=Object.defineProperty,t1=(e,t,a)=>t in e?e1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Cf=(e,t,a)=>t1(e,typeof t!="symbol"?t+"":t,a);class Ca extends C{}Cf(Ca,"code",403),Cf(Ca,"message","Forbidden");var r1=Object.defineProperty,a1=(e,t,a)=>t in e?r1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Tf=(e,t,a)=>a1(e,typeof t!="symbol"?t+"":t,a);class Ta extends C{}Tf(Ta,"code",404),Tf(Ta,"message","Not Found");var n1=Object.defineProperty,s1=(e,t,a)=>t in e?n1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Sf=(e,t,a)=>s1(e,typeof t!="symbol"?t+"":t,a);class Sa extends C{}Sf(Sa,"code",429),Sf(Sa,"message","Too Many Requests");var i1=Object.defineProperty,o1=(e,t,a)=>t in e?i1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,wf=(e,t,a)=>o1(e,typeof t!="symbol"?t+"":t,a);class wa extends C{}wf(wa,"code",500),wf(wa,"message","Internal Server Error");var c1=Object.defineProperty,l1=(e,t,a)=>t in e?c1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Af=(e,t,a)=>l1(e,typeof t!="symbol"?t+"":t,a);class Aa extends C{}Af(Aa,"code",501),Af(Aa,"message","Not Implemented");var u1=Object.defineProperty,p1=(e,t,a)=>t in e?u1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,If=(e,t,a)=>p1(e,typeof t!="symbol"?t+"":t,a);class Ia extends C{}If(Ia,"code",502),If(Ia,"message","Bad Gateway");var d1=Object.defineProperty,f1=(e,t,a)=>t in e?d1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Bf=(e,t,a)=>f1(e,typeof t!="symbol"?t+"":t,a);class Ba extends C{}Bf(Ba,"code",503),Bf(Ba,"message","Service Unavailable");var h1=Object.defineProperty,m1=(e,t,a)=>t in e?h1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Rf=(e,t,a)=>m1(e,typeof t!="symbol"?t+"":t,a);class Ra extends C{}Rf(Ra,"code",504),Rf(Ra,"message","Gateway Timeout");var v1=Object.defineProperty,g1=(e,t,a)=>t in e?v1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,kf=(e,t,a)=>g1(e,typeof t!="symbol"?t+"":t,a);class ka extends Lt{}kf(ka,"code","ECONNREFUSED"),kf(ka,"message","Connection refused");var x1=Object.defineProperty,y1=(e,t,a)=>t in e?x1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,_f=(e,t,a)=>y1(e,typeof t!="symbol"?t+"":t,a);class _a extends Lt{}_f(_a,"code","ETIMEDOUT"),_f(_a,"message","Connection timeout");var b1=Object.defineProperty,E1=(e,t,a)=>t in e?b1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Uf=(e,t,a)=>E1(e,typeof t!="symbol"?t+"":t,a);class Ua extends Lt{}Uf(Ua,"code","ECONNABORTED"),Uf(Ua,"message","Request timeout");var C1=Object.defineProperty,T1=(e,t,a)=>t in e?C1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Nf=(e,t,a)=>T1(e,typeof t!="symbol"?t+"":t,a);class Na extends Lt{}Nf(Na,"code","ENOTFOUND"),Nf(Na,"message","DNS lookup failed - host not found");var S1=Object.defineProperty,w1=(e,t,a)=>t in e?S1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Lf=(e,t,a)=>w1(e,typeof t!="symbol"?t+"":t,a);class La extends Lt{}Lf(La,"code","EAI_AGAIN"),Lf(La,"message","DNS lookup failed - timeout");var A1=Object.defineProperty,I1=(e,t,a)=>t in e?A1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Pf=(e,t,a)=>I1(e,typeof t!="symbol"?t+"":t,a);class Pa extends Lt{}Pf(Pa,"code","ENETUNREACH"),Pf(Pa,"message","Network unreachable");var B1=Object.defineProperty,R1=(e,t,a)=>t in e?B1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Of=(e,t,a)=>R1(e,typeof t!="symbol"?t+"":t,a);class Oa extends Lt{}Of(Oa,"code","ECONNRESET"),Of(Oa,"message","Connection reset");var k1=Object.defineProperty,_1=(e,t,a)=>t in e?k1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Df=(e,t,a)=>_1(e,typeof t!="symbol"?t+"":t,a);class Da extends Lt{}Df(Da,"code","EHOSTUNREACH"),Df(Da,"message","Host unreachable");const Ff={undefined:Lt,[ka.code]:ka,[_a.code]:_a,[Ua.code]:Ua,[Oa.code]:Oa,[Na.code]:Na,[La.code]:La,[Pa.code]:Pa,[Da.code]:Da};function U1(e){return Ff[e]??Ff.undefined}function N1(e){return L1({code:e.code,message:e.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function L1({code:e,message:t,url:a,method:r,error:n}){const i=U1(e);return new i({message:t,code:e,url:a,method:r,error:n})}var P1=Object.defineProperty,O1=(e,t,a)=>t in e?P1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,f=(e,t,a)=>O1(e,typeof t!="symbol"?t+"":t,a);class Ru extends C{}f(Ru,"code",110700),f(Ru,"message","The input amount is outside trade limit.");class ku extends C{}f(ku,"code",110701),f(ku,"message","No quote is available with given input.");class _u extends C{}f(_u,"code",110702),f(_u,"message","No supported configurations with given input.");class Uu extends C{}f(Uu,"code",110703),f(Uu,"message","refId already exists, should be unique.");class Fa extends C{}f(Fa,"code",155101),f(Fa,"message","Existing user already created with the provided userId.");class qa extends C{}f(qa,"code",155102),f(qa,"message","Cannot find the user id in the system.");class Va extends C{}f(Va,"code",155103),f(Va,"message","Cannot find the user token in the system.");class Ma extends C{}f(Ma,"code",155104),f(Ma,"message","The userToken had expired.");class ja extends C{}f(ja,"code",155105),f(ja,"message","The userToken is invalid.");class Ka extends C{}f(Ka,"code",155106),f(Ka,"message","The user had already been initialized.");class za extends C{}f(za,"code",155107),f(za,"message","User has previously set a PIN. Use PUT /user/pin to reset the PIN.");class Ha extends C{}f(Ha,"code",155108),f(Ha,"message","User has previously set up their security questions, and they can't be reset.");class $a extends C{}f($a,"code",155109),f($a,"message","The specified user has been disabled.");class Ga extends C{}f(Ga,"code",155110),f(Ga,"message","User has not set up a PIN yet.");class Wa extends C{}f(Wa,"code",155111),f(Wa,"message","User hasn't set the security questions for PIN backup yet.");class Xa extends C{}f(Xa,"code",155112),f(Xa,"message","The user has inputted the incorrect pin.");class Qa extends C{}f(Qa,"code",155113),f(Qa,"message","Provided device ID is not found in the system.");class Ya extends C{}f(Ya,"code",155114),f(Ya,"message","Provided app ID is not recognized in the system.");class Ja extends C{}f(Ja,"code",155115),f(Ja,"message","The user has inputted the incorrect security answers");class Za extends C{}f(Za,"code",155116),f(Za,"message","The challenge ID doesn't exist in the system.");class en extends C{}f(en,"code",155117),f(en,"message","The content provided for approval is not correct.");class tn extends C{}f(tn,"code",155118),f(tn,"message","Encryption key does not match with the user's token. Call POST /users/token to get the correct token encryption key pair.");class rn extends C{}f(rn,"code",155119),f(rn,"message","The user's PIN input is locked. It will be unlocked after the cooldown period.");class an extends C{}f(an,"code",155120),f(an,"message","The user's security questions input is locked. It will be unlocked after the cooldown period.");class nn extends C{}f(nn,"code",155121),f(nn,"message","The provided challengeId has expired.");class sn extends C{}f(sn,"code",155122),f(sn,"message","The provided challengeId is invalid");class on extends C{}f(on,"code",155123),f(on,"message","No extra information provided when adding PIN-related requests.");class cn extends C{}f(cn,"code",155124),f(cn,"message","The extra information provided for PIN-related requests is invalid.");class ln extends C{}f(ln,"code",155130),f(ln,"message","User OTP token is expired.");class un extends C{}f(un,"code",155131),f(un,"message","User OTP token is invalid.");class pn extends C{}f(pn,"code",155132),f(pn,"message","User OTP value is not found.");class dn extends C{}f(dn,"code",155133),f(dn,"message","User OTP value is invalid.");class fn extends C{}f(fn,"code",155134),f(fn,"message","User OTP value is not matched.");class hn extends C{}f(hn,"code",155135),f(hn,"message","User's email is invalid.");class mn extends C{}f(mn,"code",155136),f(mn,"message","User's email is not matched.");class vn extends C{}f(vn,"code",155137),f(vn,"message","User's device ID is invalid.");class gn extends C{}f(gn,"code",155138),f(gn,"message","Failed to send the email.");class xn extends C{}f(xn,"code",155139),f(xn,"message","The idToken / accessToken of SSO is expired.");class yn extends C{}f(yn,"code",155140),f(yn,"message","Failed to validate the idToken/ accessToken.");class bn extends C{}f(bn,"code",155141),f(bn,"message","The user has exceeded the max limit (5) of entering OTP at the moment.");class En extends C{}f(En,"code",155142),f(En,"message","The max limit (5) of sending OTP has been exceeded at the moment.");class Cn extends C{}f(Cn,"code",155143),f(Cn,"message","The device token is expired.");class Tn extends C{}f(Tn,"code",155144),f(Tn,"message","The device token is invalid.");class Sn extends C{}f(Sn,"code",155145),f(Sn,"message","The device token is not found.");class wn extends C{}f(wn,"code",155146),f(wn,"message","The one-time password token is invalid as the user has entered it incorrectly three times.");class An extends C{}f(An,"code",155150),f(An,"message","The SMTP server configuration is not found.");class In extends C{}f(In,"code",155151),f(In,"message","The SMTP server configuration is invalid.");class Bn extends C{}f(Bn,"code",155152),f(Bn,"message","The SSO provider configuration is not found.");class Rn extends C{}f(Rn,"code",155154),f(Rn,"message","The OTP email template is invalid.");class kn extends C{}f(kn,"code",155155),f(kn,"message","The OTP email template is not found.");class _n extends C{}f(_n,"code",155156),f(_n,"message","Failed to update the email template.");class Un extends C{}f(Un,"code",155157),f(Un,"message","Failed to update the SMTP server configuration.");class Nn extends C{}f(Nn,"code",155158),f(Nn,"message","Failed to dial to the SMTP server.");class Ln extends C{}f(Ln,"code",155159),f(Ln,"message","Failed to auth to the SMTP server.");class Pn extends C{}f(Pn,"code",155160),f(Pn,"message","Failed to send to the SMTP server.");class On extends C{}f(On,"code",155201),f(On,"message","Not enough funds to fulfill the withdraw request.");class Dn extends C{}f(Dn,"code",155202),f(Dn,"message","Transaction nonce is inconsistent with sender's latest nonce.");class Fn extends C{}f(Fn,"code",155203),f(Fn,"message","User op nonce can not be larger than 0 when the smart contract wallet hasn't been deployed.");class qn extends C{}f(qn,"code",155204),f(qn,"message","The total cost of executing transaction is higher than the balance of the user's account when estimating fee.");class Vn extends C{}f(Vn,"code",155205),f(Vn,"message","Failed to execute this request on EVM due to insufficient tokens when the estimating gas fee.");class Mn extends C{}f(Mn,"code",155206),f(Mn,"message","The sender address is not the token owner or the sender wasn't approved to commit this transaction.");class jn extends C{}f(jn,"code",155207),f(jn,"message","Gas required exceeds the maximum allowance for the account. This is based on the gas fee estimate amount.");class Kn extends C{}f(Kn,"code",155208),f(Kn,"message","Estimate fee execution reverted.");class zn extends C{}f(zn,"code",155209),f(zn,"message","ABI function signature can't pack ABI parameter.");class Hn extends C{}f(Hn,"code",155210),f(Hn,"message","Fails to perform transaction estimation.");class $n extends C{}f($n,"code",155211),f($n,"message","MaxFee * GasLimit exceeded the maximum permitted transaction gas fee.");class Gn extends C{}f(Gn,"code",155215),f(Gn,"message","Unsupported operation for transaction.");class Wn extends C{}f(Wn,"code",155218),f(Wn,"message","Invalid number of nft in transaction request.");class Xn extends C{}f(Xn,"code",155219),f(Xn,"message","Invalid destination address.");class Qn extends C{}f(Qn,"code",155220),f(Qn,"message","Wallet and token's blockchain mismatch.");class Yn extends C{}f(Yn,"code",155221),f(Yn,"message","Invalid amounts in transfer request.");class Jn extends C{}f(Jn,"code",155222),f(Jn,"message","NFT metadata can not be found.");class Zn extends C{}f(Zn,"code",155223),f(Zn,"message","Unsupported userId for get transactions.");class es extends C{}f(es,"code",155224),f(es,"message","Failed to parse the provided amounts in request to decimals.");class ts extends C{}f(ts,"code",155225),f(ts,"message","Wallet and request's blockchain mismatch.");class rs extends C{}f(rs,"code",155226),f(rs,"message","Invalid source address.");class as extends C{}f(as,"code",155227),f(as,"message","Invalid transaction type.");class ns extends C{}f(ns,"code",155228),f(ns,"message","Missing token ID.");class ss extends C{}f(ss,"code",155229),f(ss,"message","Transaction is not eligible for operation.");class is extends C{}f(is,"code",155230),f(is,"message","No abi signature provided.");class os extends C{}f(os,"code",155231),f(os,"message","Transaction needs feeLevel or gasLimit provided.");class cs extends C{}f(cs,"code",155232),f(cs,"message","SCA transaction needs feeLevel provided.");class ls extends C{}f(ls,"code",155233),f(ls,"message","Provided gasLimit is too low to complete the requested transaction.");class us extends C{}f(us,"code",155234),f(us,"message","Transaction can't have both feeLevel and fee parameters provided.");class ps extends C{}f(ps,"code",155235),f(ps,"message","EIP1559 chains need maxFee/priorityFee provided.");class ds extends C{}f(ds,"code",155236),f(ds,"message","The provided fee in request is invalid.");class fs extends C{}f(fs,"code",155237),f(fs,"message","PriorityFee cannot be larger than maxFee in creating transaction request.");class hs extends C{}f(hs,"code",155238),f(hs,"message","Non-EIP1559 chains need gasPrice provided.");class ms extends C{}f(ms,"code",155239),f(ms,"message","Invalid token address for transfer.");class vs extends C{}f(vs,"code",155240),f(vs,"message","Invalid token standard for transfer.");class gs extends C{}f(gs,"code",155241),f(gs,"message","Invalid token decimal for transfer.");class xs extends C{}f(xs,"code",155242),f(xs,"message","The lengths of amounts and nft tokens don't match.");class ys extends C{}f(ys,"code",155243),f(ys,"message","Missing bytecode for contract deployment.");class bs extends C{}f(bs,"code",155244),f(bs,"message","Cannot provide both WalletID and SourceAddress/Blockchain.");class Es extends C{}f(Es,"code",155245),f(Es,"message","Invalid amount in contract execution request.");class Cs extends C{}f(Cs,"code",155247),f(Cs,"message","Cannot provide both CallData and AbiFunctionSignature/AbiParameters.");class Ts extends C{}f(Ts,"code",155254),f(Ts,"message","Non-EIP1559 chains don't support maxFee/priorityFee.");class Ss extends C{}f(Ss,"code",155257),f(Ss,"message","the transfer amount is insufficient to make the destination account rent exempted or the balance of the source account is insufficient to remain rent exempted. The source address's remaining balance after transfer must be either zero or above the rent exemption threshold.");class ws extends C{}f(ws,"code",155258),f(ws,"message","The asset amount owned by the wallet is insufficient for the transaction.");class As extends C{}f(As,"code",155262),f(As,"message","Account is not found, could be caused by transacting from a Solana account with zero balance.");class Is extends C{}f(Is,"code",155264),f(Is,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class Bs extends C{}f(Bs,"code",155501),f(Bs,"message","Frozen wallets can not be updated or interact with, only query.");class Rs extends C{}f(Rs,"code",155502),f(Rs,"message","Max amount of wallets (tentative 1M) reached under 1 wallet set.");class ks extends C{}f(ks,"code",155503),f(ks,"message","Metadata array length needs to match wallet count in create developer wallets request.");class _s extends C{}f(_s,"code",155504),f(_s,"message","Metadata array length needs to match number of blockchains in create user wallets request.");class Us extends C{}f(Us,"code",155505),f(Us,"message","SCA wallet needs to wait for first-time transaction to be queued before processing more transactions.");class Ns extends C{}f(Ns,"code",155506),f(Ns,"message","SCA wallet config is invalid.");class Ls extends C{}f(Ls,"code",155507),f(Ls,"message","SCA account is not supported on the given blockchain.");class Ps extends C{}f(Ps,"code",155508),f(Ps,"message","Can't create multiple user-controlled SCA wallets across multiple blockchains at a time.");class Os extends C{}f(Os,"code",155509),f(Os,"message","Entity needs to setup paymaster policy in developer console before sending transaction on mainnet");class Ds extends C{}f(Ds,"code",155510),f(Ds,"message","The operation is not supported on the blockchain you specify.");class Fs extends C{}f(Fs,"code",155511),f(Fs,"message","Blockchain is not supported for wallet creation.");class qs extends C{}f(qs,"code",155512),f(qs,"message","The owner of the SCA wallet can not be found.");class Vs extends C{}f(Vs,"code",155514),f(Vs,"message","circle_4337_v1 SCA wallet must be deployed before being upgraded.");class Ms extends C{}f(Ms,"code",155515),f(Ms,"message","The provided wallet account type is not supported by this API.");class js extends C{}f(js,"code",155516),f(js,"message","The source wallet was originally created on an SCA version that does not support wallet derivation.");class Ks extends C{}f(Ks,"code",155517),f(Ks,"message","The SCA wallet is not deployed onchain.");class zs extends C{}f(zs,"code",155601),f(zs,"message","Failed to retrieve wallet set which already exists.");class Hs extends C{}f(Hs,"code",155701),f(Hs,"message","User canceled");class $s extends C{}f($s,"code",155702),f($s,"message","<Launch UI failed reason>");class Gs extends C{}f(Gs,"code",155703),f(Gs,"message","The code you entered is not the same as the first one.");class Ws extends C{}f(Ws,"code",155704),f(Ws,"message","Your PIN can't have repeating or consecutive numbers.");class Xs extends C{}f(Xs,"code",155705),f(Xs,"message","Your hint can't be the same as the answer.");class Qs extends C{}f(Qs,"code",155706),f(Qs,"message","Network error");class Ys extends C{}f(Ys,"code",155707),f(Ys,"message","Failed to encrypt data");class Js extends C{}f(Js,"code",155708),f(Js,"message",'"Biometrics instead of PIN" is disabled');class Zs extends C{}f(Zs,"code",155709),f(Zs,"message","The device system doesn't support biometrics");class ei extends C{}f(ei,"code",155710),f(ei,"message","Failed to decrypt biometrics key");class ti extends C{}f(ti,"code",155711),f(ti,"message","The user has not enabled biometrics yet");class ri extends C{}f(ri,"code",155712),f(ri,"message","The user refused to enable biometrics");class ai extends C{}f(ai,"code",155713),f(ai,"message","Too many requests. Try again later");class ni extends C{}f(ni,"code",155714),f(ni,"message","Too many requests. The biometrics sensor on the device is locked.");class si extends C{}f(si,"code",155715),f(si,"message","The user didn't enable biometrics");class ii extends C{}f(ii,"code",155716),f(ii,"message","Unexpected error for biometrics");class oi extends C{}f(oi,"code",155717),f(oi,"message","User secret is missing.");class ci extends C{}f(ci,"code",155718),f(ci,"message","User secret is invalid.");class li extends C{}f(li,"code",155719),f(li,"message","User token and SDK API execute function does not match.");class ui extends C{}f(ui,"code",155720),f(ui,"message","Social login failed.");class pi extends C{}f(pi,"code",155721),f(pi,"message","Login info is missing.");class di extends C{}f(di,"code",155801),f(di,"message","Transaction or rawTransaction is invalid.");class fi extends C{}f(fi,"code",155802),f(fi,"message","Account not found.");class hi extends C{}f(hi,"code",155803),f(hi,"message","Not signer account.");class mi extends C{}f(mi,"code",155804),f(mi,"message","Transaction already signed.");class vi extends C{}f(vi,"code",155805),f(vi,"message","Transaction failed to deserialize.");class gi extends C{}f(gi,"code",155806),f(gi,"message","The transaction size exceeds blockchain limit.");class xi extends C{}f(xi,"code",155807),f(xi,"message","The chain ID is not supported for signing.");class yi extends C{}f(yi,"code",155808),f(yi,"message","The chain ID is missing in sign request.");class bi extends C{}f(bi,"code",156001),f(bi,"message","Cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller.");class Ei extends C{}f(Ei,"code",156002),f(Ei,"message","Cannot find target token in the system. Either the specified token doesn't exist or it's not accessible to the caller.");class Ci extends C{}f(Ci,"code",156003),f(Ci,"message","Cannot find target transaction in the system. Either the specified transaction doesn't exist or it's not accessible to the caller.");class Ti extends C{}f(Ti,"code",156004),f(Ti,"message","Reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext.");class Si extends C{}f(Si,"code",156005),f(Si,"message","Cannot find target wallet set in the system. Either no such wallet set, or it's not accessible to the caller.");class wi extends C{}f(wi,"code",156006),f(wi,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets.");class Ai extends C{}f(Ai,"code",156007),f(Ai,"message","TEST_API key or LIVE_API key is not found for the request.");class Ii extends C{}f(Ii,"code",156008),f(Ii,"message","Cannot find target entity config in the system. Either no such entity config, or it's not accessible to the caller.");class Bi extends C{}f(Bi,"code",156009),f(Bi,"message","Fail to parse id as UUID in url.");class Ri extends C{}f(Ri,"code",156010),f(Ri,"message","Cannot find the corresponding entity in the system.");class ki extends C{}f(ki,"code",156011),f(ki,"message","Cannot find target nftTokenId in the system.");class _i extends C{}f(_i,"code",156012),f(_i,"message","Cannot find corresponding pagination cursor in the system.");class Ui extends C{}f(Ui,"code",156013),f(Ui,"message","The provided entity secret is invalid.");class Ni extends C{}f(Ni,"code",156014),f(Ni,"message","Pagination params are invalid. Only UUID format is supported for pageBefore and pageAfter.");class Li extends C{}f(Li,"code",156015),f(Li,"message","The secret for this entity has already been set.");class Pi extends C{}f(Pi,"code",156016),f(Pi,"message","The entity secret has not been set yet. Please provide encrypted ciphertext in the console.");class Oi extends C{}f(Oi,"code",156017),f(Oi,"message","The specified blockchain parameters are incorrect.");class Di extends C{}f(Di,"code",156018),f(Di,"message","The uploaded recovery file is invalid.");class Fi extends C{}f(Fi,"code",156019),f(Fi,"message","Current entity secret is invalid. Please rotate the entity secret first.");class qi extends C{}f(qi,"code",156020),f(qi,"message","Please use a new idempotency key.");class Vi extends C{}f(Vi,"code",156021),f(Vi,"message","A new wallet set ID is required.");class Mi extends C{}f(Mi,"code",156023),f(Mi,"message","EncodedByHex is true in sign request, but the message is not hex encoded.");class ji extends C{}f(ji,"code",156024),f(ji,"message","Data is not a valid JSON string in sign request.");class Ki extends C{}f(Ki,"code",156025),f(Ki,"message","Invalid message in request.");class zi extends C{}f(zi,"code",156026),f(zi,"message","Invalid typed data in request.");class Hi extends C{}f(Hi,"code",156027),f(Hi,"message","The specified blockchain is either not supported or deprecated.");class $i extends C{}f($i,"code",156030),f($i,"message","Invalid unsigned delegate action in request.");class Gi extends C{}f(Gi,"code",156031),f(Gi,"message","The specified token address is not supported.");class Wi extends C{}f(Wi,"code",156032),f(Wi,"message","The provided amount is invalid.");class Xi extends C{}f(Xi,"code",175001),f(Xi,"message","contract not found");class Qi extends C{}f(Qi,"code",175002),f(Qi,"message","no ABI JSON for the target contract");class Yi extends C{}f(Yi,"code",175003),f(Yi,"message","constructor parameters length must match constructor signature");class Ji extends C{}f(Ji,"code",175004),f(Ji,"message","contract already exists");class Zi extends C{}f(Zi,"code",175005),f(Zi,"message","address is not a contract address");class eo extends C{}f(eo,"code",175006),f(eo,"message","contract is archived");class to extends C{}f(to,"code",175007),f(to,"message","invalid ABI JSON");class ro extends C{}f(ro,"code",175008),f(ro,"message","multi-layered proxies are not supported");class ao extends C{}f(ao,"code",175009),f(ao,"message","contract deployment pending");class no extends C{}f(no,"code",175010),f(no,"message","ABI function not found");class so extends C{}f(so,"code",175011),f(so,"message","empty update on a contract");class io extends C{}f(io,"code",175012),f(io,"message","unable to query contract");class oo extends C{}f(oo,"code",175013),f(oo,"message","ABI function is not supported");class co extends C{}f(co,"code",175201),f(co,"message","template not found");class lo extends C{}f(lo,"code",175202),f(lo,"message","deploying this template is temporarily disabled");class uo extends C{}f(uo,"code",175203),f(uo,"message","invalid template deployment parameter");class po extends C{}f(po,"code",175204),f(po,"message","missing required template deployment parameter");class fo extends C{}f(fo,"code",175205),f(fo,"message","estimation is not supported");class ho extends C{}f(ho,"code",175301),f(ho,"message","event subscription not found");class mo extends C{}f(mo,"code",175302),f(mo,"message","event subscription already exists");class vo extends C{}f(vo,"code",175303),f(vo,"message","the specified event signature does not exist");class go extends C{}f(go,"code",175401),f(go,"message","failed to parse id as UUID in url");class xo extends C{}f(xo,"code",175402),f(xo,"message","the specified blockchain is either not supported or deprecated");class yo extends C{}f(yo,"code",175403),f(yo,"message","please use a new idempotency key");class bo extends C{}f(bo,"code",175404),f(bo,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets");class Eo extends C{}f(Eo,"code",175405),f(Eo,"message","TEST_API key or LIVE_API key is not found for the request");class Co extends C{}f(Co,"code",175406),f(Co,"message","this feature is temporarily disabled");class To extends C{}f(To,"code",175407),f(To,"message","the specified blockchain is currently unavailable");class So extends C{}f(So,"code",175408),f(So,"message","can not find corresponding pagination cursor in the system");class wo extends C{}f(wo,"code",175409),f(wo,"message","restricted entity cannot perform this operation");class Ao extends C{}f(Ao,"code",175410),f(Ao,"message","invalid address format");class Io extends C{}f(Io,"code",177001),f(Io,"message","transaction nonce is inconsistent with sender's latest nonce");class Bo extends C{}f(Bo,"code",177002),f(Bo,"message","user op nonce can not be larger than 0 when smart contract wallet hasn't been deployed");class Ro extends C{}f(Ro,"code",177003),f(Ro,"message","failed to execute this request on EVM due to insufficient token when estimating fee");class ko extends C{}f(ko,"code",177004),f(ko,"message","the total cost of executing transaction is higher than the balance of the user's account when estimating fee");class _o extends C{}f(_o,"code",177005),f(_o,"message","the sender address is not token owner or approved when estimating token transfer");class Uo extends C{}f(Uo,"code",177006),f(Uo,"message","gas required exceeds allowance when estimating fee");class No extends C{}f(No,"code",177007),f(No,"message","estimate fee execution reverted");class Lo extends C{}f(Lo,"code",177008),f(Lo,"message","ABI function signature can't pack ABI parameter");class Po extends C{}f(Po,"code",177009),f(Po,"message","fails to perform transaction estimation");class Oo extends C{}f(Oo,"code",177010),f(Oo,"message","MaxFee * GasLimit exceeds configurable max transaction fee (default is 1 native token)");class Do extends C{}f(Do,"code",177011),f(Do,"message","transaction needs feeLevel or gasLimit provided");class Fo extends C{}f(Fo,"code",177012),f(Fo,"message","SCA transaction needs feeLevel provided");class qo extends C{}f(qo,"code",177013),f(qo,"message","EIP1559 chains need maxFee/priorityFee provided");class Vo extends C{}f(Vo,"code",177014),f(Vo,"message","priorityFee cannot be larger than maxFee in creating transaction request");class Mo extends C{}f(Mo,"code",177015),f(Mo,"message","missing bytecode for contract deployment");class jo extends C{}f(jo,"code",177016),f(jo,"message","cannot provide both WalletID and SourceAddress/Blockchain");class Ko extends C{}f(Ko,"code",177017),f(Ko,"message","invalid amount in contract execution request");class zo extends C{}f(zo,"code",177018),f(zo,"message","policy is not activated and cannot be used");class Ho extends C{}f(Ho,"code",177019),f(Ho,"message","exceeded max daily transaction of the policy");class $o extends C{}f($o,"code",177020),f($o,"message","exceeded max spend USD per transaction of the policy");class Go extends C{}f(Go,"code",177021),f(Go,"message","exceeded max spend USD daily of the policy");class Wo extends C{}f(Wo,"code",177022),f(Wo,"message","exceeded max native token daily of the policy");class Xo extends C{}f(Xo,"code",177023),f(Xo,"message","sender is in policy blocklist");class Qo extends C{}f(Qo,"code",177024),f(Qo,"message","Wallet and request's blockchain mismatch.");class Yo extends C{}f(Yo,"code",177025),f(Yo,"message","the asset amount owned by the wallet is insufficient for the transaction");class Jo extends C{}f(Jo,"code",177026),f(Jo,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class Zo extends C{}f(Zo,"code",177301),f(Zo,"message","wallet is Frozen");class ec extends C{}f(ec,"code",177302),f(ec,"message","invalid sca wallet config");class tc extends C{}f(tc,"code",177303),f(tc,"message","SCA wallet first-time transaction is still in progress");class rc extends C{}f(rc,"code",177304),f(rc,"message","SCA account is not supported on the given blockchain");class ac extends C{}f(ac,"code",177305),f(ac,"message","entity is not eligible for SCA account creation. Please check paymaster policy setup");class nc extends C{}f(nc,"code",177601),f(nc,"message","cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller");class sc extends C{}f(sc,"code",177602),f(sc,"message","reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext");class ic extends C{}f(ic,"code",177603),f(ic,"message","cannot find the corresponding entity in the system");class oc extends C{}f(oc,"code",177604),f(oc,"message","the provided entity secret is invalid");class cc extends C{}f(cc,"code",177605),f(cc,"message","the entity secret has not been set yet. Please provide encrypted ciphertext in the console");class lc extends C{}f(lc,"code",177606),f(lc,"message","current entity secret is invalid. Please rotate the entity secret first");class uc extends C{}f(uc,"code",177607),f(uc,"message","please use a new idempotency key");class pc extends C{}f(pc,"code",177901),f(pc,"message","smart contract query failed");const qf={undefined:C,[ba.code]:ba,[Ea.code]:Ea,[Ca.code]:Ca,[Ta.code]:Ta,[Sa.code]:Sa,[wa.code]:wa,[Aa.code]:Aa,[Ia.code]:Ia,[Ba.code]:Ba,[Ra.code]:Ra,[Fa.code]:Fa,[qa.code]:qa,[Va.code]:Va,[Ma.code]:Ma,[ja.code]:ja,[Ka.code]:Ka,[za.code]:za,[Ha.code]:Ha,[$a.code]:$a,[Ga.code]:Ga,[Wa.code]:Wa,[Xa.code]:Xa,[Qa.code]:Qa,[Ya.code]:Ya,[Ja.code]:Ja,[Za.code]:Za,[en.code]:en,[tn.code]:tn,[rn.code]:rn,[an.code]:an,[nn.code]:nn,[sn.code]:sn,[on.code]:on,[cn.code]:cn,[ln.code]:ln,[un.code]:un,[pn.code]:pn,[dn.code]:dn,[fn.code]:fn,[hn.code]:hn,[mn.code]:mn,[vn.code]:vn,[gn.code]:gn,[xn.code]:xn,[yn.code]:yn,[bn.code]:bn,[En.code]:En,[Cn.code]:Cn,[Tn.code]:Tn,[Sn.code]:Sn,[wn.code]:wn,[An.code]:An,[In.code]:In,[Bn.code]:Bn,[Rn.code]:Rn,[kn.code]:kn,[_n.code]:_n,[Un.code]:Un,[Nn.code]:Nn,[Ln.code]:Ln,[Pn.code]:Pn,[On.code]:On,[Dn.code]:Dn,[Fn.code]:Fn,[qn.code]:qn,[Vn.code]:Vn,[Mn.code]:Mn,[jn.code]:jn,[Kn.code]:Kn,[zn.code]:zn,[Hn.code]:Hn,[$n.code]:$n,[Gn.code]:Gn,[Wn.code]:Wn,[Xn.code]:Xn,[Qn.code]:Qn,[Yn.code]:Yn,[Jn.code]:Jn,[Zn.code]:Zn,[es.code]:es,[ts.code]:ts,[rs.code]:rs,[as.code]:as,[ns.code]:ns,[ss.code]:ss,[is.code]:is,[os.code]:os,[cs.code]:cs,[ls.code]:ls,[us.code]:us,[ps.code]:ps,[ds.code]:ds,[fs.code]:fs,[hs.code]:hs,[ms.code]:ms,[vs.code]:vs,[gs.code]:gs,[xs.code]:xs,[ys.code]:ys,[bs.code]:bs,[Es.code]:Es,[Cs.code]:Cs,[Ts.code]:Ts,[Ss.code]:Ss,[ws.code]:ws,[As.code]:As,[Is.code]:Is,[Bs.code]:Bs,[Rs.code]:Rs,[ks.code]:ks,[_s.code]:_s,[Us.code]:Us,[Ns.code]:Ns,[Ls.code]:Ls,[Ps.code]:Ps,[Os.code]:Os,[Ds.code]:Ds,[Fs.code]:Fs,[qs.code]:qs,[Vs.code]:Vs,[Ms.code]:Ms,[js.code]:js,[Ks.code]:Ks,[zs.code]:zs,[Hs.code]:Hs,[$s.code]:$s,[Gs.code]:Gs,[Ws.code]:Ws,[Xs.code]:Xs,[Qs.code]:Qs,[Ys.code]:Ys,[Js.code]:Js,[Zs.code]:Zs,[ei.code]:ei,[ti.code]:ti,[ri.code]:ri,[ai.code]:ai,[ni.code]:ni,[si.code]:si,[ii.code]:ii,[oi.code]:oi,[ci.code]:ci,[li.code]:li,[ui.code]:ui,[pi.code]:pi,[di.code]:di,[fi.code]:fi,[hi.code]:hi,[mi.code]:mi,[vi.code]:vi,[gi.code]:gi,[xi.code]:xi,[yi.code]:yi,[bi.code]:bi,[Ei.code]:Ei,[Ci.code]:Ci,[Ti.code]:Ti,[Si.code]:Si,[wi.code]:wi,[Ai.code]:Ai,[Ii.code]:Ii,[Bi.code]:Bi,[Ri.code]:Ri,[ki.code]:ki,[_i.code]:_i,[Ui.code]:Ui,[Ni.code]:Ni,[Li.code]:Li,[Pi.code]:Pi,[Oi.code]:Oi,[Di.code]:Di,[Fi.code]:Fi,[qi.code]:qi,[Vi.code]:Vi,[Mi.code]:Mi,[ji.code]:ji,[Ki.code]:Ki,[zi.code]:zi,[Hi.code]:Hi,[$i.code]:$i,[Gi.code]:Gi,[Wi.code]:Wi,[Xi.code]:Xi,[Qi.code]:Qi,[Yi.code]:Yi,[Ji.code]:Ji,[Zi.code]:Zi,[eo.code]:eo,[to.code]:to,[ro.code]:ro,[ao.code]:ao,[no.code]:no,[so.code]:so,[io.code]:io,[oo.code]:oo,[co.code]:co,[lo.code]:lo,[uo.code]:uo,[po.code]:po,[fo.code]:fo,[ho.code]:ho,[mo.code]:mo,[vo.code]:vo,[go.code]:go,[xo.code]:xo,[yo.code]:yo,[bo.code]:bo,[Eo.code]:Eo,[Co.code]:Co,[To.code]:To,[So.code]:So,[wo.code]:wo,[Ao.code]:Ao,[Io.code]:Io,[Bo.code]:Bo,[Ro.code]:Ro,[ko.code]:ko,[_o.code]:_o,[Uo.code]:Uo,[No.code]:No,[Lo.code]:Lo,[Po.code]:Po,[Oo.code]:Oo,[Do.code]:Do,[Fo.code]:Fo,[qo.code]:qo,[Vo.code]:Vo,[Mo.code]:Mo,[jo.code]:jo,[Ko.code]:Ko,[zo.code]:zo,[Ho.code]:Ho,[$o.code]:$o,[Go.code]:Go,[Wo.code]:Wo,[Xo.code]:Xo,[Qo.code]:Qo,[Yo.code]:Yo,[Jo.code]:Jo,[Zo.code]:Zo,[ec.code]:ec,[tc.code]:tc,[rc.code]:rc,[ac.code]:ac,[nc.code]:nc,[sc.code]:sc,[ic.code]:ic,[oc.code]:oc,[cc.code]:cc,[lc.code]:lc,[uc.code]:uc,[pc.code]:pc};function D1(e){return qf[e]??qf.undefined}function F1(e){const t=e.response.data,a=e.response.status;return q1({code:t?.code??a,status:a,message:t?.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function q1({code:e,status:t,message:a,url:r,method:n,error:i}){const s=D1(e);return new s({message:a,code:e,url:r,method:n,status:t,error:i})}function te(e){return e.response?F1(e):N1(e)}const ae=e=>{const{data:t,headers:a,...r}=e;return{...r,data:t.data,headers:a}},V1=({configurationsClient:e})=>async t=>{try{return ae(await e.MonitorTokens.createMonitoredTokens(t))}catch(a){throw re(a)?te(a):a}},M1=({configurationsClient:e})=>async t=>{try{return await e.MonitorTokens.deleteMonitoredTokens(t)}catch(a){throw re(a)?te(a):a}},j1=({configurationsClient:e})=>async t=>{try{return ae(await e.MonitorTokens.listMonitoredTokens(t?.blockchain,t?.tokenAddress,t?.symbol,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize))}catch(a){throw re(a)?te(a):a}},K1=({configurationsClient:e})=>async t=>{try{return ae(await e.MonitorTokens.updateMonitoredTokens(t))}catch(a){throw re(a)?te(a):a}},z1=({configurationsClient:e})=>async t=>{try{return await e.MonitorTokens.updateMonitoredTokensScope(t)}catch(a){throw re(a)?te(a):a}},H1=({configurationsClient:e})=>async t=>{try{return ae(await e.WebhookSubscriptions.createSubscription(t))}catch(a){throw re(a)?te(a):a}},$1=({configurationsClient:e})=>async t=>{try{return await e.WebhookSubscriptions.deleteSubscription(t)}catch(a){throw re(a)?te(a):a}},G1=({configurationsClient:e})=>async t=>{try{return ae(await e.WebhookSubscriptions.getSubscription(t))}catch(a){throw re(a)?te(a):a}},W1=({configurationsClient:e})=>async t=>{try{return ae(await e.WebhookSubscriptions.getNotificationSignature(t))}catch(a){throw re(a)?te(a):a}},X1=({configurationsClient:e})=>async()=>{try{return ae(await e.WebhookSubscriptions.getSubscriptions())}catch(t){throw re(t)?te(t):t}},Q1=({configurationsClient:e})=>async({id:t,...a})=>{try{return ae(await e.WebhookSubscriptions.updateSubscription(t,a))}catch(r){throw re(r)?te(r):r}};var Y1=Object.defineProperty,J1=(e,t,a)=>t in e?Y1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Z1=(e,t,a)=>J1(e,typeof t!="symbol"?t+"":t,a);class eb{constructor(){Z1(this,"data",{})}get(t){return Promise.resolve(this.data[t]??void 0)}set(t,a){return a===void 0?delete this.data[t]:this.data[t]=a,Promise.resolve()}}var le={options:{usePureJavaScript:!1}},Nu={},tb=Nu,Vf={};Nu.encode=function(e,t,a){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(a!==void 0&&typeof a!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=rb(e,t);else{var n=0,i=t.length,s=t.charAt(0),o=[0];for(n=0;n<e.length;++n){for(var c=0,l=e[n];c<o.length;++c)l+=o[c]<<8,o[c]=l%i,l=l/i|0;for(;l>0;)o.push(l%i),l=l/i|0}for(n=0;e[n]===0&&n<e.length-1;++n)r+=s;for(n=o.length-1;n>=0;--n)r+=t[o[n]]}if(a){var u=new RegExp(".{1,"+a+"}","g");r=r.match(u).join(`\r
|
|
26
|
-
`)}return r},Nu.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var a=Vf[t];if(!a){a=Vf[t]=[];for(var r=0;r<t.length;++r)a[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var n=t.length,i=t.charAt(0),s=[0],r=0;r<e.length;r++){var o=a[e.charCodeAt(r)];if(o===void 0)return;for(var c=0,l=o;c<s.length;++c)l+=s[c]*n,s[c]=l&255,l>>=8;for(;l>0;)s.push(l&255),l>>=8}for(var u=0;e[u]===i&&u<e.length-1;++u)s.push(0);return typeof Buffer<"u"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function rb(e,t){var a=0,r=t.length,n=t.charAt(0),i=[0];for(a=0;a<e.length();++a){for(var s=0,o=e.at(a);s<i.length;++s)o+=i[s]<<8,i[s]=o%r,o=o/r|0;for(;o>0;)i.push(o%r),o=o/r|0}var c="";for(a=0;e.at(a)===0&&a<e.length()-1;++a)c+=n;for(a=i.length-1;a>=0;--a)c+=t[i[a]];return c}var Mf=le,jf=tb,w=Mf.util=Mf.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){w.nextTick=process.nextTick,typeof setImmediate=="function"?w.setImmediate=setImmediate:w.setImmediate=w.nextTick;return}if(typeof setImmediate=="function"){w.setImmediate=function(){return setImmediate.apply(void 0,arguments)},w.nextTick=function(s){return setImmediate(s)};return}if(w.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(o){if(o.source===window&&o.data===e){o.stopPropagation();var c=t.slice();t.length=0,c.forEach(function(l){l()})}};var e="forge.setImmediate",t=[];w.setImmediate=function(o){t.push(o),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var a=Date.now(),r=!0,n=document.createElement("div"),t=[];new MutationObserver(function(){var o=t.slice();t.length=0,o.forEach(function(c){c()})}).observe(n,{attributes:!0});var i=w.setImmediate;w.setImmediate=function(o){Date.now()-a>15?(a=Date.now(),i(o)):(t.push(o),t.length===1&&n.setAttribute("a",r=!r))}}w.nextTick=w.setImmediate})(),w.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,w.globalScope=(function(){return w.isNodejs?em:typeof self>"u"?window:self})(),w.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},w.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer},w.isArrayBufferView=function(e){return e&&w.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function dc(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}w.ByteBuffer=Lu;function Lu(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(w.isArrayBuffer(e)||w.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var a=0;a<t.length;++a)this.putByte(t[a])}}else(e instanceof Lu||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}w.ByteStringBuffer=Lu;var ab=4096;w.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>ab&&(this.data.substr(0,1),this._constructedStringLength=0)},w.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},w.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},w.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},w.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var a=this.data;t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return this.data=a,this._optimizeConstructedString(t),this},w.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},w.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(w.encodeUtf8(e))},w.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},w.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},w.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},w.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))},w.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},w.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},w.ByteStringBuffer.prototype.putInt=function(e,t){dc(t);var a="";do t-=8,a+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(a)},w.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},w.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},w.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},w.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},w.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},w.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},w.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},w.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},w.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},w.ByteStringBuffer.prototype.getInt=function(e){dc(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t},w.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},w.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},w.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},w.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},w.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},w.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},w.ByteStringBuffer.prototype.copy=function(){var e=w.createBuffer(this.data);return e.read=this.read,e},w.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},w.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},w.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},w.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var a=this.data.charCodeAt(t);a<16&&(e+="0"),e+=a.toString(16)}return e},w.ByteStringBuffer.prototype.toString=function(){return w.decodeUtf8(this.bytes())};function nb(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var a=w.isArrayBuffer(e),r=w.isArrayBufferView(e);if(a||r){a?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}w.DataBuffer=nb,w.DataBuffer.prototype.length=function(){return this.write-this.read},w.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},w.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var a=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(a),this.data=new DataView(r.buffer),this},w.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},w.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var a=0;a<t;++a)this.data.setUint8(e);return this},w.DataBuffer.prototype.putBytes=function(e,t){if(w.isArrayBufferView(e)){var a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=a.byteLength-a.byteOffset;this.accommodate(r);var n=new Uint8Array(this.data.buffer,this.write);return n.set(a),this.write+=r,this}if(w.isArrayBuffer(e)){var a=new Uint8Array(e);this.accommodate(a.byteLength);var n=new Uint8Array(this.data.buffer);return n.set(a,this.write),this.write+=a.byteLength,this}if(e instanceof w.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&w.isArrayBufferView(e.data)){var a=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(a.byteLength);var n=new Uint8Array(e.data.byteLength,this.write);return n.set(a),this.write+=a.byteLength,this}if(e instanceof w.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var i;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=w.binary.hex.decode(e,i,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=w.binary.base64.decode(e,i,this.write),this;if(t==="utf8"&&(e=w.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=w.binary.raw.decode(i),this;if(t==="utf16")return this.accommodate(e.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=w.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},w.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},w.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},w.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},w.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},w.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},w.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},w.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},w.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},w.DataBuffer.prototype.putInt=function(e,t){dc(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this},w.DataBuffer.prototype.putSignedInt=function(e,t){return dc(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},w.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},w.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},w.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},w.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},w.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},w.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},w.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},w.DataBuffer.prototype.getInt=function(e){dc(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t},w.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},w.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},w.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},w.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},w.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},w.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},w.DataBuffer.prototype.copy=function(){return new w.DataBuffer(this)},w.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},w.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},w.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},w.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var a=this.data.getUint8(t);a<16&&(e+="0"),e+=a.toString(16)}return e},w.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return w.binary.raw.encode(t);if(e==="hex")return w.binary.hex.encode(t);if(e==="base64")return w.binary.base64.encode(t);if(e==="utf8")return w.text.utf8.decode(t);if(e==="utf16")return w.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},w.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=w.encodeUtf8(e)),new w.ByteBuffer(e)},w.fillString=function(e,t){for(var a="";t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return a},w.xorBytes=function(e,t,a){for(var r="",n="",i="",s=0,o=0;a>0;--a,++s)n=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(r+=i,i="",o=0),i+=String.fromCharCode(n),++o;return r+=i,r},w.hexToBytes=function(e){var t="",a=0;for(e.length&!0&&(a=1,t+=String.fromCharCode(parseInt(e[0],16)));a<e.length;a+=2)t+=String.fromCharCode(parseInt(e.substr(a,2),16));return t},w.bytesToHex=function(e){return w.createBuffer(e).toHex()},w.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var or="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",cr=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Kf="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";w.encode64=function(e,t){for(var a="",r="",n,i,s,o=0;o<e.length;)n=e.charCodeAt(o++),i=e.charCodeAt(o++),s=e.charCodeAt(o++),a+=or.charAt(n>>2),a+=or.charAt((n&3)<<4|i>>4),isNaN(i)?a+="==":(a+=or.charAt((i&15)<<2|s>>6),a+=isNaN(s)?"=":or.charAt(s&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
|
|
27
|
-
`,a=a.substr(t));return r+=a,r},w.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",a,r,n,i,s=0;s<e.length;)a=cr[e.charCodeAt(s++)-43],r=cr[e.charCodeAt(s++)-43],n=cr[e.charCodeAt(s++)-43],i=cr[e.charCodeAt(s++)-43],t+=String.fromCharCode(a<<2|r>>4),n!==64&&(t+=String.fromCharCode((r&15)<<4|n>>2),i!==64&&(t+=String.fromCharCode((n&3)<<6|i)));return t},w.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},w.decodeUtf8=function(e){return decodeURIComponent(escape(e))},w.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:jf.encode,decode:jf.decode}},w.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},w.binary.raw.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var n=a,i=0;i<e.length;++i)r[n++]=e.charCodeAt(i);return t?n-a:r},w.binary.hex.encode=w.bytesToHex,w.binary.hex.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2))),a=a||0;var n=0,i=a;for(e.length&1&&(n=1,r[i++]=parseInt(e[0],16));n<e.length;n+=2)r[i++]=parseInt(e.substr(n,2),16);return t?i-a:r},w.binary.base64.encode=function(e,t){for(var a="",r="",n,i,s,o=0;o<e.byteLength;)n=e[o++],i=e[o++],s=e[o++],a+=or.charAt(n>>2),a+=or.charAt((n&3)<<4|i>>4),isNaN(i)?a+="==":(a+=or.charAt((i&15)<<2|s>>6),a+=isNaN(s)?"=":or.charAt(s&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
|
|
28
|
-
`,a=a.substr(t));return r+=a,r},w.binary.base64.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),a=a||0;for(var n,i,s,o,c=0,l=a;c<e.length;)n=cr[e.charCodeAt(c++)-43],i=cr[e.charCodeAt(c++)-43],s=cr[e.charCodeAt(c++)-43],o=cr[e.charCodeAt(c++)-43],r[l++]=n<<2|i>>4,s!==64&&(r[l++]=(i&15)<<4|s>>2,o!==64&&(r[l++]=(s&3)<<6|o));return t?l-a:r.subarray(0,l)},w.binary.base58.encode=function(e,t){return w.binary.baseN.encode(e,Kf,t)},w.binary.base58.decode=function(e,t){return w.binary.baseN.decode(e,Kf,t)},w.text={utf8:{},utf16:{}},w.text.utf8.encode=function(e,t,a){e=w.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var n=a,i=0;i<e.length;++i)r[n++]=e.charCodeAt(i);return t?n-a:r},w.text.utf8.decode=function(e){return w.decodeUtf8(String.fromCharCode.apply(null,e))},w.text.utf16.encode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length*2));var n=new Uint16Array(r.buffer);a=a||0;for(var i=a,s=a,o=0;o<e.length;++o)n[s++]=e.charCodeAt(o),i+=2;return t?i-a:r},w.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},w.deflate=function(e,t,a){if(t=w.decode64(e.deflate(w.encode64(t)).rval),a){var r=2,n=t.charCodeAt(1);n&32&&(r=6),t=t.substring(r,t.length-4)}return t},w.inflate=function(e,t,a){var r=e.inflate(w.encode64(t)).rval;return r===null?null:w.decode64(r)};var Pu=function(e,t,a){if(!e)throw new Error("WebStorage not available.");var r;if(a===null?r=e.removeItem(t):(a=w.encode64(JSON.stringify(a)),r=e.setItem(t,a)),typeof r<"u"&&r.rval!==!0){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}},Ou=function(e,t){if(!e)throw new Error("WebStorage not available.");var a=e.getItem(t);if(e.init)if(a.rval===null){if(a.error){var r=new Error(a.error.message);throw r.id=a.error.id,r.name=a.error.name,r}a=null}else a=a.rval;return a!==null&&(a=JSON.parse(w.decode64(a))),a},sb=function(e,t,a,r){var n=Ou(e,t);n===null&&(n={}),n[a]=r,Pu(e,t,n)},ib=function(e,t,a){var r=Ou(e,t);return r!==null&&(r=a in r?r[a]:null),r},ob=function(e,t,a){var r=Ou(e,t);if(r!==null&&a in r){delete r[a];var n=!0;for(var i in r){n=!1;break}n&&(r=null),Pu(e,t,r)}},cb=function(e,t){Pu(e,t,null)},Yc=function(e,t,a){var r=null;typeof a>"u"&&(a=["web","flash"]);var n,i=!1,s=null;for(var o in a){n=a[o];try{if(n==="flash"||n==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),i=n==="flash"}(n==="web"||n==="both")&&(t[0]=localStorage,r=e.apply(this,t),i=!0)}catch(c){s=c}if(i)break}if(!i)throw s;return r};w.setItem=function(e,t,a,r,n){Yc(sb,arguments,n)},w.getItem=function(e,t,a,r){return Yc(ib,arguments,r)},w.removeItem=function(e,t,a,r){Yc(ob,arguments,r)},w.clearItems=function(e,t,a){Yc(cb,arguments,a)},w.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},w.format=function(e){for(var t=/%./g,a,r,n=0,i=[],s=0;a=t.exec(e);){r=e.substring(s,t.lastIndex-2),r.length>0&&i.push(r),s=t.lastIndex;var o=a[0][1];switch(o){case"s":case"o":n<arguments.length?i.push(arguments[n+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(e.substring(s)),i.join("")},w.formatNumber=function(e,t,a,r){var n=e,i=isNaN(t=Math.abs(t))?2:t,s=a===void 0?",":a,o=r===void 0?".":r,c=n<0?"-":"",l=parseInt(n=Math.abs(+n||0).toFixed(i),10)+"",u=l.length>3?l.length%3:0;return c+(u?l.substr(0,u)+o:"")+l.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?s+Math.abs(n-l).toFixed(i).slice(2):"")},w.formatSize=function(e){return e>=1073741824?e=w.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=w.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=w.formatNumber(e/1024,0)+" KiB":e=w.formatNumber(e,0)+" bytes",e},w.bytesFromIP=function(e){return e.indexOf(".")!==-1?w.bytesFromIPv4(e):e.indexOf(":")!==-1?w.bytesFromIPv6(e):null},w.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=w.createBuffer(),a=0;a<e.length;++a){var r=parseInt(e[a],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()},w.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(s){return s.length===0&&++t,!0});for(var a=(8-e.length+t)*2,r=w.createBuffer(),n=0;n<8;++n){if(!e[n]||e[n].length===0){r.fillWithByte(0,a),a=0;continue}var i=w.hexToBytes(e[n]);i.length<2&&r.putByte(0),r.putBytes(i)}return r.getBytes()},w.bytesToIP=function(e){return e.length===4?w.bytesToIPv4(e):e.length===16?w.bytesToIPv6(e):null},w.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a));return t.join(".")},w.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],a=[],r=0,n=0;n<e.length;n+=2){for(var i=w.bytesToHex(e[n]+e[n+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var s=a[a.length-1],o=t.length;!s||o!==s.end+1?a.push({start:o,end:o}):(s.end=o,s.end-s.start>a[r].end-a[r].start&&(r=a.length-1))}t.push(i)}if(a.length>0){var c=a[r];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),c.start===0&&t.unshift(""),c.end===7&&t.push(""))}return t.join(":")},w.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in w&&!e.update)return t(null,w.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return w.cores=navigator.hardwareConcurrency,t(null,w.cores);if(typeof Worker>"u")return w.cores=1,t(null,w.cores);if(typeof Blob>"u")return w.cores=2,t(null,w.cores);var a=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){var o=Date.now(),c=o+4;self.postMessage({st:o,et:c})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(s,o,c){if(o===0){var l=Math.floor(s.reduce(function(u,p){return u+p},0)/s.length);return w.cores=Math.max(1,l),URL.revokeObjectURL(a),t(null,w.cores)}n(c,function(u,p){s.push(i(c,p)),r(s,o-1,c)})}function n(s,o){for(var c=[],l=[],u=0;u<s;++u){var p=new Worker(a);p.addEventListener("message",function(d){if(l.push(d.data),l.length===s){for(var g=0;g<s;++g)c[g].terminate();o(null,l)}}),c.push(p)}for(var u=0;u<s;++u)c[u].postMessage(u)}function i(s,o){for(var c=[],l=0;l<s;++l)for(var u=o[l],p=c[l]=[],d=0;d<s;++d)if(l!==d){var g=o[d];(u.st>g.st&&u.st<g.et||g.st>u.st&&g.st<u.et)&&p.push(d)}return c.reduce(function(h,y){return Math.max(h,y.length)},0)}};var st=le;st.cipher=st.cipher||{},st.cipher.algorithms=st.cipher.algorithms||{},st.cipher.createCipher=function(e,t){var a=e;if(typeof a=="string"&&(a=st.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new st.cipher.BlockCipher({algorithm:a,key:t,decrypt:!1})},st.cipher.createDecipher=function(e,t){var a=e;if(typeof a=="string"&&(a=st.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new st.cipher.BlockCipher({algorithm:a,key:t,decrypt:!0})},st.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),st.cipher.algorithms[e]=t},st.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in st.cipher.algorithms?st.cipher.algorithms[e]:null};var Du=st.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};Du.prototype.start=function(e){e=e||{};var t={};for(var a in e)t[a]=e[a];t.decrypt=this._decrypt,this._finish=!1,this._input=st.util.createBuffer(),this.output=e.output||st.util.createBuffer(),this.mode.start(t)},Du.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},Du.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(a){return e(this.blockSize,a,!1)},this.mode.unpad=function(a){return e(this.blockSize,a,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))};var it=le;it.cipher=it.cipher||{};var fe=it.cipher.modes=it.cipher.modes||{};fe.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},fe.ecb.prototype.start=function(e){},fe.ecb.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},fe.ecb.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},fe.ecb.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},fe.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},fe.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},fe.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=Jc(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},fe.cbc.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock},fe.cbc.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)},fe.cbc.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},fe.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},fe.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=it.util.createBuffer(),this._partialBytes=0},fe.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Jc(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},fe.cfb.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32()^this._outBlock[n],t.putInt32(this._inBlock[n]);return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},fe.cfb.prototype.decrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32(),t.putInt32(this._inBlock[n]^this._outBlock[n]);return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},fe.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=it.util.createBuffer(),this._partialBytes=0},fe.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Jc(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},fe.ofb.prototype.encrypt=function(e,t,a){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},fe.ofb.prototype.decrypt=fe.ofb.prototype.encrypt,fe.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=it.util.createBuffer(),this._partialBytes=0},fe.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Jc(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},fe.ctr.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]);else{var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}Zc(this._inBlock)},fe.ctr.prototype.decrypt=fe.ctr.prototype.encrypt,fe.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=it.util.createBuffer(),this._partialBytes=0,this._R=3774873600},fe.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=it.util.createBuffer(e.iv);this._cipherLength=0;var a;if("additionalData"in e?a=it.util.createBuffer(e.additionalData):a=it.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=it.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=t.length();if(r===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Fu(r*8)))}this._inBlock=this._j0.slice(0),Zc(this._inBlock),this._partialBytes=0,a=it.util.createBuffer(a),this._aDataLength=Fu(a.length()*8);var n=a.length()%this.blockSize;for(n&&a.fillWithByte(0,this.blockSize-n),this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])},fe.gcm.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^=e.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i<=0||a){if(a){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var n=0;n<this._ints;++n)this._outBlock[n]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Zc(this._inBlock)},fe.gcm.prototype.decrypt=function(e,t,a){var r=e.length();if(r<this.blockSize&&!(a&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Zc(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^this._hashBlock[n]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize},fe.gcm.prototype.afterFinish=function(e,t){var a=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=it.util.createBuffer();var r=this._aDataLength.concat(Fu(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var n=[];this.cipher.encrypt(this._j0,n);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^n[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(a=!1),a},fe.gcm.prototype.multiply=function(e,t){for(var a=[0,0,0,0],r=t.slice(0),n=0;n<128;++n){var i=e[n/32|0]&1<<31-n%32;i&&(a[0]^=r[0],a[1]^=r[1],a[2]^=r[2],a[3]^=r[3]),this.pow(r,r)}return a},fe.gcm.prototype.pow=function(e,t){for(var a=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,a&&(t[0]^=this._R)},fe.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],a=0;a<32;++a){var r=a/8|0,n=e[r]>>>(7-a%8)*4&15,i=this._m[a][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},fe.gcm.prototype.ghash=function(e,t,a){return t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3],this.tableMultiply(t)},fe.gcm.prototype.generateHashTable=function(e,t){for(var a=8/t,r=4*a,n=16*a,i=new Array(n),s=0;s<n;++s){var o=[0,0,0,0],c=s/r|0,l=(r-1-s%r)*t;o[c]=1<<t-1<<l,i[s]=this.generateSubHashTable(this.multiply(o,e),t)}return i},fe.gcm.prototype.generateSubHashTable=function(e,t){var a=1<<t,r=a>>>1,n=new Array(a);n[r]=e.slice(0);for(var i=r>>>1;i>0;)this.pow(n[2*i],n[i]=[]),i>>=1;for(i=2;i<r;){for(var s=1;s<i;++s){var o=n[i],c=n[s];n[i+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}i*=2}for(n[0]=[0,0,0,0],i=r+1;i<a;++i){var l=n[i^r];n[i]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return n};function Jc(e,t){if(typeof e=="string"&&(e=it.util.createBuffer(e)),it.util.isArray(e)&&e.length>4){var a=e;e=it.util.createBuffer();for(var r=0;r<a.length;++r)e.putByte(a[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!it.util.isArray(e)){for(var n=[],i=t/4,r=0;r<i;++r)n.push(e.getInt32());e=n}return e}function Zc(e){e[e.length-1]=e[e.length-1]+1&4294967295}function Fu(e){return[e/4294967296|0,e&4294967295]}var Fe=le;Fe.aes=Fe.aes||{},Fe.aes.startEncrypting=function(e,t,a,r){var n=el({key:e,output:a,decrypt:!1,mode:r});return n.start(t),n},Fe.aes.createEncryptionCipher=function(e,t){return el({key:e,output:null,decrypt:!1,mode:t})},Fe.aes.startDecrypting=function(e,t,a,r){var n=el({key:e,output:a,decrypt:!0,mode:r});return n.start(t),n},Fe.aes.createDecryptionCipher=function(e,t){return el({key:e,output:null,decrypt:!0,mode:t})},Fe.aes.Algorithm=function(e,t){qu||Hf();var a=this;a.name=e,a.mode=new t({blockSize:16,cipher:{encrypt:function(r,n){return Mu(a._w,r,n,!1)},decrypt:function(r,n){return Mu(a._w,r,n,!0)}}}),a._init=!1},Fe.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,a;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Fe.util.createBuffer(t);else if(Fe.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){a=t,t=Fe.util.createBuffer();for(var r=0;r<a.length;++r)t.putByte(a[r])}if(!Fe.util.isArray(t)){a=t,t=[];var n=a.length();if(n===16||n===24||n===32){n=n>>>2;for(var r=0;r<n;++r)t.push(a.getInt32())}}if(!Fe.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var i=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(i)!==-1;this._w=$f(t,e.decrypt&&!s),this._init=!0}},Fe.aes._expandKey=function(e,t){return qu||Hf(),$f(e,t)},Fe.aes._updateBlock=Mu,Gr("AES-ECB",Fe.cipher.modes.ecb),Gr("AES-CBC",Fe.cipher.modes.cbc),Gr("AES-CFB",Fe.cipher.modes.cfb),Gr("AES-OFB",Fe.cipher.modes.ofb),Gr("AES-CTR",Fe.cipher.modes.ctr),Gr("AES-GCM",Fe.cipher.modes.gcm);function Gr(e,t){var a=function(){return new Fe.aes.Algorithm(e,t)};Fe.cipher.registerAlgorithm(e,a)}var qu=!1,Wr=4,Et,Vu,zf,Br,jt;function Hf(){qu=!0,zf=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;Et=new Array(256),Vu=new Array(256),Br=new Array(4),jt=new Array(4);for(var t=0;t<4;++t)Br[t]=new Array(256),jt[t]=new Array(256);for(var a=0,r=0,n,i,s,o,c,l,u,t=0;t<256;++t){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,Et[a]=o,Vu[o]=a,c=e[o],n=e[a],i=e[n],s=e[i],l=c<<24^o<<16^o<<8^(o^c),u=(n^i^s)<<24^(a^s)<<16^(a^i^s)<<8^(a^n^s);for(var p=0;p<4;++p)Br[p][a]=l,jt[p][o]=u,l=l<<24|l>>>8,u=u<<24|u>>>8;a===0?a=r=1:(a=n^e[e[e[n^s]]],r^=e[e[r]])}}function $f(e,t){for(var a=e.slice(0),r,n=1,i=a.length,s=i+6+1,o=Wr*s,c=i;c<o;++c)r=a[c-1],c%i===0?(r=Et[r>>>16&255]<<24^Et[r>>>8&255]<<16^Et[r&255]<<8^Et[r>>>24]^zf[n]<<24,n++):i>6&&c%i===4&&(r=Et[r>>>24]<<24^Et[r>>>16&255]<<16^Et[r>>>8&255]<<8^Et[r&255]),a[c]=a[c-i]^r;if(t){var l,u=jt[0],p=jt[1],d=jt[2],g=jt[3],h=a.slice(0);o=a.length;for(var c=0,y=o-Wr;c<o;c+=Wr,y-=Wr)if(c===0||c===o-Wr)h[c]=a[y],h[c+1]=a[y+3],h[c+2]=a[y+2],h[c+3]=a[y+1];else for(var b=0;b<Wr;++b)l=a[y+b],h[c+(3&-b)]=u[Et[l>>>24]]^p[Et[l>>>16&255]]^d[Et[l>>>8&255]]^g[Et[l&255]];a=h}return a}function Mu(e,t,a,r){var n=e.length/4-1,i,s,o,c,l;r?(i=jt[0],s=jt[1],o=jt[2],c=jt[3],l=Vu):(i=Br[0],s=Br[1],o=Br[2],c=Br[3],l=Et);var u,p,d,g,h,y,b;u=t[0]^e[0],p=t[r?3:1]^e[1],d=t[2]^e[2],g=t[r?1:3]^e[3];for(var E=3,I=1;I<n;++I)h=i[u>>>24]^s[p>>>16&255]^o[d>>>8&255]^c[g&255]^e[++E],y=i[p>>>24]^s[d>>>16&255]^o[g>>>8&255]^c[u&255]^e[++E],b=i[d>>>24]^s[g>>>16&255]^o[u>>>8&255]^c[p&255]^e[++E],g=i[g>>>24]^s[u>>>16&255]^o[p>>>8&255]^c[d&255]^e[++E],u=h,p=y,d=b;a[0]=l[u>>>24]<<24^l[p>>>16&255]<<16^l[d>>>8&255]<<8^l[g&255]^e[++E],a[r?3:1]=l[p>>>24]<<24^l[d>>>16&255]<<16^l[g>>>8&255]<<8^l[u&255]^e[++E],a[2]=l[d>>>24]<<24^l[g>>>16&255]<<16^l[u>>>8&255]<<8^l[p&255]^e[++E],a[r?1:3]=l[g>>>24]<<24^l[u>>>16&255]<<16^l[p>>>8&255]<<8^l[d&255]^e[++E]}function el(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="AES-"+t,r;e.decrypt?r=Fe.cipher.createDecipher(a,e.key):r=Fe.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(i,s){var o=null;s instanceof Fe.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=i,n.call(r,s)},r}var fc=le;fc.pki=fc.pki||{};var ju=fc.pki.oids=fc.oids=fc.oids||{};function O(e,t){ju[e]=t,ju[t]=e}function Le(e,t){ju[e]=t}O("1.2.840.113549.1.1.1","rsaEncryption"),O("1.2.840.113549.1.1.4","md5WithRSAEncryption"),O("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),O("1.2.840.113549.1.1.7","RSAES-OAEP"),O("1.2.840.113549.1.1.8","mgf1"),O("1.2.840.113549.1.1.9","pSpecified"),O("1.2.840.113549.1.1.10","RSASSA-PSS"),O("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),O("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),O("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),O("1.3.101.112","EdDSA25519"),O("1.2.840.10040.4.3","dsa-with-sha1"),O("1.3.14.3.2.7","desCBC"),O("1.3.14.3.2.26","sha1"),O("1.3.14.3.2.29","sha1WithRSASignature"),O("2.16.840.1.101.3.4.2.1","sha256"),O("2.16.840.1.101.3.4.2.2","sha384"),O("2.16.840.1.101.3.4.2.3","sha512"),O("2.16.840.1.101.3.4.2.4","sha224"),O("2.16.840.1.101.3.4.2.5","sha512-224"),O("2.16.840.1.101.3.4.2.6","sha512-256"),O("1.2.840.113549.2.2","md2"),O("1.2.840.113549.2.5","md5"),O("1.2.840.113549.1.7.1","data"),O("1.2.840.113549.1.7.2","signedData"),O("1.2.840.113549.1.7.3","envelopedData"),O("1.2.840.113549.1.7.4","signedAndEnvelopedData"),O("1.2.840.113549.1.7.5","digestedData"),O("1.2.840.113549.1.7.6","encryptedData"),O("1.2.840.113549.1.9.1","emailAddress"),O("1.2.840.113549.1.9.2","unstructuredName"),O("1.2.840.113549.1.9.3","contentType"),O("1.2.840.113549.1.9.4","messageDigest"),O("1.2.840.113549.1.9.5","signingTime"),O("1.2.840.113549.1.9.6","counterSignature"),O("1.2.840.113549.1.9.7","challengePassword"),O("1.2.840.113549.1.9.8","unstructuredAddress"),O("1.2.840.113549.1.9.14","extensionRequest"),O("1.2.840.113549.1.9.20","friendlyName"),O("1.2.840.113549.1.9.21","localKeyId"),O("1.2.840.113549.1.9.22.1","x509Certificate"),O("1.2.840.113549.1.12.10.1.1","keyBag"),O("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),O("1.2.840.113549.1.12.10.1.3","certBag"),O("1.2.840.113549.1.12.10.1.4","crlBag"),O("1.2.840.113549.1.12.10.1.5","secretBag"),O("1.2.840.113549.1.12.10.1.6","safeContentsBag"),O("1.2.840.113549.1.5.13","pkcs5PBES2"),O("1.2.840.113549.1.5.12","pkcs5PBKDF2"),O("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),O("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),O("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),O("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),O("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),O("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),O("1.2.840.113549.2.7","hmacWithSHA1"),O("1.2.840.113549.2.8","hmacWithSHA224"),O("1.2.840.113549.2.9","hmacWithSHA256"),O("1.2.840.113549.2.10","hmacWithSHA384"),O("1.2.840.113549.2.11","hmacWithSHA512"),O("1.2.840.113549.3.7","des-EDE3-CBC"),O("2.16.840.1.101.3.4.1.2","aes128-CBC"),O("2.16.840.1.101.3.4.1.22","aes192-CBC"),O("2.16.840.1.101.3.4.1.42","aes256-CBC"),O("2.5.4.3","commonName"),O("2.5.4.4","surname"),O("2.5.4.5","serialNumber"),O("2.5.4.6","countryName"),O("2.5.4.7","localityName"),O("2.5.4.8","stateOrProvinceName"),O("2.5.4.9","streetAddress"),O("2.5.4.10","organizationName"),O("2.5.4.11","organizationalUnitName"),O("2.5.4.12","title"),O("2.5.4.13","description"),O("2.5.4.15","businessCategory"),O("2.5.4.17","postalCode"),O("2.5.4.42","givenName"),O("2.5.4.65","pseudonym"),O("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),O("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),O("2.16.840.1.113730.1.1","nsCertType"),O("2.16.840.1.113730.1.13","nsComment"),Le("2.5.29.1","authorityKeyIdentifier"),Le("2.5.29.2","keyAttributes"),Le("2.5.29.3","certificatePolicies"),Le("2.5.29.4","keyUsageRestriction"),Le("2.5.29.5","policyMapping"),Le("2.5.29.6","subtreesConstraint"),Le("2.5.29.7","subjectAltName"),Le("2.5.29.8","issuerAltName"),Le("2.5.29.9","subjectDirectoryAttributes"),Le("2.5.29.10","basicConstraints"),Le("2.5.29.11","nameConstraints"),Le("2.5.29.12","policyConstraints"),Le("2.5.29.13","basicConstraints"),O("2.5.29.14","subjectKeyIdentifier"),O("2.5.29.15","keyUsage"),Le("2.5.29.16","privateKeyUsagePeriod"),O("2.5.29.17","subjectAltName"),O("2.5.29.18","issuerAltName"),O("2.5.29.19","basicConstraints"),Le("2.5.29.20","cRLNumber"),Le("2.5.29.21","cRLReason"),Le("2.5.29.22","expirationDate"),Le("2.5.29.23","instructionCode"),Le("2.5.29.24","invalidityDate"),Le("2.5.29.25","cRLDistributionPoints"),Le("2.5.29.26","issuingDistributionPoint"),Le("2.5.29.27","deltaCRLIndicator"),Le("2.5.29.28","issuingDistributionPoint"),Le("2.5.29.29","certificateIssuer"),Le("2.5.29.30","nameConstraints"),O("2.5.29.31","cRLDistributionPoints"),O("2.5.29.32","certificatePolicies"),Le("2.5.29.33","policyMappings"),Le("2.5.29.34","policyConstraints"),O("2.5.29.35","authorityKeyIdentifier"),Le("2.5.29.36","policyConstraints"),O("2.5.29.37","extKeyUsage"),Le("2.5.29.46","freshestCRL"),Le("2.5.29.54","inhibitAnyPolicy"),O("1.3.6.1.4.1.11129.2.4.2","timestampList"),O("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),O("1.3.6.1.5.5.7.3.1","serverAuth"),O("1.3.6.1.5.5.7.3.2","clientAuth"),O("1.3.6.1.5.5.7.3.3","codeSigning"),O("1.3.6.1.5.5.7.3.4","emailProtection"),O("1.3.6.1.5.5.7.3.8","timeStamping");var Me=le,K=Me.asn1=Me.asn1||{};K.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},K.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},K.maxDepth=256,K.create=function(e,t,a,r,n){if(Me.util.isArray(r)){for(var i=[],s=0;s<r.length;++s)r[s]!==void 0&&i.push(r[s]);r=i}var o={tagClass:e,type:t,constructed:a,composed:a||Me.util.isArray(r),value:r};return n&&"bitStringContents"in n&&(o.bitStringContents=n.bitStringContents,o.original=K.copy(o)),o},K.copy=function(e,t){var a;if(Me.util.isArray(e)){a=[];for(var r=0;r<e.length;++r)a.push(K.copy(e[r],t));return a}return typeof e=="string"?e:(a={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:K.copy(e.value,t)},t&&!t.excludeBitStringContents&&(a.bitStringContents=e.bitStringContents),a)},K.equals=function(e,t,a){if(Me.util.isArray(e)){if(!Me.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!K.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var n=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&K.equals(e.value,t.value);return a&&a.includeBitStringContents&&(n=n&&e.bitStringContents===t.bitStringContents),n},K.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var a,r=t&128;return r?a=e.getInt((t&127)<<3):a=t,a}};function hc(e,t,a){if(a>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=a,r}}var lb=function(e,t){var a=e.getByte();if(t--,a!==128){var r,n=a&128;if(!n)r=a;else{var i=a&127;hc(e,t,i),r=e.getInt(i<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};K.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=K.maxDepth),typeof e=="string"&&(e=Me.util.createBuffer(e));var a=e.length(),r=tl(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var n=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw n.byteCount=a,n.remaining=e.length(),n}return r};function tl(e,t,a,r){if(a>=r.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var n;hc(e,t,2);var i=e.getByte();t--;var s=i&192,o=i&31;n=e.length();var c=lb(e,t);if(t-=n-e.length(),c!==void 0&&c>t){if(r.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=c,l}c=t}var u,p,d=(i&32)===32;if(d)if(u=[],c===void 0)for(;;){if(hc(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}n=e.length(),u.push(tl(e,t,a+1,r)),t-=n-e.length()}else for(;c>0;)n=e.length(),u.push(tl(e,c,a+1,r)),t-=n-e.length(),c-=n-e.length();if(u===void 0&&s===K.Class.UNIVERSAL&&o===K.Type.BITSTRING&&(p=e.bytes(c)),u===void 0&&r.decodeBitStrings&&s===K.Class.UNIVERSAL&&o===K.Type.BITSTRING&&c>1){var g=e.read,h=t,y=0;if(o===K.Type.BITSTRING&&(hc(e,t,1),y=e.getByte(),t--),y===0)try{n=e.length();var b={strict:!0,decodeBitStrings:!0},E=tl(e,t,a+1,b),I=n-e.length();t-=I,o==K.Type.BITSTRING&&I++;var R=E.tagClass;I===c&&(R===K.Class.UNIVERSAL||R===K.Class.CONTEXT_SPECIFIC)&&(u=[E])}catch{}u===void 0&&(e.read=g,t=h)}if(u===void 0){if(c===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=t}if(o===K.Type.BMPSTRING)for(u="";c>0;c-=2)hc(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(c),t-=c}var k=p===void 0?null:{bitStringContents:p};return K.create(s,o,d,u,k)}K.toDer=function(e){var t=Me.util.createBuffer(),a=e.tagClass|e.type,r=Me.util.createBuffer(),n=!1;if("bitStringContents"in e&&(n=!0,e.original&&(n=K.equals(e,e.original))),n)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?a|=32:r.putByte(0);for(var i=0;i<e.value.length;++i)e.value[i]!==void 0&&r.putBuffer(K.toDer(e.value[i]))}else if(e.type===K.Type.BMPSTRING)for(var i=0;i<e.value.length;++i)r.putInt16(e.value.charCodeAt(i));else e.type===K.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&(e.value.charCodeAt(1)&128)===0||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(a),r.length()<=127)t.putByte(r.length()&127);else{var s=r.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);t.putByte(o.length|128);for(var i=o.length-1;i>=0;--i)t.putByte(o.charCodeAt(i))}return t.putBuffer(r),t},K.oidToDer=function(e){var t=e.split("."),a=Me.util.createBuffer();a.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,n,i,s,o=2;o<t.length;++o){if(r=!0,n=[],i=parseInt(t[o],10),i>4294967295)throw new Error("OID value too large; max is 32-bits.");do s=i&127,i=i>>>7,r||(s|=128),n.push(s),r=!1;while(i>0);for(var c=n.length-1;c>=0;--c)a.putByte(n[c])}return a},K.derToOid=function(e){var t;typeof e=="string"&&(e=Me.util.createBuffer(e));var a=e.getByte();t=Math.floor(a/40)+"."+a%40;for(var r=0;e.length()>0;){if(r>70368744177663)throw new Error("OID value too large; max is 53-bits.");a=e.getByte(),r=r*128,a&128?r+=a&127:(t+="."+(r+a),r=0)}return t},K.utcTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,2),10);a=a>=50?1900+a:2e3+a;var r=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),l=10;c!=="+"&&c!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(a,r,n),t.setUTCHours(i,s,o,0),l&&(c=e.charAt(l),c==="+"||c==="-")){var u=parseInt(e.substr(l+1,2),10),p=parseInt(e.substr(l+4,2),10),d=u*60+p;d*=6e4,c==="+"?t.setTime(+t-d):t.setTime(+t+d)}return t},K.generalizedTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,l=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var p=e.length-5,d=e.charAt(p);if(d==="+"||d==="-"){var g=parseInt(e.substr(p+1,2),10),h=parseInt(e.substr(p+4,2),10);l=g*60+h,l*=6e4,d==="+"&&(l*=-1),u=!0}return e.charAt(14)==="."&&(c=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(a,r,n),t.setUTCHours(i,s,o,c),t.setTime(+t+l)):(t.setFullYear(a,r,n),t.setHours(i,s,o,c)),t},K.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push((""+e.getUTCFullYear()).substr(2)),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t},K.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push(""+e.getUTCFullYear()),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t},K.integerToDer=function(e){var t=Me.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var a=new Error("Integer too large; max is 32-bits.");throw a.integer=e,a},K.derToInteger=function(e){typeof e=="string"&&(e=Me.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},K.validate=function(e,t,a,r){var n=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(n=!0,t.value&&Me.util.isArray(t.value))for(var i=0,s=0;n&&s<t.value.length;++s){var o=t.value[s];n=!!o.optional;var c=e.value[i];if(!c){o.optional||(n=!1,r&&r.push("["+t.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var l=typeof o.tagClass<"u"&&typeof o.type<"u";if(l&&(c.tagClass!==o.tagClass||c.type!==o.type))if(o.optional){n=!0;continue}else{n=!1,r&&r.push("["+t.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+c.tagClass+","+c.type+")");break}var u=K.validate(c,o,a,r);if(u)++i,n=!0;else if(o.optional)n=!0;else{n=!1;break}}if(n&&a&&(t.capture&&(a[t.capture]=e.value),t.captureAsn1&&(a[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(a[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)a[t.captureBitStringValue]="";else{var p=e.bitStringContents.charCodeAt(0);if(p!==0)throw new Error("captureBitStringValue only supported for zero unused bits");a[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return n};var Gf=/[^\\u0000-\\u00ff]/;K.prettyPrint=function(e,t,a){var r="";t=t||0,a=a||2,t>0&&(r+=`
|
|
29
|
-
`);for(var n="",i=0;i<t*a;++i)n+=" ";switch(r+=n+"Tag: ",e.tagClass){case K.Class.UNIVERSAL:r+="Universal:";break;case K.Class.APPLICATION:r+="Application:";break;case K.Class.CONTEXT_SPECIFIC:r+="Context-Specific:";break;case K.Class.PRIVATE:r+="Private:";break}if(e.tagClass===K.Class.UNIVERSAL)switch(r+=e.type,e.type){case K.Type.NONE:r+=" (None)";break;case K.Type.BOOLEAN:r+=" (Boolean)";break;case K.Type.INTEGER:r+=" (Integer)";break;case K.Type.BITSTRING:r+=" (Bit string)";break;case K.Type.OCTETSTRING:r+=" (Octet string)";break;case K.Type.NULL:r+=" (Null)";break;case K.Type.OID:r+=" (Object Identifier)";break;case K.Type.ODESC:r+=" (Object Descriptor)";break;case K.Type.EXTERNAL:r+=" (External or Instance of)";break;case K.Type.REAL:r+=" (Real)";break;case K.Type.ENUMERATED:r+=" (Enumerated)";break;case K.Type.EMBEDDED:r+=" (Embedded PDV)";break;case K.Type.UTF8:r+=" (UTF8)";break;case K.Type.ROID:r+=" (Relative Object Identifier)";break;case K.Type.SEQUENCE:r+=" (Sequence)";break;case K.Type.SET:r+=" (Set)";break;case K.Type.PRINTABLESTRING:r+=" (Printable String)";break;case K.Type.IA5String:r+=" (IA5String (ASCII))";break;case K.Type.UTCTIME:r+=" (UTC time)";break;case K.Type.GENERALIZEDTIME:r+=" (Generalized time)";break;case K.Type.BMPSTRING:r+=" (BMP String)";break}else r+=e.type;if(r+=`
|
|
1
|
+
"use strict";var _=require("axios");require("fs"),require("path");var wo=require("crypto");const Je="https://api.circle.com".replace(/\/+$/,"");let K0=class extends Error{constructor(t,a){super(a),this.field=t,this.name="RequiredError"}};const et={},tt="https://example.com",bt=function(e,t,a){if(a==null)throw new K0(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},ut=async function(e,t){if(t&&t.accessToken){const a=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+a}};function ac(e,t,a=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>ac(e,r,a)):Object.keys(t).forEach(r=>ac(e,t[r],`${a}${a!==""?".":""}${r}`)):e.has(a)?e.append(a,t):e.set(a,t))}const rt=function(e,...t){const a=new URLSearchParams(e.search);ac(a,t),e.search=a.toString()},Yt=function(e,t,a){const r=typeof e!="string";return(r&&a&&a.isJsonMime?a.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},at=function(e){return e.pathname+e.search+e.hash},nt=function(e,t,a,r){return(n=t,i=a)=>{const s={...e.options,url:(r?.basePath||n.defaults.baseURL||i)+e.url};return n.request(s)}},q0=function(e){return{getEntityConfig:async(t={})=>{const a="/v1/w3s/config/entity",r=new URL(a,tt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await ut(s,e),rt(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:at(r),options:i}},getPublicKey:async(t={})=>{const a="/v1/w3s/config/entity/publicKey",r=new URL(a,tt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await ut(s,e),rt(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:at(r),options:i}}}},H0=function(e){const t=q0(e);return{async getEntityConfig(a){const r=await t.getEntityConfig(a),n=e?.serverIndex??0,i=et["DeveloperAccountApi.getEntityConfig"]?.[n]?.url;return(s,o)=>nt(r,_,Je,e)(s,i||o)},async getPublicKey(a){const r=await t.getPublicKey(a),n=e?.serverIndex??0,i=et["DeveloperAccountApi.getPublicKey"]?.[n]?.url;return(s,o)=>nt(r,_,Je,e)(s,i||o)}}},G0=function(e,t,a){const r=H0(e);return{getEntityConfig(n){return r.getEntityConfig(n).then(i=>i(a,t))},getPublicKey(n){return r.getPublicKey(n).then(i=>i(a,t))}}},W0=function(e){return{requestTestnetTokens:async(t,a,r={})=>{const n="/v1/faucet/drips",i=new URL(n,tt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await ut(c,e),t!=null&&(c["X-Request-Id"]=String(t)),c["Content-Type"]="application/json",rt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Yt(a,o,e),{url:at(i),options:o}}}},z0=function(e){const t=W0(e);return{async requestTestnetTokens(a,r,n){const i=await t.requestTestnetTokens(a,r,n),s=e?.serverIndex??0,o=et["FaucetApi.requestTestnetTokens"]?.[s]?.url;return(c,l)=>nt(i,_,Je,e)(c,o||l)}}},$0=function(e,t,a){const r=z0(e);return{requestTestnetTokens(n,i,s){return r.requestTestnetTokens(n,i,s).then(o=>o(a,t))}}},Q0=function(e){return{ping:async(t={})=>{const a="/ping",r=new URL(a,tt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={};rt(r,{});let o=n&&n.headers?n.headers:{};return i.headers={...s,...o,...t.headers},{url:at(r),options:i}}}},X0=function(e){const t=Q0(e);return{async ping(a){const r=await t.ping(a),n=e?.serverIndex??0,i=et["HealthApi.ping"]?.[n]?.url;return(s,o)=>nt(r,_,Je,e)(s,i||o)}}},j0=function(e,t,a){const r=X0(e);return{ping(n){return r.ping(n).then(i=>i(a,t))}}},Y0=function(e){return{createMonitoredTokens:async(t,a={})=>{bt("createMonitoredTokens","createMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens",n=new URL(r,tt);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await ut(o,e),o["Content-Type"]="application/json",rt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:at(n),options:s}},deleteMonitoredTokens:async(t,a={})=>{bt("deleteMonitoredTokens","deleteMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens/delete",n=new URL(r,tt);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await ut(o,e),o["Content-Type"]="application/json",rt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:at(n),options:s}},listMonitoredTokens:async(t,a,r,n,i,s,o,c,l={})=>{const u="/v1/w3s/config/entity/monitoredTokens",f=new URL(u,tt);let y;e&&(y=e.baseOptions);const E={method:"GET",...y,...l},v={},x={};await ut(v,e),t!==void 0&&(x.blockchain=t),a!==void 0&&(x.tokenAddress=a),r!==void 0&&(x.symbol=r),n!==void 0&&(x.from=n instanceof Date?n.toISOString():n),i!==void 0&&(x.to=i instanceof Date?i.toISOString():i),s!==void 0&&(x.pageBefore=s),o!==void 0&&(x.pageAfter=o),c!==void 0&&(x.pageSize=c),rt(f,x);let T=y&&y.headers?y.headers:{};return E.headers={...v,...T,...l.headers},{url:at(f),options:E}},updateMonitoredTokens:async(t,a={})=>{bt("updateMonitoredTokens","updateMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens",n=new URL(r,tt);let i;e&&(i=e.baseOptions);const s={method:"PUT",...i,...a},o={},c={};await ut(o,e),o["Content-Type"]="application/json",rt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:at(n),options:s}},updateMonitoredTokensScope:async(t,a={})=>{bt("updateMonitoredTokensScope","updateMonitoredTokensScopeRequest",t);const r="/v1/w3s/config/entity/monitoredTokens/scope",n=new URL(r,tt);let i;e&&(i=e.baseOptions);const s={method:"PUT",...i,...a},o={},c={};await ut(o,e),o["Content-Type"]="application/json",rt(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:at(n),options:s}}}},Z0=function(e){const t=Y0(e);return{async createMonitoredTokens(a,r){const n=await t.createMonitoredTokens(a,r),i=e?.serverIndex??0,s=et["MonitorTokensApi.createMonitoredTokens"]?.[i]?.url;return(o,c)=>nt(n,_,Je,e)(o,s||c)},async deleteMonitoredTokens(a,r){const n=await t.deleteMonitoredTokens(a,r),i=e?.serverIndex??0,s=et["MonitorTokensApi.deleteMonitoredTokens"]?.[i]?.url;return(o,c)=>nt(n,_,Je,e)(o,s||c)},async listMonitoredTokens(a,r,n,i,s,o,c,l,u){const f=await t.listMonitoredTokens(a,r,n,i,s,o,c,l,u),y=e?.serverIndex??0,E=et["MonitorTokensApi.listMonitoredTokens"]?.[y]?.url;return(v,x)=>nt(f,_,Je,e)(v,E||x)},async updateMonitoredTokens(a,r){const n=await t.updateMonitoredTokens(a,r),i=e?.serverIndex??0,s=et["MonitorTokensApi.updateMonitoredTokens"]?.[i]?.url;return(o,c)=>nt(n,_,Je,e)(o,s||c)},async updateMonitoredTokensScope(a,r){const n=await t.updateMonitoredTokensScope(a,r),i=e?.serverIndex??0,s=et["MonitorTokensApi.updateMonitoredTokensScope"]?.[i]?.url;return(o,c)=>nt(n,_,Je,e)(o,s||c)}}},J0=function(e,t,a){const r=Z0(e);return{createMonitoredTokens(n,i){return r.createMonitoredTokens(n,i).then(s=>s(a,t))},deleteMonitoredTokens(n,i){return r.deleteMonitoredTokens(n,i).then(s=>s(a,t))},listMonitoredTokens(n,i,s,o,c,l,u,f,y){return r.listMonitoredTokens(n,i,s,o,c,l,u,f,y).then(E=>E(a,t))},updateMonitoredTokens(n,i){return r.updateMonitoredTokens(n,i).then(s=>s(a,t))},updateMonitoredTokensScope(n,i){return r.updateMonitoredTokensScope(n,i).then(s=>s(a,t))}}},eu=function(e){return{createSubscription:async(t,a,r={})=>{bt("createSubscription","createSubscriptionRequest",t);const n="/v2/notifications/subscriptions",i=new URL(n,tt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await ut(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",rt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Yt(t,o,e),{url:at(i),options:o}},deleteSubscription:async(t,a,r={})=>{bt("deleteSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,tt);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},c={},l={};await ut(c,e),a!=null&&(c["X-Request-Id"]=String(a)),rt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:at(i),options:o}},getNotificationSignature:async(t,a,r={})=>{bt("getNotificationSignature","id",t);const n="/v2/notifications/publicKey/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,tt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await ut(c,e),a!=null&&(c["X-Request-Id"]=String(a)),rt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:at(i),options:o}},getSubscription:async(t,a,r={})=>{bt("getSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,tt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await ut(c,e),a!=null&&(c["X-Request-Id"]=String(a)),rt(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:at(i),options:o}},getSubscriptions:async(t={})=>{const a="/v2/notifications/subscriptions",r=new URL(a,tt);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await ut(s,e),rt(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:at(r),options:i}},updateSubscription:async(t,a,r,n={})=>{bt("updateSubscription","id",t),bt("updateSubscription","updateSubscriptionRequest",a);const i="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,tt);let o;e&&(o=e.baseOptions);const c={method:"PATCH",...o,...n},l={},u={};await ut(l,e),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",rt(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=Yt(a,c,e),{url:at(s),options:c}}}},tu=function(e){const t=eu(e);return{async createSubscription(a,r,n){const i=await t.createSubscription(a,r,n),s=e?.serverIndex??0,o=et["WebhookSubscriptionsApi.createSubscription"]?.[s]?.url;return(c,l)=>nt(i,_,Je,e)(c,o||l)},async deleteSubscription(a,r,n){const i=await t.deleteSubscription(a,r,n),s=e?.serverIndex??0,o=et["WebhookSubscriptionsApi.deleteSubscription"]?.[s]?.url;return(c,l)=>nt(i,_,Je,e)(c,o||l)},async getNotificationSignature(a,r,n){const i=await t.getNotificationSignature(a,r,n),s=e?.serverIndex??0,o=et["WebhookSubscriptionsApi.getNotificationSignature"]?.[s]?.url;return(c,l)=>nt(i,_,Je,e)(c,o||l)},async getSubscription(a,r,n){const i=await t.getSubscription(a,r,n),s=e?.serverIndex??0,o=et["WebhookSubscriptionsApi.getSubscription"]?.[s]?.url;return(c,l)=>nt(i,_,Je,e)(c,o||l)},async getSubscriptions(a){const r=await t.getSubscriptions(a),n=e?.serverIndex??0,i=et["WebhookSubscriptionsApi.getSubscriptions"]?.[n]?.url;return(s,o)=>nt(r,_,Je,e)(s,i||o)},async updateSubscription(a,r,n,i){const s=await t.updateSubscription(a,r,n,i),o=e?.serverIndex??0,c=et["WebhookSubscriptionsApi.updateSubscription"]?.[o]?.url;return(l,u)=>nt(s,_,Je,e)(l,c||u)}}},ru=function(e,t,a){const r=tu(e);return{createSubscription(n,i,s){return r.createSubscription(n,i,s).then(o=>o(a,t))},deleteSubscription(n,i,s){return r.deleteSubscription(n,i,s).then(o=>o(a,t))},getNotificationSignature(n,i,s){return r.getNotificationSignature(n,i,s).then(o=>o(a,t))},getSubscription(n,i,s){return r.getSubscription(n,i,s).then(o=>o(a,t))},getSubscriptions(n){return r.getSubscriptions(n).then(i=>i(a,t))},updateSubscription(n,i,s,o){return r.updateSubscription(n,i,s,o).then(c=>c(a,t))}}};var au=Object.defineProperty,nu=(e,t,a)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Ft=(e,t,a)=>nu(e,typeof t!="symbol"?t+"":t,a);let su=class{constructor(t={}){Ft(this,"apiKey"),Ft(this,"username"),Ft(this,"password"),Ft(this,"accessToken"),Ft(this,"basePath"),Ft(this,"serverIndex"),Ft(this,"baseOptions"),Ft(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(a.test(t)||t.toLowerCase()==="application/json-patch+json")}};var iu=Object.defineProperty,ou=(e,t,a)=>t in e?iu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Tr=(e,t,a)=>ou(e,typeof t!="symbol"?t+"":t,a);class cu{constructor(t,a,r={}){Tr(this,"DeveloperAccount"),Tr(this,"Faucet"),Tr(this,"Health"),Tr(this,"MonitorTokens"),Tr(this,"WebhookSubscriptions");const n=new su({basePath:t,baseOptions:{headers:{...r,Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json","User-Agent":`${a.userAgent?a.userAgent+" / ":""}CircleNodeJS / Configurations / ${a.version}`}}});this.DeveloperAccount=G0(n),this.Faucet=$0(n),this.Health=j0(n),this.MonitorTokens=J0(n),this.WebhookSubscriptions=ru(n)}}const ae="https://api.circle.com".replace(/\/+$/,"");class lu extends Error{constructor(t,a){super(a),this.field=t,this.name="RequiredError"}}const ne={},se="https://example.com",q=function(e,t,a){if(a==null)throw new lu(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},ie=async function(e,t){if(t&&t.accessToken){const a=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+a}};function nc(e,t,a=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>nc(e,r,a)):Object.keys(t).forEach(r=>nc(e,t[r],`${a}${a!==""?".":""}${r}`)):e.has(a)?e.append(a,t):e.set(a,t))}const oe=function(e,...t){const a=new URLSearchParams(e.search);nc(a,t),e.search=a.toString()},be=function(e,t,a){const r=typeof e!="string";return(r&&a&&a.isJsonMime?a.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},ce=function(e){return e.pathname+e.search+e.hash},le=function(e,t,a,r){return(n=t,i=a)=>{const s={...e.options,url:(r?.basePath||n.defaults.baseURL||i)+e.url};return n.request(s)}},uu=function(e){return{createUser:async(t,a={})=>{q("createUser","createUserRequest",t);const r="/v1/w3s/users",n=new URL(r,se);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await ie(o,e),o["Content-Type"]="application/json",oe(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=be(t,s,e),{url:ce(n),options:s}},createUserPinChallenge:async(t,a,r,n={})=>{q("createUserPinChallenge","xUserToken",t),q("createUserPinChallenge","setPinRequest",a);const i="/v1/w3s/user/pin",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},createUserPinRestoreChallenge:async(t,a,r,n={})=>{q("createUserPinRestoreChallenge","xUserToken",t),q("createUserPinRestoreChallenge","setPinRequest",a);const i="/v1/w3s/user/pin/restore",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},getUserToken:async(t,a,r={})=>{q("getUserToken","userTokenRequest",t);const n="/v1/w3s/users/token",i=new URL(n,se);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await ie(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",oe(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=be(t,o,e),{url:ce(i),options:o}},updateUserPinChallenge:async(t,a,r={})=>{q("updateUserPinChallenge","xUserToken",t),q("updateUserPinChallenge","setPinRequest",a);const n="/v1/w3s/user/pin",i=new URL(n,se);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...r},c={},l={};await ie(c,e),t!=null&&(c["X-User-Token"]=String(t)),c["Content-Type"]="application/json",oe(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=be(a,o,e),{url:ce(i),options:o}}}},fu=function(e){const t=uu(e);return{async createUser(a,r){const n=await t.createUser(a,r),i=e?.serverIndex??0,s=ne["PINAuthenticationApi.createUser"]?.[i]?.url;return(o,c)=>le(n,_,ae,e)(o,s||c)},async createUserPinChallenge(a,r,n,i){const s=await t.createUserPinChallenge(a,r,n,i),o=e?.serverIndex??0,c=ne["PINAuthenticationApi.createUserPinChallenge"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async createUserPinRestoreChallenge(a,r,n,i){const s=await t.createUserPinRestoreChallenge(a,r,n,i),o=e?.serverIndex??0,c=ne["PINAuthenticationApi.createUserPinRestoreChallenge"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async getUserToken(a,r,n){const i=await t.getUserToken(a,r,n),s=e?.serverIndex??0,o=ne["PINAuthenticationApi.getUserToken"]?.[s]?.url;return(c,l)=>le(i,_,ae,e)(c,o||l)},async updateUserPinChallenge(a,r,n){const i=await t.updateUserPinChallenge(a,r,n),s=e?.serverIndex??0,o=ne["PINAuthenticationApi.updateUserPinChallenge"]?.[s]?.url;return(c,l)=>le(i,_,ae,e)(c,o||l)}}},du=function(e,t,a){const r=fu(e);return{createUser(n,i){return r.createUser(n,i).then(s=>s(a,t))},createUserPinChallenge(n,i,s,o){return r.createUserPinChallenge(n,i,s,o).then(c=>c(a,t))},createUserPinRestoreChallenge(n,i,s,o){return r.createUserPinRestoreChallenge(n,i,s,o).then(c=>c(a,t))},getUserToken(n,i,s){return r.getUserToken(n,i,s).then(o=>o(a,t))},updateUserPinChallenge(n,i,s){return r.updateUserPinChallenge(n,i,s).then(o=>o(a,t))}}},hu=function(e){return{signUserMessage:async(t,a,r,n={})=>{q("signUserMessage","xUserToken",t),q("signUserMessage","signMessageRequest",a);const i="/v1/w3s/user/sign/message",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},signUserTransaction:async(t,a,r,n={})=>{q("signUserTransaction","xUserToken",t),q("signUserTransaction","signUserTransactionRequest",a);const i="/v1/w3s/user/sign/transaction",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},signUserTypedData:async(t,a,r,n={})=>{q("signUserTypedData","xUserToken",t),q("signUserTypedData","signTypedDataRequest",a);const i="/v1/w3s/user/sign/typedData",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}}}},pu=function(e){const t=hu(e);return{async signUserMessage(a,r,n,i){const s=await t.signUserMessage(a,r,n,i),o=e?.serverIndex??0,c=ne["SigningApi.signUserMessage"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async signUserTransaction(a,r,n,i){const s=await t.signUserTransaction(a,r,n,i),o=e?.serverIndex??0,c=ne["SigningApi.signUserTransaction"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async signUserTypedData(a,r,n,i){const s=await t.signUserTypedData(a,r,n,i),o=e?.serverIndex??0,c=ne["SigningApi.signUserTypedData"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)}}},gu=function(e,t,a){const r=pu(e);return{signUserMessage(n,i,s,o){return r.signUserMessage(n,i,s,o).then(c=>c(a,t))},signUserTransaction(n,i,s,o){return r.signUserTransaction(n,i,s,o).then(c=>c(a,t))},signUserTypedData(n,i,s,o){return r.signUserTypedData(n,i,s,o).then(c=>c(a,t))}}},yu=function(e){return{createDeviceTokenEmailLogin:async(t,a,r={})=>{q("createDeviceTokenEmailLogin","deviceTokenEmailRequest",t);const n="/v1/w3s/users/email/token",i=new URL(n,se);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await ie(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",oe(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=be(t,o,e),{url:ce(i),options:o}},createDeviceTokenSocialLogin:async(t,a,r={})=>{q("createDeviceTokenSocialLogin","deviceTokenSocialRequest",t);const n="/v1/w3s/users/social/token",i=new URL(n,se);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await ie(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",oe(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=be(t,o,e),{url:ce(i),options:o}},refreshUserToken:async(t,a,r,n={})=>{q("refreshUserToken","xUserToken",t),q("refreshUserToken","refreshUserTokenRequest",a);const i="/v1/w3s/users/token/refresh",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},resendOTP:async(t,a,r,n={})=>{q("resendOTP","xUserToken",t),q("resendOTP","resendOTPRequest",a);const i="/v1/w3s/users/email/resendOTP",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}}}},vu=function(e){const t=yu(e);return{async createDeviceTokenEmailLogin(a,r,n){const i=await t.createDeviceTokenEmailLogin(a,r,n),s=e?.serverIndex??0,o=ne["SocialEmailAuthenticationApi.createDeviceTokenEmailLogin"]?.[s]?.url;return(c,l)=>le(i,_,ae,e)(c,o||l)},async createDeviceTokenSocialLogin(a,r,n){const i=await t.createDeviceTokenSocialLogin(a,r,n),s=e?.serverIndex??0,o=ne["SocialEmailAuthenticationApi.createDeviceTokenSocialLogin"]?.[s]?.url;return(c,l)=>le(i,_,ae,e)(c,o||l)},async refreshUserToken(a,r,n,i){const s=await t.refreshUserToken(a,r,n,i),o=e?.serverIndex??0,c=ne["SocialEmailAuthenticationApi.refreshUserToken"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async resendOTP(a,r,n,i){const s=await t.resendOTP(a,r,n,i),o=e?.serverIndex??0,c=ne["SocialEmailAuthenticationApi.resendOTP"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)}}},mu=function(e,t,a){const r=vu(e);return{createDeviceTokenEmailLogin(n,i,s){return r.createDeviceTokenEmailLogin(n,i,s).then(o=>o(a,t))},createDeviceTokenSocialLogin(n,i,s){return r.createDeviceTokenSocialLogin(n,i,s).then(o=>o(a,t))},refreshUserToken(n,i,s,o){return r.refreshUserToken(n,i,s,o).then(c=>c(a,t))},resendOTP(n,i,s,o){return r.resendOTP(n,i,s,o).then(c=>c(a,t))}}},Eu=function(e){return{getTokenId:async(t,a={})=>{q("getTokenId","id",t);const r="/v1/w3s/tokens/{id}".replace("{id}",encodeURIComponent(String(t))),n=new URL(r,se);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...a},o={},c={};await ie(o,e),oe(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},{url:ce(n),options:s}}}},Cu=function(e){const t=Eu(e);return{async getTokenId(a,r){const n=await t.getTokenId(a,r),i=e?.serverIndex??0,s=ne["TokenLookupApi.getTokenId"]?.[i]?.url;return(o,c)=>le(n,_,ae,e)(o,s||c)}}},xu=function(e,t,a){const r=Cu(e);return{getTokenId(n,i){return r.getTokenId(n,i).then(s=>s(a,t))}}},Tu=function(e){return{createTransactionEstimateFee:async(t,a,r,n={})=>{q("createTransactionEstimateFee","xUserToken",t),q("createTransactionEstimateFee","estimateContractExecutionTransactionFeeRequest",a);const i="/v1/w3s/transactions/contractExecution/estimateFee",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},createTransferEstimateFee:async(t,a,r,n={})=>{q("createTransferEstimateFee","xUserToken",t),q("createTransferEstimateFee","estimateTransferTransactionFeeRequest",a);const i="/v1/w3s/transactions/transfer/estimateFee",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},createUserTransactionAccelerateChallenge:async(t,a,r,n,i={})=>{q("createUserTransactionAccelerateChallenge","xUserToken",t),q("createUserTransactionAccelerateChallenge","id",a),q("createUserTransactionAccelerateChallenge","accelerateTransactionForEndUserRequest",r);const s="/v1/w3s/user/transactions/{id}/accelerate".replace("{id}",encodeURIComponent(String(a))),o=new URL(s,se);let c;e&&(c=e.baseOptions);const l={method:"POST",...c,...i},u={},f={};await ie(u,e),t!=null&&(u["X-User-Token"]=String(t)),n!=null&&(u["X-Request-Id"]=String(n)),u["Content-Type"]="application/json",oe(o,f);let y=c&&c.headers?c.headers:{};return l.headers={...u,...y,...i.headers},l.data=be(r,l,e),{url:ce(o),options:l}},createUserTransactionCancelChallenge:async(t,a,r,n,i={})=>{q("createUserTransactionCancelChallenge","xUserToken",t),q("createUserTransactionCancelChallenge","id",a),q("createUserTransactionCancelChallenge","cancelTransactionForEndUserRequest",r);const s="/v1/w3s/user/transactions/{id}/cancel".replace("{id}",encodeURIComponent(String(a))),o=new URL(s,se);let c;e&&(c=e.baseOptions);const l={method:"POST",...c,...i},u={},f={};await ie(u,e),t!=null&&(u["X-User-Token"]=String(t)),n!=null&&(u["X-Request-Id"]=String(n)),u["Content-Type"]="application/json",oe(o,f);let y=c&&c.headers?c.headers:{};return l.headers={...u,...y,...i.headers},l.data=be(r,l,e),{url:ce(o),options:l}},createUserTransactionContractExecutionChallenge:async(t,a,r,n={})=>{q("createUserTransactionContractExecutionChallenge","xUserToken",t),q("createUserTransactionContractExecutionChallenge","createContractExecutionTransactionForEndUserRequest",a);const i="/v1/w3s/user/transactions/contractExecution",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},createUserTransactionTransferChallenge:async(t,a,r,n={})=>{q("createUserTransactionTransferChallenge","xUserToken",t),q("createUserTransactionTransferChallenge","createTransferTransactionForEndUserRequest",a);const i="/v1/w3s/user/transactions/transfer",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},createUserTransactionWalletUpgradeChallenge:async(t,a,r,n={})=>{q("createUserTransactionWalletUpgradeChallenge","xUserToken",t),q("createUserTransactionWalletUpgradeChallenge","createWalletUpgradeTransactionForEndUserRequest",a);const i="/v1/w3s/user/transactions/walletUpgrade",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},createValidateAddress:async(t,a={})=>{q("createValidateAddress","validateAddressRequest",t);const r="/v1/w3s/transactions/validateAddress",n=new URL(r,se);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await ie(o,e),o["Content-Type"]="application/json",oe(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=be(t,s,e),{url:ce(n),options:s}},getLowestNonceTransaction:async(t,a,r,n={})=>{const i="/v1/w3s/transactions/lowestNonceTransaction",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await ie(l,e),t!==void 0&&(u.blockchain=t),a!==void 0&&(u.address=a),r!==void 0&&(u.walletId=r),oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},{url:ce(s),options:c}},getTransaction:async(t,a,r,n,i={})=>{q("getTransaction","id",t),q("getTransaction","xUserToken",a);const s="/v1/w3s/transactions/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...i},u={},f={};await ie(u,e),r!==void 0&&(f.txType=r),a!=null&&(u["X-User-Token"]=String(a)),n!=null&&(u["X-Request-Id"]=String(n)),oe(o,f);let y=c&&c.headers?c.headers:{};return l.headers={...u,...y,...i.headers},{url:ce(o),options:l}},listTransactions:async(t,a,r,n,i,s,o,c,l,u,f,y,E,v,x,T,I,B={})=>{q("listTransactions","xUserToken",t);const U="/v1/w3s/transactions",D=new URL(U,se);let L;e&&(L=e.baseOptions);const P={method:"GET",...L,...B},$={},H={};await ie($,e),a!==void 0&&(H.blockchain=a),r!==void 0&&(H.destinationAddress=r),n!==void 0&&(H.includeAll=n),i!==void 0&&(H.operation=i),s!==void 0&&(H.state=s),o!==void 0&&(H.txHash=o),c!==void 0&&(H.txType=c),l!==void 0&&(H.userId=l),u!==void 0&&(H.walletIds=u),f!==void 0&&(H.from=f instanceof Date?f.toISOString():f),y!==void 0&&(H.to=y instanceof Date?y.toISOString():y),E!==void 0&&(H.pageBefore=E),v!==void 0&&(H.pageAfter=v),x!==void 0&&(H.pageSize=x),T!==void 0&&(H.order=T),t!=null&&($["X-User-Token"]=String(t)),I!=null&&($["X-Request-Id"]=String(I)),oe(D,H);let pe=L&&L.headers?L.headers:{};return P.headers={...$,...pe,...B.headers},{url:ce(D),options:P}}}},Su=function(e){const t=Tu(e);return{async createTransactionEstimateFee(a,r,n,i){const s=await t.createTransactionEstimateFee(a,r,n,i),o=e?.serverIndex??0,c=ne["TransactionsApi.createTransactionEstimateFee"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async createTransferEstimateFee(a,r,n,i){const s=await t.createTransferEstimateFee(a,r,n,i),o=e?.serverIndex??0,c=ne["TransactionsApi.createTransferEstimateFee"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async createUserTransactionAccelerateChallenge(a,r,n,i,s){const o=await t.createUserTransactionAccelerateChallenge(a,r,n,i,s),c=e?.serverIndex??0,l=ne["TransactionsApi.createUserTransactionAccelerateChallenge"]?.[c]?.url;return(u,f)=>le(o,_,ae,e)(u,l||f)},async createUserTransactionCancelChallenge(a,r,n,i,s){const o=await t.createUserTransactionCancelChallenge(a,r,n,i,s),c=e?.serverIndex??0,l=ne["TransactionsApi.createUserTransactionCancelChallenge"]?.[c]?.url;return(u,f)=>le(o,_,ae,e)(u,l||f)},async createUserTransactionContractExecutionChallenge(a,r,n,i){const s=await t.createUserTransactionContractExecutionChallenge(a,r,n,i),o=e?.serverIndex??0,c=ne["TransactionsApi.createUserTransactionContractExecutionChallenge"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async createUserTransactionTransferChallenge(a,r,n,i){const s=await t.createUserTransactionTransferChallenge(a,r,n,i),o=e?.serverIndex??0,c=ne["TransactionsApi.createUserTransactionTransferChallenge"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async createUserTransactionWalletUpgradeChallenge(a,r,n,i){const s=await t.createUserTransactionWalletUpgradeChallenge(a,r,n,i),o=e?.serverIndex??0,c=ne["TransactionsApi.createUserTransactionWalletUpgradeChallenge"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async createValidateAddress(a,r){const n=await t.createValidateAddress(a,r),i=e?.serverIndex??0,s=ne["TransactionsApi.createValidateAddress"]?.[i]?.url;return(o,c)=>le(n,_,ae,e)(o,s||c)},async getLowestNonceTransaction(a,r,n,i){const s=await t.getLowestNonceTransaction(a,r,n,i),o=e?.serverIndex??0,c=ne["TransactionsApi.getLowestNonceTransaction"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async getTransaction(a,r,n,i,s){const o=await t.getTransaction(a,r,n,i,s),c=e?.serverIndex??0,l=ne["TransactionsApi.getTransaction"]?.[c]?.url;return(u,f)=>le(o,_,ae,e)(u,l||f)},async listTransactions(a,r,n,i,s,o,c,l,u,f,y,E,v,x,T,I,B,U){const D=await t.listTransactions(a,r,n,i,s,o,c,l,u,f,y,E,v,x,T,I,B,U),L=e?.serverIndex??0,P=ne["TransactionsApi.listTransactions"]?.[L]?.url;return($,H)=>le(D,_,ae,e)($,P||H)}}},Au=function(e,t,a){const r=Su(e);return{createTransactionEstimateFee(n,i,s,o){return r.createTransactionEstimateFee(n,i,s,o).then(c=>c(a,t))},createTransferEstimateFee(n,i,s,o){return r.createTransferEstimateFee(n,i,s,o).then(c=>c(a,t))},createUserTransactionAccelerateChallenge(n,i,s,o,c){return r.createUserTransactionAccelerateChallenge(n,i,s,o,c).then(l=>l(a,t))},createUserTransactionCancelChallenge(n,i,s,o,c){return r.createUserTransactionCancelChallenge(n,i,s,o,c).then(l=>l(a,t))},createUserTransactionContractExecutionChallenge(n,i,s,o){return r.createUserTransactionContractExecutionChallenge(n,i,s,o).then(c=>c(a,t))},createUserTransactionTransferChallenge(n,i,s,o){return r.createUserTransactionTransferChallenge(n,i,s,o).then(c=>c(a,t))},createUserTransactionWalletUpgradeChallenge(n,i,s,o){return r.createUserTransactionWalletUpgradeChallenge(n,i,s,o).then(c=>c(a,t))},createValidateAddress(n,i){return r.createValidateAddress(n,i).then(s=>s(a,t))},getLowestNonceTransaction(n,i,s,o){return r.getLowestNonceTransaction(n,i,s,o).then(c=>c(a,t))},getTransaction(n,i,s,o,c){return r.getTransaction(n,i,s,o,c).then(l=>l(a,t))},listTransactions(n,i,s,o,c,l,u,f,y,E,v,x,T,I,B,U,D,L){return r.listTransactions(n,i,s,o,c,l,u,f,y,E,v,x,T,I,B,U,D,L).then(P=>P(a,t))}}},Iu=function(e){return{createUserWithPinChallenge:async(t,a,r,n={})=>{q("createUserWithPinChallenge","xUserToken",t),q("createUserWithPinChallenge","setPinAndInitWalletRequest",a);const i="/v1/w3s/user/initialize",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},getUser:async(t,a,r={})=>{q("getUser","id",t);const n="/v1/w3s/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,se);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await ie(c,e),a!=null&&(c["X-Request-Id"]=String(a)),oe(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:ce(i),options:o}},getUserByToken:async(t,a,r={})=>{q("getUserByToken","xUserToken",t);const n="/v1/w3s/user",i=new URL(n,se);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await ie(c,e),t!=null&&(c["X-User-Token"]=String(t)),a!=null&&(c["X-Request-Id"]=String(a)),oe(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:ce(i),options:o}},getUserChallenge:async(t,a,r,n={})=>{q("getUserChallenge","xUserToken",t),q("getUserChallenge","id",a);const i="/v1/w3s/user/challenges/{id}".replace("{id}",encodeURIComponent(String(a))),s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},{url:ce(s),options:c}},listUserChallenges:async(t,a,r,n={})=>{q("listUserChallenges","xUserToken",t);const i="/v1/w3s/user/challenges",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await ie(l,e),a!==void 0&&(u.status=a),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},{url:ce(s),options:c}},listUsers:async(t,a,r,n,i,s,o,c,l,u={})=>{const f="/v1/w3s/users",y=new URL(f,se);let E;e&&(E=e.baseOptions);const v={method:"GET",...E,...u},x={},T={};await ie(x,e),t!==void 0&&(T.pinStatus=t),a!==void 0&&(T.securityQuestionStatus=a),r!==void 0&&(T.from=r instanceof Date?r.toISOString():r),n!==void 0&&(T.to=n instanceof Date?n.toISOString():n),i!==void 0&&(T.pageBefore=i),s!==void 0&&(T.pageAfter=s),o!==void 0&&(T.pageSize=o),c!==void 0&&(T.order=c),l!=null&&(x["X-Request-Id"]=String(l)),oe(y,T);let I=E&&E.headers?E.headers:{};return v.headers={...x,...I,...u.headers},{url:ce(y),options:v}}}},bu=function(e){const t=Iu(e);return{async createUserWithPinChallenge(a,r,n,i){const s=await t.createUserWithPinChallenge(a,r,n,i),o=e?.serverIndex??0,c=ne["UsersApi.createUserWithPinChallenge"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async getUser(a,r,n){const i=await t.getUser(a,r,n),s=e?.serverIndex??0,o=ne["UsersApi.getUser"]?.[s]?.url;return(c,l)=>le(i,_,ae,e)(c,o||l)},async getUserByToken(a,r,n){const i=await t.getUserByToken(a,r,n),s=e?.serverIndex??0,o=ne["UsersApi.getUserByToken"]?.[s]?.url;return(c,l)=>le(i,_,ae,e)(c,o||l)},async getUserChallenge(a,r,n,i){const s=await t.getUserChallenge(a,r,n,i),o=e?.serverIndex??0,c=ne["UsersApi.getUserChallenge"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async listUserChallenges(a,r,n,i){const s=await t.listUserChallenges(a,r,n,i),o=e?.serverIndex??0,c=ne["UsersApi.listUserChallenges"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async listUsers(a,r,n,i,s,o,c,l,u,f){const y=await t.listUsers(a,r,n,i,s,o,c,l,u,f),E=e?.serverIndex??0,v=ne["UsersApi.listUsers"]?.[E]?.url;return(x,T)=>le(y,_,ae,e)(x,v||T)}}},Bu=function(e,t,a){const r=bu(e);return{createUserWithPinChallenge(n,i,s,o){return r.createUserWithPinChallenge(n,i,s,o).then(c=>c(a,t))},getUser(n,i,s){return r.getUser(n,i,s).then(o=>o(a,t))},getUserByToken(n,i,s){return r.getUserByToken(n,i,s).then(o=>o(a,t))},getUserChallenge(n,i,s,o){return r.getUserChallenge(n,i,s,o).then(c=>c(a,t))},listUserChallenges(n,i,s,o){return r.listUserChallenges(n,i,s,o).then(c=>c(a,t))},listUsers(n,i,s,o,c,l,u,f,y,E){return r.listUsers(n,i,s,o,c,l,u,f,y,E).then(v=>v(a,t))}}},wu=function(e){return{createUserWallet:async(t,a,r,n={})=>{q("createUserWallet","xUserToken",t),q("createUserWallet","createEndUserWalletRequest",a);const i="/v1/w3s/user/wallets",s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await ie(l,e),t!=null&&(l["X-User-Token"]=String(t)),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(a,c,e),{url:ce(s),options:c}},getWallet:async(t,a,r,n={})=>{q("getWallet","id",t),q("getWallet","xUserToken",a);const i="/v1/w3s/wallets/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"GET",...o,...n},l={},u={};await ie(l,e),a!=null&&(l["X-User-Token"]=String(a)),r!=null&&(l["X-Request-Id"]=String(r)),oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},{url:ce(s),options:c}},listWalletBalance:async(t,a,r,n,i,s,o,c,l,u,f={})=>{q("listWalletBalance","xUserToken",t),q("listWalletBalance","id",a);const y="/v1/w3s/wallets/{id}/balances".replace("{id}",encodeURIComponent(String(a))),E=new URL(y,se);let v;e&&(v=e.baseOptions);const x={method:"GET",...v,...f},T={},I={};await ie(T,e),r!==void 0&&(I.includeAll=r),n!==void 0&&(I.name=n),i!==void 0&&(I.tokenAddress=i),s!==void 0&&(I.standard=s),o!==void 0&&(I.pageBefore=o),c!==void 0&&(I.pageAfter=c),l!==void 0&&(I.pageSize=l),t!=null&&(T["X-User-Token"]=String(t)),u!=null&&(T["X-Request-Id"]=String(u)),oe(E,I);let B=v&&v.headers?v.headers:{};return x.headers={...T,...B,...f.headers},{url:ce(E),options:x}},listWalletNfts:async(t,a,r,n,i,s,o,c,l,u,f={})=>{q("listWalletNfts","xUserToken",t),q("listWalletNfts","id",a);const y="/v1/w3s/wallets/{id}/nfts".replace("{id}",encodeURIComponent(String(a))),E=new URL(y,se);let v;e&&(v=e.baseOptions);const x={method:"GET",...v,...f},T={},I={};await ie(T,e),r!==void 0&&(I.includeAll=r),n!==void 0&&(I.name=n),i!==void 0&&(I.tokenAddress=i),s!==void 0&&(I.standard=s),o!==void 0&&(I.pageBefore=o),c!==void 0&&(I.pageAfter=c),l!==void 0&&(I.pageSize=l),t!=null&&(T["X-User-Token"]=String(t)),u!=null&&(T["X-Request-Id"]=String(u)),oe(E,I);let B=v&&v.headers?v.headers:{};return x.headers={...T,...B,...f.headers},{url:ce(E),options:x}},listWallets:async(t,a,r,n,i,s,o,c,l,u,f,y,E,v={})=>{q("listWallets","xUserToken",t);const x="/v1/w3s/wallets",T=new URL(x,se);let I;e&&(I=e.baseOptions);const B={method:"GET",...I,...v},U={},D={};await ie(U,e),a!==void 0&&(D.address=a),r!==void 0&&(D.blockchain=r),n!==void 0&&(D.scaCore=n),i!==void 0&&(D.walletSetId=i),s!==void 0&&(D.refId=s),o!==void 0&&(D.from=o instanceof Date?o.toISOString():o),c!==void 0&&(D.to=c instanceof Date?c.toISOString():c),l!==void 0&&(D.pageBefore=l),u!==void 0&&(D.pageAfter=u),f!==void 0&&(D.pageSize=f),y!==void 0&&(D.order=y),t!=null&&(U["X-User-Token"]=String(t)),E!=null&&(U["X-Request-Id"]=String(E)),oe(T,D);let L=I&&I.headers?I.headers:{};return B.headers={...U,...L,...v.headers},{url:ce(T),options:B}},updateWallet:async(t,a,r,n={})=>{q("updateWallet","id",t),q("updateWallet","xUserToken",a),q("updateWallet","updateWalletRequest",r);const i="/v1/w3s/wallets/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se);let o;e&&(o=e.baseOptions);const c={method:"PUT",...o,...n},l={},u={};await ie(l,e),a!=null&&(l["X-User-Token"]=String(a)),l["Content-Type"]="application/json",oe(s,u);let f=o&&o.headers?o.headers:{};return c.headers={...l,...f,...n.headers},c.data=be(r,c,e),{url:ce(s),options:c}}}},Uu=function(e){const t=wu(e);return{async createUserWallet(a,r,n,i){const s=await t.createUserWallet(a,r,n,i),o=e?.serverIndex??0,c=ne["WalletsApi.createUserWallet"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async getWallet(a,r,n,i){const s=await t.getWallet(a,r,n,i),o=e?.serverIndex??0,c=ne["WalletsApi.getWallet"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)},async listWalletBalance(a,r,n,i,s,o,c,l,u,f,y){const E=await t.listWalletBalance(a,r,n,i,s,o,c,l,u,f,y),v=e?.serverIndex??0,x=ne["WalletsApi.listWalletBalance"]?.[v]?.url;return(T,I)=>le(E,_,ae,e)(T,x||I)},async listWalletNfts(a,r,n,i,s,o,c,l,u,f,y){const E=await t.listWalletNfts(a,r,n,i,s,o,c,l,u,f,y),v=e?.serverIndex??0,x=ne["WalletsApi.listWalletNfts"]?.[v]?.url;return(T,I)=>le(E,_,ae,e)(T,x||I)},async listWallets(a,r,n,i,s,o,c,l,u,f,y,E,v,x){const T=await t.listWallets(a,r,n,i,s,o,c,l,u,f,y,E,v,x),I=e?.serverIndex??0,B=ne["WalletsApi.listWallets"]?.[I]?.url;return(U,D)=>le(T,_,ae,e)(U,B||D)},async updateWallet(a,r,n,i){const s=await t.updateWallet(a,r,n,i),o=e?.serverIndex??0,c=ne["WalletsApi.updateWallet"]?.[o]?.url;return(l,u)=>le(s,_,ae,e)(l,c||u)}}},ku=function(e,t,a){const r=Uu(e);return{createUserWallet(n,i,s,o){return r.createUserWallet(n,i,s,o).then(c=>c(a,t))},getWallet(n,i,s,o){return r.getWallet(n,i,s,o).then(c=>c(a,t))},listWalletBalance(n,i,s,o,c,l,u,f,y,E,v){return r.listWalletBalance(n,i,s,o,c,l,u,f,y,E,v).then(x=>x(a,t))},listWalletNfts(n,i,s,o,c,l,u,f,y,E,v){return r.listWalletNfts(n,i,s,o,c,l,u,f,y,E,v).then(x=>x(a,t))},listWallets(n,i,s,o,c,l,u,f,y,E,v,x,T,I){return r.listWallets(n,i,s,o,c,l,u,f,y,E,v,x,T,I).then(B=>B(a,t))},updateWallet(n,i,s,o){return r.updateWallet(n,i,s,o).then(c=>c(a,t))}}};var Nu=Object.defineProperty,Ru=(e,t,a)=>t in e?Nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Mt=(e,t,a)=>Ru(e,typeof t!="symbol"?t+"":t,a);class _u{constructor(t={}){Mt(this,"apiKey"),Mt(this,"username"),Mt(this,"password"),Mt(this,"accessToken"),Mt(this,"basePath"),Mt(this,"serverIndex"),Mt(this,"baseOptions"),Mt(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(a.test(t)||t.toLowerCase()==="application/json-patch+json")}}const Lu={Eth:"ETH",EthSepolia:"ETH-SEPOLIA",Avax:"AVAX",AvaxFuji:"AVAX-FUJI",Matic:"MATIC",MaticAmoy:"MATIC-AMOY",Sol:"SOL",SolDevnet:"SOL-DEVNET",Arb:"ARB",ArbSepolia:"ARB-SEPOLIA",Near:"NEAR",NearTestnet:"NEAR-TESTNET",Evm:"EVM",EvmTestnet:"EVM-TESTNET",Uni:"UNI",UniSepolia:"UNI-SEPOLIA",Base:"BASE",BaseSepolia:"BASE-SEPOLIA",Op:"OP",OpSepolia:"OP-SEPOLIA",Aptos:"APTOS",AptosTestnet:"APTOS-TESTNET",ArcTestnet:"ARC-TESTNET",Monad:"MONAD",MonadTestnet:"MONAD-TESTNET"};var Du=Object.defineProperty,Pu=(e,t,a)=>t in e?Du(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Zt=(e,t,a)=>Pu(e,typeof t!="symbol"?t+"":t,a);class Ou{constructor(t,a,r={}){Zt(this,"PINAuthentication"),Zt(this,"Signing"),Zt(this,"SocialEmailAuthentication"),Zt(this,"TokenLookup"),Zt(this,"Transactions"),Zt(this,"Users"),Zt(this,"Wallets");const n=new _u({basePath:t,baseOptions:{headers:{...r,Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json","User-Agent":`${a.userAgent?a.userAgent+" / ":""}CircleNodeJS / UserControlledWallets / ${a.version}`}}});this.PINAuthentication=du(n),this.Signing=gu(n),this.SocialEmailAuthentication=mu(n),this.TokenLookup=xu(n),this.Transactions=Au(n),this.Users=Bu(n),this.Wallets=ku(n)}}var Vu=Object.defineProperty,Zc=e=>{throw TypeError(e)},Fu=(e,t,a)=>t in e?Vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,lr=(e,t,a)=>Fu(e,typeof t!="symbol"?t+"":t,a),Jc=(e,t,a)=>t.has(e)||Zc("Cannot "+a),Mu=(e,t,a)=>(Jc(e,t,"read from private field"),a?a.call(e):t.get(e)),Ku=(e,t,a)=>t.has(e)?Zc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),qu=(e,t,a,r)=>(Jc(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a),Uo;class Sr extends Error{constructor({message:t,code:a,url:r,method:n,error:i}){super(t),lr(this,"code"),lr(this,"message"),lr(this,"url"),lr(this,"method"),Ku(this,Uo),this.message=t??new.target.message,this.code=a??new.target.code,this.url=r,this.method=n,qu(this,Uo,i)}get error(){return Mu(this,Uo)}}Uo=new WeakMap,lr(Sr,"code","UNKNOWN"),lr(Sr,"message","HTTP Error");var Hu=Object.defineProperty,Gu=(e,t,a)=>t in e?Hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,sc=(e,t,a)=>Gu(e,typeof t!="symbol"?t+"":t,a);class m extends Sr{constructor({message:t,code:a,url:r,method:n,status:i,error:s}){super({message:t,code:a,url:r,method:n,error:s}),sc(this,"status"),this.status=i}}sc(m,"code",-1),sc(m,"message","HTTP Response Error");var Wu=Object.defineProperty,zu=(e,t,a)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,el=(e,t,a)=>zu(e,typeof t!="symbol"?t+"":t,a);class mt extends Sr{}el(mt,"code","UNKNOWN"),el(mt,"message","Unknown HTTP request error");var $u=Object.defineProperty,Qu=(e,t,a)=>t in e?$u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,tl=(e,t,a)=>Qu(e,typeof t!="symbol"?t+"":t,a);class Ar extends m{}tl(Ar,"code",400),tl(Ar,"message","Bad Request");var Xu=Object.defineProperty,ju=(e,t,a)=>t in e?Xu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,rl=(e,t,a)=>ju(e,typeof t!="symbol"?t+"":t,a);class Ir extends m{}rl(Ir,"code",401),rl(Ir,"message","Unauthorized");var Yu=Object.defineProperty,Zu=(e,t,a)=>t in e?Yu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,al=(e,t,a)=>Zu(e,typeof t!="symbol"?t+"":t,a);class br extends m{}al(br,"code",403),al(br,"message","Forbidden");var Ju=Object.defineProperty,ef=(e,t,a)=>t in e?Ju(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,nl=(e,t,a)=>ef(e,typeof t!="symbol"?t+"":t,a);class Br extends m{}nl(Br,"code",404),nl(Br,"message","Not Found");var tf=Object.defineProperty,rf=(e,t,a)=>t in e?tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,sl=(e,t,a)=>rf(e,typeof t!="symbol"?t+"":t,a);class wr extends m{}sl(wr,"code",429),sl(wr,"message","Too Many Requests");var af=Object.defineProperty,nf=(e,t,a)=>t in e?af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,il=(e,t,a)=>nf(e,typeof t!="symbol"?t+"":t,a);class Ur extends m{}il(Ur,"code",500),il(Ur,"message","Internal Server Error");var sf=Object.defineProperty,of=(e,t,a)=>t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ol=(e,t,a)=>of(e,typeof t!="symbol"?t+"":t,a);class kr extends m{}ol(kr,"code",501),ol(kr,"message","Not Implemented");var cf=Object.defineProperty,lf=(e,t,a)=>t in e?cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,cl=(e,t,a)=>lf(e,typeof t!="symbol"?t+"":t,a);class Nr extends m{}cl(Nr,"code",502),cl(Nr,"message","Bad Gateway");var uf=Object.defineProperty,ff=(e,t,a)=>t in e?uf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ll=(e,t,a)=>ff(e,typeof t!="symbol"?t+"":t,a);class Rr extends m{}ll(Rr,"code",503),ll(Rr,"message","Service Unavailable");var df=Object.defineProperty,hf=(e,t,a)=>t in e?df(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ul=(e,t,a)=>hf(e,typeof t!="symbol"?t+"":t,a);class _r extends m{}ul(_r,"code",504),ul(_r,"message","Gateway Timeout");var pf=Object.defineProperty,gf=(e,t,a)=>t in e?pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,fl=(e,t,a)=>gf(e,typeof t!="symbol"?t+"":t,a);class Lr extends mt{}fl(Lr,"code","ECONNREFUSED"),fl(Lr,"message","Connection refused");var yf=Object.defineProperty,vf=(e,t,a)=>t in e?yf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,dl=(e,t,a)=>vf(e,typeof t!="symbol"?t+"":t,a);class Dr extends mt{}dl(Dr,"code","ETIMEDOUT"),dl(Dr,"message","Connection timeout");var mf=Object.defineProperty,Ef=(e,t,a)=>t in e?mf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,hl=(e,t,a)=>Ef(e,typeof t!="symbol"?t+"":t,a);class Pr extends mt{}hl(Pr,"code","ECONNABORTED"),hl(Pr,"message","Request timeout");var Cf=Object.defineProperty,xf=(e,t,a)=>t in e?Cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,pl=(e,t,a)=>xf(e,typeof t!="symbol"?t+"":t,a);class Or extends mt{}pl(Or,"code","ENOTFOUND"),pl(Or,"message","DNS lookup failed - host not found");var Tf=Object.defineProperty,Sf=(e,t,a)=>t in e?Tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,gl=(e,t,a)=>Sf(e,typeof t!="symbol"?t+"":t,a);class Vr extends mt{}gl(Vr,"code","EAI_AGAIN"),gl(Vr,"message","DNS lookup failed - timeout");var Af=Object.defineProperty,If=(e,t,a)=>t in e?Af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,yl=(e,t,a)=>If(e,typeof t!="symbol"?t+"":t,a);class Fr extends mt{}yl(Fr,"code","ENETUNREACH"),yl(Fr,"message","Network unreachable");var bf=Object.defineProperty,Bf=(e,t,a)=>t in e?bf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,vl=(e,t,a)=>Bf(e,typeof t!="symbol"?t+"":t,a);class Mr extends mt{}vl(Mr,"code","ECONNRESET"),vl(Mr,"message","Connection reset");var wf=Object.defineProperty,Uf=(e,t,a)=>t in e?wf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ml=(e,t,a)=>Uf(e,typeof t!="symbol"?t+"":t,a);class Kr extends mt{}ml(Kr,"code","EHOSTUNREACH"),ml(Kr,"message","Host unreachable");const El={undefined:mt,[Lr.code]:Lr,[Dr.code]:Dr,[Pr.code]:Pr,[Mr.code]:Mr,[Or.code]:Or,[Vr.code]:Vr,[Fr.code]:Fr,[Kr.code]:Kr};function kf(e){return El[e]??El.undefined}function Nf(e){return Rf({code:e.code,message:e.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function Rf({code:e,message:t,url:a,method:r,error:n}){const i=kf(e);return new i({message:t,code:e,url:a,method:r,error:n})}var _f=Object.defineProperty,Lf=(e,t,a)=>t in e?_f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,d=(e,t,a)=>Lf(e,typeof t!="symbol"?t+"":t,a);class ic extends m{}d(ic,"code",110700),d(ic,"message","The input amount is outside trade limit.");class oc extends m{}d(oc,"code",110701),d(oc,"message","No quote is available with given input.");class cc extends m{}d(cc,"code",110702),d(cc,"message","No supported configurations with given input.");class lc extends m{}d(lc,"code",110703),d(lc,"message","refId already exists, should be unique.");class qr extends m{}d(qr,"code",155101),d(qr,"message","Existing user already created with the provided userId.");class Hr extends m{}d(Hr,"code",155102),d(Hr,"message","Cannot find the user id in the system.");class Gr extends m{}d(Gr,"code",155103),d(Gr,"message","Cannot find the user token in the system.");class Wr extends m{}d(Wr,"code",155104),d(Wr,"message","The userToken had expired.");class zr extends m{}d(zr,"code",155105),d(zr,"message","The userToken is invalid.");class $r extends m{}d($r,"code",155106),d($r,"message","The user had already been initialized.");class Qr extends m{}d(Qr,"code",155107),d(Qr,"message","User has previously set a PIN. Use PUT /user/pin to reset the PIN.");class Xr extends m{}d(Xr,"code",155108),d(Xr,"message","User has previously set up their security questions, and they can't be reset.");class jr extends m{}d(jr,"code",155109),d(jr,"message","The specified user has been disabled.");class Yr extends m{}d(Yr,"code",155110),d(Yr,"message","User has not set up a PIN yet.");class Zr extends m{}d(Zr,"code",155111),d(Zr,"message","User hasn't set the security questions for PIN backup yet.");class Jr extends m{}d(Jr,"code",155112),d(Jr,"message","The user has inputted the incorrect pin.");class ea extends m{}d(ea,"code",155113),d(ea,"message","Provided device ID is not found in the system.");class ta extends m{}d(ta,"code",155114),d(ta,"message","Provided app ID is not recognized in the system.");class ra extends m{}d(ra,"code",155115),d(ra,"message","The user has inputted the incorrect security answers");class aa extends m{}d(aa,"code",155116),d(aa,"message","The challenge ID doesn't exist in the system.");class na extends m{}d(na,"code",155117),d(na,"message","The content provided for approval is not correct.");class sa extends m{}d(sa,"code",155118),d(sa,"message","Encryption key does not match with the user's token. Call POST /users/token to get the correct token encryption key pair.");class ia extends m{}d(ia,"code",155119),d(ia,"message","The user's PIN input is locked. It will be unlocked after the cooldown period.");class oa extends m{}d(oa,"code",155120),d(oa,"message","The user's security questions input is locked. It will be unlocked after the cooldown period.");class ca extends m{}d(ca,"code",155121),d(ca,"message","The provided challengeId has expired.");class la extends m{}d(la,"code",155122),d(la,"message","The provided challengeId is invalid");class ua extends m{}d(ua,"code",155123),d(ua,"message","No extra information provided when adding PIN-related requests.");class fa extends m{}d(fa,"code",155124),d(fa,"message","The extra information provided for PIN-related requests is invalid.");class da extends m{}d(da,"code",155130),d(da,"message","User OTP token is expired.");class ha extends m{}d(ha,"code",155131),d(ha,"message","User OTP token is invalid.");class pa extends m{}d(pa,"code",155132),d(pa,"message","User OTP value is not found.");class ga extends m{}d(ga,"code",155133),d(ga,"message","User OTP value is invalid.");class ya extends m{}d(ya,"code",155134),d(ya,"message","User OTP value is not matched.");class va extends m{}d(va,"code",155135),d(va,"message","User's email is invalid.");class ma extends m{}d(ma,"code",155136),d(ma,"message","User's email is not matched.");class Ea extends m{}d(Ea,"code",155137),d(Ea,"message","User's device ID is invalid.");class Ca extends m{}d(Ca,"code",155138),d(Ca,"message","Failed to send the email.");class xa extends m{}d(xa,"code",155139),d(xa,"message","The idToken / accessToken of SSO is expired.");class Ta extends m{}d(Ta,"code",155140),d(Ta,"message","Failed to validate the idToken/ accessToken.");class Sa extends m{}d(Sa,"code",155141),d(Sa,"message","The user has exceeded the max limit (5) of entering OTP at the moment.");class Aa extends m{}d(Aa,"code",155142),d(Aa,"message","The max limit (5) of sending OTP has been exceeded at the moment.");class Ia extends m{}d(Ia,"code",155143),d(Ia,"message","The device token is expired.");class ba extends m{}d(ba,"code",155144),d(ba,"message","The device token is invalid.");class Ba extends m{}d(Ba,"code",155145),d(Ba,"message","The device token is not found.");class wa extends m{}d(wa,"code",155146),d(wa,"message","The one-time password token is invalid as the user has entered it incorrectly three times.");class Ua extends m{}d(Ua,"code",155150),d(Ua,"message","The SMTP server configuration is not found.");class ka extends m{}d(ka,"code",155151),d(ka,"message","The SMTP server configuration is invalid.");class Na extends m{}d(Na,"code",155152),d(Na,"message","The SSO provider configuration is not found.");class Ra extends m{}d(Ra,"code",155154),d(Ra,"message","The OTP email template is invalid.");class _a extends m{}d(_a,"code",155155),d(_a,"message","The OTP email template is not found.");class La extends m{}d(La,"code",155156),d(La,"message","Failed to update the email template.");class Da extends m{}d(Da,"code",155157),d(Da,"message","Failed to update the SMTP server configuration.");class Pa extends m{}d(Pa,"code",155158),d(Pa,"message","Failed to dial to the SMTP server.");class Oa extends m{}d(Oa,"code",155159),d(Oa,"message","Failed to auth to the SMTP server.");class Va extends m{}d(Va,"code",155160),d(Va,"message","Failed to send to the SMTP server.");class Fa extends m{}d(Fa,"code",155201),d(Fa,"message","Not enough funds to fulfill the withdraw request.");class Ma extends m{}d(Ma,"code",155202),d(Ma,"message","Transaction nonce is inconsistent with sender's latest nonce.");class Ka extends m{}d(Ka,"code",155203),d(Ka,"message","User op nonce can not be larger than 0 when the smart contract wallet hasn't been deployed.");class qa extends m{}d(qa,"code",155204),d(qa,"message","The total cost of executing transaction is higher than the balance of the user's account when estimating fee.");class Ha extends m{}d(Ha,"code",155205),d(Ha,"message","Failed to execute this request on EVM due to insufficient tokens when the estimating gas fee.");class Ga extends m{}d(Ga,"code",155206),d(Ga,"message","The sender address is not the token owner or the sender wasn't approved to commit this transaction.");class Wa extends m{}d(Wa,"code",155207),d(Wa,"message","Gas required exceeds the maximum allowance for the account. This is based on the gas fee estimate amount.");class za extends m{}d(za,"code",155208),d(za,"message","Estimate fee execution reverted.");class $a extends m{}d($a,"code",155209),d($a,"message","ABI function signature can't pack ABI parameter.");class Qa extends m{}d(Qa,"code",155210),d(Qa,"message","Fails to perform transaction estimation.");class Xa extends m{}d(Xa,"code",155211),d(Xa,"message","MaxFee * GasLimit exceeded the maximum permitted transaction gas fee.");class ja extends m{}d(ja,"code",155215),d(ja,"message","Unsupported operation for transaction.");class Ya extends m{}d(Ya,"code",155218),d(Ya,"message","Invalid number of nft in transaction request.");class Za extends m{}d(Za,"code",155219),d(Za,"message","Invalid destination address.");class Ja extends m{}d(Ja,"code",155220),d(Ja,"message","Wallet and token's blockchain mismatch.");class en extends m{}d(en,"code",155221),d(en,"message","Invalid amounts in transfer request.");class tn extends m{}d(tn,"code",155222),d(tn,"message","NFT metadata can not be found.");class rn extends m{}d(rn,"code",155223),d(rn,"message","Unsupported userId for get transactions.");class an extends m{}d(an,"code",155224),d(an,"message","Failed to parse the provided amounts in request to decimals.");class nn extends m{}d(nn,"code",155225),d(nn,"message","Wallet and request's blockchain mismatch.");class sn extends m{}d(sn,"code",155226),d(sn,"message","Invalid source address.");class on extends m{}d(on,"code",155227),d(on,"message","Invalid transaction type.");class cn extends m{}d(cn,"code",155228),d(cn,"message","Missing token ID.");class ln extends m{}d(ln,"code",155229),d(ln,"message","Transaction is not eligible for operation.");class un extends m{}d(un,"code",155230),d(un,"message","No abi signature provided.");class fn extends m{}d(fn,"code",155231),d(fn,"message","Transaction needs feeLevel or gasLimit provided.");class dn extends m{}d(dn,"code",155232),d(dn,"message","SCA transaction needs feeLevel provided.");class hn extends m{}d(hn,"code",155233),d(hn,"message","Provided gasLimit is too low to complete the requested transaction.");class pn extends m{}d(pn,"code",155234),d(pn,"message","Transaction can't have both feeLevel and fee parameters provided.");class gn extends m{}d(gn,"code",155235),d(gn,"message","EIP1559 chains need maxFee/priorityFee provided.");class yn extends m{}d(yn,"code",155236),d(yn,"message","The provided fee in request is invalid.");class vn extends m{}d(vn,"code",155237),d(vn,"message","PriorityFee cannot be larger than maxFee in creating transaction request.");class mn extends m{}d(mn,"code",155238),d(mn,"message","Non-EIP1559 chains need gasPrice provided.");class En extends m{}d(En,"code",155239),d(En,"message","Invalid token address for transfer.");class Cn extends m{}d(Cn,"code",155240),d(Cn,"message","Invalid token standard for transfer.");class xn extends m{}d(xn,"code",155241),d(xn,"message","Invalid token decimal for transfer.");class Tn extends m{}d(Tn,"code",155242),d(Tn,"message","The lengths of amounts and nft tokens don't match.");class Sn extends m{}d(Sn,"code",155243),d(Sn,"message","Missing bytecode for contract deployment.");class An extends m{}d(An,"code",155244),d(An,"message","Cannot provide both WalletID and SourceAddress/Blockchain.");class In extends m{}d(In,"code",155245),d(In,"message","Invalid amount in contract execution request.");class bn extends m{}d(bn,"code",155247),d(bn,"message","Cannot provide both CallData and AbiFunctionSignature/AbiParameters.");class Bn extends m{}d(Bn,"code",155254),d(Bn,"message","Non-EIP1559 chains don't support maxFee/priorityFee.");class wn extends m{}d(wn,"code",155257),d(wn,"message","the transfer amount is insufficient to make the destination account rent exempted or the balance of the source account is insufficient to remain rent exempted. The source address's remaining balance after transfer must be either zero or above the rent exemption threshold.");class Un extends m{}d(Un,"code",155258),d(Un,"message","The asset amount owned by the wallet is insufficient for the transaction.");class kn extends m{}d(kn,"code",155262),d(kn,"message","Account is not found, could be caused by transacting from a Solana account with zero balance.");class Nn extends m{}d(Nn,"code",155264),d(Nn,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class Rn extends m{}d(Rn,"code",155501),d(Rn,"message","Frozen wallets can not be updated or interact with, only query.");class _n extends m{}d(_n,"code",155502),d(_n,"message","Max amount of wallets (tentative 1M) reached under 1 wallet set.");class Ln extends m{}d(Ln,"code",155503),d(Ln,"message","Metadata array length needs to match wallet count in create developer wallets request.");class Dn extends m{}d(Dn,"code",155504),d(Dn,"message","Metadata array length needs to match number of blockchains in create user wallets request.");class Pn extends m{}d(Pn,"code",155505),d(Pn,"message","SCA wallet needs to wait for first-time transaction to be queued before processing more transactions.");class On extends m{}d(On,"code",155506),d(On,"message","SCA wallet config is invalid.");class Vn extends m{}d(Vn,"code",155507),d(Vn,"message","SCA account is not supported on the given blockchain.");class Fn extends m{}d(Fn,"code",155508),d(Fn,"message","Can't create multiple user-controlled SCA wallets across multiple blockchains at a time.");class Mn extends m{}d(Mn,"code",155509),d(Mn,"message","Entity needs to setup paymaster policy in developer console before sending transaction on mainnet");class Kn extends m{}d(Kn,"code",155510),d(Kn,"message","The operation is not supported on the blockchain you specify.");class qn extends m{}d(qn,"code",155511),d(qn,"message","Blockchain is not supported for wallet creation.");class Hn extends m{}d(Hn,"code",155512),d(Hn,"message","The owner of the SCA wallet can not be found.");class Gn extends m{}d(Gn,"code",155514),d(Gn,"message","circle_4337_v1 SCA wallet must be deployed before being upgraded.");class Wn extends m{}d(Wn,"code",155515),d(Wn,"message","The provided wallet account type is not supported by this API.");class zn extends m{}d(zn,"code",155516),d(zn,"message","The source wallet was originally created on an SCA version that does not support wallet derivation.");class $n extends m{}d($n,"code",155517),d($n,"message","The SCA wallet is not deployed onchain.");class Qn extends m{}d(Qn,"code",155601),d(Qn,"message","Failed to retrieve wallet set which already exists.");class Xn extends m{}d(Xn,"code",155701),d(Xn,"message","User canceled");class jn extends m{}d(jn,"code",155702),d(jn,"message","<Launch UI failed reason>");class Yn extends m{}d(Yn,"code",155703),d(Yn,"message","The code you entered is not the same as the first one.");class Zn extends m{}d(Zn,"code",155704),d(Zn,"message","Your PIN can't have repeating or consecutive numbers.");class Jn extends m{}d(Jn,"code",155705),d(Jn,"message","Your hint can't be the same as the answer.");class es extends m{}d(es,"code",155706),d(es,"message","Network error");class ts extends m{}d(ts,"code",155707),d(ts,"message","Failed to encrypt data");class rs extends m{}d(rs,"code",155708),d(rs,"message",'"Biometrics instead of PIN" is disabled');class as extends m{}d(as,"code",155709),d(as,"message","The device system doesn't support biometrics");class ns extends m{}d(ns,"code",155710),d(ns,"message","Failed to decrypt biometrics key");class ss extends m{}d(ss,"code",155711),d(ss,"message","The user has not enabled biometrics yet");class is extends m{}d(is,"code",155712),d(is,"message","The user refused to enable biometrics");class os extends m{}d(os,"code",155713),d(os,"message","Too many requests. Try again later");class cs extends m{}d(cs,"code",155714),d(cs,"message","Too many requests. The biometrics sensor on the device is locked.");class ls extends m{}d(ls,"code",155715),d(ls,"message","The user didn't enable biometrics");class us extends m{}d(us,"code",155716),d(us,"message","Unexpected error for biometrics");class fs extends m{}d(fs,"code",155717),d(fs,"message","User secret is missing.");class ds extends m{}d(ds,"code",155718),d(ds,"message","User secret is invalid.");class hs extends m{}d(hs,"code",155719),d(hs,"message","User token and SDK API execute function does not match.");class ps extends m{}d(ps,"code",155720),d(ps,"message","Social login failed.");class gs extends m{}d(gs,"code",155721),d(gs,"message","Login info is missing.");class ys extends m{}d(ys,"code",155801),d(ys,"message","Transaction or rawTransaction is invalid.");class vs extends m{}d(vs,"code",155802),d(vs,"message","Account not found.");class ms extends m{}d(ms,"code",155803),d(ms,"message","Not signer account.");class Es extends m{}d(Es,"code",155804),d(Es,"message","Transaction already signed.");class Cs extends m{}d(Cs,"code",155805),d(Cs,"message","Transaction failed to deserialize.");class xs extends m{}d(xs,"code",155806),d(xs,"message","The transaction size exceeds blockchain limit.");class Ts extends m{}d(Ts,"code",155807),d(Ts,"message","The chain ID is not supported for signing.");class Ss extends m{}d(Ss,"code",155808),d(Ss,"message","The chain ID is missing in sign request.");class As extends m{}d(As,"code",156001),d(As,"message","Cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller.");class Is extends m{}d(Is,"code",156002),d(Is,"message","Cannot find target token in the system. Either the specified token doesn't exist or it's not accessible to the caller.");class bs extends m{}d(bs,"code",156003),d(bs,"message","Cannot find target transaction in the system. Either the specified transaction doesn't exist or it's not accessible to the caller.");class Bs extends m{}d(Bs,"code",156004),d(Bs,"message","Reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext.");class ws extends m{}d(ws,"code",156005),d(ws,"message","Cannot find target wallet set in the system. Either no such wallet set, or it's not accessible to the caller.");class Us extends m{}d(Us,"code",156006),d(Us,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets.");class ks extends m{}d(ks,"code",156007),d(ks,"message","TEST_API key or LIVE_API key is not found for the request.");class Ns extends m{}d(Ns,"code",156008),d(Ns,"message","Cannot find target entity config in the system. Either no such entity config, or it's not accessible to the caller.");class Rs extends m{}d(Rs,"code",156009),d(Rs,"message","Fail to parse id as UUID in url.");class _s extends m{}d(_s,"code",156010),d(_s,"message","Cannot find the corresponding entity in the system.");class Ls extends m{}d(Ls,"code",156011),d(Ls,"message","Cannot find target nftTokenId in the system.");class Ds extends m{}d(Ds,"code",156012),d(Ds,"message","Cannot find corresponding pagination cursor in the system.");class Ps extends m{}d(Ps,"code",156013),d(Ps,"message","The provided entity secret is invalid.");class Os extends m{}d(Os,"code",156014),d(Os,"message","Pagination params are invalid. Only UUID format is supported for pageBefore and pageAfter.");class Vs extends m{}d(Vs,"code",156015),d(Vs,"message","The secret for this entity has already been set.");class Fs extends m{}d(Fs,"code",156016),d(Fs,"message","The entity secret has not been set yet. Please provide encrypted ciphertext in the console.");class Ms extends m{}d(Ms,"code",156017),d(Ms,"message","The specified blockchain parameters are incorrect.");class Ks extends m{}d(Ks,"code",156018),d(Ks,"message","The uploaded recovery file is invalid.");class qs extends m{}d(qs,"code",156019),d(qs,"message","Current entity secret is invalid. Please rotate the entity secret first.");class Hs extends m{}d(Hs,"code",156020),d(Hs,"message","Please use a new idempotency key.");class Gs extends m{}d(Gs,"code",156021),d(Gs,"message","A new wallet set ID is required.");class Ws extends m{}d(Ws,"code",156023),d(Ws,"message","EncodedByHex is true in sign request, but the message is not hex encoded.");class zs extends m{}d(zs,"code",156024),d(zs,"message","Data is not a valid JSON string in sign request.");class $s extends m{}d($s,"code",156025),d($s,"message","Invalid message in request.");class Qs extends m{}d(Qs,"code",156026),d(Qs,"message","Invalid typed data in request.");class Xs extends m{}d(Xs,"code",156027),d(Xs,"message","The specified blockchain is either not supported or deprecated.");class js extends m{}d(js,"code",156030),d(js,"message","Invalid unsigned delegate action in request.");class Ys extends m{}d(Ys,"code",156031),d(Ys,"message","The specified token address is not supported.");class Zs extends m{}d(Zs,"code",156032),d(Zs,"message","The provided amount is invalid.");class Js extends m{}d(Js,"code",175001),d(Js,"message","contract not found");class ei extends m{}d(ei,"code",175002),d(ei,"message","no ABI JSON for the target contract");class ti extends m{}d(ti,"code",175003),d(ti,"message","constructor parameters length must match constructor signature");class ri extends m{}d(ri,"code",175004),d(ri,"message","contract already exists");class ai extends m{}d(ai,"code",175005),d(ai,"message","address is not a contract address");class ni extends m{}d(ni,"code",175006),d(ni,"message","contract is archived");class si extends m{}d(si,"code",175007),d(si,"message","invalid ABI JSON");class ii extends m{}d(ii,"code",175008),d(ii,"message","multi-layered proxies are not supported");class oi extends m{}d(oi,"code",175009),d(oi,"message","contract deployment pending");class ci extends m{}d(ci,"code",175010),d(ci,"message","ABI function not found");class li extends m{}d(li,"code",175011),d(li,"message","empty update on a contract");class ui extends m{}d(ui,"code",175012),d(ui,"message","unable to query contract");class fi extends m{}d(fi,"code",175013),d(fi,"message","ABI function is not supported");class di extends m{}d(di,"code",175201),d(di,"message","template not found");class hi extends m{}d(hi,"code",175202),d(hi,"message","deploying this template is temporarily disabled");class pi extends m{}d(pi,"code",175203),d(pi,"message","invalid template deployment parameter");class gi extends m{}d(gi,"code",175204),d(gi,"message","missing required template deployment parameter");class yi extends m{}d(yi,"code",175205),d(yi,"message","estimation is not supported");class vi extends m{}d(vi,"code",175301),d(vi,"message","event subscription not found");class mi extends m{}d(mi,"code",175302),d(mi,"message","event subscription already exists");class Ei extends m{}d(Ei,"code",175303),d(Ei,"message","the specified event signature does not exist");class Ci extends m{}d(Ci,"code",175401),d(Ci,"message","failed to parse id as UUID in url");class xi extends m{}d(xi,"code",175402),d(xi,"message","the specified blockchain is either not supported or deprecated");class Ti extends m{}d(Ti,"code",175403),d(Ti,"message","please use a new idempotency key");class Si extends m{}d(Si,"code",175404),d(Si,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets");class Ai extends m{}d(Ai,"code",175405),d(Ai,"message","TEST_API key or LIVE_API key is not found for the request");class Ii extends m{}d(Ii,"code",175406),d(Ii,"message","this feature is temporarily disabled");class bi extends m{}d(bi,"code",175407),d(bi,"message","the specified blockchain is currently unavailable");class Bi extends m{}d(Bi,"code",175408),d(Bi,"message","can not find corresponding pagination cursor in the system");class wi extends m{}d(wi,"code",175409),d(wi,"message","restricted entity cannot perform this operation");class Ui extends m{}d(Ui,"code",175410),d(Ui,"message","invalid address format");class ki extends m{}d(ki,"code",177001),d(ki,"message","transaction nonce is inconsistent with sender's latest nonce");class Ni extends m{}d(Ni,"code",177002),d(Ni,"message","user op nonce can not be larger than 0 when smart contract wallet hasn't been deployed");class Ri extends m{}d(Ri,"code",177003),d(Ri,"message","failed to execute this request on EVM due to insufficient token when estimating fee");class _i extends m{}d(_i,"code",177004),d(_i,"message","the total cost of executing transaction is higher than the balance of the user's account when estimating fee");class Li extends m{}d(Li,"code",177005),d(Li,"message","the sender address is not token owner or approved when estimating token transfer");class Di extends m{}d(Di,"code",177006),d(Di,"message","gas required exceeds allowance when estimating fee");class Pi extends m{}d(Pi,"code",177007),d(Pi,"message","estimate fee execution reverted");class Oi extends m{}d(Oi,"code",177008),d(Oi,"message","ABI function signature can't pack ABI parameter");class Vi extends m{}d(Vi,"code",177009),d(Vi,"message","fails to perform transaction estimation");class Fi extends m{}d(Fi,"code",177010),d(Fi,"message","MaxFee * GasLimit exceeds configurable max transaction fee (default is 1 native token)");class Mi extends m{}d(Mi,"code",177011),d(Mi,"message","transaction needs feeLevel or gasLimit provided");class Ki extends m{}d(Ki,"code",177012),d(Ki,"message","SCA transaction needs feeLevel provided");class qi extends m{}d(qi,"code",177013),d(qi,"message","EIP1559 chains need maxFee/priorityFee provided");class Hi extends m{}d(Hi,"code",177014),d(Hi,"message","priorityFee cannot be larger than maxFee in creating transaction request");class Gi extends m{}d(Gi,"code",177015),d(Gi,"message","missing bytecode for contract deployment");class Wi extends m{}d(Wi,"code",177016),d(Wi,"message","cannot provide both WalletID and SourceAddress/Blockchain");class zi extends m{}d(zi,"code",177017),d(zi,"message","invalid amount in contract execution request");class $i extends m{}d($i,"code",177018),d($i,"message","policy is not activated and cannot be used");class Qi extends m{}d(Qi,"code",177019),d(Qi,"message","exceeded max daily transaction of the policy");class Xi extends m{}d(Xi,"code",177020),d(Xi,"message","exceeded max spend USD per transaction of the policy");class ji extends m{}d(ji,"code",177021),d(ji,"message","exceeded max spend USD daily of the policy");class Yi extends m{}d(Yi,"code",177022),d(Yi,"message","exceeded max native token daily of the policy");class Zi extends m{}d(Zi,"code",177023),d(Zi,"message","sender is in policy blocklist");class Ji extends m{}d(Ji,"code",177024),d(Ji,"message","Wallet and request's blockchain mismatch.");class eo extends m{}d(eo,"code",177025),d(eo,"message","the asset amount owned by the wallet is insufficient for the transaction");class to extends m{}d(to,"code",177026),d(to,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class ro extends m{}d(ro,"code",177301),d(ro,"message","wallet is Frozen");class ao extends m{}d(ao,"code",177302),d(ao,"message","invalid sca wallet config");class no extends m{}d(no,"code",177303),d(no,"message","SCA wallet first-time transaction is still in progress");class so extends m{}d(so,"code",177304),d(so,"message","SCA account is not supported on the given blockchain");class io extends m{}d(io,"code",177305),d(io,"message","entity is not eligible for SCA account creation. Please check paymaster policy setup");class oo extends m{}d(oo,"code",177601),d(oo,"message","cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller");class co extends m{}d(co,"code",177602),d(co,"message","reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext");class lo extends m{}d(lo,"code",177603),d(lo,"message","cannot find the corresponding entity in the system");class uo extends m{}d(uo,"code",177604),d(uo,"message","the provided entity secret is invalid");class fo extends m{}d(fo,"code",177605),d(fo,"message","the entity secret has not been set yet. Please provide encrypted ciphertext in the console");class ho extends m{}d(ho,"code",177606),d(ho,"message","current entity secret is invalid. Please rotate the entity secret first");class po extends m{}d(po,"code",177607),d(po,"message","please use a new idempotency key");class go extends m{}d(go,"code",177901),d(go,"message","smart contract query failed");const Cl={undefined:m,[Ar.code]:Ar,[Ir.code]:Ir,[br.code]:br,[Br.code]:Br,[wr.code]:wr,[Ur.code]:Ur,[kr.code]:kr,[Nr.code]:Nr,[Rr.code]:Rr,[_r.code]:_r,[qr.code]:qr,[Hr.code]:Hr,[Gr.code]:Gr,[Wr.code]:Wr,[zr.code]:zr,[$r.code]:$r,[Qr.code]:Qr,[Xr.code]:Xr,[jr.code]:jr,[Yr.code]:Yr,[Zr.code]:Zr,[Jr.code]:Jr,[ea.code]:ea,[ta.code]:ta,[ra.code]:ra,[aa.code]:aa,[na.code]:na,[sa.code]:sa,[ia.code]:ia,[oa.code]:oa,[ca.code]:ca,[la.code]:la,[ua.code]:ua,[fa.code]:fa,[da.code]:da,[ha.code]:ha,[pa.code]:pa,[ga.code]:ga,[ya.code]:ya,[va.code]:va,[ma.code]:ma,[Ea.code]:Ea,[Ca.code]:Ca,[xa.code]:xa,[Ta.code]:Ta,[Sa.code]:Sa,[Aa.code]:Aa,[Ia.code]:Ia,[ba.code]:ba,[Ba.code]:Ba,[wa.code]:wa,[Ua.code]:Ua,[ka.code]:ka,[Na.code]:Na,[Ra.code]:Ra,[_a.code]:_a,[La.code]:La,[Da.code]:Da,[Pa.code]:Pa,[Oa.code]:Oa,[Va.code]:Va,[Fa.code]:Fa,[Ma.code]:Ma,[Ka.code]:Ka,[qa.code]:qa,[Ha.code]:Ha,[Ga.code]:Ga,[Wa.code]:Wa,[za.code]:za,[$a.code]:$a,[Qa.code]:Qa,[Xa.code]:Xa,[ja.code]:ja,[Ya.code]:Ya,[Za.code]:Za,[Ja.code]:Ja,[en.code]:en,[tn.code]:tn,[rn.code]:rn,[an.code]:an,[nn.code]:nn,[sn.code]:sn,[on.code]:on,[cn.code]:cn,[ln.code]:ln,[un.code]:un,[fn.code]:fn,[dn.code]:dn,[hn.code]:hn,[pn.code]:pn,[gn.code]:gn,[yn.code]:yn,[vn.code]:vn,[mn.code]:mn,[En.code]:En,[Cn.code]:Cn,[xn.code]:xn,[Tn.code]:Tn,[Sn.code]:Sn,[An.code]:An,[In.code]:In,[bn.code]:bn,[Bn.code]:Bn,[wn.code]:wn,[Un.code]:Un,[kn.code]:kn,[Nn.code]:Nn,[Rn.code]:Rn,[_n.code]:_n,[Ln.code]:Ln,[Dn.code]:Dn,[Pn.code]:Pn,[On.code]:On,[Vn.code]:Vn,[Fn.code]:Fn,[Mn.code]:Mn,[Kn.code]:Kn,[qn.code]:qn,[Hn.code]:Hn,[Gn.code]:Gn,[Wn.code]:Wn,[zn.code]:zn,[$n.code]:$n,[Qn.code]:Qn,[Xn.code]:Xn,[jn.code]:jn,[Yn.code]:Yn,[Zn.code]:Zn,[Jn.code]:Jn,[es.code]:es,[ts.code]:ts,[rs.code]:rs,[as.code]:as,[ns.code]:ns,[ss.code]:ss,[is.code]:is,[os.code]:os,[cs.code]:cs,[ls.code]:ls,[us.code]:us,[fs.code]:fs,[ds.code]:ds,[hs.code]:hs,[ps.code]:ps,[gs.code]:gs,[ys.code]:ys,[vs.code]:vs,[ms.code]:ms,[Es.code]:Es,[Cs.code]:Cs,[xs.code]:xs,[Ts.code]:Ts,[Ss.code]:Ss,[As.code]:As,[Is.code]:Is,[bs.code]:bs,[Bs.code]:Bs,[ws.code]:ws,[Us.code]:Us,[ks.code]:ks,[Ns.code]:Ns,[Rs.code]:Rs,[_s.code]:_s,[Ls.code]:Ls,[Ds.code]:Ds,[Ps.code]:Ps,[Os.code]:Os,[Vs.code]:Vs,[Fs.code]:Fs,[Ms.code]:Ms,[Ks.code]:Ks,[qs.code]:qs,[Hs.code]:Hs,[Gs.code]:Gs,[Ws.code]:Ws,[zs.code]:zs,[$s.code]:$s,[Qs.code]:Qs,[Xs.code]:Xs,[js.code]:js,[Ys.code]:Ys,[Zs.code]:Zs,[Js.code]:Js,[ei.code]:ei,[ti.code]:ti,[ri.code]:ri,[ai.code]:ai,[ni.code]:ni,[si.code]:si,[ii.code]:ii,[oi.code]:oi,[ci.code]:ci,[li.code]:li,[ui.code]:ui,[fi.code]:fi,[di.code]:di,[hi.code]:hi,[pi.code]:pi,[gi.code]:gi,[yi.code]:yi,[vi.code]:vi,[mi.code]:mi,[Ei.code]:Ei,[Ci.code]:Ci,[xi.code]:xi,[Ti.code]:Ti,[Si.code]:Si,[Ai.code]:Ai,[Ii.code]:Ii,[bi.code]:bi,[Bi.code]:Bi,[wi.code]:wi,[Ui.code]:Ui,[ki.code]:ki,[Ni.code]:Ni,[Ri.code]:Ri,[_i.code]:_i,[Li.code]:Li,[Di.code]:Di,[Pi.code]:Pi,[Oi.code]:Oi,[Vi.code]:Vi,[Fi.code]:Fi,[Mi.code]:Mi,[Ki.code]:Ki,[qi.code]:qi,[Hi.code]:Hi,[Gi.code]:Gi,[Wi.code]:Wi,[zi.code]:zi,[$i.code]:$i,[Qi.code]:Qi,[Xi.code]:Xi,[ji.code]:ji,[Yi.code]:Yi,[Zi.code]:Zi,[Ji.code]:Ji,[eo.code]:eo,[to.code]:to,[ro.code]:ro,[ao.code]:ao,[no.code]:no,[so.code]:so,[io.code]:io,[oo.code]:oo,[co.code]:co,[lo.code]:lo,[uo.code]:uo,[fo.code]:fo,[ho.code]:ho,[po.code]:po,[go.code]:go};function Df(e){return Cl[e]??Cl.undefined}function Pf(e){const t=e.response.data,a=e.response.status;return Of({code:t?.code??a,status:a,message:t?.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function Of({code:e,status:t,message:a,url:r,method:n,error:i}){const s=Df(e);return new s({message:a,code:e,url:r,method:n,status:t,error:i})}function X(e){return e.response?Pf(e):Nf(e)}const j=e=>{const{data:t,headers:a,...r}=e;return{...r,data:t.data,headers:a}},Vf=({configurationsClient:e})=>async t=>{try{return j(await e.MonitorTokens.createMonitoredTokens(t))}catch(a){throw _.isAxiosError(a)?X(a):a}},Ff=({configurationsClient:e})=>async t=>{try{return await e.MonitorTokens.deleteMonitoredTokens(t)}catch(a){throw _.isAxiosError(a)?X(a):a}},Mf=({configurationsClient:e})=>async t=>{try{return j(await e.MonitorTokens.listMonitoredTokens(t?.blockchain,t?.tokenAddress,t?.symbol,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize))}catch(a){throw _.isAxiosError(a)?X(a):a}},Kf=({configurationsClient:e})=>async t=>{try{return j(await e.MonitorTokens.updateMonitoredTokens(t))}catch(a){throw _.isAxiosError(a)?X(a):a}},qf=({configurationsClient:e})=>async t=>{try{return await e.MonitorTokens.updateMonitoredTokensScope(t)}catch(a){throw _.isAxiosError(a)?X(a):a}},Hf=({configurationsClient:e})=>async t=>{try{return j(await e.WebhookSubscriptions.createSubscription(t))}catch(a){throw _.isAxiosError(a)?X(a):a}},Gf=({configurationsClient:e})=>async t=>{try{return await e.WebhookSubscriptions.deleteSubscription(t)}catch(a){throw _.isAxiosError(a)?X(a):a}},Wf=({configurationsClient:e})=>async t=>{try{return j(await e.WebhookSubscriptions.getSubscription(t))}catch(a){throw _.isAxiosError(a)?X(a):a}},zf=({configurationsClient:e})=>async t=>{try{return j(await e.WebhookSubscriptions.getNotificationSignature(t))}catch(a){throw _.isAxiosError(a)?X(a):a}},$f=({configurationsClient:e})=>async()=>{try{return j(await e.WebhookSubscriptions.getSubscriptions())}catch(t){throw _.isAxiosError(t)?X(t):t}},Qf=({configurationsClient:e})=>async({id:t,...a})=>{try{return j(await e.WebhookSubscriptions.updateSubscription(t,a))}catch(r){throw _.isAxiosError(r)?X(r):r}};var Xf=Object.defineProperty,jf=(e,t,a)=>t in e?Xf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Yf=(e,t,a)=>jf(e,typeof t!="symbol"?t+"":t,a);class Zf{constructor(){Yf(this,"data",{})}get(t){return Promise.resolve(this.data[t]??void 0)}set(t,a){return a===void 0?delete this.data[t]:this.data[t]=a,Promise.resolve()}}var Jf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},J={options:{usePureJavaScript:!1}},uc={},ed=uc,xl={};uc.encode=function(e,t,a){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(a!==void 0&&typeof a!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=td(e,t);else{var n=0,i=t.length,s=t.charAt(0),o=[0];for(n=0;n<e.length;++n){for(var c=0,l=e[n];c<o.length;++c)l+=o[c]<<8,o[c]=l%i,l=l/i|0;for(;l>0;)o.push(l%i),l=l/i|0}for(n=0;e[n]===0&&n<e.length-1;++n)r+=s;for(n=o.length-1;n>=0;--n)r+=t[o[n]]}if(a){var u=new RegExp(".{1,"+a+"}","g");r=r.match(u).join(`\r
|
|
2
|
+
`)}return r},uc.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var a=xl[t];if(!a){a=xl[t]=[];for(var r=0;r<t.length;++r)a[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var n=t.length,i=t.charAt(0),s=[0],r=0;r<e.length;r++){var o=a[e.charCodeAt(r)];if(o===void 0)return;for(var c=0,l=o;c<s.length;++c)l+=s[c]*n,s[c]=l&255,l>>=8;for(;l>0;)s.push(l&255),l>>=8}for(var u=0;e[u]===i&&u<e.length-1;++u)s.push(0);return typeof Buffer<"u"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function td(e,t){var a=0,r=t.length,n=t.charAt(0),i=[0];for(a=0;a<e.length();++a){for(var s=0,o=e.at(a);s<i.length;++s)o+=i[s]<<8,i[s]=o%r,o=o/r|0;for(;o>0;)i.push(o%r),o=o/r|0}var c="";for(a=0;e.at(a)===0&&a<e.length()-1;++a)c+=n;for(a=i.length-1;a>=0;--a)c+=t[i[a]];return c}var Tl=J,Sl=ed,A=Tl.util=Tl.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){A.nextTick=process.nextTick,typeof setImmediate=="function"?A.setImmediate=setImmediate:A.setImmediate=A.nextTick;return}if(typeof setImmediate=="function"){A.setImmediate=function(){return setImmediate.apply(void 0,arguments)},A.nextTick=function(s){return setImmediate(s)};return}if(A.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(o){if(o.source===window&&o.data===e){o.stopPropagation();var c=t.slice();t.length=0,c.forEach(function(l){l()})}};var e="forge.setImmediate",t=[];A.setImmediate=function(o){t.push(o),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var a=Date.now(),r=!0,n=document.createElement("div"),t=[];new MutationObserver(function(){var o=t.slice();t.length=0,o.forEach(function(c){c()})}).observe(n,{attributes:!0});var i=A.setImmediate;A.setImmediate=function(o){Date.now()-a>15?(a=Date.now(),i(o)):(t.push(o),t.length===1&&n.setAttribute("a",r=!r))}}A.nextTick=A.setImmediate})(),A.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,A.globalScope=(function(){return A.isNodejs?Jf:typeof self>"u"?window:self})(),A.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},A.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer},A.isArrayBufferView=function(e){return e&&A.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function yo(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}A.ByteBuffer=fc;function fc(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(A.isArrayBuffer(e)||A.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var a=0;a<t.length;++a)this.putByte(t[a])}}else(e instanceof fc||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}A.ByteStringBuffer=fc;var rd=4096;A.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>rd&&(this.data.substr(0,1),this._constructedStringLength=0)},A.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},A.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},A.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},A.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var a=this.data;t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return this.data=a,this._optimizeConstructedString(t),this},A.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},A.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(A.encodeUtf8(e))},A.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},A.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},A.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},A.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))},A.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},A.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},A.ByteStringBuffer.prototype.putInt=function(e,t){yo(t);var a="";do t-=8,a+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(a)},A.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},A.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},A.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},A.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},A.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},A.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},A.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},A.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},A.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},A.ByteStringBuffer.prototype.getInt=function(e){yo(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t},A.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},A.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},A.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},A.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},A.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},A.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},A.ByteStringBuffer.prototype.copy=function(){var e=A.createBuffer(this.data);return e.read=this.read,e},A.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},A.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},A.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},A.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var a=this.data.charCodeAt(t);a<16&&(e+="0"),e+=a.toString(16)}return e},A.ByteStringBuffer.prototype.toString=function(){return A.decodeUtf8(this.bytes())};function ad(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var a=A.isArrayBuffer(e),r=A.isArrayBufferView(e);if(a||r){a?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}A.DataBuffer=ad,A.DataBuffer.prototype.length=function(){return this.write-this.read},A.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},A.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var a=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(a),this.data=new DataView(r.buffer),this},A.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},A.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var a=0;a<t;++a)this.data.setUint8(e);return this},A.DataBuffer.prototype.putBytes=function(e,t){if(A.isArrayBufferView(e)){var a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=a.byteLength-a.byteOffset;this.accommodate(r);var n=new Uint8Array(this.data.buffer,this.write);return n.set(a),this.write+=r,this}if(A.isArrayBuffer(e)){var a=new Uint8Array(e);this.accommodate(a.byteLength);var n=new Uint8Array(this.data.buffer);return n.set(a,this.write),this.write+=a.byteLength,this}if(e instanceof A.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&A.isArrayBufferView(e.data)){var a=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(a.byteLength);var n=new Uint8Array(e.data.byteLength,this.write);return n.set(a),this.write+=a.byteLength,this}if(e instanceof A.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var i;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=A.binary.hex.decode(e,i,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=A.binary.base64.decode(e,i,this.write),this;if(t==="utf8"&&(e=A.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=A.binary.raw.decode(i),this;if(t==="utf16")return this.accommodate(e.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=A.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},A.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},A.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},A.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},A.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},A.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},A.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},A.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},A.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},A.DataBuffer.prototype.putInt=function(e,t){yo(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this},A.DataBuffer.prototype.putSignedInt=function(e,t){return yo(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},A.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},A.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},A.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},A.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},A.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},A.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},A.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},A.DataBuffer.prototype.getInt=function(e){yo(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t},A.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},A.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},A.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},A.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},A.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},A.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},A.DataBuffer.prototype.copy=function(){return new A.DataBuffer(this)},A.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},A.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},A.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},A.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var a=this.data.getUint8(t);a<16&&(e+="0"),e+=a.toString(16)}return e},A.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return A.binary.raw.encode(t);if(e==="hex")return A.binary.hex.encode(t);if(e==="base64")return A.binary.base64.encode(t);if(e==="utf8")return A.text.utf8.decode(t);if(e==="utf16")return A.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},A.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=A.encodeUtf8(e)),new A.ByteBuffer(e)},A.fillString=function(e,t){for(var a="";t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return a},A.xorBytes=function(e,t,a){for(var r="",n="",i="",s=0,o=0;a>0;--a,++s)n=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(r+=i,i="",o=0),i+=String.fromCharCode(n),++o;return r+=i,r},A.hexToBytes=function(e){var t="",a=0;for(e.length&!0&&(a=1,t+=String.fromCharCode(parseInt(e[0],16)));a<e.length;a+=2)t+=String.fromCharCode(parseInt(e.substr(a,2),16));return t},A.bytesToHex=function(e){return A.createBuffer(e).toHex()},A.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var Kt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",qt=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Al="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";A.encode64=function(e,t){for(var a="",r="",n,i,s,o=0;o<e.length;)n=e.charCodeAt(o++),i=e.charCodeAt(o++),s=e.charCodeAt(o++),a+=Kt.charAt(n>>2),a+=Kt.charAt((n&3)<<4|i>>4),isNaN(i)?a+="==":(a+=Kt.charAt((i&15)<<2|s>>6),a+=isNaN(s)?"=":Kt.charAt(s&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
|
|
3
|
+
`,a=a.substr(t));return r+=a,r},A.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",a,r,n,i,s=0;s<e.length;)a=qt[e.charCodeAt(s++)-43],r=qt[e.charCodeAt(s++)-43],n=qt[e.charCodeAt(s++)-43],i=qt[e.charCodeAt(s++)-43],t+=String.fromCharCode(a<<2|r>>4),n!==64&&(t+=String.fromCharCode((r&15)<<4|n>>2),i!==64&&(t+=String.fromCharCode((n&3)<<6|i)));return t},A.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},A.decodeUtf8=function(e){return decodeURIComponent(escape(e))},A.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Sl.encode,decode:Sl.decode}},A.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},A.binary.raw.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var n=a,i=0;i<e.length;++i)r[n++]=e.charCodeAt(i);return t?n-a:r},A.binary.hex.encode=A.bytesToHex,A.binary.hex.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2))),a=a||0;var n=0,i=a;for(e.length&1&&(n=1,r[i++]=parseInt(e[0],16));n<e.length;n+=2)r[i++]=parseInt(e.substr(n,2),16);return t?i-a:r},A.binary.base64.encode=function(e,t){for(var a="",r="",n,i,s,o=0;o<e.byteLength;)n=e[o++],i=e[o++],s=e[o++],a+=Kt.charAt(n>>2),a+=Kt.charAt((n&3)<<4|i>>4),isNaN(i)?a+="==":(a+=Kt.charAt((i&15)<<2|s>>6),a+=isNaN(s)?"=":Kt.charAt(s&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
|
|
4
|
+
`,a=a.substr(t));return r+=a,r},A.binary.base64.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),a=a||0;for(var n,i,s,o,c=0,l=a;c<e.length;)n=qt[e.charCodeAt(c++)-43],i=qt[e.charCodeAt(c++)-43],s=qt[e.charCodeAt(c++)-43],o=qt[e.charCodeAt(c++)-43],r[l++]=n<<2|i>>4,s!==64&&(r[l++]=(i&15)<<4|s>>2,o!==64&&(r[l++]=(s&3)<<6|o));return t?l-a:r.subarray(0,l)},A.binary.base58.encode=function(e,t){return A.binary.baseN.encode(e,Al,t)},A.binary.base58.decode=function(e,t){return A.binary.baseN.decode(e,Al,t)},A.text={utf8:{},utf16:{}},A.text.utf8.encode=function(e,t,a){e=A.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var n=a,i=0;i<e.length;++i)r[n++]=e.charCodeAt(i);return t?n-a:r},A.text.utf8.decode=function(e){return A.decodeUtf8(String.fromCharCode.apply(null,e))},A.text.utf16.encode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length*2));var n=new Uint16Array(r.buffer);a=a||0;for(var i=a,s=a,o=0;o<e.length;++o)n[s++]=e.charCodeAt(o),i+=2;return t?i-a:r},A.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},A.deflate=function(e,t,a){if(t=A.decode64(e.deflate(A.encode64(t)).rval),a){var r=2,n=t.charCodeAt(1);n&32&&(r=6),t=t.substring(r,t.length-4)}return t},A.inflate=function(e,t,a){var r=e.inflate(A.encode64(t)).rval;return r===null?null:A.decode64(r)};var dc=function(e,t,a){if(!e)throw new Error("WebStorage not available.");var r;if(a===null?r=e.removeItem(t):(a=A.encode64(JSON.stringify(a)),r=e.setItem(t,a)),typeof r<"u"&&r.rval!==!0){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}},hc=function(e,t){if(!e)throw new Error("WebStorage not available.");var a=e.getItem(t);if(e.init)if(a.rval===null){if(a.error){var r=new Error(a.error.message);throw r.id=a.error.id,r.name=a.error.name,r}a=null}else a=a.rval;return a!==null&&(a=JSON.parse(A.decode64(a))),a},nd=function(e,t,a,r){var n=hc(e,t);n===null&&(n={}),n[a]=r,dc(e,t,n)},sd=function(e,t,a){var r=hc(e,t);return r!==null&&(r=a in r?r[a]:null),r},id=function(e,t,a){var r=hc(e,t);if(r!==null&&a in r){delete r[a];var n=!0;for(var i in r){n=!1;break}n&&(r=null),dc(e,t,r)}},od=function(e,t){dc(e,t,null)},ko=function(e,t,a){var r=null;typeof a>"u"&&(a=["web","flash"]);var n,i=!1,s=null;for(var o in a){n=a[o];try{if(n==="flash"||n==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),i=n==="flash"}(n==="web"||n==="both")&&(t[0]=localStorage,r=e.apply(this,t),i=!0)}catch(c){s=c}if(i)break}if(!i)throw s;return r};A.setItem=function(e,t,a,r,n){ko(nd,arguments,n)},A.getItem=function(e,t,a,r){return ko(sd,arguments,r)},A.removeItem=function(e,t,a,r){ko(id,arguments,r)},A.clearItems=function(e,t,a){ko(od,arguments,a)},A.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},A.format=function(e){for(var t=/%./g,a,r,n=0,i=[],s=0;a=t.exec(e);){r=e.substring(s,t.lastIndex-2),r.length>0&&i.push(r),s=t.lastIndex;var o=a[0][1];switch(o){case"s":case"o":n<arguments.length?i.push(arguments[n+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(e.substring(s)),i.join("")},A.formatNumber=function(e,t,a,r){var n=e,i=isNaN(t=Math.abs(t))?2:t,s=a===void 0?",":a,o=r===void 0?".":r,c=n<0?"-":"",l=parseInt(n=Math.abs(+n||0).toFixed(i),10)+"",u=l.length>3?l.length%3:0;return c+(u?l.substr(0,u)+o:"")+l.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?s+Math.abs(n-l).toFixed(i).slice(2):"")},A.formatSize=function(e){return e>=1073741824?e=A.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=A.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=A.formatNumber(e/1024,0)+" KiB":e=A.formatNumber(e,0)+" bytes",e},A.bytesFromIP=function(e){return e.indexOf(".")!==-1?A.bytesFromIPv4(e):e.indexOf(":")!==-1?A.bytesFromIPv6(e):null},A.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=A.createBuffer(),a=0;a<e.length;++a){var r=parseInt(e[a],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()},A.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(s){return s.length===0&&++t,!0});for(var a=(8-e.length+t)*2,r=A.createBuffer(),n=0;n<8;++n){if(!e[n]||e[n].length===0){r.fillWithByte(0,a),a=0;continue}var i=A.hexToBytes(e[n]);i.length<2&&r.putByte(0),r.putBytes(i)}return r.getBytes()},A.bytesToIP=function(e){return e.length===4?A.bytesToIPv4(e):e.length===16?A.bytesToIPv6(e):null},A.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a));return t.join(".")},A.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],a=[],r=0,n=0;n<e.length;n+=2){for(var i=A.bytesToHex(e[n]+e[n+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var s=a[a.length-1],o=t.length;!s||o!==s.end+1?a.push({start:o,end:o}):(s.end=o,s.end-s.start>a[r].end-a[r].start&&(r=a.length-1))}t.push(i)}if(a.length>0){var c=a[r];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),c.start===0&&t.unshift(""),c.end===7&&t.push(""))}return t.join(":")},A.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in A&&!e.update)return t(null,A.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return A.cores=navigator.hardwareConcurrency,t(null,A.cores);if(typeof Worker>"u")return A.cores=1,t(null,A.cores);if(typeof Blob>"u")return A.cores=2,t(null,A.cores);var a=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){var o=Date.now(),c=o+4;self.postMessage({st:o,et:c})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(s,o,c){if(o===0){var l=Math.floor(s.reduce(function(u,f){return u+f},0)/s.length);return A.cores=Math.max(1,l),URL.revokeObjectURL(a),t(null,A.cores)}n(c,function(u,f){s.push(i(c,f)),r(s,o-1,c)})}function n(s,o){for(var c=[],l=[],u=0;u<s;++u){var f=new Worker(a);f.addEventListener("message",function(y){if(l.push(y.data),l.length===s){for(var E=0;E<s;++E)c[E].terminate();o(null,l)}}),c.push(f)}for(var u=0;u<s;++u)c[u].postMessage(u)}function i(s,o){for(var c=[],l=0;l<s;++l)for(var u=o[l],f=c[l]=[],y=0;y<s;++y)if(l!==y){var E=o[y];(u.st>E.st&&u.st<E.et||E.st>u.st&&E.st<u.et)&&f.push(y)}return c.reduce(function(v,x){return Math.max(v,x.length)},0)}};var Le=J;Le.cipher=Le.cipher||{},Le.cipher.algorithms=Le.cipher.algorithms||{},Le.cipher.createCipher=function(e,t){var a=e;if(typeof a=="string"&&(a=Le.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new Le.cipher.BlockCipher({algorithm:a,key:t,decrypt:!1})},Le.cipher.createDecipher=function(e,t){var a=e;if(typeof a=="string"&&(a=Le.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new Le.cipher.BlockCipher({algorithm:a,key:t,decrypt:!0})},Le.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),Le.cipher.algorithms[e]=t},Le.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in Le.cipher.algorithms?Le.cipher.algorithms[e]:null};var pc=Le.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};pc.prototype.start=function(e){e=e||{};var t={};for(var a in e)t[a]=e[a];t.decrypt=this._decrypt,this._finish=!1,this._input=Le.util.createBuffer(),this.output=e.output||Le.util.createBuffer(),this.mode.start(t)},pc.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},pc.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(a){return e(this.blockSize,a,!1)},this.mode.unpad=function(a){return e(this.blockSize,a,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))};var De=J;De.cipher=De.cipher||{};var ee=De.cipher.modes=De.cipher.modes||{};ee.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},ee.ecb.prototype.start=function(e){},ee.ecb.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},ee.ecb.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},ee.ecb.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},ee.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},ee.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},ee.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=No(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},ee.cbc.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock},ee.cbc.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)},ee.cbc.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},ee.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},ee.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=De.util.createBuffer(),this._partialBytes=0},ee.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=No(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},ee.cfb.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32()^this._outBlock[n],t.putInt32(this._inBlock[n]);return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},ee.cfb.prototype.decrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32(),t.putInt32(this._inBlock[n]^this._outBlock[n]);return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},ee.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=De.util.createBuffer(),this._partialBytes=0},ee.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=No(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},ee.ofb.prototype.encrypt=function(e,t,a){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},ee.ofb.prototype.decrypt=ee.ofb.prototype.encrypt,ee.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=De.util.createBuffer(),this._partialBytes=0},ee.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=No(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},ee.ctr.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]);else{var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}Ro(this._inBlock)},ee.ctr.prototype.decrypt=ee.ctr.prototype.encrypt,ee.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=De.util.createBuffer(),this._partialBytes=0,this._R=3774873600},ee.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=De.util.createBuffer(e.iv);this._cipherLength=0;var a;if("additionalData"in e?a=De.util.createBuffer(e.additionalData):a=De.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=De.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=t.length();if(r===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(gc(r*8)))}this._inBlock=this._j0.slice(0),Ro(this._inBlock),this._partialBytes=0,a=De.util.createBuffer(a),this._aDataLength=gc(a.length()*8);var n=a.length()%this.blockSize;for(n&&a.fillWithByte(0,this.blockSize-n),this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])},ee.gcm.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^=e.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i<=0||a){if(a){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var n=0;n<this._ints;++n)this._outBlock[n]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Ro(this._inBlock)},ee.gcm.prototype.decrypt=function(e,t,a){var r=e.length();if(r<this.blockSize&&!(a&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Ro(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^this._hashBlock[n]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize},ee.gcm.prototype.afterFinish=function(e,t){var a=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=De.util.createBuffer();var r=this._aDataLength.concat(gc(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var n=[];this.cipher.encrypt(this._j0,n);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^n[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(a=!1),a},ee.gcm.prototype.multiply=function(e,t){for(var a=[0,0,0,0],r=t.slice(0),n=0;n<128;++n){var i=e[n/32|0]&1<<31-n%32;i&&(a[0]^=r[0],a[1]^=r[1],a[2]^=r[2],a[3]^=r[3]),this.pow(r,r)}return a},ee.gcm.prototype.pow=function(e,t){for(var a=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,a&&(t[0]^=this._R)},ee.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],a=0;a<32;++a){var r=a/8|0,n=e[r]>>>(7-a%8)*4&15,i=this._m[a][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},ee.gcm.prototype.ghash=function(e,t,a){return t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3],this.tableMultiply(t)},ee.gcm.prototype.generateHashTable=function(e,t){for(var a=8/t,r=4*a,n=16*a,i=new Array(n),s=0;s<n;++s){var o=[0,0,0,0],c=s/r|0,l=(r-1-s%r)*t;o[c]=1<<t-1<<l,i[s]=this.generateSubHashTable(this.multiply(o,e),t)}return i},ee.gcm.prototype.generateSubHashTable=function(e,t){var a=1<<t,r=a>>>1,n=new Array(a);n[r]=e.slice(0);for(var i=r>>>1;i>0;)this.pow(n[2*i],n[i]=[]),i>>=1;for(i=2;i<r;){for(var s=1;s<i;++s){var o=n[i],c=n[s];n[i+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}i*=2}for(n[0]=[0,0,0,0],i=r+1;i<a;++i){var l=n[i^r];n[i]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return n};function No(e,t){if(typeof e=="string"&&(e=De.util.createBuffer(e)),De.util.isArray(e)&&e.length>4){var a=e;e=De.util.createBuffer();for(var r=0;r<a.length;++r)e.putByte(a[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!De.util.isArray(e)){for(var n=[],i=t/4,r=0;r<i;++r)n.push(e.getInt32());e=n}return e}function Ro(e){e[e.length-1]=e[e.length-1]+1&4294967295}function gc(e){return[e/4294967296|0,e&4294967295]}var Ce=J;Ce.aes=Ce.aes||{},Ce.aes.startEncrypting=function(e,t,a,r){var n=_o({key:e,output:a,decrypt:!1,mode:r});return n.start(t),n},Ce.aes.createEncryptionCipher=function(e,t){return _o({key:e,output:null,decrypt:!1,mode:t})},Ce.aes.startDecrypting=function(e,t,a,r){var n=_o({key:e,output:a,decrypt:!0,mode:r});return n.start(t),n},Ce.aes.createDecryptionCipher=function(e,t){return _o({key:e,output:null,decrypt:!0,mode:t})},Ce.aes.Algorithm=function(e,t){yc||bl();var a=this;a.name=e,a.mode=new t({blockSize:16,cipher:{encrypt:function(r,n){return mc(a._w,r,n,!1)},decrypt:function(r,n){return mc(a._w,r,n,!0)}}}),a._init=!1},Ce.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,a;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Ce.util.createBuffer(t);else if(Ce.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){a=t,t=Ce.util.createBuffer();for(var r=0;r<a.length;++r)t.putByte(a[r])}if(!Ce.util.isArray(t)){a=t,t=[];var n=a.length();if(n===16||n===24||n===32){n=n>>>2;for(var r=0;r<n;++r)t.push(a.getInt32())}}if(!Ce.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var i=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(i)!==-1;this._w=Bl(t,e.decrypt&&!s),this._init=!0}},Ce.aes._expandKey=function(e,t){return yc||bl(),Bl(e,t)},Ce.aes._updateBlock=mc,ur("AES-ECB",Ce.cipher.modes.ecb),ur("AES-CBC",Ce.cipher.modes.cbc),ur("AES-CFB",Ce.cipher.modes.cfb),ur("AES-OFB",Ce.cipher.modes.ofb),ur("AES-CTR",Ce.cipher.modes.ctr),ur("AES-GCM",Ce.cipher.modes.gcm);function ur(e,t){var a=function(){return new Ce.aes.Algorithm(e,t)};Ce.cipher.registerAlgorithm(e,a)}var yc=!1,fr=4,st,vc,Il,Jt,At;function bl(){yc=!0,Il=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;st=new Array(256),vc=new Array(256),Jt=new Array(4),At=new Array(4);for(var t=0;t<4;++t)Jt[t]=new Array(256),At[t]=new Array(256);for(var a=0,r=0,n,i,s,o,c,l,u,t=0;t<256;++t){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,st[a]=o,vc[o]=a,c=e[o],n=e[a],i=e[n],s=e[i],l=c<<24^o<<16^o<<8^(o^c),u=(n^i^s)<<24^(a^s)<<16^(a^i^s)<<8^(a^n^s);for(var f=0;f<4;++f)Jt[f][a]=l,At[f][o]=u,l=l<<24|l>>>8,u=u<<24|u>>>8;a===0?a=r=1:(a=n^e[e[e[n^s]]],r^=e[e[r]])}}function Bl(e,t){for(var a=e.slice(0),r,n=1,i=a.length,s=i+6+1,o=fr*s,c=i;c<o;++c)r=a[c-1],c%i===0?(r=st[r>>>16&255]<<24^st[r>>>8&255]<<16^st[r&255]<<8^st[r>>>24]^Il[n]<<24,n++):i>6&&c%i===4&&(r=st[r>>>24]<<24^st[r>>>16&255]<<16^st[r>>>8&255]<<8^st[r&255]),a[c]=a[c-i]^r;if(t){var l,u=At[0],f=At[1],y=At[2],E=At[3],v=a.slice(0);o=a.length;for(var c=0,x=o-fr;c<o;c+=fr,x-=fr)if(c===0||c===o-fr)v[c]=a[x],v[c+1]=a[x+3],v[c+2]=a[x+2],v[c+3]=a[x+1];else for(var T=0;T<fr;++T)l=a[x+T],v[c+(3&-T)]=u[st[l>>>24]]^f[st[l>>>16&255]]^y[st[l>>>8&255]]^E[st[l&255]];a=v}return a}function mc(e,t,a,r){var n=e.length/4-1,i,s,o,c,l;r?(i=At[0],s=At[1],o=At[2],c=At[3],l=vc):(i=Jt[0],s=Jt[1],o=Jt[2],c=Jt[3],l=st);var u,f,y,E,v,x,T;u=t[0]^e[0],f=t[r?3:1]^e[1],y=t[2]^e[2],E=t[r?1:3]^e[3];for(var I=3,B=1;B<n;++B)v=i[u>>>24]^s[f>>>16&255]^o[y>>>8&255]^c[E&255]^e[++I],x=i[f>>>24]^s[y>>>16&255]^o[E>>>8&255]^c[u&255]^e[++I],T=i[y>>>24]^s[E>>>16&255]^o[u>>>8&255]^c[f&255]^e[++I],E=i[E>>>24]^s[u>>>16&255]^o[f>>>8&255]^c[y&255]^e[++I],u=v,f=x,y=T;a[0]=l[u>>>24]<<24^l[f>>>16&255]<<16^l[y>>>8&255]<<8^l[E&255]^e[++I],a[r?3:1]=l[f>>>24]<<24^l[y>>>16&255]<<16^l[E>>>8&255]<<8^l[u&255]^e[++I],a[2]=l[y>>>24]<<24^l[E>>>16&255]<<16^l[u>>>8&255]<<8^l[f&255]^e[++I],a[r?1:3]=l[E>>>24]<<24^l[u>>>16&255]<<16^l[f>>>8&255]<<8^l[y&255]^e[++I]}function _o(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="AES-"+t,r;e.decrypt?r=Ce.cipher.createDecipher(a,e.key):r=Ce.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(i,s){var o=null;s instanceof Ce.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=i,n.call(r,s)},r}var vo=J;vo.pki=vo.pki||{};var Ec=vo.pki.oids=vo.oids=vo.oids||{};function R(e,t){Ec[e]=t,Ec[t]=e}function ge(e,t){Ec[e]=t}R("1.2.840.113549.1.1.1","rsaEncryption"),R("1.2.840.113549.1.1.4","md5WithRSAEncryption"),R("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),R("1.2.840.113549.1.1.7","RSAES-OAEP"),R("1.2.840.113549.1.1.8","mgf1"),R("1.2.840.113549.1.1.9","pSpecified"),R("1.2.840.113549.1.1.10","RSASSA-PSS"),R("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),R("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),R("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),R("1.3.101.112","EdDSA25519"),R("1.2.840.10040.4.3","dsa-with-sha1"),R("1.3.14.3.2.7","desCBC"),R("1.3.14.3.2.26","sha1"),R("1.3.14.3.2.29","sha1WithRSASignature"),R("2.16.840.1.101.3.4.2.1","sha256"),R("2.16.840.1.101.3.4.2.2","sha384"),R("2.16.840.1.101.3.4.2.3","sha512"),R("2.16.840.1.101.3.4.2.4","sha224"),R("2.16.840.1.101.3.4.2.5","sha512-224"),R("2.16.840.1.101.3.4.2.6","sha512-256"),R("1.2.840.113549.2.2","md2"),R("1.2.840.113549.2.5","md5"),R("1.2.840.113549.1.7.1","data"),R("1.2.840.113549.1.7.2","signedData"),R("1.2.840.113549.1.7.3","envelopedData"),R("1.2.840.113549.1.7.4","signedAndEnvelopedData"),R("1.2.840.113549.1.7.5","digestedData"),R("1.2.840.113549.1.7.6","encryptedData"),R("1.2.840.113549.1.9.1","emailAddress"),R("1.2.840.113549.1.9.2","unstructuredName"),R("1.2.840.113549.1.9.3","contentType"),R("1.2.840.113549.1.9.4","messageDigest"),R("1.2.840.113549.1.9.5","signingTime"),R("1.2.840.113549.1.9.6","counterSignature"),R("1.2.840.113549.1.9.7","challengePassword"),R("1.2.840.113549.1.9.8","unstructuredAddress"),R("1.2.840.113549.1.9.14","extensionRequest"),R("1.2.840.113549.1.9.20","friendlyName"),R("1.2.840.113549.1.9.21","localKeyId"),R("1.2.840.113549.1.9.22.1","x509Certificate"),R("1.2.840.113549.1.12.10.1.1","keyBag"),R("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),R("1.2.840.113549.1.12.10.1.3","certBag"),R("1.2.840.113549.1.12.10.1.4","crlBag"),R("1.2.840.113549.1.12.10.1.5","secretBag"),R("1.2.840.113549.1.12.10.1.6","safeContentsBag"),R("1.2.840.113549.1.5.13","pkcs5PBES2"),R("1.2.840.113549.1.5.12","pkcs5PBKDF2"),R("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),R("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),R("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),R("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),R("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),R("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),R("1.2.840.113549.2.7","hmacWithSHA1"),R("1.2.840.113549.2.8","hmacWithSHA224"),R("1.2.840.113549.2.9","hmacWithSHA256"),R("1.2.840.113549.2.10","hmacWithSHA384"),R("1.2.840.113549.2.11","hmacWithSHA512"),R("1.2.840.113549.3.7","des-EDE3-CBC"),R("2.16.840.1.101.3.4.1.2","aes128-CBC"),R("2.16.840.1.101.3.4.1.22","aes192-CBC"),R("2.16.840.1.101.3.4.1.42","aes256-CBC"),R("2.5.4.3","commonName"),R("2.5.4.4","surname"),R("2.5.4.5","serialNumber"),R("2.5.4.6","countryName"),R("2.5.4.7","localityName"),R("2.5.4.8","stateOrProvinceName"),R("2.5.4.9","streetAddress"),R("2.5.4.10","organizationName"),R("2.5.4.11","organizationalUnitName"),R("2.5.4.12","title"),R("2.5.4.13","description"),R("2.5.4.15","businessCategory"),R("2.5.4.17","postalCode"),R("2.5.4.42","givenName"),R("2.5.4.65","pseudonym"),R("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),R("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),R("2.16.840.1.113730.1.1","nsCertType"),R("2.16.840.1.113730.1.13","nsComment"),ge("2.5.29.1","authorityKeyIdentifier"),ge("2.5.29.2","keyAttributes"),ge("2.5.29.3","certificatePolicies"),ge("2.5.29.4","keyUsageRestriction"),ge("2.5.29.5","policyMapping"),ge("2.5.29.6","subtreesConstraint"),ge("2.5.29.7","subjectAltName"),ge("2.5.29.8","issuerAltName"),ge("2.5.29.9","subjectDirectoryAttributes"),ge("2.5.29.10","basicConstraints"),ge("2.5.29.11","nameConstraints"),ge("2.5.29.12","policyConstraints"),ge("2.5.29.13","basicConstraints"),R("2.5.29.14","subjectKeyIdentifier"),R("2.5.29.15","keyUsage"),ge("2.5.29.16","privateKeyUsagePeriod"),R("2.5.29.17","subjectAltName"),R("2.5.29.18","issuerAltName"),R("2.5.29.19","basicConstraints"),ge("2.5.29.20","cRLNumber"),ge("2.5.29.21","cRLReason"),ge("2.5.29.22","expirationDate"),ge("2.5.29.23","instructionCode"),ge("2.5.29.24","invalidityDate"),ge("2.5.29.25","cRLDistributionPoints"),ge("2.5.29.26","issuingDistributionPoint"),ge("2.5.29.27","deltaCRLIndicator"),ge("2.5.29.28","issuingDistributionPoint"),ge("2.5.29.29","certificateIssuer"),ge("2.5.29.30","nameConstraints"),R("2.5.29.31","cRLDistributionPoints"),R("2.5.29.32","certificatePolicies"),ge("2.5.29.33","policyMappings"),ge("2.5.29.34","policyConstraints"),R("2.5.29.35","authorityKeyIdentifier"),ge("2.5.29.36","policyConstraints"),R("2.5.29.37","extKeyUsage"),ge("2.5.29.46","freshestCRL"),ge("2.5.29.54","inhibitAnyPolicy"),R("1.3.6.1.4.1.11129.2.4.2","timestampList"),R("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),R("1.3.6.1.5.5.7.3.1","serverAuth"),R("1.3.6.1.5.5.7.3.2","clientAuth"),R("1.3.6.1.5.5.7.3.3","codeSigning"),R("1.3.6.1.5.5.7.3.4","emailProtection"),R("1.3.6.1.5.5.7.3.8","timeStamping");var Te=J,F=Te.asn1=Te.asn1||{};F.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},F.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},F.maxDepth=256,F.create=function(e,t,a,r,n){if(Te.util.isArray(r)){for(var i=[],s=0;s<r.length;++s)r[s]!==void 0&&i.push(r[s]);r=i}var o={tagClass:e,type:t,constructed:a,composed:a||Te.util.isArray(r),value:r};return n&&"bitStringContents"in n&&(o.bitStringContents=n.bitStringContents,o.original=F.copy(o)),o},F.copy=function(e,t){var a;if(Te.util.isArray(e)){a=[];for(var r=0;r<e.length;++r)a.push(F.copy(e[r],t));return a}return typeof e=="string"?e:(a={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:F.copy(e.value,t)},t&&!t.excludeBitStringContents&&(a.bitStringContents=e.bitStringContents),a)},F.equals=function(e,t,a){if(Te.util.isArray(e)){if(!Te.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!F.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var n=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&F.equals(e.value,t.value);return a&&a.includeBitStringContents&&(n=n&&e.bitStringContents===t.bitStringContents),n},F.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var a,r=t&128;return r?a=e.getInt((t&127)<<3):a=t,a}};function mo(e,t,a){if(a>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=a,r}}var cd=function(e,t){var a=e.getByte();if(t--,a!==128){var r,n=a&128;if(!n)r=a;else{var i=a&127;mo(e,t,i),r=e.getInt(i<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};F.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=F.maxDepth),typeof e=="string"&&(e=Te.util.createBuffer(e));var a=e.length(),r=Lo(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var n=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw n.byteCount=a,n.remaining=e.length(),n}return r};function Lo(e,t,a,r){if(a>=r.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var n;mo(e,t,2);var i=e.getByte();t--;var s=i&192,o=i&31;n=e.length();var c=cd(e,t);if(t-=n-e.length(),c!==void 0&&c>t){if(r.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=c,l}c=t}var u,f,y=(i&32)===32;if(y)if(u=[],c===void 0)for(;;){if(mo(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}n=e.length(),u.push(Lo(e,t,a+1,r)),t-=n-e.length()}else for(;c>0;)n=e.length(),u.push(Lo(e,c,a+1,r)),t-=n-e.length(),c-=n-e.length();if(u===void 0&&s===F.Class.UNIVERSAL&&o===F.Type.BITSTRING&&(f=e.bytes(c)),u===void 0&&r.decodeBitStrings&&s===F.Class.UNIVERSAL&&o===F.Type.BITSTRING&&c>1){var E=e.read,v=t,x=0;if(o===F.Type.BITSTRING&&(mo(e,t,1),x=e.getByte(),t--),x===0)try{n=e.length();var T={strict:!0,decodeBitStrings:!0},I=Lo(e,t,a+1,T),B=n-e.length();t-=B,o==F.Type.BITSTRING&&B++;var U=I.tagClass;B===c&&(U===F.Class.UNIVERSAL||U===F.Class.CONTEXT_SPECIFIC)&&(u=[I])}catch{}u===void 0&&(e.read=E,t=v)}if(u===void 0){if(c===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=t}if(o===F.Type.BMPSTRING)for(u="";c>0;c-=2)mo(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(c),t-=c}var D=f===void 0?null:{bitStringContents:f};return F.create(s,o,y,u,D)}F.toDer=function(e){var t=Te.util.createBuffer(),a=e.tagClass|e.type,r=Te.util.createBuffer(),n=!1;if("bitStringContents"in e&&(n=!0,e.original&&(n=F.equals(e,e.original))),n)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?a|=32:r.putByte(0);for(var i=0;i<e.value.length;++i)e.value[i]!==void 0&&r.putBuffer(F.toDer(e.value[i]))}else if(e.type===F.Type.BMPSTRING)for(var i=0;i<e.value.length;++i)r.putInt16(e.value.charCodeAt(i));else e.type===F.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&(e.value.charCodeAt(1)&128)===0||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(a),r.length()<=127)t.putByte(r.length()&127);else{var s=r.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);t.putByte(o.length|128);for(var i=o.length-1;i>=0;--i)t.putByte(o.charCodeAt(i))}return t.putBuffer(r),t},F.oidToDer=function(e){var t=e.split("."),a=Te.util.createBuffer();a.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,n,i,s,o=2;o<t.length;++o){if(r=!0,n=[],i=parseInt(t[o],10),i>4294967295)throw new Error("OID value too large; max is 32-bits.");do s=i&127,i=i>>>7,r||(s|=128),n.push(s),r=!1;while(i>0);for(var c=n.length-1;c>=0;--c)a.putByte(n[c])}return a},F.derToOid=function(e){var t;typeof e=="string"&&(e=Te.util.createBuffer(e));var a=e.getByte();t=Math.floor(a/40)+"."+a%40;for(var r=0;e.length()>0;){if(r>70368744177663)throw new Error("OID value too large; max is 53-bits.");a=e.getByte(),r=r*128,a&128?r+=a&127:(t+="."+(r+a),r=0)}return t},F.utcTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,2),10);a=a>=50?1900+a:2e3+a;var r=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),l=10;c!=="+"&&c!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(a,r,n),t.setUTCHours(i,s,o,0),l&&(c=e.charAt(l),c==="+"||c==="-")){var u=parseInt(e.substr(l+1,2),10),f=parseInt(e.substr(l+4,2),10),y=u*60+f;y*=6e4,c==="+"?t.setTime(+t-y):t.setTime(+t+y)}return t},F.generalizedTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,l=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var f=e.length-5,y=e.charAt(f);if(y==="+"||y==="-"){var E=parseInt(e.substr(f+1,2),10),v=parseInt(e.substr(f+4,2),10);l=E*60+v,l*=6e4,y==="+"&&(l*=-1),u=!0}return e.charAt(14)==="."&&(c=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(a,r,n),t.setUTCHours(i,s,o,c),t.setTime(+t+l)):(t.setFullYear(a,r,n),t.setHours(i,s,o,c)),t},F.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push((""+e.getUTCFullYear()).substr(2)),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t},F.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push(""+e.getUTCFullYear()),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t},F.integerToDer=function(e){var t=Te.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var a=new Error("Integer too large; max is 32-bits.");throw a.integer=e,a},F.derToInteger=function(e){typeof e=="string"&&(e=Te.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},F.validate=function(e,t,a,r){var n=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(n=!0,t.value&&Te.util.isArray(t.value))for(var i=0,s=0;n&&s<t.value.length;++s){var o=t.value[s];n=!!o.optional;var c=e.value[i];if(!c){o.optional||(n=!1,r&&r.push("["+t.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var l=typeof o.tagClass<"u"&&typeof o.type<"u";if(l&&(c.tagClass!==o.tagClass||c.type!==o.type))if(o.optional){n=!0;continue}else{n=!1,r&&r.push("["+t.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+c.tagClass+","+c.type+")");break}var u=F.validate(c,o,a,r);if(u)++i,n=!0;else if(o.optional)n=!0;else{n=!1;break}}if(n&&a&&(t.capture&&(a[t.capture]=e.value),t.captureAsn1&&(a[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(a[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)a[t.captureBitStringValue]="";else{var f=e.bitStringContents.charCodeAt(0);if(f!==0)throw new Error("captureBitStringValue only supported for zero unused bits");a[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return n};var wl=/[^\\u0000-\\u00ff]/;F.prettyPrint=function(e,t,a){var r="";t=t||0,a=a||2,t>0&&(r+=`
|
|
5
|
+
`);for(var n="",i=0;i<t*a;++i)n+=" ";switch(r+=n+"Tag: ",e.tagClass){case F.Class.UNIVERSAL:r+="Universal:";break;case F.Class.APPLICATION:r+="Application:";break;case F.Class.CONTEXT_SPECIFIC:r+="Context-Specific:";break;case F.Class.PRIVATE:r+="Private:";break}if(e.tagClass===F.Class.UNIVERSAL)switch(r+=e.type,e.type){case F.Type.NONE:r+=" (None)";break;case F.Type.BOOLEAN:r+=" (Boolean)";break;case F.Type.INTEGER:r+=" (Integer)";break;case F.Type.BITSTRING:r+=" (Bit string)";break;case F.Type.OCTETSTRING:r+=" (Octet string)";break;case F.Type.NULL:r+=" (Null)";break;case F.Type.OID:r+=" (Object Identifier)";break;case F.Type.ODESC:r+=" (Object Descriptor)";break;case F.Type.EXTERNAL:r+=" (External or Instance of)";break;case F.Type.REAL:r+=" (Real)";break;case F.Type.ENUMERATED:r+=" (Enumerated)";break;case F.Type.EMBEDDED:r+=" (Embedded PDV)";break;case F.Type.UTF8:r+=" (UTF8)";break;case F.Type.ROID:r+=" (Relative Object Identifier)";break;case F.Type.SEQUENCE:r+=" (Sequence)";break;case F.Type.SET:r+=" (Set)";break;case F.Type.PRINTABLESTRING:r+=" (Printable String)";break;case F.Type.IA5String:r+=" (IA5String (ASCII))";break;case F.Type.UTCTIME:r+=" (UTC time)";break;case F.Type.GENERALIZEDTIME:r+=" (Generalized time)";break;case F.Type.BMPSTRING:r+=" (BMP String)";break}else r+=e.type;if(r+=`
|
|
30
6
|
`,r+=n+"Constructed: "+e.constructed+`
|
|
31
|
-
`,e.composed){for(var s=0,o="",i=0;i<e.value.length;++i)e.value[i]!==void 0&&(s+=1,o+=
|
|
32
|
-
`,r;if(e.procType&&(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},a+=
|
|
33
|
-
`),a+=
|
|
7
|
+
`,e.composed){for(var s=0,o="",i=0;i<e.value.length;++i)e.value[i]!==void 0&&(s+=1,o+=F.prettyPrint(e.value[i],t+1,a),i+1<e.value.length&&(o+=","));r+=n+"Sub values: "+s+o}else{if(r+=n+"Value: ",e.type===F.Type.OID){var c=F.derToOid(e.value);r+=c,Te.pki&&Te.pki.oids&&c in Te.pki.oids&&(r+=" ("+Te.pki.oids[c]+") ")}if(e.type===F.Type.INTEGER)try{r+=F.derToInteger(e.value)}catch{r+="0x"+Te.util.bytesToHex(e.value)}else if(e.type===F.Type.BITSTRING){if(e.value.length>1?r+="0x"+Te.util.bytesToHex(e.value.slice(1)):r+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);l==1?r+=" (1 unused bit shown)":l>1&&(r+=" ("+l+" unused bits shown)")}}else if(e.type===F.Type.OCTETSTRING)wl.test(e.value)||(r+="("+e.value+") "),r+="0x"+Te.util.bytesToHex(e.value);else if(e.type===F.Type.UTF8)try{r+=Te.util.decodeUtf8(e.value)}catch(u){if(u.message==="URI malformed")r+="0x"+Te.util.bytesToHex(e.value)+" (malformed UTF8)";else throw u}else e.type===F.Type.PRINTABLESTRING||e.type===F.Type.IA5String?r+=e.value:wl.test(e.value)?r+="0x"+Te.util.bytesToHex(e.value):e.value.length===0?r+="[null]":r+=e.value}return r};var Do=J;Do.md=Do.md||{},Do.md.algorithms=Do.md.algorithms||{};var Dt=J,ld=Dt.hmac=Dt.hmac||{};ld.create=function(){var e=null,t=null,a=null,r=null,n={};return n.start=function(i,s){if(i!==null)if(typeof i=="string")if(i=i.toLowerCase(),i in Dt.md.algorithms)t=Dt.md.algorithms[i].create();else throw new Error('Unknown hash algorithm "'+i+'"');else t=i;if(s===null)s=e;else{if(typeof s=="string")s=Dt.util.createBuffer(s);else if(Dt.util.isArray(s)){var o=s;s=Dt.util.createBuffer();for(var c=0;c<o.length;++c)s.putByte(o[c])}var l=s.length();l>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),a=Dt.util.createBuffer(),r=Dt.util.createBuffer(),l=s.length();for(var c=0;c<l;++c){var o=s.at(c);a.putByte(54^o),r.putByte(92^o)}if(l<t.blockLength)for(var o=t.blockLength-l,c=0;c<o;++c)a.putByte(54),r.putByte(92);e=s,a=a.bytes(),r=r.bytes()}t.start(),t.update(a)},n.update=function(i){t.update(i)},n.getMac=function(){var i=t.digest().bytes();return t.start(),t.update(r),t.update(i),t.digest()},n.digest=n.getMac,n};var Bt=J,Ul=Bt.md5=Bt.md5||{};Bt.md.md5=Bt.md.algorithms.md5=Ul,Ul.create=function(){kl||ud();var e=null,t=Bt.util.createBuffer(),a=new Array(16),r={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=Bt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=Bt.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),Nl(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=Bt.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(Cc.substr(0,r.blockLength-s));for(var o,c=0,l=r.fullMessageLength.length-1;l>=0;--l)o=r.fullMessageLength[l]*8+c,c=o/4294967296>>>0,n.putInt32Le(o>>>0);var u={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};Nl(u,a,n);var f=Bt.util.createBuffer();return f.putInt32Le(u.h0),f.putInt32Le(u.h1),f.putInt32Le(u.h2),f.putInt32Le(u.h3),f},r};var Cc=null,Po=null,Eo=null,dr=null,kl=!1;function ud(){Cc="\x80",Cc+=Bt.util.fillString("\0",64),Po=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],Eo=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],dr=new Array(64);for(var e=0;e<64;++e)dr[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);kl=!0}function Nl(e,t,a){for(var r,n,i,s,o,c,l,u,f=a.length();f>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,u=0;u<16;++u)t[u]=a.getInt32Le(),c=o^i&(s^o),r=n+c+dr[u]+t[u],l=Eo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;for(;u<32;++u)c=s^o&(i^s),r=n+c+dr[u]+t[Po[u]],l=Eo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;for(;u<48;++u)c=i^s^o,r=n+c+dr[u]+t[Po[u]],l=Eo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;for(;u<64;++u)c=s^(i|~o),r=n+c+dr[u]+t[Po[u]],l=Eo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,f-=64}}var Oo=J,Rl=Oo.pem=Oo.pem||{};Rl.encode=function(e,t){t=t||{};var a="-----BEGIN "+e.type+`-----\r
|
|
8
|
+
`,r;if(e.procType&&(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},a+=Vo(r)),e.contentDomain&&(r={name:"Content-Domain",values:[e.contentDomain]},a+=Vo(r)),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),a+=Vo(r)),e.headers)for(var n=0;n<e.headers.length;++n)a+=Vo(e.headers[n]);return e.procType&&(a+=`\r
|
|
9
|
+
`),a+=Oo.util.encode64(e.body,t.maxline||64)+`\r
|
|
34
10
|
`,a+="-----END "+e.type+`-----\r
|
|
35
|
-
`,a},
|
|
11
|
+
`,a},Rl.decode=function(e){for(var t=[],a=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,r=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,n=/\r?\n/,i;i=a.exec(e),!!i;){var s=i[1];s==="NEW CERTIFICATE REQUEST"&&(s="CERTIFICATE REQUEST");var o={type:s,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Oo.util.decode64(i[3])};if(t.push(o),!!i[2]){for(var c=i[2].split(n),l=0;i&&l<c.length;){for(var u=c[l].replace(/\s+$/,""),f=l+1;f<c.length;++f){var y=c[f];if(!/\s/.test(y[0]))break;u+=y,l=f}if(i=u.match(r),i){for(var E={name:i[1],values:[]},v=i[2].split(","),x=0;x<v.length;++x)E.values.push(fd(v[x]));if(o.procType)if(!o.contentDomain&&E.name==="Content-Domain")o.contentDomain=v[0]||"";else if(!o.dekInfo&&E.name==="DEK-Info"){if(E.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:v[0],parameters:v[1]||null}}else o.headers.push(E);else{if(E.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(E.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:v[0],type:v[1]}}}++l}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Vo(e){for(var t=e.name+": ",a=[],r=function(c,l){return" "+l},n=0;n<e.values.length;++n)a.push(e.values[n].replace(/^(\S+\r\n)/,r));t+=a.join(",")+`\r
|
|
36
12
|
`;for(var i=0,s=-1,n=0;n<t.length;++n,++i)if(i>65&&s!==-1){var o=t[s];o===","?(++s,t=t.substr(0,s)+`\r
|
|
37
13
|
`+t.substr(s)):t=t.substr(0,s)+`\r
|
|
38
|
-
`+o+t.substr(s+1),i=n-s-1,s=-1,++n}else(t[n]===" "||t[n]===" "||t[n]===",")&&(s=n);return t}function db(e){return e.replace(/^\s+/,"")}var He=le;He.des=He.des||{},He.des.startEncrypting=function(e,t,a,r){var n=il({key:e,output:a,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n},He.des.createEncryptionCipher=function(e,t){return il({key:e,output:null,decrypt:!1,mode:t})},He.des.startDecrypting=function(e,t,a,r){var n=il({key:e,output:a,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n},He.des.createDecryptionCipher=function(e,t){return il({key:e,output:null,decrypt:!0,mode:t})},He.des.Algorithm=function(e,t){var a=this;a.name=e,a.mode=new t({blockSize:8,cipher:{encrypt:function(r,n){return Jf(a._keys,r,n,!1)},decrypt:function(r,n){return Jf(a._keys,r,n,!0)}}}),a._init=!1},He.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=He.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=Eb(t),this._init=!0}},$t("DES-ECB",He.cipher.modes.ecb),$t("DES-CBC",He.cipher.modes.cbc),$t("DES-CFB",He.cipher.modes.cfb),$t("DES-OFB",He.cipher.modes.ofb),$t("DES-CTR",He.cipher.modes.ctr),$t("3DES-ECB",He.cipher.modes.ecb),$t("3DES-CBC",He.cipher.modes.cbc),$t("3DES-CFB",He.cipher.modes.cfb),$t("3DES-OFB",He.cipher.modes.ofb),$t("3DES-CTR",He.cipher.modes.ctr);function $t(e,t){var a=function(){return new He.des.Algorithm(e,t)};He.cipher.registerAlgorithm(e,a)}var fb=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],hb=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],mb=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],vb=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],gb=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],xb=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],yb=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],bb=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function Eb(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],i=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],h=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,b=[],E=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],I=0,R,k=0;k<y;k++){var U=e.getInt32(),L=e.getInt32();R=(U>>>4^L)&252645135,L^=R,U^=R<<4,R=(L>>>-16^U)&65535,U^=R,L^=R<<-16,R=(U>>>2^L)&858993459,L^=R,U^=R<<2,R=(L>>>-16^U)&65535,U^=R,L^=R<<-16,R=(U>>>1^L)&1431655765,L^=R,U^=R<<1,R=(L>>>8^U)&16711935,U^=R,L^=R<<8,R=(U>>>1^L)&1431655765,L^=R,U^=R<<1,R=U<<8|L>>>20&240,U=L<<24|L<<8&16711680|L>>>8&65280|L>>>24&240,L=R;for(var q=0;q<E.length;++q){E[q]?(U=U<<2|U>>>26,L=L<<2|L>>>26):(U=U<<1|U>>>27,L=L<<1|L>>>27),U&=-15,L&=-15;var H=t[U>>>28]|a[U>>>24&15]|r[U>>>20&15]|n[U>>>16&15]|i[U>>>12&15]|s[U>>>8&15]|o[U>>>4&15],Y=c[L>>>28]|l[L>>>24&15]|u[L>>>20&15]|p[L>>>16&15]|d[L>>>12&15]|g[L>>>8&15]|h[L>>>4&15];R=(Y>>>16^H)&65535,b[I++]=H^R,b[I++]=Y^R<<16}}return b}function Jf(e,t,a,r){var n=e.length===32?3:9,i;n===3?i=r?[30,-2,-2]:[0,32,2]:i=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s,o=t[0],c=t[1];s=(o>>>4^c)&252645135,c^=s,o^=s<<4,s=(o>>>16^c)&65535,c^=s,o^=s<<16,s=(c>>>2^o)&858993459,o^=s,c^=s<<2,s=(c>>>8^o)&16711935,o^=s,c^=s<<8,s=(o>>>1^c)&1431655765,c^=s,o^=s<<1,o=o<<1|o>>>31,c=c<<1|c>>>31;for(var l=0;l<n;l+=3){for(var u=i[l+1],p=i[l+2],d=i[l];d!=u;d+=p){var g=c^e[d],h=(c>>>4|c<<28)^e[d+1];s=o,o=c,c=s^(hb[g>>>24&63]|vb[g>>>16&63]|xb[g>>>8&63]|bb[g&63]|fb[h>>>24&63]|mb[h>>>16&63]|gb[h>>>8&63]|yb[h&63])}s=o,o=c,c=s}o=o>>>1|o<<31,c=c>>>1|c<<31,s=(o>>>1^c)&1431655765,c^=s,o^=s<<1,s=(c>>>8^o)&16711935,o^=s,c^=s<<8,s=(c>>>2^o)&858993459,o^=s,c^=s<<2,s=(o>>>16^c)&65535,c^=s,o^=s<<16,s=(o>>>4^c)&252645135,c^=s,o^=s<<4,a[0]=o,a[1]=c}function il(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="DES-"+t,r;e.decrypt?r=He.cipher.createDecipher(a,e.key):r=He.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(i,s){var o=null;s instanceof He.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=i,n.call(r,s)},r}var Ct=le,Cb=Ct.pkcs5=Ct.pkcs5||{},er;Ct.util.isNodejs&&!Ct.options.usePureJavaScript&&(er=Or),Ct.pbkdf2=Cb.pbkdf2=function(e,t,a,r,n,i){if(typeof n=="function"&&(i=n,n=null),Ct.util.isNodejs&&!Ct.options.usePureJavaScript&&er.pbkdf2&&(n===null||typeof n!="object")&&(er.pbkdf2Sync.length>4||!n||n==="sha1"))return typeof n!="string"&&(n="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),i?er.pbkdf2Sync.length===4?er.pbkdf2(e,t,a,r,function(R,k){if(R)return i(R);i(null,k.toString("binary"))}):er.pbkdf2(e,t,a,r,n,function(R,k){if(R)return i(R);i(null,k.toString("binary"))}):er.pbkdf2Sync.length===4?er.pbkdf2Sync(e,t,a,r).toString("binary"):er.pbkdf2Sync(e,t,a,r,n).toString("binary");if((typeof n>"u"||n===null)&&(n="sha1"),typeof n=="string"){if(!(n in Ct.md.algorithms))throw new Error("Unknown hash algorithm: "+n);n=Ct.md[n].create()}var s=n.digestLength;if(r>4294967295*s){var o=new Error("Derived key is too long.");if(i)return i(o);throw o}var c=Math.ceil(r/s),l=r-(c-1)*s,u=Ct.hmac.create();u.start(n,e);var p="",d,g,h;if(!i){for(var y=1;y<=c;++y){u.start(null,null),u.update(t),u.update(Ct.util.int32ToBytes(y)),d=h=u.digest().getBytes();for(var b=2;b<=a;++b)u.start(null,null),u.update(h),g=u.digest().getBytes(),d=Ct.util.xorBytes(d,g,s),h=g;p+=y<c?d:d.substr(0,l)}return p}var y=1,b;function E(){if(y>c)return i(null,p);u.start(null,null),u.update(t),u.update(Ct.util.int32ToBytes(y)),d=h=u.digest().getBytes(),b=2,I()}function I(){if(b<=a)return u.start(null,null),u.update(h),g=u.digest().getBytes(),d=Ct.util.xorBytes(d,g,s),h=g,++b,Ct.util.setImmediate(I);p+=y<c?d:d.substr(0,l),++y,E()}E()};var Gt=le,Zf=Gt.sha256=Gt.sha256||{};Gt.md.sha256=Gt.md.algorithms.sha256=Zf,Zf.create=function(){e0||Tb();var e=null,t=Gt.util.createBuffer(),a=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=Gt.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=Gt.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),r0(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=Gt.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(zu.substr(0,r.blockLength-s));for(var o,c,l=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};r0(p,a,n);var d=Gt.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d.putInt32(p.h5),d.putInt32(p.h6),d.putInt32(p.h7),d},r};var zu=null,e0=!1,t0=null;function Tb(){zu="\x80",zu+=Gt.util.fillString("\0",64),t0=[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],e0=!0}function r0(e,t,a){for(var r,n,i,s,o,c,l,u,p,d,g,h,y,b,E,I=a.length();I>=64;){for(l=0;l<16;++l)t[l]=a.getInt32();for(;l<64;++l)r=t[l-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,n=t[l-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[l]=r+t[l-7]+n+t[l-16]|0;for(u=e.h0,p=e.h1,d=e.h2,g=e.h3,h=e.h4,y=e.h5,b=e.h6,E=e.h7,l=0;l<64;++l)s=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),o=b^h&(y^b),i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&p|d&(u^p),r=E+s+o+t0[l]+t[l],n=i+c,E=b,b=y,y=h,h=g+r>>>0,g=d,d=p,p=u,u=r+n>>>0;e.h0=e.h0+u|0,e.h1=e.h1+p|0,e.h2=e.h2+d|0,e.h3=e.h3+g|0,e.h4=e.h4+h|0,e.h5=e.h5+y|0,e.h6=e.h6+b|0,e.h7=e.h7+E|0,I-=64}}var Wt=le,ol=null;Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(ol=Or);var Sb=Wt.prng=Wt.prng||{};Sb.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=e.md,r=new Array(32),n=0;n<32;++n)r[n]=a.create();t.pools=r,t.pool=0,t.generate=function(l,u){if(!u)return t.generateSync(l);var p=t.plugin.cipher,d=t.plugin.increment,g=t.plugin.formatKey,h=t.plugin.formatSeed,y=Wt.util.createBuffer();t.key=null,b();function b(E){if(E)return u(E);if(y.length()>=l)return u(null,y.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return Wt.util.nextTick(function(){i(b)});var I=p(t.key,t.seed);t.generated+=I.length,y.putBytes(I),t.key=g(p(t.key,d(t.seed))),t.seed=h(p(t.key,t.seed)),Wt.util.setImmediate(b)}},t.generateSync=function(l){var u=t.plugin.cipher,p=t.plugin.increment,d=t.plugin.formatKey,g=t.plugin.formatSeed;t.key=null;for(var h=Wt.util.createBuffer();h.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&s();var y=u(t.key,t.seed);t.generated+=y.length,h.putBytes(y),t.key=d(u(t.key,p(t.seed))),t.seed=g(u(t.key,t.seed))}return h.getBytes(l)};function i(l){if(t.pools[0].messageLength>=32)return o(),l();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(p,d){if(p)return l(p);t.collect(d),o(),l()})}function s(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var u=1,p=0;p<32;++p)t.reseeds%u===0&&(l.update(t.pools[p].digest().getBytes()),t.pools[p].start()),u=u<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var d=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(d),t.generated=0}function c(l){var u=null,p=Wt.util.globalScope,d=p.crypto||p.msCrypto;d&&d.getRandomValues&&(u=function(U){return d.getRandomValues(U)});var g=Wt.util.createBuffer();if(u)for(;g.length()<l;){var h=Math.max(1,Math.min(l-g.length(),65536)/4),y=new Uint32Array(Math.floor(h));try{u(y);for(var b=0;b<y.length;++b)g.putInt32(y[b])}catch(U){if(!(typeof QuotaExceededError<"u"&&U instanceof QuotaExceededError))throw U}}if(g.length()<l)for(var E,I,R,k=Math.floor(Math.random()*65536);g.length()<l;){I=16807*(k&65535),E=16807*(k>>16),I+=(E&32767)<<16,I+=E>>15,I=(I&2147483647)+(I>>31),k=I&4294967295;for(var b=0;b<3;++b)R=k>>>(b<<3),R^=Math.floor(Math.random()*256),g.putByte(R&255)}return g.getBytes(l)}return ol?(t.seedFile=function(l,u){ol.randomBytes(l,function(p,d){if(p)return u(p);u(null,d.toString())})},t.seedFileSync=function(l){return ol.randomBytes(l).toString()}):(t.seedFile=function(l,u){try{u(null,c(l))}catch(p){u(p)}},t.seedFileSync=c),t.collect=function(l){for(var u=l.length,p=0;p<u;++p)t.pools[t.pool].update(l.substr(p,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(l,u){for(var p="",d=0;d<u;d+=8)p+=String.fromCharCode(l>>d&255);t.collect(p)},t.registerWorker=function(l){if(l===self)t.seedFile=function(p,d){function g(h){var y=h.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",g),d(y.forge.prng.err,y.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:p}}})};else{var u=function(p){var d=p.data;d.forge&&d.forge.prng&&t.seedFile(d.forge.prng.needed,function(g,h){l.postMessage({forge:{prng:{err:g,bytes:h}}})})};l.addEventListener("message",u)}},t};var ot=le;(function(){if(ot.random&&ot.random.getBytes){ot.random;return}(function(e){var t={},a=new Array(4),r=ot.util.createBuffer();t.formatKey=function(p){var d=ot.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),ot.aes._expandKey(p,!1)},t.formatSeed=function(p){var d=ot.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),p},t.cipher=function(p,d){return ot.aes._updateBlock(p,d,a,!1),r.putInt32(a[0]),r.putInt32(a[1]),r.putInt32(a[2]),r.putInt32(a[3]),r.getBytes()},t.increment=function(p){return++p[3],p},t.md=ot.md.sha256;function n(){var p=ot.prng.create(t);return p.getBytes=function(d,g){return p.generate(d,g)},p.getBytesSync=function(d){return p.generate(d)},p}var i=n(),s=null,o=ot.util.globalScope,c=o.crypto||o.msCrypto;if(c&&c.getRandomValues&&(s=function(p){return c.getRandomValues(p)}),ot.options.usePureJavaScript||!ot.util.isNodejs&&!s){if(i.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var u in navigator)try{typeof navigator[u]=="string"&&(l+=navigator[u])}catch{}i.collect(l),l=null}e&&(e().mousemove(function(p){i.collectInt(p.clientX,16),i.collectInt(p.clientY,16)}),e().keypress(function(p){i.collectInt(p.charCode,8)}))}if(!ot.random)ot.random=i;else for(var u in i)ot.random[u]=i[u];ot.random.createInstance=n,ot.random})(typeof jQuery<"u"?jQuery:null)})();var Bt=le,Hu=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a0=[1,2,3,5],wb=function(e,t){return e<<t&65535|(e&65535)>>16-t},Ab=function(e,t){return(e&65535)>>t|e<<16-t&65535};Bt.rc2=Bt.rc2||{},Bt.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Bt.util.createBuffer(e)),t=t||128;var a=e,r=e.length(),n=t,i=Math.ceil(n/8),s=255>>(n&7),o;for(o=r;o<128;o++)a.putByte(Hu[a.at(o-1)+a.at(o-r)&255]);for(a.setAt(128-i,Hu[a.at(128-i)&s]),o=127-i;o>=0;o--)a.setAt(o,Hu[a.at(o+1)^a.at(o+i)]);return a};var n0=function(e,t,a){var r=!1,n=null,i=null,s=null,o,c,l,u,p=[];for(e=Bt.rc2.expandKey(e,t),l=0;l<64;l++)p.push(e.getInt16Le());a?(o=function(h){for(l=0;l<4;l++)h[l]+=p[u]+(h[(l+3)%4]&h[(l+2)%4])+(~h[(l+3)%4]&h[(l+1)%4]),h[l]=wb(h[l],a0[l]),u++},c=function(h){for(l=0;l<4;l++)h[l]+=p[h[(l+3)%4]&63]}):(o=function(h){for(l=3;l>=0;l--)h[l]=Ab(h[l],a0[l]),h[l]-=p[u]+(h[(l+3)%4]&h[(l+2)%4])+(~h[(l+3)%4]&h[(l+1)%4]),u--},c=function(h){for(l=3;l>=0;l--)h[l]-=p[h[(l+3)%4]&63]});var d=function(h){var y=[];for(l=0;l<4;l++){var b=n.getInt16Le();s!==null&&(a?b^=s.getInt16Le():s.putInt16Le(b)),y.push(b&65535)}u=a?0:63;for(var E=0;E<h.length;E++)for(var I=0;I<h[E][0];I++)h[E][1](y);for(l=0;l<4;l++)s!==null&&(a?s.putInt16Le(y[l]):y[l]^=s.getInt16Le()),i.putInt16Le(y[l])},g=null;return g={start:function(h,y){h&&typeof h=="string"&&(h=Bt.util.createBuffer(h)),r=!1,n=Bt.util.createBuffer(),i=y||new Bt.util.createBuffer,s=h,g.output=i},update:function(h){for(r||n.putBuffer(h);n.length()>=8;)d([[5,o],[1,c],[6,o],[1,c],[5,o]])},finish:function(h){var y=!0;if(a)if(h)y=h(8,n,!a);else{var b=n.length()===8?8:8-n.length();n.fillWithByte(b,b)}if(y&&(r=!0,g.update()),!a&&(y=n.length()===0,y))if(h)y=h(8,i,!a);else{var E=i.length(),I=i.at(E-1);I>E?y=!1:i.truncate(I)}return y}},g};Bt.rc2.startEncrypting=function(e,t,a){var r=Bt.rc2.createEncryptionCipher(e,128);return r.start(t,a),r},Bt.rc2.createEncryptionCipher=function(e,t){return n0(e,t,!0)},Bt.rc2.startDecrypting=function(e,t,a){var r=Bt.rc2.createDecryptionCipher(e,128);return r.start(t,a),r},Bt.rc2.createDecryptionCipher=function(e,t){return n0(e,t,!1)};var $u=le;$u.jsbn=$u.jsbn||{};var tr;function N(e,t,a){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,a):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}$u.jsbn.BigInteger=N;function Be(){return new N(null)}function Ib(e,t,a,r,n,i){for(;--i>=0;){var s=t*this.data[e++]+a.data[r]+n;n=Math.floor(s/67108864),a.data[r++]=s&67108863}return n}function Bb(e,t,a,r,n,i){for(var s=t&32767,o=t>>15;--i>=0;){var c=this.data[e]&32767,l=this.data[e++]>>15,u=o*c+l*s;c=s*c+((u&32767)<<15)+a.data[r]+(n&1073741823),n=(c>>>30)+(u>>>15)+o*l+(n>>>30),a.data[r++]=c&1073741823}return n}function s0(e,t,a,r,n,i){for(var s=t&16383,o=t>>14;--i>=0;){var c=this.data[e]&16383,l=this.data[e++]>>14,u=o*c+l*s;c=s*c+((u&16383)<<14)+a.data[r]+n,n=(c>>28)+(u>>14)+o*l,a.data[r++]=c&268435455}return n}typeof navigator>"u"?(N.prototype.am=s0,tr=28):navigator.appName=="Microsoft Internet Explorer"?(N.prototype.am=Bb,tr=30):navigator.appName!="Netscape"?(N.prototype.am=Ib,tr=26):(N.prototype.am=s0,tr=28),N.prototype.DB=tr,N.prototype.DM=(1<<tr)-1,N.prototype.DV=1<<tr;var Gu=52;N.prototype.FV=Math.pow(2,Gu),N.prototype.F1=Gu-tr,N.prototype.F2=2*tr-Gu;var Rb="0123456789abcdefghijklmnopqrstuvwxyz",cl=new Array,Qr,Pt;for(Qr=48,Pt=0;Pt<=9;++Pt)cl[Qr++]=Pt;for(Qr=97,Pt=10;Pt<36;++Pt)cl[Qr++]=Pt;for(Qr=65,Pt=10;Pt<36;++Pt)cl[Qr++]=Pt;function i0(e){return Rb.charAt(e)}function o0(e,t){var a=cl[e.charCodeAt(t)];return a??-1}function kb(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function _b(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function lr(e){var t=Be();return t.fromInt(e),t}function Ub(e,t){var a;if(t==16)a=4;else if(t==8)a=3;else if(t==256)a=8;else if(t==2)a=1;else if(t==32)a=5;else if(t==4)a=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,n=!1,i=0;--r>=0;){var s=a==8?e[r]&255:o0(e,r);if(s<0){e.charAt(r)=="-"&&(n=!0);continue}n=!1,i==0?this.data[this.t++]=s:i+a>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-i)-1)<<i,this.data[this.t++]=s>>this.DB-i):this.data[this.t-1]|=s<<i,i+=a,i>=this.DB&&(i-=this.DB)}a==8&&(e[0]&128)!=0&&(this.s=-1,i>0&&(this.data[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),n&&N.ZERO.subTo(this,this)}function Nb(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function Lb(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var a=(1<<t)-1,r,n=!1,i="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(n=!0,i=i0(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&a,o<=0&&(o+=this.DB,--s)),r>0&&(n=!0),n&&(i+=i0(r));return n?i:"0"}function Pb(){var e=Be();return N.ZERO.subTo(this,e),e}function Ob(){return this.s<0?this.negate():this}function Db(e){var t=this.s-e.s;if(t!=0)return t;var a=this.t;if(t=a-e.t,t!=0)return this.s<0?-t:t;for(;--a>=0;)if((t=this.data[a]-e.data[a])!=0)return t;return 0}function ll(e){var t=1,a;return(a=e>>>16)!=0&&(e=a,t+=16),(a=e>>8)!=0&&(e=a,t+=8),(a=e>>4)!=0&&(e=a,t+=4),(a=e>>2)!=0&&(e=a,t+=2),(a=e>>1)!=0&&(e=a,t+=1),t}function Fb(){return this.t<=0?0:this.DB*(this.t-1)+ll(this.data[this.t-1]^this.s&this.DM)}function qb(e,t){var a;for(a=this.t-1;a>=0;--a)t.data[a+e]=this.data[a];for(a=e-1;a>=0;--a)t.data[a]=0;t.t=this.t+e,t.s=this.s}function Vb(e,t){for(var a=e;a<this.t;++a)t.data[a-e]=this.data[a];t.t=Math.max(this.t-e,0),t.s=this.s}function Mb(e,t){var a=e%this.DB,r=this.DB-a,n=(1<<r)-1,i=Math.floor(e/this.DB),s=this.s<<a&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+i+1]=this.data[o]>>r|s,s=(this.data[o]&n)<<a;for(o=i-1;o>=0;--o)t.data[o]=0;t.data[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()}function jb(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t){t.t=0;return}var r=e%this.DB,n=this.DB-r,i=(1<<r)-1;t.data[0]=this.data[a]>>r;for(var s=a+1;s<this.t;++s)t.data[s-a-1]|=(this.data[s]&i)<<n,t.data[s-a]=this.data[s]>>r;r>0&&(t.data[this.t-a-1]|=(this.s&i)<<n),t.t=this.t-a,t.clamp()}function Kb(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]-e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r-=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[a++]=this.DV+r:r>0&&(t.data[a++]=r),t.t=a,t.clamp()}function zb(e,t){var a=this.abs(),r=e.abs(),n=a.t;for(t.t=n+r.t;--n>=0;)t.data[n]=0;for(n=0;n<r.t;++n)t.data[n+a.t]=a.am(0,r.data[n],t,n,0,a.t);t.s=0,t.clamp(),this.s!=e.s&&N.ZERO.subTo(t,t)}function Hb(e){for(var t=this.abs(),a=e.t=2*t.t;--a>=0;)e.data[a]=0;for(a=0;a<t.t-1;++a){var r=t.am(a,t.data[a],e,2*a,0,1);(e.data[a+t.t]+=t.am(a+1,2*t.data[a],e,2*a+1,r,t.t-a-1))>=t.DV&&(e.data[a+t.t]-=t.DV,e.data[a+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(a,t.data[a],e,2*a,0,1)),e.s=0,e.clamp()}function $b(e,t,a){var r=e.abs();if(!(r.t<=0)){var n=this.abs();if(n.t<r.t){t?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=Be());var i=Be(),s=this.s,o=e.s,c=this.DB-ll(r.data[r.t-1]);c>0?(r.lShiftTo(c,i),n.lShiftTo(c,a)):(r.copyTo(i),n.copyTo(a));var l=i.t,u=i.data[l-1];if(u!=0){var p=u*(1<<this.F1)+(l>1?i.data[l-2]>>this.F2:0),d=this.FV/p,g=(1<<this.F1)/p,h=1<<this.F2,y=a.t,b=y-l,E=t??Be();for(i.dlShiftTo(b,E),a.compareTo(E)>=0&&(a.data[a.t++]=1,a.subTo(E,a)),N.ONE.dlShiftTo(l,E),E.subTo(i,i);i.t<l;)i.data[i.t++]=0;for(;--b>=0;){var I=a.data[--y]==u?this.DM:Math.floor(a.data[y]*d+(a.data[y-1]+h)*g);if((a.data[y]+=i.am(0,I,a,b,0,l))<I)for(i.dlShiftTo(b,E),a.subTo(E,a);a.data[y]<--I;)a.subTo(E,a)}t!=null&&(a.drShiftTo(l,t),s!=o&&N.ZERO.subTo(t,t)),a.t=l,a.clamp(),c>0&&a.rShiftTo(c,a),s<0&&N.ZERO.subTo(a,a)}}}function Gb(e){var t=Be();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(N.ZERO)>0&&e.subTo(t,t),t}function Rr(e){this.m=e}function Wb(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Xb(e){return e}function Qb(e){e.divRemTo(this.m,null,e)}function Yb(e,t,a){e.multiplyTo(t,a),this.reduce(a)}function Jb(e,t){e.squareTo(t),this.reduce(t)}Rr.prototype.convert=Wb,Rr.prototype.revert=Xb,Rr.prototype.reduce=Qb,Rr.prototype.mulTo=Yb,Rr.prototype.sqrTo=Jb;function Zb(){if(this.t<1)return 0;var e=this.data[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function kr(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function eE(e){var t=Be();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(N.ZERO)>0&&this.m.subTo(t,t),t}function tE(e){var t=Be();return e.copyTo(t),this.reduce(t),t}function rE(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var a=e.data[t]&32767,r=a*this.mpl+((a*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(a=t+this.m.t,e.data[a]+=this.m.am(0,r,e,t,0,this.m.t);e.data[a]>=e.DV;)e.data[a]-=e.DV,e.data[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function aE(e,t){e.squareTo(t),this.reduce(t)}function nE(e,t,a){e.multiplyTo(t,a),this.reduce(a)}kr.prototype.convert=eE,kr.prototype.revert=tE,kr.prototype.reduce=rE,kr.prototype.mulTo=nE,kr.prototype.sqrTo=aE;function sE(){return(this.t>0?this.data[0]&1:this.s)==0}function iE(e,t){if(e>4294967295||e<1)return N.ONE;var a=Be(),r=Be(),n=t.convert(this),i=ll(e)-1;for(n.copyTo(a);--i>=0;)if(t.sqrTo(a,r),(e&1<<i)>0)t.mulTo(r,n,a);else{var s=a;a=r,r=s}return t.revert(a)}function oE(e,t){var a;return e<256||t.isEven()?a=new Rr(t):a=new kr(t),this.exp(e,a)}N.prototype.copyTo=kb,N.prototype.fromInt=_b,N.prototype.fromString=Ub,N.prototype.clamp=Nb,N.prototype.dlShiftTo=qb,N.prototype.drShiftTo=Vb,N.prototype.lShiftTo=Mb,N.prototype.rShiftTo=jb,N.prototype.subTo=Kb,N.prototype.multiplyTo=zb,N.prototype.squareTo=Hb,N.prototype.divRemTo=$b,N.prototype.invDigit=Zb,N.prototype.isEven=sE,N.prototype.exp=iE,N.prototype.toString=Lb,N.prototype.negate=Pb,N.prototype.abs=Ob,N.prototype.compareTo=Db,N.prototype.bitLength=Fb,N.prototype.mod=Gb,N.prototype.modPowInt=oE,N.ZERO=lr(0),N.ONE=lr(1);function cE(){var e=Be();return this.copyTo(e),e}function lE(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function uE(){return this.t==0?this.s:this.data[0]<<24>>24}function pE(){return this.t==0?this.s:this.data[0]<<16>>16}function dE(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function fE(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function hE(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),r=lr(a),n=Be(),i=Be(),s="";for(this.divRemTo(r,n,i);n.signum()>0;)s=(a+i.intValue()).toString(e).substr(1)+s,n.divRemTo(r,n,i);return i.intValue().toString(e)+s}function mE(e,t){this.fromInt(0),t==null&&(t=10);for(var a=this.chunkSize(t),r=Math.pow(t,a),n=!1,i=0,s=0,o=0;o<e.length;++o){var c=o0(e,o);if(c<0){e.charAt(o)=="-"&&this.signum()==0&&(n=!0);continue}s=t*s+c,++i>=a&&(this.dMultiply(r),this.dAddOffset(s,0),i=0,s=0)}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(s,0)),n&&N.ZERO.subTo(this,this)}function vE(e,t,a){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(N.ONE.shiftLeft(e-1),Wu,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(N.ONE.shiftLeft(e-1),this);else{var r=new Array,n=e&7;r.length=(e>>3)+1,t.nextBytes(r),n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromString(r,256)}}function gE(){var e=this.t,t=new Array;t[0]=this.s;var a=this.DB-e*this.DB%8,r,n=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[n++]=r|this.s<<this.DB-a);e>=0;)a<8?(r=(this.data[e]&(1<<a)-1)<<8-a,r|=this.data[--e]>>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),(r&128)!=0&&(r|=-256),n==0&&(this.s&128)!=(r&128)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t}function xE(e){return this.compareTo(e)==0}function yE(e){return this.compareTo(e)<0?this:e}function bE(e){return this.compareTo(e)>0?this:e}function EE(e,t,a){var r,n,i=Math.min(e.t,this.t);for(r=0;r<i;++r)a.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(n=e.s&this.DM,r=i;r<this.t;++r)a.data[r]=t(this.data[r],n);a.t=this.t}else{for(n=this.s&this.DM,r=i;r<e.t;++r)a.data[r]=t(n,e.data[r]);a.t=e.t}a.s=t(this.s,e.s),a.clamp()}function CE(e,t){return e&t}function TE(e){var t=Be();return this.bitwiseTo(e,CE,t),t}function Wu(e,t){return e|t}function SE(e){var t=Be();return this.bitwiseTo(e,Wu,t),t}function c0(e,t){return e^t}function wE(e){var t=Be();return this.bitwiseTo(e,c0,t),t}function l0(e,t){return e&~t}function AE(e){var t=Be();return this.bitwiseTo(e,l0,t),t}function IE(){for(var e=Be(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function BE(e){var t=Be();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function RE(e){var t=Be();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function kE(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function _E(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+kE(this.data[e]);return this.s<0?this.t*this.DB:-1}function UE(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function NE(){for(var e=0,t=this.s&this.DM,a=0;a<this.t;++a)e+=UE(this.data[a]^t);return e}function LE(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function PE(e,t){var a=N.ONE.shiftLeft(e);return this.bitwiseTo(a,t,a),a}function OE(e){return this.changeBit(e,Wu)}function DE(e){return this.changeBit(e,l0)}function FE(e){return this.changeBit(e,c0)}function qE(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]+e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r+=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[a++]=r:r<-1&&(t.data[a++]=this.DV+r),t.t=a,t.clamp()}function VE(e){var t=Be();return this.addTo(e,t),t}function ME(e){var t=Be();return this.subTo(e,t),t}function jE(e){var t=Be();return this.multiplyTo(e,t),t}function KE(){var e=Be();return this.squareTo(e),e}function zE(e){var t=Be();return this.divRemTo(e,t,null),t}function HE(e){var t=Be();return this.divRemTo(e,null,t),t}function $E(e){var t=Be(),a=Be();return this.divRemTo(e,t,a),new Array(t,a)}function GE(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function WE(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function vc(){}function u0(e){return e}function XE(e,t,a){e.multiplyTo(t,a)}function QE(e,t){e.squareTo(t)}vc.prototype.convert=u0,vc.prototype.revert=u0,vc.prototype.mulTo=XE,vc.prototype.sqrTo=QE;function YE(e){return this.exp(e,new vc)}function JE(e,t,a){var r=Math.min(this.t+e.t,t);for(a.s=0,a.t=r;r>0;)a.data[--r]=0;var n;for(n=a.t-this.t;r<n;++r)a.data[r+this.t]=this.am(0,e.data[r],a,r,0,this.t);for(n=Math.min(e.t,t);r<n;++r)this.am(0,e.data[r],a,r,0,t-r);a.clamp()}function ZE(e,t,a){--t;var r=a.t=this.t+e.t-t;for(a.s=0;--r>=0;)a.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)a.data[this.t+r-t]=this.am(t-r,e.data[r],a,0,0,this.t+r-t);a.clamp(),a.drShiftTo(1,a)}function Yr(e){this.r2=Be(),this.q3=Be(),N.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function eC(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Be();return e.copyTo(t),this.reduce(t),t}function tC(e){return e}function rC(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function aC(e,t){e.squareTo(t),this.reduce(t)}function nC(e,t,a){e.multiplyTo(t,a),this.reduce(a)}Yr.prototype.convert=eC,Yr.prototype.revert=tC,Yr.prototype.reduce=rC,Yr.prototype.mulTo=nC,Yr.prototype.sqrTo=aC;function sC(e,t){var a=e.bitLength(),r,n=lr(1),i;if(a<=0)return n;a<18?r=1:a<48?r=3:a<144?r=4:a<768?r=5:r=6,a<8?i=new Rr(t):t.isEven()?i=new Yr(t):i=new kr(t);var s=new Array,o=3,c=r-1,l=(1<<r)-1;if(s[1]=i.convert(this),r>1){var u=Be();for(i.sqrTo(s[1],u);o<=l;)s[o]=Be(),i.mulTo(u,s[o-2],s[o]),o+=2}var p=e.t-1,d,g=!0,h=Be(),y;for(a=ll(e.data[p])-1;p>=0;){for(a>=c?d=e.data[p]>>a-c&l:(d=(e.data[p]&(1<<a+1)-1)<<c-a,p>0&&(d|=e.data[p-1]>>this.DB+a-c)),o=r;(d&1)==0;)d>>=1,--o;if((a-=o)<0&&(a+=this.DB,--p),g)s[d].copyTo(n),g=!1;else{for(;o>1;)i.sqrTo(n,h),i.sqrTo(h,n),o-=2;o>0?i.sqrTo(n,h):(y=n,n=h,h=y),i.mulTo(h,s[d],n)}for(;p>=0&&(e.data[p]&1<<a)==0;)i.sqrTo(n,h),y=n,n=h,h=y,--a<0&&(a=this.DB-1,--p)}return i.revert(n)}function iC(e){var t=this.s<0?this.negate():this.clone(),a=e.s<0?e.negate():e.clone();if(t.compareTo(a)<0){var r=t;t=a,a=r}var n=t.getLowestSetBit(),i=a.getLowestSetBit();if(i<0)return t;for(n<i&&(i=n),i>0&&(t.rShiftTo(i,t),a.rShiftTo(i,a));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=a.getLowestSetBit())>0&&a.rShiftTo(n,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return i>0&&a.lShiftTo(i,a),a}function oC(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(t==0)a=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)a=(t*a+this.data[r])%e;return a}function cC(e){if(this.signum()==0)return N.ZERO;var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return N.ZERO;for(var a=e.clone(),r=this.clone(),n=lr(1),i=lr(0),s=lr(0),o=lr(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),t?((!n.isEven()||!i.isEven())&&(n.addTo(this,n),i.subTo(e,i)),n.rShiftTo(1,n)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);a.compareTo(r)>=0?(a.subTo(r,a),t&&n.subTo(s,n),i.subTo(o,i)):(r.subTo(a,r),t&&s.subTo(n,s),o.subTo(i,o))}if(r.compareTo(N.ONE)!=0)return N.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var Kt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lC=(1<<26)/Kt[Kt.length-1];function uC(e){var t,a=this.abs();if(a.t==1&&a.data[0]<=Kt[Kt.length-1]){for(t=0;t<Kt.length;++t)if(a.data[0]==Kt[t])return!0;return!1}if(a.isEven())return!1;for(t=1;t<Kt.length;){for(var r=Kt[t],n=t+1;n<Kt.length&&r<lC;)r*=Kt[n++];for(r=a.modInt(r);t<n;)if(r%Kt[t++]==0)return!1}return a.millerRabin(e)}function pC(e){var t=this.subtract(N.ONE),a=t.getLowestSetBit();if(a<=0)return!1;for(var r=t.shiftRight(a),n=dC(),i,s=0;s<e;++s){do i=new N(this.bitLength(),n);while(i.compareTo(N.ONE)<=0||i.compareTo(t)>=0);var o=i.modPow(r,this);if(o.compareTo(N.ONE)!=0&&o.compareTo(t)!=0){for(var c=1;c++<a&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(N.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function dC(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}N.prototype.chunkSize=dE,N.prototype.toRadix=hE,N.prototype.fromRadix=mE,N.prototype.fromNumber=vE,N.prototype.bitwiseTo=EE,N.prototype.changeBit=PE,N.prototype.addTo=qE,N.prototype.dMultiply=GE,N.prototype.dAddOffset=WE,N.prototype.multiplyLowerTo=JE,N.prototype.multiplyUpperTo=ZE,N.prototype.modInt=oC,N.prototype.millerRabin=pC,N.prototype.clone=cE,N.prototype.intValue=lE,N.prototype.byteValue=uE,N.prototype.shortValue=pE,N.prototype.signum=fE,N.prototype.toByteArray=gE,N.prototype.equals=xE,N.prototype.min=yE,N.prototype.max=bE,N.prototype.and=TE,N.prototype.or=SE,N.prototype.xor=wE,N.prototype.andNot=AE,N.prototype.not=IE,N.prototype.shiftLeft=BE,N.prototype.shiftRight=RE,N.prototype.getLowestSetBit=_E,N.prototype.bitCount=NE,N.prototype.testBit=LE,N.prototype.setBit=OE,N.prototype.clearBit=DE,N.prototype.flipBit=FE,N.prototype.add=VE,N.prototype.subtract=ME,N.prototype.multiply=jE,N.prototype.divide=zE,N.prototype.remainder=HE,N.prototype.divideAndRemainder=$E,N.prototype.modPow=sC,N.prototype.modInverse=cC,N.prototype.pow=YE,N.prototype.gcd=iC,N.prototype.isProbablePrime=uC,N.prototype.square=KE;var Xt=le,p0=Xt.sha1=Xt.sha1||{};Xt.md.sha1=Xt.md.algorithms.sha1=p0,p0.create=function(){d0||fC();var e=null,t=Xt.util.createBuffer(),a=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=Xt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=Xt.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),f0(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=Xt.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(Xu.substr(0,r.blockLength-s));for(var o,c,l=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};f0(p,a,n);var d=Xt.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d},r};var Xu=null,d0=!1;function fC(){Xu="\x80",Xu+=Xt.util.fillString("\0",64),d0=!0}function f0(e,t,a){for(var r,n,i,s,o,c,l,u,p=a.length();p>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)r=a.getInt32(),t[u]=r,l=o^i&(s^o),r=(n<<5|n>>>27)+l+c+1518500249+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<20;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=o^i&(s^o),r=(n<<5|n>>>27)+l+c+1518500249+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<32;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+1859775393+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<40;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+1859775393+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<60;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i&s|o&(i^s),r=(n<<5|n>>>27)+l+c+2400959708+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<80;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+3395469782+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,p-=64}}var Qt=le,h0=Qt.pkcs1=Qt.pkcs1||{};h0.encode_rsa_oaep=function(e,t,a){var r,n,i,s;typeof a=="string"?(r=a,n=arguments[3]||void 0,i=arguments[4]||void 0):a&&(r=a.label||void 0,n=a.seed||void 0,i=a.md||void 0,a.mgf1&&a.mgf1.md&&(s=a.mgf1.md)),i?i.start():i=Qt.md.sha1.create(),s||(s=i);var o=Math.ceil(e.n.bitLength()/8),c=o-2*i.digestLength-2;if(t.length>c){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=c,l}r||(r=""),i.update(r,"raw");for(var u=i.digest(),p="",d=c-t.length,g=0;g<d;g++)p+="\0";var h=u.getBytes()+p+""+t;if(!n)n=Qt.random.getBytes(i.digestLength);else if(n.length!==i.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=n.length,l.digestLength=i.digestLength,l}var y=ul(n,o-i.digestLength-1,s),b=Qt.util.xorBytes(h,y,h.length),E=ul(b,i.digestLength,s),I=Qt.util.xorBytes(n,E,n.length);return"\0"+I+b},h0.decode_rsa_oaep=function(e,t,a){var r,n,i;typeof a=="string"?(r=a,n=arguments[3]||void 0):a&&(r=a.label||void 0,n=a.md||void 0,a.mgf1&&a.mgf1.md&&(i=a.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var b=new Error("RSAES-OAEP encoded message length is invalid.");throw b.length=t.length,b.expectedLength=s,b}if(n===void 0?n=Qt.md.sha1.create():n.start(),i||(i=n),s<2*n.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),n.update(r,"raw");for(var o=n.digest().getBytes(),c=t.charAt(0),l=t.substring(1,n.digestLength+1),u=t.substring(1+n.digestLength),p=ul(u,n.digestLength,i),d=Qt.util.xorBytes(l,p,l.length),g=ul(d,s-n.digestLength-1,i),h=Qt.util.xorBytes(u,g,u.length),y=h.substring(0,n.digestLength),b=c!=="\0",E=0;E<n.digestLength;++E)b|=o.charAt(E)!==y.charAt(E);for(var I=1,R=n.digestLength,k=n.digestLength;k<h.length;k++){var U=h.charCodeAt(k),L=U&1^1,q=I?65534:0;b|=U&q,I=I&L,R+=I}if(b||h.charCodeAt(R)!==1)throw new Error("Invalid RSAES-OAEP padding.");return h.substring(R+1)};function ul(e,t,a){a||(a=Qt.md.sha1.create());for(var r="",n=Math.ceil(t/a.digestLength),i=0;i<n;++i){var s=String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255);a.start(),a.update(e+s),r+=a.digest().getBytes()}return r.substring(0,t)}var ur=le;(function(){if(ur.prime){ur.prime;return}var e=ur.prime=ur.prime||{},t=ur.jsbn.BigInteger,a=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var n=function(p,d){return p|d};e.generateProbablePrime=function(p,d,g){typeof d=="function"&&(g=d,d={}),d=d||{};var h=d.algorithm||"PRIMEINC";typeof h=="string"&&(h={name:h}),h.options=h.options||{};var y=d.prng||ur.random,b={nextBytes:function(E){for(var I=y.getBytesSync(E.length),R=0;R<E.length;++R)E[R]=I.charCodeAt(R)}};if(h.name==="PRIMEINC")return i(p,b,h.options,g);throw new Error("Invalid prime generation algorithm: "+h.name)};function i(p,d,g,h){return"workers"in g?c(p,d,g,h):s(p,d,g,h)}function s(p,d,g,h){var y=l(p,d),b=0,E=u(y.bitLength());"millerRabinTests"in g&&(E=g.millerRabinTests);var I=10;"maxBlockTime"in g&&(I=g.maxBlockTime),o(y,p,d,b,E,I,h)}function o(p,d,g,h,y,b,E){var I=+new Date;do{if(p.bitLength()>d&&(p=l(d,g)),p.isProbablePrime(y))return E(null,p);p.dAddOffset(a[h++%8],0)}while(b<0||+new Date-I<b);ur.util.setImmediate(function(){o(p,d,g,h,y,b,E)})}function c(p,d,g,h){if(typeof Worker>"u")return s(p,d,g,h);var y=l(p,d),b=g.workers,E=g.workLoad||100,I=E*30/8,R=g.workerScript||"forge/prime.worker.js";if(b===-1)return ur.util.estimateCores(function(U,L){U&&(L=2),b=L-1,k()});k();function k(){b=Math.max(1,b);for(var U=[],L=0;L<b;++L)U[L]=new Worker(R);for(var L=0;L<b;++L)U[L].addEventListener("message",H);var q=!1;function H(Y){if(!q){var ve=Y.data;if(ve.found){for(var Ae=0;Ae<U.length;++Ae)U[Ae].terminate();return q=!0,h(null,new t(ve.prime,16))}y.bitLength()>p&&(y=l(p,d));var ke=y.toString(16);Y.target.postMessage({hex:ke,workLoad:E}),y.dAddOffset(I,0)}}}}function l(p,d){var g=new t(p,d),h=p-1;return g.testBit(h)||g.bitwiseTo(t.ONE.shiftLeft(h),n,g),g.dAddOffset(31-g.mod(r).byteValue(),0),g}function u(p){return p<=100?27:p<=150?18:p<=200?15:p<=250?12:p<=300?9:p<=350?8:p<=400?7:p<=500?6:p<=600?5:p<=800?4:p<=1250?3:2}})();var X=le;if(typeof _e>"u")var _e=X.jsbn.BigInteger;var Qu=X.util.isNodejs?Or:null,B=X.asn1,Ot=X.util;X.pki=X.pki||{},X.pki.rsa=X.rsa=X.rsa||{};var ne=X.pki,hC=[6,4,2,4,2,4,6,2],mC={name:"PrivateKeyInfo",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:B.Class.UNIVERSAL,type:B.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:B.Class.UNIVERSAL,type:B.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},vC={name:"RSAPrivateKey",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},gC={name:"RSAPublicKey",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},xC=X.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:B.Class.UNIVERSAL,type:B.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:B.Class.UNIVERSAL,type:B.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},yC={name:"DigestInfo",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:B.Class.UNIVERSAL,type:B.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:B.Class.UNIVERSAL,type:B.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:B.Class.UNIVERSAL,type:B.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},bC=function(e){var t;if(e.algorithm in ne.oids)t=ne.oids[e.algorithm];else{var a=new Error("Unknown message digest algorithm.");throw a.algorithm=e.algorithm,a}var r=B.oidToDer(t).getBytes(),n=B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[]),i=B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[]);i.value.push(B.create(B.Class.UNIVERSAL,B.Type.OID,!1,r)),i.value.push(B.create(B.Class.UNIVERSAL,B.Type.NULL,!1,""));var s=B.create(B.Class.UNIVERSAL,B.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(i),n.value.push(s),B.toDer(n).getBytes()},m0=function(e,t,a){if(a)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(_e.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(_e.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new _e(X.util.bytesToHex(X.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(_e.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var n=e.mod(t.p).modPow(t.dP,t.p),i=e.mod(t.q).modPow(t.dQ,t.q);n.compareTo(i)<0;)n=n.add(t.p);var s=n.subtract(i).multiply(t.qInv).mod(t.p).multiply(t.q).add(i);return s=s.multiply(r.modInverse(t.n)).mod(t.n),s};ne.rsa.encrypt=function(e,t,a){var r=a,n,i=Math.ceil(t.n.bitLength()/8);a!==!1&&a!==!0?(r=a===2,n=v0(e,t,a)):(n=X.util.createBuffer(),n.putBytes(e));for(var s=new _e(n.toHex(),16),o=m0(s,t,r),c=o.toString(16),l=X.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(X.util.hexToBytes(c)),l.getBytes()},ne.rsa.decrypt=function(e,t,a,r){var n=Math.ceil(t.n.bitLength()/8);if(e.length!==n){var i=new Error("Encrypted message length is invalid.");throw i.length=e.length,i.expected=n,i}var s=new _e(X.util.createBuffer(e).toHex(),16);if(s.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=m0(s,t,a),c=o.toString(16),l=X.util.createBuffer(),u=n-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(X.util.hexToBytes(c)),r!==!1?pl(l.getBytes(),t,a):l.getBytes()},ne.rsa.createKeyPairGenerationState=function(e,t,a){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,a=a||{};var r=a.prng||X.random,n={nextBytes:function(o){for(var c=r.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=c.charCodeAt(l)}},i=a.algorithm||"PRIMEINC",s;if(i==="PRIMEINC")s={algorithm:i,state:0,bits:e,rng:n,eInt:t||65537,e:new _e(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},s.e.fromInt(s.eInt);else throw new Error("Invalid key generation algorithm: "+i);return s},ne.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var a=new _e(null);a.fromInt(30);for(var r=0,n=function(p,d){return p|d},i=+new Date,s,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var c=e.p===null?e.pBits:e.qBits,l=c-1;e.pqState===0?(e.num=new _e(c,e.rng),e.num.testBit(l)||e.num.bitwiseTo(_e.ONE.shiftLeft(l),n,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(CC(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(hC[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(_e.ONE).gcd(e.e).compareTo(_e.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(_e.ONE),e.q1=e.q.subtract(_e.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(_e.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:ne.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:ne.rsa.setPublicKey(e.n,e.e)}}s=+new Date,o+=s-i,i=s}return e.keys!==null},ne.rsa.generateKeyPair=function(e,t,a,r){if(arguments.length===1?typeof e=="object"?(a=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(a=t,t=void 0):(a=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof a=="function"&&(r=a,a=void 0):(r=a,a=t,t=void 0)),a=a||{},e===void 0&&(e=a.bits||2048),t===void 0&&(t=a.e||65537),!X.options.usePureJavaScript&&!a.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(g0("generateKeyPair"))return Qu.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,c,l){if(o)return r(o);r(null,{privateKey:ne.privateKeyFromPem(l),publicKey:ne.publicKeyFromPem(c)})});if(x0("generateKey")&&x0("exportKey"))return Ot.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:b0(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Ot.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){r(o)}).then(function(o){if(o){var c=ne.privateKeyFromAsn1(B.fromDer(X.util.createBuffer(o)));r(null,{privateKey:c,publicKey:ne.setRsaPublicKey(c.n,c.e)})}});if(y0("generateKey")&&y0("exportKey")){var n=Ot.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:b0(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);n.oncomplete=function(o){var c=o.target.result,l=Ot.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);l.oncomplete=function(u){var p=u.target.result,d=ne.privateKeyFromAsn1(B.fromDer(X.util.createBuffer(p)));r(null,{privateKey:d,publicKey:ne.setRsaPublicKey(d.n,d.e)})},l.onerror=function(u){r(u)}},n.onerror=function(o){r(o)};return}}else if(g0("generateKeyPairSync")){var i=Qu.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:ne.privateKeyFromPem(i.privateKey),publicKey:ne.publicKeyFromPem(i.publicKey)}}}var s=ne.rsa.createKeyPairGenerationState(e,t,a);if(!r)return ne.rsa.stepKeyPairGenerationState(s,0),s.keys;EC(s,a,r)},ne.setRsaPublicKey=ne.rsa.setPublicKey=function(e,t){var a={n:e,e:t};return a.encrypt=function(r,n,i){if(typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSAES-PKCS1-V1_5"),n==="RSAES-PKCS1-V1_5")n={encode:function(o,c,l){return v0(o,c,2).getBytes()}};else if(n==="RSA-OAEP"||n==="RSAES-OAEP")n={encode:function(o,c){return X.pkcs1.encode_rsa_oaep(c,o,i)}};else if(["RAW","NONE","NULL",null].indexOf(n)!==-1)n={encode:function(o){return o}};else if(typeof n=="string")throw new Error('Unsupported encryption scheme: "'+n+'".');var s=n.encode(r,a,!0);return ne.rsa.encrypt(s,a,!0)},a.verify=function(r,n,i,s){typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSASSA-PKCS1-V1_5"),s===void 0&&(s={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),"_skipPaddingChecks"in s||(s._skipPaddingChecks=!1),i==="RSASSA-PKCS1-V1_5"?i={verify:function(c,l){l=pl(l,a,!0,void 0,s);var u=B.fromDer(l,{parseAllBytes:s._parseAllDigestBytes}),p={},d=[];if(!B.validate(u,yC,p,d)||u.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=d,g}var h=B.derToOid(p.algorithmIdentifier);if(!(h===X.oids.md2||h===X.oids.md5||h===X.oids.sha1||h===X.oids.sha224||h===X.oids.sha256||h===X.oids.sha384||h===X.oids.sha512||h===X.oids["sha512-224"]||h===X.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=h,g}if((h===X.oids.md2||h===X.oids.md5)&&!("parameters"in p))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return c===p.digest}}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:function(c,l){return l=pl(l,a,!0,void 0,s),c===l}});var o=ne.rsa.decrypt(n,a,!0,!1);return i.verify(r,o,a.n.bitLength())},a},ne.setRsaPrivateKey=ne.rsa.setPrivateKey=function(e,t,a,r,n,i,s,o){var c={n:e,e:t,d:a,p:r,q:n,dP:i,dQ:s,qInv:o};return c.decrypt=function(l,u,p){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var d=ne.rsa.decrypt(l,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:pl};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,h){return X.pkcs1.decode_rsa_oaep(h,g,p)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(d,c,!1)},c.sign=function(l,u){var p=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:bC},p=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return l}},p=1);var d=u.encode(l,c.n.bitLength());return ne.rsa.encrypt(d,c,p)},c},ne.wrapRsaPrivateKey=function(e){return B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,B.integerToDer(0).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OID,!1,B.oidToDer(ne.oids.rsaEncryption).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.NULL,!1,"")]),B.create(B.Class.UNIVERSAL,B.Type.OCTETSTRING,!1,B.toDer(e).getBytes())])},ne.privateKeyFromAsn1=function(e){var t={},a=[];if(B.validate(e,mC,t,a)&&(e=B.fromDer(X.util.createBuffer(t.privateKey))),t={},a=[],!B.validate(e,vC,t,a)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=a,r}var n,i,s,o,c,l,u,p;return n=X.util.createBuffer(t.privateKeyModulus).toHex(),i=X.util.createBuffer(t.privateKeyPublicExponent).toHex(),s=X.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=X.util.createBuffer(t.privateKeyPrime1).toHex(),c=X.util.createBuffer(t.privateKeyPrime2).toHex(),l=X.util.createBuffer(t.privateKeyExponent1).toHex(),u=X.util.createBuffer(t.privateKeyExponent2).toHex(),p=X.util.createBuffer(t.privateKeyCoefficient).toHex(),ne.setRsaPrivateKey(new _e(n,16),new _e(i,16),new _e(s,16),new _e(o,16),new _e(c,16),new _e(l,16),new _e(u,16),new _e(p,16))},ne.privateKeyToAsn1=ne.privateKeyToRSAPrivateKey=function(e){return B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,B.integerToDer(0).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.n)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.e)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.d)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.p)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.q)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.dP)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.dQ)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.qInv))])},ne.publicKeyFromAsn1=function(e){var t={},a=[];if(B.validate(e,xC,t,a)){var r=B.derToOid(t.publicKeyOid);if(r!==ne.oids.rsaEncryption){var n=new Error("Cannot read public key. Unknown OID.");throw n.oid=r,n}e=t.rsaPublicKey}if(a=[],!B.validate(e,gC,t,a)){var n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw n.errors=a,n}var i=X.util.createBuffer(t.publicKeyModulus).toHex(),s=X.util.createBuffer(t.publicKeyExponent).toHex();return ne.setRsaPublicKey(new _e(i,16),new _e(s,16))},ne.publicKeyToAsn1=ne.publicKeyToSubjectPublicKeyInfo=function(e){return B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OID,!1,B.oidToDer(ne.oids.rsaEncryption).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.NULL,!1,"")]),B.create(B.Class.UNIVERSAL,B.Type.BITSTRING,!1,[ne.publicKeyToRSAPublicKey(e)])])},ne.publicKeyToRSAPublicKey=function(e){return B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.n)),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,Yt(e.e))])};function v0(e,t,a){var r=X.util.createBuffer(),n=Math.ceil(t.n.bitLength()/8);if(e.length>n-11){var i=new Error("Message is too long for PKCS#1 v1.5 padding.");throw i.length=e.length,i.max=n-11,i}r.putByte(0),r.putByte(a);var s=n-3-e.length,o;if(a===0||a===1){o=a===0?0:255;for(var c=0;c<s;++c)r.putByte(o)}else for(;s>0;){for(var l=0,u=X.random.getBytes(s),c=0;c<s;++c)o=u.charCodeAt(c),o===0?++l:r.putByte(o);s=l}return r.putByte(0),r.putBytes(e),r}function pl(e,t,a,r,n){var i=Math.ceil(t.n.bitLength()/8),s=X.util.createBuffer(e),o=s.getByte(),c=s.getByte();if(o!==0||a&&c!==0&&c!==1||!a&&c!==2||a&&c===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(c===0){l=i-3-r;for(var u=0;u<l;++u)if(s.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(c===1){for(l=0;s.length()>1;){if(s.getByte()!==255){--s.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(c===2){for(l=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var p=s.getByte();if(p!==0||l!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function EC(e,t,a){typeof t=="function"&&(a=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),n();function n(){i(e.pBits,function(o,c){if(o)return a(o);if(e.p=c,e.q!==null)return s(o,e.q);i(e.qBits,s)})}function i(o,c){X.prime.generateProbablePrime(o,r,c)}function s(o,c){if(o)return a(o);if(e.q=c,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l}if(e.p.subtract(_e.ONE).gcd(e.e).compareTo(_e.ONE)!==0){e.p=null,n();return}if(e.q.subtract(_e.ONE).gcd(e.e).compareTo(_e.ONE)!==0){e.q=null,i(e.qBits,s);return}if(e.p1=e.p.subtract(_e.ONE),e.q1=e.q.subtract(_e.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(_e.ONE)!==0){e.p=e.q=null,n();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,i(e.qBits,s);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:ne.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:ne.rsa.setPublicKey(e.n,e.e)},a(null,e.keys)}}function Yt(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var a=X.util.hexToBytes(t);return a.length>1&&(a.charCodeAt(0)===0&&(a.charCodeAt(1)&128)===0||a.charCodeAt(0)===255&&(a.charCodeAt(1)&128)===128)?a.substr(1):a}function CC(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function g0(e){return X.util.isNodejs&&typeof Qu[e]=="function"}function x0(e){return typeof Ot.globalScope<"u"&&typeof Ot.globalScope.crypto=="object"&&typeof Ot.globalScope.crypto.subtle=="object"&&typeof Ot.globalScope.crypto.subtle[e]=="function"}function y0(e){return typeof Ot.globalScope<"u"&&typeof Ot.globalScope.msCrypto=="object"&&typeof Ot.globalScope.msCrypto.subtle=="object"&&typeof Ot.globalScope.msCrypto.subtle[e]=="function"}function b0(e){for(var t=X.util.hexToBytes(e.toString(16)),a=new Uint8Array(t.length),r=0;r<t.length;++r)a[r]=t.charCodeAt(r);return a}var $=le;if(typeof TC>"u")var TC=$.jsbn.BigInteger;var _=$.asn1,oe=$.pki=$.pki||{};oe.pbe=$.pbe=$.pbe||{};var _r=oe.oids,SC={name:"EncryptedPrivateKeyInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},wC={name:"PBES2Algorithms",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},AC={name:"pkcs-12PbeParams",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"iterations"}]};oe.encryptPrivateKeyInfo=function(e,t,a){a=a||{},a.saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||"aes128",a.prfAlgorithm=a.prfAlgorithm||"sha1";var r=$.random.getBytesSync(a.saltSize),n=a.count,i=_.integerToDer(n),s,o,c;if(a.algorithm.indexOf("aes")===0||a.algorithm==="des"){var l,u,p;switch(a.algorithm){case"aes128":s=16,l=16,u=_r["aes128-CBC"],p=$.aes.createEncryptionCipher;break;case"aes192":s=24,l=16,u=_r["aes192-CBC"],p=$.aes.createEncryptionCipher;break;case"aes256":s=32,l=16,u=_r["aes256-CBC"],p=$.aes.createEncryptionCipher;break;case"des":s=8,l=8,u=_r.desCBC,p=$.des.createEncryptionCipher;break;default:var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=a.algorithm,d}var g="hmacWith"+a.prfAlgorithm.toUpperCase(),h=T0(g),y=$.pkcs5.pbkdf2(t,r,n,s,h),b=$.random.getBytesSync(l),E=p(y);E.start(b),E.update(_.toDer(e)),E.finish(),c=E.output.getBytes();var I=IC(r,i,s,g);o=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(_r.pkcs5PBES2).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(_r.pkcs5PBKDF2).getBytes()),I]),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(u).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,b)])])])}else if(a.algorithm==="3des"){s=24;var R=new $.util.ByteBuffer(r),y=oe.pbe.generatePkcs12Key(t,R,1,n,s),b=oe.pbe.generatePkcs12Key(t,R,2,n,s),E=$.des.createEncryptionCipher(y);E.start(b),E.update(_.toDer(e)),E.finish(),c=E.output.getBytes(),o=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(_r["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,r),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,i.getBytes())])])}else{var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=a.algorithm,d}var k=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[o,_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,c)]);return k},oe.decryptPrivateKeyInfo=function(e,t){var a=null,r={},n=[];if(!_.validate(e,SC,r,n)){var i=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}var s=_.derToOid(r.encryptionOid),o=oe.pbe.getCipher(s,r.encryptionParams,t),c=$.util.createBuffer(r.encryptedData);return o.update(c),o.finish()&&(a=_.fromDer(o.output)),a},oe.encryptedPrivateKeyToPem=function(e,t){var a={type:"ENCRYPTED PRIVATE KEY",body:_.toDer(e).getBytes()};return $.pem.encode(a,{maxline:t})},oe.encryptedPrivateKeyFromPem=function(e){var t=$.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var a=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return _.fromDer(t.body)},oe.encryptRsaPrivateKey=function(e,t,a){if(a=a||{},!a.legacy){var r=oe.wrapRsaPrivateKey(oe.privateKeyToAsn1(e));return r=oe.encryptPrivateKeyInfo(r,t,a),oe.encryptedPrivateKeyToPem(r)}var n,i,s,o;switch(a.algorithm){case"aes128":n="AES-128-CBC",s=16,i=$.random.getBytesSync(16),o=$.aes.createEncryptionCipher;break;case"aes192":n="AES-192-CBC",s=24,i=$.random.getBytesSync(16),o=$.aes.createEncryptionCipher;break;case"aes256":n="AES-256-CBC",s=32,i=$.random.getBytesSync(16),o=$.aes.createEncryptionCipher;break;case"3des":n="DES-EDE3-CBC",s=24,i=$.random.getBytesSync(8),o=$.des.createEncryptionCipher;break;case"des":n="DES-CBC",s=8,i=$.random.getBytesSync(8),o=$.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+a.algorithm+'".');throw c.algorithm=a.algorithm,c}var l=$.pbe.opensslDeriveBytes(t,i.substr(0,8),s),u=o(l);u.start(i),u.update(_.toDer(oe.privateKeyToAsn1(e))),u.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:n,parameters:$.util.bytesToHex(i).toUpperCase()},body:u.output.getBytes()};return $.pem.encode(p)},oe.decryptRsaPrivateKey=function(e,t){var a=null,r=$.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw n.headerType=n,n}if(r.procType&&r.procType.type==="ENCRYPTED"){var i,s;switch(r.dekInfo.algorithm){case"DES-CBC":i=8,s=$.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,s=$.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,s=$.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,s=$.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,s=$.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,s=function(p){return $.rc2.createDecryptionCipher(p,40)};break;case"RC2-64-CBC":i=8,s=function(p){return $.rc2.createDecryptionCipher(p,64)};break;case"RC2-128-CBC":i=16,s=function(p){return $.rc2.createDecryptionCipher(p,128)};break;default:var n=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw n.algorithm=r.dekInfo.algorithm,n}var o=$.util.hexToBytes(r.dekInfo.parameters),c=$.pbe.opensslDeriveBytes(t,o.substr(0,8),i),l=s(c);if(l.start(o),l.update($.util.createBuffer(r.body)),l.finish())a=l.output.getBytes();else return a}else a=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?a=oe.decryptPrivateKeyInfo(_.fromDer(a),t):a=_.fromDer(a),a!==null&&(a=oe.privateKeyFromAsn1(a)),a},oe.pbe.generatePkcs12Key=function(e,t,a,r,n,i){var s,o;if(typeof i>"u"||i===null){if(!("sha1"in $.md))throw new Error('"sha1" hash algorithm unavailable.');i=$.md.sha1.create()}var c=i.digestLength,l=i.blockLength,u=new $.util.ByteBuffer,p=new $.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)p.putInt16(e.charCodeAt(o));p.putInt16(0)}var d=p.length(),g=t.length(),h=new $.util.ByteBuffer;h.fillWithByte(a,l);var y=l*Math.ceil(g/l),b=new $.util.ByteBuffer;for(o=0;o<y;o++)b.putByte(t.at(o%g));var E=l*Math.ceil(d/l),I=new $.util.ByteBuffer;for(o=0;o<E;o++)I.putByte(p.at(o%d));var R=b;R.putBuffer(I);for(var k=Math.ceil(n/c),U=1;U<=k;U++){var L=new $.util.ByteBuffer;L.putBytes(h.bytes()),L.putBytes(R.bytes());for(var q=0;q<r;q++)i.start(),i.update(L.getBytes()),L=i.digest();var H=new $.util.ByteBuffer;for(o=0;o<l;o++)H.putByte(L.at(o%c));var Y=Math.ceil(g/l)+Math.ceil(d/l),ve=new $.util.ByteBuffer;for(s=0;s<Y;s++){var Ae=new $.util.ByteBuffer(R.getBytes(l)),ke=511;for(o=H.length()-1;o>=0;o--)ke=ke>>8,ke+=H.at(o)+Ae.at(o),Ae.setAt(o,ke&255);ve.putBuffer(Ae)}R=ve,u.putBuffer(L)}return u.truncate(u.length()-n),u},oe.pbe.getCipher=function(e,t,a){switch(e){case oe.oids.pkcs5PBES2:return oe.pbe.getCipherForPBES2(e,t,a);case oe.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case oe.oids["pbewithSHAAnd40BitRC2-CBC"]:return oe.pbe.getCipherForPKCS12PBE(e,t,a);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}},oe.pbe.getCipherForPBES2=function(e,t,a){var r={},n=[];if(!_.validate(t,wC,r,n)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}if(e=_.derToOid(r.kdfOid),e!==oe.oids.pkcs5PBKDF2){var i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw i.oid=e,i.supportedOids=["pkcs5PBKDF2"],i}if(e=_.derToOid(r.encOid),e!==oe.oids["aes128-CBC"]&&e!==oe.oids["aes192-CBC"]&&e!==oe.oids["aes256-CBC"]&&e!==oe.oids["des-EDE3-CBC"]&&e!==oe.oids.desCBC){var i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw i.oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i}var s=r.kdfSalt,o=$.util.createBuffer(r.kdfIterationCount);o=o.getInt(o.length()<<3);var c,l;switch(oe.oids[e]){case"aes128-CBC":c=16,l=$.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,l=$.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,l=$.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,l=$.des.createDecryptionCipher;break;case"desCBC":c=8,l=$.des.createDecryptionCipher;break}var u=C0(r.prfOid),p=$.pkcs5.pbkdf2(a,s,o,c,u),d=r.encIv,g=l(p);return g.start(d),g},oe.pbe.getCipherForPKCS12PBE=function(e,t,a){var r={},n=[];if(!_.validate(t,AC,r,n)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}var s=$.util.createBuffer(r.salt),o=$.util.createBuffer(r.iterations);o=o.getInt(o.length()<<3);var c,l,u;switch(e){case oe.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,l=8,u=$.des.startDecrypting;break;case oe.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,l=8,u=function(y,b){var E=$.rc2.createDecryptionCipher(y,40);return E.start(b,null),E};break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=e,i}var p=C0(r.prfOid),d=oe.pbe.generatePkcs12Key(a,s,1,o,c,p);p.start();var g=oe.pbe.generatePkcs12Key(a,s,2,o,l,p);return u(d,g)},oe.pbe.opensslDeriveBytes=function(e,t,a,r){if(typeof r>"u"||r===null){if(!("md5"in $.md))throw new Error('"md5" hash algorithm unavailable.');r=$.md.md5.create()}t===null&&(t="");for(var n=[E0(r,e+t)],i=16,s=1;i<a;++s,i+=16)n.push(E0(r,n[s-1]+e+t));return n.join("").substr(0,a)};function E0(e,t){return e.start().update(t).digest().getBytes()}function C0(e){var t;if(!e)t="hmacWithSHA1";else if(t=oe.oids[_.derToOid(e)],!t){var a=new Error("Unsupported PRF OID.");throw a.oid=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}return T0(t)}function T0(e){var t=$.md;switch(e){case"hmacWithSHA224":t=$.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var a=new Error("Unsupported PRF algorithm.");throw a.algorithm=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function IC(e,t,a,r){var n=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,e),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&n.value.push(_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,$.util.hexToBytes(a.toString(16))),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(oe.oids[r]).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])),n}var Jr=le,z=Jr.asn1,Zr=Jr.pkcs7asn1=Jr.pkcs7asn1||{};Jr.pkcs7=Jr.pkcs7||{},Jr.pkcs7.asn1=Zr;var S0={name:"ContentInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Zr.contentInfoValidator=S0;var w0={name:"EncryptedContentInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:z.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Zr.envelopedDataValidator={name:"EnvelopedData",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:z.Class.UNIVERSAL,type:z.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(w0)},Zr.encryptedDataValidator={name:"EncryptedData",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"}].concat(w0)};var BC={name:"SignerInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:z.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:z.Class.UNIVERSAL,type:z.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:z.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Zr.signedDataValidator={name:"SignedData",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:z.Class.UNIVERSAL,type:z.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},S0,{name:"SignedData.Certificates",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:z.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:z.Class.UNIVERSAL,type:z.Type.SET,capture:"signerInfos",optional:!0,value:[BC]}]},Zr.recipientInfoValidator={name:"RecipientInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:z.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:z.Class.UNIVERSAL,type:z.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var Ur=le;Ur.mgf=Ur.mgf||{};var RC=Ur.mgf.mgf1=Ur.mgf1=Ur.mgf1||{};RC.create=function(e){var t={generate:function(a,r){for(var n=new Ur.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s<i;s++){var o=new Ur.util.ByteBuffer;o.putInt32(s),e.start(),e.update(a+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}};return t};var dl=le;dl.mgf=dl.mgf||{},dl.mgf.mgf1=dl.mgf1;var Nr=le,kC=Nr.pss=Nr.pss||{};kC.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,a=e.mgf,r=t.digestLength,n=e.salt||null;typeof n=="string"&&(n=Nr.util.createBuffer(n));var i;if("saltLength"in e)i=e.saltLength;else if(n!==null)i=n.length();else throw new Error("Salt length not specified or specific salt not given.");if(n!==null&&n.length()!==i)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||Nr.random,o={};return o.encode=function(c,l){var u,p=l-1,d=Math.ceil(p/8),g=c.digest().getBytes();if(d<r+i+2)throw new Error("Message is too long to encrypt.");var h;n===null?h=s.getBytesSync(i):h=n.bytes();var y=new Nr.util.ByteBuffer;y.fillWithByte(0,8),y.putBytes(g),y.putBytes(h),t.start(),t.update(y.getBytes());var b=t.digest().getBytes(),E=new Nr.util.ByteBuffer;E.fillWithByte(0,d-i-r-2),E.putByte(1),E.putBytes(h);var I=E.getBytes(),R=d-r-1,k=a.generate(b,R),U="";for(u=0;u<R;u++)U+=String.fromCharCode(I.charCodeAt(u)^k.charCodeAt(u));var L=65280>>8*d-p&255;return U=String.fromCharCode(U.charCodeAt(0)&~L)+U.substr(1),U+b+"\xBC"},o.verify=function(c,l,u){var p,d=u-1,g=Math.ceil(d/8);if(l=l.substr(-g),g<r+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(g-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var h=g-r-1,y=l.substr(0,h),b=l.substr(h,r),E=65280>>8*g-d&255;if((y.charCodeAt(0)&E)!==0)throw new Error("Bits beyond keysize not zero as expected.");var I=a.generate(b,h),R="";for(p=0;p<h;p++)R+=String.fromCharCode(y.charCodeAt(p)^I.charCodeAt(p));R=String.fromCharCode(R.charCodeAt(0)&~E)+R.substr(1);var k=g-r-i-2;for(p=0;p<k;p++)if(R.charCodeAt(p)!==0)throw new Error("Leftmost octets not zero as expected");if(R.charCodeAt(k)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var U=R.substr(-i),L=new Nr.util.ByteBuffer;L.fillWithByte(0,8),L.putBytes(c),L.putBytes(U),t.start(),t.update(L.getBytes());var q=t.digest().getBytes();return b===q},o};var Q=le,m=Q.asn1,F=Q.pki=Q.pki||{},Re=F.oids,Je={};Je.CN=Re.commonName,Je.commonName="CN",Je.C=Re.countryName,Je.countryName="C",Je.L=Re.localityName,Je.localityName="L",Je.ST=Re.stateOrProvinceName,Je.stateOrProvinceName="ST",Je.O=Re.organizationName,Je.organizationName="O",Je.OU=Re.organizationalUnitName,Je.organizationalUnitName="OU",Je.E=Re.emailAddress,Je.emailAddress="E";var A0=Q.pki.rsa.publicKeyValidator,_C={name:"Certificate",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:m.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:m.Class.UNIVERSAL,type:m.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:m.Class.UNIVERSAL,type:m.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:m.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:m.Class.UNIVERSAL,type:m.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:m.Class.UNIVERSAL,type:m.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:m.Class.UNIVERSAL,type:m.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:m.Class.UNIVERSAL,type:m.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},A0,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:m.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:m.Class.UNIVERSAL,type:m.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:m.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:m.Class.UNIVERSAL,type:m.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:m.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:m.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:m.Class.UNIVERSAL,type:m.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},UC={name:"rsapss",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:m.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:m.Class.UNIVERSAL,type:m.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:m.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:m.Class.UNIVERSAL,type:m.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:m.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:m.Class.UNIVERSAL,type:m.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:m.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:m.Class.UNIVERSAL,type:m.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},NC={name:"CertificationRequestInfo",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:m.Class.UNIVERSAL,type:m.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},A0,{name:"CertificationRequestInfo.attributes",tagClass:m.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:m.Class.UNIVERSAL,type:m.Type.SET,constructed:!0}]}]}]},LC={name:"CertificationRequest",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[NC,{name:"CertificationRequest.signatureAlgorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:m.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:m.Class.UNIVERSAL,type:m.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};F.RDNAttributesAsArray=function(e,t){for(var a=[],r,n,i,s=0;s<e.value.length;++s){r=e.value[s];for(var o=0;o<r.value.length;++o)i={},n=r.value[o],i.type=m.derToOid(n.value[0].value),i.value=n.value[1].value,i.valueTagClass=n.value[1].type,i.type in Re&&(i.name=Re[i.type],i.name in Je&&(i.shortName=Je[i.name])),t&&(t.update(i.type),t.update(i.value)),a.push(i)}return a},F.CRIAttributesAsArray=function(e){for(var t=[],a=0;a<e.length;++a)for(var r=e[a],n=m.derToOid(r.value[0].value),i=r.value[1].value,s=0;s<i.length;++s){var o={};if(o.type=n,o.value=i[s].value,o.valueTagClass=i[s].type,o.type in Re&&(o.name=Re[o.type],o.name in Je&&(o.shortName=Je[o.name])),o.type===Re.extensionRequest){o.extensions=[];for(var c=0;c<o.value.length;++c)o.extensions.push(F.certificateExtensionFromAsn1(o.value[c]))}t.push(o)}return t};function pr(e,t){typeof t=="string"&&(t={shortName:t});for(var a=null,r,n=0;a===null&&n<e.attributes.length;++n)r=e.attributes[n],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(a=r);return a}var fl=function(e,t,a){var r={};if(e!==Re["RSASSA-PSS"])return r;a&&(r={hash:{algorithmOid:Re.sha1},mgf:{algorithmOid:Re.mgf1,hash:{algorithmOid:Re.sha1}},saltLength:20});var n={},i=[];if(!m.validate(t,UC,n,i)){var s=new Error("Cannot read RSASSA-PSS parameter block.");throw s.errors=i,s}return n.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=m.derToOid(n.hashOid)),n.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=m.derToOid(n.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=m.derToOid(n.maskGenHashOid)),n.saltLength!==void 0&&(r.saltLength=n.saltLength.charCodeAt(0)),r},hl=function(e){switch(Re[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return Q.md.sha1.create();case"md5WithRSAEncryption":return Q.md.md5.create();case"sha256WithRSAEncryption":return Q.md.sha256.create();case"sha384WithRSAEncryption":return Q.md.sha384.create();case"sha512WithRSAEncryption":return Q.md.sha512.create();case"RSASSA-PSS":return Q.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},I0=function(e){var t=e.certificate,a;switch(t.signatureOid){case Re.sha1WithRSAEncryption:case Re.sha1WithRSASignature:break;case Re["RSASSA-PSS"]:var r,n;if(r=Re[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||Q.md[r]===void 0){var i=new Error("Unsupported MGF hash function.");throw i.oid=t.signatureParameters.mgf.hash.algorithmOid,i.name=r,i}if(n=Re[t.signatureParameters.mgf.algorithmOid],n===void 0||Q.mgf[n]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=t.signatureParameters.mgf.algorithmOid,i.name=n,i}if(n=Q.mgf[n].create(Q.md[r].create()),r=Re[t.signatureParameters.hash.algorithmOid],r===void 0||Q.md[r]===void 0){var i=new Error("Unsupported RSASSA-PSS hash function.");throw i.oid=t.signatureParameters.hash.algorithmOid,i.name=r,i}a=Q.pss.create(Q.md[r].create(),n,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,a)};F.certificateFromPem=function(e,t,a){var r=Q.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var n=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var i=m.fromDer(r.body,a);return F.certificateFromAsn1(i,t)},F.certificateToPem=function(e,t){var a={type:"CERTIFICATE",body:m.toDer(F.certificateToAsn1(e)).getBytes()};return Q.pem.encode(a,{maxline:t})},F.publicKeyFromPem=function(e){var t=Q.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var a=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=m.fromDer(t.body);return F.publicKeyFromAsn1(r)},F.publicKeyToPem=function(e,t){var a={type:"PUBLIC KEY",body:m.toDer(F.publicKeyToAsn1(e)).getBytes()};return Q.pem.encode(a,{maxline:t})},F.publicKeyToRSAPublicKeyPem=function(e,t){var a={type:"RSA PUBLIC KEY",body:m.toDer(F.publicKeyToRSAPublicKey(e)).getBytes()};return Q.pem.encode(a,{maxline:t})},F.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||Q.md.sha1.create(),r=t.type||"RSAPublicKey",n;switch(r){case"RSAPublicKey":n=m.toDer(F.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":n=m.toDer(F.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}a.start(),a.update(n);var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i},F.certificationRequestFromPem=function(e,t,a){var r=Q.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var n=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var i=m.fromDer(r.body,a);return F.certificationRequestFromAsn1(i,t)},F.certificationRequestToPem=function(e,t){var a={type:"CERTIFICATE REQUEST",body:m.toDer(F.certificationRequestToAsn1(e)).getBytes()};return Q.pem.encode(a,{maxline:t})},F.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return pr(e.issuer,t)},e.issuer.addField=function(t){Dt([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return pr(e.subject,t)},e.subject.addField=function(t){Dt([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,a){Dt(t),e.subject.attributes=t,delete e.subject.uniqueId,a&&(e.subject.uniqueId=a),e.subject.hash=null},e.setIssuer=function(t,a){Dt(t),e.issuer.attributes=t,delete e.issuer.uniqueId,a&&(e.issuer.uniqueId=a),e.issuer.hash=null},e.setExtensions=function(t){for(var a=0;a<t.length;++a)B0(t[a],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var a=null,r,n=0;a===null&&n<e.extensions.length;++n)r=e.extensions[n],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(a=r);return a},e.sign=function(t,a){e.md=a||Q.md.sha1.create();var r=Re[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=F.getTBSCertificate(e);var i=m.toDer(e.tbsCertificate);e.md.update(i.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var a=!1;if(!e.issued(t)){var r=t.issuer,n=e.subject,i=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw i.expectedIssuer=n.attributes,i.actualIssuer=r.attributes,i}var s=t.md;if(s===null){s=hl({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||F.getTBSCertificate(t),c=m.toDer(o);s.update(c.getBytes())}return s!==null&&(a=I0({certificate:e,md:s,signature:t.signature})),a},e.isIssuer=function(t){var a=!1,r=e.issuer,n=t.subject;if(r.hash&&n.hash)a=r.hash===n.hash;else if(r.attributes.length===n.attributes.length){a=!0;for(var i,s,o=0;a&&o<r.attributes.length;++o)i=r.attributes[o],s=n.attributes[o],(i.type!==s.type||i.value!==s.value)&&(a=!1)}return a},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return F.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=Re.subjectKeyIdentifier,a=0;a<e.extensions.length;++a){var r=e.extensions[a];if(r.id===t){var n=e.generateSubjectKeyIdentifier().getBytes();return Q.util.hexToBytes(r.subjectKeyIdentifier)===n}}return!1},e},F.certificateFromAsn1=function(e,t){var a={},r=[];if(!m.validate(e,_C,a,r)){var n=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw n.errors=r,n}var i=m.derToOid(a.publicKeyOid);if(i!==F.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=F.createCertificate();s.version=a.certVersion?a.certVersion.charCodeAt(0):0;var o=Q.util.createBuffer(a.certSerialNumber);s.serialNumber=o.toHex(),s.signatureOid=Q.asn1.derToOid(a.certSignatureOid),s.signatureParameters=fl(s.signatureOid,a.certSignatureParams,!0),s.siginfo.algorithmOid=Q.asn1.derToOid(a.certinfoSignatureOid),s.siginfo.parameters=fl(s.siginfo.algorithmOid,a.certinfoSignatureParams,!1),s.signature=a.certSignature;var c=[];if(a.certValidity1UTCTime!==void 0&&c.push(m.utcTimeToDate(a.certValidity1UTCTime)),a.certValidity2GeneralizedTime!==void 0&&c.push(m.generalizedTimeToDate(a.certValidity2GeneralizedTime)),a.certValidity3UTCTime!==void 0&&c.push(m.utcTimeToDate(a.certValidity3UTCTime)),a.certValidity4GeneralizedTime!==void 0&&c.push(m.generalizedTimeToDate(a.certValidity4GeneralizedTime)),c.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(c.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(s.validity.notBefore=c[0],s.validity.notAfter=c[1],s.tbsCertificate=a.tbsCertificate,t){s.md=hl({signatureOid:s.signatureOid,type:"certificate"});var l=m.toDer(s.tbsCertificate);s.md.update(l.getBytes())}var u=Q.md.sha1.create(),p=m.toDer(a.certIssuer);u.update(p.getBytes()),s.issuer.getField=function(h){return pr(s.issuer,h)},s.issuer.addField=function(h){Dt([h]),s.issuer.attributes.push(h)},s.issuer.attributes=F.RDNAttributesAsArray(a.certIssuer),a.certIssuerUniqueId&&(s.issuer.uniqueId=a.certIssuerUniqueId),s.issuer.hash=u.digest().toHex();var d=Q.md.sha1.create(),g=m.toDer(a.certSubject);return d.update(g.getBytes()),s.subject.getField=function(h){return pr(s.subject,h)},s.subject.addField=function(h){Dt([h]),s.subject.attributes.push(h)},s.subject.attributes=F.RDNAttributesAsArray(a.certSubject),a.certSubjectUniqueId&&(s.subject.uniqueId=a.certSubjectUniqueId),s.subject.hash=d.digest().toHex(),a.certExtensions?s.extensions=F.certificateExtensionsFromAsn1(a.certExtensions):s.extensions=[],s.publicKey=F.publicKeyFromAsn1(a.subjectPublicKeyInfo),s},F.certificateExtensionsFromAsn1=function(e){for(var t=[],a=0;a<e.value.length;++a)for(var r=e.value[a],n=0;n<r.value.length;++n)t.push(F.certificateExtensionFromAsn1(r.value[n]));return t},F.certificateExtensionFromAsn1=function(e){var t={};if(t.id=m.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===m.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in Re){if(t.name=Re[t.id],t.name==="keyUsage"){var a=m.fromDer(t.value),r=0,n=0;a.value.length>1&&(r=a.value.charCodeAt(1),n=a.value.length>2?a.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(n&128)===128}else if(t.name==="basicConstraints"){var a=m.fromDer(t.value);a.value.length>0&&a.value[0].type===m.Type.BOOLEAN?t.cA=a.value[0].value.charCodeAt(0)!==0:t.cA=!1;var i=null;a.value.length>0&&a.value[0].type===m.Type.INTEGER?i=a.value[0].value:a.value.length>1&&(i=a.value[1].value),i!==null&&(t.pathLenConstraint=m.derToInteger(i))}else if(t.name==="extKeyUsage")for(var a=m.fromDer(t.value),s=0;s<a.value.length;++s){var o=m.derToOid(a.value[s].value);o in Re?t[Re[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var a=m.fromDer(t.value),r=0;a.value.length>1&&(r=a.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var c,a=m.fromDer(t.value),l=0;l<a.value.length;++l){c=a.value[l];var u={type:c.type,value:c.value};switch(t.altNames.push(u),c.type){case 1:case 2:case 6:break;case 7:u.ip=Q.util.bytesToIP(c.value);break;case 8:u.oid=m.derToOid(c.value);break}}}else if(t.name==="subjectKeyIdentifier"){var a=m.fromDer(t.value);t.subjectKeyIdentifier=Q.util.bytesToHex(a.value)}}return t},F.certificationRequestFromAsn1=function(e,t){var a={},r=[];if(!m.validate(e,LC,a,r)){var n=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw n.errors=r,n}var i=m.derToOid(a.publicKeyOid);if(i!==F.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=F.createCertificationRequest();if(s.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,s.signatureOid=Q.asn1.derToOid(a.csrSignatureOid),s.signatureParameters=fl(s.signatureOid,a.csrSignatureParams,!0),s.siginfo.algorithmOid=Q.asn1.derToOid(a.csrSignatureOid),s.siginfo.parameters=fl(s.siginfo.algorithmOid,a.csrSignatureParams,!1),s.signature=a.csrSignature,s.certificationRequestInfo=a.certificationRequestInfo,t){s.md=hl({signatureOid:s.signatureOid,type:"certification request"});var o=m.toDer(s.certificationRequestInfo);s.md.update(o.getBytes())}var c=Q.md.sha1.create();return s.subject.getField=function(l){return pr(s.subject,l)},s.subject.addField=function(l){Dt([l]),s.subject.attributes.push(l)},s.subject.attributes=F.RDNAttributesAsArray(a.certificationRequestInfoSubject,c),s.subject.hash=c.digest().toHex(),s.publicKey=F.publicKeyFromAsn1(a.subjectPublicKeyInfo),s.getAttribute=function(l){return pr(s,l)},s.addAttribute=function(l){Dt([l]),s.attributes.push(l)},s.attributes=F.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),s},F.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return pr(e.subject,t)},e.subject.addField=function(t){Dt([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return pr(e,t)},e.addAttribute=function(t){Dt([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){Dt(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){Dt(t),e.attributes=t},e.sign=function(t,a){e.md=a||Q.md.sha1.create();var r=Re[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=F.getCertificationRequestInfo(e);var i=m.toDer(e.certificationRequestInfo);e.md.update(i.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,a=e.md;if(a===null){a=hl({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||F.getCertificationRequestInfo(e),n=m.toDer(r);a.update(n.getBytes())}return a!==null&&(t=I0({certificate:e,md:a,signature:e.signature})),t},e};function ea(e){for(var t=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]),a,r,n=e.attributes,i=0;i<n.length;++i){a=n[i];var s=a.value,o=m.Type.PRINTABLESTRING;"valueTagClass"in a&&(o=a.valueTagClass,o===m.Type.UTF8&&(s=Q.util.encodeUtf8(s))),r=m.create(m.Class.UNIVERSAL,m.Type.SET,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(a.type).getBytes()),m.create(m.Class.UNIVERSAL,o,!1,s)])]),t.value.push(r)}return t}function Dt(e){for(var t,a=0;a<e.length;++a){if(t=e[a],typeof t.name>"u"&&(t.type&&t.type in F.oids?t.name=F.oids[t.type]:t.shortName&&t.shortName in Je&&(t.name=F.oids[Je[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in F.oids)t.type=F.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Je&&(t.shortName=Je[t.name]),t.type===Re.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=m.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(F.certificateExtensionToAsn1(B0(t.extensions[n])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function B0(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in F.oids&&(e.name=F.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in F.oids)e.id=F.oids[e.name];else{var a=new Error("Extension ID not specified.");throw a.extension=e,a}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,n=0,i=0;e.digitalSignature&&(n|=128,r=7),e.nonRepudiation&&(n|=64,r=6),e.keyEncipherment&&(n|=32,r=5),e.dataEncipherment&&(n|=16,r=4),e.keyAgreement&&(n|=8,r=3),e.keyCertSign&&(n|=4,r=2),e.cRLSign&&(n|=2,r=1),e.encipherOnly&&(n|=1,r=0),e.decipherOnly&&(i|=128,r=7);var s=String.fromCharCode(r);i!==0?s+=String.fromCharCode(n)+String.fromCharCode(i):n!==0&&(s+=String.fromCharCode(n)),e.value=m.create(m.Class.UNIVERSAL,m.Type.BITSTRING,!1,s)}else if(e.name==="basicConstraints")e.value=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(m.create(m.Class.UNIVERSAL,m.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,m.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var c in e)e[c]===!0&&(c in Re?o.push(m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(Re[c]).getBytes())):c.indexOf(".")!==-1&&o.push(m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(c).getBytes())))}else if(e.name==="nsCertType"){var r=0,n=0;e.client&&(n|=128,r=7),e.server&&(n|=64,r=6),e.email&&(n|=32,r=5),e.objsign&&(n|=16,r=4),e.reserved&&(n|=8,r=3),e.sslCA&&(n|=4,r=2),e.emailCA&&(n|=2,r=1),e.objCA&&(n|=1,r=0);var s=String.fromCharCode(r);n!==0&&(s+=String.fromCharCode(n)),e.value=m.create(m.Class.UNIVERSAL,m.Type.BITSTRING,!1,s)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]);for(var l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var s=l.value;if(l.type===7&&l.ip){if(s=Q.util.bytesFromIP(l.ip),s===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?s=m.oidToDer(m.oidToDer(l.oid)):s=m.oidToDer(s));e.value.value.push(m.create(m.Class.CONTEXT_SPECIFIC,l.type,!1,s))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=m.create(m.Class.UNIVERSAL,m.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,p.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var d=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(m.create(m.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var g=[m.create(m.Class.CONTEXT_SPECIFIC,4,!0,[ea(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(m.create(m.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var h=Q.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(m.create(m.Class.CONTEXT_SPECIFIC,2,!1,h))}}else if(e.name==="cRLDistributionPoints"){e.value=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]);for(var o=e.value.value,y=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]),b=m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[]),l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var s=l.value;if(l.type===7&&l.ip){if(s=Q.util.bytesFromIP(l.ip),s===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?s=m.oidToDer(m.oidToDer(l.oid)):s=m.oidToDer(s));b.value.push(m.create(m.Class.CONTEXT_SPECIFIC,l.type,!1,s))}y.value.push(m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[b])),o.push(y)}if(typeof e.value>"u"){var a=new Error("Extension value not specified.");throw a.extension=e,a}return e}function Yu(e,t){switch(e){case Re["RSASSA-PSS"]:var a=[];return t.hash.algorithmOid!==void 0&&a.push(m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(t.hash.algorithmOid).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&a.push(m.create(m.Class.CONTEXT_SPECIFIC,1,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(t.mgf.algorithmOid).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(t.mgf.hash.algorithmOid).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&a.push(m.create(m.Class.CONTEXT_SPECIFIC,2,!0,[m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,m.integerToDer(t.saltLength).getBytes())])),m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,a);default:return m.create(m.Class.UNIVERSAL,m.Type.NULL,!1,"")}}function PC(e){var t=m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var a=e.attributes,r=0;r<a.length;++r){var n=a[r],i=n.value,s=m.Type.UTF8;"valueTagClass"in n&&(s=n.valueTagClass),s===m.Type.UTF8&&(i=Q.util.encodeUtf8(i));var o=!1;"valueConstructed"in n&&(o=n.valueConstructed);var c=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(n.type).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.SET,!0,[m.create(m.Class.UNIVERSAL,s,o,i)])]);t.value.push(c)}return t}var OC=new Date("1950-01-01T00:00:00Z"),DC=new Date("2050-01-01T00:00:00Z");function R0(e){return e>=OC&&e<DC?m.create(m.Class.UNIVERSAL,m.Type.UTCTIME,!1,m.dateToUtcTime(e)):m.create(m.Class.UNIVERSAL,m.Type.GENERALIZEDTIME,!1,m.dateToGeneralizedTime(e))}F.getTBSCertificate=function(e){var t=R0(e.validity.notBefore),a=R0(e.validity.notAfter),r=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,m.integerToDer(e.version).getBytes())]),m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,Q.util.hexToBytes(e.serialNumber)),m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(e.siginfo.algorithmOid).getBytes()),Yu(e.siginfo.algorithmOid,e.siginfo.parameters)]),ea(e.issuer),m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[t,a]),ea(e.subject),F.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(m.create(m.Class.CONTEXT_SPECIFIC,1,!0,[m.create(m.Class.UNIVERSAL,m.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(m.create(m.Class.CONTEXT_SPECIFIC,2,!0,[m.create(m.Class.UNIVERSAL,m.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(F.certificateExtensionsToAsn1(e.extensions)),r},F.getCertificationRequestInfo=function(e){var t=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,m.integerToDer(e.version).getBytes()),ea(e.subject),F.publicKeyToAsn1(e.publicKey),PC(e)]);return t},F.distinguishedNameToAsn1=function(e){return ea(e)},F.certificateToAsn1=function(e){var t=e.tbsCertificate||F.getTBSCertificate(e);return m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[t,m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(e.signatureOid).getBytes()),Yu(e.signatureOid,e.signatureParameters)]),m.create(m.Class.UNIVERSAL,m.Type.BITSTRING,!1,"\0"+e.signature)])},F.certificateExtensionsToAsn1=function(e){var t=m.create(m.Class.CONTEXT_SPECIFIC,3,!0,[]),a=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]);t.value.push(a);for(var r=0;r<e.length;++r)a.value.push(F.certificateExtensionToAsn1(e[r]));return t},F.certificateExtensionToAsn1=function(e){var t=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[]);t.value.push(m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(e.id).getBytes())),e.critical&&t.value.push(m.create(m.Class.UNIVERSAL,m.Type.BOOLEAN,!1,"\xFF"));var a=e.value;return typeof e.value!="string"&&(a=m.toDer(a).getBytes()),t.value.push(m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,a)),t},F.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||F.getCertificationRequestInfo(e);return m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[t,m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(e.signatureOid).getBytes()),Yu(e.signatureOid,e.signatureParameters)]),m.create(m.Class.UNIVERSAL,m.Type.BITSTRING,!1,"\0"+e.signature)])},F.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(s){var o=a(s.issuer);return o},t.addCertificate=function(s){if(typeof s=="string"&&(s=Q.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))if(s.subject.hash in t.certs){var o=t.certs[s.subject.hash];Q.util.isArray(o)||(o=[o]),o.push(s),t.certs[s.subject.hash]=o}else t.certs[s.subject.hash]=s},t.hasCertificate=function(s){typeof s=="string"&&(s=Q.pki.certificateFromPem(s));var o=a(s.subject);if(!o)return!1;Q.util.isArray(o)||(o=[o]);for(var c=m.toDer(F.certificateToAsn1(s)).getBytes(),l=0;l<o.length;++l){var u=m.toDer(F.certificateToAsn1(o[l])).getBytes();if(c===u)return!0}return!1},t.listAllCertificates=function(){var s=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var c=t.certs[o];if(!Q.util.isArray(c))s.push(c);else for(var l=0;l<c.length;++l)s.push(c[l])}return s},t.removeCertificate=function(s){var o;if(typeof s=="string"&&(s=Q.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))return null;var c=a(s.subject);if(!Q.util.isArray(c))return o=t.certs[s.subject.hash],delete t.certs[s.subject.hash],o;for(var l=m.toDer(F.certificateToAsn1(s)).getBytes(),u=0;u<c.length;++u){var p=m.toDer(F.certificateToAsn1(c[u])).getBytes();l===p&&(o=c[u],c.splice(u,1))}return c.length===0&&delete t.certs[s.subject.hash],o};function a(s){return r(s),t.certs[s.hash]||null}function r(s){if(!s.hash){var o=Q.md.sha1.create();s.attributes=F.RDNAttributesAsArray(ea(s),o),s.hash=o.digest().toHex()}}if(e)for(var n=0;n<e.length;++n){var i=e[n];t.addCertificate(i)}return t},F.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},F.verifyCertificateChain=function(e,t,a){typeof a=="function"&&(a={verify:a}),a=a||{},t=t.slice(0);var r=t.slice(0),n=a.validityCheckDate;typeof n>"u"&&(n=new Date);var i=!0,s=null,o=0;do{var c=t.shift(),l=null,u=!1;if(n&&(n<c.validity.notBefore||n>c.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:F.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:n}),s===null){if(l=t[0]||e.getIssuer(c),l===null&&c.isIssuer(c)&&(u=!0,l=c),l){var p=l;Q.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){l=p.shift();try{d=l.verify(c)}catch{}}d||(s={message:"Certificate signature is invalid.",error:F.certificateError.bad_certificate})}s===null&&(!l||u)&&!e.hasCertificate(c)&&(s={message:"Certificate is not trusted.",error:F.certificateError.unknown_ca})}if(s===null&&l&&!c.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:F.certificateError.bad_certificate}),s===null)for(var g={keyUsage:!0,basicConstraints:!0},h=0;s===null&&h<c.extensions.length;++h){var y=c.extensions[h];y.critical&&!(y.name in g)&&(s={message:"Certificate has an unsupported critical extension.",error:F.certificateError.unsupported_certificate})}if(s===null&&(!i||t.length===0&&(!l||u))){var b=c.getExtension("basicConstraints"),E=c.getExtension("keyUsage");if(E!==null&&(!E.keyCertSign||b===null)&&(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:F.certificateError.bad_certificate}),s===null&&b===null&&(s={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:F.certificateError.bad_certificate}),s===null&&b!==null&&!b.cA&&(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:F.certificateError.bad_certificate}),s===null&&E!==null&&"pathLenConstraint"in b){var I=o-1;I>b.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:F.certificateError.bad_certificate})}}var R=s===null?!0:s.error,k=a.verify?a.verify(R,o,r):R;if(k===!0)s=null;else throw R===!0&&(s={message:"The application rejected the certificate.",error:F.certificateError.bad_certificate}),(k||k===0)&&(typeof k=="object"&&!Q.util.isArray(k)?(k.message&&(s.message=k.message),k.error&&(s.error=k.error)):typeof k=="string"&&(s.error=k)),s;i=!1,++o}while(t.length>0);return!0};var qe=le,T=qe.asn1,he=qe.pki,gc=qe.pkcs12=qe.pkcs12||{},k0={name:"ContentInfo",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:T.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},FC={name:"PFX",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"version"},k0,{name:"PFX.macData",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:T.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:T.Class.UNIVERSAL,type:T.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:T.Class.UNIVERSAL,type:T.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},qC={name:"SafeBag",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:T.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:T.Class.UNIVERSAL,type:T.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},VC={name:"Attribute",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:T.Class.UNIVERSAL,type:T.Type.SET,constructed:!0,capture:"values"}]},MC={name:"CertBag",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:T.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:T.Class.UNIVERSAL,type:T.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function xc(e,t,a,r){for(var n=[],i=0;i<e.length;i++)for(var s=0;s<e[i].safeBags.length;s++){var o=e[i].safeBags[s];if(!(r!==void 0&&o.type!==r)){if(t===null){n.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(a)>=0&&n.push(o)}}return n}gc.pkcs12FromAsn1=function(e,t,a){typeof t=="string"?(a=t,t=!0):t===void 0&&(t=!0);var r={},n=[];if(!T.validate(e,FC,r,n)){var i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw i.errors=i,i}var s={version:r.version.charCodeAt(0),safeContents:[],getBags:function(b){var E={},I;return"localKeyId"in b?I=b.localKeyId:"localKeyIdHex"in b&&(I=qe.util.hexToBytes(b.localKeyIdHex)),I===void 0&&!("friendlyName"in b)&&"bagType"in b&&(E[b.bagType]=xc(s.safeContents,null,null,b.bagType)),I!==void 0&&(E.localKeyId=xc(s.safeContents,"localKeyId",I,b.bagType)),"friendlyName"in b&&(E.friendlyName=xc(s.safeContents,"friendlyName",b.friendlyName,b.bagType)),E},getBagsByFriendlyName:function(b,E){return xc(s.safeContents,"friendlyName",b,E)},getBagsByLocalKeyId:function(b,E){return xc(s.safeContents,"localKeyId",b,E)}};if(r.version.charCodeAt(0)!==3){var i=new Error("PKCS#12 PFX of version other than 3 not supported.");throw i.version=r.version.charCodeAt(0),i}if(T.derToOid(r.contentType)!==he.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=T.derToOid(r.contentType),i}var o=r.content.value[0];if(o.tagClass!==T.Class.UNIVERSAL||o.type!==T.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Ju(o),r.mac){var c=null,l=0,u=T.derToOid(r.macAlgorithm);switch(u){case he.oids.sha1:c=qe.md.sha1.create(),l=20;break;case he.oids.sha256:c=qe.md.sha256.create(),l=32;break;case he.oids.sha384:c=qe.md.sha384.create(),l=48;break;case he.oids.sha512:c=qe.md.sha512.create(),l=64;break;case he.oids.md5:c=qe.md.md5.create(),l=16;break}if(c===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+u);var p=new qe.util.ByteBuffer(r.macSalt),d="macIterations"in r?parseInt(qe.util.bytesToHex(r.macIterations),16):1,g=gc.generateKey(a,p,3,d,l,c),h=qe.hmac.create();h.start(c,g),h.update(o.value);var y=h.getMac();if(y.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return jC(s,o.value,t,a),s};function Ju(e){if(e.composed||e.constructed){for(var t=qe.util.createBuffer(),a=0;a<e.value.length;++a)t.putBytes(e.value[a].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function jC(e,t,a,r){if(t=T.fromDer(t,a),t.tagClass!==T.Class.UNIVERSAL||t.type!==T.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var n=0;n<t.value.length;n++){var i=t.value[n],s={},o=[];if(!T.validate(i,k0,s,o)){var c=new Error("Cannot read ContentInfo.");throw c.errors=o,c}var l={encrypted:!1},u=null,p=s.content.value[0];switch(T.derToOid(s.contentType)){case he.oids.data:if(p.tagClass!==T.Class.UNIVERSAL||p.type!==T.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");u=Ju(p).value;break;case he.oids.encryptedData:u=KC(p,r),l.encrypted=!0;break;default:var c=new Error("Unsupported PKCS#12 contentType.");throw c.contentType=T.derToOid(s.contentType),c}l.safeBags=zC(u,a,r),e.safeContents.push(l)}}function KC(e,t){var a={},r=[];if(!T.validate(e,qe.pkcs7.asn1.encryptedDataValidator,a,r)){var n=new Error("Cannot read EncryptedContentInfo.");throw n.errors=r,n}var i=T.derToOid(a.contentType);if(i!==he.oids.data){var n=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw n.oid=i,n}i=T.derToOid(a.encAlgorithm);var s=he.pbe.getCipher(i,a.encParameter,t),o=Ju(a.encryptedContentAsn1),c=qe.util.createBuffer(o.value);if(s.update(c),!s.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return s.output.getBytes()}function zC(e,t,a){if(!t&&e.length===0)return[];if(e=T.fromDer(e,t),e.tagClass!==T.Class.UNIVERSAL||e.type!==T.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],n=0;n<e.value.length;n++){var i=e.value[n],s={},o=[];if(!T.validate(i,qC,s,o)){var c=new Error("Cannot read SafeBag.");throw c.errors=o,c}var l={type:T.derToOid(s.bagId),attributes:HC(s.bagAttributes)};r.push(l);var u,p,d=s.bagValue.value[0];switch(l.type){case he.oids.pkcs8ShroudedKeyBag:if(d=he.decryptPrivateKeyInfo(d,a),d===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case he.oids.keyBag:try{l.key=he.privateKeyFromAsn1(d)}catch{l.key=null,l.asn1=d}continue;case he.oids.certBag:u=MC,p=function(){if(T.derToOid(s.certId)!==he.oids.x509Certificate){var h=new Error("Unsupported certificate type, only X.509 supported.");throw h.oid=T.derToOid(s.certId),h}var y=T.fromDer(s.cert,t);try{l.cert=he.certificateFromAsn1(y,!0)}catch{l.cert=null,l.asn1=y}};break;default:var c=new Error("Unsupported PKCS#12 SafeBag type.");throw c.oid=l.type,c}if(u!==void 0&&!T.validate(d,u,s,o)){var c=new Error("Cannot read PKCS#12 "+u.name);throw c.errors=o,c}p()}return r}function HC(e){var t={};if(e!==void 0)for(var a=0;a<e.length;++a){var r={},n=[];if(!T.validate(e[a],VC,r,n)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=n,i}var s=T.derToOid(r.oid);if(he.oids[s]!==void 0){t[he.oids[s]]=[];for(var o=0;o<r.values.length;++o)t[he.oids[s]].push(r.values[o].value)}}return t}gc.toPkcs12Asn1=function(e,t,a,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var n=r.localKeyId,i;if(n!==null)n=qe.util.hexToBytes(n);else if(r.generateLocalKeyId)if(t){var s=qe.util.isArray(t)?t[0]:t;typeof s=="string"&&(s=he.certificateFromPem(s));var o=qe.md.sha1.create();o.update(T.toDer(he.certificateToAsn1(s)).getBytes()),n=o.digest().getBytes()}else n=qe.random.getBytes(20);var c=[];n!==null&&c.push(T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.localKeyId).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,n)])])),"friendlyName"in r&&c.push(T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.friendlyName).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[T.create(T.Class.UNIVERSAL,T.Type.BMPSTRING,!1,r.friendlyName)])])),c.length>0&&(i=T.create(T.Class.UNIVERSAL,T.Type.SET,!0,c));var l=[],u=[];t!==null&&(qe.util.isArray(t)?u=t:u=[t]);for(var p=[],d=0;d<u.length;++d){t=u[d],typeof t=="string"&&(t=he.certificateFromPem(t));var g=d===0?i:void 0,h=he.certificateToAsn1(t),y=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.certBag).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.x509Certificate).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,T.toDer(h).getBytes())])])]),g]);p.push(y)}if(p.length>0){var b=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,p),E=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.data).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,T.toDer(b).getBytes())])]);l.push(E)}var I=null;if(e!==null){var R=he.wrapRsaPrivateKey(he.privateKeyToAsn1(e));a===null?I=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.keyBag).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[R]),i]):I=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.pkcs8ShroudedKeyBag).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[he.encryptPrivateKeyInfo(R,a,r)]),i]);var k=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[I]),U=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.data).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,T.toDer(k).getBytes())])]);l.push(U)}var L=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,l),q;if(r.useMac){var o=qe.md.sha1.create(),H=new qe.util.ByteBuffer(qe.random.getBytes(r.saltSize)),Y=r.count,e=gc.generateKey(a,H,3,Y,20),ve=qe.hmac.create();ve.start(o,e),ve.update(T.toDer(L).getBytes());var Ae=ve.getMac();q=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.sha1).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")]),T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,Ae.getBytes())]),T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,H.getBytes()),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(Y).getBytes())])}return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(3).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(he.oids.data).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,T.toDer(L).getBytes())])]),q])},gc.generateKey=qe.pbe.generatePkcs12Key;var dr=le,Zu=dr.asn1,ta=dr.pki=dr.pki||{};ta.pemToDer=function(e){var t=dr.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return dr.util.createBuffer(t.body)},ta.privateKeyFromPem=function(e){var t=dr.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=Zu.fromDer(t.body);return ta.privateKeyFromAsn1(r)},ta.privateKeyToPem=function(e,t){var a={type:"RSA PRIVATE KEY",body:Zu.toDer(ta.privateKeyToAsn1(e)).getBytes()};return dr.pem.encode(a,{maxline:t})},ta.privateKeyInfoToPem=function(e,t){var a={type:"PRIVATE KEY",body:Zu.toDer(e).getBytes()};return dr.pem.encode(a,{maxline:t})};var P=le,ml=function(e,t,a,r){var n=P.util.createBuffer(),i=e.length>>1,s=i+(e.length&1),o=e.substr(0,s),c=e.substr(i,s),l=P.util.createBuffer(),u=P.hmac.create();a=t+a;var p=Math.ceil(r/16),d=Math.ceil(r/20);u.start("MD5",o);var g=P.util.createBuffer();l.putBytes(a);for(var h=0;h<p;++h)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+a),g.putBuffer(u.digest());u.start("SHA1",c);var y=P.util.createBuffer();l.clear(),l.putBytes(a);for(var h=0;h<d;++h)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+a),y.putBuffer(u.digest());return n.putBytes(P.util.xorBytes(g.getBytes(),y.getBytes(),r)),n},$C=function(e,t,a){var r=P.hmac.create();r.start("SHA1",e);var n=P.util.createBuffer();return n.putInt32(t[0]),n.putInt32(t[1]),n.putByte(a.type),n.putByte(a.version.major),n.putByte(a.version.minor),n.putInt16(a.length),n.putBytes(a.fragment.bytes()),r.update(n.getBytes()),r.digest().getBytes()},GC=function(e,t,a){var r=!1;try{var n=e.deflate(t.fragment.getBytes());t.fragment=P.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},WC=function(e,t,a){var r=!1;try{var n=e.inflate(t.fragment.getBytes());t.fragment=P.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},kt=function(e,t){var a=0;switch(t){case 1:a=e.getByte();break;case 2:a=e.getInt16();break;case 3:a=e.getInt24();break;case 4:a=e.getInt32();break}return P.util.createBuffer(e.getBytes(a))},Ft=function(e,t,a){e.putInt(a.length(),t<<3),e.putBuffer(a)},x={};x.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},x.SupportedVersions=[x.Versions.TLS_1_1,x.Versions.TLS_1_0],x.Version=x.SupportedVersions[0],x.MaxFragment=15360,x.ConnectionEnd={server:0,client:1},x.PRFAlgorithm={tls_prf_sha256:0},x.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},x.CipherType={stream:0,block:1,aead:2},x.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},x.CompressionMethod={none:0,deflate:1},x.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},x.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},x.Alert={},x.Alert.Level={warning:1,fatal:2},x.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},x.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},x.CipherSuites={},x.getCipherSuite=function(e){var t=null;for(var a in x.CipherSuites){var r=x.CipherSuites[a];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t},x.handleUnexpected=function(e,t){var a=!e.open&&e.entity===x.ConnectionEnd.client;a||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.unexpected_message}})},x.handleHelloRequest=function(e,t,a){!e.handshaking&&e.handshakes>0&&(x.queue(e,x.createAlert(e,{level:x.Alert.Level.warning,description:x.Alert.Description.no_renegotiation})),x.flush(e)),e.process()},x.parseHelloMessage=function(e,t,a){var r=null,n=e.entity===x.ConnectionEnd.client;if(a<38)e.error(e,{message:n?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.illegal_parameter}});else{var i=t.fragment,s=i.length();if(r={version:{major:i.getByte(),minor:i.getByte()},random:P.util.createBuffer(i.getBytes(32)),session_id:kt(i,1),extensions:[]},n?(r.cipher_suite=i.getBytes(2),r.compression_method=i.getByte()):(r.cipher_suites=kt(i,2),r.compression_methods=kt(i,1)),s=a-(s-i.length()),s>0){for(var o=kt(i,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:kt(o,2)});if(!n)for(var c=0;c<r.extensions.length;++c){var l=r.extensions[c];if(l.type[0]===0&&l.type[1]===0)for(var u=kt(l.data,2);u.length()>0;){var p=u.getByte();if(p!==0)break;e.session.extensions.server_name.serverNameList.push(kt(u,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.protocol_version}});if(n)e.session.cipherSuite=x.getCipherSuite(r.cipher_suite);else for(var d=P.util.createBuffer(r.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=x.getCipherSuite(d.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.handshake_failure},cipherSuite:P.util.bytesToHex(r.cipher_suite)});n?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=x.CompressionMethod.none}return r},x.createSecurityParameters=function(e,t){var a=e.entity===x.ConnectionEnd.client,r=t.random.bytes(),n=a?e.session.sp.client_random:r,i=a?r:x.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:x.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:n,server_random:i}},x.handleServerHello=function(e,t,a){var r=x.parseHelloMessage(e,t,a);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.protocol_version}});e.session.version=e.version;var n=r.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=U0,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=QC,e.session.resuming=!1,x.createSecurityParameters(e,r)),e.session.id=n,e.process()}},x.handleClientHello=function(e,t,a){var r=x.parseHelloMessage(e,t,a);if(!e.fail){var n=r.session_id.bytes(),i=null;if(e.sessionCache&&(i=e.sessionCache.getSession(n),i===null?n="":(i.version.major!==r.version.major||i.version.minor>r.version.minor)&&(i=null,n="")),n.length===0&&(n=P.random.getBytes(32)),e.session.id=n,e.session.clientHelloVersion=r.version,e.session.sp={},i)e.version=e.session.version=i.version,e.session.sp=i.sp;else{for(var s,o=1;o<x.SupportedVersions.length&&(s=x.SupportedVersions[o],!(s.minor<=r.version.minor));++o);e.version={major:s.major,minor:s.minor},e.session.version=e.version}i!==null?(e.expect=tp,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?aT:ep,e.session.resuming=!1,x.createSecurityParameters(e,r)),e.open=!0,x.queue(e,x.createRecord(e,{type:x.ContentType.handshake,data:x.createServerHello(e)})),e.session.resuming?(x.queue(e,x.createRecord(e,{type:x.ContentType.change_cipher_spec,data:x.createChangeCipherSpec()})),e.state.pending=x.createConnectionState(e),e.state.current.write=e.state.pending.write,x.queue(e,x.createRecord(e,{type:x.ContentType.handshake,data:x.createFinished(e)}))):(x.queue(e,x.createRecord(e,{type:x.ContentType.handshake,data:x.createCertificate(e)})),e.fail||(x.queue(e,x.createRecord(e,{type:x.ContentType.handshake,data:x.createServerKeyExchange(e)})),e.verifyClient!==!1&&x.queue(e,x.createRecord(e,{type:x.ContentType.handshake,data:x.createCertificateRequest(e)})),x.queue(e,x.createRecord(e,{type:x.ContentType.handshake,data:x.createServerHelloDone(e)})))),x.flush(e),e.process()}},x.handleCertificate=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_list:kt(r,3)},i,s,o=[];try{for(;n.certificate_list.length()>0;)i=kt(n.certificate_list,3),s=P.asn1.fromDer(i),i=P.pki.certificateFromAsn1(s,!0),o.push(i)}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.bad_certificate}})}var c=e.entity===x.ConnectionEnd.client;(c||e.verifyClient===!0)&&o.length===0?e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.illegal_parameter}}):o.length===0?e.expect=c?_0:ep:(c?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],x.verifyCertificateChain(e,o)&&(e.expect=c?_0:ep)),e.process()},x.handleServerKeyExchange=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.unsupported_certificate}});e.expect=YC,e.process()},x.handleClientKeyExchange=function(e,t,a){if(a<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.unsupported_certificate}});var r=t.fragment,n={enc_pre_master_secret:kt(r,2).getBytes()},i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.serverCertificate),i=P.pki.privateKeyFromPem(i)}catch(c){e.error(e,{message:"Could not get private key.",cause:c,send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.internal_error}})}if(i===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=i.decrypt(n.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==s.pre_master_secret.charCodeAt(0)||o.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{s.pre_master_secret=P.random.getBytes(48)}e.expect=tp,e.session.clientCertificate!==null&&(e.expect=nT),e.process()},x.handleCertificateRequest=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_types:kt(r,1),certificate_authorities:kt(r,2)};e.session.certificateRequest=n,e.expect=JC,e.process()},x.handleCertificateVerify=function(e,t,a){if(a<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var i={signature:kt(r,2).getBytes()},s=P.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(s,i.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(n),e.session.sha1.update(n)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.handshake_failure}})}e.expect=tp,e.process()},x.handleServerHelloDone=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.insufficient_security}},n=0,i=e.verify(e,r.alert.description,n,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!P.util.isArray(i)?(i.message&&(r.message=i.message),i.alert&&(r.alert.description=i.alert)):typeof i=="number"&&(r.alert.description=i)),e.error(e,r)}e.session.certificateRequest!==null&&(t=x.createRecord(e,{type:x.ContentType.handshake,data:x.createCertificate(e)}),x.queue(e,t)),t=x.createRecord(e,{type:x.ContentType.handshake,data:x.createClientKeyExchange(e)}),x.queue(e,t),e.expect=tT;var s=function(o,c){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&x.queue(o,x.createRecord(o,{type:x.ContentType.handshake,data:x.createCertificateVerify(o,c)})),x.queue(o,x.createRecord(o,{type:x.ContentType.change_cipher_spec,data:x.createChangeCipherSpec()})),o.state.pending=x.createConnectionState(o),o.state.current.write=o.state.pending.write,x.queue(o,x.createRecord(o,{type:x.ContentType.handshake,data:x.createFinished(o)})),o.expect=U0,x.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return s(e,null);x.getClientSignature(e,s)},x.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.illegal_parameter}});var a=e.entity===x.ConnectionEnd.client;(e.session.resuming&&a||!e.session.resuming&&!a)&&(e.state.pending=x.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&a||e.session.resuming&&!a)&&(e.state.pending=null),e.expect=a?ZC:sT,e.process()},x.handleFinished=function(e,t,a){var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var i=t.fragment.getBytes();r=P.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var s=e.entity===x.ConnectionEnd.client,o=s?"server finished":"client finished",c=e.session.sp,l=12,u=ml;if(r=u(c.master_secret,o,r.getBytes(),l),r.getBytes()!==i)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.decrypt_error}});e.session.md5.update(n),e.session.sha1.update(n),(e.session.resuming&&s||!e.session.resuming&&!s)&&(x.queue(e,x.createRecord(e,{type:x.ContentType.change_cipher_spec,data:x.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,x.queue(e,x.createRecord(e,{type:x.ContentType.handshake,data:x.createFinished(e)}))),e.expect=s?eT:iT,e.handshaking=!1,++e.handshakes,e.peerCertificate=s?e.session.serverCertificate:e.session.clientCertificate,x.flush(e),e.isConnected=!0,e.connected(e),e.process()},x.handleAlert=function(e,t){var a=t.fragment,r={level:a.getByte(),description:a.getByte()},n;switch(r.description){case x.Alert.Description.close_notify:n="Connection closed.";break;case x.Alert.Description.unexpected_message:n="Unexpected message.";break;case x.Alert.Description.bad_record_mac:n="Bad record MAC.";break;case x.Alert.Description.decryption_failed:n="Decryption failed.";break;case x.Alert.Description.record_overflow:n="Record overflow.";break;case x.Alert.Description.decompression_failure:n="Decompression failed.";break;case x.Alert.Description.handshake_failure:n="Handshake failure.";break;case x.Alert.Description.bad_certificate:n="Bad certificate.";break;case x.Alert.Description.unsupported_certificate:n="Unsupported certificate.";break;case x.Alert.Description.certificate_revoked:n="Certificate revoked.";break;case x.Alert.Description.certificate_expired:n="Certificate expired.";break;case x.Alert.Description.certificate_unknown:n="Certificate unknown.";break;case x.Alert.Description.illegal_parameter:n="Illegal parameter.";break;case x.Alert.Description.unknown_ca:n="Unknown certificate authority.";break;case x.Alert.Description.access_denied:n="Access denied.";break;case x.Alert.Description.decode_error:n="Decode error.";break;case x.Alert.Description.decrypt_error:n="Decrypt error.";break;case x.Alert.Description.export_restriction:n="Export restriction.";break;case x.Alert.Description.protocol_version:n="Unsupported protocol version.";break;case x.Alert.Description.insufficient_security:n="Insufficient security.";break;case x.Alert.Description.internal_error:n="Internal error.";break;case x.Alert.Description.user_canceled:n="User canceled.";break;case x.Alert.Description.no_renegotiation:n="Renegotiation not supported.";break;default:n="Unknown error.";break}if(r.description===x.Alert.Description.close_notify)return e.close();e.error(e,{message:n,send:!1,origin:e.entity===x.ConnectionEnd.client?"server":"client",alert:r}),e.process()},x.handleHandshake=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt24();if(n>a.length())return e.fragmented=t,t.fragment=P.util.createBuffer(),a.read-=4,e.process();e.fragmented=null,a.read-=4;var i=a.bytes(n+4);a.read+=4,r in gl[e.entity][e.expect]?(e.entity===x.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:P.md.md5.create(),sha1:P.md.sha1.create()}),r!==x.HandshakeType.hello_request&&r!==x.HandshakeType.certificate_verify&&r!==x.HandshakeType.finished&&(e.session.md5.update(i),e.session.sha1.update(i)),gl[e.entity][e.expect][r](e,t,n)):x.handleUnexpected(e,t)},x.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},x.handleHeartbeat=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt16(),i=a.getBytes(n);if(r===x.HeartbeatMessageType.heartbeat_request){if(e.handshaking||n>i.length)return e.process();x.queue(e,x.createRecord(e,{type:x.ContentType.heartbeat,data:x.createHeartbeat(x.HeartbeatMessageType.heartbeat_response,i)})),x.flush(e)}else if(r===x.HeartbeatMessageType.heartbeat_response){if(i!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,P.util.createBuffer(i))}e.process()};var XC=0,QC=1,_0=2,YC=3,JC=4,U0=5,ZC=6,eT=7,tT=8,rT=0,aT=1,ep=2,nT=3,tp=4,sT=5,iT=6,v=x.handleUnexpected,N0=x.handleChangeCipherSpec,ut=x.handleAlert,Tt=x.handleHandshake,L0=x.handleApplicationData,pt=x.handleHeartbeat,rp=[];rp[x.ConnectionEnd.client]=[[v,ut,Tt,v,pt],[v,ut,Tt,v,pt],[v,ut,Tt,v,pt],[v,ut,Tt,v,pt],[v,ut,Tt,v,pt],[N0,ut,v,v,pt],[v,ut,Tt,v,pt],[v,ut,Tt,L0,pt],[v,ut,Tt,v,pt]],rp[x.ConnectionEnd.server]=[[v,ut,Tt,v,pt],[v,ut,Tt,v,pt],[v,ut,Tt,v,pt],[v,ut,Tt,v,pt],[N0,ut,v,v,pt],[v,ut,Tt,v,pt],[v,ut,Tt,L0,pt],[v,ut,Tt,v,pt]];var fr=x.handleHelloRequest,oT=x.handleServerHello,P0=x.handleCertificate,O0=x.handleServerKeyExchange,ap=x.handleCertificateRequest,vl=x.handleServerHelloDone,D0=x.handleFinished,gl=[];gl[x.ConnectionEnd.client]=[[v,v,oT,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[fr,v,v,v,v,v,v,v,v,v,v,P0,O0,ap,vl,v,v,v,v,v,v],[fr,v,v,v,v,v,v,v,v,v,v,v,O0,ap,vl,v,v,v,v,v,v],[fr,v,v,v,v,v,v,v,v,v,v,v,v,ap,vl,v,v,v,v,v,v],[fr,v,v,v,v,v,v,v,v,v,v,v,v,v,vl,v,v,v,v,v,v],[fr,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[fr,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,D0],[fr,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[fr,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v]];var cT=x.handleClientHello,lT=x.handleClientKeyExchange,uT=x.handleCertificateVerify;gl[x.ConnectionEnd.server]=[[v,cT,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,P0,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,lT,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,uT,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,D0],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v]],x.generateKeys=function(e,t){var a=ml,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=a(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var n=2*t.mac_key_length+2*t.enc_key_length,i=e.version.major===x.Versions.TLS_1_0.major&&e.version.minor===x.Versions.TLS_1_0.minor;i&&(n+=2*t.fixed_iv_length);var s=a(t.master_secret,"key expansion",r,n),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return i&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o},x.createConnectionState=function(e){var t=e.entity===x.ConnectionEnd.client,a=function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(s){return!0},compressionState:null,compressFunction:function(s){return!0},updateSequenceNumber:function(){i.sequenceNumber[1]===4294967295?(i.sequenceNumber[1]=0,++i.sequenceNumber[0]):++i.sequenceNumber[1]}};return i},r={read:a(),write:a()};if(r.read.update=function(i,s){return r.read.cipherFunction(s,r.read)?r.read.compressFunction(i,s,r.read)||i.error(i,{message:"Could not decompress record.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.bad_record_mac}}),!i.fail},r.write.update=function(i,s){return r.write.compressFunction(i,s,r.write)?r.write.cipherFunction(s,r.write)||i.error(i,{message:"Could not encrypt record.",send:!1,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.internal_error}}),!i.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=x.generateKeys(e,n),r.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,r.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,n),n.compression_algorithm){case x.CompressionMethod.none:break;case x.CompressionMethod.deflate:r.read.compressFunction=WC,r.write.compressFunction=GC;break;default:throw new Error("Unsupported compression algorithm.")}}return r},x.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,a=P.util.createBuffer();return a.putInt32(t),a.putBytes(P.random.getBytes(28)),a},x.createRecord=function(e,t){if(!t.data)return null;var a={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return a},x.createAlert=function(e,t){var a=P.util.createBuffer();return a.putByte(t.level),a.putByte(t.description),x.createRecord(e,{type:x.ContentType.alert,data:a})},x.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=P.util.createBuffer(),a=0;a<e.cipherSuites.length;++a){var r=e.cipherSuites[a];t.putByte(r.id[0]),t.putByte(r.id[1])}var n=t.length(),i=P.util.createBuffer();i.putByte(x.CompressionMethod.none);var s=i.length(),o=P.util.createBuffer();if(e.virtualHost){var c=P.util.createBuffer();c.putByte(0),c.putByte(0);var l=P.util.createBuffer();l.putByte(0),Ft(l,2,P.util.createBuffer(e.virtualHost));var u=P.util.createBuffer();Ft(u,2,l),Ft(c,2,u),o.putBuffer(c)}var p=o.length();p>0&&(p+=2);var d=e.session.id,g=d.length+1+2+4+28+2+n+1+s+p,h=P.util.createBuffer();return h.putByte(x.HandshakeType.client_hello),h.putInt24(g),h.putByte(e.version.major),h.putByte(e.version.minor),h.putBytes(e.session.sp.client_random),Ft(h,1,P.util.createBuffer(d)),Ft(h,2,t),Ft(h,1,i),p>0&&Ft(h,2,o),h},x.createServerHello=function(e){var t=e.session.id,a=t.length+1+2+4+28+2+1,r=P.util.createBuffer();return r.putByte(x.HandshakeType.server_hello),r.putInt24(a),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),Ft(r,1,P.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r},x.createCertificate=function(e){var t=e.entity===x.ConnectionEnd.client,a=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,a=e.getCertificate(e,r)}var n=P.util.createBuffer();if(a!==null)try{P.util.isArray(a)||(a=[a]);for(var i=null,s=0;s<a.length;++s){var o=P.pem.decode(a[s])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=o.type,c}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=P.util.createBuffer(o.body);i===null&&(i=P.asn1.fromDer(l.bytes(),!1));var u=P.util.createBuffer();Ft(u,3,l),n.putBuffer(u)}a=P.pki.certificateFromAsn1(i),t?e.session.clientCertificate=a:e.session.serverCertificate=a}catch(g){return e.error(e,{message:"Could not send certificate list.",cause:g,send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.bad_certificate}})}var p=3+n.length(),d=P.util.createBuffer();return d.putByte(x.HandshakeType.certificate),d.putInt24(p),Ft(d,3,n),d},x.createClientKeyExchange=function(e){var t=P.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(P.random.getBytes(46));var a=e.session.sp;a.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(a.pre_master_secret);var n=t.length+2,i=P.util.createBuffer();return i.putByte(x.HandshakeType.client_key_exchange),i.putInt24(n),i.putInt16(t.length),i.putBytes(t),i},x.createServerKeyExchange=function(e){var t=P.util.createBuffer();return t},x.getClientSignature=function(e,t){var a=P.util.createBuffer();a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest()),a=a.getBytes(),e.getSignature=e.getSignature||function(r,n,i){var s=null;if(r.getPrivateKey)try{s=r.getPrivateKey(r,r.session.clientCertificate),s=P.pki.privateKeyFromPem(s)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.internal_error}})}s===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.internal_error}}):n=s.sign(n,null),i(r,n)},e.getSignature(e,a,t)},x.createCertificateVerify=function(e,t){var a=t.length+2,r=P.util.createBuffer();return r.putByte(x.HandshakeType.certificate_verify),r.putInt24(a),r.putInt16(t.length),r.putBytes(t),r},x.createCertificateRequest=function(e){var t=P.util.createBuffer();t.putByte(1);var a=P.util.createBuffer();for(var r in e.caStore.certs){var n=e.caStore.certs[r],i=P.pki.distinguishedNameToAsn1(n.subject),s=P.asn1.toDer(i);a.putInt16(s.length()),a.putBuffer(s)}var o=1+t.length()+2+a.length(),c=P.util.createBuffer();return c.putByte(x.HandshakeType.certificate_request),c.putInt24(o),Ft(c,1,t),Ft(c,2,a),c},x.createServerHelloDone=function(e){var t=P.util.createBuffer();return t.putByte(x.HandshakeType.server_hello_done),t.putInt24(0),t},x.createChangeCipherSpec=function(){var e=P.util.createBuffer();return e.putByte(1),e},x.createFinished=function(e){var t=P.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var a=e.entity===x.ConnectionEnd.client,r=e.session.sp,n=12,i=ml,s=a?"client finished":"server finished";t=i(r.master_secret,s,t.getBytes(),n);var o=P.util.createBuffer();return o.putByte(x.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},x.createHeartbeat=function(e,t,a){typeof a>"u"&&(a=t.length);var r=P.util.createBuffer();r.putByte(e),r.putInt16(a),r.putBytes(t);var n=r.length(),i=Math.max(16,n-a-3);return r.putBytes(P.random.getBytes(i)),r},x.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===x.ContentType.handshake||t.type===x.ContentType.alert||t.type===x.ContentType.change_cipher_spec))){if(t.type===x.ContentType.handshake){var a=t.fragment.bytes();e.session.md5.update(a),e.session.sha1.update(a),a=null}var r;if(t.fragment.length()<=x.MaxFragment)r=[t];else{r=[];for(var n=t.fragment.bytes();n.length>x.MaxFragment;)r.push(x.createRecord(e,{type:t.type,data:P.util.createBuffer(n.slice(0,x.MaxFragment))})),n=n.slice(x.MaxFragment);n.length>0&&r.push(x.createRecord(e,{type:t.type,data:P.util.createBuffer(n)}))}for(var i=0;i<r.length&&!e.fail;++i){var s=r[i],o=e.state.current.write;o.update(e,s)&&e.records.push(s)}}},x.flush=function(e){for(var t=0;t<e.records.length;++t){var a=e.records[t];e.tlsData.putByte(a.type),e.tlsData.putByte(a.version.major),e.tlsData.putByte(a.version.minor),e.tlsData.putInt16(a.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var np=function(e){switch(e){case!0:return!0;case P.pki.certificateError.bad_certificate:return x.Alert.Description.bad_certificate;case P.pki.certificateError.unsupported_certificate:return x.Alert.Description.unsupported_certificate;case P.pki.certificateError.certificate_revoked:return x.Alert.Description.certificate_revoked;case P.pki.certificateError.certificate_expired:return x.Alert.Description.certificate_expired;case P.pki.certificateError.certificate_unknown:return x.Alert.Description.certificate_unknown;case P.pki.certificateError.unknown_ca:return x.Alert.Description.unknown_ca;default:return x.Alert.Description.bad_certificate}},pT=function(e){switch(e){case!0:return!0;case x.Alert.Description.bad_certificate:return P.pki.certificateError.bad_certificate;case x.Alert.Description.unsupported_certificate:return P.pki.certificateError.unsupported_certificate;case x.Alert.Description.certificate_revoked:return P.pki.certificateError.certificate_revoked;case x.Alert.Description.certificate_expired:return P.pki.certificateError.certificate_expired;case x.Alert.Description.certificate_unknown:return P.pki.certificateError.certificate_unknown;case x.Alert.Description.unknown_ca:return P.pki.certificateError.unknown_ca;default:return P.pki.certificateError.bad_certificate}};x.verifyCertificateChain=function(e,t){try{var a={};for(var r in e.verifyOptions)a[r]=e.verifyOptions[r];a.verify=function(i,s,o){var c=np(i),l=e.verify(e,i,s,o);if(l!==!0){if(typeof l=="object"&&!P.util.isArray(l)){var u=new Error("The application rejected the certificate.");throw u.send=!0,u.alert={level:x.Alert.Level.fatal,description:x.Alert.Description.bad_certificate},l.message&&(u.message=l.message),l.alert&&(u.alert.description=l.alert),u}l!==i&&(l=pT(l))}return l},P.pki.verifyCertificateChain(e.caStore,t,a)}catch(i){var n=i;(typeof n!="object"||P.util.isArray(n))&&(n={send:!0,alert:{level:x.Alert.Level.fatal,description:np(i)}}),"send"in n||(n.send=!0),"alert"in n||(n.alert={level:x.Alert.Level.fatal,description:np(n.error)}),e.error(e,n)}return!e.fail},x.createSessionCache=function(e,t){var a=null;if(e&&e.getSession&&e.setSession&&e.order)a=e;else{a={},a.cache=e||{},a.capacity=Math.max(t||100,1),a.order=[];for(var r in e)a.order.length<=t?a.order.push(r):delete e[r];a.getSession=function(n){var i=null,s=null;if(n?s=P.util.bytesToHex(n):a.order.length>0&&(s=a.order[0]),s!==null&&s in a.cache){i=a.cache[s],delete a.cache[s];for(var o in a.order)if(a.order[o]===s){a.order.splice(o,1);break}}return i},a.setSession=function(n,i){if(a.order.length===a.capacity){var s=a.order.shift();delete a.cache[s]}var s=P.util.bytesToHex(n);a.order.push(s),a.cache[s]=i}}return a},x.createConnection=function(e){var t=null;e.caStore?P.util.isArray(e.caStore)?t=P.pki.createCaStore(e.caStore):t=e.caStore:t=P.pki.createCaStore();var a=e.cipherSuites||null;if(a===null){a=[];for(var r in x.CipherSuites)a.push(x.CipherSuites[r])}var n=e.server?x.ConnectionEnd.server:x.ConnectionEnd.client,i=e.sessionCache?x.createSessionCache(e.sessionCache):null,s={version:{major:x.Version.major,minor:x.Version.minor},entity:n,sessionId:e.sessionId,caStore:t,sessionCache:i,cipherSuites:a,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(u,p,d,g){return p},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:P.util.createBuffer(),tlsData:P.util.createBuffer(),data:P.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(u,p){p.origin=p.origin||(u.entity===x.ConnectionEnd.client?"client":"server"),p.send&&(x.queue(u,x.createAlert(u,p.alert)),x.flush(u));var d=p.fatal!==!1;d&&(u.fail=!0),e.error(u,p),d&&u.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};s.reset=function(u){s.version={major:x.Version.major,minor:x.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=s.entity===x.ConnectionEnd.client?XC:rT,s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(u||typeof u>"u"),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=x.createConnectionState(s)},s.reset();var o=function(u,p){var d=p.type-x.ContentType.change_cipher_spec,g=rp[u.entity][u.expect];d in g?g[d](u,p):x.handleUnexpected(u,p)},c=function(u){var p=0,d=u.input,g=d.length();if(g<5)p=5-g;else{u.record={type:d.getByte(),version:{major:d.getByte(),minor:d.getByte()},length:d.getInt16(),fragment:P.util.createBuffer(),ready:!1};var h=u.record.version.major===u.version.major;h&&u.session&&u.session.version&&(h=u.record.version.minor===u.version.minor),h||u.error(u,{message:"Incompatible TLS version.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.protocol_version}})}return p},l=function(u){var p=0,d=u.input,g=d.length();if(g<u.record.length)p=u.record.length-g;else{u.record.fragment.putBytes(d.getBytes(u.record.length)),d.compact();var h=u.state.current.read;h.update(u,u.record)&&(u.fragmented!==null&&(u.fragmented.type===u.record.type?(u.fragmented.fragment.putBuffer(u.record.fragment),u.record=u.fragmented):u.error(u,{message:"Invalid fragmented record.",send:!0,alert:{level:x.Alert.Level.fatal,description:x.Alert.Description.unexpected_message}})),u.record.ready=!0)}return p};return s.handshake=function(u){if(s.entity!==x.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&s.handshakes===0&&(s.fail=!1),s.handshaking=!0,u=u||"";var p=null;u.length>0&&(s.sessionCache&&(p=s.sessionCache.getSession(u)),p===null&&(u="")),u.length===0&&s.sessionCache&&(p=s.sessionCache.getSession(),p!==null&&(u=p.id)),s.session={id:u,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:P.md.md5.create(),sha1:P.md.sha1.create()},p&&(s.version=p.version,s.session.sp=p.sp),s.session.sp.client_random=x.createRandom().getBytes(),s.open=!0,x.queue(s,x.createRecord(s,{type:x.ContentType.handshake,data:x.createClientHello(s)})),x.flush(s)}},s.process=function(u){var p=0;return u&&s.input.putBytes(u),s.fail||(s.record!==null&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),s.record===null&&(p=c(s)),!s.fail&&s.record!==null&&!s.record.ready&&(p=l(s)),!s.fail&&s.record!==null&&s.record.ready&&o(s,s.record)),p},s.prepare=function(u){return x.queue(s,x.createRecord(s,{type:x.ContentType.application_data,data:P.util.createBuffer(u)})),x.flush(s)},s.prepareHeartbeatRequest=function(u,p){return u instanceof P.util.ByteBuffer&&(u=u.bytes()),typeof p>"u"&&(p=u.length),s.expectedHeartbeatPayload=u,x.queue(s,x.createRecord(s,{type:x.ContentType.heartbeat,data:x.createHeartbeat(x.HeartbeatMessageType.heartbeat_request,u,p)})),x.flush(s)},s.close=function(u){if(!s.fail&&s.sessionCache&&s.session){var p={id:s.session.id,version:s.session.version,sp:s.session.sp};p.sp.keys=null,s.sessionCache.setSession(p.id,p)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,x.queue(s,x.createAlert(s,{level:x.Alert.Level.warning,description:x.Alert.Description.close_notify})),x.flush(s)),s.closed(s)),s.reset(u)},s},P.tls=P.tls||{};for(var sp in x)typeof x[sp]!="function"&&(P.tls[sp]=x[sp]);P.tls.prf_tls1=ml,P.tls.hmac_sha1=$C,P.tls.createSessionCache=x.createSessionCache,P.tls.createConnection=x.createConnection;var hr=le,qt=hr.tls;qt.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=qt.BulkCipherAlgorithm.aes,e.cipher_type=qt.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=qt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:F0},qt.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=qt.BulkCipherAlgorithm.aes,e.cipher_type=qt.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=qt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:F0};function F0(e,t,a){var r=t.entity===hr.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:hr.cipher.createDecipher("AES-CBC",r?a.keys.server_write_key:a.keys.client_write_key),iv:r?a.keys.server_write_IV:a.keys.client_write_IV},e.write.cipherState={init:!1,cipher:hr.cipher.createCipher("AES-CBC",r?a.keys.client_write_key:a.keys.server_write_key),iv:r?a.keys.client_write_IV:a.keys.server_write_IV},e.read.cipherFunction=mT,e.write.cipherFunction=dT,e.read.macLength=e.write.macLength=a.mac_length,e.read.macFunction=e.write.macFunction=qt.hmac_sha1}function dT(e,t){var a=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var n;e.version.minor===qt.Versions.TLS_1_0.minor?n=t.cipherState.init?null:t.cipherState.iv:n=hr.random.getBytesSync(16),t.cipherState.init=!0;var i=t.cipherState.cipher;return i.start({iv:n}),e.version.minor>=qt.Versions.TLS_1_1.minor&&i.output.putBytes(n),i.update(e.fragment),i.finish(fT)&&(e.fragment=i.output,e.length=e.fragment.length(),a=!0),a}function fT(e,t,a){if(!a){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function hT(e,t,a){var r=!0;if(a){for(var n=t.length(),i=t.last(),s=n-1-i;s<n-1;++s)r=r&&t.at(s)==i;r&&t.truncate(i+1)}return r}function mT(e,t){var a=!1,r;e.version.minor===qt.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var n=t.cipherState.cipher;n.start({iv:r}),n.update(e.fragment),a=n.finish(hT);var i=t.macLength,s=hr.random.getBytesSync(i),o=n.output.length();o>=i?(e.fragment=n.output.getBytes(o-i),s=n.output.getBytes(i)):e.fragment=n.output.getBytes(),e.fragment=hr.util.createBuffer(e.fragment),e.length=e.fragment.length();var c=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),a=vT(t.macKey,s,c)&&a,a}function vT(e,t,a){var r=hr.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(a),a=r.digest().getBytes(),t===a}var je=le,yc=je.sha512=je.sha512||{};je.md.sha512=je.md.algorithms.sha512=yc;var q0=je.sha384=je.sha512.sha384=je.sha512.sha384||{};q0.create=function(){return yc.create("SHA-384")},je.md.sha384=je.md.algorithms.sha384=q0,je.sha512.sha256=je.sha512.sha256||{create:function(){return yc.create("SHA-512/256")}},je.md["sha512/256"]=je.md.algorithms["sha512/256"]=je.sha512.sha256,je.sha512.sha224=je.sha512.sha224||{create:function(){return yc.create("SHA-512/224")}},je.md["sha512/224"]=je.md.algorithms["sha512/224"]=je.sha512.sha224,yc.create=function(e){if(V0||gT(),typeof e>"u"&&(e="SHA-512"),!(e in Lr))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Lr[e],a=null,r=je.util.createBuffer(),n=new Array(80),i=0;i<80;++i)n[i]=new Array(2);var s=64;switch(e){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var c=o.messageLengthSize/4,l=0;l<c;++l)o.fullMessageLength.push(0);r=je.util.createBuffer(),a=new Array(t.length);for(var l=0;l<t.length;++l)a[l]=t[l].slice(0);return o},o.start(),o.update=function(c,l){l==="utf8"&&(c=je.util.encodeUtf8(c));var u=c.length;o.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var p=o.fullMessageLength.length-1;p>=0;--p)o.fullMessageLength[p]+=u[1],u[1]=u[0]+(o.fullMessageLength[p]/4294967296>>>0),o.fullMessageLength[p]=o.fullMessageLength[p]>>>0,u[0]=u[1]/4294967296>>>0;return r.putBytes(c),M0(a,n,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var c=je.util.createBuffer();c.putBytes(r.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=l&o.blockLength-1;c.putBytes(ip.substr(0,o.blockLength-u));for(var p,d,g=o.fullMessageLength[0]*8,h=0;h<o.fullMessageLength.length-1;++h)p=o.fullMessageLength[h+1]*8,d=p/4294967296>>>0,g+=d,c.putInt32(g>>>0),g=p>>>0;c.putInt32(g);for(var y=new Array(a.length),h=0;h<a.length;++h)y[h]=a[h].slice(0);M0(y,n,c);var b=je.util.createBuffer(),E;e==="SHA-512"?E=y.length:e==="SHA-384"?E=y.length-2:E=y.length-4;for(var h=0;h<E;++h)b.putInt32(y[h][0]),(h!==E-1||e!=="SHA-512/224")&&b.putInt32(y[h][1]);return b},o};var ip=null,V0=!1,op=null,Lr=null;function gT(){ip="\x80",ip+=je.util.fillString("\0",128),op=[[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]],Lr={},Lr["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Lr["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Lr["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Lr["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],V0=!0}function M0(e,t,a){for(var r,n,i,s,o,c,l,u,p,d,g,h,y,b,E,I,R,k,U,L,q,H,Y,ve,Ae,ke,Ke,Ve,Ue,ie,G,tt,ze,Pe,ue,j=a.length();j>=128;){for(Ue=0;Ue<16;++Ue)t[Ue][0]=a.getInt32()>>>0,t[Ue][1]=a.getInt32()>>>0;for(;Ue<80;++Ue)tt=t[Ue-2],ie=tt[0],G=tt[1],r=((ie>>>19|G<<13)^(G>>>29|ie<<3)^ie>>>6)>>>0,n=((ie<<13|G>>>19)^(G<<3|ie>>>29)^(ie<<26|G>>>6))>>>0,Pe=t[Ue-15],ie=Pe[0],G=Pe[1],i=((ie>>>1|G<<31)^(ie>>>8|G<<24)^ie>>>7)>>>0,s=((ie<<31|G>>>1)^(ie<<24|G>>>8)^(ie<<25|G>>>7))>>>0,ze=t[Ue-7],ue=t[Ue-16],G=n+ze[1]+s+ue[1],t[Ue][0]=r+ze[0]+i+ue[0]+(G/4294967296>>>0)>>>0,t[Ue][1]=G>>>0;for(y=e[0][0],b=e[0][1],E=e[1][0],I=e[1][1],R=e[2][0],k=e[2][1],U=e[3][0],L=e[3][1],q=e[4][0],H=e[4][1],Y=e[5][0],ve=e[5][1],Ae=e[6][0],ke=e[6][1],Ke=e[7][0],Ve=e[7][1],Ue=0;Ue<80;++Ue)l=((q>>>14|H<<18)^(q>>>18|H<<14)^(H>>>9|q<<23))>>>0,u=((q<<18|H>>>14)^(q<<14|H>>>18)^(H<<23|q>>>9))>>>0,p=(Ae^q&(Y^Ae))>>>0,d=(ke^H&(ve^ke))>>>0,o=((y>>>28|b<<4)^(b>>>2|y<<30)^(b>>>7|y<<25))>>>0,c=((y<<4|b>>>28)^(b<<30|y>>>2)^(b<<25|y>>>7))>>>0,g=(y&E|R&(y^E))>>>0,h=(b&I|k&(b^I))>>>0,G=Ve+u+d+op[Ue][1]+t[Ue][1],r=Ke+l+p+op[Ue][0]+t[Ue][0]+(G/4294967296>>>0)>>>0,n=G>>>0,G=c+h,i=o+g+(G/4294967296>>>0)>>>0,s=G>>>0,Ke=Ae,Ve=ke,Ae=Y,ke=ve,Y=q,ve=H,G=L+n,q=U+r+(G/4294967296>>>0)>>>0,H=G>>>0,U=R,L=k,R=E,k=I,E=y,I=b,G=n+s,y=r+i+(G/4294967296>>>0)>>>0,b=G>>>0;G=e[0][1]+b,e[0][0]=e[0][0]+y+(G/4294967296>>>0)>>>0,e[0][1]=G>>>0,G=e[1][1]+I,e[1][0]=e[1][0]+E+(G/4294967296>>>0)>>>0,e[1][1]=G>>>0,G=e[2][1]+k,e[2][0]=e[2][0]+R+(G/4294967296>>>0)>>>0,e[2][1]=G>>>0,G=e[3][1]+L,e[3][0]=e[3][0]+U+(G/4294967296>>>0)>>>0,e[3][1]=G>>>0,G=e[4][1]+H,e[4][0]=e[4][0]+q+(G/4294967296>>>0)>>>0,e[4][1]=G>>>0,G=e[5][1]+ve,e[5][0]=e[5][0]+Y+(G/4294967296>>>0)>>>0,e[5][1]=G>>>0,G=e[6][1]+ke,e[6][0]=e[6][0]+Ae+(G/4294967296>>>0)>>>0,e[6][1]=G>>>0,G=e[7][1]+Ve,e[7][0]=e[7][0]+Ke+(G/4294967296>>>0)>>>0,e[7][1]=G>>>0,j-=128}}var cp={},xT=le,ct=xT.asn1;cp.privateKeyValidator={name:"PrivateKeyInfo",tagClass:ct.Class.UNIVERSAL,type:ct.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:ct.Class.UNIVERSAL,type:ct.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:ct.Class.UNIVERSAL,type:ct.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ct.Class.UNIVERSAL,type:ct.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:ct.Class.UNIVERSAL,type:ct.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},cp.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:ct.Class.UNIVERSAL,type:ct.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:ct.Class.UNIVERSAL,type:ct.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ct.Class.UNIVERSAL,type:ct.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:ct.Class.UNIVERSAL,type:ct.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var dt=le,j0=cp,yT=j0.publicKeyValidator,bT=j0.privateKeyValidator;if(typeof ET>"u")var ET=dt.jsbn.BigInteger;var lp=dt.util.ByteBuffer,Rt=typeof Buffer>"u"?Uint8Array:Buffer;dt.pki=dt.pki||{},dt.pki.ed25519=dt.ed25519=dt.ed25519||{};var me=dt.ed25519;me.constants={},me.constants.PUBLIC_KEY_BYTE_LENGTH=32,me.constants.PRIVATE_KEY_BYTE_LENGTH=64,me.constants.SEED_BYTE_LENGTH=32,me.constants.SIGN_BYTE_LENGTH=64,me.constants.HASH_BYTE_LENGTH=64,me.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=dt.random.getBytesSync(me.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==me.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+me.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=rr({message:t,encoding:"binary"});for(var a=new Rt(me.constants.PUBLIC_KEY_BYTE_LENGTH),r=new Rt(me.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)r[n]=t[n];return wT(a,r),{publicKey:a,privateKey:r}},me.privateKeyFromAsn1=function(e){var t={},a=[],r=dt.asn1.validate(e,bT,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var i=dt.asn1.derToOid(t.privateKeyOid),s=dt.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.privateKey,c=rr({message:dt.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:c}},me.publicKeyFromAsn1=function(e){var t={},a=[],r=dt.asn1.validate(e,yT,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var i=dt.asn1.derToOid(t.publicKeyOid),s=dt.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.ed25519PublicKey;if(o.length!==me.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return rr({message:o,encoding:"binary"})},me.publicKeyFromPrivateKey=function(e){e=e||{};var t=rr({message:e.privateKey,encoding:"binary"});if(t.length!==me.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+me.constants.PRIVATE_KEY_BYTE_LENGTH);for(var a=new Rt(me.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<a.length;++r)a[r]=t[32+r];return a},me.sign=function(e){e=e||{};var t=rr(e),a=rr({message:e.privateKey,encoding:"binary"});if(a.length===me.constants.SEED_BYTE_LENGTH){var r=me.generateKeyPair({seed:a});a=r.privateKey}else if(a.length!==me.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+me.constants.SEED_BYTE_LENGTH+" or "+me.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new Rt(me.constants.SIGN_BYTE_LENGTH+t.length);AT(n,t,t.length,a);for(var i=new Rt(me.constants.SIGN_BYTE_LENGTH),s=0;s<i.length;++s)i[s]=n[s];return i},me.verify=function(e){e=e||{};var t=rr(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var a=rr({message:e.signature,encoding:"binary"});if(a.length!==me.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+me.constants.SIGN_BYTE_LENGTH);var r=rr({message:e.publicKey,encoding:"binary"});if(r.length!==me.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+me.constants.PUBLIC_KEY_BYTE_LENGTH);var n=new Rt(me.constants.SIGN_BYTE_LENGTH+t.length),i=new Rt(me.constants.SIGN_BYTE_LENGTH+t.length),s;for(s=0;s<me.constants.SIGN_BYTE_LENGTH;++s)n[s]=a[s];for(s=0;s<t.length;++s)n[s+me.constants.SIGN_BYTE_LENGTH]=t[s];return IT(i,n,n.length,r)>=0};function rr(e){var t=e.message;if(t instanceof Uint8Array||t instanceof Rt)return t;var a=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),a="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!a)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,a);t=new lp(t,a)}else if(!(t instanceof lp))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new Rt(t.length()),n=0;n<r.length;++n)r[n]=t.at(n);return r}var up=Z(),xl=Z([1]),CT=Z([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),TT=Z([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),K0=Z([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),z0=Z([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),bc=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),ST=Z([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ec(e,t){var a=dt.md.sha512.create(),r=new lp(e);a.update(r.getBytes(t),"binary");var n=a.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(n,"binary");for(var i=new Rt(me.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)i[s]=n.charCodeAt(s);return i}function wT(e,t){var a=[Z(),Z(),Z(),Z()],r,n=Ec(t,32);for(n[0]&=248,n[31]&=127,n[31]|=64,hp(a,n),fp(e,a),r=0;r<32;++r)t[r+32]=e[r];return 0}function AT(e,t,a,r){var n,i,s=new Float64Array(64),o=[Z(),Z(),Z(),Z()],c=Ec(r,32);c[0]&=248,c[31]&=127,c[31]|=64;var l=a+64;for(n=0;n<a;++n)e[64+n]=t[n];for(n=0;n<32;++n)e[32+n]=c[32+n];var u=Ec(e.subarray(32),a+32);for(pp(u),hp(o,u),fp(e,o),n=32;n<64;++n)e[n]=r[n];var p=Ec(e,a+64);for(pp(p),n=32;n<64;++n)s[n]=0;for(n=0;n<32;++n)s[n]=u[n];for(n=0;n<32;++n)for(i=0;i<32;i++)s[n+i]+=p[n]*c[i];return H0(e.subarray(32),s),l}function IT(e,t,a,r){var n,i,s=new Rt(32),o=[Z(),Z(),Z(),Z()],c=[Z(),Z(),Z(),Z()];if(i=-1,a<64||RT(c,r)||!BT(t,32))return-1;for(n=0;n<a;++n)e[n]=t[n];for(n=0;n<32;++n)e[n+32]=r[n];var l=Ec(e,a);if(pp(l),Q0(o,c,l),hp(c,t.subarray(32)),dp(o,c),fp(s,o),a-=64,W0(t,0,s,0)){for(n=0;n<a;++n)e[n]=0;return-1}for(n=0;n<a;++n)e[n]=t[n+64];return i=a,i}function BT(e,t){var a;for(a=31;a>=0;--a){if(e[t+a]<bc[a])return!0;if(e[t+a]>bc[a])return!1}return!1}function H0(e,t){var a,r,n,i;for(r=63;r>=32;--r){for(a=0,n=r-32,i=r-12;n<i;++n)t[n]+=a-16*t[r]*bc[n-(r-32)],a=t[n]+128>>8,t[n]-=a*256;t[n]+=a,t[r]=0}for(a=0,n=0;n<32;++n)t[n]+=a-(t[31]>>4)*bc[n],a=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=a*bc[n];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function pp(e){for(var t=new Float64Array(64),a=0;a<64;++a)t[a]=e[a],e[a]=0;H0(e,t)}function dp(e,t){var a=Z(),r=Z(),n=Z(),i=Z(),s=Z(),o=Z(),c=Z(),l=Z(),u=Z();aa(a,e[1],e[0]),aa(u,t[1],t[0]),Oe(a,a,u),ra(r,e[0],e[1]),ra(u,t[0],t[1]),Oe(r,r,u),Oe(n,e[3],t[3]),Oe(n,n,TT),Oe(i,e[2],t[2]),ra(i,i,i),aa(s,r,a),aa(o,i,n),ra(c,i,n),ra(l,r,a),Oe(e[0],s,o),Oe(e[1],l,c),Oe(e[2],c,o),Oe(e[3],s,l)}function $0(e,t,a){for(var r=0;r<4;++r)Y0(e[r],t[r],a)}function fp(e,t){var a=Z(),r=Z(),n=Z();NT(n,t[2]),Oe(a,t[0],n),Oe(r,t[1],n),yl(e,r),e[31]^=X0(a)<<7}function yl(e,t){var a,r,n,i=Z(),s=Z();for(a=0;a<16;++a)s[a]=t[a];for(mp(s),mp(s),mp(s),r=0;r<2;++r){for(i[0]=s[0]-65517,a=1;a<15;++a)i[a]=s[a]-65535-(i[a-1]>>16&1),i[a-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),n=i[15]>>16&1,i[14]&=65535,Y0(s,i,1-n)}for(a=0;a<16;a++)e[2*a]=s[a]&255,e[2*a+1]=s[a]>>8}function RT(e,t){var a=Z(),r=Z(),n=Z(),i=Z(),s=Z(),o=Z(),c=Z();return mr(e[2],xl),kT(e[1],t),Pr(n,e[1]),Oe(i,n,CT),aa(n,n,e[2]),ra(i,e[2],i),Pr(s,i),Pr(o,s),Oe(c,o,s),Oe(a,c,n),Oe(a,a,i),_T(a,a),Oe(a,a,n),Oe(a,a,i),Oe(a,a,i),Oe(e[0],a,i),Pr(r,e[0]),Oe(r,r,i),G0(r,n)&&Oe(e[0],e[0],ST),Pr(r,e[0]),Oe(r,r,i),G0(r,n)?-1:(X0(e[0])===t[31]>>7&&aa(e[0],up,e[0]),Oe(e[3],e[0],e[1]),0)}function kT(e,t){var a;for(a=0;a<16;++a)e[a]=t[2*a]+(t[2*a+1]<<8);e[15]&=32767}function _T(e,t){var a=Z(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)Pr(a,a),r!==1&&Oe(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function G0(e,t){var a=new Rt(32),r=new Rt(32);return yl(a,e),yl(r,t),W0(a,0,r,0)}function W0(e,t,a,r){return UT(e,t,a,r,32)}function UT(e,t,a,r,n){var i,s=0;for(i=0;i<n;++i)s|=e[t+i]^a[r+i];return(1&s-1>>>8)-1}function X0(e){var t=new Rt(32);return yl(t,e),t[0]&1}function Q0(e,t,a){var r,n;for(mr(e[0],up),mr(e[1],xl),mr(e[2],xl),mr(e[3],up),n=255;n>=0;--n)r=a[n/8|0]>>(n&7)&1,$0(e,t,r),dp(t,e),dp(e,e),$0(e,t,r)}function hp(e,t){var a=[Z(),Z(),Z(),Z()];mr(a[0],K0),mr(a[1],z0),mr(a[2],xl),Oe(a[3],K0,z0),Q0(e,a,t)}function mr(e,t){var a;for(a=0;a<16;a++)e[a]=t[a]|0}function NT(e,t){var a=Z(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)Pr(a,a),r!==2&&r!==4&&Oe(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function mp(e){var t,a,r=1;for(t=0;t<16;++t)a=e[t]+r+65535,r=Math.floor(a/65536),e[t]=a-r*65536;e[0]+=r-1+37*(r-1)}function Y0(e,t,a){for(var r,n=~(a-1),i=0;i<16;++i)r=n&(e[i]^t[i]),e[i]^=r,t[i]^=r}function Z(e){var t,a=new Float64Array(16);if(e)for(t=0;t<e.length;++t)a[t]=e[t];return a}function ra(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]+a[r]}function aa(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]-a[r]}function Pr(e,t){Oe(e,t,t)}function Oe(e,t,a){var r,n,i=0,s=0,o=0,c=0,l=0,u=0,p=0,d=0,g=0,h=0,y=0,b=0,E=0,I=0,R=0,k=0,U=0,L=0,q=0,H=0,Y=0,ve=0,Ae=0,ke=0,Ke=0,Ve=0,Ue=0,ie=0,G=0,tt=0,ze=0,Pe=a[0],ue=a[1],j=a[2],V=a[3],ee=a[4],ce=a[5],se=a[6],Ne=a[7],De=a[8],pe=a[9],$e=a[10],Xe=a[11],we=a[12],rt=a[13],ft=a[14],ht=a[15];r=t[0],i+=r*Pe,s+=r*ue,o+=r*j,c+=r*V,l+=r*ee,u+=r*ce,p+=r*se,d+=r*Ne,g+=r*De,h+=r*pe,y+=r*$e,b+=r*Xe,E+=r*we,I+=r*rt,R+=r*ft,k+=r*ht,r=t[1],s+=r*Pe,o+=r*ue,c+=r*j,l+=r*V,u+=r*ee,p+=r*ce,d+=r*se,g+=r*Ne,h+=r*De,y+=r*pe,b+=r*$e,E+=r*Xe,I+=r*we,R+=r*rt,k+=r*ft,U+=r*ht,r=t[2],o+=r*Pe,c+=r*ue,l+=r*j,u+=r*V,p+=r*ee,d+=r*ce,g+=r*se,h+=r*Ne,y+=r*De,b+=r*pe,E+=r*$e,I+=r*Xe,R+=r*we,k+=r*rt,U+=r*ft,L+=r*ht,r=t[3],c+=r*Pe,l+=r*ue,u+=r*j,p+=r*V,d+=r*ee,g+=r*ce,h+=r*se,y+=r*Ne,b+=r*De,E+=r*pe,I+=r*$e,R+=r*Xe,k+=r*we,U+=r*rt,L+=r*ft,q+=r*ht,r=t[4],l+=r*Pe,u+=r*ue,p+=r*j,d+=r*V,g+=r*ee,h+=r*ce,y+=r*se,b+=r*Ne,E+=r*De,I+=r*pe,R+=r*$e,k+=r*Xe,U+=r*we,L+=r*rt,q+=r*ft,H+=r*ht,r=t[5],u+=r*Pe,p+=r*ue,d+=r*j,g+=r*V,h+=r*ee,y+=r*ce,b+=r*se,E+=r*Ne,I+=r*De,R+=r*pe,k+=r*$e,U+=r*Xe,L+=r*we,q+=r*rt,H+=r*ft,Y+=r*ht,r=t[6],p+=r*Pe,d+=r*ue,g+=r*j,h+=r*V,y+=r*ee,b+=r*ce,E+=r*se,I+=r*Ne,R+=r*De,k+=r*pe,U+=r*$e,L+=r*Xe,q+=r*we,H+=r*rt,Y+=r*ft,ve+=r*ht,r=t[7],d+=r*Pe,g+=r*ue,h+=r*j,y+=r*V,b+=r*ee,E+=r*ce,I+=r*se,R+=r*Ne,k+=r*De,U+=r*pe,L+=r*$e,q+=r*Xe,H+=r*we,Y+=r*rt,ve+=r*ft,Ae+=r*ht,r=t[8],g+=r*Pe,h+=r*ue,y+=r*j,b+=r*V,E+=r*ee,I+=r*ce,R+=r*se,k+=r*Ne,U+=r*De,L+=r*pe,q+=r*$e,H+=r*Xe,Y+=r*we,ve+=r*rt,Ae+=r*ft,ke+=r*ht,r=t[9],h+=r*Pe,y+=r*ue,b+=r*j,E+=r*V,I+=r*ee,R+=r*ce,k+=r*se,U+=r*Ne,L+=r*De,q+=r*pe,H+=r*$e,Y+=r*Xe,ve+=r*we,Ae+=r*rt,ke+=r*ft,Ke+=r*ht,r=t[10],y+=r*Pe,b+=r*ue,E+=r*j,I+=r*V,R+=r*ee,k+=r*ce,U+=r*se,L+=r*Ne,q+=r*De,H+=r*pe,Y+=r*$e,ve+=r*Xe,Ae+=r*we,ke+=r*rt,Ke+=r*ft,Ve+=r*ht,r=t[11],b+=r*Pe,E+=r*ue,I+=r*j,R+=r*V,k+=r*ee,U+=r*ce,L+=r*se,q+=r*Ne,H+=r*De,Y+=r*pe,ve+=r*$e,Ae+=r*Xe,ke+=r*we,Ke+=r*rt,Ve+=r*ft,Ue+=r*ht,r=t[12],E+=r*Pe,I+=r*ue,R+=r*j,k+=r*V,U+=r*ee,L+=r*ce,q+=r*se,H+=r*Ne,Y+=r*De,ve+=r*pe,Ae+=r*$e,ke+=r*Xe,Ke+=r*we,Ve+=r*rt,Ue+=r*ft,ie+=r*ht,r=t[13],I+=r*Pe,R+=r*ue,k+=r*j,U+=r*V,L+=r*ee,q+=r*ce,H+=r*se,Y+=r*Ne,ve+=r*De,Ae+=r*pe,ke+=r*$e,Ke+=r*Xe,Ve+=r*we,Ue+=r*rt,ie+=r*ft,G+=r*ht,r=t[14],R+=r*Pe,k+=r*ue,U+=r*j,L+=r*V,q+=r*ee,H+=r*ce,Y+=r*se,ve+=r*Ne,Ae+=r*De,ke+=r*pe,Ke+=r*$e,Ve+=r*Xe,Ue+=r*we,ie+=r*rt,G+=r*ft,tt+=r*ht,r=t[15],k+=r*Pe,U+=r*ue,L+=r*j,q+=r*V,H+=r*ee,Y+=r*ce,ve+=r*se,Ae+=r*Ne,ke+=r*De,Ke+=r*pe,Ve+=r*$e,Ue+=r*Xe,ie+=r*we,G+=r*rt,tt+=r*ft,ze+=r*ht,i+=38*U,s+=38*L,o+=38*q,c+=38*H,l+=38*Y,u+=38*ve,p+=38*Ae,d+=38*ke,g+=38*Ke,h+=38*Ve,y+=38*Ue,b+=38*ie,E+=38*G,I+=38*tt,R+=38*ze,n=1,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=p+n+65535,n=Math.floor(r/65536),p=r-n*65536,r=d+n+65535,n=Math.floor(r/65536),d=r-n*65536,r=g+n+65535,n=Math.floor(r/65536),g=r-n*65536,r=h+n+65535,n=Math.floor(r/65536),h=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=b+n+65535,n=Math.floor(r/65536),b=r-n*65536,r=E+n+65535,n=Math.floor(r/65536),E=r-n*65536,r=I+n+65535,n=Math.floor(r/65536),I=r-n*65536,r=R+n+65535,n=Math.floor(r/65536),R=r-n*65536,r=k+n+65535,n=Math.floor(r/65536),k=r-n*65536,i+=n-1+37*(n-1),n=1,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=p+n+65535,n=Math.floor(r/65536),p=r-n*65536,r=d+n+65535,n=Math.floor(r/65536),d=r-n*65536,r=g+n+65535,n=Math.floor(r/65536),g=r-n*65536,r=h+n+65535,n=Math.floor(r/65536),h=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=b+n+65535,n=Math.floor(r/65536),b=r-n*65536,r=E+n+65535,n=Math.floor(r/65536),E=r-n*65536,r=I+n+65535,n=Math.floor(r/65536),I=r-n*65536,r=R+n+65535,n=Math.floor(r/65536),R=r-n*65536,r=k+n+65535,n=Math.floor(r/65536),k=r-n*65536,i+=n-1+37*(n-1),e[0]=i,e[1]=s,e[2]=o,e[3]=c,e[4]=l,e[5]=u,e[6]=p,e[7]=d,e[8]=g,e[9]=h,e[10]=y,e[11]=b,e[12]=E,e[13]=I,e[14]=R,e[15]=k}var _t=le;_t.kem=_t.kem||{};var J0=_t.jsbn.BigInteger;_t.kem.rsa={},_t.kem.rsa.create=function(e,t){t=t||{};var a=t.prng||_t.random,r={};return r.encrypt=function(n,i){var s=Math.ceil(n.n.bitLength()/8),o;do o=new J0(_t.util.bytesToHex(a.getBytesSync(s)),16).mod(n.n);while(o.compareTo(J0.ONE)<=0);o=_t.util.hexToBytes(o.toString(16));var c=s-o.length;c>0&&(o=_t.util.fillString("\0",c)+o);var l=n.encrypt(o,"NONE"),u=e.generate(o,i);return{encapsulation:l,key:u}},r.decrypt=function(n,i,s){var o=n.decrypt(i,"NONE");return e.generate(o,s)},r},_t.kem.kdf1=function(e,t){Z0(this,e,0,t||e.digestLength)},_t.kem.kdf2=function(e,t){Z0(this,e,1,t||e.digestLength)};function Z0(e,t,a,r){e.generate=function(n,i){for(var s=new _t.util.ByteBuffer,o=Math.ceil(i/r)+a,c=new _t.util.ByteBuffer,l=a;l<o;++l){c.putInt32(l),t.start(),t.update(n+c.getBytes());var u=t.digest();s.putBytes(u.getBytes(r))}return s.truncate(s.length()-i),s.getBytes()}}var Se=le;Se.log=Se.log||{},Se.log.levels=["none","error","warning","info","debug","verbose","max"];var bl={},vp=[],Cc=null;Se.log.LEVEL_LOCKED=2,Se.log.NO_LEVEL_CHECK=4,Se.log.INTERPOLATE=8;for(var vr=0;vr<Se.log.levels.length;++vr){var eh=Se.log.levels[vr];bl[eh]={index:vr,name:eh.toUpperCase()}}Se.log.logMessage=function(e){for(var t=bl[e.level].index,a=0;a<vp.length;++a){var r=vp[a];if(r.flags&Se.log.NO_LEVEL_CHECK)r.f(e);else{var n=bl[r.level].index;t<=n&&r.f(r,e)}}},Se.log.prepareStandard=function(e){"standard"in e||(e.standard=bl[e.level].name+" ["+e.category+"] "+e.message)},Se.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=Se.util.format.apply(this,t)}},Se.log.prepareStandardFull=function(e){"standardFull"in e||(Se.log.prepareStandard(e),e.standardFull=e.standard)};for(var th=["error","warning","info","debug","verbose"],vr=0;vr<th.length;++vr)(function(t){Se.log[t]=function(a,r){var n=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:t,category:a,message:r,arguments:n};Se.log.logMessage(i)}})(th[vr]);if(Se.log.makeLogger=function(e){var t={flags:0,f:e};return Se.log.setLevel(t,"none"),t},Se.log.setLevel=function(e,t){var a=!1;if(e&&!(e.flags&Se.log.LEVEL_LOCKED))for(var r=0;r<Se.log.levels.length;++r){var n=Se.log.levels[r];if(t==n){e.level=t,a=!0;break}}return a},Se.log.lock=function(e,t){typeof t>"u"||t?e.flags|=Se.log.LEVEL_LOCKED:e.flags&=~Se.log.LEVEL_LOCKED},Se.log.addLogger=function(e){vp.push(e)},typeof console<"u"&&"log"in console){var Tc;if(console.error&&console.warn&&console.info&&console.debug){var LT={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},bp=function(e,t){Se.log.prepareStandard(t);var a=LT[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),a.apply(console,r)};Tc=Se.log.makeLogger(bp)}else{var bp=function(t,a){Se.log.prepareStandardFull(a),console.log(a.standardFull)};Tc=Se.log.makeLogger(bp)}Se.log.setLevel(Tc,"debug"),Se.log.addLogger(Tc),Cc=Tc}else console={log:function(){}};if(Cc!==null&&typeof window<"u"&&window.location){var El=new URL(window.location.href).searchParams;if(El.has("console.level")&&Se.log.setLevel(Cc,El.get("console.level").slice(-1)[0]),El.has("console.lock")){var PT=El.get("console.lock").slice(-1)[0];PT=="true"&&Se.log.lock(Cc)}}Se.log.consoleLogger=Cc;var M=le,S=M.asn1,St=M.pkcs7=M.pkcs7||{};St.messageFromPem=function(e){var t=M.pem.decode(e)[0];if(t.type!=="PKCS7"){var a=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=S.fromDer(t.body);return St.messageFromAsn1(r)},St.messageToPem=function(e,t){var a={type:"PKCS7",body:S.toDer(e.toAsn1()).getBytes()};return M.pem.encode(a,{maxline:t})},St.messageFromAsn1=function(e){var t={},a=[];if(!S.validate(e,St.asn1.contentInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=a,r}var n=S.derToOid(t.contentType),i;switch(n){case M.pki.oids.envelopedData:i=St.createEnvelopedData();break;case M.pki.oids.encryptedData:i=St.createEncryptedData();break;case M.pki.oids.signedData:i=St.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+n+" is not (yet) supported.")}return i.fromAsn1(t.content.value[0]),i},St.createSignedData=function(){var e=null;return e={type:M.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(xp(e,r,St.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,i=0;i<n.length;++i)e.certificates.push(M.pki.certificateFromAsn1(n[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],n=0;n<e.certificates.length;++n)r.push(M.pki.certificateToAsn1(e.certificates[n]));var i=[],s=S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&s.value[0].value.push(S.create(S.Class.CONTEXT_SPECIFIC,0,!0,r)),i.length>0&&s.value[0].value.push(S.create(S.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(S.create(S.Class.UNIVERSAL,S.Type.SET,!0,e.signerInfos)),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),s])},addSigner:function(r){var n=r.issuer,i=r.serialNumber;if(r.certificate){var s=r.certificate;typeof s=="string"&&(s=M.pki.certificateFromPem(s)),n=s.issuer.attributes,i=s.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=M.pki.privateKeyFromPem(o));var c=r.digestAlgorithm||M.pki.oids.sha1;switch(c){case M.pki.oids.sha1:case M.pki.oids.sha256:case M.pki.oids.sha384:case M.pki.oids.sha512:case M.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+c)}var l=r.authenticatedAttributes||[];if(l.length>0){for(var u=!1,p=!1,d=0;d<l.length;++d){var g=l[d];if(!u&&g.type===M.pki.oids.contentType){if(u=!0,p)break;continue}if(!p&&g.type===M.pki.oids.messageDigest){if(p=!0,u)break;continue}}if(!u||!p)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:n,serialNumber:i,digestAlgorithm:c,signatureAlgorithm:M.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(M.pki.oids.data).getBytes())]),"content"in e)){var n;e.content instanceof M.util.ByteBuffer?n=e.content.bytes():typeof e.content=="string"&&(n=M.util.encodeUtf8(e.content)),r.detached?e.detachedContent=S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n)]))}if(e.signers.length!==0){var i=t();a(i)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=M.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},n=0;n<e.signers.length;++n){var i=e.signers[n],s=i.digestAlgorithm;s in r||(r[s]=M.md[M.pki.oids[s]].create()),i.authenticatedAttributes.length===0?i.md=r[s]:i.md=M.md[M.pki.oids[s]].create()}e.digestAlgorithmIdentifiers=[];for(var s in r)e.digestAlgorithmIdentifiers.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(s).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")]));return r}function a(r){var n;if(e.detachedContent?n=e.detachedContent:(n=e.contentInfo.value[1],n=n.value[0]),!n)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=S.derToOid(e.contentInfo.value[0].value),s=S.toDer(n);s.getByte(),S.getBerValueLength(s),s=s.getBytes();for(var o in r)r[o].start().update(s);for(var c=new Date,l=0;l<e.signers.length;++l){var u=e.signers[l];if(u.authenticatedAttributes.length===0){if(i!==M.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{u.authenticatedAttributesAsn1=S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[]),d=0;d<u.authenticatedAttributes.length;++d){var g=u.authenticatedAttributes[d];g.type===M.pki.oids.messageDigest?g.value=r[u.digestAlgorithm].digest():g.type===M.pki.oids.signingTime&&(g.value||(g.value=c)),p.value.push(gp(g)),u.authenticatedAttributesAsn1.value.push(gp(g))}s=S.toDer(p).getBytes(),u.md.start().update(s)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=MT(e.signers)}},St.createEncryptedData=function(){var e=null;return e={type:M.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){xp(e,t,St.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),rh(e)}},e},St.createEnvelopedData=function(){var e=null;return e={type:M.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){var a=xp(e,t,St.asn1.envelopedDataValidator);e.recipients=FT(a.recipientInfos.value)},toAsn1:function(){return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,qT(e.recipients)),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,jT(e.encryptedContent))])])])},findRecipient:function(t){for(var a=t.issuer.attributes,r=0;r<e.recipients.length;++r){var n=e.recipients[r],i=n.issuer;if(n.serialNumber===t.serialNumber&&i.length===a.length){for(var s=!0,o=0;o<a.length;++o)if(i[o].type!==a[o].type||i[o].value!==a[o].value){s=!1;break}if(s)return n}}return null},decrypt:function(t,a){if(e.encryptedContent.key===void 0&&t!==void 0&&a!==void 0)switch(t.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:case M.pki.oids.desCBC:var r=a.decrypt(t.encryptedContent.content);e.encryptedContent.key=M.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}rh(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:M.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,a){if(e.encryptedContent.content===void 0){a=a||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,n,i;switch(a){case M.pki.oids["aes128-CBC"]:r=16,n=16,i=M.aes.createEncryptionCipher;break;case M.pki.oids["aes192-CBC"]:r=24,n=16,i=M.aes.createEncryptionCipher;break;case M.pki.oids["aes256-CBC"]:r=32,n=16,i=M.aes.createEncryptionCipher;break;case M.pki.oids["des-EDE3-CBC"]:r=24,n=8,i=M.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+a)}if(t===void 0)t=M.util.createBuffer(M.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=a,e.encryptedContent.key=t,e.encryptedContent.parameter=M.util.createBuffer(M.random.getBytes(n));var s=i(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var o=0;o<e.recipients.length;++o){var c=e.recipients[o];if(c.encryptedContent.content===void 0)switch(c.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}},e};function OT(e){var t={},a=[];if(!S.validate(e,St.asn1.recipientInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=a,r}return{version:t.version.charCodeAt(0),issuer:M.pki.RDNAttributesAsArray(t.issuer),serialNumber:M.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:S.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function DT(e){return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.encryptedContent.algorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")]),S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function FT(e){for(var t=[],a=0;a<e.length;++a)t.push(OT(e[a]));return t}function qT(e){for(var t=[],a=0;a<e.length;++a)t.push(DT(e[a]));return t}function VT(e){var t=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.digestAlgorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.signatureAlgorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")])),t.value.push(S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var a=S.create(S.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var n=e.unauthenticatedAttributes[r];a.values.push(gp(n))}t.value.push(a)}return t}function MT(e){for(var t=[],a=0;a<e.length;++a)t.push(VT(e[a]));return t}function gp(e){var t;if(e.type===M.pki.oids.contentType)t=S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.value).getBytes());else if(e.type===M.pki.oids.messageDigest)t=S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===M.pki.oids.signingTime){var a=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),n=e.value;if(typeof n=="string"){var i=Date.parse(n);isNaN(i)?n.length===13?n=S.utcTimeToDate(n):n=S.generalizedTimeToDate(n):n=new Date(i)}n>=a&&n<r?t=S.create(S.Class.UNIVERSAL,S.Type.UTCTIME,!1,S.dateToUtcTime(n)):t=S.create(S.Class.UNIVERSAL,S.Type.GENERALIZEDTIME,!1,S.dateToGeneralizedTime(n))}return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[t])])}function jT(e){return[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(M.pki.oids.data).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.algorithm).getBytes()),e.parameter?S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.content.getBytes())])]}function xp(e,t,a){var r={},n=[];if(!S.validate(t,a,r,n)){var i=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw i.errors=i,i}var s=S.derToOid(r.contentType);if(s!==M.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var o="";if(M.util.isArray(r.encryptedContent))for(var c=0;c<r.encryptedContent.length;++c){if(r.encryptedContent[c].type!==S.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=r.encryptedContent[c].value}else o=r.encryptedContent;e.encryptedContent={algorithm:S.derToOid(r.encAlgorithm),parameter:M.util.createBuffer(r.encParameter.value),content:M.util.createBuffer(o)}}if(r.content){var o="";if(M.util.isArray(r.content))for(var c=0;c<r.content.length;++c){if(r.content[c].type!==S.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=r.content[c].value}else o=r.content;e.content=M.util.createBuffer(o)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function rh(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case M.pki.oids["aes128-CBC"]:case M.pki.oids["aes192-CBC"]:case M.pki.oids["aes256-CBC"]:t=M.aes.createDecryptionCipher(e.encryptedContent.key);break;case M.pki.oids.desCBC:case M.pki.oids["des-EDE3-CBC"]:t=M.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}var et=le,Cl=et.ssh=et.ssh||{};Cl.privateKeyToPutty=function(e,t,a){a=a||"",t=t||"";var r="ssh-rsa",n=t===""?"none":"aes256-cbc",i="PuTTY-User-Key-File-2: "+r+`\r
|
|
14
|
+
`+o+t.substr(s+1),i=n-s-1,s=-1,++n}else(t[n]===" "||t[n]===" "||t[n]===",")&&(s=n);return t}function fd(e){return e.replace(/^\s+/,"")}var Ae=J;Ae.des=Ae.des||{},Ae.des.startEncrypting=function(e,t,a,r){var n=Fo({key:e,output:a,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n},Ae.des.createEncryptionCipher=function(e,t){return Fo({key:e,output:null,decrypt:!1,mode:t})},Ae.des.startDecrypting=function(e,t,a,r){var n=Fo({key:e,output:a,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n},Ae.des.createDecryptionCipher=function(e,t){return Fo({key:e,output:null,decrypt:!0,mode:t})},Ae.des.Algorithm=function(e,t){var a=this;a.name=e,a.mode=new t({blockSize:8,cipher:{encrypt:function(r,n){return _l(a._keys,r,n,!1)},decrypt:function(r,n){return _l(a._keys,r,n,!0)}}}),a._init=!1},Ae.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Ae.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=Cd(t),this._init=!0}},wt("DES-ECB",Ae.cipher.modes.ecb),wt("DES-CBC",Ae.cipher.modes.cbc),wt("DES-CFB",Ae.cipher.modes.cfb),wt("DES-OFB",Ae.cipher.modes.ofb),wt("DES-CTR",Ae.cipher.modes.ctr),wt("3DES-ECB",Ae.cipher.modes.ecb),wt("3DES-CBC",Ae.cipher.modes.cbc),wt("3DES-CFB",Ae.cipher.modes.cfb),wt("3DES-OFB",Ae.cipher.modes.ofb),wt("3DES-CTR",Ae.cipher.modes.ctr);function wt(e,t){var a=function(){return new Ae.des.Algorithm(e,t)};Ae.cipher.registerAlgorithm(e,a)}var dd=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],hd=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],pd=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],gd=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],yd=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],vd=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],md=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],Ed=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function Cd(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],i=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],y=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],E=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],v=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],x=e.length()>8?3:1,T=[],I=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],B=0,U,D=0;D<x;D++){var L=e.getInt32(),P=e.getInt32();U=(L>>>4^P)&252645135,P^=U,L^=U<<4,U=(P>>>-16^L)&65535,L^=U,P^=U<<-16,U=(L>>>2^P)&858993459,P^=U,L^=U<<2,U=(P>>>-16^L)&65535,L^=U,P^=U<<-16,U=(L>>>1^P)&1431655765,P^=U,L^=U<<1,U=(P>>>8^L)&16711935,L^=U,P^=U<<8,U=(L>>>1^P)&1431655765,P^=U,L^=U<<1,U=L<<8|P>>>20&240,L=P<<24|P<<8&16711680|P>>>8&65280|P>>>24&240,P=U;for(var $=0;$<I.length;++$){I[$]?(L=L<<2|L>>>26,P=P<<2|P>>>26):(L=L<<1|L>>>27,P=P<<1|P>>>27),L&=-15,P&=-15;var H=t[L>>>28]|a[L>>>24&15]|r[L>>>20&15]|n[L>>>16&15]|i[L>>>12&15]|s[L>>>8&15]|o[L>>>4&15],pe=c[P>>>28]|l[P>>>24&15]|u[P>>>20&15]|f[P>>>16&15]|y[P>>>12&15]|E[P>>>8&15]|v[P>>>4&15];U=(pe>>>16^H)&65535,T[B++]=H^U,T[B++]=pe^U<<16}}return T}function _l(e,t,a,r){var n=e.length===32?3:9,i;n===3?i=r?[30,-2,-2]:[0,32,2]:i=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s,o=t[0],c=t[1];s=(o>>>4^c)&252645135,c^=s,o^=s<<4,s=(o>>>16^c)&65535,c^=s,o^=s<<16,s=(c>>>2^o)&858993459,o^=s,c^=s<<2,s=(c>>>8^o)&16711935,o^=s,c^=s<<8,s=(o>>>1^c)&1431655765,c^=s,o^=s<<1,o=o<<1|o>>>31,c=c<<1|c>>>31;for(var l=0;l<n;l+=3){for(var u=i[l+1],f=i[l+2],y=i[l];y!=u;y+=f){var E=c^e[y],v=(c>>>4|c<<28)^e[y+1];s=o,o=c,c=s^(hd[E>>>24&63]|gd[E>>>16&63]|vd[E>>>8&63]|Ed[E&63]|dd[v>>>24&63]|pd[v>>>16&63]|yd[v>>>8&63]|md[v&63])}s=o,o=c,c=s}o=o>>>1|o<<31,c=c>>>1|c<<31,s=(o>>>1^c)&1431655765,c^=s,o^=s<<1,s=(c>>>8^o)&16711935,o^=s,c^=s<<8,s=(c>>>2^o)&858993459,o^=s,c^=s<<2,s=(o>>>16^c)&65535,c^=s,o^=s<<16,s=(o>>>4^c)&252645135,c^=s,o^=s<<4,a[0]=o,a[1]=c}function Fo(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="DES-"+t,r;e.decrypt?r=Ae.cipher.createDecipher(a,e.key):r=Ae.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(i,s){var o=null;s instanceof Ae.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=i,n.call(r,s)},r}var it=J,xd=it.pkcs5=it.pkcs5||{},Pt;it.util.isNodejs&&!it.options.usePureJavaScript&&(Pt=wo),it.pbkdf2=xd.pbkdf2=function(e,t,a,r,n,i){if(typeof n=="function"&&(i=n,n=null),it.util.isNodejs&&!it.options.usePureJavaScript&&Pt.pbkdf2&&(n===null||typeof n!="object")&&(Pt.pbkdf2Sync.length>4||!n||n==="sha1"))return typeof n!="string"&&(n="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),i?Pt.pbkdf2Sync.length===4?Pt.pbkdf2(e,t,a,r,function(U,D){if(U)return i(U);i(null,D.toString("binary"))}):Pt.pbkdf2(e,t,a,r,n,function(U,D){if(U)return i(U);i(null,D.toString("binary"))}):Pt.pbkdf2Sync.length===4?Pt.pbkdf2Sync(e,t,a,r).toString("binary"):Pt.pbkdf2Sync(e,t,a,r,n).toString("binary");if((typeof n>"u"||n===null)&&(n="sha1"),typeof n=="string"){if(!(n in it.md.algorithms))throw new Error("Unknown hash algorithm: "+n);n=it.md[n].create()}var s=n.digestLength;if(r>4294967295*s){var o=new Error("Derived key is too long.");if(i)return i(o);throw o}var c=Math.ceil(r/s),l=r-(c-1)*s,u=it.hmac.create();u.start(n,e);var f="",y,E,v;if(!i){for(var x=1;x<=c;++x){u.start(null,null),u.update(t),u.update(it.util.int32ToBytes(x)),y=v=u.digest().getBytes();for(var T=2;T<=a;++T)u.start(null,null),u.update(v),E=u.digest().getBytes(),y=it.util.xorBytes(y,E,s),v=E;f+=x<c?y:y.substr(0,l)}return f}var x=1,T;function I(){if(x>c)return i(null,f);u.start(null,null),u.update(t),u.update(it.util.int32ToBytes(x)),y=v=u.digest().getBytes(),T=2,B()}function B(){if(T<=a)return u.start(null,null),u.update(v),E=u.digest().getBytes(),y=it.util.xorBytes(y,E,s),v=E,++T,it.util.setImmediate(B);f+=x<c?y:y.substr(0,l),++x,I()}I()};var Ut=J,Ll=Ut.sha256=Ut.sha256||{};Ut.md.sha256=Ut.md.algorithms.sha256=Ll,Ll.create=function(){Dl||Td();var e=null,t=Ut.util.createBuffer(),a=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=Ut.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=Ut.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),Ol(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=Ut.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(xc.substr(0,r.blockLength-s));for(var o,c,l=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};Ol(f,a,n);var y=Ut.util.createBuffer();return y.putInt32(f.h0),y.putInt32(f.h1),y.putInt32(f.h2),y.putInt32(f.h3),y.putInt32(f.h4),y.putInt32(f.h5),y.putInt32(f.h6),y.putInt32(f.h7),y},r};var xc=null,Dl=!1,Pl=null;function Td(){xc="\x80",xc+=Ut.util.fillString("\0",64),Pl=[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],Dl=!0}function Ol(e,t,a){for(var r,n,i,s,o,c,l,u,f,y,E,v,x,T,I,B=a.length();B>=64;){for(l=0;l<16;++l)t[l]=a.getInt32();for(;l<64;++l)r=t[l-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,n=t[l-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[l]=r+t[l-7]+n+t[l-16]|0;for(u=e.h0,f=e.h1,y=e.h2,E=e.h3,v=e.h4,x=e.h5,T=e.h6,I=e.h7,l=0;l<64;++l)s=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),o=T^v&(x^T),i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&f|y&(u^f),r=I+s+o+Pl[l]+t[l],n=i+c,I=T,T=x,x=v,v=E+r>>>0,E=y,y=f,f=u,u=r+n>>>0;e.h0=e.h0+u|0,e.h1=e.h1+f|0,e.h2=e.h2+y|0,e.h3=e.h3+E|0,e.h4=e.h4+v|0,e.h5=e.h5+x|0,e.h6=e.h6+T|0,e.h7=e.h7+I|0,B-=64}}var kt=J,Mo=null;kt.util.isNodejs&&!kt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Mo=wo);var Sd=kt.prng=kt.prng||{};Sd.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=e.md,r=new Array(32),n=0;n<32;++n)r[n]=a.create();t.pools=r,t.pool=0,t.generate=function(l,u){if(!u)return t.generateSync(l);var f=t.plugin.cipher,y=t.plugin.increment,E=t.plugin.formatKey,v=t.plugin.formatSeed,x=kt.util.createBuffer();t.key=null,T();function T(I){if(I)return u(I);if(x.length()>=l)return u(null,x.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return kt.util.nextTick(function(){i(T)});var B=f(t.key,t.seed);t.generated+=B.length,x.putBytes(B),t.key=E(f(t.key,y(t.seed))),t.seed=v(f(t.key,t.seed)),kt.util.setImmediate(T)}},t.generateSync=function(l){var u=t.plugin.cipher,f=t.plugin.increment,y=t.plugin.formatKey,E=t.plugin.formatSeed;t.key=null;for(var v=kt.util.createBuffer();v.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&s();var x=u(t.key,t.seed);t.generated+=x.length,v.putBytes(x),t.key=y(u(t.key,f(t.seed))),t.seed=E(u(t.key,t.seed))}return v.getBytes(l)};function i(l){if(t.pools[0].messageLength>=32)return o(),l();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(f,y){if(f)return l(f);t.collect(y),o(),l()})}function s(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var u=1,f=0;f<32;++f)t.reseeds%u===0&&(l.update(t.pools[f].digest().getBytes()),t.pools[f].start()),u=u<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var y=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(y),t.generated=0}function c(l){var u=null,f=kt.util.globalScope,y=f.crypto||f.msCrypto;y&&y.getRandomValues&&(u=function(L){return y.getRandomValues(L)});var E=kt.util.createBuffer();if(u)for(;E.length()<l;){var v=Math.max(1,Math.min(l-E.length(),65536)/4),x=new Uint32Array(Math.floor(v));try{u(x);for(var T=0;T<x.length;++T)E.putInt32(x[T])}catch(L){if(!(typeof QuotaExceededError<"u"&&L instanceof QuotaExceededError))throw L}}if(E.length()<l)for(var I,B,U,D=Math.floor(Math.random()*65536);E.length()<l;){B=16807*(D&65535),I=16807*(D>>16),B+=(I&32767)<<16,B+=I>>15,B=(B&2147483647)+(B>>31),D=B&4294967295;for(var T=0;T<3;++T)U=D>>>(T<<3),U^=Math.floor(Math.random()*256),E.putByte(U&255)}return E.getBytes(l)}return Mo?(t.seedFile=function(l,u){Mo.randomBytes(l,function(f,y){if(f)return u(f);u(null,y.toString())})},t.seedFileSync=function(l){return Mo.randomBytes(l).toString()}):(t.seedFile=function(l,u){try{u(null,c(l))}catch(f){u(f)}},t.seedFileSync=c),t.collect=function(l){for(var u=l.length,f=0;f<u;++f)t.pools[t.pool].update(l.substr(f,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(l,u){for(var f="",y=0;y<u;y+=8)f+=String.fromCharCode(l>>y&255);t.collect(f)},t.registerWorker=function(l){if(l===self)t.seedFile=function(f,y){function E(v){var x=v.data;x.forge&&x.forge.prng&&(self.removeEventListener("message",E),y(x.forge.prng.err,x.forge.prng.bytes))}self.addEventListener("message",E),self.postMessage({forge:{prng:{needed:f}}})};else{var u=function(f){var y=f.data;y.forge&&y.forge.prng&&t.seedFile(y.forge.prng.needed,function(E,v){l.postMessage({forge:{prng:{err:E,bytes:v}}})})};l.addEventListener("message",u)}},t};var ot=J;(function(){ot.random&&ot.random.getBytes||(function(e){var t={},a=new Array(4),r=ot.util.createBuffer();t.formatKey=function(f){var y=ot.util.createBuffer(f);return f=new Array(4),f[0]=y.getInt32(),f[1]=y.getInt32(),f[2]=y.getInt32(),f[3]=y.getInt32(),ot.aes._expandKey(f,!1)},t.formatSeed=function(f){var y=ot.util.createBuffer(f);return f=new Array(4),f[0]=y.getInt32(),f[1]=y.getInt32(),f[2]=y.getInt32(),f[3]=y.getInt32(),f},t.cipher=function(f,y){return ot.aes._updateBlock(f,y,a,!1),r.putInt32(a[0]),r.putInt32(a[1]),r.putInt32(a[2]),r.putInt32(a[3]),r.getBytes()},t.increment=function(f){return++f[3],f},t.md=ot.md.sha256;function n(){var f=ot.prng.create(t);return f.getBytes=function(y,E){return f.generate(y,E)},f.getBytesSync=function(y){return f.generate(y)},f}var i=n(),s=null,o=ot.util.globalScope,c=o.crypto||o.msCrypto;if(c&&c.getRandomValues&&(s=function(f){return c.getRandomValues(f)}),!ot.util.isNodejs&&!s){if(i.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var u in navigator)try{typeof navigator[u]=="string"&&(l+=navigator[u])}catch{}i.collect(l),l=null}e&&(e().mousemove(function(f){i.collectInt(f.clientX,16),i.collectInt(f.clientY,16)}),e().keypress(function(f){i.collectInt(f.charCode,8)}))}if(!ot.random)ot.random=i;else for(var u in i)ot.random[u]=i[u];ot.random.createInstance=n})(typeof jQuery<"u"?jQuery:null)})();var ft=J,Tc=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],Vl=[1,2,3,5],Ad=function(e,t){return e<<t&65535|(e&65535)>>16-t},Id=function(e,t){return(e&65535)>>t|e<<16-t&65535};ft.rc2=ft.rc2||{},ft.rc2.expandKey=function(e,t){typeof e=="string"&&(e=ft.util.createBuffer(e)),t=t||128;var a=e,r=e.length(),n=t,i=Math.ceil(n/8),s=255>>(n&7),o;for(o=r;o<128;o++)a.putByte(Tc[a.at(o-1)+a.at(o-r)&255]);for(a.setAt(128-i,Tc[a.at(128-i)&s]),o=127-i;o>=0;o--)a.setAt(o,Tc[a.at(o+1)^a.at(o+i)]);return a};var Fl=function(e,t,a){var r=!1,n=null,i=null,s=null,o,c,l,u,f=[];for(e=ft.rc2.expandKey(e,t),l=0;l<64;l++)f.push(e.getInt16Le());a?(o=function(v){for(l=0;l<4;l++)v[l]+=f[u]+(v[(l+3)%4]&v[(l+2)%4])+(~v[(l+3)%4]&v[(l+1)%4]),v[l]=Ad(v[l],Vl[l]),u++},c=function(v){for(l=0;l<4;l++)v[l]+=f[v[(l+3)%4]&63]}):(o=function(v){for(l=3;l>=0;l--)v[l]=Id(v[l],Vl[l]),v[l]-=f[u]+(v[(l+3)%4]&v[(l+2)%4])+(~v[(l+3)%4]&v[(l+1)%4]),u--},c=function(v){for(l=3;l>=0;l--)v[l]-=f[v[(l+3)%4]&63]});var y=function(v){var x=[];for(l=0;l<4;l++){var T=n.getInt16Le();s!==null&&(a?T^=s.getInt16Le():s.putInt16Le(T)),x.push(T&65535)}u=a?0:63;for(var I=0;I<v.length;I++)for(var B=0;B<v[I][0];B++)v[I][1](x);for(l=0;l<4;l++)s!==null&&(a?s.putInt16Le(x[l]):x[l]^=s.getInt16Le()),i.putInt16Le(x[l])},E=null;return E={start:function(v,x){v&&typeof v=="string"&&(v=ft.util.createBuffer(v)),r=!1,n=ft.util.createBuffer(),i=x||new ft.util.createBuffer,s=v,E.output=i},update:function(v){for(r||n.putBuffer(v);n.length()>=8;)y([[5,o],[1,c],[6,o],[1,c],[5,o]])},finish:function(v){var x=!0;if(a)if(v)x=v(8,n,!a);else{var T=n.length()===8?8:8-n.length();n.fillWithByte(T,T)}if(x&&(r=!0,E.update()),!a&&(x=n.length()===0,x))if(v)x=v(8,i,!a);else{var I=i.length(),B=i.at(I-1);B>I?x=!1:i.truncate(B)}return x}},E};ft.rc2.startEncrypting=function(e,t,a){var r=ft.rc2.createEncryptionCipher(e,128);return r.start(t,a),r},ft.rc2.createEncryptionCipher=function(e,t){return Fl(e,t,!0)},ft.rc2.startDecrypting=function(e,t,a){var r=ft.rc2.createDecryptionCipher(e,128);return r.start(t,a),r},ft.rc2.createDecryptionCipher=function(e,t){return Fl(e,t,!1)};var Sc=J;Sc.jsbn=Sc.jsbn||{};var Ot;function k(e,t,a){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,a):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}Sc.jsbn.BigInteger=k;function fe(){return new k(null)}function bd(e,t,a,r,n,i){for(;--i>=0;){var s=t*this.data[e++]+a.data[r]+n;n=Math.floor(s/67108864),a.data[r++]=s&67108863}return n}function Bd(e,t,a,r,n,i){for(var s=t&32767,o=t>>15;--i>=0;){var c=this.data[e]&32767,l=this.data[e++]>>15,u=o*c+l*s;c=s*c+((u&32767)<<15)+a.data[r]+(n&1073741823),n=(c>>>30)+(u>>>15)+o*l+(n>>>30),a.data[r++]=c&1073741823}return n}function Ml(e,t,a,r,n,i){for(var s=t&16383,o=t>>14;--i>=0;){var c=this.data[e]&16383,l=this.data[e++]>>14,u=o*c+l*s;c=s*c+((u&16383)<<14)+a.data[r]+n,n=(c>>28)+(u>>14)+o*l,a.data[r++]=c&268435455}return n}typeof navigator>"u"?(k.prototype.am=Ml,Ot=28):navigator.appName=="Microsoft Internet Explorer"?(k.prototype.am=Bd,Ot=30):navigator.appName!="Netscape"?(k.prototype.am=bd,Ot=26):(k.prototype.am=Ml,Ot=28),k.prototype.DB=Ot,k.prototype.DM=(1<<Ot)-1,k.prototype.DV=1<<Ot;var Ac=52;k.prototype.FV=Math.pow(2,Ac),k.prototype.F1=Ac-Ot,k.prototype.F2=2*Ot-Ac;var wd="0123456789abcdefghijklmnopqrstuvwxyz",Ko=new Array,hr,Et;for(hr=48,Et=0;Et<=9;++Et)Ko[hr++]=Et;for(hr=97,Et=10;Et<36;++Et)Ko[hr++]=Et;for(hr=65,Et=10;Et<36;++Et)Ko[hr++]=Et;function Kl(e){return wd.charAt(e)}function ql(e,t){var a=Ko[e.charCodeAt(t)];return a??-1}function Ud(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function kd(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function Ht(e){var t=fe();return t.fromInt(e),t}function Nd(e,t){var a;if(t==16)a=4;else if(t==8)a=3;else if(t==256)a=8;else if(t==2)a=1;else if(t==32)a=5;else if(t==4)a=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,n=!1,i=0;--r>=0;){var s=a==8?e[r]&255:ql(e,r);if(s<0){e.charAt(r)=="-"&&(n=!0);continue}n=!1,i==0?this.data[this.t++]=s:i+a>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-i)-1)<<i,this.data[this.t++]=s>>this.DB-i):this.data[this.t-1]|=s<<i,i+=a,i>=this.DB&&(i-=this.DB)}a==8&&(e[0]&128)!=0&&(this.s=-1,i>0&&(this.data[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),n&&k.ZERO.subTo(this,this)}function Rd(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function _d(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var a=(1<<t)-1,r,n=!1,i="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(n=!0,i=Kl(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&a,o<=0&&(o+=this.DB,--s)),r>0&&(n=!0),n&&(i+=Kl(r));return n?i:"0"}function Ld(){var e=fe();return k.ZERO.subTo(this,e),e}function Dd(){return this.s<0?this.negate():this}function Pd(e){var t=this.s-e.s;if(t!=0)return t;var a=this.t;if(t=a-e.t,t!=0)return this.s<0?-t:t;for(;--a>=0;)if((t=this.data[a]-e.data[a])!=0)return t;return 0}function qo(e){var t=1,a;return(a=e>>>16)!=0&&(e=a,t+=16),(a=e>>8)!=0&&(e=a,t+=8),(a=e>>4)!=0&&(e=a,t+=4),(a=e>>2)!=0&&(e=a,t+=2),(a=e>>1)!=0&&(e=a,t+=1),t}function Od(){return this.t<=0?0:this.DB*(this.t-1)+qo(this.data[this.t-1]^this.s&this.DM)}function Vd(e,t){var a;for(a=this.t-1;a>=0;--a)t.data[a+e]=this.data[a];for(a=e-1;a>=0;--a)t.data[a]=0;t.t=this.t+e,t.s=this.s}function Fd(e,t){for(var a=e;a<this.t;++a)t.data[a-e]=this.data[a];t.t=Math.max(this.t-e,0),t.s=this.s}function Md(e,t){var a=e%this.DB,r=this.DB-a,n=(1<<r)-1,i=Math.floor(e/this.DB),s=this.s<<a&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+i+1]=this.data[o]>>r|s,s=(this.data[o]&n)<<a;for(o=i-1;o>=0;--o)t.data[o]=0;t.data[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()}function Kd(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t){t.t=0;return}var r=e%this.DB,n=this.DB-r,i=(1<<r)-1;t.data[0]=this.data[a]>>r;for(var s=a+1;s<this.t;++s)t.data[s-a-1]|=(this.data[s]&i)<<n,t.data[s-a]=this.data[s]>>r;r>0&&(t.data[this.t-a-1]|=(this.s&i)<<n),t.t=this.t-a,t.clamp()}function qd(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]-e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r-=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[a++]=this.DV+r:r>0&&(t.data[a++]=r),t.t=a,t.clamp()}function Hd(e,t){var a=this.abs(),r=e.abs(),n=a.t;for(t.t=n+r.t;--n>=0;)t.data[n]=0;for(n=0;n<r.t;++n)t.data[n+a.t]=a.am(0,r.data[n],t,n,0,a.t);t.s=0,t.clamp(),this.s!=e.s&&k.ZERO.subTo(t,t)}function Gd(e){for(var t=this.abs(),a=e.t=2*t.t;--a>=0;)e.data[a]=0;for(a=0;a<t.t-1;++a){var r=t.am(a,t.data[a],e,2*a,0,1);(e.data[a+t.t]+=t.am(a+1,2*t.data[a],e,2*a+1,r,t.t-a-1))>=t.DV&&(e.data[a+t.t]-=t.DV,e.data[a+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(a,t.data[a],e,2*a,0,1)),e.s=0,e.clamp()}function Wd(e,t,a){var r=e.abs();if(!(r.t<=0)){var n=this.abs();if(n.t<r.t){t?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=fe());var i=fe(),s=this.s,o=e.s,c=this.DB-qo(r.data[r.t-1]);c>0?(r.lShiftTo(c,i),n.lShiftTo(c,a)):(r.copyTo(i),n.copyTo(a));var l=i.t,u=i.data[l-1];if(u!=0){var f=u*(1<<this.F1)+(l>1?i.data[l-2]>>this.F2:0),y=this.FV/f,E=(1<<this.F1)/f,v=1<<this.F2,x=a.t,T=x-l,I=t??fe();for(i.dlShiftTo(T,I),a.compareTo(I)>=0&&(a.data[a.t++]=1,a.subTo(I,a)),k.ONE.dlShiftTo(l,I),I.subTo(i,i);i.t<l;)i.data[i.t++]=0;for(;--T>=0;){var B=a.data[--x]==u?this.DM:Math.floor(a.data[x]*y+(a.data[x-1]+v)*E);if((a.data[x]+=i.am(0,B,a,T,0,l))<B)for(i.dlShiftTo(T,I),a.subTo(I,a);a.data[x]<--B;)a.subTo(I,a)}t!=null&&(a.drShiftTo(l,t),s!=o&&k.ZERO.subTo(t,t)),a.t=l,a.clamp(),c>0&&a.rShiftTo(c,a),s<0&&k.ZERO.subTo(a,a)}}}function zd(e){var t=fe();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(k.ZERO)>0&&e.subTo(t,t),t}function er(e){this.m=e}function $d(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Qd(e){return e}function Xd(e){e.divRemTo(this.m,null,e)}function jd(e,t,a){e.multiplyTo(t,a),this.reduce(a)}function Yd(e,t){e.squareTo(t),this.reduce(t)}er.prototype.convert=$d,er.prototype.revert=Qd,er.prototype.reduce=Xd,er.prototype.mulTo=jd,er.prototype.sqrTo=Yd;function Zd(){if(this.t<1)return 0;var e=this.data[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function tr(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Jd(e){var t=fe();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(k.ZERO)>0&&this.m.subTo(t,t),t}function eh(e){var t=fe();return e.copyTo(t),this.reduce(t),t}function th(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var a=e.data[t]&32767,r=a*this.mpl+((a*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(a=t+this.m.t,e.data[a]+=this.m.am(0,r,e,t,0,this.m.t);e.data[a]>=e.DV;)e.data[a]-=e.DV,e.data[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function rh(e,t){e.squareTo(t),this.reduce(t)}function ah(e,t,a){e.multiplyTo(t,a),this.reduce(a)}tr.prototype.convert=Jd,tr.prototype.revert=eh,tr.prototype.reduce=th,tr.prototype.mulTo=ah,tr.prototype.sqrTo=rh;function nh(){return(this.t>0?this.data[0]&1:this.s)==0}function sh(e,t){if(e>4294967295||e<1)return k.ONE;var a=fe(),r=fe(),n=t.convert(this),i=qo(e)-1;for(n.copyTo(a);--i>=0;)if(t.sqrTo(a,r),(e&1<<i)>0)t.mulTo(r,n,a);else{var s=a;a=r,r=s}return t.revert(a)}function ih(e,t){var a;return e<256||t.isEven()?a=new er(t):a=new tr(t),this.exp(e,a)}k.prototype.copyTo=Ud,k.prototype.fromInt=kd,k.prototype.fromString=Nd,k.prototype.clamp=Rd,k.prototype.dlShiftTo=Vd,k.prototype.drShiftTo=Fd,k.prototype.lShiftTo=Md,k.prototype.rShiftTo=Kd,k.prototype.subTo=qd,k.prototype.multiplyTo=Hd,k.prototype.squareTo=Gd,k.prototype.divRemTo=Wd,k.prototype.invDigit=Zd,k.prototype.isEven=nh,k.prototype.exp=sh,k.prototype.toString=_d,k.prototype.negate=Ld,k.prototype.abs=Dd,k.prototype.compareTo=Pd,k.prototype.bitLength=Od,k.prototype.mod=zd,k.prototype.modPowInt=ih,k.ZERO=Ht(0),k.ONE=Ht(1);function oh(){var e=fe();return this.copyTo(e),e}function ch(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function lh(){return this.t==0?this.s:this.data[0]<<24>>24}function uh(){return this.t==0?this.s:this.data[0]<<16>>16}function fh(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function dh(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function hh(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),r=Ht(a),n=fe(),i=fe(),s="";for(this.divRemTo(r,n,i);n.signum()>0;)s=(a+i.intValue()).toString(e).substr(1)+s,n.divRemTo(r,n,i);return i.intValue().toString(e)+s}function ph(e,t){this.fromInt(0),t==null&&(t=10);for(var a=this.chunkSize(t),r=Math.pow(t,a),n=!1,i=0,s=0,o=0;o<e.length;++o){var c=ql(e,o);if(c<0){e.charAt(o)=="-"&&this.signum()==0&&(n=!0);continue}s=t*s+c,++i>=a&&(this.dMultiply(r),this.dAddOffset(s,0),i=0,s=0)}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(s,0)),n&&k.ZERO.subTo(this,this)}function gh(e,t,a){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(k.ONE.shiftLeft(e-1),Ic,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(k.ONE.shiftLeft(e-1),this);else{var r=new Array,n=e&7;r.length=(e>>3)+1,t.nextBytes(r),n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromString(r,256)}}function yh(){var e=this.t,t=new Array;t[0]=this.s;var a=this.DB-e*this.DB%8,r,n=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[n++]=r|this.s<<this.DB-a);e>=0;)a<8?(r=(this.data[e]&(1<<a)-1)<<8-a,r|=this.data[--e]>>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),(r&128)!=0&&(r|=-256),n==0&&(this.s&128)!=(r&128)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t}function vh(e){return this.compareTo(e)==0}function mh(e){return this.compareTo(e)<0?this:e}function Eh(e){return this.compareTo(e)>0?this:e}function Ch(e,t,a){var r,n,i=Math.min(e.t,this.t);for(r=0;r<i;++r)a.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(n=e.s&this.DM,r=i;r<this.t;++r)a.data[r]=t(this.data[r],n);a.t=this.t}else{for(n=this.s&this.DM,r=i;r<e.t;++r)a.data[r]=t(n,e.data[r]);a.t=e.t}a.s=t(this.s,e.s),a.clamp()}function xh(e,t){return e&t}function Th(e){var t=fe();return this.bitwiseTo(e,xh,t),t}function Ic(e,t){return e|t}function Sh(e){var t=fe();return this.bitwiseTo(e,Ic,t),t}function Hl(e,t){return e^t}function Ah(e){var t=fe();return this.bitwiseTo(e,Hl,t),t}function Gl(e,t){return e&~t}function Ih(e){var t=fe();return this.bitwiseTo(e,Gl,t),t}function bh(){for(var e=fe(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function Bh(e){var t=fe();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function wh(e){var t=fe();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Uh(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function kh(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+Uh(this.data[e]);return this.s<0?this.t*this.DB:-1}function Nh(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function Rh(){for(var e=0,t=this.s&this.DM,a=0;a<this.t;++a)e+=Nh(this.data[a]^t);return e}function _h(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function Lh(e,t){var a=k.ONE.shiftLeft(e);return this.bitwiseTo(a,t,a),a}function Dh(e){return this.changeBit(e,Ic)}function Ph(e){return this.changeBit(e,Gl)}function Oh(e){return this.changeBit(e,Hl)}function Vh(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]+e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r+=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[a++]=r:r<-1&&(t.data[a++]=this.DV+r),t.t=a,t.clamp()}function Fh(e){var t=fe();return this.addTo(e,t),t}function Mh(e){var t=fe();return this.subTo(e,t),t}function Kh(e){var t=fe();return this.multiplyTo(e,t),t}function qh(){var e=fe();return this.squareTo(e),e}function Hh(e){var t=fe();return this.divRemTo(e,t,null),t}function Gh(e){var t=fe();return this.divRemTo(e,null,t),t}function Wh(e){var t=fe(),a=fe();return this.divRemTo(e,t,a),new Array(t,a)}function zh(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function $h(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function Co(){}function Wl(e){return e}function Qh(e,t,a){e.multiplyTo(t,a)}function Xh(e,t){e.squareTo(t)}Co.prototype.convert=Wl,Co.prototype.revert=Wl,Co.prototype.mulTo=Qh,Co.prototype.sqrTo=Xh;function jh(e){return this.exp(e,new Co)}function Yh(e,t,a){var r=Math.min(this.t+e.t,t);for(a.s=0,a.t=r;r>0;)a.data[--r]=0;var n;for(n=a.t-this.t;r<n;++r)a.data[r+this.t]=this.am(0,e.data[r],a,r,0,this.t);for(n=Math.min(e.t,t);r<n;++r)this.am(0,e.data[r],a,r,0,t-r);a.clamp()}function Zh(e,t,a){--t;var r=a.t=this.t+e.t-t;for(a.s=0;--r>=0;)a.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)a.data[this.t+r-t]=this.am(t-r,e.data[r],a,0,0,this.t+r-t);a.clamp(),a.drShiftTo(1,a)}function pr(e){this.r2=fe(),this.q3=fe(),k.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Jh(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=fe();return e.copyTo(t),this.reduce(t),t}function ep(e){return e}function tp(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function rp(e,t){e.squareTo(t),this.reduce(t)}function ap(e,t,a){e.multiplyTo(t,a),this.reduce(a)}pr.prototype.convert=Jh,pr.prototype.revert=ep,pr.prototype.reduce=tp,pr.prototype.mulTo=ap,pr.prototype.sqrTo=rp;function np(e,t){var a=e.bitLength(),r,n=Ht(1),i;if(a<=0)return n;a<18?r=1:a<48?r=3:a<144?r=4:a<768?r=5:r=6,a<8?i=new er(t):t.isEven()?i=new pr(t):i=new tr(t);var s=new Array,o=3,c=r-1,l=(1<<r)-1;if(s[1]=i.convert(this),r>1){var u=fe();for(i.sqrTo(s[1],u);o<=l;)s[o]=fe(),i.mulTo(u,s[o-2],s[o]),o+=2}var f=e.t-1,y,E=!0,v=fe(),x;for(a=qo(e.data[f])-1;f>=0;){for(a>=c?y=e.data[f]>>a-c&l:(y=(e.data[f]&(1<<a+1)-1)<<c-a,f>0&&(y|=e.data[f-1]>>this.DB+a-c)),o=r;(y&1)==0;)y>>=1,--o;if((a-=o)<0&&(a+=this.DB,--f),E)s[y].copyTo(n),E=!1;else{for(;o>1;)i.sqrTo(n,v),i.sqrTo(v,n),o-=2;o>0?i.sqrTo(n,v):(x=n,n=v,v=x),i.mulTo(v,s[y],n)}for(;f>=0&&(e.data[f]&1<<a)==0;)i.sqrTo(n,v),x=n,n=v,v=x,--a<0&&(a=this.DB-1,--f)}return i.revert(n)}function sp(e){var t=this.s<0?this.negate():this.clone(),a=e.s<0?e.negate():e.clone();if(t.compareTo(a)<0){var r=t;t=a,a=r}var n=t.getLowestSetBit(),i=a.getLowestSetBit();if(i<0)return t;for(n<i&&(i=n),i>0&&(t.rShiftTo(i,t),a.rShiftTo(i,a));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=a.getLowestSetBit())>0&&a.rShiftTo(n,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return i>0&&a.lShiftTo(i,a),a}function ip(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(t==0)a=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)a=(t*a+this.data[r])%e;return a}function op(e){if(this.signum()==0)return k.ZERO;var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return k.ZERO;for(var a=e.clone(),r=this.clone(),n=Ht(1),i=Ht(0),s=Ht(0),o=Ht(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),t?((!n.isEven()||!i.isEven())&&(n.addTo(this,n),i.subTo(e,i)),n.rShiftTo(1,n)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);a.compareTo(r)>=0?(a.subTo(r,a),t&&n.subTo(s,n),i.subTo(o,i)):(r.subTo(a,r),t&&s.subTo(n,s),o.subTo(i,o))}if(r.compareTo(k.ONE)!=0)return k.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var It=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],cp=(1<<26)/It[It.length-1];function lp(e){var t,a=this.abs();if(a.t==1&&a.data[0]<=It[It.length-1]){for(t=0;t<It.length;++t)if(a.data[0]==It[t])return!0;return!1}if(a.isEven())return!1;for(t=1;t<It.length;){for(var r=It[t],n=t+1;n<It.length&&r<cp;)r*=It[n++];for(r=a.modInt(r);t<n;)if(r%It[t++]==0)return!1}return a.millerRabin(e)}function up(e){var t=this.subtract(k.ONE),a=t.getLowestSetBit();if(a<=0)return!1;for(var r=t.shiftRight(a),n=fp(),i,s=0;s<e;++s){do i=new k(this.bitLength(),n);while(i.compareTo(k.ONE)<=0||i.compareTo(t)>=0);var o=i.modPow(r,this);if(o.compareTo(k.ONE)!=0&&o.compareTo(t)!=0){for(var c=1;c++<a&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(k.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function fp(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}k.prototype.chunkSize=fh,k.prototype.toRadix=hh,k.prototype.fromRadix=ph,k.prototype.fromNumber=gh,k.prototype.bitwiseTo=Ch,k.prototype.changeBit=Lh,k.prototype.addTo=Vh,k.prototype.dMultiply=zh,k.prototype.dAddOffset=$h,k.prototype.multiplyLowerTo=Yh,k.prototype.multiplyUpperTo=Zh,k.prototype.modInt=ip,k.prototype.millerRabin=up,k.prototype.clone=oh,k.prototype.intValue=ch,k.prototype.byteValue=lh,k.prototype.shortValue=uh,k.prototype.signum=dh,k.prototype.toByteArray=yh,k.prototype.equals=vh,k.prototype.min=mh,k.prototype.max=Eh,k.prototype.and=Th,k.prototype.or=Sh,k.prototype.xor=Ah,k.prototype.andNot=Ih,k.prototype.not=bh,k.prototype.shiftLeft=Bh,k.prototype.shiftRight=wh,k.prototype.getLowestSetBit=kh,k.prototype.bitCount=Rh,k.prototype.testBit=_h,k.prototype.setBit=Dh,k.prototype.clearBit=Ph,k.prototype.flipBit=Oh,k.prototype.add=Fh,k.prototype.subtract=Mh,k.prototype.multiply=Kh,k.prototype.divide=Hh,k.prototype.remainder=Gh,k.prototype.divideAndRemainder=Wh,k.prototype.modPow=np,k.prototype.modInverse=op,k.prototype.pow=jh,k.prototype.gcd=sp,k.prototype.isProbablePrime=lp,k.prototype.square=qh;var Nt=J,zl=Nt.sha1=Nt.sha1||{};Nt.md.sha1=Nt.md.algorithms.sha1=zl,zl.create=function(){$l||dp();var e=null,t=Nt.util.createBuffer(),a=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=Nt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=Nt.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),Ql(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=Nt.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(bc.substr(0,r.blockLength-s));for(var o,c,l=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};Ql(f,a,n);var y=Nt.util.createBuffer();return y.putInt32(f.h0),y.putInt32(f.h1),y.putInt32(f.h2),y.putInt32(f.h3),y.putInt32(f.h4),y},r};var bc=null,$l=!1;function dp(){bc="\x80",bc+=Nt.util.fillString("\0",64),$l=!0}function Ql(e,t,a){for(var r,n,i,s,o,c,l,u,f=a.length();f>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)r=a.getInt32(),t[u]=r,l=o^i&(s^o),r=(n<<5|n>>>27)+l+c+1518500249+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<20;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=o^i&(s^o),r=(n<<5|n>>>27)+l+c+1518500249+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<32;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+1859775393+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<40;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+1859775393+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<60;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i&s|o&(i^s),r=(n<<5|n>>>27)+l+c+2400959708+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<80;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+3395469782+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,f-=64}}var Rt=J,Xl=Rt.pkcs1=Rt.pkcs1||{};Xl.encode_rsa_oaep=function(e,t,a){var r,n,i,s;typeof a=="string"?(r=a,n=arguments[3]||void 0,i=arguments[4]||void 0):a&&(r=a.label||void 0,n=a.seed||void 0,i=a.md||void 0,a.mgf1&&a.mgf1.md&&(s=a.mgf1.md)),i?i.start():i=Rt.md.sha1.create(),s||(s=i);var o=Math.ceil(e.n.bitLength()/8),c=o-2*i.digestLength-2;if(t.length>c){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=c,l}r||(r=""),i.update(r,"raw");for(var u=i.digest(),f="",y=c-t.length,E=0;E<y;E++)f+="\0";var v=u.getBytes()+f+""+t;if(!n)n=Rt.random.getBytes(i.digestLength);else if(n.length!==i.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=n.length,l.digestLength=i.digestLength,l}var x=Ho(n,o-i.digestLength-1,s),T=Rt.util.xorBytes(v,x,v.length),I=Ho(T,i.digestLength,s),B=Rt.util.xorBytes(n,I,n.length);return"\0"+B+T},Xl.decode_rsa_oaep=function(e,t,a){var r,n,i;typeof a=="string"?(r=a,n=arguments[3]||void 0):a&&(r=a.label||void 0,n=a.md||void 0,a.mgf1&&a.mgf1.md&&(i=a.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var T=new Error("RSAES-OAEP encoded message length is invalid.");throw T.length=t.length,T.expectedLength=s,T}if(n===void 0?n=Rt.md.sha1.create():n.start(),i||(i=n),s<2*n.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),n.update(r,"raw");for(var o=n.digest().getBytes(),c=t.charAt(0),l=t.substring(1,n.digestLength+1),u=t.substring(1+n.digestLength),f=Ho(u,n.digestLength,i),y=Rt.util.xorBytes(l,f,l.length),E=Ho(y,s-n.digestLength-1,i),v=Rt.util.xorBytes(u,E,u.length),x=v.substring(0,n.digestLength),T=c!=="\0",I=0;I<n.digestLength;++I)T|=o.charAt(I)!==x.charAt(I);for(var B=1,U=n.digestLength,D=n.digestLength;D<v.length;D++){var L=v.charCodeAt(D),P=L&1^1,$=B?65534:0;T|=L&$,B=B&P,U+=B}if(T||v.charCodeAt(U)!==1)throw new Error("Invalid RSAES-OAEP padding.");return v.substring(U+1)};function Ho(e,t,a){a||(a=Rt.md.sha1.create());for(var r="",n=Math.ceil(t/a.digestLength),i=0;i<n;++i){var s=String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255);a.start(),a.update(e+s),r+=a.digest().getBytes()}return r.substring(0,t)}var rr=J;(function(){if(rr.prime)return;var e=rr.prime=rr.prime||{},t=rr.jsbn.BigInteger,a=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var n=function(f,y){return f|y};e.generateProbablePrime=function(f,y,E){typeof y=="function"&&(E=y,y={}),y=y||{};var v=y.algorithm||"PRIMEINC";typeof v=="string"&&(v={name:v}),v.options=v.options||{};var x=y.prng||rr.random,T={nextBytes:function(I){for(var B=x.getBytesSync(I.length),U=0;U<I.length;++U)I[U]=B.charCodeAt(U)}};if(v.name==="PRIMEINC")return i(f,T,v.options,E);throw new Error("Invalid prime generation algorithm: "+v.name)};function i(f,y,E,v){return"workers"in E?c(f,y,E,v):s(f,y,E,v)}function s(f,y,E,v){var x=l(f,y),T=0,I=u(x.bitLength());"millerRabinTests"in E&&(I=E.millerRabinTests);var B=10;"maxBlockTime"in E&&(B=E.maxBlockTime),o(x,f,y,T,I,B,v)}function o(f,y,E,v,x,T,I){var B=+new Date;do{if(f.bitLength()>y&&(f=l(y,E)),f.isProbablePrime(x))return I(null,f);f.dAddOffset(a[v++%8],0)}while(T<0||+new Date-B<T);rr.util.setImmediate(function(){o(f,y,E,v,x,T,I)})}function c(f,y,E,v){if(typeof Worker>"u")return s(f,y,E,v);var x=l(f,y),T=E.workers,I=E.workLoad||100,B=I*30/8,U=E.workerScript||"forge/prime.worker.js";if(T===-1)return rr.util.estimateCores(function(L,P){L&&(P=2),T=P-1,D()});D();function D(){T=Math.max(1,T);for(var L=[],P=0;P<T;++P)L[P]=new Worker(U);for(var P=0;P<T;++P)L[P].addEventListener("message",H);var $=!1;function H(pe){if(!$){var ye=pe.data;if(ye.found){for(var ve=0;ve<L.length;++ve)L[ve].terminate();return $=!0,v(null,new t(ye.prime,16))}x.bitLength()>f&&(x=l(f,y));var Ie=x.toString(16);pe.target.postMessage({hex:Ie,workLoad:I}),x.dAddOffset(B,0)}}}}function l(f,y){var E=new t(f,y),v=f-1;return E.testBit(v)||E.bitwiseTo(t.ONE.shiftLeft(v),n,E),E.dAddOffset(31-E.mod(r).byteValue(),0),E}function u(f){return f<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2}})();var z=J;if(typeof he>"u")var he=z.jsbn.BigInteger;var Bc=z.util.isNodejs?wo:null,b=z.asn1,Ct=z.util;z.pki=z.pki||{},z.pki.rsa=z.rsa=z.rsa||{};var Y=z.pki,hp=[6,4,2,4,2,4,6,2],pp={name:"PrivateKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},gp={name:"RSAPrivateKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},yp={name:"RSAPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},vp=z.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},mp={name:"DigestInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:b.Class.UNIVERSAL,type:b.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},Ep=function(e){var t;if(e.algorithm in Y.oids)t=Y.oids[e.algorithm];else{var a=new Error("Unknown message digest algorithm.");throw a.algorithm=e.algorithm,a}var r=b.oidToDer(t).getBytes(),n=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]),i=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);i.value.push(b.create(b.Class.UNIVERSAL,b.Type.OID,!1,r)),i.value.push(b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,""));var s=b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(i),n.value.push(s),b.toDer(n).getBytes()},jl=function(e,t,a){if(a)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(he.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(he.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new he(z.util.bytesToHex(z.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(he.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var n=e.mod(t.p).modPow(t.dP,t.p),i=e.mod(t.q).modPow(t.dQ,t.q);n.compareTo(i)<0;)n=n.add(t.p);var s=n.subtract(i).multiply(t.qInv).mod(t.p).multiply(t.q).add(i);return s=s.multiply(r.modInverse(t.n)).mod(t.n),s};Y.rsa.encrypt=function(e,t,a){var r=a,n,i=Math.ceil(t.n.bitLength()/8);a!==!1&&a!==!0?(r=a===2,n=Yl(e,t,a)):(n=z.util.createBuffer(),n.putBytes(e));for(var s=new he(n.toHex(),16),o=jl(s,t,r),c=o.toString(16),l=z.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(z.util.hexToBytes(c)),l.getBytes()},Y.rsa.decrypt=function(e,t,a,r){var n=Math.ceil(t.n.bitLength()/8);if(e.length!==n){var i=new Error("Encrypted message length is invalid.");throw i.length=e.length,i.expected=n,i}var s=new he(z.util.createBuffer(e).toHex(),16);if(s.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=jl(s,t,a),c=o.toString(16),l=z.util.createBuffer(),u=n-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(z.util.hexToBytes(c)),r!==!1?Go(l.getBytes(),t,a):l.getBytes()},Y.rsa.createKeyPairGenerationState=function(e,t,a){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,a=a||{};var r=a.prng||z.random,n={nextBytes:function(o){for(var c=r.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=c.charCodeAt(l)}},i=a.algorithm||"PRIMEINC",s;if(i==="PRIMEINC")s={algorithm:i,state:0,bits:e,rng:n,eInt:t||65537,e:new he(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},s.e.fromInt(s.eInt);else throw new Error("Invalid key generation algorithm: "+i);return s},Y.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var a=new he(null);a.fromInt(30);for(var r=0,n=function(f,y){return f|y},i=+new Date,s,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var c=e.p===null?e.pBits:e.qBits,l=c-1;e.pqState===0?(e.num=new he(c,e.rng),e.num.testBit(l)||e.num.bitwiseTo(he.ONE.shiftLeft(l),n,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(xp(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(hp[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(he.ONE).gcd(e.e).compareTo(he.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(he.ONE),e.q1=e.q.subtract(he.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(he.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:Y.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Y.rsa.setPublicKey(e.n,e.e)}}s=+new Date,o+=s-i,i=s}return e.keys!==null},Y.rsa.generateKeyPair=function(e,t,a,r){if(arguments.length===1?typeof e=="object"?(a=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(a=t,t=void 0):(a=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof a=="function"&&(r=a,a=void 0):(r=a,a=t,t=void 0)),a=a||{},e===void 0&&(e=a.bits||2048),t===void 0&&(t=a.e||65537),!a.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(Zl("generateKeyPair"))return Bc.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,c,l){if(o)return r(o);r(null,{privateKey:Y.privateKeyFromPem(l),publicKey:Y.publicKeyFromPem(c)})});if(Jl("generateKey")&&Jl("exportKey"))return Ct.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:t0(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Ct.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){r(o)}).then(function(o){if(o){var c=Y.privateKeyFromAsn1(b.fromDer(z.util.createBuffer(o)));r(null,{privateKey:c,publicKey:Y.setRsaPublicKey(c.n,c.e)})}});if(e0("generateKey")&&e0("exportKey")){var n=Ct.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:t0(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);n.oncomplete=function(o){var c=o.target.result,l=Ct.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);l.oncomplete=function(u){var f=u.target.result,y=Y.privateKeyFromAsn1(b.fromDer(z.util.createBuffer(f)));r(null,{privateKey:y,publicKey:Y.setRsaPublicKey(y.n,y.e)})},l.onerror=function(u){r(u)}},n.onerror=function(o){r(o)};return}}else if(Zl("generateKeyPairSync")){var i=Bc.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Y.privateKeyFromPem(i.privateKey),publicKey:Y.publicKeyFromPem(i.publicKey)}}}var s=Y.rsa.createKeyPairGenerationState(e,t,a);if(!r)return Y.rsa.stepKeyPairGenerationState(s,0),s.keys;Cp(s,a,r)},Y.setRsaPublicKey=Y.rsa.setPublicKey=function(e,t){var a={n:e,e:t};return a.encrypt=function(r,n,i){if(typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSAES-PKCS1-V1_5"),n==="RSAES-PKCS1-V1_5")n={encode:function(o,c,l){return Yl(o,c,2).getBytes()}};else if(n==="RSA-OAEP"||n==="RSAES-OAEP")n={encode:function(o,c){return z.pkcs1.encode_rsa_oaep(c,o,i)}};else if(["RAW","NONE","NULL",null].indexOf(n)!==-1)n={encode:function(o){return o}};else if(typeof n=="string")throw new Error('Unsupported encryption scheme: "'+n+'".');var s=n.encode(r,a,!0);return Y.rsa.encrypt(s,a,!0)},a.verify=function(r,n,i,s){typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSASSA-PKCS1-V1_5"),s===void 0&&(s={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),"_skipPaddingChecks"in s||(s._skipPaddingChecks=!1),i==="RSASSA-PKCS1-V1_5"?i={verify:function(c,l){l=Go(l,a,!0,void 0,s);var u=b.fromDer(l,{parseAllBytes:s._parseAllDigestBytes}),f={},y=[];if(!b.validate(u,mp,f,y)||u.value.length!==2){var E=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw E.errors=y,E}var v=b.derToOid(f.algorithmIdentifier);if(!(v===z.oids.md2||v===z.oids.md5||v===z.oids.sha1||v===z.oids.sha224||v===z.oids.sha256||v===z.oids.sha384||v===z.oids.sha512||v===z.oids["sha512-224"]||v===z.oids["sha512-256"])){var E=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw E.oid=v,E}if((v===z.oids.md2||v===z.oids.md5)&&!("parameters"in f))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return c===f.digest}}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:function(c,l){return l=Go(l,a,!0,void 0,s),c===l}});var o=Y.rsa.decrypt(n,a,!0,!1);return i.verify(r,o,a.n.bitLength())},a},Y.setRsaPrivateKey=Y.rsa.setPrivateKey=function(e,t,a,r,n,i,s,o){var c={n:e,e:t,d:a,p:r,q:n,dP:i,dQ:s,qInv:o};return c.decrypt=function(l,u,f){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var y=Y.rsa.decrypt(l,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Go};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(E,v){return z.pkcs1.decode_rsa_oaep(v,E,f)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(E){return E}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(y,c,!1)},c.sign=function(l,u){var f=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:Ep},f=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return l}},f=1);var y=u.encode(l,c.n.bitLength());return Y.rsa.encrypt(y,c,f)},c},Y.wrapRsaPrivateKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(0).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(Y.oids.rsaEncryption).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")]),b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,b.toDer(e).getBytes())])},Y.privateKeyFromAsn1=function(e){var t={},a=[];if(b.validate(e,pp,t,a)&&(e=b.fromDer(z.util.createBuffer(t.privateKey))),t={},a=[],!b.validate(e,gp,t,a)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=a,r}var n,i,s,o,c,l,u,f;return n=z.util.createBuffer(t.privateKeyModulus).toHex(),i=z.util.createBuffer(t.privateKeyPublicExponent).toHex(),s=z.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=z.util.createBuffer(t.privateKeyPrime1).toHex(),c=z.util.createBuffer(t.privateKeyPrime2).toHex(),l=z.util.createBuffer(t.privateKeyExponent1).toHex(),u=z.util.createBuffer(t.privateKeyExponent2).toHex(),f=z.util.createBuffer(t.privateKeyCoefficient).toHex(),Y.setRsaPrivateKey(new he(n,16),new he(i,16),new he(s,16),new he(o,16),new he(c,16),new he(l,16),new he(u,16),new he(f,16))},Y.privateKeyToAsn1=Y.privateKeyToRSAPrivateKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(0).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.n)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.e)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.d)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.p)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.q)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.dP)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.dQ)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.qInv))])},Y.publicKeyFromAsn1=function(e){var t={},a=[];if(b.validate(e,vp,t,a)){var r=b.derToOid(t.publicKeyOid);if(r!==Y.oids.rsaEncryption){var n=new Error("Cannot read public key. Unknown OID.");throw n.oid=r,n}e=t.rsaPublicKey}if(a=[],!b.validate(e,yp,t,a)){var n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw n.errors=a,n}var i=z.util.createBuffer(t.publicKeyModulus).toHex(),s=z.util.createBuffer(t.publicKeyExponent).toHex();return Y.setRsaPublicKey(new he(i,16),new he(s,16))},Y.publicKeyToAsn1=Y.publicKeyToSubjectPublicKeyInfo=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(Y.oids.rsaEncryption).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")]),b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,[Y.publicKeyToRSAPublicKey(e)])])},Y.publicKeyToRSAPublicKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.n)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_t(e.e))])};function Yl(e,t,a){var r=z.util.createBuffer(),n=Math.ceil(t.n.bitLength()/8);if(e.length>n-11){var i=new Error("Message is too long for PKCS#1 v1.5 padding.");throw i.length=e.length,i.max=n-11,i}r.putByte(0),r.putByte(a);var s=n-3-e.length,o;if(a===0||a===1){o=a===0?0:255;for(var c=0;c<s;++c)r.putByte(o)}else for(;s>0;){for(var l=0,u=z.random.getBytes(s),c=0;c<s;++c)o=u.charCodeAt(c),o===0?++l:r.putByte(o);s=l}return r.putByte(0),r.putBytes(e),r}function Go(e,t,a,r,n){var i=Math.ceil(t.n.bitLength()/8),s=z.util.createBuffer(e),o=s.getByte(),c=s.getByte();if(o!==0||a&&c!==0&&c!==1||!a&&c!==2||a&&c===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(c===0){l=i-3-r;for(var u=0;u<l;++u)if(s.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(c===1){for(l=0;s.length()>1;){if(s.getByte()!==255){--s.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(c===2){for(l=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var f=s.getByte();if(f!==0||l!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Cp(e,t,a){typeof t=="function"&&(a=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),n();function n(){i(e.pBits,function(o,c){if(o)return a(o);if(e.p=c,e.q!==null)return s(o,e.q);i(e.qBits,s)})}function i(o,c){z.prime.generateProbablePrime(o,r,c)}function s(o,c){if(o)return a(o);if(e.q=c,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l}if(e.p.subtract(he.ONE).gcd(e.e).compareTo(he.ONE)!==0){e.p=null,n();return}if(e.q.subtract(he.ONE).gcd(e.e).compareTo(he.ONE)!==0){e.q=null,i(e.qBits,s);return}if(e.p1=e.p.subtract(he.ONE),e.q1=e.q.subtract(he.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(he.ONE)!==0){e.p=e.q=null,n();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,i(e.qBits,s);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:Y.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Y.rsa.setPublicKey(e.n,e.e)},a(null,e.keys)}}function _t(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var a=z.util.hexToBytes(t);return a.length>1&&(a.charCodeAt(0)===0&&(a.charCodeAt(1)&128)===0||a.charCodeAt(0)===255&&(a.charCodeAt(1)&128)===128)?a.substr(1):a}function xp(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function Zl(e){return z.util.isNodejs&&typeof Bc[e]=="function"}function Jl(e){return typeof Ct.globalScope<"u"&&typeof Ct.globalScope.crypto=="object"&&typeof Ct.globalScope.crypto.subtle=="object"&&typeof Ct.globalScope.crypto.subtle[e]=="function"}function e0(e){return typeof Ct.globalScope<"u"&&typeof Ct.globalScope.msCrypto=="object"&&typeof Ct.globalScope.msCrypto.subtle=="object"&&typeof Ct.globalScope.msCrypto.subtle[e]=="function"}function t0(e){for(var t=z.util.hexToBytes(e.toString(16)),a=new Uint8Array(t.length),r=0;r<t.length;++r)a[r]=t.charCodeAt(r);return a}var K=J;if(typeof Tp>"u")var Tp=K.jsbn.BigInteger;var w=K.asn1,Z=K.pki=K.pki||{};Z.pbe=K.pbe=K.pbe||{};var ar=Z.oids,Sp={name:"EncryptedPrivateKeyInfo",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:w.Class.UNIVERSAL,type:w.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:w.Class.UNIVERSAL,type:w.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:w.Class.UNIVERSAL,type:w.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:w.Class.UNIVERSAL,type:w.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:w.Class.UNIVERSAL,type:w.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:w.Class.UNIVERSAL,type:w.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:w.Class.UNIVERSAL,type:w.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:w.Class.UNIVERSAL,type:w.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:w.Class.UNIVERSAL,type:w.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Ip={name:"pkcs-12PbeParams",tagClass:w.Class.UNIVERSAL,type:w.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:w.Class.UNIVERSAL,type:w.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:w.Class.UNIVERSAL,type:w.Type.INTEGER,constructed:!1,capture:"iterations"}]};Z.encryptPrivateKeyInfo=function(e,t,a){a=a||{},a.saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||"aes128",a.prfAlgorithm=a.prfAlgorithm||"sha1";var r=K.random.getBytesSync(a.saltSize),n=a.count,i=w.integerToDer(n),s,o,c;if(a.algorithm.indexOf("aes")===0||a.algorithm==="des"){var l,u,f;switch(a.algorithm){case"aes128":s=16,l=16,u=ar["aes128-CBC"],f=K.aes.createEncryptionCipher;break;case"aes192":s=24,l=16,u=ar["aes192-CBC"],f=K.aes.createEncryptionCipher;break;case"aes256":s=32,l=16,u=ar["aes256-CBC"],f=K.aes.createEncryptionCipher;break;case"des":s=8,l=8,u=ar.desCBC,f=K.des.createEncryptionCipher;break;default:var y=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw y.algorithm=a.algorithm,y}var E="hmacWith"+a.prfAlgorithm.toUpperCase(),v=n0(E),x=K.pkcs5.pbkdf2(t,r,n,s,v),T=K.random.getBytesSync(l),I=f(x);I.start(T),I.update(w.toDer(e)),I.finish(),c=I.output.getBytes();var B=bp(r,i,s,E);o=w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.OID,!1,w.oidToDer(ar.pkcs5PBES2).getBytes()),w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.OID,!1,w.oidToDer(ar.pkcs5PBKDF2).getBytes()),B]),w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.OID,!1,w.oidToDer(u).getBytes()),w.create(w.Class.UNIVERSAL,w.Type.OCTETSTRING,!1,T)])])])}else if(a.algorithm==="3des"){s=24;var U=new K.util.ByteBuffer(r),x=Z.pbe.generatePkcs12Key(t,U,1,n,s),T=Z.pbe.generatePkcs12Key(t,U,2,n,s),I=K.des.createEncryptionCipher(x);I.start(T),I.update(w.toDer(e)),I.finish(),c=I.output.getBytes(),o=w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.OID,!1,w.oidToDer(ar["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.OCTETSTRING,!1,r),w.create(w.Class.UNIVERSAL,w.Type.INTEGER,!1,i.getBytes())])])}else{var y=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw y.algorithm=a.algorithm,y}var D=w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[o,w.create(w.Class.UNIVERSAL,w.Type.OCTETSTRING,!1,c)]);return D},Z.decryptPrivateKeyInfo=function(e,t){var a=null,r={},n=[];if(!w.validate(e,Sp,r,n)){var i=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}var s=w.derToOid(r.encryptionOid),o=Z.pbe.getCipher(s,r.encryptionParams,t),c=K.util.createBuffer(r.encryptedData);return o.update(c),o.finish()&&(a=w.fromDer(o.output)),a},Z.encryptedPrivateKeyToPem=function(e,t){var a={type:"ENCRYPTED PRIVATE KEY",body:w.toDer(e).getBytes()};return K.pem.encode(a,{maxline:t})},Z.encryptedPrivateKeyFromPem=function(e){var t=K.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var a=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return w.fromDer(t.body)},Z.encryptRsaPrivateKey=function(e,t,a){if(a=a||{},!a.legacy){var r=Z.wrapRsaPrivateKey(Z.privateKeyToAsn1(e));return r=Z.encryptPrivateKeyInfo(r,t,a),Z.encryptedPrivateKeyToPem(r)}var n,i,s,o;switch(a.algorithm){case"aes128":n="AES-128-CBC",s=16,i=K.random.getBytesSync(16),o=K.aes.createEncryptionCipher;break;case"aes192":n="AES-192-CBC",s=24,i=K.random.getBytesSync(16),o=K.aes.createEncryptionCipher;break;case"aes256":n="AES-256-CBC",s=32,i=K.random.getBytesSync(16),o=K.aes.createEncryptionCipher;break;case"3des":n="DES-EDE3-CBC",s=24,i=K.random.getBytesSync(8),o=K.des.createEncryptionCipher;break;case"des":n="DES-CBC",s=8,i=K.random.getBytesSync(8),o=K.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+a.algorithm+'".');throw c.algorithm=a.algorithm,c}var l=K.pbe.opensslDeriveBytes(t,i.substr(0,8),s),u=o(l);u.start(i),u.update(w.toDer(Z.privateKeyToAsn1(e))),u.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:n,parameters:K.util.bytesToHex(i).toUpperCase()},body:u.output.getBytes()};return K.pem.encode(f)},Z.decryptRsaPrivateKey=function(e,t){var a=null,r=K.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw n.headerType=n,n}if(r.procType&&r.procType.type==="ENCRYPTED"){var i,s;switch(r.dekInfo.algorithm){case"DES-CBC":i=8,s=K.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,s=K.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,s=K.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,s=K.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,s=K.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,s=function(f){return K.rc2.createDecryptionCipher(f,40)};break;case"RC2-64-CBC":i=8,s=function(f){return K.rc2.createDecryptionCipher(f,64)};break;case"RC2-128-CBC":i=16,s=function(f){return K.rc2.createDecryptionCipher(f,128)};break;default:var n=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw n.algorithm=r.dekInfo.algorithm,n}var o=K.util.hexToBytes(r.dekInfo.parameters),c=K.pbe.opensslDeriveBytes(t,o.substr(0,8),i),l=s(c);if(l.start(o),l.update(K.util.createBuffer(r.body)),l.finish())a=l.output.getBytes();else return a}else a=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?a=Z.decryptPrivateKeyInfo(w.fromDer(a),t):a=w.fromDer(a),a!==null&&(a=Z.privateKeyFromAsn1(a)),a},Z.pbe.generatePkcs12Key=function(e,t,a,r,n,i){var s,o;if(typeof i>"u"||i===null){if(!("sha1"in K.md))throw new Error('"sha1" hash algorithm unavailable.');i=K.md.sha1.create()}var c=i.digestLength,l=i.blockLength,u=new K.util.ByteBuffer,f=new K.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)f.putInt16(e.charCodeAt(o));f.putInt16(0)}var y=f.length(),E=t.length(),v=new K.util.ByteBuffer;v.fillWithByte(a,l);var x=l*Math.ceil(E/l),T=new K.util.ByteBuffer;for(o=0;o<x;o++)T.putByte(t.at(o%E));var I=l*Math.ceil(y/l),B=new K.util.ByteBuffer;for(o=0;o<I;o++)B.putByte(f.at(o%y));var U=T;U.putBuffer(B);for(var D=Math.ceil(n/c),L=1;L<=D;L++){var P=new K.util.ByteBuffer;P.putBytes(v.bytes()),P.putBytes(U.bytes());for(var $=0;$<r;$++)i.start(),i.update(P.getBytes()),P=i.digest();var H=new K.util.ByteBuffer;for(o=0;o<l;o++)H.putByte(P.at(o%c));var pe=Math.ceil(E/l)+Math.ceil(y/l),ye=new K.util.ByteBuffer;for(s=0;s<pe;s++){var ve=new K.util.ByteBuffer(U.getBytes(l)),Ie=511;for(o=H.length()-1;o>=0;o--)Ie=Ie>>8,Ie+=H.at(o)+ve.at(o),ve.setAt(o,Ie&255);ye.putBuffer(ve)}U=ye,u.putBuffer(P)}return u.truncate(u.length()-n),u},Z.pbe.getCipher=function(e,t,a){switch(e){case Z.oids.pkcs5PBES2:return Z.pbe.getCipherForPBES2(e,t,a);case Z.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case Z.oids["pbewithSHAAnd40BitRC2-CBC"]:return Z.pbe.getCipherForPKCS12PBE(e,t,a);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}},Z.pbe.getCipherForPBES2=function(e,t,a){var r={},n=[];if(!w.validate(t,Ap,r,n)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}if(e=w.derToOid(r.kdfOid),e!==Z.oids.pkcs5PBKDF2){var i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw i.oid=e,i.supportedOids=["pkcs5PBKDF2"],i}if(e=w.derToOid(r.encOid),e!==Z.oids["aes128-CBC"]&&e!==Z.oids["aes192-CBC"]&&e!==Z.oids["aes256-CBC"]&&e!==Z.oids["des-EDE3-CBC"]&&e!==Z.oids.desCBC){var i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw i.oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i}var s=r.kdfSalt,o=K.util.createBuffer(r.kdfIterationCount);o=o.getInt(o.length()<<3);var c,l;switch(Z.oids[e]){case"aes128-CBC":c=16,l=K.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,l=K.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,l=K.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,l=K.des.createDecryptionCipher;break;case"desCBC":c=8,l=K.des.createDecryptionCipher;break}var u=a0(r.prfOid),f=K.pkcs5.pbkdf2(a,s,o,c,u),y=r.encIv,E=l(f);return E.start(y),E},Z.pbe.getCipherForPKCS12PBE=function(e,t,a){var r={},n=[];if(!w.validate(t,Ip,r,n)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}var s=K.util.createBuffer(r.salt),o=K.util.createBuffer(r.iterations);o=o.getInt(o.length()<<3);var c,l,u;switch(e){case Z.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,l=8,u=K.des.startDecrypting;break;case Z.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,l=8,u=function(x,T){var I=K.rc2.createDecryptionCipher(x,40);return I.start(T,null),I};break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=e,i}var f=a0(r.prfOid),y=Z.pbe.generatePkcs12Key(a,s,1,o,c,f);f.start();var E=Z.pbe.generatePkcs12Key(a,s,2,o,l,f);return u(y,E)},Z.pbe.opensslDeriveBytes=function(e,t,a,r){if(typeof r>"u"||r===null){if(!("md5"in K.md))throw new Error('"md5" hash algorithm unavailable.');r=K.md.md5.create()}t===null&&(t="");for(var n=[r0(r,e+t)],i=16,s=1;i<a;++s,i+=16)n.push(r0(r,n[s-1]+e+t));return n.join("").substr(0,a)};function r0(e,t){return e.start().update(t).digest().getBytes()}function a0(e){var t;if(!e)t="hmacWithSHA1";else if(t=Z.oids[w.derToOid(e)],!t){var a=new Error("Unsupported PRF OID.");throw a.oid=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}return n0(t)}function n0(e){var t=K.md;switch(e){case"hmacWithSHA224":t=K.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var a=new Error("Unsupported PRF algorithm.");throw a.algorithm=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function bp(e,t,a,r){var n=w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.OCTETSTRING,!1,e),w.create(w.Class.UNIVERSAL,w.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&n.value.push(w.create(w.Class.UNIVERSAL,w.Type.INTEGER,!1,K.util.hexToBytes(a.toString(16))),w.create(w.Class.UNIVERSAL,w.Type.SEQUENCE,!0,[w.create(w.Class.UNIVERSAL,w.Type.OID,!1,w.oidToDer(Z.oids[r]).getBytes()),w.create(w.Class.UNIVERSAL,w.Type.NULL,!1,"")])),n}var gr=J,M=gr.asn1,yr=gr.pkcs7asn1=gr.pkcs7asn1||{};gr.pkcs7=gr.pkcs7||{},gr.pkcs7.asn1=yr;var s0={name:"ContentInfo",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:M.Class.UNIVERSAL,type:M.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:M.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};yr.contentInfoValidator=s0;var i0={name:"EncryptedContentInfo",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:M.Class.UNIVERSAL,type:M.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:M.Class.UNIVERSAL,type:M.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:M.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:M.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};yr.envelopedDataValidator={name:"EnvelopedData",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:M.Class.UNIVERSAL,type:M.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:M.Class.UNIVERSAL,type:M.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(i0)},yr.encryptedDataValidator={name:"EncryptedData",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:M.Class.UNIVERSAL,type:M.Type.INTEGER,constructed:!1,capture:"version"}].concat(i0)};var Bp={name:"SignerInfo",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:M.Class.UNIVERSAL,type:M.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:M.Class.UNIVERSAL,type:M.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:M.Class.UNIVERSAL,type:M.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:M.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:M.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:M.Class.UNIVERSAL,type:M.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:M.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};yr.signedDataValidator={name:"SignedData",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:M.Class.UNIVERSAL,type:M.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:M.Class.UNIVERSAL,type:M.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s0,{name:"SignedData.Certificates",tagClass:M.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:M.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:M.Class.UNIVERSAL,type:M.Type.SET,capture:"signerInfos",optional:!0,value:[Bp]}]},yr.recipientInfoValidator={name:"RecipientInfo",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:M.Class.UNIVERSAL,type:M.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:M.Class.UNIVERSAL,type:M.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:M.Class.UNIVERSAL,type:M.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:M.Class.UNIVERSAL,type:M.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:M.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:M.Class.UNIVERSAL,type:M.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var nr=J;nr.mgf=nr.mgf||{};var wp=nr.mgf.mgf1=nr.mgf1=nr.mgf1||{};wp.create=function(e){var t={generate:function(a,r){for(var n=new nr.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s<i;s++){var o=new nr.util.ByteBuffer;o.putInt32(s),e.start(),e.update(a+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}};return t};var Wo=J;Wo.mgf=Wo.mgf||{},Wo.mgf.mgf1=Wo.mgf1;var sr=J,Up=sr.pss=sr.pss||{};Up.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,a=e.mgf,r=t.digestLength,n=e.salt||null;typeof n=="string"&&(n=sr.util.createBuffer(n));var i;if("saltLength"in e)i=e.saltLength;else if(n!==null)i=n.length();else throw new Error("Salt length not specified or specific salt not given.");if(n!==null&&n.length()!==i)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||sr.random,o={};return o.encode=function(c,l){var u,f=l-1,y=Math.ceil(f/8),E=c.digest().getBytes();if(y<r+i+2)throw new Error("Message is too long to encrypt.");var v;n===null?v=s.getBytesSync(i):v=n.bytes();var x=new sr.util.ByteBuffer;x.fillWithByte(0,8),x.putBytes(E),x.putBytes(v),t.start(),t.update(x.getBytes());var T=t.digest().getBytes(),I=new sr.util.ByteBuffer;I.fillWithByte(0,y-i-r-2),I.putByte(1),I.putBytes(v);var B=I.getBytes(),U=y-r-1,D=a.generate(T,U),L="";for(u=0;u<U;u++)L+=String.fromCharCode(B.charCodeAt(u)^D.charCodeAt(u));var P=65280>>8*y-f&255;return L=String.fromCharCode(L.charCodeAt(0)&~P)+L.substr(1),L+T+"\xBC"},o.verify=function(c,l,u){var f,y=u-1,E=Math.ceil(y/8);if(l=l.substr(-E),E<r+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(E-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var v=E-r-1,x=l.substr(0,v),T=l.substr(v,r),I=65280>>8*E-y&255;if((x.charCodeAt(0)&I)!==0)throw new Error("Bits beyond keysize not zero as expected.");var B=a.generate(T,v),U="";for(f=0;f<v;f++)U+=String.fromCharCode(x.charCodeAt(f)^B.charCodeAt(f));U=String.fromCharCode(U.charCodeAt(0)&~I)+U.substr(1);var D=E-r-i-2;for(f=0;f<D;f++)if(U.charCodeAt(f)!==0)throw new Error("Leftmost octets not zero as expected");if(U.charCodeAt(D)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var L=U.substr(-i),P=new sr.util.ByteBuffer;P.fillWithByte(0,8),P.putBytes(c),P.putBytes(L),t.start(),t.update(P.getBytes());var $=t.digest().getBytes();return T===$},o};var W=J,h=W.asn1,O=W.pki=W.pki||{},de=O.oids,we={};we.CN=de.commonName,we.commonName="CN",we.C=de.countryName,we.countryName="C",we.L=de.localityName,we.localityName="L",we.ST=de.stateOrProvinceName,we.stateOrProvinceName="ST",we.O=de.organizationName,we.organizationName="O",we.OU=de.organizationalUnitName,we.organizationalUnitName="OU",we.E=de.emailAddress,we.emailAddress="E";var o0=W.pki.rsa.publicKeyValidator,kp={name:"Certificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},o0,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},Np={name:"rsapss",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},Rp={name:"CertificationRequestInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},o0,{name:"CertificationRequestInfo.attributes",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0}]}]}]},_p={name:"CertificationRequest",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[Rp,{name:"CertificationRequest.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};O.RDNAttributesAsArray=function(e,t){for(var a=[],r,n,i,s=0;s<e.value.length;++s){r=e.value[s];for(var o=0;o<r.value.length;++o)i={},n=r.value[o],i.type=h.derToOid(n.value[0].value),i.value=n.value[1].value,i.valueTagClass=n.value[1].type,i.type in de&&(i.name=de[i.type],i.name in we&&(i.shortName=we[i.name])),t&&(t.update(i.type),t.update(i.value)),a.push(i)}return a},O.CRIAttributesAsArray=function(e){for(var t=[],a=0;a<e.length;++a)for(var r=e[a],n=h.derToOid(r.value[0].value),i=r.value[1].value,s=0;s<i.length;++s){var o={};if(o.type=n,o.value=i[s].value,o.valueTagClass=i[s].type,o.type in de&&(o.name=de[o.type],o.name in we&&(o.shortName=we[o.name])),o.type===de.extensionRequest){o.extensions=[];for(var c=0;c<o.value.length;++c)o.extensions.push(O.certificateExtensionFromAsn1(o.value[c]))}t.push(o)}return t};function Gt(e,t){typeof t=="string"&&(t={shortName:t});for(var a=null,r,n=0;a===null&&n<e.attributes.length;++n)r=e.attributes[n],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(a=r);return a}var zo=function(e,t,a){var r={};if(e!==de["RSASSA-PSS"])return r;a&&(r={hash:{algorithmOid:de.sha1},mgf:{algorithmOid:de.mgf1,hash:{algorithmOid:de.sha1}},saltLength:20});var n={},i=[];if(!h.validate(t,Np,n,i)){var s=new Error("Cannot read RSASSA-PSS parameter block.");throw s.errors=i,s}return n.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=h.derToOid(n.hashOid)),n.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=h.derToOid(n.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=h.derToOid(n.maskGenHashOid)),n.saltLength!==void 0&&(r.saltLength=n.saltLength.charCodeAt(0)),r},$o=function(e){switch(de[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return W.md.sha1.create();case"md5WithRSAEncryption":return W.md.md5.create();case"sha256WithRSAEncryption":return W.md.sha256.create();case"sha384WithRSAEncryption":return W.md.sha384.create();case"sha512WithRSAEncryption":return W.md.sha512.create();case"RSASSA-PSS":return W.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},c0=function(e){var t=e.certificate,a;switch(t.signatureOid){case de.sha1WithRSAEncryption:case de.sha1WithRSASignature:break;case de["RSASSA-PSS"]:var r,n;if(r=de[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||W.md[r]===void 0){var i=new Error("Unsupported MGF hash function.");throw i.oid=t.signatureParameters.mgf.hash.algorithmOid,i.name=r,i}if(n=de[t.signatureParameters.mgf.algorithmOid],n===void 0||W.mgf[n]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=t.signatureParameters.mgf.algorithmOid,i.name=n,i}if(n=W.mgf[n].create(W.md[r].create()),r=de[t.signatureParameters.hash.algorithmOid],r===void 0||W.md[r]===void 0){var i=new Error("Unsupported RSASSA-PSS hash function.");throw i.oid=t.signatureParameters.hash.algorithmOid,i.name=r,i}a=W.pss.create(W.md[r].create(),n,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,a)};O.certificateFromPem=function(e,t,a){var r=W.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var n=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var i=h.fromDer(r.body,a);return O.certificateFromAsn1(i,t)},O.certificateToPem=function(e,t){var a={type:"CERTIFICATE",body:h.toDer(O.certificateToAsn1(e)).getBytes()};return W.pem.encode(a,{maxline:t})},O.publicKeyFromPem=function(e){var t=W.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var a=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=h.fromDer(t.body);return O.publicKeyFromAsn1(r)},O.publicKeyToPem=function(e,t){var a={type:"PUBLIC KEY",body:h.toDer(O.publicKeyToAsn1(e)).getBytes()};return W.pem.encode(a,{maxline:t})},O.publicKeyToRSAPublicKeyPem=function(e,t){var a={type:"RSA PUBLIC KEY",body:h.toDer(O.publicKeyToRSAPublicKey(e)).getBytes()};return W.pem.encode(a,{maxline:t})},O.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||W.md.sha1.create(),r=t.type||"RSAPublicKey",n;switch(r){case"RSAPublicKey":n=h.toDer(O.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":n=h.toDer(O.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}a.start(),a.update(n);var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i},O.certificationRequestFromPem=function(e,t,a){var r=W.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var n=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var i=h.fromDer(r.body,a);return O.certificationRequestFromAsn1(i,t)},O.certificationRequestToPem=function(e,t){var a={type:"CERTIFICATE REQUEST",body:h.toDer(O.certificationRequestToAsn1(e)).getBytes()};return W.pem.encode(a,{maxline:t})},O.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return Gt(e.issuer,t)},e.issuer.addField=function(t){xt([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return Gt(e.subject,t)},e.subject.addField=function(t){xt([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,a){xt(t),e.subject.attributes=t,delete e.subject.uniqueId,a&&(e.subject.uniqueId=a),e.subject.hash=null},e.setIssuer=function(t,a){xt(t),e.issuer.attributes=t,delete e.issuer.uniqueId,a&&(e.issuer.uniqueId=a),e.issuer.hash=null},e.setExtensions=function(t){for(var a=0;a<t.length;++a)l0(t[a],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var a=null,r,n=0;a===null&&n<e.extensions.length;++n)r=e.extensions[n],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(a=r);return a},e.sign=function(t,a){e.md=a||W.md.sha1.create();var r=de[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=O.getTBSCertificate(e);var i=h.toDer(e.tbsCertificate);e.md.update(i.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var a=!1;if(!e.issued(t)){var r=t.issuer,n=e.subject,i=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw i.expectedIssuer=n.attributes,i.actualIssuer=r.attributes,i}var s=t.md;if(s===null){s=$o({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||O.getTBSCertificate(t),c=h.toDer(o);s.update(c.getBytes())}return s!==null&&(a=c0({certificate:e,md:s,signature:t.signature})),a},e.isIssuer=function(t){var a=!1,r=e.issuer,n=t.subject;if(r.hash&&n.hash)a=r.hash===n.hash;else if(r.attributes.length===n.attributes.length){a=!0;for(var i,s,o=0;a&&o<r.attributes.length;++o)i=r.attributes[o],s=n.attributes[o],(i.type!==s.type||i.value!==s.value)&&(a=!1)}return a},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return O.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=de.subjectKeyIdentifier,a=0;a<e.extensions.length;++a){var r=e.extensions[a];if(r.id===t){var n=e.generateSubjectKeyIdentifier().getBytes();return W.util.hexToBytes(r.subjectKeyIdentifier)===n}}return!1},e},O.certificateFromAsn1=function(e,t){var a={},r=[];if(!h.validate(e,kp,a,r)){var n=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw n.errors=r,n}var i=h.derToOid(a.publicKeyOid);if(i!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=O.createCertificate();s.version=a.certVersion?a.certVersion.charCodeAt(0):0;var o=W.util.createBuffer(a.certSerialNumber);s.serialNumber=o.toHex(),s.signatureOid=W.asn1.derToOid(a.certSignatureOid),s.signatureParameters=zo(s.signatureOid,a.certSignatureParams,!0),s.siginfo.algorithmOid=W.asn1.derToOid(a.certinfoSignatureOid),s.siginfo.parameters=zo(s.siginfo.algorithmOid,a.certinfoSignatureParams,!1),s.signature=a.certSignature;var c=[];if(a.certValidity1UTCTime!==void 0&&c.push(h.utcTimeToDate(a.certValidity1UTCTime)),a.certValidity2GeneralizedTime!==void 0&&c.push(h.generalizedTimeToDate(a.certValidity2GeneralizedTime)),a.certValidity3UTCTime!==void 0&&c.push(h.utcTimeToDate(a.certValidity3UTCTime)),a.certValidity4GeneralizedTime!==void 0&&c.push(h.generalizedTimeToDate(a.certValidity4GeneralizedTime)),c.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(c.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(s.validity.notBefore=c[0],s.validity.notAfter=c[1],s.tbsCertificate=a.tbsCertificate,t){s.md=$o({signatureOid:s.signatureOid,type:"certificate"});var l=h.toDer(s.tbsCertificate);s.md.update(l.getBytes())}var u=W.md.sha1.create(),f=h.toDer(a.certIssuer);u.update(f.getBytes()),s.issuer.getField=function(v){return Gt(s.issuer,v)},s.issuer.addField=function(v){xt([v]),s.issuer.attributes.push(v)},s.issuer.attributes=O.RDNAttributesAsArray(a.certIssuer),a.certIssuerUniqueId&&(s.issuer.uniqueId=a.certIssuerUniqueId),s.issuer.hash=u.digest().toHex();var y=W.md.sha1.create(),E=h.toDer(a.certSubject);return y.update(E.getBytes()),s.subject.getField=function(v){return Gt(s.subject,v)},s.subject.addField=function(v){xt([v]),s.subject.attributes.push(v)},s.subject.attributes=O.RDNAttributesAsArray(a.certSubject),a.certSubjectUniqueId&&(s.subject.uniqueId=a.certSubjectUniqueId),s.subject.hash=y.digest().toHex(),a.certExtensions?s.extensions=O.certificateExtensionsFromAsn1(a.certExtensions):s.extensions=[],s.publicKey=O.publicKeyFromAsn1(a.subjectPublicKeyInfo),s},O.certificateExtensionsFromAsn1=function(e){for(var t=[],a=0;a<e.value.length;++a)for(var r=e.value[a],n=0;n<r.value.length;++n)t.push(O.certificateExtensionFromAsn1(r.value[n]));return t},O.certificateExtensionFromAsn1=function(e){var t={};if(t.id=h.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===h.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in de){if(t.name=de[t.id],t.name==="keyUsage"){var a=h.fromDer(t.value),r=0,n=0;a.value.length>1&&(r=a.value.charCodeAt(1),n=a.value.length>2?a.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(n&128)===128}else if(t.name==="basicConstraints"){var a=h.fromDer(t.value);a.value.length>0&&a.value[0].type===h.Type.BOOLEAN?t.cA=a.value[0].value.charCodeAt(0)!==0:t.cA=!1;var i=null;a.value.length>0&&a.value[0].type===h.Type.INTEGER?i=a.value[0].value:a.value.length>1&&(i=a.value[1].value),i!==null&&(t.pathLenConstraint=h.derToInteger(i))}else if(t.name==="extKeyUsage")for(var a=h.fromDer(t.value),s=0;s<a.value.length;++s){var o=h.derToOid(a.value[s].value);o in de?t[de[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var a=h.fromDer(t.value),r=0;a.value.length>1&&(r=a.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var c,a=h.fromDer(t.value),l=0;l<a.value.length;++l){c=a.value[l];var u={type:c.type,value:c.value};switch(t.altNames.push(u),c.type){case 1:case 2:case 6:break;case 7:u.ip=W.util.bytesToIP(c.value);break;case 8:u.oid=h.derToOid(c.value);break}}}else if(t.name==="subjectKeyIdentifier"){var a=h.fromDer(t.value);t.subjectKeyIdentifier=W.util.bytesToHex(a.value)}}return t},O.certificationRequestFromAsn1=function(e,t){var a={},r=[];if(!h.validate(e,_p,a,r)){var n=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw n.errors=r,n}var i=h.derToOid(a.publicKeyOid);if(i!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=O.createCertificationRequest();if(s.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,s.signatureOid=W.asn1.derToOid(a.csrSignatureOid),s.signatureParameters=zo(s.signatureOid,a.csrSignatureParams,!0),s.siginfo.algorithmOid=W.asn1.derToOid(a.csrSignatureOid),s.siginfo.parameters=zo(s.siginfo.algorithmOid,a.csrSignatureParams,!1),s.signature=a.csrSignature,s.certificationRequestInfo=a.certificationRequestInfo,t){s.md=$o({signatureOid:s.signatureOid,type:"certification request"});var o=h.toDer(s.certificationRequestInfo);s.md.update(o.getBytes())}var c=W.md.sha1.create();return s.subject.getField=function(l){return Gt(s.subject,l)},s.subject.addField=function(l){xt([l]),s.subject.attributes.push(l)},s.subject.attributes=O.RDNAttributesAsArray(a.certificationRequestInfoSubject,c),s.subject.hash=c.digest().toHex(),s.publicKey=O.publicKeyFromAsn1(a.subjectPublicKeyInfo),s.getAttribute=function(l){return Gt(s,l)},s.addAttribute=function(l){xt([l]),s.attributes.push(l)},s.attributes=O.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),s},O.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return Gt(e.subject,t)},e.subject.addField=function(t){xt([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return Gt(e,t)},e.addAttribute=function(t){xt([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){xt(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){xt(t),e.attributes=t},e.sign=function(t,a){e.md=a||W.md.sha1.create();var r=de[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=O.getCertificationRequestInfo(e);var i=h.toDer(e.certificationRequestInfo);e.md.update(i.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,a=e.md;if(a===null){a=$o({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||O.getCertificationRequestInfo(e),n=h.toDer(r);a.update(n.getBytes())}return a!==null&&(t=c0({certificate:e,md:a,signature:e.signature})),t},e};function vr(e){for(var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),a,r,n=e.attributes,i=0;i<n.length;++i){a=n[i];var s=a.value,o=h.Type.PRINTABLESTRING;"valueTagClass"in a&&(o=a.valueTagClass,o===h.Type.UTF8&&(s=W.util.encodeUtf8(s))),r=h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(a.type).getBytes()),h.create(h.Class.UNIVERSAL,o,!1,s)])]),t.value.push(r)}return t}function xt(e){for(var t,a=0;a<e.length;++a){if(t=e[a],typeof t.name>"u"&&(t.type&&t.type in O.oids?t.name=O.oids[t.type]:t.shortName&&t.shortName in we&&(t.name=O.oids[we[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in O.oids)t.type=O.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in we&&(t.shortName=we[t.name]),t.type===de.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=h.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(O.certificateExtensionToAsn1(l0(t.extensions[n])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function l0(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in O.oids&&(e.name=O.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in O.oids)e.id=O.oids[e.name];else{var a=new Error("Extension ID not specified.");throw a.extension=e,a}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,n=0,i=0;e.digitalSignature&&(n|=128,r=7),e.nonRepudiation&&(n|=64,r=6),e.keyEncipherment&&(n|=32,r=5),e.dataEncipherment&&(n|=16,r=4),e.keyAgreement&&(n|=8,r=3),e.keyCertSign&&(n|=4,r=2),e.cRLSign&&(n|=2,r=1),e.encipherOnly&&(n|=1,r=0),e.decipherOnly&&(i|=128,r=7);var s=String.fromCharCode(r);i!==0?s+=String.fromCharCode(n)+String.fromCharCode(i):n!==0&&(s+=String.fromCharCode(n)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="basicConstraints")e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var c in e)e[c]===!0&&(c in de?o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(de[c]).getBytes())):c.indexOf(".")!==-1&&o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(c).getBytes())))}else if(e.name==="nsCertType"){var r=0,n=0;e.client&&(n|=128,r=7),e.server&&(n|=64,r=6),e.email&&(n|=32,r=5),e.objsign&&(n|=16,r=4),e.reserved&&(n|=8,r=3),e.sslCA&&(n|=4,r=2),e.emailCA&&(n|=2,r=1),e.objCA&&(n|=1,r=0);var s=String.fromCharCode(r);n!==0&&(s+=String.fromCharCode(n)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var s=l.value;if(l.type===7&&l.ip){if(s=W.util.bytesFromIP(l.ip),s===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?s=h.oidToDer(h.oidToDer(l.oid)):s=h.oidToDer(s));e.value.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,s))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=h.create(h.Class.UNIVERSAL,h.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var f=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=f.toHex(),e.value=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,f.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var y=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!1,y))}if(e.authorityCertIssuer){var E=[h.create(h.Class.CONTEXT_SPECIFIC,4,!0,[vr(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,E))}if(e.serialNumber){var v=W.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if(e.name==="cRLDistributionPoints"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var o=e.value.value,x=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),T=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]),l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var s=l.value;if(l.type===7&&l.ip){if(s=W.util.bytesFromIP(l.ip),s===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?s=h.oidToDer(h.oidToDer(l.oid)):s=h.oidToDer(s));T.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,s))}x.value.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[T])),o.push(x)}if(typeof e.value>"u"){var a=new Error("Extension value not specified.");throw a.extension=e,a}return e}function wc(e,t){switch(e){case de["RSASSA-PSS"]:var a=[];return t.hash.algorithmOid!==void 0&&a.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&a.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&a.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(t.saltLength).getBytes())])),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,a);default:return h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")}}function Lp(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var a=e.attributes,r=0;r<a.length;++r){var n=a[r],i=n.value,s=h.Type.UTF8;"valueTagClass"in n&&(s=n.valueTagClass),s===h.Type.UTF8&&(i=W.util.encodeUtf8(i));var o=!1;"valueConstructed"in n&&(o=n.valueConstructed);var c=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(n.type).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,s,o,i)])]);t.value.push(c)}return t}var Dp=new Date("1950-01-01T00:00:00Z"),Pp=new Date("2050-01-01T00:00:00Z");function u0(e){return e>=Dp&&e<Pp?h.create(h.Class.UNIVERSAL,h.Type.UTCTIME,!1,h.dateToUtcTime(e)):h.create(h.Class.UNIVERSAL,h.Type.GENERALIZEDTIME,!1,h.dateToGeneralizedTime(e))}O.getTBSCertificate=function(e){var t=u0(e.validity.notBefore),a=u0(e.validity.notAfter),r=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes())]),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,W.util.hexToBytes(e.serialNumber)),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.siginfo.algorithmOid).getBytes()),wc(e.siginfo.algorithmOid,e.siginfo.parameters)]),vr(e.issuer),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,a]),vr(e.subject),O.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(O.certificateExtensionsToAsn1(e.extensions)),r},O.getCertificationRequestInfo=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),vr(e.subject),O.publicKeyToAsn1(e.publicKey),Lp(e)]);return t},O.distinguishedNameToAsn1=function(e){return vr(e)},O.certificateToAsn1=function(e){var t=e.tbsCertificate||O.getTBSCertificate(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),wc(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])},O.certificateExtensionsToAsn1=function(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,3,!0,[]),a=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(a);for(var r=0;r<e.length;++r)a.value.push(O.certificateExtensionToAsn1(e[r]));return t},O.certificateExtensionToAsn1=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.id).getBytes())),e.critical&&t.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF"));var a=e.value;return typeof e.value!="string"&&(a=h.toDer(a).getBytes()),t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,a)),t},O.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||O.getCertificationRequestInfo(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),wc(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])},O.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(s){var o=a(s.issuer);return o},t.addCertificate=function(s){if(typeof s=="string"&&(s=W.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))if(s.subject.hash in t.certs){var o=t.certs[s.subject.hash];W.util.isArray(o)||(o=[o]),o.push(s),t.certs[s.subject.hash]=o}else t.certs[s.subject.hash]=s},t.hasCertificate=function(s){typeof s=="string"&&(s=W.pki.certificateFromPem(s));var o=a(s.subject);if(!o)return!1;W.util.isArray(o)||(o=[o]);for(var c=h.toDer(O.certificateToAsn1(s)).getBytes(),l=0;l<o.length;++l){var u=h.toDer(O.certificateToAsn1(o[l])).getBytes();if(c===u)return!0}return!1},t.listAllCertificates=function(){var s=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var c=t.certs[o];if(!W.util.isArray(c))s.push(c);else for(var l=0;l<c.length;++l)s.push(c[l])}return s},t.removeCertificate=function(s){var o;if(typeof s=="string"&&(s=W.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))return null;var c=a(s.subject);if(!W.util.isArray(c))return o=t.certs[s.subject.hash],delete t.certs[s.subject.hash],o;for(var l=h.toDer(O.certificateToAsn1(s)).getBytes(),u=0;u<c.length;++u){var f=h.toDer(O.certificateToAsn1(c[u])).getBytes();l===f&&(o=c[u],c.splice(u,1))}return c.length===0&&delete t.certs[s.subject.hash],o};function a(s){return r(s),t.certs[s.hash]||null}function r(s){if(!s.hash){var o=W.md.sha1.create();s.attributes=O.RDNAttributesAsArray(vr(s),o),s.hash=o.digest().toHex()}}if(e)for(var n=0;n<e.length;++n){var i=e[n];t.addCertificate(i)}return t},O.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},O.verifyCertificateChain=function(e,t,a){typeof a=="function"&&(a={verify:a}),a=a||{},t=t.slice(0);var r=t.slice(0),n=a.validityCheckDate;typeof n>"u"&&(n=new Date);var i=!0,s=null,o=0;do{var c=t.shift(),l=null,u=!1;if(n&&(n<c.validity.notBefore||n>c.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:O.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:n}),s===null){if(l=t[0]||e.getIssuer(c),l===null&&c.isIssuer(c)&&(u=!0,l=c),l){var f=l;W.util.isArray(f)||(f=[f]);for(var y=!1;!y&&f.length>0;){l=f.shift();try{y=l.verify(c)}catch{}}y||(s={message:"Certificate signature is invalid.",error:O.certificateError.bad_certificate})}s===null&&(!l||u)&&!e.hasCertificate(c)&&(s={message:"Certificate is not trusted.",error:O.certificateError.unknown_ca})}if(s===null&&l&&!c.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:O.certificateError.bad_certificate}),s===null)for(var E={keyUsage:!0,basicConstraints:!0},v=0;s===null&&v<c.extensions.length;++v){var x=c.extensions[v];x.critical&&!(x.name in E)&&(s={message:"Certificate has an unsupported critical extension.",error:O.certificateError.unsupported_certificate})}if(s===null&&(!i||t.length===0&&(!l||u))){var T=c.getExtension("basicConstraints"),I=c.getExtension("keyUsage");if(I!==null&&(!I.keyCertSign||T===null)&&(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:O.certificateError.bad_certificate}),s===null&&T===null&&(s={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:O.certificateError.bad_certificate}),s===null&&T!==null&&!T.cA&&(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:O.certificateError.bad_certificate}),s===null&&I!==null&&"pathLenConstraint"in T){var B=o-1;B>T.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:O.certificateError.bad_certificate})}}var U=s===null?!0:s.error,D=a.verify?a.verify(U,o,r):U;if(D===!0)s=null;else throw U===!0&&(s={message:"The application rejected the certificate.",error:O.certificateError.bad_certificate}),(D||D===0)&&(typeof D=="object"&&!W.util.isArray(D)?(D.message&&(s.message=D.message),D.error&&(s.error=D.error)):typeof D=="string"&&(s.error=D)),s;i=!1,++o}while(t.length>0);return!0};var xe=J,C=xe.asn1,te=xe.pki,xo=xe.pkcs12=xe.pkcs12||{},f0={name:"ContentInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},Op={name:"PFX",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"version"},f0,{name:"PFX.macData",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:C.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},Vp={name:"SafeBag",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},Fp={name:"Attribute",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,capture:"values"}]},Mp={name:"CertBag",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:C.Class.UNIVERSAL,type:C.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function To(e,t,a,r){for(var n=[],i=0;i<e.length;i++)for(var s=0;s<e[i].safeBags.length;s++){var o=e[i].safeBags[s];if(!(r!==void 0&&o.type!==r)){if(t===null){n.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(a)>=0&&n.push(o)}}return n}xo.pkcs12FromAsn1=function(e,t,a){typeof t=="string"?(a=t,t=!0):t===void 0&&(t=!0);var r={},n=[];if(!C.validate(e,Op,r,n)){var i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw i.errors=i,i}var s={version:r.version.charCodeAt(0),safeContents:[],getBags:function(T){var I={},B;return"localKeyId"in T?B=T.localKeyId:"localKeyIdHex"in T&&(B=xe.util.hexToBytes(T.localKeyIdHex)),B===void 0&&!("friendlyName"in T)&&"bagType"in T&&(I[T.bagType]=To(s.safeContents,null,null,T.bagType)),B!==void 0&&(I.localKeyId=To(s.safeContents,"localKeyId",B,T.bagType)),"friendlyName"in T&&(I.friendlyName=To(s.safeContents,"friendlyName",T.friendlyName,T.bagType)),I},getBagsByFriendlyName:function(T,I){return To(s.safeContents,"friendlyName",T,I)},getBagsByLocalKeyId:function(T,I){return To(s.safeContents,"localKeyId",T,I)}};if(r.version.charCodeAt(0)!==3){var i=new Error("PKCS#12 PFX of version other than 3 not supported.");throw i.version=r.version.charCodeAt(0),i}if(C.derToOid(r.contentType)!==te.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=C.derToOid(r.contentType),i}var o=r.content.value[0];if(o.tagClass!==C.Class.UNIVERSAL||o.type!==C.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Uc(o),r.mac){var c=null,l=0,u=C.derToOid(r.macAlgorithm);switch(u){case te.oids.sha1:c=xe.md.sha1.create(),l=20;break;case te.oids.sha256:c=xe.md.sha256.create(),l=32;break;case te.oids.sha384:c=xe.md.sha384.create(),l=48;break;case te.oids.sha512:c=xe.md.sha512.create(),l=64;break;case te.oids.md5:c=xe.md.md5.create(),l=16;break}if(c===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+u);var f=new xe.util.ByteBuffer(r.macSalt),y="macIterations"in r?parseInt(xe.util.bytesToHex(r.macIterations),16):1,E=xo.generateKey(a,f,3,y,l,c),v=xe.hmac.create();v.start(c,E),v.update(o.value);var x=v.getMac();if(x.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return Kp(s,o.value,t,a),s};function Uc(e){if(e.composed||e.constructed){for(var t=xe.util.createBuffer(),a=0;a<e.value.length;++a)t.putBytes(e.value[a].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function Kp(e,t,a,r){if(t=C.fromDer(t,a),t.tagClass!==C.Class.UNIVERSAL||t.type!==C.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var n=0;n<t.value.length;n++){var i=t.value[n],s={},o=[];if(!C.validate(i,f0,s,o)){var c=new Error("Cannot read ContentInfo.");throw c.errors=o,c}var l={encrypted:!1},u=null,f=s.content.value[0];switch(C.derToOid(s.contentType)){case te.oids.data:if(f.tagClass!==C.Class.UNIVERSAL||f.type!==C.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");u=Uc(f).value;break;case te.oids.encryptedData:u=qp(f,r),l.encrypted=!0;break;default:var c=new Error("Unsupported PKCS#12 contentType.");throw c.contentType=C.derToOid(s.contentType),c}l.safeBags=Hp(u,a,r),e.safeContents.push(l)}}function qp(e,t){var a={},r=[];if(!C.validate(e,xe.pkcs7.asn1.encryptedDataValidator,a,r)){var n=new Error("Cannot read EncryptedContentInfo.");throw n.errors=r,n}var i=C.derToOid(a.contentType);if(i!==te.oids.data){var n=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw n.oid=i,n}i=C.derToOid(a.encAlgorithm);var s=te.pbe.getCipher(i,a.encParameter,t),o=Uc(a.encryptedContentAsn1),c=xe.util.createBuffer(o.value);if(s.update(c),!s.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return s.output.getBytes()}function Hp(e,t,a){if(!t&&e.length===0)return[];if(e=C.fromDer(e,t),e.tagClass!==C.Class.UNIVERSAL||e.type!==C.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],n=0;n<e.value.length;n++){var i=e.value[n],s={},o=[];if(!C.validate(i,Vp,s,o)){var c=new Error("Cannot read SafeBag.");throw c.errors=o,c}var l={type:C.derToOid(s.bagId),attributes:Gp(s.bagAttributes)};r.push(l);var u,f,y=s.bagValue.value[0];switch(l.type){case te.oids.pkcs8ShroudedKeyBag:if(y=te.decryptPrivateKeyInfo(y,a),y===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case te.oids.keyBag:try{l.key=te.privateKeyFromAsn1(y)}catch{l.key=null,l.asn1=y}continue;case te.oids.certBag:u=Mp,f=function(){if(C.derToOid(s.certId)!==te.oids.x509Certificate){var v=new Error("Unsupported certificate type, only X.509 supported.");throw v.oid=C.derToOid(s.certId),v}var x=C.fromDer(s.cert,t);try{l.cert=te.certificateFromAsn1(x,!0)}catch{l.cert=null,l.asn1=x}};break;default:var c=new Error("Unsupported PKCS#12 SafeBag type.");throw c.oid=l.type,c}if(u!==void 0&&!C.validate(y,u,s,o)){var c=new Error("Cannot read PKCS#12 "+u.name);throw c.errors=o,c}f()}return r}function Gp(e){var t={};if(e!==void 0)for(var a=0;a<e.length;++a){var r={},n=[];if(!C.validate(e[a],Fp,r,n)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=n,i}var s=C.derToOid(r.oid);if(te.oids[s]!==void 0){t[te.oids[s]]=[];for(var o=0;o<r.values.length;++o)t[te.oids[s]].push(r.values[o].value)}}return t}xo.toPkcs12Asn1=function(e,t,a,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var n=r.localKeyId,i;if(n!==null)n=xe.util.hexToBytes(n);else if(r.generateLocalKeyId)if(t){var s=xe.util.isArray(t)?t[0]:t;typeof s=="string"&&(s=te.certificateFromPem(s));var o=xe.md.sha1.create();o.update(C.toDer(te.certificateToAsn1(s)).getBytes()),n=o.digest().getBytes()}else n=xe.random.getBytes(20);var c=[];n!==null&&c.push(C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.localKeyId).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SET,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,n)])])),"friendlyName"in r&&c.push(C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.friendlyName).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SET,!0,[C.create(C.Class.UNIVERSAL,C.Type.BMPSTRING,!1,r.friendlyName)])])),c.length>0&&(i=C.create(C.Class.UNIVERSAL,C.Type.SET,!0,c));var l=[],u=[];t!==null&&(xe.util.isArray(t)?u=t:u=[t]);for(var f=[],y=0;y<u.length;++y){t=u[y],typeof t=="string"&&(t=te.certificateFromPem(t));var E=y===0?i:void 0,v=te.certificateToAsn1(t),x=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.certBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.x509Certificate).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(v).getBytes())])])]),E]);f.push(x)}if(f.length>0){var T=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,f),I=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(T).getBytes())])]);l.push(I)}var B=null;if(e!==null){var U=te.wrapRsaPrivateKey(te.privateKeyToAsn1(e));a===null?B=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.keyBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[U]),i]):B=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.pkcs8ShroudedKeyBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[te.encryptPrivateKeyInfo(U,a,r)]),i]);var D=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[B]),L=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(D).getBytes())])]);l.push(L)}var P=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,l),$;if(r.useMac){var o=xe.md.sha1.create(),H=new xe.util.ByteBuffer(xe.random.getBytes(r.saltSize)),pe=r.count,e=xo.generateKey(a,H,3,pe,20),ye=xe.hmac.create();ye.start(o,e),ye.update(C.toDer(P).getBytes());var ve=ye.getMac();$=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.sha1).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.NULL,!1,"")]),C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,ve.getBytes())]),C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,H.getBytes()),C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(pe).getBytes())])}return C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(3).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(P).getBytes())])]),$])},xo.generateKey=xe.pbe.generatePkcs12Key;var Wt=J,kc=Wt.asn1,mr=Wt.pki=Wt.pki||{};mr.pemToDer=function(e){var t=Wt.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Wt.util.createBuffer(t.body)},mr.privateKeyFromPem=function(e){var t=Wt.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=kc.fromDer(t.body);return mr.privateKeyFromAsn1(r)},mr.privateKeyToPem=function(e,t){var a={type:"RSA PRIVATE KEY",body:kc.toDer(mr.privateKeyToAsn1(e)).getBytes()};return Wt.pem.encode(a,{maxline:t})},mr.privateKeyInfoToPem=function(e,t){var a={type:"PRIVATE KEY",body:kc.toDer(e).getBytes()};return Wt.pem.encode(a,{maxline:t})};var N=J,Qo=function(e,t,a,r){var n=N.util.createBuffer(),i=e.length>>1,s=i+(e.length&1),o=e.substr(0,s),c=e.substr(i,s),l=N.util.createBuffer(),u=N.hmac.create();a=t+a;var f=Math.ceil(r/16),y=Math.ceil(r/20);u.start("MD5",o);var E=N.util.createBuffer();l.putBytes(a);for(var v=0;v<f;++v)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+a),E.putBuffer(u.digest());u.start("SHA1",c);var x=N.util.createBuffer();l.clear(),l.putBytes(a);for(var v=0;v<y;++v)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+a),x.putBuffer(u.digest());return n.putBytes(N.util.xorBytes(E.getBytes(),x.getBytes(),r)),n},Wp=function(e,t,a){var r=N.hmac.create();r.start("SHA1",e);var n=N.util.createBuffer();return n.putInt32(t[0]),n.putInt32(t[1]),n.putByte(a.type),n.putByte(a.version.major),n.putByte(a.version.minor),n.putInt16(a.length),n.putBytes(a.fragment.bytes()),r.update(n.getBytes()),r.digest().getBytes()},zp=function(e,t,a){var r=!1;try{var n=e.deflate(t.fragment.getBytes());t.fragment=N.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},$p=function(e,t,a){var r=!1;try{var n=e.inflate(t.fragment.getBytes());t.fragment=N.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},pt=function(e,t){var a=0;switch(t){case 1:a=e.getByte();break;case 2:a=e.getInt16();break;case 3:a=e.getInt24();break;case 4:a=e.getInt32();break}return N.util.createBuffer(e.getBytes(a))},Tt=function(e,t,a){e.putInt(a.length(),t<<3),e.putBuffer(a)},g={};g.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},g.SupportedVersions=[g.Versions.TLS_1_1,g.Versions.TLS_1_0],g.Version=g.SupportedVersions[0],g.MaxFragment=15360,g.ConnectionEnd={server:0,client:1},g.PRFAlgorithm={tls_prf_sha256:0},g.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},g.CipherType={stream:0,block:1,aead:2},g.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},g.CompressionMethod={none:0,deflate:1},g.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},g.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},g.Alert={},g.Alert.Level={warning:1,fatal:2},g.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},g.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},g.CipherSuites={},g.getCipherSuite=function(e){var t=null;for(var a in g.CipherSuites){var r=g.CipherSuites[a];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t},g.handleUnexpected=function(e,t){var a=!e.open&&e.entity===g.ConnectionEnd.client;a||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})},g.handleHelloRequest=function(e,t,a){!e.handshaking&&e.handshakes>0&&(g.queue(e,g.createAlert(e,{level:g.Alert.Level.warning,description:g.Alert.Description.no_renegotiation})),g.flush(e)),e.process()},g.parseHelloMessage=function(e,t,a){var r=null,n=e.entity===g.ConnectionEnd.client;if(a<38)e.error(e,{message:n?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});else{var i=t.fragment,s=i.length();if(r={version:{major:i.getByte(),minor:i.getByte()},random:N.util.createBuffer(i.getBytes(32)),session_id:pt(i,1),extensions:[]},n?(r.cipher_suite=i.getBytes(2),r.compression_method=i.getByte()):(r.cipher_suites=pt(i,2),r.compression_methods=pt(i,1)),s=a-(s-i.length()),s>0){for(var o=pt(i,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:pt(o,2)});if(!n)for(var c=0;c<r.extensions.length;++c){var l=r.extensions[c];if(l.type[0]===0&&l.type[1]===0)for(var u=pt(l.data,2);u.length()>0;){var f=u.getByte();if(f!==0)break;e.session.extensions.server_name.serverNameList.push(pt(u,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});if(n)e.session.cipherSuite=g.getCipherSuite(r.cipher_suite);else for(var y=N.util.createBuffer(r.cipher_suites.bytes());y.length()>0&&(e.session.cipherSuite=g.getCipherSuite(y.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure},cipherSuite:N.util.bytesToHex(r.cipher_suite)});n?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=g.CompressionMethod.none}return r},g.createSecurityParameters=function(e,t){var a=e.entity===g.ConnectionEnd.client,r=t.random.bytes(),n=a?e.session.sp.client_random:r,i=a?r:g.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:g.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:n,server_random:i}},g.handleServerHello=function(e,t,a){var r=g.parseHelloMessage(e,t,a);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});e.session.version=e.version;var n=r.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=h0,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=Xp,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.session.id=n,e.process()}},g.handleClientHello=function(e,t,a){var r=g.parseHelloMessage(e,t,a);if(!e.fail){var n=r.session_id.bytes(),i=null;if(e.sessionCache&&(i=e.sessionCache.getSession(n),i===null?n="":(i.version.major!==r.version.major||i.version.minor>r.version.minor)&&(i=null,n="")),n.length===0&&(n=N.random.getBytes(32)),e.session.id=n,e.session.clientHelloVersion=r.version,e.session.sp={},i)e.version=e.session.version=i.version,e.session.sp=i.sp;else{for(var s,o=1;o<g.SupportedVersions.length&&(s=g.SupportedVersions[o],!(s.minor<=r.version.minor));++o);e.version={major:s.major,minor:s.minor},e.session.version=e.version}i!==null?(e.expect=Rc,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?r1:Nc,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.open=!0,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHello(e)})),e.session.resuming?(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.pending=g.createConnectionState(e),e.state.current.write=e.state.pending.write,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))):(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)})),e.fail||(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerKeyExchange(e)})),e.verifyClient!==!1&&g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificateRequest(e)})),g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHelloDone(e)})))),g.flush(e),e.process()}},g.handleCertificate=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_list:pt(r,3)},i,s,o=[];try{for(;n.certificate_list.length()>0;)i=pt(n.certificate_list,3),s=N.asn1.fromDer(i),i=N.pki.certificateFromAsn1(s,!0),o.push(i)}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var c=e.entity===g.ConnectionEnd.client;(c||e.verifyClient===!0)&&o.length===0?e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}}):o.length===0?e.expect=c?d0:Nc:(c?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],g.verifyCertificateChain(e,o)&&(e.expect=c?d0:Nc)),e.process()},g.handleServerKeyExchange=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});e.expect=jp,e.process()},g.handleClientKeyExchange=function(e,t,a){if(a<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});var r=t.fragment,n={enc_pre_master_secret:pt(r,2).getBytes()},i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.serverCertificate),i=N.pki.privateKeyFromPem(i)}catch(c){e.error(e,{message:"Could not get private key.",cause:c,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}if(i===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=i.decrypt(n.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==s.pre_master_secret.charCodeAt(0)||o.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{s.pre_master_secret=N.random.getBytes(48)}e.expect=Rc,e.session.clientCertificate!==null&&(e.expect=a1),e.process()},g.handleCertificateRequest=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_types:pt(r,1),certificate_authorities:pt(r,2)};e.session.certificateRequest=n,e.expect=Yp,e.process()},g.handleCertificateVerify=function(e,t,a){if(a<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var i={signature:pt(r,2).getBytes()},s=N.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(s,i.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(n),e.session.sha1.update(n)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure}})}e.expect=Rc,e.process()},g.handleServerHelloDone=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.insufficient_security}},n=0,i=e.verify(e,r.alert.description,n,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!N.util.isArray(i)?(i.message&&(r.message=i.message),i.alert&&(r.alert.description=i.alert)):typeof i=="number"&&(r.alert.description=i)),e.error(e,r)}e.session.certificateRequest!==null&&(t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)}),g.queue(e,t)),t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createClientKeyExchange(e)}),g.queue(e,t),e.expect=e1;var s=function(o,c){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createCertificateVerify(o,c)})),g.queue(o,g.createRecord(o,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),o.state.pending=g.createConnectionState(o),o.state.current.write=o.state.pending.write,g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createFinished(o)})),o.expect=h0,g.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return s(e,null);g.getClientSignature(e,s)},g.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var a=e.entity===g.ConnectionEnd.client;(e.session.resuming&&a||!e.session.resuming&&!a)&&(e.state.pending=g.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&a||e.session.resuming&&!a)&&(e.state.pending=null),e.expect=a?Zp:n1,e.process()},g.handleFinished=function(e,t,a){var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var i=t.fragment.getBytes();r=N.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var s=e.entity===g.ConnectionEnd.client,o=s?"server finished":"client finished",c=e.session.sp,l=12,u=Qo;if(r=u(c.master_secret,o,r.getBytes(),l),r.getBytes()!==i)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decrypt_error}});e.session.md5.update(n),e.session.sha1.update(n),(e.session.resuming&&s||!e.session.resuming&&!s)&&(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))),e.expect=s?Jp:s1,e.handshaking=!1,++e.handshakes,e.peerCertificate=s?e.session.serverCertificate:e.session.clientCertificate,g.flush(e),e.isConnected=!0,e.connected(e),e.process()},g.handleAlert=function(e,t){var a=t.fragment,r={level:a.getByte(),description:a.getByte()},n;switch(r.description){case g.Alert.Description.close_notify:n="Connection closed.";break;case g.Alert.Description.unexpected_message:n="Unexpected message.";break;case g.Alert.Description.bad_record_mac:n="Bad record MAC.";break;case g.Alert.Description.decryption_failed:n="Decryption failed.";break;case g.Alert.Description.record_overflow:n="Record overflow.";break;case g.Alert.Description.decompression_failure:n="Decompression failed.";break;case g.Alert.Description.handshake_failure:n="Handshake failure.";break;case g.Alert.Description.bad_certificate:n="Bad certificate.";break;case g.Alert.Description.unsupported_certificate:n="Unsupported certificate.";break;case g.Alert.Description.certificate_revoked:n="Certificate revoked.";break;case g.Alert.Description.certificate_expired:n="Certificate expired.";break;case g.Alert.Description.certificate_unknown:n="Certificate unknown.";break;case g.Alert.Description.illegal_parameter:n="Illegal parameter.";break;case g.Alert.Description.unknown_ca:n="Unknown certificate authority.";break;case g.Alert.Description.access_denied:n="Access denied.";break;case g.Alert.Description.decode_error:n="Decode error.";break;case g.Alert.Description.decrypt_error:n="Decrypt error.";break;case g.Alert.Description.export_restriction:n="Export restriction.";break;case g.Alert.Description.protocol_version:n="Unsupported protocol version.";break;case g.Alert.Description.insufficient_security:n="Insufficient security.";break;case g.Alert.Description.internal_error:n="Internal error.";break;case g.Alert.Description.user_canceled:n="User canceled.";break;case g.Alert.Description.no_renegotiation:n="Renegotiation not supported.";break;default:n="Unknown error.";break}if(r.description===g.Alert.Description.close_notify)return e.close();e.error(e,{message:n,send:!1,origin:e.entity===g.ConnectionEnd.client?"server":"client",alert:r}),e.process()},g.handleHandshake=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt24();if(n>a.length())return e.fragmented=t,t.fragment=N.util.createBuffer(),a.read-=4,e.process();e.fragmented=null,a.read-=4;var i=a.bytes(n+4);a.read+=4,r in jo[e.entity][e.expect]?(e.entity===g.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:N.md.md5.create(),sha1:N.md.sha1.create()}),r!==g.HandshakeType.hello_request&&r!==g.HandshakeType.certificate_verify&&r!==g.HandshakeType.finished&&(e.session.md5.update(i),e.session.sha1.update(i)),jo[e.entity][e.expect][r](e,t,n)):g.handleUnexpected(e,t)},g.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},g.handleHeartbeat=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt16(),i=a.getBytes(n);if(r===g.HeartbeatMessageType.heartbeat_request){if(e.handshaking||n>i.length)return e.process();g.queue(e,g.createRecord(e,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_response,i)})),g.flush(e)}else if(r===g.HeartbeatMessageType.heartbeat_response){if(i!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,N.util.createBuffer(i))}e.process()};var Qp=0,Xp=1,d0=2,jp=3,Yp=4,h0=5,Zp=6,Jp=7,e1=8,t1=0,r1=1,Nc=2,a1=3,Rc=4,n1=5,s1=6,p=g.handleUnexpected,p0=g.handleChangeCipherSpec,Oe=g.handleAlert,ct=g.handleHandshake,g0=g.handleApplicationData,Ve=g.handleHeartbeat,_c=[];_c[g.ConnectionEnd.client]=[[p,Oe,ct,p,Ve],[p,Oe,ct,p,Ve],[p,Oe,ct,p,Ve],[p,Oe,ct,p,Ve],[p,Oe,ct,p,Ve],[p0,Oe,p,p,Ve],[p,Oe,ct,p,Ve],[p,Oe,ct,g0,Ve],[p,Oe,ct,p,Ve]],_c[g.ConnectionEnd.server]=[[p,Oe,ct,p,Ve],[p,Oe,ct,p,Ve],[p,Oe,ct,p,Ve],[p,Oe,ct,p,Ve],[p0,Oe,p,p,Ve],[p,Oe,ct,p,Ve],[p,Oe,ct,g0,Ve],[p,Oe,ct,p,Ve]];var zt=g.handleHelloRequest,i1=g.handleServerHello,y0=g.handleCertificate,v0=g.handleServerKeyExchange,Lc=g.handleCertificateRequest,Xo=g.handleServerHelloDone,m0=g.handleFinished,jo=[];jo[g.ConnectionEnd.client]=[[p,p,i1,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[zt,p,p,p,p,p,p,p,p,p,p,y0,v0,Lc,Xo,p,p,p,p,p,p],[zt,p,p,p,p,p,p,p,p,p,p,p,v0,Lc,Xo,p,p,p,p,p,p],[zt,p,p,p,p,p,p,p,p,p,p,p,p,Lc,Xo,p,p,p,p,p,p],[zt,p,p,p,p,p,p,p,p,p,p,p,p,p,Xo,p,p,p,p,p,p],[zt,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[zt,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,m0],[zt,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[zt,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]];var o1=g.handleClientHello,c1=g.handleClientKeyExchange,l1=g.handleCertificateVerify;jo[g.ConnectionEnd.server]=[[p,o1,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,y0,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,c1,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,l1,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,m0],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]],g.generateKeys=function(e,t){var a=Qo,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=a(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var n=2*t.mac_key_length+2*t.enc_key_length,i=e.version.major===g.Versions.TLS_1_0.major&&e.version.minor===g.Versions.TLS_1_0.minor;i&&(n+=2*t.fixed_iv_length);var s=a(t.master_secret,"key expansion",r,n),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return i&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o},g.createConnectionState=function(e){var t=e.entity===g.ConnectionEnd.client,a=function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(s){return!0},compressionState:null,compressFunction:function(s){return!0},updateSequenceNumber:function(){i.sequenceNumber[1]===4294967295?(i.sequenceNumber[1]=0,++i.sequenceNumber[0]):++i.sequenceNumber[1]}};return i},r={read:a(),write:a()};if(r.read.update=function(i,s){return r.read.cipherFunction(s,r.read)?r.read.compressFunction(i,s,r.read)||i.error(i,{message:"Could not decompress record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_record_mac}}),!i.fail},r.write.update=function(i,s){return r.write.compressFunction(i,s,r.write)?r.write.cipherFunction(s,r.write)||i.error(i,{message:"Could not encrypt record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}),!i.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=g.generateKeys(e,n),r.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,r.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,n),n.compression_algorithm){case g.CompressionMethod.none:break;case g.CompressionMethod.deflate:r.read.compressFunction=$p,r.write.compressFunction=zp;break;default:throw new Error("Unsupported compression algorithm.")}}return r},g.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,a=N.util.createBuffer();return a.putInt32(t),a.putBytes(N.random.getBytes(28)),a},g.createRecord=function(e,t){if(!t.data)return null;var a={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return a},g.createAlert=function(e,t){var a=N.util.createBuffer();return a.putByte(t.level),a.putByte(t.description),g.createRecord(e,{type:g.ContentType.alert,data:a})},g.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=N.util.createBuffer(),a=0;a<e.cipherSuites.length;++a){var r=e.cipherSuites[a];t.putByte(r.id[0]),t.putByte(r.id[1])}var n=t.length(),i=N.util.createBuffer();i.putByte(g.CompressionMethod.none);var s=i.length(),o=N.util.createBuffer();if(e.virtualHost){var c=N.util.createBuffer();c.putByte(0),c.putByte(0);var l=N.util.createBuffer();l.putByte(0),Tt(l,2,N.util.createBuffer(e.virtualHost));var u=N.util.createBuffer();Tt(u,2,l),Tt(c,2,u),o.putBuffer(c)}var f=o.length();f>0&&(f+=2);var y=e.session.id,E=y.length+1+2+4+28+2+n+1+s+f,v=N.util.createBuffer();return v.putByte(g.HandshakeType.client_hello),v.putInt24(E),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),Tt(v,1,N.util.createBuffer(y)),Tt(v,2,t),Tt(v,1,i),f>0&&Tt(v,2,o),v},g.createServerHello=function(e){var t=e.session.id,a=t.length+1+2+4+28+2+1,r=N.util.createBuffer();return r.putByte(g.HandshakeType.server_hello),r.putInt24(a),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),Tt(r,1,N.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r},g.createCertificate=function(e){var t=e.entity===g.ConnectionEnd.client,a=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,a=e.getCertificate(e,r)}var n=N.util.createBuffer();if(a!==null)try{N.util.isArray(a)||(a=[a]);for(var i=null,s=0;s<a.length;++s){var o=N.pem.decode(a[s])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=o.type,c}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=N.util.createBuffer(o.body);i===null&&(i=N.asn1.fromDer(l.bytes(),!1));var u=N.util.createBuffer();Tt(u,3,l),n.putBuffer(u)}a=N.pki.certificateFromAsn1(i),t?e.session.clientCertificate=a:e.session.serverCertificate=a}catch(E){return e.error(e,{message:"Could not send certificate list.",cause:E,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var f=3+n.length(),y=N.util.createBuffer();return y.putByte(g.HandshakeType.certificate),y.putInt24(f),Tt(y,3,n),y},g.createClientKeyExchange=function(e){var t=N.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(N.random.getBytes(46));var a=e.session.sp;a.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(a.pre_master_secret);var n=t.length+2,i=N.util.createBuffer();return i.putByte(g.HandshakeType.client_key_exchange),i.putInt24(n),i.putInt16(t.length),i.putBytes(t),i},g.createServerKeyExchange=function(e){var t=N.util.createBuffer();return t},g.getClientSignature=function(e,t){var a=N.util.createBuffer();a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest()),a=a.getBytes(),e.getSignature=e.getSignature||function(r,n,i){var s=null;if(r.getPrivateKey)try{s=r.getPrivateKey(r,r.session.clientCertificate),s=N.pki.privateKeyFromPem(s)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}s===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):n=s.sign(n,null),i(r,n)},e.getSignature(e,a,t)},g.createCertificateVerify=function(e,t){var a=t.length+2,r=N.util.createBuffer();return r.putByte(g.HandshakeType.certificate_verify),r.putInt24(a),r.putInt16(t.length),r.putBytes(t),r},g.createCertificateRequest=function(e){var t=N.util.createBuffer();t.putByte(1);var a=N.util.createBuffer();for(var r in e.caStore.certs){var n=e.caStore.certs[r],i=N.pki.distinguishedNameToAsn1(n.subject),s=N.asn1.toDer(i);a.putInt16(s.length()),a.putBuffer(s)}var o=1+t.length()+2+a.length(),c=N.util.createBuffer();return c.putByte(g.HandshakeType.certificate_request),c.putInt24(o),Tt(c,1,t),Tt(c,2,a),c},g.createServerHelloDone=function(e){var t=N.util.createBuffer();return t.putByte(g.HandshakeType.server_hello_done),t.putInt24(0),t},g.createChangeCipherSpec=function(){var e=N.util.createBuffer();return e.putByte(1),e},g.createFinished=function(e){var t=N.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var a=e.entity===g.ConnectionEnd.client,r=e.session.sp,n=12,i=Qo,s=a?"client finished":"server finished";t=i(r.master_secret,s,t.getBytes(),n);var o=N.util.createBuffer();return o.putByte(g.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},g.createHeartbeat=function(e,t,a){typeof a>"u"&&(a=t.length);var r=N.util.createBuffer();r.putByte(e),r.putInt16(a),r.putBytes(t);var n=r.length(),i=Math.max(16,n-a-3);return r.putBytes(N.random.getBytes(i)),r},g.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===g.ContentType.handshake||t.type===g.ContentType.alert||t.type===g.ContentType.change_cipher_spec))){if(t.type===g.ContentType.handshake){var a=t.fragment.bytes();e.session.md5.update(a),e.session.sha1.update(a),a=null}var r;if(t.fragment.length()<=g.MaxFragment)r=[t];else{r=[];for(var n=t.fragment.bytes();n.length>g.MaxFragment;)r.push(g.createRecord(e,{type:t.type,data:N.util.createBuffer(n.slice(0,g.MaxFragment))})),n=n.slice(g.MaxFragment);n.length>0&&r.push(g.createRecord(e,{type:t.type,data:N.util.createBuffer(n)}))}for(var i=0;i<r.length&&!e.fail;++i){var s=r[i],o=e.state.current.write;o.update(e,s)&&e.records.push(s)}}},g.flush=function(e){for(var t=0;t<e.records.length;++t){var a=e.records[t];e.tlsData.putByte(a.type),e.tlsData.putByte(a.version.major),e.tlsData.putByte(a.version.minor),e.tlsData.putInt16(a.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Dc=function(e){switch(e){case!0:return!0;case N.pki.certificateError.bad_certificate:return g.Alert.Description.bad_certificate;case N.pki.certificateError.unsupported_certificate:return g.Alert.Description.unsupported_certificate;case N.pki.certificateError.certificate_revoked:return g.Alert.Description.certificate_revoked;case N.pki.certificateError.certificate_expired:return g.Alert.Description.certificate_expired;case N.pki.certificateError.certificate_unknown:return g.Alert.Description.certificate_unknown;case N.pki.certificateError.unknown_ca:return g.Alert.Description.unknown_ca;default:return g.Alert.Description.bad_certificate}},u1=function(e){switch(e){case!0:return!0;case g.Alert.Description.bad_certificate:return N.pki.certificateError.bad_certificate;case g.Alert.Description.unsupported_certificate:return N.pki.certificateError.unsupported_certificate;case g.Alert.Description.certificate_revoked:return N.pki.certificateError.certificate_revoked;case g.Alert.Description.certificate_expired:return N.pki.certificateError.certificate_expired;case g.Alert.Description.certificate_unknown:return N.pki.certificateError.certificate_unknown;case g.Alert.Description.unknown_ca:return N.pki.certificateError.unknown_ca;default:return N.pki.certificateError.bad_certificate}};g.verifyCertificateChain=function(e,t){try{var a={};for(var r in e.verifyOptions)a[r]=e.verifyOptions[r];a.verify=function(i,s,o){var c=Dc(i),l=e.verify(e,i,s,o);if(l!==!0){if(typeof l=="object"&&!N.util.isArray(l)){var u=new Error("The application rejected the certificate.");throw u.send=!0,u.alert={level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate},l.message&&(u.message=l.message),l.alert&&(u.alert.description=l.alert),u}l!==i&&(l=u1(l))}return l},N.pki.verifyCertificateChain(e.caStore,t,a)}catch(i){var n=i;(typeof n!="object"||N.util.isArray(n))&&(n={send:!0,alert:{level:g.Alert.Level.fatal,description:Dc(i)}}),"send"in n||(n.send=!0),"alert"in n||(n.alert={level:g.Alert.Level.fatal,description:Dc(n.error)}),e.error(e,n)}return!e.fail},g.createSessionCache=function(e,t){var a=null;if(e&&e.getSession&&e.setSession&&e.order)a=e;else{a={},a.cache=e||{},a.capacity=Math.max(t||100,1),a.order=[];for(var r in e)a.order.length<=t?a.order.push(r):delete e[r];a.getSession=function(n){var i=null,s=null;if(n?s=N.util.bytesToHex(n):a.order.length>0&&(s=a.order[0]),s!==null&&s in a.cache){i=a.cache[s],delete a.cache[s];for(var o in a.order)if(a.order[o]===s){a.order.splice(o,1);break}}return i},a.setSession=function(n,i){if(a.order.length===a.capacity){var s=a.order.shift();delete a.cache[s]}var s=N.util.bytesToHex(n);a.order.push(s),a.cache[s]=i}}return a},g.createConnection=function(e){var t=null;e.caStore?N.util.isArray(e.caStore)?t=N.pki.createCaStore(e.caStore):t=e.caStore:t=N.pki.createCaStore();var a=e.cipherSuites||null;if(a===null){a=[];for(var r in g.CipherSuites)a.push(g.CipherSuites[r])}var n=e.server?g.ConnectionEnd.server:g.ConnectionEnd.client,i=e.sessionCache?g.createSessionCache(e.sessionCache):null,s={version:{major:g.Version.major,minor:g.Version.minor},entity:n,sessionId:e.sessionId,caStore:t,sessionCache:i,cipherSuites:a,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(u,f,y,E){return f},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:N.util.createBuffer(),tlsData:N.util.createBuffer(),data:N.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(u,f){f.origin=f.origin||(u.entity===g.ConnectionEnd.client?"client":"server"),f.send&&(g.queue(u,g.createAlert(u,f.alert)),g.flush(u));var y=f.fatal!==!1;y&&(u.fail=!0),e.error(u,f),y&&u.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};s.reset=function(u){s.version={major:g.Version.major,minor:g.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=s.entity===g.ConnectionEnd.client?Qp:t1,s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(u||typeof u>"u"),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=g.createConnectionState(s)},s.reset();var o=function(u,f){var y=f.type-g.ContentType.change_cipher_spec,E=_c[u.entity][u.expect];y in E?E[y](u,f):g.handleUnexpected(u,f)},c=function(u){var f=0,y=u.input,E=y.length();if(E<5)f=5-E;else{u.record={type:y.getByte(),version:{major:y.getByte(),minor:y.getByte()},length:y.getInt16(),fragment:N.util.createBuffer(),ready:!1};var v=u.record.version.major===u.version.major;v&&u.session&&u.session.version&&(v=u.record.version.minor===u.version.minor),v||u.error(u,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}})}return f},l=function(u){var f=0,y=u.input,E=y.length();if(E<u.record.length)f=u.record.length-E;else{u.record.fragment.putBytes(y.getBytes(u.record.length)),y.compact();var v=u.state.current.read;v.update(u,u.record)&&(u.fragmented!==null&&(u.fragmented.type===u.record.type?(u.fragmented.fragment.putBuffer(u.record.fragment),u.record=u.fragmented):u.error(u,{message:"Invalid fragmented record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})),u.record.ready=!0)}return f};return s.handshake=function(u){if(s.entity!==g.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&s.handshakes===0&&(s.fail=!1),s.handshaking=!0,u=u||"";var f=null;u.length>0&&(s.sessionCache&&(f=s.sessionCache.getSession(u)),f===null&&(u="")),u.length===0&&s.sessionCache&&(f=s.sessionCache.getSession(),f!==null&&(u=f.id)),s.session={id:u,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:N.md.md5.create(),sha1:N.md.sha1.create()},f&&(s.version=f.version,s.session.sp=f.sp),s.session.sp.client_random=g.createRandom().getBytes(),s.open=!0,g.queue(s,g.createRecord(s,{type:g.ContentType.handshake,data:g.createClientHello(s)})),g.flush(s)}},s.process=function(u){var f=0;return u&&s.input.putBytes(u),s.fail||(s.record!==null&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),s.record===null&&(f=c(s)),!s.fail&&s.record!==null&&!s.record.ready&&(f=l(s)),!s.fail&&s.record!==null&&s.record.ready&&o(s,s.record)),f},s.prepare=function(u){return g.queue(s,g.createRecord(s,{type:g.ContentType.application_data,data:N.util.createBuffer(u)})),g.flush(s)},s.prepareHeartbeatRequest=function(u,f){return u instanceof N.util.ByteBuffer&&(u=u.bytes()),typeof f>"u"&&(f=u.length),s.expectedHeartbeatPayload=u,g.queue(s,g.createRecord(s,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_request,u,f)})),g.flush(s)},s.close=function(u){if(!s.fail&&s.sessionCache&&s.session){var f={id:s.session.id,version:s.session.version,sp:s.session.sp};f.sp.keys=null,s.sessionCache.setSession(f.id,f)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,g.queue(s,g.createAlert(s,{level:g.Alert.Level.warning,description:g.Alert.Description.close_notify})),g.flush(s)),s.closed(s)),s.reset(u)},s},N.tls=N.tls||{};for(var Pc in g)typeof g[Pc]!="function"&&(N.tls[Pc]=g[Pc]);N.tls.prf_tls1=Qo,N.tls.hmac_sha1=Wp,N.tls.createSessionCache=g.createSessionCache,N.tls.createConnection=g.createConnection;var $t=J,St=$t.tls;St.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=St.BulkCipherAlgorithm.aes,e.cipher_type=St.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=St.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:E0},St.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=St.BulkCipherAlgorithm.aes,e.cipher_type=St.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=St.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:E0};function E0(e,t,a){var r=t.entity===$t.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:$t.cipher.createDecipher("AES-CBC",r?a.keys.server_write_key:a.keys.client_write_key),iv:r?a.keys.server_write_IV:a.keys.client_write_IV},e.write.cipherState={init:!1,cipher:$t.cipher.createCipher("AES-CBC",r?a.keys.client_write_key:a.keys.server_write_key),iv:r?a.keys.client_write_IV:a.keys.server_write_IV},e.read.cipherFunction=p1,e.write.cipherFunction=f1,e.read.macLength=e.write.macLength=a.mac_length,e.read.macFunction=e.write.macFunction=St.hmac_sha1}function f1(e,t){var a=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var n;e.version.minor===St.Versions.TLS_1_0.minor?n=t.cipherState.init?null:t.cipherState.iv:n=$t.random.getBytesSync(16),t.cipherState.init=!0;var i=t.cipherState.cipher;return i.start({iv:n}),e.version.minor>=St.Versions.TLS_1_1.minor&&i.output.putBytes(n),i.update(e.fragment),i.finish(d1)&&(e.fragment=i.output,e.length=e.fragment.length(),a=!0),a}function d1(e,t,a){if(!a){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function h1(e,t,a){var r=!0;if(a){for(var n=t.length(),i=t.last(),s=n-1-i;s<n-1;++s)r=r&&t.at(s)==i;r&&t.truncate(i+1)}return r}function p1(e,t){var a=!1,r;e.version.minor===St.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var n=t.cipherState.cipher;n.start({iv:r}),n.update(e.fragment),a=n.finish(h1);var i=t.macLength,s=$t.random.getBytesSync(i),o=n.output.length();o>=i?(e.fragment=n.output.getBytes(o-i),s=n.output.getBytes(i)):e.fragment=n.output.getBytes(),e.fragment=$t.util.createBuffer(e.fragment),e.length=e.fragment.length();var c=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),a=g1(t.macKey,s,c)&&a,a}function g1(e,t,a){var r=$t.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(a),a=r.digest().getBytes(),t===a}var Se=J,So=Se.sha512=Se.sha512||{};Se.md.sha512=Se.md.algorithms.sha512=So;var C0=Se.sha384=Se.sha512.sha384=Se.sha512.sha384||{};C0.create=function(){return So.create("SHA-384")},Se.md.sha384=Se.md.algorithms.sha384=C0,Se.sha512.sha256=Se.sha512.sha256||{create:function(){return So.create("SHA-512/256")}},Se.md["sha512/256"]=Se.md.algorithms["sha512/256"]=Se.sha512.sha256,Se.sha512.sha224=Se.sha512.sha224||{create:function(){return So.create("SHA-512/224")}},Se.md["sha512/224"]=Se.md.algorithms["sha512/224"]=Se.sha512.sha224,So.create=function(e){if(x0||y1(),typeof e>"u"&&(e="SHA-512"),!(e in ir))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=ir[e],a=null,r=Se.util.createBuffer(),n=new Array(80),i=0;i<80;++i)n[i]=new Array(2);var s=64;switch(e){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var c=o.messageLengthSize/4,l=0;l<c;++l)o.fullMessageLength.push(0);r=Se.util.createBuffer(),a=new Array(t.length);for(var l=0;l<t.length;++l)a[l]=t[l].slice(0);return o},o.start(),o.update=function(c,l){l==="utf8"&&(c=Se.util.encodeUtf8(c));var u=c.length;o.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var f=o.fullMessageLength.length-1;f>=0;--f)o.fullMessageLength[f]+=u[1],u[1]=u[0]+(o.fullMessageLength[f]/4294967296>>>0),o.fullMessageLength[f]=o.fullMessageLength[f]>>>0,u[0]=u[1]/4294967296>>>0;return r.putBytes(c),T0(a,n,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var c=Se.util.createBuffer();c.putBytes(r.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=l&o.blockLength-1;c.putBytes(Oc.substr(0,o.blockLength-u));for(var f,y,E=o.fullMessageLength[0]*8,v=0;v<o.fullMessageLength.length-1;++v)f=o.fullMessageLength[v+1]*8,y=f/4294967296>>>0,E+=y,c.putInt32(E>>>0),E=f>>>0;c.putInt32(E);for(var x=new Array(a.length),v=0;v<a.length;++v)x[v]=a[v].slice(0);T0(x,n,c);var T=Se.util.createBuffer(),I;e==="SHA-512"?I=x.length:e==="SHA-384"?I=x.length-2:I=x.length-4;for(var v=0;v<I;++v)T.putInt32(x[v][0]),(v!==I-1||e!=="SHA-512/224")&&T.putInt32(x[v][1]);return T},o};var Oc=null,x0=!1,Vc=null,ir=null;function y1(){Oc="\x80",Oc+=Se.util.fillString("\0",128),Vc=[[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]],ir={},ir["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],ir["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],ir["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],ir["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],x0=!0}function T0(e,t,a){for(var r,n,i,s,o,c,l,u,f,y,E,v,x,T,I,B,U,D,L,P,$,H,pe,ye,ve,Ie,ht,vt,me,Ue,G,jt,cr,ke,Ne,_e=a.length();_e>=128;){for(me=0;me<16;++me)t[me][0]=a.getInt32()>>>0,t[me][1]=a.getInt32()>>>0;for(;me<80;++me)jt=t[me-2],Ue=jt[0],G=jt[1],r=((Ue>>>19|G<<13)^(G>>>29|Ue<<3)^Ue>>>6)>>>0,n=((Ue<<13|G>>>19)^(G<<3|Ue>>>29)^(Ue<<26|G>>>6))>>>0,ke=t[me-15],Ue=ke[0],G=ke[1],i=((Ue>>>1|G<<31)^(Ue>>>8|G<<24)^Ue>>>7)>>>0,s=((Ue<<31|G>>>1)^(Ue<<24|G>>>8)^(Ue<<25|G>>>7))>>>0,cr=t[me-7],Ne=t[me-16],G=n+cr[1]+s+Ne[1],t[me][0]=r+cr[0]+i+Ne[0]+(G/4294967296>>>0)>>>0,t[me][1]=G>>>0;for(x=e[0][0],T=e[0][1],I=e[1][0],B=e[1][1],U=e[2][0],D=e[2][1],L=e[3][0],P=e[3][1],$=e[4][0],H=e[4][1],pe=e[5][0],ye=e[5][1],ve=e[6][0],Ie=e[6][1],ht=e[7][0],vt=e[7][1],me=0;me<80;++me)l=(($>>>14|H<<18)^($>>>18|H<<14)^(H>>>9|$<<23))>>>0,u=(($<<18|H>>>14)^($<<14|H>>>18)^(H<<23|$>>>9))>>>0,f=(ve^$&(pe^ve))>>>0,y=(Ie^H&(ye^Ie))>>>0,o=((x>>>28|T<<4)^(T>>>2|x<<30)^(T>>>7|x<<25))>>>0,c=((x<<4|T>>>28)^(T<<30|x>>>2)^(T<<25|x>>>7))>>>0,E=(x&I|U&(x^I))>>>0,v=(T&B|D&(T^B))>>>0,G=vt+u+y+Vc[me][1]+t[me][1],r=ht+l+f+Vc[me][0]+t[me][0]+(G/4294967296>>>0)>>>0,n=G>>>0,G=c+v,i=o+E+(G/4294967296>>>0)>>>0,s=G>>>0,ht=ve,vt=Ie,ve=pe,Ie=ye,pe=$,ye=H,G=P+n,$=L+r+(G/4294967296>>>0)>>>0,H=G>>>0,L=U,P=D,U=I,D=B,I=x,B=T,G=n+s,x=r+i+(G/4294967296>>>0)>>>0,T=G>>>0;G=e[0][1]+T,e[0][0]=e[0][0]+x+(G/4294967296>>>0)>>>0,e[0][1]=G>>>0,G=e[1][1]+B,e[1][0]=e[1][0]+I+(G/4294967296>>>0)>>>0,e[1][1]=G>>>0,G=e[2][1]+D,e[2][0]=e[2][0]+U+(G/4294967296>>>0)>>>0,e[2][1]=G>>>0,G=e[3][1]+P,e[3][0]=e[3][0]+L+(G/4294967296>>>0)>>>0,e[3][1]=G>>>0,G=e[4][1]+H,e[4][0]=e[4][0]+$+(G/4294967296>>>0)>>>0,e[4][1]=G>>>0,G=e[5][1]+ye,e[5][0]=e[5][0]+pe+(G/4294967296>>>0)>>>0,e[5][1]=G>>>0,G=e[6][1]+Ie,e[6][0]=e[6][0]+ve+(G/4294967296>>>0)>>>0,e[6][1]=G>>>0,G=e[7][1]+vt,e[7][0]=e[7][0]+ht+(G/4294967296>>>0)>>>0,e[7][1]=G>>>0,_e-=128}}var Fc={},v1=J,Pe=v1.asn1;Fc.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Fc.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Pe.Class.UNIVERSAL,type:Pe.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var Fe=J,S0=Fc,m1=S0.publicKeyValidator,E1=S0.privateKeyValidator;if(typeof C1>"u")var C1=Fe.jsbn.BigInteger;var Mc=Fe.util.ByteBuffer,dt=typeof Buffer>"u"?Uint8Array:Buffer;Fe.pki=Fe.pki||{},Fe.pki.ed25519=Fe.ed25519=Fe.ed25519||{};var re=Fe.ed25519;re.constants={},re.constants.PUBLIC_KEY_BYTE_LENGTH=32,re.constants.PRIVATE_KEY_BYTE_LENGTH=64,re.constants.SEED_BYTE_LENGTH=32,re.constants.SIGN_BYTE_LENGTH=64,re.constants.HASH_BYTE_LENGTH=64,re.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=Fe.random.getBytesSync(re.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==re.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+re.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Vt({message:t,encoding:"binary"});for(var a=new dt(re.constants.PUBLIC_KEY_BYTE_LENGTH),r=new dt(re.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)r[n]=t[n];return A1(a,r),{publicKey:a,privateKey:r}},re.privateKeyFromAsn1=function(e){var t={},a=[],r=Fe.asn1.validate(e,E1,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var i=Fe.asn1.derToOid(t.privateKeyOid),s=Fe.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.privateKey,c=Vt({message:Fe.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:c}},re.publicKeyFromAsn1=function(e){var t={},a=[],r=Fe.asn1.validate(e,m1,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var i=Fe.asn1.derToOid(t.publicKeyOid),s=Fe.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.ed25519PublicKey;if(o.length!==re.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Vt({message:o,encoding:"binary"})},re.publicKeyFromPrivateKey=function(e){e=e||{};var t=Vt({message:e.privateKey,encoding:"binary"});if(t.length!==re.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+re.constants.PRIVATE_KEY_BYTE_LENGTH);for(var a=new dt(re.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<a.length;++r)a[r]=t[32+r];return a},re.sign=function(e){e=e||{};var t=Vt(e),a=Vt({message:e.privateKey,encoding:"binary"});if(a.length===re.constants.SEED_BYTE_LENGTH){var r=re.generateKeyPair({seed:a});a=r.privateKey}else if(a.length!==re.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+re.constants.SEED_BYTE_LENGTH+" or "+re.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new dt(re.constants.SIGN_BYTE_LENGTH+t.length);I1(n,t,t.length,a);for(var i=new dt(re.constants.SIGN_BYTE_LENGTH),s=0;s<i.length;++s)i[s]=n[s];return i},re.verify=function(e){e=e||{};var t=Vt(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var a=Vt({message:e.signature,encoding:"binary"});if(a.length!==re.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+re.constants.SIGN_BYTE_LENGTH);var r=Vt({message:e.publicKey,encoding:"binary"});if(r.length!==re.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+re.constants.PUBLIC_KEY_BYTE_LENGTH);var n=new dt(re.constants.SIGN_BYTE_LENGTH+t.length),i=new dt(re.constants.SIGN_BYTE_LENGTH+t.length),s;for(s=0;s<re.constants.SIGN_BYTE_LENGTH;++s)n[s]=a[s];for(s=0;s<t.length;++s)n[s+re.constants.SIGN_BYTE_LENGTH]=t[s];return b1(i,n,n.length,r)>=0};function Vt(e){var t=e.message;if(t instanceof Uint8Array||t instanceof dt)return t;var a=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),a="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!a)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,a);t=new Mc(t,a)}else if(!(t instanceof Mc))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new dt(t.length()),n=0;n<r.length;++n)r[n]=t.at(n);return r}var Kc=Q(),Yo=Q([1]),x1=Q([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),T1=Q([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),A0=Q([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),I0=Q([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Ao=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),S1=Q([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Io(e,t){var a=Fe.md.sha512.create(),r=new Mc(e);a.update(r.getBytes(t),"binary");var n=a.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(n,"binary");for(var i=new dt(re.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)i[s]=n.charCodeAt(s);return i}function A1(e,t){var a=[Q(),Q(),Q(),Q()],r,n=Io(t,32);for(n[0]&=248,n[31]&=127,n[31]|=64,Wc(a,n),Gc(e,a),r=0;r<32;++r)t[r+32]=e[r];return 0}function I1(e,t,a,r){var n,i,s=new Float64Array(64),o=[Q(),Q(),Q(),Q()],c=Io(r,32);c[0]&=248,c[31]&=127,c[31]|=64;var l=a+64;for(n=0;n<a;++n)e[64+n]=t[n];for(n=0;n<32;++n)e[32+n]=c[32+n];var u=Io(e.subarray(32),a+32);for(qc(u),Wc(o,u),Gc(e,o),n=32;n<64;++n)e[n]=r[n];var f=Io(e,a+64);for(qc(f),n=32;n<64;++n)s[n]=0;for(n=0;n<32;++n)s[n]=u[n];for(n=0;n<32;++n)for(i=0;i<32;i++)s[n+i]+=f[n]*c[i];return b0(e.subarray(32),s),l}function b1(e,t,a,r){var n,i,s=new dt(32),o=[Q(),Q(),Q(),Q()],c=[Q(),Q(),Q(),Q()];if(i=-1,a<64||w1(c,r)||!B1(t,32))return-1;for(n=0;n<a;++n)e[n]=t[n];for(n=0;n<32;++n)e[n+32]=r[n];var l=Io(e,a);if(qc(l),N0(o,c,l),Wc(c,t.subarray(32)),Hc(o,c),Gc(s,o),a-=64,U0(t,0,s,0)){for(n=0;n<a;++n)e[n]=0;return-1}for(n=0;n<a;++n)e[n]=t[n+64];return i=a,i}function B1(e,t){var a;for(a=31;a>=0;--a){if(e[t+a]<Ao[a])return!0;if(e[t+a]>Ao[a])return!1}return!1}function b0(e,t){var a,r,n,i;for(r=63;r>=32;--r){for(a=0,n=r-32,i=r-12;n<i;++n)t[n]+=a-16*t[r]*Ao[n-(r-32)],a=t[n]+128>>8,t[n]-=a*256;t[n]+=a,t[r]=0}for(a=0,n=0;n<32;++n)t[n]+=a-(t[31]>>4)*Ao[n],a=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=a*Ao[n];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function qc(e){for(var t=new Float64Array(64),a=0;a<64;++a)t[a]=e[a],e[a]=0;b0(e,t)}function Hc(e,t){var a=Q(),r=Q(),n=Q(),i=Q(),s=Q(),o=Q(),c=Q(),l=Q(),u=Q();Cr(a,e[1],e[0]),Cr(u,t[1],t[0]),Ee(a,a,u),Er(r,e[0],e[1]),Er(u,t[0],t[1]),Ee(r,r,u),Ee(n,e[3],t[3]),Ee(n,n,T1),Ee(i,e[2],t[2]),Er(i,i,i),Cr(s,r,a),Cr(o,i,n),Er(c,i,n),Er(l,r,a),Ee(e[0],s,o),Ee(e[1],l,c),Ee(e[2],c,o),Ee(e[3],s,l)}function B0(e,t,a){for(var r=0;r<4;++r)R0(e[r],t[r],a)}function Gc(e,t){var a=Q(),r=Q(),n=Q();R1(n,t[2]),Ee(a,t[0],n),Ee(r,t[1],n),Zo(e,r),e[31]^=k0(a)<<7}function Zo(e,t){var a,r,n,i=Q(),s=Q();for(a=0;a<16;++a)s[a]=t[a];for(zc(s),zc(s),zc(s),r=0;r<2;++r){for(i[0]=s[0]-65517,a=1;a<15;++a)i[a]=s[a]-65535-(i[a-1]>>16&1),i[a-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),n=i[15]>>16&1,i[14]&=65535,R0(s,i,1-n)}for(a=0;a<16;a++)e[2*a]=s[a]&255,e[2*a+1]=s[a]>>8}function w1(e,t){var a=Q(),r=Q(),n=Q(),i=Q(),s=Q(),o=Q(),c=Q();return Qt(e[2],Yo),U1(e[1],t),or(n,e[1]),Ee(i,n,x1),Cr(n,n,e[2]),Er(i,e[2],i),or(s,i),or(o,s),Ee(c,o,s),Ee(a,c,n),Ee(a,a,i),k1(a,a),Ee(a,a,n),Ee(a,a,i),Ee(a,a,i),Ee(e[0],a,i),or(r,e[0]),Ee(r,r,i),w0(r,n)&&Ee(e[0],e[0],S1),or(r,e[0]),Ee(r,r,i),w0(r,n)?-1:(k0(e[0])===t[31]>>7&&Cr(e[0],Kc,e[0]),Ee(e[3],e[0],e[1]),0)}function U1(e,t){var a;for(a=0;a<16;++a)e[a]=t[2*a]+(t[2*a+1]<<8);e[15]&=32767}function k1(e,t){var a=Q(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)or(a,a),r!==1&&Ee(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function w0(e,t){var a=new dt(32),r=new dt(32);return Zo(a,e),Zo(r,t),U0(a,0,r,0)}function U0(e,t,a,r){return N1(e,t,a,r,32)}function N1(e,t,a,r,n){var i,s=0;for(i=0;i<n;++i)s|=e[t+i]^a[r+i];return(1&s-1>>>8)-1}function k0(e){var t=new dt(32);return Zo(t,e),t[0]&1}function N0(e,t,a){var r,n;for(Qt(e[0],Kc),Qt(e[1],Yo),Qt(e[2],Yo),Qt(e[3],Kc),n=255;n>=0;--n)r=a[n/8|0]>>(n&7)&1,B0(e,t,r),Hc(t,e),Hc(e,e),B0(e,t,r)}function Wc(e,t){var a=[Q(),Q(),Q(),Q()];Qt(a[0],A0),Qt(a[1],I0),Qt(a[2],Yo),Ee(a[3],A0,I0),N0(e,a,t)}function Qt(e,t){var a;for(a=0;a<16;a++)e[a]=t[a]|0}function R1(e,t){var a=Q(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)or(a,a),r!==2&&r!==4&&Ee(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function zc(e){var t,a,r=1;for(t=0;t<16;++t)a=e[t]+r+65535,r=Math.floor(a/65536),e[t]=a-r*65536;e[0]+=r-1+37*(r-1)}function R0(e,t,a){for(var r,n=~(a-1),i=0;i<16;++i)r=n&(e[i]^t[i]),e[i]^=r,t[i]^=r}function Q(e){var t,a=new Float64Array(16);if(e)for(t=0;t<e.length;++t)a[t]=e[t];return a}function Er(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]+a[r]}function Cr(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]-a[r]}function or(e,t){Ee(e,t,t)}function Ee(e,t,a){var r,n,i=0,s=0,o=0,c=0,l=0,u=0,f=0,y=0,E=0,v=0,x=0,T=0,I=0,B=0,U=0,D=0,L=0,P=0,$=0,H=0,pe=0,ye=0,ve=0,Ie=0,ht=0,vt=0,me=0,Ue=0,G=0,jt=0,cr=0,ke=a[0],Ne=a[1],_e=a[2],Me=a[3],Ke=a[4],qe=a[5],He=a[6],Ge=a[7],We=a[8],ze=a[9],$e=a[10],Qe=a[11],Xe=a[12],je=a[13],Ye=a[14],Ze=a[15];r=t[0],i+=r*ke,s+=r*Ne,o+=r*_e,c+=r*Me,l+=r*Ke,u+=r*qe,f+=r*He,y+=r*Ge,E+=r*We,v+=r*ze,x+=r*$e,T+=r*Qe,I+=r*Xe,B+=r*je,U+=r*Ye,D+=r*Ze,r=t[1],s+=r*ke,o+=r*Ne,c+=r*_e,l+=r*Me,u+=r*Ke,f+=r*qe,y+=r*He,E+=r*Ge,v+=r*We,x+=r*ze,T+=r*$e,I+=r*Qe,B+=r*Xe,U+=r*je,D+=r*Ye,L+=r*Ze,r=t[2],o+=r*ke,c+=r*Ne,l+=r*_e,u+=r*Me,f+=r*Ke,y+=r*qe,E+=r*He,v+=r*Ge,x+=r*We,T+=r*ze,I+=r*$e,B+=r*Qe,U+=r*Xe,D+=r*je,L+=r*Ye,P+=r*Ze,r=t[3],c+=r*ke,l+=r*Ne,u+=r*_e,f+=r*Me,y+=r*Ke,E+=r*qe,v+=r*He,x+=r*Ge,T+=r*We,I+=r*ze,B+=r*$e,U+=r*Qe,D+=r*Xe,L+=r*je,P+=r*Ye,$+=r*Ze,r=t[4],l+=r*ke,u+=r*Ne,f+=r*_e,y+=r*Me,E+=r*Ke,v+=r*qe,x+=r*He,T+=r*Ge,I+=r*We,B+=r*ze,U+=r*$e,D+=r*Qe,L+=r*Xe,P+=r*je,$+=r*Ye,H+=r*Ze,r=t[5],u+=r*ke,f+=r*Ne,y+=r*_e,E+=r*Me,v+=r*Ke,x+=r*qe,T+=r*He,I+=r*Ge,B+=r*We,U+=r*ze,D+=r*$e,L+=r*Qe,P+=r*Xe,$+=r*je,H+=r*Ye,pe+=r*Ze,r=t[6],f+=r*ke,y+=r*Ne,E+=r*_e,v+=r*Me,x+=r*Ke,T+=r*qe,I+=r*He,B+=r*Ge,U+=r*We,D+=r*ze,L+=r*$e,P+=r*Qe,$+=r*Xe,H+=r*je,pe+=r*Ye,ye+=r*Ze,r=t[7],y+=r*ke,E+=r*Ne,v+=r*_e,x+=r*Me,T+=r*Ke,I+=r*qe,B+=r*He,U+=r*Ge,D+=r*We,L+=r*ze,P+=r*$e,$+=r*Qe,H+=r*Xe,pe+=r*je,ye+=r*Ye,ve+=r*Ze,r=t[8],E+=r*ke,v+=r*Ne,x+=r*_e,T+=r*Me,I+=r*Ke,B+=r*qe,U+=r*He,D+=r*Ge,L+=r*We,P+=r*ze,$+=r*$e,H+=r*Qe,pe+=r*Xe,ye+=r*je,ve+=r*Ye,Ie+=r*Ze,r=t[9],v+=r*ke,x+=r*Ne,T+=r*_e,I+=r*Me,B+=r*Ke,U+=r*qe,D+=r*He,L+=r*Ge,P+=r*We,$+=r*ze,H+=r*$e,pe+=r*Qe,ye+=r*Xe,ve+=r*je,Ie+=r*Ye,ht+=r*Ze,r=t[10],x+=r*ke,T+=r*Ne,I+=r*_e,B+=r*Me,U+=r*Ke,D+=r*qe,L+=r*He,P+=r*Ge,$+=r*We,H+=r*ze,pe+=r*$e,ye+=r*Qe,ve+=r*Xe,Ie+=r*je,ht+=r*Ye,vt+=r*Ze,r=t[11],T+=r*ke,I+=r*Ne,B+=r*_e,U+=r*Me,D+=r*Ke,L+=r*qe,P+=r*He,$+=r*Ge,H+=r*We,pe+=r*ze,ye+=r*$e,ve+=r*Qe,Ie+=r*Xe,ht+=r*je,vt+=r*Ye,me+=r*Ze,r=t[12],I+=r*ke,B+=r*Ne,U+=r*_e,D+=r*Me,L+=r*Ke,P+=r*qe,$+=r*He,H+=r*Ge,pe+=r*We,ye+=r*ze,ve+=r*$e,Ie+=r*Qe,ht+=r*Xe,vt+=r*je,me+=r*Ye,Ue+=r*Ze,r=t[13],B+=r*ke,U+=r*Ne,D+=r*_e,L+=r*Me,P+=r*Ke,$+=r*qe,H+=r*He,pe+=r*Ge,ye+=r*We,ve+=r*ze,Ie+=r*$e,ht+=r*Qe,vt+=r*Xe,me+=r*je,Ue+=r*Ye,G+=r*Ze,r=t[14],U+=r*ke,D+=r*Ne,L+=r*_e,P+=r*Me,$+=r*Ke,H+=r*qe,pe+=r*He,ye+=r*Ge,ve+=r*We,Ie+=r*ze,ht+=r*$e,vt+=r*Qe,me+=r*Xe,Ue+=r*je,G+=r*Ye,jt+=r*Ze,r=t[15],D+=r*ke,L+=r*Ne,P+=r*_e,$+=r*Me,H+=r*Ke,pe+=r*qe,ye+=r*He,ve+=r*Ge,Ie+=r*We,ht+=r*ze,vt+=r*$e,me+=r*Qe,Ue+=r*Xe,G+=r*je,jt+=r*Ye,cr+=r*Ze,i+=38*L,s+=38*P,o+=38*$,c+=38*H,l+=38*pe,u+=38*ye,f+=38*ve,y+=38*Ie,E+=38*ht,v+=38*vt,x+=38*me,T+=38*Ue,I+=38*G,B+=38*jt,U+=38*cr,n=1,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=f+n+65535,n=Math.floor(r/65536),f=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=E+n+65535,n=Math.floor(r/65536),E=r-n*65536,r=v+n+65535,n=Math.floor(r/65536),v=r-n*65536,r=x+n+65535,n=Math.floor(r/65536),x=r-n*65536,r=T+n+65535,n=Math.floor(r/65536),T=r-n*65536,r=I+n+65535,n=Math.floor(r/65536),I=r-n*65536,r=B+n+65535,n=Math.floor(r/65536),B=r-n*65536,r=U+n+65535,n=Math.floor(r/65536),U=r-n*65536,r=D+n+65535,n=Math.floor(r/65536),D=r-n*65536,i+=n-1+37*(n-1),n=1,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=f+n+65535,n=Math.floor(r/65536),f=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=E+n+65535,n=Math.floor(r/65536),E=r-n*65536,r=v+n+65535,n=Math.floor(r/65536),v=r-n*65536,r=x+n+65535,n=Math.floor(r/65536),x=r-n*65536,r=T+n+65535,n=Math.floor(r/65536),T=r-n*65536,r=I+n+65535,n=Math.floor(r/65536),I=r-n*65536,r=B+n+65535,n=Math.floor(r/65536),B=r-n*65536,r=U+n+65535,n=Math.floor(r/65536),U=r-n*65536,r=D+n+65535,n=Math.floor(r/65536),D=r-n*65536,i+=n-1+37*(n-1),e[0]=i,e[1]=s,e[2]=o,e[3]=c,e[4]=l,e[5]=u,e[6]=f,e[7]=y,e[8]=E,e[9]=v,e[10]=x,e[11]=T,e[12]=I,e[13]=B,e[14]=U,e[15]=D}var gt=J;gt.kem=gt.kem||{};var _0=gt.jsbn.BigInteger;gt.kem.rsa={},gt.kem.rsa.create=function(e,t){t=t||{};var a=t.prng||gt.random,r={};return r.encrypt=function(n,i){var s=Math.ceil(n.n.bitLength()/8),o;do o=new _0(gt.util.bytesToHex(a.getBytesSync(s)),16).mod(n.n);while(o.compareTo(_0.ONE)<=0);o=gt.util.hexToBytes(o.toString(16));var c=s-o.length;c>0&&(o=gt.util.fillString("\0",c)+o);var l=n.encrypt(o,"NONE"),u=e.generate(o,i);return{encapsulation:l,key:u}},r.decrypt=function(n,i,s){var o=n.decrypt(i,"NONE");return e.generate(o,s)},r},gt.kem.kdf1=function(e,t){L0(this,e,0,t||e.digestLength)},gt.kem.kdf2=function(e,t){L0(this,e,1,t||e.digestLength)};function L0(e,t,a,r){e.generate=function(n,i){for(var s=new gt.util.ByteBuffer,o=Math.ceil(i/r)+a,c=new gt.util.ByteBuffer,l=a;l<o;++l){c.putInt32(l),t.start(),t.update(n+c.getBytes());var u=t.digest();s.putBytes(u.getBytes(r))}return s.truncate(s.length()-i),s.getBytes()}}var ue=J;ue.log=ue.log||{},ue.log.levels=["none","error","warning","info","debug","verbose","max"];var Jo={},$c=[],bo=null;ue.log.LEVEL_LOCKED=2,ue.log.NO_LEVEL_CHECK=4,ue.log.INTERPOLATE=8;for(var Xt=0;Xt<ue.log.levels.length;++Xt){var D0=ue.log.levels[Xt];Jo[D0]={index:Xt,name:D0.toUpperCase()}}ue.log.logMessage=function(e){for(var t=Jo[e.level].index,a=0;a<$c.length;++a){var r=$c[a];if(r.flags&ue.log.NO_LEVEL_CHECK)r.f(e);else{var n=Jo[r.level].index;t<=n&&r.f(r,e)}}},ue.log.prepareStandard=function(e){"standard"in e||(e.standard=Jo[e.level].name+" ["+e.category+"] "+e.message)},ue.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=ue.util.format.apply(this,t)}},ue.log.prepareStandardFull=function(e){"standardFull"in e||(ue.log.prepareStandard(e),e.standardFull=e.standard)};for(var P0=["error","warning","info","debug","verbose"],Xt=0;Xt<P0.length;++Xt)(function(t){ue.log[t]=function(a,r){var n=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:t,category:a,message:r,arguments:n};ue.log.logMessage(i)}})(P0[Xt]);if(ue.log.makeLogger=function(e){var t={flags:0,f:e};return ue.log.setLevel(t,"none"),t},ue.log.setLevel=function(e,t){var a=!1;if(e&&!(e.flags&ue.log.LEVEL_LOCKED))for(var r=0;r<ue.log.levels.length;++r){var n=ue.log.levels[r];if(t==n){e.level=t,a=!0;break}}return a},ue.log.lock=function(e,t){typeof t>"u"||t?e.flags|=ue.log.LEVEL_LOCKED:e.flags&=~ue.log.LEVEL_LOCKED},ue.log.addLogger=function(e){$c.push(e)},typeof console<"u"&&"log"in console){var Bo;if(console.error&&console.warn&&console.info&&console.debug){var _1={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},Yc=function(e,t){ue.log.prepareStandard(t);var a=_1[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),a.apply(console,r)};Bo=ue.log.makeLogger(Yc)}else{var Yc=function(t,a){ue.log.prepareStandardFull(a),console.log(a.standardFull)};Bo=ue.log.makeLogger(Yc)}ue.log.setLevel(Bo,"debug"),ue.log.addLogger(Bo),bo=Bo}else console={log:function(){}};if(bo!==null&&typeof window<"u"&&window.location){var ec=new URL(window.location.href).searchParams;if(ec.has("console.level")&&ue.log.setLevel(bo,ec.get("console.level").slice(-1)[0]),ec.has("console.lock")){var L1=ec.get("console.lock").slice(-1)[0];L1=="true"&&ue.log.lock(bo)}}ue.log.consoleLogger=bo;var V=J,S=V.asn1,lt=V.pkcs7=V.pkcs7||{};lt.messageFromPem=function(e){var t=V.pem.decode(e)[0];if(t.type!=="PKCS7"){var a=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=S.fromDer(t.body);return lt.messageFromAsn1(r)},lt.messageToPem=function(e,t){var a={type:"PKCS7",body:S.toDer(e.toAsn1()).getBytes()};return V.pem.encode(a,{maxline:t})},lt.messageFromAsn1=function(e){var t={},a=[];if(!S.validate(e,lt.asn1.contentInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=a,r}var n=S.derToOid(t.contentType),i;switch(n){case V.pki.oids.envelopedData:i=lt.createEnvelopedData();break;case V.pki.oids.encryptedData:i=lt.createEncryptedData();break;case V.pki.oids.signedData:i=lt.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+n+" is not (yet) supported.")}return i.fromAsn1(t.content.value[0]),i},lt.createSignedData=function(){var e=null;return e={type:V.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(Xc(e,r,lt.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,i=0;i<n.length;++i)e.certificates.push(V.pki.certificateFromAsn1(n[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],n=0;n<e.certificates.length;++n)r.push(V.pki.certificateToAsn1(e.certificates[n]));var i=[],s=S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&s.value[0].value.push(S.create(S.Class.CONTEXT_SPECIFIC,0,!0,r)),i.length>0&&s.value[0].value.push(S.create(S.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(S.create(S.Class.UNIVERSAL,S.Type.SET,!0,e.signerInfos)),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),s])},addSigner:function(r){var n=r.issuer,i=r.serialNumber;if(r.certificate){var s=r.certificate;typeof s=="string"&&(s=V.pki.certificateFromPem(s)),n=s.issuer.attributes,i=s.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=V.pki.privateKeyFromPem(o));var c=r.digestAlgorithm||V.pki.oids.sha1;switch(c){case V.pki.oids.sha1:case V.pki.oids.sha256:case V.pki.oids.sha384:case V.pki.oids.sha512:case V.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+c)}var l=r.authenticatedAttributes||[];if(l.length>0){for(var u=!1,f=!1,y=0;y<l.length;++y){var E=l[y];if(!u&&E.type===V.pki.oids.contentType){if(u=!0,f)break;continue}if(!f&&E.type===V.pki.oids.messageDigest){if(f=!0,u)break;continue}}if(!u||!f)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:n,serialNumber:i,digestAlgorithm:c,signatureAlgorithm:V.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(V.pki.oids.data).getBytes())]),"content"in e)){var n;e.content instanceof V.util.ByteBuffer?n=e.content.bytes():typeof e.content=="string"&&(n=V.util.encodeUtf8(e.content)),r.detached?e.detachedContent=S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n)]))}if(e.signers.length!==0){var i=t();a(i)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=V.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},n=0;n<e.signers.length;++n){var i=e.signers[n],s=i.digestAlgorithm;s in r||(r[s]=V.md[V.pki.oids[s]].create()),i.authenticatedAttributes.length===0?i.md=r[s]:i.md=V.md[V.pki.oids[s]].create()}e.digestAlgorithmIdentifiers=[];for(var s in r)e.digestAlgorithmIdentifiers.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(s).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")]));return r}function a(r){var n;if(e.detachedContent?n=e.detachedContent:(n=e.contentInfo.value[1],n=n.value[0]),!n)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=S.derToOid(e.contentInfo.value[0].value),s=S.toDer(n);s.getByte(),S.getBerValueLength(s),s=s.getBytes();for(var o in r)r[o].start().update(s);for(var c=new Date,l=0;l<e.signers.length;++l){var u=e.signers[l];if(u.authenticatedAttributes.length===0){if(i!==V.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{u.authenticatedAttributesAsn1=S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[]),y=0;y<u.authenticatedAttributes.length;++y){var E=u.authenticatedAttributes[y];E.type===V.pki.oids.messageDigest?E.value=r[u.digestAlgorithm].digest():E.type===V.pki.oids.signingTime&&(E.value||(E.value=c)),f.value.push(Qc(E)),u.authenticatedAttributesAsn1.value.push(Qc(E))}s=S.toDer(f).getBytes(),u.md.start().update(s)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=M1(e.signers)}},lt.createEncryptedData=function(){var e=null;return e={type:V.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:V.pki.oids["aes256-CBC"]},fromAsn1:function(t){Xc(e,t,lt.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),O0(e)}},e},lt.createEnvelopedData=function(){var e=null;return e={type:V.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:V.pki.oids["aes256-CBC"]},fromAsn1:function(t){var a=Xc(e,t,lt.asn1.envelopedDataValidator);e.recipients=O1(a.recipientInfos.value)},toAsn1:function(){return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,V1(e.recipients)),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,K1(e.encryptedContent))])])])},findRecipient:function(t){for(var a=t.issuer.attributes,r=0;r<e.recipients.length;++r){var n=e.recipients[r],i=n.issuer;if(n.serialNumber===t.serialNumber&&i.length===a.length){for(var s=!0,o=0;o<a.length;++o)if(i[o].type!==a[o].type||i[o].value!==a[o].value){s=!1;break}if(s)return n}}return null},decrypt:function(t,a){if(e.encryptedContent.key===void 0&&t!==void 0&&a!==void 0)switch(t.encryptedContent.algorithm){case V.pki.oids.rsaEncryption:case V.pki.oids.desCBC:var r=a.decrypt(t.encryptedContent.content);e.encryptedContent.key=V.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}O0(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:V.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,a){if(e.encryptedContent.content===void 0){a=a||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,n,i;switch(a){case V.pki.oids["aes128-CBC"]:r=16,n=16,i=V.aes.createEncryptionCipher;break;case V.pki.oids["aes192-CBC"]:r=24,n=16,i=V.aes.createEncryptionCipher;break;case V.pki.oids["aes256-CBC"]:r=32,n=16,i=V.aes.createEncryptionCipher;break;case V.pki.oids["des-EDE3-CBC"]:r=24,n=8,i=V.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+a)}if(t===void 0)t=V.util.createBuffer(V.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=a,e.encryptedContent.key=t,e.encryptedContent.parameter=V.util.createBuffer(V.random.getBytes(n));var s=i(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var o=0;o<e.recipients.length;++o){var c=e.recipients[o];if(c.encryptedContent.content===void 0)switch(c.encryptedContent.algorithm){case V.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}},e};function D1(e){var t={},a=[];if(!S.validate(e,lt.asn1.recipientInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=a,r}return{version:t.version.charCodeAt(0),issuer:V.pki.RDNAttributesAsArray(t.issuer),serialNumber:V.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:S.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function P1(e){return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[V.pki.distinguishedNameToAsn1({attributes:e.issuer}),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,V.util.hexToBytes(e.serialNumber))]),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.encryptedContent.algorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")]),S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function O1(e){for(var t=[],a=0;a<e.length;++a)t.push(D1(e[a]));return t}function V1(e){for(var t=[],a=0;a<e.length;++a)t.push(P1(e[a]));return t}function F1(e){var t=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[V.pki.distinguishedNameToAsn1({attributes:e.issuer}),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,V.util.hexToBytes(e.serialNumber))]),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.digestAlgorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.signatureAlgorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")])),t.value.push(S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var a=S.create(S.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var n=e.unauthenticatedAttributes[r];a.values.push(Qc(n))}t.value.push(a)}return t}function M1(e){for(var t=[],a=0;a<e.length;++a)t.push(F1(e[a]));return t}function Qc(e){var t;if(e.type===V.pki.oids.contentType)t=S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.value).getBytes());else if(e.type===V.pki.oids.messageDigest)t=S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===V.pki.oids.signingTime){var a=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),n=e.value;if(typeof n=="string"){var i=Date.parse(n);isNaN(i)?n.length===13?n=S.utcTimeToDate(n):n=S.generalizedTimeToDate(n):n=new Date(i)}n>=a&&n<r?t=S.create(S.Class.UNIVERSAL,S.Type.UTCTIME,!1,S.dateToUtcTime(n)):t=S.create(S.Class.UNIVERSAL,S.Type.GENERALIZEDTIME,!1,S.dateToGeneralizedTime(n))}return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[t])])}function K1(e){return[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(V.pki.oids.data).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.algorithm).getBytes()),e.parameter?S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.content.getBytes())])]}function Xc(e,t,a){var r={},n=[];if(!S.validate(t,a,r,n)){var i=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw i.errors=i,i}var s=S.derToOid(r.contentType);if(s!==V.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var o="";if(V.util.isArray(r.encryptedContent))for(var c=0;c<r.encryptedContent.length;++c){if(r.encryptedContent[c].type!==S.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=r.encryptedContent[c].value}else o=r.encryptedContent;e.encryptedContent={algorithm:S.derToOid(r.encAlgorithm),parameter:V.util.createBuffer(r.encParameter.value),content:V.util.createBuffer(o)}}if(r.content){var o="";if(V.util.isArray(r.content))for(var c=0;c<r.content.length;++c){if(r.content[c].type!==S.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=r.content[c].value}else o=r.content;e.content=V.util.createBuffer(o)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function O0(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case V.pki.oids["aes128-CBC"]:case V.pki.oids["aes192-CBC"]:case V.pki.oids["aes256-CBC"]:t=V.aes.createDecryptionCipher(e.encryptedContent.key);break;case V.pki.oids.desCBC:case V.pki.oids["des-EDE3-CBC"]:t=V.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}var Re=J,tc=Re.ssh=Re.ssh||{};tc.privateKeyToPutty=function(e,t,a){a=a||"",t=t||"";var r="ssh-rsa",n=t===""?"none":"aes256-cbc",i="PuTTY-User-Key-File-2: "+r+`\r
|
|
39
15
|
`;i+="Encryption: "+n+`\r
|
|
40
16
|
`,i+="Comment: "+a+`\r
|
|
41
|
-
`;var s=
|
|
42
|
-
`,i+=o;var l=
|
|
17
|
+
`;var s=Re.util.createBuffer();xr(s,r),Lt(s,e.e),Lt(s,e.n);var o=Re.util.encode64(s.bytes(),64),c=Math.floor(o.length/66)+1;i+="Public-Lines: "+c+`\r
|
|
18
|
+
`,i+=o;var l=Re.util.createBuffer();Lt(l,e.d),Lt(l,e.p),Lt(l,e.q),Lt(l,e.qInv);var u;if(!t)u=Re.util.encode64(l.bytes(),64);else{var f=l.length()+16-1;f-=f%16;var y=rc(l.bytes());y.truncate(y.length()-f+l.length()),l.putBuffer(y);var E=Re.util.createBuffer();E.putBuffer(rc("\0\0\0\0",t)),E.putBuffer(rc("\0\0\0",t));var v=Re.aes.createEncryptionCipher(E.truncate(8),"CBC");v.start(Re.util.createBuffer().fillWithByte(0,16)),v.update(l.copy()),v.finish();var x=v.output;x.truncate(16),u=Re.util.encode64(x.bytes(),64)}c=Math.floor(u.length/66)+1,i+=`\r
|
|
43
19
|
Private-Lines: `+c+`\r
|
|
44
|
-
`,i+=u;var
|
|
45
|
-
Private-MAC: `+
|
|
46
|
-
`,i},Cl.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=et.util.createBuffer();return na(r,a),Jt(r,e.e),Jt(r,e.n),a+" "+et.util.encode64(r.bytes())+" "+t},Cl.privateKeyToOpenSSH=function(e,t){return t?et.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):et.pki.privateKeyToPem(e)},Cl.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||et.md.md5.create(),r="ssh-rsa",n=et.util.createBuffer();na(n,r),Jt(n,e.e),Jt(n,e.n),a.start(),a.update(n.getBytes());var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function Jt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=et.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function na(e,t){e.putInt32(t.length),e.putString(t)}function Tl(){for(var e=et.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}const Ut=()=>Or.randomUUID(),KT=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(a){throw re(a)?te(a):a}};var ah="10.5.4";const nh=({client:e})=>async({xRequestId:t,...a})=>{try{return ae(await e.PINAuthentication.getUserToken({...a},t))}catch(r){throw re(r)?te(r):r}},We=async(e,t,a=!1)=>{let r;return e.storage&&(r=await e.storage.get("userToken:"+t)),!a&&r?.userToken!=null&&r.expirationTime>Date.now()?r.userToken:await zT(e,t)};async function zT(e,t){const a=await nh(e)({userId:t});if(!a.data?.userToken)throw new Error("Could not fetch user token");return e.storage&&await e.storage.set("userToken:"+t,{...a.data,expirationTime:Date.now()+3e3*1e3}),a.data.userToken}const HT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut()},n))}catch(i){throw re(i)?te(i):i}},$T=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return ae(await e.client.Users.createUserWithPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),accountType:n,...s},i))}catch(o){throw re(o)?te(o):o}},GT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await We(e,a),{idempotencyKey:r??Ut()},n))}catch(i){throw re(i)?te(i):i}},WT=e=>async({userToken:t,userId:a,idempotencyKey:r})=>{try{return ae(await e.client.PINAuthentication.updateUserPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut()}))}catch(n){throw re(n)?te(n):n}},XT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserMessage(t??await We(e,a),n,r))}catch(i){throw re(i)?te(i):i}},QT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTransaction(t??await We(e,a),{...n},r))}catch(i){throw re(i)?te(i):i}},YT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTypedData(t??await We(e,a),n,r))}catch(i){throw re(i)?te(i):i}},JT=({client:e})=>async({id:t})=>{try{return ae(await e.TokenLookup.getTokenId(t))}catch(a){throw re(a)?te(a):a}},ZT=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await We(e,a),r,{idempotencyKey:n??Ut()},i))}catch(s){throw re(s)?te(s):s}},e2=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.createUserTransactionCancelChallenge(t??await We(e,a),r,{idempotencyKey:n??Ut()},i))}catch(s){throw re(s)?te(s):s}},t2=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return ae(await e.client.Transactions.createUserTransactionTransferChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),...n.config,...s},i))}catch(o){throw re(o)?te(o):o}},r2=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return ae(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),...n.config,...s},i))}catch(o){throw re(o)?te(o):o}},a2=e=>async({userId:t,userToken:a,source:r,xRequestId:n,...i})=>{try{return ae(await e.client.Transactions.createTransactionEstimateFee(a??await We(e,t),{...i,...r},n))}catch(s){throw re(s)?te(s):s}},n2=e=>async({userToken:t,userId:a,amount:r,xRequestId:n,...i})=>{try{return ae(await e.client.Transactions.createTransferEstimateFee(t??await We(e,a),{amounts:r,...i},n))}catch(s){throw re(s)?te(s):s}},s2=e=>async({id:t,userToken:a,userId:r,txType:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.getTransaction(t,a??await We(e,r),n,i))}catch(s){throw re(s)?te(s):s}},i2=({client:e})=>async({blockchain:t,address:a,walletId:r,xRequestId:n}={})=>{try{return ae(await e.Transactions.getLowestNonceTransaction(t,a,r,{headers:n?{"X-Request-Id":n}:void 0}))}catch(i){throw re(i)?te(i):i}},o2=e=>async({userToken:t,blockchain:a,destinationAddress:r,includeAll:n,operation:i,state:s,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:y,order:b,xRequestId:E})=>{try{return ae(await e.client.Transactions.listTransactions(t??await We(e,l),a,r,n,i,s,o,c,l,u?.join(","),p,y,g,d,h,b,E))}catch(I){throw re(I)?te(I):I}},c2=({client:e})=>async t=>{try{return ae(await e.Transactions.createValidateAddress(t))}catch(a){throw re(a)?te(a):a}},l2=({client:e})=>async({...t})=>{try{return ae(await e.PINAuthentication.createUser({...t}))}catch(a){throw re(a)?te(a):a}},u2=e=>async({userToken:t,idempotencyKey:a,userId:r,xRequestId:n,...i})=>{try{return ae(await e.client.SocialEmailAuthentication.resendOTP(t??await We(e,r),{idempotencyKey:a??Ut(),...i},n))}catch(s){throw re(s)?te(s):s}},p2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw re(n)?te(n):n}},d2=({client:e})=>async({userId:t,xRequestId:a})=>{try{return ae(await e.Users.getUser(t,a))}catch(r){throw re(r)?te(r):r}},f2=({client:e})=>async({userToken:t,xRequestId:a})=>{try{return ae(await e.Users.getUserByToken(t,a))}catch(r){throw re(r)?te(r):r}},h2=({client:e})=>async({userToken:t,challengeId:a,xRequestId:r})=>{try{return ae(await e.Users.getUserChallenge(t,a,r))}catch(n){throw re(n)?te(n):n}},m2=({client:e})=>async({pinStatus:t,securityQuestionStatus:a,from:r,to:n,pageBefore:i,pageAfter:s,pageSize:o,order:c,xRequestId:l}={})=>{try{return ae(await e.Users.listUsers(t,a,r,n,i,s,o,c,l))}catch(u){throw re(u)?te(u):u}},v2=({client:e})=>async({userToken:t,challengeStatus:a,xRequestId:r})=>{try{return ae(await e.Users.listUserChallenges(t,a,r))}catch(n){throw re(n)?te(n):n}},g2=e=>async({userId:t,userToken:a,deviceId:r,idempotencyKey:n,refreshToken:i,xRequestId:s})=>{try{return ae(await e.client.SocialEmailAuthentication.refreshUserToken(a??await We(e,t),{idempotencyKey:n??Ut(),refreshToken:i,deviceId:r},s))}catch(o){throw re(o)?te(o):o}},x2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw re(n)?te(n):n}},y2=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return ae(await e.client.Wallets.createUserWallet(t??await We(e,a),{idempotencyKey:r??Ut(),accountType:n,...s},i))}catch(o){throw re(o)?te(o):o}},b2=e=>async({id:t,userToken:a,userId:r,xRequestId:n})=>{try{return ae(await e.client.Wallets.getWallet(t,a??await We(e,r),n))}catch(i){throw re(i)?te(i):i}},E2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletNfts(a??await We(e,r),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw re(d)?te(d):d}},C2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletBalance(a??await We(e,r),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw re(d)?te(d):d}},T2=e=>async({userId:t,userToken:a,address:r,blockchain:n,from:i,pageAfter:s,pageBefore:o,pageSize:c,to:l,walletSetId:u,refId:p,scaCore:d,order:g,xRequestId:h})=>{try{return ae(await e.client.Wallets.listWallets(a??await We(e,t),r,n,d,u,p,i,l,o,s,c,g,h))}catch(y){throw re(y)?te(y):y}},S2=e=>async({id:t,name:a,refId:r,userToken:n,userId:i})=>{try{return ae(await e.client.Wallets.updateWallet(t,n??await We(e,i),{name:a,refId:r}))}catch(s){throw re(s)?te(s):s}};var w2=Object.defineProperty,A2=(e,t,a)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,I2=(e,t,a)=>A2(e,typeof t!="symbol"?t+"":t,a);const yp="https://api.circle.com";class sh{constructor(t){I2(this,"params");const{apiKey:a,baseUrl:r,storage:n,userAgent:i,headers:s}=t;this.params={client:new Vy(r??yp,{apiKey:a,version:ah,userAgent:i},s),configurationsClient:new py(r??yp,{apiKey:a,version:ah,userAgent:i},s),storage:n??new eb}}createUserPin(t){return HT(this.params)(t)}createUserPinWithWallets(t){return $T(this.params)(t)}updateUserPin(t){return WT(this.params)(t)}restoreUserPin(t){return GT(this.params)(t)}createDeviceTokenForEmailLogin(t){return p2(this.params)(t)}createDeviceTokenForSocialLogin(t){return x2(this.params)(t)}refreshUserToken(t){return g2(this.params)(t)}resendOTP(t){return u2(this.params)(t)}createWallet(t){return y2(this.params)(t)}listWallets(t){return T2(this.params)(t)}getWallet(t){return b2(this.params)(t)}updateWallet(t){return S2(this.params)(t)}getWalletTokenBalance(t){return C2(this.params)(t)}getWalletNFTBalance(t){return E2(this.params)(t)}accelerateTransaction(t){return ZT(this.params)(t)}createTransaction(t){return t2(this.params)(t)}cancelTransaction(t){return e2(this.params)(t)}getTransaction(t){return s2(this.params)(t)}listTransactions(t){return o2(this.params)(t)}estimateContractExecutionFee(t){return a2(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return r2(this.params)(t)}estimateTransferFee(t){return n2(this.params)(t)}validateAddress(t){return c2(this.params)(t)}getLowestNonceTransaction(t){return i2(this.params)(t)}createUser(t){return l2(this.params)(t)}getUser(t){return d2(this.params)(t)}getUserStatus(t){return f2(this.params)(t)}listUsers(t){return m2(this.params)(t)}createUserToken(t){return nh(this.params)(t)}getUserChallenge(t){return h2(this.params)(t)}listUserChallenges(t){return v2(this.params)(t)}getToken(t){return JT(this.params)(t)}signMessage(t){return XT(this.params)(t)}signTransaction(t){return QT(this.params)(t)}signTypedData(t){return YT(this.params)(t)}requestTestnetTokens(t){return KT(this.params)(t)}createMonitoredTokens(t){return V1(this.params)(t)}updateMonitoredTokens(t){return K1(this.params)(t)}listMonitoredTokens(t){return j1(this.params)(t)}deleteMonitoredTokens(t){return M1(this.params)(t)}updateMonitoredTokensScope(t){return z1(this.params)(t)}createSubscription(t){return H1(this.params)(t)}deleteSubscription(t){return $1(this.params)(t)}getSubscription(t){return G1(this.params)(t)}getNotificationSignature(t){return W1(this.params)(t)}listSubscriptions(){return X1(this.params)()}updateSubscription(t){return Q1(this.params)(t)}}function B2(e){return new sh(e)}exports.BadGatewayError=Ia,exports.BadRequestError=ba,exports.Blockchain=Dy,exports.CircleUserControlledWalletsClient=sh,exports.ConnectionAbortedError=Ua,exports.ConnectionRefusedError=ka,exports.ConnectionResetError=Oa,exports.ConnectionTimeoutError=_a,exports.DNSNotFoundError=Na,exports.DNSTimeoutError=La,exports.Error110700=Ru,exports.Error110701=ku,exports.Error110702=_u,exports.Error110703=Uu,exports.Error155101=Fa,exports.Error155102=qa,exports.Error155103=Va,exports.Error155104=Ma,exports.Error155105=ja,exports.Error155106=Ka,exports.Error155107=za,exports.Error155108=Ha,exports.Error155109=$a,exports.Error155110=Ga,exports.Error155111=Wa,exports.Error155112=Xa,exports.Error155113=Qa,exports.Error155114=Ya,exports.Error155115=Ja,exports.Error155116=Za,exports.Error155117=en,exports.Error155118=tn,exports.Error155119=rn,exports.Error155120=an,exports.Error155121=nn,exports.Error155122=sn,exports.Error155123=on,exports.Error155124=cn,exports.Error155130=ln,exports.Error155131=un,exports.Error155132=pn,exports.Error155133=dn,exports.Error155134=fn,exports.Error155135=hn,exports.Error155136=mn,exports.Error155137=vn,exports.Error155138=gn,exports.Error155139=xn,exports.Error155140=yn,exports.Error155141=bn,exports.Error155142=En,exports.Error155143=Cn,exports.Error155144=Tn,exports.Error155145=Sn,exports.Error155146=wn,exports.Error155150=An,exports.Error155151=In,exports.Error155152=Bn,exports.Error155154=Rn,exports.Error155155=kn,exports.Error155156=_n,exports.Error155157=Un,exports.Error155158=Nn,exports.Error155159=Ln,exports.Error155160=Pn,exports.Error155201=On,exports.Error155202=Dn,exports.Error155203=Fn,exports.Error155204=qn,exports.Error155205=Vn,exports.Error155206=Mn,exports.Error155207=jn,exports.Error155208=Kn,exports.Error155209=zn,exports.Error155210=Hn,exports.Error155211=$n,exports.Error155215=Gn,exports.Error155218=Wn,exports.Error155219=Xn,exports.Error155220=Qn,exports.Error155221=Yn,exports.Error155222=Jn,exports.Error155223=Zn,exports.Error155224=es,exports.Error155225=ts,exports.Error155226=rs,exports.Error155227=as,exports.Error155228=ns,exports.Error155229=ss,exports.Error155230=is,exports.Error155231=os,exports.Error155232=cs,exports.Error155233=ls,exports.Error155234=us,exports.Error155235=ps,exports.Error155236=ds,exports.Error155237=fs,exports.Error155238=hs,exports.Error155239=ms,exports.Error155240=vs,exports.Error155241=gs,exports.Error155242=xs,exports.Error155243=ys,exports.Error155244=bs,exports.Error155245=Es,exports.Error155247=Cs,exports.Error155254=Ts,exports.Error155257=Ss,exports.Error155258=ws,exports.Error155262=As,exports.Error155264=Is,exports.Error155501=Bs,exports.Error155502=Rs,exports.Error155503=ks,exports.Error155504=_s,exports.Error155505=Us,exports.Error155506=Ns,exports.Error155507=Ls,exports.Error155508=Ps,exports.Error155509=Os,exports.Error155510=Ds,exports.Error155511=Fs,exports.Error155512=qs,exports.Error155514=Vs,exports.Error155515=Ms,exports.Error155516=js,exports.Error155517=Ks,exports.Error155601=zs,exports.Error155701=Hs,exports.Error155702=$s,exports.Error155703=Gs,exports.Error155704=Ws,exports.Error155705=Xs,exports.Error155706=Qs,exports.Error155707=Ys,exports.Error155708=Js,exports.Error155709=Zs,exports.Error155710=ei,exports.Error155711=ti,exports.Error155712=ri,exports.Error155713=ai,exports.Error155714=ni,exports.Error155715=si,exports.Error155716=ii,exports.Error155717=oi,exports.Error155718=ci,exports.Error155719=li,exports.Error155720=ui,exports.Error155721=pi,exports.Error155801=di,exports.Error155802=fi,exports.Error155803=hi,exports.Error155804=mi,exports.Error155805=vi,exports.Error155806=gi,exports.Error155807=xi,exports.Error155808=yi,exports.Error156001=bi,exports.Error156002=Ei,exports.Error156003=Ci,exports.Error156004=Ti,exports.Error156005=Si,exports.Error156006=wi,exports.Error156007=Ai,exports.Error156008=Ii,exports.Error156009=Bi,exports.Error156010=Ri,exports.Error156011=ki,exports.Error156012=_i,exports.Error156013=Ui,exports.Error156014=Ni,exports.Error156015=Li,exports.Error156016=Pi,exports.Error156017=Oi,exports.Error156018=Di,exports.Error156019=Fi,exports.Error156020=qi,exports.Error156021=Vi,exports.Error156023=Mi,exports.Error156024=ji,exports.Error156025=Ki,exports.Error156026=zi,exports.Error156027=Hi,exports.Error156030=$i,exports.Error156031=Gi,exports.Error156032=Wi,exports.Error175001=Xi,exports.Error175002=Qi,exports.Error175003=Yi,exports.Error175004=Ji,exports.Error175005=Zi,exports.Error175006=eo,exports.Error175007=to,exports.Error175008=ro,exports.Error175009=ao,exports.Error175010=no,exports.Error175011=so,exports.Error175012=io,exports.Error175013=oo,exports.Error175201=co,exports.Error175202=lo,exports.Error175203=uo,exports.Error175204=po,exports.Error175205=fo,exports.Error175301=ho,exports.Error175302=mo,exports.Error175303=vo,exports.Error175401=go,exports.Error175402=xo,exports.Error175403=yo,exports.Error175404=bo,exports.Error175405=Eo,exports.Error175406=Co,exports.Error175407=To,exports.Error175408=So,exports.Error175409=wo,exports.Error175410=Ao,exports.Error177001=Io,exports.Error177002=Bo,exports.Error177003=Ro,exports.Error177004=ko,exports.Error177005=_o,exports.Error177006=Uo,exports.Error177007=No,exports.Error177008=Lo,exports.Error177009=Po,exports.Error177010=Oo,exports.Error177011=Do,exports.Error177012=Fo,exports.Error177013=qo,exports.Error177014=Vo,exports.Error177015=Mo,exports.Error177016=jo,exports.Error177017=Ko,exports.Error177018=zo,exports.Error177019=Ho,exports.Error177020=$o,exports.Error177021=Go,exports.Error177022=Wo,exports.Error177023=Xo,exports.Error177024=Qo,exports.Error177025=Yo,exports.Error177026=Jo,exports.Error177301=Zo,exports.Error177302=ec,exports.Error177303=tc,exports.Error177304=rc,exports.Error177305=ac,exports.Error177601=nc,exports.Error177602=sc,exports.Error177603=ic,exports.Error177604=oc,exports.Error177605=cc,exports.Error177606=lc,exports.Error177607=uc,exports.Error177901=pc,exports.ForbiddenError=Ca,exports.GatewayTimeoutError=Ra,exports.HostUnreachableError=Da,exports.HttpError=ya,exports.HttpRequestError=Lt,exports.HttpResponseError=C,exports.InternalServerError=wa,exports.NetworkUnreachableError=Pa,exports.NotFoundError=Ta,exports.NotImplementedError=Aa,exports.RatelimitError=Sa,exports.ServiceUnavailableError=Ba,exports.UnauthorizedError=Ea,exports.defaultBaseUrl=yp,exports.fromAxiosError=te,exports.initiateUserControlledWalletsClient=B2;
|
|
20
|
+
`,i+=u;var T=rc("putty-private-key-file-mac-key",t),I=Re.util.createBuffer();xr(I,r),xr(I,n),xr(I,a),I.putInt32(s.length()),I.putBuffer(s),I.putInt32(l.length()),I.putBuffer(l);var B=Re.hmac.create();return B.start("sha1",T),B.update(I.bytes()),i+=`\r
|
|
21
|
+
Private-MAC: `+B.digest().toHex()+`\r
|
|
22
|
+
`,i},tc.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=Re.util.createBuffer();return xr(r,a),Lt(r,e.e),Lt(r,e.n),a+" "+Re.util.encode64(r.bytes())+" "+t},tc.privateKeyToOpenSSH=function(e,t){return t?Re.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Re.pki.privateKeyToPem(e)},tc.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||Re.md.md5.create(),r="ssh-rsa",n=Re.util.createBuffer();xr(n,r),Lt(n,e.e),Lt(n,e.n),a.start(),a.update(n.getBytes());var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function Lt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=Re.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function xr(e,t){e.putInt32(t.length),e.putString(t)}function rc(){for(var e=Re.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}const yt=()=>wo.randomUUID(),q1=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(a){throw _.isAxiosError(a)?X(a):a}};var V0="10.5.5";const F0=({client:e})=>async({xRequestId:t,...a})=>{try{return j(await e.PINAuthentication.getUserToken({...a},t))}catch(r){throw _.isAxiosError(r)?X(r):r}},Be=async(e,t,a=!1)=>{let r;return e.storage&&(r=await e.storage.get("userToken:"+t)),!a&&r?.userToken!=null&&r.expirationTime>Date.now()?r.userToken:await H1(e,t)};async function H1(e,t){const a=await F0(e)({userId:t});if(!a.data?.userToken)throw new Error("Could not fetch user token");return e.storage&&await e.storage.set("userToken:"+t,{...a.data,expirationTime:Date.now()+3e3*1e3}),a.data.userToken}const G1=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return j(await e.client.PINAuthentication.createUserPinChallenge(t??await Be(e,a),{idempotencyKey:r??yt()},n))}catch(i){throw _.isAxiosError(i)?X(i):i}},W1=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return j(await e.client.Users.createUserWithPinChallenge(t??await Be(e,a),{idempotencyKey:r??yt(),accountType:n,...s},i))}catch(o){throw _.isAxiosError(o)?X(o):o}},z1=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return j(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await Be(e,a),{idempotencyKey:r??yt()},n))}catch(i){throw _.isAxiosError(i)?X(i):i}},$1=e=>async({userToken:t,userId:a,idempotencyKey:r})=>{try{return j(await e.client.PINAuthentication.updateUserPinChallenge(t??await Be(e,a),{idempotencyKey:r??yt()}))}catch(n){throw _.isAxiosError(n)?X(n):n}},Q1=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return j(await e.client.Signing.signUserMessage(t??await Be(e,a),n,r))}catch(i){throw _.isAxiosError(i)?X(i):i}},X1=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return j(await e.client.Signing.signUserTransaction(t??await Be(e,a),{...n},r))}catch(i){throw _.isAxiosError(i)?X(i):i}},j1=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return j(await e.client.Signing.signUserTypedData(t??await Be(e,a),n,r))}catch(i){throw _.isAxiosError(i)?X(i):i}},Y1=({client:e})=>async({id:t})=>{try{return j(await e.TokenLookup.getTokenId(t))}catch(a){throw _.isAxiosError(a)?X(a):a}},Z1=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return j(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await Be(e,a),r,{idempotencyKey:n??yt()},i))}catch(s){throw _.isAxiosError(s)?X(s):s}},J1=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return j(await e.client.Transactions.createUserTransactionCancelChallenge(t??await Be(e,a),r,{idempotencyKey:n??yt()},i))}catch(s){throw _.isAxiosError(s)?X(s):s}},eg=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return j(await e.client.Transactions.createUserTransactionTransferChallenge(t??await Be(e,a),{idempotencyKey:r??yt(),...n.config,...s},i))}catch(o){throw _.isAxiosError(o)?X(o):o}},tg=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return j(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await Be(e,a),{idempotencyKey:r??yt(),...n.config,...s},i))}catch(o){throw _.isAxiosError(o)?X(o):o}},rg=e=>async({userId:t,userToken:a,source:r,xRequestId:n,...i})=>{try{return j(await e.client.Transactions.createTransactionEstimateFee(a??await Be(e,t),{...i,...r},n))}catch(s){throw _.isAxiosError(s)?X(s):s}},ag=e=>async({userToken:t,userId:a,amount:r,xRequestId:n,...i})=>{try{return j(await e.client.Transactions.createTransferEstimateFee(t??await Be(e,a),{amounts:r,...i},n))}catch(s){throw _.isAxiosError(s)?X(s):s}},ng=e=>async({id:t,userToken:a,userId:r,txType:n,xRequestId:i})=>{try{return j(await e.client.Transactions.getTransaction(t,a??await Be(e,r),n,i))}catch(s){throw _.isAxiosError(s)?X(s):s}},sg=({client:e})=>async({blockchain:t,address:a,walletId:r,xRequestId:n}={})=>{try{return j(await e.Transactions.getLowestNonceTransaction(t,a,r,{headers:n?{"X-Request-Id":n}:void 0}))}catch(i){throw _.isAxiosError(i)?X(i):i}},ig=e=>async({userToken:t,blockchain:a,destinationAddress:r,includeAll:n,operation:i,state:s,txHash:o,txType:c,userId:l,walletIds:u,from:f,pageAfter:y,pageBefore:E,pageSize:v,to:x,order:T,xRequestId:I})=>{try{return j(await e.client.Transactions.listTransactions(t??await Be(e,l),a,r,n,i,s,o,c,l,u?.join(","),f,x,E,y,v,T,I))}catch(B){throw _.isAxiosError(B)?X(B):B}},og=({client:e})=>async t=>{try{return j(await e.Transactions.createValidateAddress(t))}catch(a){throw _.isAxiosError(a)?X(a):a}},cg=({client:e})=>async({...t})=>{try{return j(await e.PINAuthentication.createUser({...t}))}catch(a){throw _.isAxiosError(a)?X(a):a}},lg=e=>async({userToken:t,idempotencyKey:a,userId:r,xRequestId:n,...i})=>{try{return j(await e.client.SocialEmailAuthentication.resendOTP(t??await Be(e,r),{idempotencyKey:a??yt(),...i},n))}catch(s){throw _.isAxiosError(s)?X(s):s}},ug=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return j(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??yt(),...r},a))}catch(n){throw _.isAxiosError(n)?X(n):n}},fg=({client:e})=>async({userId:t,xRequestId:a})=>{try{return j(await e.Users.getUser(t,a))}catch(r){throw _.isAxiosError(r)?X(r):r}},dg=({client:e})=>async({userToken:t,xRequestId:a})=>{try{return j(await e.Users.getUserByToken(t,a))}catch(r){throw _.isAxiosError(r)?X(r):r}},hg=({client:e})=>async({userToken:t,challengeId:a,xRequestId:r})=>{try{return j(await e.Users.getUserChallenge(t,a,r))}catch(n){throw _.isAxiosError(n)?X(n):n}},pg=({client:e})=>async({pinStatus:t,securityQuestionStatus:a,from:r,to:n,pageBefore:i,pageAfter:s,pageSize:o,order:c,xRequestId:l}={})=>{try{return j(await e.Users.listUsers(t,a,r,n,i,s,o,c,l))}catch(u){throw _.isAxiosError(u)?X(u):u}},gg=({client:e})=>async({userToken:t,challengeStatus:a,xRequestId:r})=>{try{return j(await e.Users.listUserChallenges(t,a,r))}catch(n){throw _.isAxiosError(n)?X(n):n}},yg=e=>async({userId:t,userToken:a,deviceId:r,idempotencyKey:n,refreshToken:i,xRequestId:s})=>{try{return j(await e.client.SocialEmailAuthentication.refreshUserToken(a??await Be(e,t),{idempotencyKey:n??yt(),refreshToken:i,deviceId:r},s))}catch(o){throw _.isAxiosError(o)?X(o):o}},vg=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return j(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??yt(),...r},a))}catch(n){throw _.isAxiosError(n)?X(n):n}},mg=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return j(await e.client.Wallets.createUserWallet(t??await Be(e,a),{idempotencyKey:r??yt(),accountType:n,...s},i))}catch(o){throw _.isAxiosError(o)?X(o):o}},Eg=e=>async({id:t,userToken:a,userId:r,xRequestId:n})=>{try{return j(await e.client.Wallets.getWallet(t,a??await Be(e,r),n))}catch(i){throw _.isAxiosError(i)?X(i):i}},Cg=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:f})=>{try{return j(await e.client.Wallets.listWalletNfts(a??await Be(e,r),t,n,i,l?.join(","),u,o,s,c,f))}catch(y){throw _.isAxiosError(y)?X(y):y}},xg=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:f})=>{try{return j(await e.client.Wallets.listWalletBalance(a??await Be(e,r),t,n,i,l?.join(","),u,o,s,c,f))}catch(y){throw _.isAxiosError(y)?X(y):y}},Tg=e=>async({userId:t,userToken:a,address:r,blockchain:n,from:i,pageAfter:s,pageBefore:o,pageSize:c,to:l,walletSetId:u,refId:f,scaCore:y,order:E,xRequestId:v})=>{try{return j(await e.client.Wallets.listWallets(a??await Be(e,t),r,n,y,u,f,i,l,o,s,c,E,v))}catch(x){throw _.isAxiosError(x)?X(x):x}},Sg=e=>async({id:t,name:a,refId:r,userToken:n,userId:i})=>{try{return j(await e.client.Wallets.updateWallet(t,n??await Be(e,i),{name:a,refId:r}))}catch(s){throw _.isAxiosError(s)?X(s):s}};var Ag=Object.defineProperty,Ig=(e,t,a)=>t in e?Ag(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,bg=(e,t,a)=>Ig(e,typeof t!="symbol"?t+"":t,a);const jc="https://api.circle.com";class M0{constructor(t){bg(this,"params");const{apiKey:a,baseUrl:r,storage:n,userAgent:i,headers:s}=t;this.params={client:new Ou(r??jc,{apiKey:a,version:V0,userAgent:i},s),configurationsClient:new cu(r??jc,{apiKey:a,version:V0,userAgent:i},s),storage:n??new Zf}}createUserPin(t){return G1(this.params)(t)}createUserPinWithWallets(t){return W1(this.params)(t)}updateUserPin(t){return $1(this.params)(t)}restoreUserPin(t){return z1(this.params)(t)}createDeviceTokenForEmailLogin(t){return ug(this.params)(t)}createDeviceTokenForSocialLogin(t){return vg(this.params)(t)}refreshUserToken(t){return yg(this.params)(t)}resendOTP(t){return lg(this.params)(t)}createWallet(t){return mg(this.params)(t)}listWallets(t){return Tg(this.params)(t)}getWallet(t){return Eg(this.params)(t)}updateWallet(t){return Sg(this.params)(t)}getWalletTokenBalance(t){return xg(this.params)(t)}getWalletNFTBalance(t){return Cg(this.params)(t)}accelerateTransaction(t){return Z1(this.params)(t)}createTransaction(t){return eg(this.params)(t)}cancelTransaction(t){return J1(this.params)(t)}getTransaction(t){return ng(this.params)(t)}listTransactions(t){return ig(this.params)(t)}estimateContractExecutionFee(t){return rg(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return tg(this.params)(t)}estimateTransferFee(t){return ag(this.params)(t)}validateAddress(t){return og(this.params)(t)}getLowestNonceTransaction(t){return sg(this.params)(t)}createUser(t){return cg(this.params)(t)}getUser(t){return fg(this.params)(t)}getUserStatus(t){return dg(this.params)(t)}listUsers(t){return pg(this.params)(t)}createUserToken(t){return F0(this.params)(t)}getUserChallenge(t){return hg(this.params)(t)}listUserChallenges(t){return gg(this.params)(t)}getToken(t){return Y1(this.params)(t)}signMessage(t){return Q1(this.params)(t)}signTransaction(t){return X1(this.params)(t)}signTypedData(t){return j1(this.params)(t)}requestTestnetTokens(t){return q1(this.params)(t)}createMonitoredTokens(t){return Vf(this.params)(t)}updateMonitoredTokens(t){return Kf(this.params)(t)}listMonitoredTokens(t){return Mf(this.params)(t)}deleteMonitoredTokens(t){return Ff(this.params)(t)}updateMonitoredTokensScope(t){return qf(this.params)(t)}createSubscription(t){return Hf(this.params)(t)}deleteSubscription(t){return Gf(this.params)(t)}getSubscription(t){return Wf(this.params)(t)}getNotificationSignature(t){return zf(this.params)(t)}listSubscriptions(){return $f(this.params)()}updateSubscription(t){return Qf(this.params)(t)}}function Bg(e){return new M0(e)}exports.BadGatewayError=Nr,exports.BadRequestError=Ar,exports.Blockchain=Lu,exports.CircleUserControlledWalletsClient=M0,exports.ConnectionAbortedError=Pr,exports.ConnectionRefusedError=Lr,exports.ConnectionResetError=Mr,exports.ConnectionTimeoutError=Dr,exports.DNSNotFoundError=Or,exports.DNSTimeoutError=Vr,exports.Error110700=ic,exports.Error110701=oc,exports.Error110702=cc,exports.Error110703=lc,exports.Error155101=qr,exports.Error155102=Hr,exports.Error155103=Gr,exports.Error155104=Wr,exports.Error155105=zr,exports.Error155106=$r,exports.Error155107=Qr,exports.Error155108=Xr,exports.Error155109=jr,exports.Error155110=Yr,exports.Error155111=Zr,exports.Error155112=Jr,exports.Error155113=ea,exports.Error155114=ta,exports.Error155115=ra,exports.Error155116=aa,exports.Error155117=na,exports.Error155118=sa,exports.Error155119=ia,exports.Error155120=oa,exports.Error155121=ca,exports.Error155122=la,exports.Error155123=ua,exports.Error155124=fa,exports.Error155130=da,exports.Error155131=ha,exports.Error155132=pa,exports.Error155133=ga,exports.Error155134=ya,exports.Error155135=va,exports.Error155136=ma,exports.Error155137=Ea,exports.Error155138=Ca,exports.Error155139=xa,exports.Error155140=Ta,exports.Error155141=Sa,exports.Error155142=Aa,exports.Error155143=Ia,exports.Error155144=ba,exports.Error155145=Ba,exports.Error155146=wa,exports.Error155150=Ua,exports.Error155151=ka,exports.Error155152=Na,exports.Error155154=Ra,exports.Error155155=_a,exports.Error155156=La,exports.Error155157=Da,exports.Error155158=Pa,exports.Error155159=Oa,exports.Error155160=Va,exports.Error155201=Fa,exports.Error155202=Ma,exports.Error155203=Ka,exports.Error155204=qa,exports.Error155205=Ha,exports.Error155206=Ga,exports.Error155207=Wa,exports.Error155208=za,exports.Error155209=$a,exports.Error155210=Qa,exports.Error155211=Xa,exports.Error155215=ja,exports.Error155218=Ya,exports.Error155219=Za,exports.Error155220=Ja,exports.Error155221=en,exports.Error155222=tn,exports.Error155223=rn,exports.Error155224=an,exports.Error155225=nn,exports.Error155226=sn,exports.Error155227=on,exports.Error155228=cn,exports.Error155229=ln,exports.Error155230=un,exports.Error155231=fn,exports.Error155232=dn,exports.Error155233=hn,exports.Error155234=pn,exports.Error155235=gn,exports.Error155236=yn,exports.Error155237=vn,exports.Error155238=mn,exports.Error155239=En,exports.Error155240=Cn,exports.Error155241=xn,exports.Error155242=Tn,exports.Error155243=Sn,exports.Error155244=An,exports.Error155245=In,exports.Error155247=bn,exports.Error155254=Bn,exports.Error155257=wn,exports.Error155258=Un,exports.Error155262=kn,exports.Error155264=Nn,exports.Error155501=Rn,exports.Error155502=_n,exports.Error155503=Ln,exports.Error155504=Dn,exports.Error155505=Pn,exports.Error155506=On,exports.Error155507=Vn,exports.Error155508=Fn,exports.Error155509=Mn,exports.Error155510=Kn,exports.Error155511=qn,exports.Error155512=Hn,exports.Error155514=Gn,exports.Error155515=Wn,exports.Error155516=zn,exports.Error155517=$n,exports.Error155601=Qn,exports.Error155701=Xn,exports.Error155702=jn,exports.Error155703=Yn,exports.Error155704=Zn,exports.Error155705=Jn,exports.Error155706=es,exports.Error155707=ts,exports.Error155708=rs,exports.Error155709=as,exports.Error155710=ns,exports.Error155711=ss,exports.Error155712=is,exports.Error155713=os,exports.Error155714=cs,exports.Error155715=ls,exports.Error155716=us,exports.Error155717=fs,exports.Error155718=ds,exports.Error155719=hs,exports.Error155720=ps,exports.Error155721=gs,exports.Error155801=ys,exports.Error155802=vs,exports.Error155803=ms,exports.Error155804=Es,exports.Error155805=Cs,exports.Error155806=xs,exports.Error155807=Ts,exports.Error155808=Ss,exports.Error156001=As,exports.Error156002=Is,exports.Error156003=bs,exports.Error156004=Bs,exports.Error156005=ws,exports.Error156006=Us,exports.Error156007=ks,exports.Error156008=Ns,exports.Error156009=Rs,exports.Error156010=_s,exports.Error156011=Ls,exports.Error156012=Ds,exports.Error156013=Ps,exports.Error156014=Os,exports.Error156015=Vs,exports.Error156016=Fs,exports.Error156017=Ms,exports.Error156018=Ks,exports.Error156019=qs,exports.Error156020=Hs,exports.Error156021=Gs,exports.Error156023=Ws,exports.Error156024=zs,exports.Error156025=$s,exports.Error156026=Qs,exports.Error156027=Xs,exports.Error156030=js,exports.Error156031=Ys,exports.Error156032=Zs,exports.Error175001=Js,exports.Error175002=ei,exports.Error175003=ti,exports.Error175004=ri,exports.Error175005=ai,exports.Error175006=ni,exports.Error175007=si,exports.Error175008=ii,exports.Error175009=oi,exports.Error175010=ci,exports.Error175011=li,exports.Error175012=ui,exports.Error175013=fi,exports.Error175201=di,exports.Error175202=hi,exports.Error175203=pi,exports.Error175204=gi,exports.Error175205=yi,exports.Error175301=vi,exports.Error175302=mi,exports.Error175303=Ei,exports.Error175401=Ci,exports.Error175402=xi,exports.Error175403=Ti,exports.Error175404=Si,exports.Error175405=Ai,exports.Error175406=Ii,exports.Error175407=bi,exports.Error175408=Bi,exports.Error175409=wi,exports.Error175410=Ui,exports.Error177001=ki,exports.Error177002=Ni,exports.Error177003=Ri,exports.Error177004=_i,exports.Error177005=Li,exports.Error177006=Di,exports.Error177007=Pi,exports.Error177008=Oi,exports.Error177009=Vi,exports.Error177010=Fi,exports.Error177011=Mi,exports.Error177012=Ki,exports.Error177013=qi,exports.Error177014=Hi,exports.Error177015=Gi,exports.Error177016=Wi,exports.Error177017=zi,exports.Error177018=$i,exports.Error177019=Qi,exports.Error177020=Xi,exports.Error177021=ji,exports.Error177022=Yi,exports.Error177023=Zi,exports.Error177024=Ji,exports.Error177025=eo,exports.Error177026=to,exports.Error177301=ro,exports.Error177302=ao,exports.Error177303=no,exports.Error177304=so,exports.Error177305=io,exports.Error177601=oo,exports.Error177602=co,exports.Error177603=lo,exports.Error177604=uo,exports.Error177605=fo,exports.Error177606=ho,exports.Error177607=po,exports.Error177901=go,exports.ForbiddenError=br,exports.GatewayTimeoutError=_r,exports.HostUnreachableError=Kr,exports.HttpError=Sr,exports.HttpRequestError=mt,exports.HttpResponseError=m,exports.InternalServerError=Ur,exports.NetworkUnreachableError=Fr,exports.NotFoundError=Br,exports.NotImplementedError=kr,exports.RatelimitError=wr,exports.ServiceUnavailableError=Rr,exports.UnauthorizedError=Ir,exports.defaultBaseUrl=jc,exports.fromAxiosError=X,exports.initiateUserControlledWalletsClient=Bg;
|