Sub-Store/sub-store-1.min.js
github-actions[bot] 1a70249d78 release: 2.19.18
2025-04-08 04:49:07 +00:00

1159 lines
895 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var S3=Object.create;var Ng=Object.defineProperty;var b3=Object.getOwnPropertyDescriptor;var C3=Object.getOwnPropertyNames;var F3=Object.getPrototypeOf,_3=Object.prototype.hasOwnProperty;var Oa=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var I3=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of C3(t))!_3.call(e,i)&&i!==r&&Ng(e,i,{get:()=>t[i],enumerable:!(n=b3(t,i))||n.enumerable});return e};var ln=(e,t,r)=>(r=e!=null?S3(F3(e)):{},I3(t||!e||!e.__esModule?Ng(r,"default",{value:e,enumerable:!0}):r,e));var Up=we((DP,Mg)=>{var k3=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Mg.exports=k3});var Hp=we((BP,qg)=>{var L3="2.0.0",U3=Number.MAX_SAFE_INTEGER||9007199254740991,H3=16,j3=250,M3=["major","premajor","minor","preminor","patch","prepatch","prerelease"];qg.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:H3,MAX_SAFE_BUILD_LENGTH:j3,MAX_SAFE_INTEGER:U3,RELEASE_TYPES:M3,SEMVER_SPEC_VERSION:L3,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qp=we((hs,Vg)=>{var{MAX_SAFE_COMPONENT_LENGTH:jp,MAX_SAFE_BUILD_LENGTH:q3,MAX_LENGTH:V3}=Hp(),K3=Up();hs=Vg.exports={};var G3=hs.re=[],z3=hs.safeRe=[],Te=hs.src=[],xe=hs.t={},Y3=0,Mp="[a-zA-Z0-9-]",W3=[["\\s",1],["\\d",V3],[Mp,q3]],X3=e=>{for(let[t,r]of W3)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},Xe=(e,t,r)=>{let n=X3(t),i=Y3++;K3(e,i,t),xe[e]=i,Te[i]=t,G3[i]=new RegExp(t,r?"g":void 0),z3[i]=new RegExp(n,r?"g":void 0)};Xe("NUMERICIDENTIFIER","0|[1-9]\\d*");Xe("NUMERICIDENTIFIERLOOSE","\\d+");Xe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Mp}*`);Xe("MAINVERSION",`(${Te[xe.NUMERICIDENTIFIER]})\\.(${Te[xe.NUMERICIDENTIFIER]})\\.(${Te[xe.NUMERICIDENTIFIER]})`);Xe("MAINVERSIONLOOSE",`(${Te[xe.NUMERICIDENTIFIERLOOSE]})\\.(${Te[xe.NUMERICIDENTIFIERLOOSE]})\\.(${Te[xe.NUMERICIDENTIFIERLOOSE]})`);Xe("PRERELEASEIDENTIFIER",`(?:${Te[xe.NUMERICIDENTIFIER]}|${Te[xe.NONNUMERICIDENTIFIER]})`);Xe("PRERELEASEIDENTIFIERLOOSE",`(?:${Te[xe.NUMERICIDENTIFIERLOOSE]}|${Te[xe.NONNUMERICIDENTIFIER]})`);Xe("PRERELEASE",`(?:-(${Te[xe.PRERELEASEIDENTIFIER]}(?:\\.${Te[xe.PRERELEASEIDENTIFIER]})*))`);Xe("PRERELEASELOOSE",`(?:-?(${Te[xe.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Te[xe.PRERELEASEIDENTIFIERLOOSE]})*))`);Xe("BUILDIDENTIFIER",`${Mp}+`);Xe("BUILD",`(?:\\+(${Te[xe.BUILDIDENTIFIER]}(?:\\.${Te[xe.BUILDIDENTIFIER]})*))`);Xe("FULLPLAIN",`v?${Te[xe.MAINVERSION]}${Te[xe.PRERELEASE]}?${Te[xe.BUILD]}?`);Xe("FULL",`^${Te[xe.FULLPLAIN]}$`);Xe("LOOSEPLAIN",`[v=\\s]*${Te[xe.MAINVERSIONLOOSE]}${Te[xe.PRERELEASELOOSE]}?${Te[xe.BUILD]}?`);Xe("LOOSE",`^${Te[xe.LOOSEPLAIN]}$`);Xe("GTLT","((?:<|>)?=?)");Xe("XRANGEIDENTIFIERLOOSE",`${Te[xe.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Xe("XRANGEIDENTIFIER",`${Te[xe.NUMERICIDENTIFIER]}|x|X|\\*`);Xe("XRANGEPLAIN",`[v=\\s]*(${Te[xe.XRANGEIDENTIFIER]})(?:\\.(${Te[xe.XRANGEIDENTIFIER]})(?:\\.(${Te[xe.XRANGEIDENTIFIER]})(?:${Te[xe.PRERELEASE]})?${Te[xe.BUILD]}?)?)?`);Xe("XRANGEPLAINLOOSE",`[v=\\s]*(${Te[xe.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Te[xe.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Te[xe.XRANGEIDENTIFIERLOOSE]})(?:${Te[xe.PRERELEASELOOSE]})?${Te[xe.BUILD]}?)?)?`);Xe("XRANGE",`^${Te[xe.GTLT]}\\s*${Te[xe.XRANGEPLAIN]}$`);Xe("XRANGELOOSE",`^${Te[xe.GTLT]}\\s*${Te[xe.XRANGEPLAINLOOSE]}$`);Xe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${jp}})(?:\\.(\\d{1,${jp}}))?(?:\\.(\\d{1,${jp}}))?`);Xe("COERCE",`${Te[xe.COERCEPLAIN]}(?:$|[^\\d])`);Xe("COERCEFULL",Te[xe.COERCEPLAIN]+`(?:${Te[xe.PRERELEASE]})?(?:${Te[xe.BUILD]})?(?:$|[^\\d])`);Xe("COERCERTL",Te[xe.COERCE],!0);Xe("COERCERTLFULL",Te[xe.COERCEFULL],!0);Xe("LONETILDE","(?:~>?)");Xe("TILDETRIM",`(\\s*)${Te[xe.LONETILDE]}\\s+`,!0);hs.tildeTrimReplace="$1~";Xe("TILDE",`^${Te[xe.LONETILDE]}${Te[xe.XRANGEPLAIN]}$`);Xe("TILDELOOSE",`^${Te[xe.LONETILDE]}${Te[xe.XRANGEPLAINLOOSE]}$`);Xe("LONECARET","(?:\\^)");Xe("CARETTRIM",`(\\s*)${Te[xe.LONECARET]}\\s+`,!0);hs.caretTrimReplace="$1^";Xe("CARET",`^${Te[xe.LONECARET]}${Te[xe.XRANGEPLAIN]}$`);Xe("CARETLOOSE",`^${Te[xe.LONECARET]}${Te[xe.XRANGEPLAINLOOSE]}$`);Xe("COMPARATORLOOSE",`^${Te[xe.GTLT]}\\s*(${Te[xe.LOOSEPLAIN]})$|^$`);Xe("COMPARATOR",`^${Te[xe.GTLT]}\\s*(${Te[xe.FULLPLAIN]})$|^$`);Xe("COMPARATORTRIM",`(\\s*)${Te[xe.GTLT]}\\s*(${Te[xe.LOOSEPLAIN]}|${Te[xe.XRANGEPLAIN]})`,!0);hs.comparatorTrimReplace="$1$2$3";Xe("HYPHENRANGE",`^\\s*(${Te[xe.XRANGEPLAIN]})\\s+-\\s+(${Te[xe.XRANGEPLAIN]})\\s*$`);Xe("HYPHENRANGELOOSE",`^\\s*(${Te[xe.XRANGEPLAINLOOSE]})\\s+-\\s+(${Te[xe.XRANGEPLAINLOOSE]})\\s*$`);Xe("STAR","(<|>)?=?\\s*\\*");Xe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Xe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Gg=we(($P,Kg)=>{var J3=Object.freeze({loose:!0}),Z3=Object.freeze({}),Q3=e=>e?typeof e!="object"?J3:e:Z3;Kg.exports=Q3});var Xg=we((PP,Wg)=>{var zg=/^[0-9]+$/,Yg=(e,t)=>{let r=zg.test(e),n=zg.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},eb=(e,t)=>Yg(t,e);Wg.exports={compareIdentifiers:Yg,rcompareIdentifiers:eb}});var Zl=we((RP,em)=>{var Xl=Up(),{MAX_LENGTH:Jg,MAX_SAFE_INTEGER:Jl}=Hp(),{safeRe:Zg,t:Qg}=qp(),tb=Gg(),{compareIdentifiers:Vu}=Xg(),Vp=class e{constructor(t,r){if(r=tb(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Jg)throw new TypeError(`version is longer than ${Jg} characters`);Xl("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Zg[Qg.LOOSE]:Zg[Qg.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Jl||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Jl||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Jl||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let a=+i;if(a>=0&&a<Jl)return a}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Xl("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Vu(this.major,t.major)||Vu(this.minor,t.minor)||Vu(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(Xl("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Vu(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(Xl("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Vu(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let a=[r,i];n===!1&&(a=[r]),Vu(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};em.exports=Vp});var nm=we((TP,rm)=>{var tm=Zl(),rb=(e,t,r)=>new tm(e,r).compare(new tm(t,r));rm.exports=rb});var sm=we((xP,im)=>{var nb=nm(),ib=(e,t,r)=>nb(e,t,r)>=0;im.exports=ib});var om=we((OP,um)=>{var am=Zl(),sb=(e,t,r=!1)=>{if(e instanceof am)return e;try{return new am(e,t)}catch(n){if(!r)return null;throw n}};um.exports=sb});var lm=we((NP,cm)=>{var ab=Zl(),ub=om(),{safeRe:Ql,t:ef}=qp(),ob=(e,t)=>{if(e instanceof ab)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Ql[ef.COERCEFULL]:Ql[ef.COERCE]);else{let l=t.includePrerelease?Ql[ef.COERCERTLFULL]:Ql[ef.COERCERTL],h;for(;(h=l.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||h.index+h[0].length!==r.index+r[0].length)&&(r=h),l.lastIndex=h.index+h[1].length+h[2].length;l.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",a=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",o=t.includePrerelease&&r[6]?`+${r[6]}`:"";return ub(`${n}.${i}.${a}${s}${o}`,t)};cm.exports=ob});var gm=we(rf=>{"use strict";rf.byteLength=fb;rf.toByteArray=pb;rf.fromByteArray=mb;var Fi=[],Xn=[],lb=typeof Uint8Array<"u"?Uint8Array:Array,zp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ha=0,pm=zp.length;Ha<pm;++Ha)Fi[Ha]=zp[Ha],Xn[zp.charCodeAt(Ha)]=Ha;var Ha,pm;Xn[45]=62;Xn[95]=63;function dm(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function fb(e){var t=dm(e),r=t[0],n=t[1];return(r+n)*3/4-n}function hb(e,t,r){return(t+r)*3/4-r}function pb(e){var t,r=dm(e),n=r[0],i=r[1],a=new lb(hb(e,n,i)),s=0,o=i>0?n-4:n,l;for(l=0;l<o;l+=4)t=Xn[e.charCodeAt(l)]<<18|Xn[e.charCodeAt(l+1)]<<12|Xn[e.charCodeAt(l+2)]<<6|Xn[e.charCodeAt(l+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return i===2&&(t=Xn[e.charCodeAt(l)]<<2|Xn[e.charCodeAt(l+1)]>>4,a[s++]=t&255),i===1&&(t=Xn[e.charCodeAt(l)]<<10|Xn[e.charCodeAt(l+1)]<<4|Xn[e.charCodeAt(l+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function db(e){return Fi[e>>18&63]+Fi[e>>12&63]+Fi[e>>6&63]+Fi[e&63]}function gb(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(db(n));return i.join("")}function mb(e){for(var t,r=e.length,n=r%3,i=[],a=16383,s=0,o=r-n;s<o;s+=a)i.push(gb(e,s,s+a>o?o:s+a));return n===1?(t=e[r-1],i.push(Fi[t>>2]+Fi[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Fi[t>>10]+Fi[t>>4&63]+Fi[t<<2&63]+"=")),i.join("")}});var mm=we(Yp=>{Yp.read=function(e,t,r,n,i){var a,s,o=i*8-n-1,l=(1<<o)-1,h=l>>1,d=-7,E=r?i-1:0,p=r?-1:1,f=e[t+E];for(E+=p,a=f&(1<<-d)-1,f>>=-d,d+=o;d>0;a=a*256+e[t+E],E+=p,d-=8);for(s=a&(1<<-d)-1,a>>=-d,d+=n;d>0;s=s*256+e[t+E],E+=p,d-=8);if(a===0)a=1-h;else{if(a===l)return s?NaN:(f?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-h}return(f?-1:1)*s*Math.pow(2,a-n)};Yp.write=function(e,t,r,n,i,a){var s,o,l,h=a*8-i-1,d=(1<<h)-1,E=d>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,w=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+E>=1?t+=p/l:t+=p*Math.pow(2,1-E),t*l>=2&&(s++,l/=2),s+E>=d?(o=0,s=d):s+E>=1?(o=(t*l-1)*Math.pow(2,i),s=s+E):(o=t*Math.pow(2,E-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=o&255,f+=w,o/=256,i-=8);for(s=s<<i|o,h+=i;h>0;e[r+f]=s&255,f+=w,s/=256,h-=8);e[r+f-w]|=g*128}});var af=we(Yu=>{"use strict";var Wp=gm(),Gu=mm(),vm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Yu.Buffer=fe;Yu.SlowBuffer=Sb;Yu.INSPECT_MAX_BYTES=50;var nf=2147483647;Yu.kMaxLength=nf;fe.TYPED_ARRAY_SUPPORT=vb();!fe.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function vb(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(fe.prototype,"parent",{enumerable:!0,get:function(){if(fe.isBuffer(this))return this.buffer}});Object.defineProperty(fe.prototype,"offset",{enumerable:!0,get:function(){if(fe.isBuffer(this))return this.byteOffset}});function ps(e){if(e>nf)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,fe.prototype),t}function fe(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Qp(e)}return ym(e,t,r)}fe.poolSize=8192;function ym(e,t,r){if(typeof e=="string")return Ab(e,t);if(ArrayBuffer.isView(e))return wb(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(_i(e,ArrayBuffer)||e&&_i(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_i(e,SharedArrayBuffer)||e&&_i(e.buffer,SharedArrayBuffer)))return Jp(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return fe.from(n,t,r);let i=yb(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return fe.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}fe.from=function(e,t,r){return ym(e,t,r)};Object.setPrototypeOf(fe.prototype,Uint8Array.prototype);Object.setPrototypeOf(fe,Uint8Array);function Sm(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Eb(e,t,r){return Sm(e),e<=0?ps(e):t!==void 0?typeof r=="string"?ps(e).fill(t,r):ps(e).fill(t):ps(e)}fe.alloc=function(e,t,r){return Eb(e,t,r)};function Qp(e){return Sm(e),ps(e<0?0:ed(e)|0)}fe.allocUnsafe=function(e){return Qp(e)};fe.allocUnsafeSlow=function(e){return Qp(e)};function Ab(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!fe.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=bm(e,t)|0,n=ps(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Xp(e){let t=e.length<0?0:ed(e.length)|0,r=ps(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function wb(e){if(_i(e,Uint8Array)){let t=new Uint8Array(e);return Jp(t.buffer,t.byteOffset,t.byteLength)}return Xp(e)}function Jp(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,fe.prototype),n}function yb(e){if(fe.isBuffer(e)){let t=ed(e.length)|0,r=ps(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||rd(e.length)?ps(0):Xp(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Xp(e.data)}function ed(e){if(e>=nf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+nf.toString(16)+" bytes");return e|0}function Sb(e){return+e!=e&&(e=0),fe.alloc(+e)}fe.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==fe.prototype};fe.compare=function(t,r){if(_i(t,Uint8Array)&&(t=fe.from(t,t.offset,t.byteLength)),_i(r,Uint8Array)&&(r=fe.from(r,r.offset,r.byteLength)),!fe.isBuffer(t)||!fe.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let a=0,s=Math.min(n,i);a<s;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0};fe.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};fe.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return fe.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let i=fe.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){let s=t[n];if(_i(s,Uint8Array))a+s.length>i.length?(fe.isBuffer(s)||(s=fe.from(s)),s.copy(i,a)):Uint8Array.prototype.set.call(i,s,a);else if(fe.isBuffer(s))s.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return i};function bm(e,t){if(fe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||_i(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Zp(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Rm(e).length;default:if(i)return n?-1:Zp(e).length;t=(""+t).toLowerCase(),i=!0}}fe.byteLength=bm;function bb(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Tb(this,t,r);case"utf8":case"utf-8":return Fm(this,t,r);case"ascii":return Pb(this,t,r);case"latin1":case"binary":return Rb(this,t,r);case"base64":return Bb(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xb(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}fe.prototype._isBuffer=!0;function ja(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}fe.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)ja(this,r,r+1);return this};fe.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)ja(this,r,r+3),ja(this,r+1,r+2);return this};fe.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)ja(this,r,r+7),ja(this,r+1,r+6),ja(this,r+2,r+5),ja(this,r+3,r+4);return this};fe.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Fm(this,0,t):bb.apply(this,arguments)};fe.prototype.toLocaleString=fe.prototype.toString;fe.prototype.equals=function(t){if(!fe.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:fe.compare(this,t)===0};fe.prototype.inspect=function(){let t="",r=Yu.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};vm&&(fe.prototype[vm]=fe.prototype.inspect);fe.prototype.compare=function(t,r,n,i,a){if(_i(t,Uint8Array)&&(t=fe.from(t,t.offset,t.byteLength)),!fe.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;let s=a-i,o=n-r,l=Math.min(s,o),h=this.slice(i,a),d=t.slice(r,n);for(let E=0;E<l;++E)if(h[E]!==d[E]){s=h[E],o=d[E];break}return s<o?-1:o<s?1:0};function Cm(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,rd(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=fe.from(t,n)),fe.isBuffer(t))return t.length===0?-1:Em(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Em(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Em(e,t,r,n,i){let a=1,s=e.length,o=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,s/=2,o/=2,r/=2}function l(d,E){return a===1?d[E]:d.readUInt16BE(E*a)}let h;if(i){let d=-1;for(h=r;h<s;h++)if(l(e,h)===l(t,d===-1?0:h-d)){if(d===-1&&(d=h),h-d+1===o)return d*a}else d!==-1&&(h-=h-d),d=-1}else for(r+o>s&&(r=s-o),h=r;h>=0;h--){let d=!0;for(let E=0;E<o;E++)if(l(e,h+E)!==l(t,E)){d=!1;break}if(d)return h}return-1}fe.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};fe.prototype.indexOf=function(t,r,n){return Cm(this,t,r,n,!0)};fe.prototype.lastIndexOf=function(t,r,n){return Cm(this,t,r,n,!1)};function Cb(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let a=t.length;n>a/2&&(n=a/2);let s;for(s=0;s<n;++s){let o=parseInt(t.substr(s*2,2),16);if(rd(o))return s;e[r+s]=o}return s}function Fb(e,t,r,n){return sf(Zp(t,e.length-r),e,r,n)}function _b(e,t,r,n){return sf(Lb(t),e,r,n)}function Ib(e,t,r,n){return sf(Rm(t),e,r,n)}function Db(e,t,r,n){return sf(Ub(t,e.length-r),e,r,n)}fe.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return Cb(this,t,r,n);case"utf8":case"utf-8":return Fb(this,t,r,n);case"ascii":case"latin1":case"binary":return _b(this,t,r,n);case"base64":return Ib(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Db(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Bb(e,t,r){return t===0&&r===e.length?Wp.fromByteArray(e):Wp.fromByteArray(e.slice(t,r))}function Fm(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let a=e[i],s=null,o=a>239?4:a>223?3:a>191?2:1;if(i+o<=r){let l,h,d,E;switch(o){case 1:a<128&&(s=a);break;case 2:l=e[i+1],(l&192)===128&&(E=(a&31)<<6|l&63,E>127&&(s=E));break;case 3:l=e[i+1],h=e[i+2],(l&192)===128&&(h&192)===128&&(E=(a&15)<<12|(l&63)<<6|h&63,E>2047&&(E<55296||E>57343)&&(s=E));break;case 4:l=e[i+1],h=e[i+2],d=e[i+3],(l&192)===128&&(h&192)===128&&(d&192)===128&&(E=(a&15)<<18|(l&63)<<12|(h&63)<<6|d&63,E>65535&&E<1114112&&(s=E))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=o}return $b(n)}var Am=4096;function $b(e){let t=e.length;if(t<=Am)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Am));return r}function Pb(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function Rb(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function Tb(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=t;a<r;++a)i+=Hb[e[a]];return i}function xb(e,t,r){let n=e.slice(t,r),i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}fe.prototype.slice=function(t,r){let n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);let i=this.subarray(t,r);return Object.setPrototypeOf(i,fe.prototype),i};function gr(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}fe.prototype.readUintLE=fe.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||gr(t,r,this.length);let i=this[t],a=1,s=0;for(;++s<r&&(a*=256);)i+=this[t+s]*a;return i};fe.prototype.readUintBE=fe.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||gr(t,r,this.length);let i=this[t+--r],a=1;for(;r>0&&(a*=256);)i+=this[t+--r]*a;return i};fe.prototype.readUint8=fe.prototype.readUInt8=function(t,r){return t=t>>>0,r||gr(t,1,this.length),this[t]};fe.prototype.readUint16LE=fe.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||gr(t,2,this.length),this[t]|this[t+1]<<8};fe.prototype.readUint16BE=fe.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||gr(t,2,this.length),this[t]<<8|this[t+1]};fe.prototype.readUint32LE=fe.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||gr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};fe.prototype.readUint32BE=fe.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||gr(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};fe.prototype.readBigUInt64LE=Js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Ac(t,this.length-8);let i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(a)<<BigInt(32))});fe.prototype.readBigUInt64BE=Js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Ac(t,this.length-8);let i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(a)});fe.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||gr(t,r,this.length);let i=this[t],a=1,s=0;for(;++s<r&&(a*=256);)i+=this[t+s]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};fe.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||gr(t,r,this.length);let i=r,a=1,s=this[t+--i];for(;i>0&&(a*=256);)s+=this[t+--i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s};fe.prototype.readInt8=function(t,r){return t=t>>>0,r||gr(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};fe.prototype.readInt16LE=function(t,r){t=t>>>0,r||gr(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt16BE=function(t,r){t=t>>>0,r||gr(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt32LE=function(t,r){return t=t>>>0,r||gr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};fe.prototype.readInt32BE=function(t,r){return t=t>>>0,r||gr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};fe.prototype.readBigInt64LE=Js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Ac(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});fe.prototype.readBigInt64BE=Js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Ac(t,this.length-8);let i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});fe.prototype.readFloatLE=function(t,r){return t=t>>>0,r||gr(t,4,this.length),Gu.read(this,t,!0,23,4)};fe.prototype.readFloatBE=function(t,r){return t=t>>>0,r||gr(t,4,this.length),Gu.read(this,t,!1,23,4)};fe.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||gr(t,8,this.length),Gu.read(this,t,!0,52,8)};fe.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||gr(t,8,this.length),Gu.read(this,t,!1,52,8)};function fn(e,t,r,n,i,a){if(!fe.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}fe.prototype.writeUintLE=fe.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let o=Math.pow(2,8*n)-1;fn(this,t,r,n,o,0)}let a=1,s=0;for(this[r]=t&255;++s<n&&(a*=256);)this[r+s]=t/a&255;return r+n};fe.prototype.writeUintBE=fe.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let o=Math.pow(2,8*n)-1;fn(this,t,r,n,o,0)}let a=n-1,s=1;for(this[r+a]=t&255;--a>=0&&(s*=256);)this[r+a]=t/s&255;return r+n};fe.prototype.writeUint8=fe.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,1,255,0),this[r]=t&255,r+1};fe.prototype.writeUint16LE=fe.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};fe.prototype.writeUint16BE=fe.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};fe.prototype.writeUint32LE=fe.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};fe.prototype.writeUint32BE=fe.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function _m(e,t,r,n,i){Pm(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function Im(e,t,r,n,i){Pm(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}fe.prototype.writeBigUInt64LE=Js(function(t,r=0){return _m(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeBigUInt64BE=Js(function(t,r=0){return Im(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fn(this,t,r,n,l-1,-l)}let a=0,s=1,o=0;for(this[r]=t&255;++a<n&&(s*=256);)t<0&&o===0&&this[r+a-1]!==0&&(o=1),this[r+a]=(t/s>>0)-o&255;return r+n};fe.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fn(this,t,r,n,l-1,-l)}let a=n-1,s=1,o=0;for(this[r+a]=t&255;--a>=0&&(s*=256);)t<0&&o===0&&this[r+a+1]!==0&&(o=1),this[r+a]=(t/s>>0)-o&255;return r+n};fe.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};fe.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};fe.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};fe.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};fe.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||fn(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};fe.prototype.writeBigInt64LE=Js(function(t,r=0){return _m(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});fe.prototype.writeBigInt64BE=Js(function(t,r=0){return Im(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Dm(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Bm(e,t,r,n,i){return t=+t,r=r>>>0,i||Dm(e,t,r,4,34028234663852886e22,-34028234663852886e22),Gu.write(e,t,r,n,23,4),r+4}fe.prototype.writeFloatLE=function(t,r,n){return Bm(this,t,r,!0,n)};fe.prototype.writeFloatBE=function(t,r,n){return Bm(this,t,r,!1,n)};function $m(e,t,r,n,i){return t=+t,r=r>>>0,i||Dm(e,t,r,8,17976931348623157e292,-17976931348623157e292),Gu.write(e,t,r,n,52,8),r+8}fe.prototype.writeDoubleLE=function(t,r,n){return $m(this,t,r,!0,n)};fe.prototype.writeDoubleBE=function(t,r,n){return $m(this,t,r,!1,n)};fe.prototype.copy=function(t,r,n,i){if(!fe.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);let a=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),a};fe.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!fe.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let s=t.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{let s=fe.isBuffer(t)?t:fe.from(t,i),o=s.length;if(o===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=s[a%o]}return this};var Ku={};function td(e,t,r){Ku[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}td("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);td("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);td("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=wm(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=wm(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function wm(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ob(e,t,r){zu(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Ac(t,e.length-(r+1))}function Pm(e,t,r,n,i,a){if(e>r||e<t){let s=typeof t=="bigint"?"n":"",o;throw a>3?t===0||t===BigInt(0)?o=`>= 0${s} and < 2${s} ** ${(a+1)*8}${s}`:o=`>= -(2${s} ** ${(a+1)*8-1}${s}) and < 2 ** ${(a+1)*8-1}${s}`:o=`>= ${t}${s} and <= ${r}${s}`,new Ku.ERR_OUT_OF_RANGE("value",o,e)}Ob(n,i,a)}function zu(e,t){if(typeof e!="number")throw new Ku.ERR_INVALID_ARG_TYPE(t,"number",e)}function Ac(e,t,r){throw Math.floor(e)!==e?(zu(e,r),new Ku.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Ku.ERR_BUFFER_OUT_OF_BOUNDS:new Ku.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Nb=/[^+/0-9A-Za-z-_]/g;function kb(e){if(e=e.split("=")[0],e=e.trim().replace(Nb,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Zp(e,t){t=t||1/0;let r,n=e.length,i=null,a=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Lb(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ub(e,t){let r,n,i,a=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function Rm(e){return Wp.toByteArray(kb(e))}function sf(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function _i(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function rd(e){return e!==e}var Hb=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Js(e){return typeof BigInt>"u"?jb:e}function jb(){throw new Error("BigInt not supported")}});var rv=we(Se=>{var wc={};wc.userAgent=!1;var Wu={},Mb="11.1.0",qb="jsrsasign(all) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license";var Ce=Ce||function(e,t){var r={},n=r.lib={},i=n.Base=function(){function f(){}return{extend:function(w){f.prototype=this;var g=new f;return w&&g.mixIn(w),g.hasOwnProperty("init")||(g.init=function(){g.$super.init.apply(this,arguments)}),g.init.prototype=g,g.$super=this,g},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var g in w)w.hasOwnProperty(g)&&(this[g]=w[g]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=n.WordArray=i.extend({init:function(f,w){f=this.words=f||[],w!=t?this.sigBytes=w:this.sigBytes=f.length*4},toString:function(f){return(f||o).stringify(this)},concat:function(f){var w=this.words,g=f.words,y=this.sigBytes,A=f.sigBytes;if(this.clamp(),y%4)for(var S=0;S<A;S++){var _=g[S>>>2]>>>24-S%4*8&255;w[y+S>>>2]|=_<<24-(y+S)%4*8}else for(var S=0;S<A;S+=4)w[y+S>>>2]=g[S>>>2];return this.sigBytes+=A,this},clamp:function(){var f=this.words,w=this.sigBytes;f[w>>>2]&=4294967295<<32-w%4*8,f.length=e.ceil(w/4)},clone:function(){var f=i.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var w=[],g=0;g<f;g+=4)w.push(e.random()*4294967296|0);return new a.init(w,f)}}),s=r.enc={},o=s.Hex={stringify:function(f){for(var w=f.words,g=f.sigBytes,y=[],A=0;A<g;A++){var S=w[A>>>2]>>>24-A%4*8&255;y.push((S>>>4).toString(16)),y.push((S&15).toString(16))}return y.join("")},parse:function(f){for(var w=f.length,g=[],y=0;y<w;y+=2)g[y>>>3]|=parseInt(f.substr(y,2),16)<<24-y%8*4;return new a.init(g,w/2)}},l=s.Latin1={stringify:function(f){for(var w=f.words,g=f.sigBytes,y=[],A=0;A<g;A++){var S=w[A>>>2]>>>24-A%4*8&255;y.push(String.fromCharCode(S))}return y.join("")},parse:function(f){for(var w=f.length,g=[],y=0;y<w;y++)g[y>>>2]|=(f.charCodeAt(y)&255)<<24-y%4*8;return new a.init(g,w)}},h=s.Utf8={stringify:function(f){try{return decodeURIComponent(escape(l.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return l.parse(unescape(encodeURIComponent(f)))}},d=n.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=h.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var w=this._data,g=w.words,y=w.sigBytes,A=this.blockSize,S=A*4,_=y/S;f?_=e.ceil(_):_=e.max((_|0)-this._minBufferSize,0);var I=_*A,D=e.min(I*4,y);if(I){for(var H=0;H<I;H+=A)this._doProcessBlock(g,H);var V=g.splice(0,I);w.sigBytes-=D}return new a.init(V,D)},clone:function(){var f=i.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0}),E=n.Hasher=d.extend({cfg:i.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){f&&this._append(f);var w=this._doFinalize();return w},blockSize:512/32,_createHelper:function(f){return function(w,g){return new f.init(g).finalize(w)}},_createHmacHelper:function(f){return function(w,g){return new p.HMAC.init(f,g).finalize(w)}}}),p=r.algo={};return r}(Math);(function(e){var i=Ce,t=i.lib,r=t.Base,n=t.WordArray,i=i.x64={};i.Word=r.extend({init:function(a,s){this.high=a,this.low=s}}),i.WordArray=r.extend({init:function(a,s){a=this.words=a||[],this.sigBytes=s!=e?s:8*a.length},toX32:function(){for(var a=this.words,s=a.length,o=[],l=0;l<s;l++){var h=a[l];o.push(h.high),o.push(h.low)}return n.create(o,this.sigBytes)},clone:function(){for(var a=r.clone.call(this),s=a.words=this.words.slice(0),o=s.length,l=0;l<o;l++)s[l]=s[l].clone();return a}})})();Ce.lib.Cipher||function(e){var f=Ce,t=f.lib,r=t.Base,n=t.WordArray,i=t.BufferedBlockAlgorithm,a=f.enc.Base64,s=f.algo.EvpKDF,o=t.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(g,y){return this.create(this._ENC_XFORM_MODE,g,y)},createDecryptor:function(g,y){return this.create(this._DEC_XFORM_MODE,g,y)},init:function(g,y,A){this.cfg=this.cfg.extend(A),this._xformMode=g,this._key=y,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(g){return this._append(g),this._process()},finalize:function(g){return g&&this._append(g),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(g){return{encrypt:function(y,A,S){return(typeof A=="string"?w:p).encrypt(g,y,A,S)},decrypt:function(y,A,S){return(typeof A=="string"?w:p).decrypt(g,y,A,S)}}}});t.StreamCipher=o.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var E=f.mode={},l=function(g,y,A){var S=this._iv;S?this._iv=e:S=this._prevBlock;for(var _=0;_<A;_++)g[y+_]^=S[_]},h=(t.BlockCipherMode=r.extend({createEncryptor:function(g,y){return this.Encryptor.create(g,y)},createDecryptor:function(g,y){return this.Decryptor.create(g,y)},init:function(g,y){this._cipher=g,this._iv=y}})).extend();h.Encryptor=h.extend({processBlock:function(g,y){var A=this._cipher,S=A.blockSize;l.call(this,g,y,S),A.encryptBlock(g,y),this._prevBlock=g.slice(y,y+S)}}),h.Decryptor=h.extend({processBlock:function(g,y){var A=this._cipher,S=A.blockSize,_=g.slice(y,y+S);A.decryptBlock(g,y),l.call(this,g,y,S),this._prevBlock=_}}),E=E.CBC=h,h=(f.pad={}).Pkcs7={pad:function(g,y){for(var A=4*y,A=A-g.sigBytes%A,S=A<<24|A<<16|A<<8|A,_=[],I=0;I<A;I+=4)_.push(S);A=n.create(_,A),g.concat(A)},unpad:function(g){g.sigBytes-=g.words[g.sigBytes-1>>>2]&255}},t.BlockCipher=o.extend({cfg:o.cfg.extend({mode:E,padding:h}),reset:function(){o.reset.call(this);var y=this.cfg,g=y.iv,y=y.mode;if(this._xformMode==this._ENC_XFORM_MODE)var A=y.createEncryptor;else A=y.createDecryptor,this._minBufferSize=1;this._mode=A.call(y,this,g&&g.words)},_doProcessBlock:function(g,y){this._mode.processBlock(g,y)},_doFinalize:function(){var g=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){g.pad(this._data,this.blockSize);var y=this._process(!0)}else y=this._process(!0),g.unpad(y);return y},blockSize:4});var d=t.CipherParams=r.extend({init:function(g){this.mixIn(g)},toString:function(g){return(g||this.formatter).stringify(this)}}),E=(f.format={}).OpenSSL={stringify:function(g){var y=g.ciphertext;return g=g.salt,(g?n.create([1398893684,1701076831]).concat(g).concat(y):y).toString(a)},parse:function(g){g=a.parse(g);var y=g.words;if(y[0]==1398893684&&y[1]==1701076831){var A=n.create(y.slice(2,4));y.splice(0,4),g.sigBytes-=16}return d.create({ciphertext:g,salt:A})}},p=t.SerializableCipher=r.extend({cfg:r.extend({format:E}),encrypt:function(g,y,A,S){S=this.cfg.extend(S);var _=g.createEncryptor(A,S);return y=_.finalize(y),_=_.cfg,d.create({ciphertext:y,key:A,iv:_.iv,algorithm:g,mode:_.mode,padding:_.padding,blockSize:g.blockSize,formatter:S.format})},decrypt:function(g,y,A,S){return S=this.cfg.extend(S),y=this._parse(y,S.format),g.createDecryptor(A,S).finalize(y.ciphertext)},_parse:function(g,y){return typeof g=="string"?y.parse(g,this):g}}),f=(f.kdf={}).OpenSSL={execute:function(g,y,A,S){return S||(S=n.random(8)),g=s.create({keySize:y+A}).compute(g,S),A=n.create(g.words.slice(y),4*A),g.sigBytes=4*y,d.create({key:g,iv:A,salt:S})}},w=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:f}),encrypt:function(g,y,A,S){return S=this.cfg.extend(S),A=S.kdf.execute(A,g.keySize,g.ivSize),S.iv=A.iv,g=p.encrypt.call(this,g,y,A.key,S),g.mixIn(A),g},decrypt:function(g,y,A,S){return S=this.cfg.extend(S),y=this._parse(y,S.format),A=S.kdf.execute(A,g.keySize,g.ivSize,y.salt),S.iv=A.iv,p.decrypt.call(this,g,y,A.key,S)}})}();(function(){for(var e=Ce,t=e.lib.BlockCipher,H=e.algo,r=[],n=[],i=[],a=[],s=[],o=[],l=[],h=[],d=[],E=[],p=[],f=0;256>f;f++)p[f]=128>f?f<<1:f<<1^283;for(var w=0,g=0,f=0;256>f;f++){var y=g^g<<1^g<<2^g<<3^g<<4,y=y>>>8^y&255^99;r[w]=y,n[y]=w;var A=p[w],S=p[A],_=p[S],I=257*p[y]^16843008*y;i[w]=I<<24|I>>>8,a[w]=I<<16|I>>>16,s[w]=I<<8|I>>>24,o[w]=I,I=16843009*_^65537*S^257*A^16843008*w,l[y]=I<<24|I>>>8,h[y]=I<<16|I>>>16,d[y]=I<<8|I>>>24,E[y]=I,w?(w=A^p[p[p[_^A]]],g^=p[p[g]]):w=g=1}var D=[0,1,2,4,8,16,32,64,128,27,54],H=H.AES=t.extend({_doReset:function(){for(var P=this._key,V=P.words,F=P.sigBytes/4,P=4*((this._nRounds=F+6)+1),k=this._keySchedule=[],L=0;L<P;L++)if(L<F)k[L]=V[L];else{var q=k[L-1];L%F?6<F&&L%F==4&&(q=r[q>>>24]<<24|r[q>>>16&255]<<16|r[q>>>8&255]<<8|r[q&255]):(q=q<<8|q>>>24,q=r[q>>>24]<<24|r[q>>>16&255]<<16|r[q>>>8&255]<<8|r[q&255],q^=D[L/F|0]<<24),k[L]=k[L-F]^q}for(V=this._invKeySchedule=[],F=0;F<P;F++)L=P-F,q=F%4?k[L]:k[L-4],V[F]=4>F||4>=L?q:l[r[q>>>24]]^h[r[q>>>16&255]]^d[r[q>>>8&255]]^E[r[q&255]]},encryptBlock:function(V,F){this._doCryptBlock(V,F,this._keySchedule,i,a,s,o,r)},decryptBlock:function(V,F){var P=V[F+1];V[F+1]=V[F+3],V[F+3]=P,this._doCryptBlock(V,F,this._invKeySchedule,l,h,d,E,n),P=V[F+1],V[F+1]=V[F+3],V[F+3]=P},_doCryptBlock:function(V,F,P,k,L,q,J,z){for(var K=this._nRounds,ce=V[F]^P[0],_e=V[F+1]^P[1],Le=V[F+2]^P[2],qe=V[F+3]^P[3],X=4,ie=1;ie<K;ie++)var be=k[ce>>>24]^L[_e>>>16&255]^q[Le>>>8&255]^J[qe&255]^P[X++],ye=k[_e>>>24]^L[Le>>>16&255]^q[qe>>>8&255]^J[ce&255]^P[X++],$e=k[Le>>>24]^L[qe>>>16&255]^q[ce>>>8&255]^J[_e&255]^P[X++],qe=k[qe>>>24]^L[ce>>>16&255]^q[_e>>>8&255]^J[Le&255]^P[X++],ce=be,_e=ye,Le=$e;be=(z[ce>>>24]<<24|z[_e>>>16&255]<<16|z[Le>>>8&255]<<8|z[qe&255])^P[X++],ye=(z[_e>>>24]<<24|z[Le>>>16&255]<<16|z[qe>>>8&255]<<8|z[ce&255])^P[X++],$e=(z[Le>>>24]<<24|z[qe>>>16&255]<<16|z[ce>>>8&255]<<8|z[_e&255])^P[X++],qe=(z[qe>>>24]<<24|z[ce>>>16&255]<<16|z[_e>>>8&255]<<8|z[Le&255])^P[X++],V[F]=be,V[F+1]=ye,V[F+2]=$e,V[F+3]=qe},keySize:8});e.AES=t._createHelper(H)})();(function(){function e(p,f){var w=(this._lBlock>>>p^this._rBlock)&f;this._rBlock^=w,this._lBlock^=w<<p}function t(p,f){var w=(this._rBlock>>>p^this._lBlock)&f;this._lBlock^=w,this._rBlock^=w<<p}var r=Ce,i=r.lib,n=i.WordArray,i=i.BlockCipher,a=r.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],E=a.DES=i.extend({_doReset:function(){for(var p=this._key.words,f=[],w=0;56>w;w++){var g=s[w]-1;f[w]=p[g>>>5]>>>31-g%32&1}for(p=this._subKeys=[],g=0;16>g;g++){for(var y=p[g]=[],A=l[g],w=0;24>w;w++)y[w/6|0]|=f[(o[w]-1+A)%28]<<31-w%6,y[4+(w/6|0)]|=f[28+(o[w+24]-1+A)%28]<<31-w%6;for(y[0]=y[0]<<1|y[0]>>>31,w=1;7>w;w++)y[w]>>>=4*(w-1)+3;y[7]=y[7]<<5|y[7]>>>27}for(f=this._invSubKeys=[],w=0;16>w;w++)f[w]=p[15-w]},encryptBlock:function(p,f){this._doCryptBlock(p,f,this._subKeys)},decryptBlock:function(p,f){this._doCryptBlock(p,f,this._invSubKeys)},_doCryptBlock:function(p,f,w){this._lBlock=p[f],this._rBlock=p[f+1],e.call(this,4,252645135),e.call(this,16,65535),t.call(this,2,858993459),t.call(this,8,16711935),e.call(this,1,1431655765);for(var g=0;16>g;g++){for(var y=w[g],A=this._lBlock,S=this._rBlock,_=0,I=0;8>I;I++)_|=h[I][((S^y[I])&d[I])>>>0];this._lBlock=S,this._rBlock=A^_}w=this._lBlock,this._lBlock=this._rBlock,this._rBlock=w,e.call(this,1,1431655765),t.call(this,8,16711935),t.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),p[f]=this._lBlock,p[f+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=i._createHelper(E),a=a.TripleDES=i.extend({_doReset:function(){var p=this._key.words;this._des1=E.createEncryptor(n.create(p.slice(0,2))),this._des2=E.createEncryptor(n.create(p.slice(2,4))),this._des3=E.createEncryptor(n.create(p.slice(4,6)))},encryptBlock:function(p,f){this._des1.encryptBlock(p,f),this._des2.decryptBlock(p,f),this._des3.encryptBlock(p,f)},decryptBlock:function(p,f){this._des3.decryptBlock(p,f),this._des2.encryptBlock(p,f),this._des1.decryptBlock(p,f)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=i._createHelper(a)})();(function(){var e=Ce,t=e.lib.WordArray;e.enc.Base64={stringify:function(r){var n=r.words,i=r.sigBytes,a=this._map;r.clamp(),r=[];for(var s=0;s<i;s+=3)for(var o=(n[s>>>2]>>>24-8*(s%4)&255)<<16|(n[s+1>>>2]>>>24-8*((s+1)%4)&255)<<8|n[s+2>>>2]>>>24-8*((s+2)%4)&255,l=0;4>l&&s+.75*l<i;l++)r.push(a.charAt(o>>>6*(3-l)&63));if(n=a.charAt(64))for(;r.length%4;)r.push(n);return r.join("")},parse:function(r){var n=r.length,i=this._map,a=i.charAt(64);a&&(a=r.indexOf(a),a!=-1&&(n=a));for(var a=[],s=0,o=0;o<n;o++)if(o%4){var l=i.indexOf(r.charAt(o-1))<<2*(o%4),h=i.indexOf(r.charAt(o))>>>6-2*(o%4);a[s>>>2]|=(l|h)<<24-8*(s%4),s++}return t.create(a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();(function(e){function t(E,p,f,w,g,y,A){return E=E+(p&f|~p&w)+g+A,(E<<y|E>>>32-y)+p}function r(E,p,f,w,g,y,A){return E=E+(p&w|f&~w)+g+A,(E<<y|E>>>32-y)+p}function n(E,p,f,w,g,y,A){return E=E+(p^f^w)+g+A,(E<<y|E>>>32-y)+p}function i(E,p,f,w,g,y,A){return E=E+(f^(p|~w))+g+A,(E<<y|E>>>32-y)+p}for(var a=Ce,l=a.lib,s=l.WordArray,o=l.Hasher,l=a.algo,h=[],d=0;64>d;d++)h[d]=4294967296*e.abs(e.sin(d+1))|0;l=l.MD5=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,p){for(var f=0;16>f;f++){var w=p+f,g=E[w];E[w]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}var f=this._hash.words,w=E[p+0],g=E[p+1],y=E[p+2],A=E[p+3],S=E[p+4],_=E[p+5],I=E[p+6],D=E[p+7],H=E[p+8],V=E[p+9],F=E[p+10],P=E[p+11],k=E[p+12],L=E[p+13],q=E[p+14],J=E[p+15],z=f[0],ie=f[1],X=f[2],K=f[3],z=t(z,ie,X,K,w,7,h[0]),K=t(K,z,ie,X,g,12,h[1]),X=t(X,K,z,ie,y,17,h[2]),ie=t(ie,X,K,z,A,22,h[3]),z=t(z,ie,X,K,S,7,h[4]),K=t(K,z,ie,X,_,12,h[5]),X=t(X,K,z,ie,I,17,h[6]),ie=t(ie,X,K,z,D,22,h[7]),z=t(z,ie,X,K,H,7,h[8]),K=t(K,z,ie,X,V,12,h[9]),X=t(X,K,z,ie,F,17,h[10]),ie=t(ie,X,K,z,P,22,h[11]),z=t(z,ie,X,K,k,7,h[12]),K=t(K,z,ie,X,L,12,h[13]),X=t(X,K,z,ie,q,17,h[14]),ie=t(ie,X,K,z,J,22,h[15]),z=r(z,ie,X,K,g,5,h[16]),K=r(K,z,ie,X,I,9,h[17]),X=r(X,K,z,ie,P,14,h[18]),ie=r(ie,X,K,z,w,20,h[19]),z=r(z,ie,X,K,_,5,h[20]),K=r(K,z,ie,X,F,9,h[21]),X=r(X,K,z,ie,J,14,h[22]),ie=r(ie,X,K,z,S,20,h[23]),z=r(z,ie,X,K,V,5,h[24]),K=r(K,z,ie,X,q,9,h[25]),X=r(X,K,z,ie,A,14,h[26]),ie=r(ie,X,K,z,H,20,h[27]),z=r(z,ie,X,K,L,5,h[28]),K=r(K,z,ie,X,y,9,h[29]),X=r(X,K,z,ie,D,14,h[30]),ie=r(ie,X,K,z,k,20,h[31]),z=n(z,ie,X,K,_,4,h[32]),K=n(K,z,ie,X,H,11,h[33]),X=n(X,K,z,ie,P,16,h[34]),ie=n(ie,X,K,z,q,23,h[35]),z=n(z,ie,X,K,g,4,h[36]),K=n(K,z,ie,X,S,11,h[37]),X=n(X,K,z,ie,D,16,h[38]),ie=n(ie,X,K,z,F,23,h[39]),z=n(z,ie,X,K,L,4,h[40]),K=n(K,z,ie,X,w,11,h[41]),X=n(X,K,z,ie,A,16,h[42]),ie=n(ie,X,K,z,I,23,h[43]),z=n(z,ie,X,K,V,4,h[44]),K=n(K,z,ie,X,k,11,h[45]),X=n(X,K,z,ie,J,16,h[46]),ie=n(ie,X,K,z,y,23,h[47]),z=i(z,ie,X,K,w,6,h[48]),K=i(K,z,ie,X,D,10,h[49]),X=i(X,K,z,ie,q,15,h[50]),ie=i(ie,X,K,z,_,21,h[51]),z=i(z,ie,X,K,k,6,h[52]),K=i(K,z,ie,X,A,10,h[53]),X=i(X,K,z,ie,F,15,h[54]),ie=i(ie,X,K,z,g,21,h[55]),z=i(z,ie,X,K,H,6,h[56]),K=i(K,z,ie,X,J,10,h[57]),X=i(X,K,z,ie,I,15,h[58]),ie=i(ie,X,K,z,L,21,h[59]),z=i(z,ie,X,K,S,6,h[60]),K=i(K,z,ie,X,P,10,h[61]),X=i(X,K,z,ie,y,15,h[62]),ie=i(ie,X,K,z,V,21,h[63]);f[0]=f[0]+z|0,f[1]=f[1]+ie|0,f[2]=f[2]+X|0,f[3]=f[3]+K|0},_doFinalize:function(){var E=this._data,p=E.words,f=8*this._nDataBytes,w=8*E.sigBytes;p[w>>>5]|=128<<24-w%32;var g=e.floor(f/4294967296);for(p[(w+64>>>9<<4)+15]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,p[(w+64>>>9<<4)+14]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,E.sigBytes=4*(p.length+1),this._process(),E=this._hash,p=E.words,f=0;4>f;f++)w=p[f],p[f]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;return E},clone:function(){var E=o.clone.call(this);return E._hash=this._hash.clone(),E}}),a.MD5=o._createHelper(l),a.HmacMD5=o._createHmacHelper(l)})(Math);(function(){var e=Ce,i=e.lib,t=i.WordArray,r=i.Hasher,n=[],i=e.algo.SHA1=r.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,s){for(var o=this._hash.words,l=o[0],h=o[1],d=o[2],E=o[3],p=o[4],f=0;80>f;f++){if(16>f)n[f]=a[s+f]|0;else{var w=n[f-3]^n[f-8]^n[f-14]^n[f-16];n[f]=w<<1|w>>>31}w=(l<<5|l>>>27)+p+n[f],w=20>f?w+((h&d|~h&E)+1518500249):40>f?w+((h^d^E)+1859775393):60>f?w+((h&d|h&E|d&E)-1894007588):w+((h^d^E)-899497514),p=E,E=d,d=h<<30|h>>>2,h=l,l=w}o[0]=o[0]+l|0,o[1]=o[1]+h|0,o[2]=o[2]+d|0,o[3]=o[3]+E|0,o[4]=o[4]+p|0},_doFinalize:function(){var a=this._data,s=a.words,o=8*this._nDataBytes,l=8*a.sigBytes;return s[l>>>5]|=128<<24-l%32,s[(l+64>>>9<<4)+14]=Math.floor(o/4294967296),s[(l+64>>>9<<4)+15]=o,a.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var a=r.clone.call(this);return a._hash=this._hash.clone(),a}});e.SHA1=r._createHelper(i),e.HmacSHA1=r._createHmacHelper(i)})();(function(e){for(var t=Ce,f=t.lib,r=f.WordArray,n=f.Hasher,f=t.algo,i=[],a=[],s=function(g){return 4294967296*(g-(g|0))|0},o=2,l=0;64>l;){var h;e:{h=o;for(var d=e.sqrt(h),E=2;E<=d;E++)if(!(h%E)){h=!1;break e}h=!0}h&&(8>l&&(i[l]=s(e.pow(o,.5))),a[l]=s(e.pow(o,1/3)),l++),o++}var p=[],f=f.SHA256=n.extend({_doReset:function(){this._hash=new r.init(i.slice(0))},_doProcessBlock:function(w,g){for(var y=this._hash.words,A=y[0],S=y[1],_=y[2],I=y[3],D=y[4],H=y[5],V=y[6],F=y[7],P=0;64>P;P++){if(16>P)p[P]=w[g+P]|0;else{var k=p[P-15],L=p[P-2];p[P]=((k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3)+p[P-7]+((L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10)+p[P-16]}k=F+((D<<26|D>>>6)^(D<<21|D>>>11)^(D<<7|D>>>25))+(D&H^~D&V)+a[P]+p[P],L=((A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22))+(A&S^A&_^S&_),F=V,V=H,H=D,D=I+k|0,I=_,_=S,S=A,A=k+L|0}y[0]=y[0]+A|0,y[1]=y[1]+S|0,y[2]=y[2]+_|0,y[3]=y[3]+I|0,y[4]=y[4]+D|0,y[5]=y[5]+H|0,y[6]=y[6]+V|0,y[7]=y[7]+F|0},_doFinalize:function(){var w=this._data,g=w.words,y=8*this._nDataBytes,A=8*w.sigBytes;return g[A>>>5]|=128<<24-A%32,g[(A+64>>>9<<4)+14]=e.floor(y/4294967296),g[(A+64>>>9<<4)+15]=y,w.sigBytes=4*g.length,this._process(),this._hash},clone:function(){var w=n.clone.call(this);return w._hash=this._hash.clone(),w}});t.SHA256=n._createHelper(f),t.HmacSHA256=n._createHmacHelper(f)})(Math);(function(){var e=Ce,t=e.lib.WordArray,n=e.algo,r=n.SHA256,n=n.SHA224=r.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var i=r._doFinalize.call(this);return i.sigBytes-=4,i}});e.SHA224=r._createHelper(n),e.HmacSHA224=r._createHmacHelper(n)})();(function(){function e(){return n.create.apply(n,arguments)}for(var t=Ce,r=t.lib.Hasher,a=t.x64,n=a.Word,i=a.WordArray,a=t.algo,s=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],o=[],l=0;80>l;l++)o[l]=e();a=a.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(h,d){for(var S=this._hash.words,E=S[0],p=S[1],f=S[2],w=S[3],g=S[4],y=S[5],A=S[6],S=S[7],_=E.high,I=E.low,D=p.high,H=p.low,V=f.high,F=f.low,P=w.high,k=w.low,L=g.high,q=g.low,J=y.high,z=y.low,K=A.high,X=A.low,ie=S.high,be=S.low,ye=_,$e=I,qe=D,ce=H,_e=V,Le=F,lr=P,Bt=k,pt=L,zt=q,Tt=J,nt=z,It=K,tt=X,gt=ie,Yt=be,Je=0;80>Je;Je++){var Pr=o[Je];if(16>Je)var Ut=Pr.high=h[d+2*Je]|0,Ze=Pr.low=h[d+2*Je+1]|0;else{var Ut=o[Je-15],Ze=Ut.high,Zt=Ut.low,Ut=(Ze>>>1|Zt<<31)^(Ze>>>8|Zt<<24)^Ze>>>7,Zt=(Zt>>>1|Ze<<31)^(Zt>>>8|Ze<<24)^(Zt>>>7|Ze<<25),$r=o[Je-2],Ze=$r.high,mt=$r.low,$r=(Ze>>>19|mt<<13)^(Ze<<3|mt>>>29)^Ze>>>6,mt=(mt>>>19|Ze<<13)^(mt<<3|Ze>>>29)^(mt>>>6|Ze<<26),Ze=o[Je-7],Un=Ze.high,fr=o[Je-16],Qt=fr.high,fr=fr.low,Ze=Zt+Ze.low,Ut=Ut+Un+(Ze>>>0<Zt>>>0?1:0),Ze=Ze+mt,Ut=Ut+$r+(Ze>>>0<mt>>>0?1:0),Ze=Ze+fr,Ut=Ut+Qt+(Ze>>>0<fr>>>0?1:0);Pr.high=Ut,Pr.low=Ze}var Un=pt&Tt^~pt&It,fr=zt&nt^~zt&tt,Pr=ye&qe^ye&_e^qe&_e,wr=$e&ce^$e&Le^ce&Le,Zt=(ye>>>28|$e<<4)^(ye<<30|$e>>>2)^(ye<<25|$e>>>7),$r=($e>>>28|ye<<4)^($e<<30|ye>>>2)^($e<<25|ye>>>7),mt=s[Je],la=mt.high,Mr=mt.low,mt=Yt+((zt>>>14|pt<<18)^(zt>>>18|pt<<14)^(zt<<23|pt>>>9)),Qt=gt+((pt>>>14|zt<<18)^(pt>>>18|zt<<14)^(pt<<23|zt>>>9))+(mt>>>0<Yt>>>0?1:0),mt=mt+fr,Qt=Qt+Un+(mt>>>0<fr>>>0?1:0),mt=mt+Mr,Qt=Qt+la+(mt>>>0<Mr>>>0?1:0),mt=mt+Ze,Qt=Qt+Ut+(mt>>>0<Ze>>>0?1:0),Ze=$r+wr,Pr=Zt+Pr+(Ze>>>0<$r>>>0?1:0),gt=It,Yt=tt,It=Tt,tt=nt,Tt=pt,nt=zt,zt=Bt+mt|0,pt=lr+Qt+(zt>>>0<Bt>>>0?1:0)|0,lr=_e,Bt=Le,_e=qe,Le=ce,qe=ye,ce=$e,$e=mt+Ze|0,ye=Qt+Pr+($e>>>0<mt>>>0?1:0)|0}I=E.low=I+$e,E.high=_+ye+(I>>>0<$e>>>0?1:0),H=p.low=H+ce,p.high=D+qe+(H>>>0<ce>>>0?1:0),F=f.low=F+Le,f.high=V+_e+(F>>>0<Le>>>0?1:0),k=w.low=k+Bt,w.high=P+lr+(k>>>0<Bt>>>0?1:0),q=g.low=q+zt,g.high=L+pt+(q>>>0<zt>>>0?1:0),z=y.low=z+nt,y.high=J+Tt+(z>>>0<nt>>>0?1:0),X=A.low=X+tt,A.high=K+It+(X>>>0<tt>>>0?1:0),be=S.low=be+Yt,S.high=ie+gt+(be>>>0<Yt>>>0?1:0)},_doFinalize:function(){var h=this._data,d=h.words,E=8*this._nDataBytes,p=8*h.sigBytes;return d[p>>>5]|=128<<24-p%32,d[(p+128>>>10<<5)+30]=Math.floor(E/4294967296),d[(p+128>>>10<<5)+31]=E,h.sigBytes=4*d.length,this._process(),this._hash.toX32()},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h},blockSize:32}),t.SHA512=r._createHelper(a),t.HmacSHA512=r._createHmacHelper(a)})();(function(){var e=Ce,i=e.x64,t=i.Word,r=i.WordArray,i=e.algo,n=i.SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var a=n._doFinalize.call(this);return a.sigBytes-=16,a}});e.SHA384=n._createHelper(i),e.HmacSHA384=n._createHmacHelper(i)})();(function(){var e=Ce,h=e.lib,t=h.WordArray,r=h.Hasher,h=e.algo,n=t.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),i=t.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=t.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),s=t.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),o=t.create([0,1518500249,1859775393,2400959708,2840853838]),l=t.create([1352829926,1548603684,1836072691,2053994217,0]),h=h.RIPEMD160=r.extend({_doReset:function(){this._hash=t.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,E){for(var p=0;16>p;p++){var f=E+p,w=d[f];d[f]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var f=this._hash.words,w=o.words,g=l.words,y=n.words,A=i.words,S=a.words,_=s.words,I,D,H,V,F,P,k,L,q,J;P=I=f[0],k=D=f[1],L=H=f[2],q=V=f[3],J=F=f[4];for(var z,p=0;80>p;p+=1)z=I+d[E+y[p]]|0,z=16>p?z+((D^H^V)+w[0]):32>p?z+((D&H|~D&V)+w[1]):48>p?z+(((D|~H)^V)+w[2]):64>p?z+((D&V|H&~V)+w[3]):z+((D^(H|~V))+w[4]),z|=0,z=z<<S[p]|z>>>32-S[p],z=z+F|0,I=F,F=V,V=H<<10|H>>>22,H=D,D=z,z=P+d[E+A[p]]|0,z=16>p?z+((k^(L|~q))+g[0]):32>p?z+((k&q|L&~q)+g[1]):48>p?z+(((k|~L)^q)+g[2]):64>p?z+((k&L|~k&q)+g[3]):z+((k^L^q)+g[4]),z|=0,z=z<<_[p]|z>>>32-_[p],z=z+J|0,P=J,J=q,q=L<<10|L>>>22,L=k,k=z;z=f[1]+H+q|0,f[1]=f[2]+V+J|0,f[2]=f[3]+F+P|0,f[3]=f[4]+I+k|0,f[4]=f[0]+D+L|0,f[0]=z},_doFinalize:function(){var d=this._data,E=d.words,p=8*this._nDataBytes,f=8*d.sigBytes;for(E[f>>>5]|=128<<24-f%32,E[(f+64>>>9<<4)+14]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,d.sigBytes=4*(E.length+1),this._process(),d=this._hash,E=d.words,p=0;5>p;p++)f=E[p],E[p]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360;return d},clone:function(){var d=r.clone.call(this);return d._hash=this._hash.clone(),d}});e.RIPEMD160=r._createHelper(h),e.HmacRIPEMD160=r._createHmacHelper(h)})(Math);(function(){var e=Ce,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(r,n){r=this._hasher=new r.init,typeof n=="string"&&(n=t.parse(n));var i=r.blockSize,a=4*i;n.sigBytes>a&&(n=r.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),l=s.words,h=o.words,d=0;d<i;d++)l[d]^=1549556828,h[d]^=909522486;s.sigBytes=o.sigBytes=a,this.reset()},reset:function(){var r=this._hasher;r.reset(),r.update(this._iKey)},update:function(r){return this._hasher.update(r),this},finalize:function(r){var n=this._hasher;return r=n.finalize(r),n.reset(),n.finalize(this._oKey.clone().concat(r))}})})();(function(){var e=Ce,n=e.lib,t=n.Base,r=n.WordArray,n=e.algo,i=n.HMAC,a=n.PBKDF2=t.extend({cfg:t.extend({keySize:4,hasher:n.SHA1,iterations:1}),init:function(s){this.cfg=this.cfg.extend(s)},compute:function(s,o){for(var w=this.cfg,l=i.create(w.hasher,s),h=r.create(),d=r.create([1]),E=h.words,p=d.words,f=w.keySize,w=w.iterations;E.length<f;){var g=l.update(o).finalize(d);l.reset();for(var y=g.words,A=y.length,S=g,_=1;_<w;_++){S=l.finalize(S),l.reset();for(var I=S.words,D=0;D<A;D++)y[D]^=I[D]}h.concat(g),p[0]++}return h.sigBytes=4*f,h}});e.PBKDF2=function(s,o,l){return a.create(l).compute(s,o)}})();var Xu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ud="=";function gs(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=Xu.charAt(r>>6)+Xu.charAt(r&63);if(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=Xu.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=Xu.charAt(r>>2)+Xu.charAt((r&3)<<4)),ud)for(;(n.length&3)>0;)n+=ud;return n}function Zu(e){var t="",r,n=0,i,a;for(r=0;r<e.length&&e.charAt(r)!=ud;++r)a=Xu.indexOf(e.charAt(r)),!(a<0)&&(n==0?(t+=ds(a>>2),i=a&3,n=1):n==1?(t+=ds(i<<2|a>>4),i=a&15,n=2):n==2?(t+=ds(i),t+=ds(a>>2),i=a&3,n=3):(t+=ds(i<<2|a>>4),t+=ds(a&15),n=0));return n==1&&(t+=ds(i<<2)),t}function Nm(e){var t=Zu(e),r,n=new Array;for(r=0;2*r<t.length;++r)n[r]=parseInt(t.substring(2*r,2*r+2),16);return n}var Qs,Vb=0xdeadbeefcafe,Tm=(Vb&16777215)==15715070;function ee(e,t,r){e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}function ft(){return new ee(null)}function Kb(e,t,r,n,i,a){for(;--a>=0;){var s=t*this[e++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=s&67108863}return i}function Gb(e,t,r,n,i,a){for(var s=t&32767,o=t>>15;--a>=0;){var l=this[e]&32767,h=this[e++]>>15,d=o*l+h*s;l=s*l+((d&32767)<<15)+r[n]+(i&1073741823),i=(l>>>30)+(d>>>15)+o*h+(i>>>30),r[n++]=l&1073741823}return i}function zb(e,t,r,n,i,a){for(var s=t&16383,o=t>>14;--a>=0;){var l=this[e]&16383,h=this[e++]>>14,d=o*l+h*s;l=s*l+((d&16383)<<14)+r[n]+i,i=(l>>28)+(d>>14)+o*h,r[n++]=l&268435455}return i}Tm&&wc.appName=="Microsoft Internet Explorer"?(ee.prototype.am=Gb,Qs=30):Tm&&wc.appName!="Netscape"?(ee.prototype.am=Kb,Qs=26):(ee.prototype.am=zb,Qs=28);ee.prototype.DB=Qs;ee.prototype.DM=(1<<Qs)-1;ee.prototype.DV=1<<Qs;var hd=52;ee.prototype.FV=Math.pow(2,hd);ee.prototype.F1=hd-Qs;ee.prototype.F2=2*Qs-hd;var Yb="0123456789abcdefghijklmnopqrstuvwxyz",ff=new Array,Qu,Zn;Qu=48;for(Zn=0;Zn<=9;++Zn)ff[Qu++]=Zn;Qu=97;for(Zn=10;Zn<36;++Zn)ff[Qu++]=Zn;Qu=65;for(Zn=10;Zn<36;++Zn)ff[Qu++]=Zn;function ds(e){return Yb.charAt(e)}function km(e,t){var r=ff[e.charCodeAt(t)];return r??-1}function Wb(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function Xb(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function Zs(e){var t=ft();return t.fromInt(e),t}function Jb(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var s=r==8?e[n]&255:km(e,n);if(s<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&e[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&ee.ZERO.subTo(this,this)}function Zb(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function Qb(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 r=(1<<t)-1,n,i=!1,a="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(n=this[s]>>o)>0&&(i=!0,a=ds(n));s>=0;)o<t?(n=(this[s]&(1<<o)-1)<<t-o,n|=this[--s]>>(o+=this.DB-t)):(n=this[s]>>(o-=t)&r,o<=0&&(o+=this.DB,--s)),n>0&&(i=!0),i&&(a+=ds(n));return i?a:"0"}function eC(){var e=ft();return ee.ZERO.subTo(this,e),e}function tC(){return this.s<0?this.negate():this}function rC(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}function hf(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}function nC(){return this.t<=0?0:this.DB*(this.t-1)+hf(this[this.t-1]^this.s&this.DM)}function iC(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}function sC(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}function aC(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(e/this.DB),s=this.s<<r&this.DM,o;for(o=this.t-1;o>=0;--o)t[o+a+1]=this[o]>>n|s,s=(this[o]&i)<<r;for(o=a-1;o>=0;--o)t[o]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()}function uC(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&a)<<i,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}function oC(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}function cC(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&ee.ZERO.subTo(t,t)}function lC(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}function fC(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=ft());var a=ft(),s=this.s,o=e.s,l=this.DB-hf(n[n.t-1]);l>0?(n.lShiftTo(l,a),i.lShiftTo(l,r)):(n.copyTo(a),i.copyTo(r));var h=a.t,d=a[h-1];if(d!=0){var E=d*(1<<this.F1)+(h>1?a[h-2]>>this.F2:0),p=this.FV/E,f=(1<<this.F1)/E,w=1<<this.F2,g=r.t,y=g-h,A=t??ft();for(a.dlShiftTo(y,A),r.compareTo(A)>=0&&(r[r.t++]=1,r.subTo(A,r)),ee.ONE.dlShiftTo(h,A),A.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--y>=0;){var S=r[--g]==d?this.DM:Math.floor(r[g]*p+(r[g-1]+w)*f);if((r[g]+=a.am(0,S,r,y,0,h))<S)for(a.dlShiftTo(y,A),r.subTo(A,r);r[g]<--S;)r.subTo(A,r)}t!=null&&(r.drShiftTo(h,t),s!=o&&ee.ZERO.subTo(t,t)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&ee.ZERO.subTo(r,r)}}}function hC(e){var t=ft();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ee.ZERO)>0&&e.subTo(t,t),t}function Ma(e){this.m=e}function pC(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function dC(e){return e}function gC(e){e.divRemTo(this.m,null,e)}function mC(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function vC(e,t){e.squareTo(t),this.reduce(t)}Ma.prototype.convert=pC;Ma.prototype.revert=dC;Ma.prototype.reduce=gC;Ma.prototype.mulTo=mC;Ma.prototype.sqrTo=vC;function EC(){if(this.t<1)return 0;var e=this[0];if(!(e&1))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 qa(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 AC(e){var t=ft();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(ee.ZERO)>0&&this.m.subTo(t,t),t}function wC(e){var t=ft();return e.copyTo(t),this.reduce(t),t}function yC(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function SC(e,t){e.squareTo(t),this.reduce(t)}function bC(e,t,r){e.multiplyTo(t,r),this.reduce(r)}qa.prototype.convert=AC;qa.prototype.revert=wC;qa.prototype.reduce=yC;qa.prototype.mulTo=bC;qa.prototype.sqrTo=SC;function CC(){return(this.t>0?this[0]&1:this.s)==0}function FC(e,t){if(e>4294967295||e<1)return ee.ONE;var r=ft(),n=ft(),i=t.convert(this),a=hf(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var s=r;r=n,n=s}return t.revert(r)}function _C(e,t){var r;return e<256||t.isEven()?r=new Ma(t):r=new qa(t),this.exp(e,r)}ee.prototype.copyTo=Wb;ee.prototype.fromInt=Xb;ee.prototype.fromString=Jb;ee.prototype.clamp=Zb;ee.prototype.dlShiftTo=iC;ee.prototype.drShiftTo=sC;ee.prototype.lShiftTo=aC;ee.prototype.rShiftTo=uC;ee.prototype.subTo=oC;ee.prototype.multiplyTo=cC;ee.prototype.squareTo=lC;ee.prototype.divRemTo=fC;ee.prototype.invDigit=EC;ee.prototype.isEven=CC;ee.prototype.exp=FC;ee.prototype.toString=Qb;ee.prototype.negate=eC;ee.prototype.abs=tC;ee.prototype.compareTo=rC;ee.prototype.bitLength=nC;ee.prototype.mod=hC;ee.prototype.modPowInt=_C;ee.ZERO=Zs(0);ee.ONE=Zs(1);function IC(){var e=ft();return this.copyTo(e),e}function DC(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function BC(){return this.t==0?this.s:this[0]<<24>>24}function $C(){return this.t==0?this.s:this[0]<<16>>16}function PC(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function RC(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function TC(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=Zs(r),i=ft(),a=ft(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s}function xC(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,s=0,o=0;o<e.length;++o){var l=km(e,o);if(l<0){e.charAt(o)=="-"&&this.signum()==0&&(i=!0);continue}s=t*s+l,++a>=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),i&&ee.ZERO.subTo(this,this)}function OC(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(ee.ONE.shiftLeft(e-1),pd,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(ee.ONE.shiftLeft(e-1),this);else{var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function NC(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}function kC(e){return this.compareTo(e)==0}function LC(e){return this.compareTo(e)<0?this:e}function UC(e){return this.compareTo(e)>0?this:e}function HC(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function jC(e,t){return e&t}function MC(e){var t=ft();return this.bitwiseTo(e,jC,t),t}function pd(e,t){return e|t}function qC(e){var t=ft();return this.bitwiseTo(e,pd,t),t}function Lm(e,t){return e^t}function VC(e){var t=ft();return this.bitwiseTo(e,Lm,t),t}function Um(e,t){return e&~t}function KC(e){var t=ft();return this.bitwiseTo(e,Um,t),t}function GC(){for(var e=ft(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function zC(e){var t=ft();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function YC(e){var t=ft();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function WC(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function XC(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+WC(this[e]);return this.s<0?this.t*this.DB:-1}function JC(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function ZC(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=JC(this[r]^t);return e}function QC(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function eF(e,t){var r=ee.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function tF(e){return this.changeBit(e,pd)}function rF(e){return this.changeBit(e,Um)}function nF(e){return this.changeBit(e,Lm)}function iF(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}function sF(e){var t=ft();return this.addTo(e,t),t}function aF(e){var t=ft();return this.subTo(e,t),t}function uF(e){var t=ft();return this.multiplyTo(e,t),t}function oF(){var e=ft();return this.squareTo(e),e}function cF(e){var t=ft();return this.divRemTo(e,t,null),t}function lF(e){var t=ft();return this.divRemTo(e,null,t),t}function fF(e){var t=ft(),r=ft();return this.divRemTo(e,t,r),new Array(t,r)}function hF(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function pF(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function Sc(){}function Hm(e){return e}function dF(e,t,r){e.multiplyTo(t,r)}function gF(e,t){e.squareTo(t)}Sc.prototype.convert=Hm;Sc.prototype.revert=Hm;Sc.prototype.mulTo=dF;Sc.prototype.sqrTo=gF;function mF(e){return this.exp(e,new Sc)}function vF(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}function EF(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function eo(e){this.r2=ft(),this.q3=ft(),ee.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function AF(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=ft();return e.copyTo(t),this.reduce(t),t}function wF(e){return e}function yF(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 SF(e,t){e.squareTo(t),this.reduce(t)}function bF(e,t,r){e.multiplyTo(t,r),this.reduce(r)}eo.prototype.convert=AF;eo.prototype.revert=wF;eo.prototype.reduce=yF;eo.prototype.mulTo=bF;eo.prototype.sqrTo=SF;function CF(e,t){var r=e.bitLength(),n,i=Zs(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new Ma(t):t.isEven()?a=new eo(t):a=new qa(t);var s=new Array,o=3,l=n-1,h=(1<<n)-1;if(s[1]=a.convert(this),n>1){var d=ft();for(a.sqrTo(s[1],d);o<=h;)s[o]=ft(),a.mulTo(d,s[o-2],s[o]),o+=2}var E=e.t-1,p,f=!0,w=ft(),g;for(r=hf(e[E])-1;E>=0;){for(r>=l?p=e[E]>>r-l&h:(p=(e[E]&(1<<r+1)-1)<<l-r,E>0&&(p|=e[E-1]>>this.DB+r-l)),o=n;!(p&1);)p>>=1,--o;if((r-=o)<0&&(r+=this.DB,--E),f)s[p].copyTo(i),f=!1;else{for(;o>1;)a.sqrTo(i,w),a.sqrTo(w,i),o-=2;o>0?a.sqrTo(i,w):(g=i,i=w,w=g),a.mulTo(w,s[p],i)}for(;E>=0&&!(e[E]&1<<r);)a.sqrTo(i,w),g=i,i=w,w=g,--r<0&&(r=this.DB-1,--E)}return a.revert(i)}function FF(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}function _F(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}function IF(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return ee.ZERO;for(var r=e.clone(),n=this.clone(),i=Zs(1),a=Zs(0),s=Zs(0),o=Zs(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),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);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),a.subTo(o,a)):(n.subTo(r,n),t&&s.subTo(i,s),o.subTo(a,o))}if(n.compareTo(ee.ONE)!=0)return ee.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 Xr=[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],DF=(1<<26)/Xr[Xr.length-1];function BF(e){var t,r=this.abs();if(r.t==1&&r[0]<=Xr[Xr.length-1]){for(t=0;t<Xr.length;++t)if(r[0]==Xr[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Xr.length;){for(var n=Xr[t],i=t+1;i<Xr.length&&n<DF;)n*=Xr[i++];for(n=r.modInt(n);t<i;)if(n%Xr[t++]==0)return!1}return r.millerRabin(e)}function $F(e){var t=this.subtract(ee.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Xr.length&&(e=Xr.length);for(var i=ft(),a=0;a<e;++a){i.fromInt(Xr[Math.floor(Math.random()*Xr.length)]);var s=i.modPow(n,this);if(s.compareTo(ee.ONE)!=0&&s.compareTo(t)!=0){for(var o=1;o++<r&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(ee.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}ee.prototype.chunkSize=PC;ee.prototype.toRadix=TC;ee.prototype.fromRadix=xC;ee.prototype.fromNumber=OC;ee.prototype.bitwiseTo=HC;ee.prototype.changeBit=eF;ee.prototype.addTo=iF;ee.prototype.dMultiply=hF;ee.prototype.dAddOffset=pF;ee.prototype.multiplyLowerTo=vF;ee.prototype.multiplyUpperTo=EF;ee.prototype.modInt=_F;ee.prototype.millerRabin=$F;ee.prototype.clone=IC;ee.prototype.intValue=DC;ee.prototype.byteValue=BC;ee.prototype.shortValue=$C;ee.prototype.signum=RC;ee.prototype.toByteArray=NC;ee.prototype.equals=kC;ee.prototype.min=LC;ee.prototype.max=UC;ee.prototype.and=MC;ee.prototype.or=qC;ee.prototype.xor=VC;ee.prototype.andNot=KC;ee.prototype.not=GC;ee.prototype.shiftLeft=zC;ee.prototype.shiftRight=YC;ee.prototype.getLowestSetBit=XC;ee.prototype.bitCount=ZC;ee.prototype.testBit=QC;ee.prototype.setBit=tF;ee.prototype.clearBit=rF;ee.prototype.flipBit=nF;ee.prototype.add=sF;ee.prototype.subtract=aF;ee.prototype.multiply=uF;ee.prototype.divide=cF;ee.prototype.remainder=lF;ee.prototype.divideAndRemainder=fF;ee.prototype.modPow=CF;ee.prototype.modInverse=IF;ee.prototype.pow=mF;ee.prototype.gcd=FF;ee.prototype.isProbablePrime=BF;ee.prototype.square=oF;function dd(){this.i=0,this.j=0,this.S=new Array}function PF(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0}function RF(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}dd.prototype.init=PF;dd.prototype.next=RF;function TF(){return new dd}var od=256;var uf,Bn,mr;function xF(e){Bn[mr++]^=e&255,Bn[mr++]^=e>>8&255,Bn[mr++]^=e>>16&255,Bn[mr++]^=e>>24&255,mr>=od&&(mr-=od)}function gd(){xF(new Date().getTime())}if(Bn==null){if(Bn=new Array,mr=0,Wu!==void 0&&(Wu.crypto!==void 0||Wu.msCrypto!==void 0)){if(nd=Wu.crypto||Wu.msCrypto,nd.getRandomValues)for(sd=new Uint8Array(32),nd.getRandomValues(sd),Jn=0;Jn<32;++Jn)Bn[mr++]=sd[Jn];else if(wc.appName=="Netscape"&&wc.appVersion<"5")for(ad=Wu.crypto.random(32),Jn=0;Jn<ad.length;++Jn)Bn[mr++]=ad.charCodeAt(Jn)&255}for(;mr<od;)Jn=Math.floor(65536*Math.random()),Bn[mr++]=Jn>>>8,Bn[mr++]=Jn&255;mr=0,gd()}var Jn,nd,sd,ad;function OF(){if(uf==null){for(gd(),uf=TF(),uf.init(Bn),mr=0;mr<Bn.length;++mr)Bn[mr]=0;mr=0}return uf.next()}function NF(e){var t;for(t=0;t<e.length;++t)e[t]=OF()}function to(){}to.prototype.nextBytes=NF;function hn(e,t){return new ee(e,t)}function ze(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function kF(e,t){if(this.isPublic=!0,this.isPrivate=!1,typeof e!="string")this.n=e,this.e=t;else if(e!=null&&t!=null&&e.length>0&&t.length>0)this.n=hn(e,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function LF(e){return e.modPowInt(this.e,this.n)}ze.prototype.doPublic=LF;ze.prototype.setPublic=kF;ze.prototype.type="RSA";function UF(e,t,r){if(this.isPrivate=!0,typeof e!="string")this.n=e,this.e=t,this.d=r;else if(e!=null&&t!=null&&e.length>0&&t.length>0)this.n=hn(e,16),this.e=parseInt(t,16),this.d=hn(r,16);else throw"Invalid RSA private key"}function HF(e,t,r,n,i,a,s,o){if(this.isPrivate=!0,this.isPublic=!1,e==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(e.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(e!=null&&t!=null&&e.length>0&&t.length>0)this.n=hn(e,16),this.e=parseInt(t,16),this.d=hn(r,16),this.p=hn(n,16),this.q=hn(i,16),this.dmp1=hn(a,16),this.dmq1=hn(s,16),this.coeff=hn(o,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function jF(e,t){var r=new to,n=e>>1;this.e=parseInt(t,16);for(var i=new ee(t,16),a=e/2-100,s=ee.ONE.shiftLeft(a);;){for(;this.p=new ee(e-n,1,r),!(this.p.subtract(ee.ONE).gcd(i).compareTo(ee.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new ee(n,1,r),!(this.q.subtract(ee.ONE).gcd(i).compareTo(ee.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var l=this.q.subtract(this.p).abs();if(!(l.bitLength()<a||l.compareTo(s)<=0)){var h=this.p.subtract(ee.ONE),d=this.q.subtract(ee.ONE),E=h.multiply(d);if(E.gcd(i).compareTo(ee.ONE)==0&&(this.n=this.p.multiply(this.q),this.n.bitLength()==e)){this.d=i.modInverse(E),this.dmp1=this.d.mod(h),this.dmq1=this.d.mod(d),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0}function MF(e){if(this.p==null||this.q==null)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)}ze.prototype.doPrivate=MF;ze.prototype.setPrivate=UF;ze.prototype.setPrivateEx=HF;ze.prototype.generate=jF;function ar(e,t){this.x=t,this.q=e}function qF(e){return e==this?!0:this.q.equals(e.q)&&this.x.equals(e.x)}function VF(){return this.x}function KF(){return new ar(this.q,this.x.negate().mod(this.q))}function GF(e){return new ar(this.q,this.x.add(e.toBigInteger()).mod(this.q))}function zF(e){return new ar(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))}function YF(e){return new ar(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))}function WF(){return new ar(this.q,this.x.square().mod(this.q))}function XF(e){return new ar(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))}ar.prototype.equals=qF;ar.prototype.toBigInteger=VF;ar.prototype.negate=KF;ar.prototype.add=GF;ar.prototype.subtract=zF;ar.prototype.multiply=YF;ar.prototype.square=WF;ar.prototype.divide=XF;ar.prototype.sqrt=function(){return new ar(this.q,this.x.sqrt().mod(this.q))};function dt(e,t,r,n){this.curve=e,this.x=t,this.y=r,n==null?this.z=ee.ONE:this.z=n,this.zinv=null}function JF(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function ZF(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function QF(e){if(e==this)return!0;if(this.isInfinity())return e.isInfinity();if(e.isInfinity())return this.isInfinity();var t,r;return t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),t.equals(ee.ZERO)?(r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q),r.equals(ee.ZERO)):!1}function e8(){return this.x==null&&this.y==null?!0:this.z.equals(ee.ZERO)&&!this.y.toBigInteger().equals(ee.ZERO)}function t8(){return new dt(this.curve,this.x,this.y.negate(),this.z)}function r8(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(ee.ZERO.equals(r))return ee.ZERO.equals(t)?this.twice():this.curve.getInfinity();var n=new ee("3"),i=this.x.toBigInteger(),a=this.y.toBigInteger(),s=e.x.toBigInteger(),o=e.y.toBigInteger(),l=r.square(),h=l.multiply(r),d=i.multiply(l),E=t.square().multiply(this.z),p=E.subtract(d.shiftLeft(1)).multiply(e.z).subtract(h).multiply(r).mod(this.curve.q),f=d.multiply(n).multiply(t).subtract(a.multiply(h)).subtract(E.multiply(t)).multiply(e.z).add(t.multiply(h)).mod(this.curve.q),w=h.multiply(this.z).multiply(e.z).mod(this.curve.q);return new dt(this.curve,this.curve.fromBigInteger(p),this.curve.fromBigInteger(f),w)}function n8(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var e=new ee("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),i=n.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),s=t.square().multiply(e);ee.ZERO.equals(a)||(s=s.add(this.z.square().multiply(a))),s=s.mod(this.curve.q);var o=s.square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.q),l=s.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(s.square().multiply(s)).mod(this.curve.q),h=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new dt(this.curve,this.curve.fromBigInteger(o),this.curve.fromBigInteger(l),h)}function i8(e){if(this.isInfinity())return this;if(e.signum()==0)return this.curve.getInfinity();var t=e,r=t.multiply(new ee("3")),n=this.negate(),i=this,a=this.curve.q.subtract(e),s=a.multiply(new ee("3")),o=new dt(this.curve,this.x,this.y),l=o.negate(),h;for(h=r.bitLength()-2;h>0;--h){i=i.twice();var d=r.testBit(h),E=t.testBit(h);d!=E&&(i=i.add(d?this:n))}for(h=s.bitLength()-2;h>0;--h){o=o.twice();var p=s.testBit(h),f=a.testBit(h);p!=f&&(o=o.add(p?o:l))}return i}function s8(e,t,r){var n;e.bitLength()>r.bitLength()?n=e.bitLength()-1:n=r.bitLength()-1;for(var i=this.curve.getInfinity(),a=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?r.testBit(n)?i=i.add(a):i=i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i}dt.prototype.getX=JF;dt.prototype.getY=ZF;dt.prototype.equals=QF;dt.prototype.isInfinity=e8;dt.prototype.negate=t8;dt.prototype.add=r8;dt.prototype.twice=n8;dt.prototype.multiply=i8;dt.prototype.multiplyTwo=s8;function ms(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new dt(this,null,null)}function a8(){return this.q}function u8(){return this.a}function o8(){return this.b}function c8(e){return e==this?!0:this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)}function l8(){return this.infinity}function f8(e){return new ar(this.q,e)}function h8(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var t=e.substr(0,2),r=e.substr(2),n=this.fromBigInteger(new ee(h,16)),i=this.getA(),a=this.getB(),s=n.square().add(i).multiply(n).add(a),o=s.sqrt();return t=="03"&&(o=o.negate()),new dt(this,n,o);case 4:case 6:case 7:var l=(e.length-2)/2,h=e.substr(2,l),d=e.substr(l+2,l);return new dt(this,this.fromBigInteger(new ee(h,16)),this.fromBigInteger(new ee(d,16)));default:return null}}ms.prototype.getQ=a8;ms.prototype.getA=u8;ms.prototype.getB=o8;ms.prototype.equals=c8;ms.prototype.getInfinity=l8;ms.prototype.fromBigInteger=f8;ms.prototype.decodePointHex=h8;ar.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)};dt.prototype.getEncoded=function(e){var t=function(a,s){var o=a.toByteArrayUnsigned();if(s<o.length)o=o.slice(o.length-s);else for(;s>o.length;)o.unshift(0);return o},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=t(r,32);return e?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(n,32))),i};dt.decodeFrom=function(e,t){var r=t[0],n=t.length-1,i=t.slice(1,1+n/2),a=t.slice(1+n/2,1+n);i.unshift(0),a.unshift(0);var s=new ee(i),o=new ee(a);return new dt(e,e.fromBigInteger(s),e.fromBigInteger(o))};dt.decodeFromHex=function(e,t){var r=t.substr(0,2),n=t.length-2,i=t.substr(2,n/2),a=t.substr(2+n/2,n/2),s=new ee(i,16),o=new ee(a,16);return new dt(e,e.fromBigInteger(s),e.fromBigInteger(o))};dt.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y),n=r.divide(t),i=n.square().subtract(this.x).subtract(e.x),a=n.multiply(this.x.subtract(i)).subtract(this.y);return new dt(this.curve,i,a)};dt.prototype.twice2D=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var e=this.curve.fromBigInteger(ee.valueOf(2)),t=this.curve.fromBigInteger(ee.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new dt(this.curve,n,i)};dt.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(e.signum()==0)return this.curve.getInfinity();var t=e,r=t.multiply(new ee("3")),n=this.negate(),i=this,a;for(a=r.bitLength()-2;a>0;--a){i=i.twice();var s=r.testBit(a),o=t.testBit(a);s!=o&&(i=i.add2D(s?this:n))}return i};dt.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),a=t.multiply(t).mod(i),s=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(i);return a.equals(s)};dt.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"};dt.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(ee.ONE)<0||t.compareTo(e.subtract(ee.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(ee.ONE)<0||r.compareTo(e.subtract(ee.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var jm=function(){var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",t='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))',r='(?:"'+t+'*")',n=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+r+")","g"),i=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),a={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:`
`,r:"\r",t:" "};function s(E,p,f){return p?a[p]:String.fromCharCode(parseInt(f,16))}var o=new String(""),l="\\",h={"{":Object,"[":Array},d=Object.hasOwnProperty;return function(E,p){var f=E.match(n),w,g=f[0],y=!1;g==="{"?w={}:g==="["?w=[]:(w=[],y=!0);for(var A,S=[w],_=1-y,I=f.length;_<I;++_){g=f[_];var D;switch(g.charCodeAt(0)){default:D=S[0],D[A||D.length]=+g,A=void 0;break;case 34:if(g=g.substring(1,g.length-1),g.indexOf(l)!==-1&&(g=g.replace(i,s)),D=S[0],!A)if(D instanceof Array)A=D.length;else{A=g||o;break}D[A]=g,A=void 0;break;case 91:D=S[0],S.unshift(D[A||D.length]=[]),A=void 0;break;case 93:S.shift();break;case 102:D=S[0],D[A||D.length]=!1,A=void 0;break;case 110:D=S[0],D[A||D.length]=null,A=void 0;break;case 116:D=S[0],D[A||D.length]=!0,A=void 0;break;case 123:D=S[0],S.unshift(D[A||D.length]={}),A=void 0;break;case 125:S.shift();break}}if(y){if(S.length!==1)throw new Error;w=w[0]}else if(S.length)throw new Error;if(p){var H=function(V,F){var P=V[F];if(P&&typeof P=="object"){var k=null;for(var L in P)if(d.call(P,L)&&P!==V){var q=H(P,L);q!==void 0?P[L]=q:(k||(k=[]),k.push(L))}if(k)for(var J=k.length;--J>=0;)delete P[k[J]]}return p.call(V,F,P)};w=H({"":w},"")}return w}}();(typeof m>"u"||!m)&&(m={});(typeof m.asn1>"u"||!m.asn1)&&(m.asn1={});m.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){return Cc(e)},this.getPEMStringFromHex=function(e,t){return Or(e,t)},this.newObject=function(e){var t=m,r=t.asn1,n=r.ASN1Object,i=r.DERBoolean,a=r.DERInteger,s=r.DERBitString,o=r.DEROctetString,l=r.DERNull,h=r.DERObjectIdentifier,d=r.DEREnumerated,E=r.DERUTF8String,p=r.DERNumericString,f=r.DERPrintableString,w=r.DERTeletexString,g=r.DERIA5String,y=r.DERUTCTime,A=r.DERGeneralizedTime,S=r.DERVisibleString,_=r.DERBMPString,I=r.DERSequence,D=r.DERSet,H=r.DERTaggedObject,V=r.ASN1Util.newObject;if(e instanceof r.ASN1Object)return e;var F=Object.keys(e);if(F.length!=1)throw new Error("key of param shall be only one.");var P=F[0];if(":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+P+":")==-1)throw new Error("undefined key: "+P);if(P=="bool")return new i(e[P]);if(P=="int")return new a(e[P]);if(P=="bitstr")return new s(e[P]);if(P=="octstr")return new o(e[P]);if(P=="null")return new l(e[P]);if(P=="oid")return new h(e[P]);if(P=="enum")return new d(e[P]);if(P=="utf8str")return new E(e[P]);if(P=="numstr")return new p(e[P]);if(P=="prnstr")return new f(e[P]);if(P=="telstr")return new w(e[P]);if(P=="ia5str")return new g(e[P]);if(P=="utctime")return new y(e[P]);if(P=="gentime")return new A(e[P]);if(P=="visstr")return new S(e[P]);if(P=="bmpstr")return new _(e[P]);if(P=="asn1")return new n(e[P]);if(P=="seq"){for(var k=e[P],L=[],q=0;q<k.length;q++){var J=V(k[q]);L.push(J)}return new I({array:L})}if(P=="set"){for(var k=e[P],L=[],q=0;q<k.length;q++){var J=V(k[q]);L.push(J)}return new D({array:L})}if(P=="tag"){var z=e[P];if(Object.prototype.toString.call(z)==="[object Array]"&&z.length==3){var K=V(z[2]);return new H({tag:z[0],explicit:z[1],obj:K})}else return new H(z)}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.tohex()}};m.asn1.ASN1Util.oidHexToInt=function(e){for(var i="",t=parseInt(e.substr(0,2),16),r=Math.floor(t/40),n=t%40,i=r+"."+n,a="",s=2;s<e.length;s+=2){var o=parseInt(e.substr(s,2),16),l=("00000000"+o.toString(2)).slice(-8);if(a=a+l.substr(1,7),l.substr(0,1)=="0"){var h=new ee(a,2);i=i+"."+h.toString(10),a=""}}return i};m.asn1.ASN1Util.oidIntToHex=function(e){var t=function(o){var l=o.toString(16);return l.length==1&&(l="0"+l),l},r=function(o){var l="",h=new ee(o,10),d=h.toString(2),E=7-d.length%7;E==7&&(E=0);for(var p="",f=0;f<E;f++)p+="0";d=p+d;for(var f=0;f<d.length-1;f+=7){var w=d.substr(f,7);f!=d.length-7&&(w="1"+w),l+=t(parseInt(w,2))}return l};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),a=parseInt(i[0])*40+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n};m.asn1.ASN1Object=function(e){var t=!0,r=null,n="00",i="00",a="";this.params=null,this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+a.length+",v="+this.hV);var s=this.hV.length/2,o=s.toString(16);if(o.length%2==1&&(o="0"+o),s<128)return o;var l=o.length/2;if(l>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+s.toString(16));var h=128+l;return h.toString(16)+o},this.tohex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(s){this.params=s},e!=null&&e.tlv!=null&&(this.hTLV=e.tlv,this.isModified=!1)};m.asn1.DERAbstractString=function(e){m.asn1.DERAbstractString.superclass.constructor.call(this);var t=null,r=null;this.getString=function(){return this.s},this.setString=function(n){this.hTLV=null,this.isModified=!0,this.s=n,this.hV=df(this.s).toLowerCase()},this.setStringHex=function(n){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"?this.setString(e):typeof e.str<"u"?this.setString(e.str):typeof e.hex<"u"&&this.setStringHex(e.hex))};he(m.asn1.DERAbstractString,m.asn1.ASN1Object);m.asn1.DERAbstractTime=function(e){m.asn1.DERAbstractTime.superclass.constructor.call(this);var t=null,r=null;this.localDateToUTC=function(n){var i=n.getTime()+n.getTimezoneOffset()*6e4,a=new Date(i);return a},this.formatDate=function(n,i,a){var s=this.zeroPadding,o=this.localDateToUTC(n),l=String(o.getFullYear());i=="utc"&&(l=l.substr(2,2));var h=s(String(o.getMonth()+1),2),d=s(String(o.getDate()),2),E=s(String(o.getHours()),2),p=s(String(o.getMinutes()),2),f=s(String(o.getSeconds()),2),w=l+h+d+E+p+f;if(a===!0){var g=o.getMilliseconds();if(g!=0){var y=s(String(g),3);y=y.replace(/[0]+$/,""),w=w+"."+y}}return w+"Z"},this.zeroPadding=function(n,i){return n.length>=i?n:new Array(i-n.length+1).join("0")+n},this.setByParam=function(n){this.hV=null,this.hTLV=null,this.params=n},this.getString=function(){},this.setString=function(n){this.hTLV=null,this.isModified=!0,this.params==null&&(this.params={}),this.params.str=n},this.setByDate=function(n){this.hTLV=null,this.isModified=!0,this.params==null&&(this.params={}),this.params.date=n},this.setByDateValue=function(n,i,a,s,o,l){var h=new Date(Date.UTC(n,i-1,a,s,o,l,0));this.setByDate(h)},this.getFreshValueHex=function(){return this.hV}};he(m.asn1.DERAbstractTime,m.asn1.ASN1Object);m.asn1.DERAbstractStructured=function(e){m.asn1.DERAbstractString.superclass.constructor.call(this);var t=null;this.setByASN1ObjectArray=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array=r},this.appendASN1Object=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array.push(r)},this.asn1Array=new Array,typeof e<"u"&&typeof e.array<"u"&&(this.asn1Array=e.array)};he(m.asn1.DERAbstractStructured,m.asn1.ASN1Object);m.asn1.DERBoolean=function(e){m.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",e==!1?this.hTLV="010100":this.hTLV="0101ff"};he(m.asn1.DERBoolean,m.asn1.ASN1Object);m.asn1.DERInteger=function(e){m.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=Cc;this.setByBigInteger=function(r){this.isModified=!0,this.params={bigint:r}},this.setByInteger=function(r){this.isModified=!0,this.params=r},this.setValueHex=function(r){this.isModified=!0,this.params={hex:r}},this.getFreshValueHex=function(){var r=this.params,n=null;if(r==null)throw new Error("value not set");if(typeof r=="object"&&r.hex!=null)return this.hV=r.hex,this.hV;if(typeof r=="number")n=new ee(String(r),10);else if(r.int!=null)n=new ee(String(r.int),10);else if(r.bigint!=null)n=r.bigint;else throw new Error("wrong parameter");return this.hV=t(n),this.hV},e!=null&&(this.params=e)};he(m.asn1.DERInteger,m.asn1.ASN1Object);m.asn1.DERBitString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=m.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}m.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(r){this.hTLV=null,this.isModified=!0,this.hV=r},this.setUnusedBitsAndHexValue=function(r,n){if(r<0||7<r)throw"unused bits shall be from 0 to 7: u = "+r;var i="0"+r;this.hTLV=null,this.isModified=!0,this.hV=i+n},this.setByBinaryString=function(r){r=r.replace(/0+$/,"");var n=8-r.length%8;n==8&&(n=0),r+="0000000".substr(0,n);for(var i="",a=0;a<r.length-1;a+=8){var s=r.substr(a,8),o=parseInt(s,2).toString(16);o.length==1&&(o="0"+o),i+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+n+i},this.setByBooleanArray=function(r){for(var n="",i=0;i<r.length;i++)r[i]==!0?n+="1":n+="0";this.setByBinaryString(n)},this.newFalseArray=function(r){for(var n=new Array(r),i=0;i<r;i++)n[i]=!1;return n},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):typeof e.hex<"u"?this.setHexValueIncludingUnusedBits(e.hex):typeof e.bin<"u"?this.setByBinaryString(e.bin):typeof e.array<"u"&&this.setByBooleanArray(e.array))};he(m.asn1.DERBitString,m.asn1.ASN1Object);m.asn1.DEROctetString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=m.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}m.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"};he(m.asn1.DEROctetString,m.asn1.DERAbstractString);m.asn1.DERNull=function(){m.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};he(m.asn1.DERNull,m.asn1.ASN1Object);m.asn1.DERObjectIdentifier=function(e){m.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var r=Ym(t);if(r==null)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(t){var r=m.asn1.x509.OID.name2oid(t);if(r!=="")this.setValueOidString(r);else throw new Error("DERObjectIdentifier oidName undefined: "+t)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){typeof t=="string"?this.setValueNameOrOid(t):t.oid!==void 0?this.setValueNameOrOid(t.oid):t.name!==void 0?this.setValueNameOrOid(t.name):t.hex!==void 0&&this.setValueHex(t.hex)},e!==void 0&&this.setByParam(e)};he(m.asn1.DERObjectIdentifier,m.asn1.ASN1Object);m.asn1.DEREnumerated=function(e){m.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Cc(t)},this.setByInteger=function(t){var r=new ee(String(t),10);this.setByBigInteger(r)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.int<"u"?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):typeof e.hex<"u"&&this.setValueHex(e.hex))};he(m.asn1.DEREnumerated,m.asn1.ASN1Object);m.asn1.DERUTF8String=function(e){m.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"};he(m.asn1.DERUTF8String,m.asn1.DERAbstractString);m.asn1.DERNumericString=function(e){m.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"};he(m.asn1.DERNumericString,m.asn1.DERAbstractString);m.asn1.DERPrintableString=function(e){m.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"};he(m.asn1.DERPrintableString,m.asn1.DERAbstractString);m.asn1.DERTeletexString=function(e){m.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"};he(m.asn1.DERTeletexString,m.asn1.DERAbstractString);m.asn1.DERIA5String=function(e){m.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"};he(m.asn1.DERIA5String,m.asn1.DERAbstractString);m.asn1.DERVisibleString=function(e){m.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"};he(m.asn1.DERVisibleString,m.asn1.DERAbstractString);m.asn1.DERBMPString=function(e){m.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"};he(m.asn1.DERBMPString,m.asn1.DERAbstractString);m.asn1.DERUTCTime=function(e){m.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(this.params==null&&(t={date:new Date}),typeof t=="string")if(t.match(/^[0-9]{12}Z$/)||t.match(/^[0-9]{12}\.[0-9]+Z$/))this.hV=pn(t);else throw new Error("malformed string for UTCTime: "+t);else if(t.str!=null)this.hV=pn(t.str);else if(t.date==null&&t.millis==!0){var r=new Date;this.hV=pn(this.formatDate(r,"utc",!0))}else if(t.date!=null&&t.date instanceof Date){var n=t.millis===!0;this.hV=pn(this.formatDate(t.date,"utc",n))}else t instanceof Date&&(this.hV=pn(this.formatDate(t,"utc")));if(this.hV==null)throw new Error("parameter not specified properly for UTCTime");return this.hV},e!=null&&this.setByParam(e)};he(m.asn1.DERUTCTime,m.asn1.DERAbstractTime);m.asn1.DERGeneralizedTime=function(e){m.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.params=e,this.getFreshValueHex=function(){var t=this.params;if(this.params==null&&(t={date:new Date}),typeof t=="string")if(t.match(/^[0-9]{14}Z$/)||t.match(/^[0-9]{14}\.[0-9]+Z$/))this.hV=pn(t);else throw new Error("malformed string for GeneralizedTime: "+t);else if(t.str!=null)this.hV=pn(t.str);else if(t.date==null&&t.millis==!0){var r=new Date;this.hV=pn(this.formatDate(r,"gen",!0))}else if(t.date!=null&&t.date instanceof Date){var n=t.millis===!0;this.hV=pn(this.formatDate(t.date,"gen",n))}else t instanceof Date&&(this.hV=pn(this.formatDate(t,"gen")));if(this.hV==null)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},e!=null&&this.setByParam(e)};he(m.asn1.DERGeneralizedTime,m.asn1.DERAbstractTime);m.asn1.DERSequence=function(e){m.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var t="",r=0;r<this.asn1Array.length;r++){var n=this.asn1Array[r];t+=n.tohex()}return this.hV=t,this.hV}};he(m.asn1.DERSequence,m.asn1.DERAbstractStructured);m.asn1.DERSet=function(e){m.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,r=0;r<this.asn1Array.length;r++){var n=this.asn1Array[r];t.push(n.tohex())}return this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof e<"u"&&typeof e.sortflag<"u"&&e.sortflag==!1&&(this.sortFlag=!1)};he(m.asn1.DERSet,m.asn1.DERAbstractStructured);m.asn1.DERTaggedObject=function(e){m.asn1.DERTaggedObject.superclass.constructor.call(this);var t=m.asn1,r=Ae,n=r.getV,i=r.isASN1HEX,a=t.ASN1Util.newObject;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(s,o,l){this.params={tag:o,explicit:s,obj:l}},this.getFreshValueHex=function(){var s=this.params;if(s.explicit==null&&(s.explicit=!0),s.tage!=null&&(s.tag=s.tage,s.explicit=!0),s.tagi!=null&&(s.tag=s.tagi,s.explicit=!1),s.str!=null)this.hV=df(s.str);else if(s.hex!=null)this.hV=s.hex;else if(s.obj!=null){var o;s.obj instanceof t.ASN1Object?o=s.obj.tohex():typeof s.obj=="object"&&(o=a(s.obj).tohex()),s.explicit?this.hV=o:this.hV=n(o,0)}else throw new Error("str, hex nor obj not specified");return s.tag==null&&(s.tag="a0"),this.hT=s.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(s){this.params=s},e!==void 0&&this.setByParam(e)};he(m.asn1.DERTaggedObject,m.asn1.ASN1Object);var Ae=new function(){};Ae.getLblen=function(e,t){if(e.substr(t+2,1)!="8")return 1;var r=parseInt(e.substr(t+3,1));return r==0?-1:0<r&&r<10?r+1:-2};Ae.getL=function(e,t){var r=Ae.getLblen(e,t);return r<1?"":e.substr(t+2,r*2)};Ae.getVblen=function(e,t){var r,n;return r=Ae.getL(e,t),r==""?-1:(r.substr(0,1)==="8"?n=new ee(r.substr(2),16):n=new ee(r,16),n.intValue())};Ae.getVidx=function(e,t){var r=Ae.getLblen(e,t);return r<0?r:t+(r+1)*2};Ae.getV=function(e,t){var r=Ae.getVidx(e,t),n=Ae.getVblen(e,t);return e.substr(r,n*2)};Ae.getTLV=function(e,t){return e.substr(t,2)+Ae.getL(e,t)+Ae.getV(e,t)};Ae.getTLVblen=function(e,t){return 2+Ae.getLblen(e,t)*2+Ae.getVblen(e,t)*2};Ae.getNextSiblingIdx=function(e,t){var r=Ae.getVidx(e,t),n=Ae.getVblen(e,t);return r+n*2};Ae.getChildIdx=function(e,t){var r=Ae,n=[],i,a,s;i=r.getVidx(e,t),a=r.getVblen(e,t)*2,e.substr(t,2)=="03"&&(i+=2,a-=2),s=0;for(var o=i;s<=a;){var l=r.getTLVblen(e,o);if(s+=l,s<=a&&n.push(o),o+=l,s>=a)break}return n};Ae.getNthChildIdx=function(e,t,r){var n=Ae.getChildIdx(e,t);return n[r]};Ae.getIdxbyList=function(e,t,r,n){var i=Ae,a,s;return r.length==0?n!==void 0&&e.substr(t,2)!==n?-1:t:(a=r.shift(),s=i.getChildIdx(e,t),a>=s.length?-1:i.getIdxbyList(e,s[a],r,n))};Ae.getIdxbyListEx=function(e,t,r,n){var i=Ae,a,s;if(r.length==0)return n!==void 0&&e.substr(t,2)!==n?-1:t;a=r.shift(),s=i.getChildIdx(e,t);for(var o=0,l=0;l<s.length;l++){var h=e.substr(s[l],2);if(typeof a=="number"&&!i.isContextTag(h)&&o==a||typeof a=="string"&&i.isContextTag(h,a))return i.getIdxbyListEx(e,s[l],r,n);i.isContextTag(h)||o++}return-1};Ae.getTLVbyList=function(e,t,r,n){var i=Ae,a=i.getIdxbyList(e,t,r,n);return a==-1||a>=e.length?null:i.getTLV(e,a)};Ae.getTLVbyListEx=function(e,t,r,n){var i=Ae,a=i.getIdxbyListEx(e,t,r,n);return a==-1?null:i.getTLV(e,a)};Ae.getVbyList=function(e,t,r,n,i){var a=Ae,s,o;return s=a.getIdxbyList(e,t,r,n),s==-1||s>=e.length?null:(o=a.getV(e,s),i===!0&&(o=o.substr(2)),o)};Ae.getVbyListEx=function(e,t,r,n,i){var a=Ae,s,o,l;return s=a.getIdxbyListEx(e,t,r,n),s==-1?null:(l=a.getV(e,s),e.substr(s,2)=="03"&&i!==!1&&(l=l.substr(2)),l)};Ae.getInt=function(e,t,r){r==null&&(r=-1);try{var n=e.substr(t,2);if(n!="02"&&n!="03")return r;var i=Ae.getV(e,t);return n=="02"?parseInt(i,16):Xm(i)}catch{return r}};Ae.getOID=function(e,t,r){r==null&&(r=null);try{if(e.substr(t,2)!="06")return r;var n=Ae.getV(e,t);return Af(n)}catch{return r}};Ae.getOIDName=function(e,t,r){r==null&&(r=null);try{var n=Ae.getOID(e,t,r);if(n==r)return r;var i=m.asn1.x509.OID.oid2name(n);return i==""?n:i}catch{return r}};Ae.getString=function(e,t,r){r==null&&(r=null);try{var n=Ae.getV(e,t);return dn(n)}catch{return r}};Ae.hextooidstr=function(e){var t=function(E,p){return E.length>=p?E:new Array(p-E.length+1).join("0")+E},r=[],n=e.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var a=e.substr(2),s=[],o=0;o<a.length/2;o++)s.push(parseInt(a.substr(o*2,2),16));for(var l=[],h="",o=0;o<s.length;o++)s[o]&128?h=h+t((s[o]&127).toString(2),7):(h=h+t((s[o]&127).toString(2),7),l.push(new String(parseInt(h,2))),h="");var d=r.join(".");return l.length>0&&(d=d+"."+l.join(".")),d};Ae.dump=function(e,t,r,n){var i=Ae,a=i.getV,s=i.dump,o=i.getChildIdx,l=e;e instanceof m.asn1.ASN1Object&&(l=e.tohex());var h=function(V,F){if(V.length<=F*2)return V;var P=V.substr(0,F)+"..(total "+V.length/2+"bytes).."+V.substr(V.length-F,F);return P};t===void 0&&(t={ommit_long_octet:32}),r===void 0&&(r=0),n===void 0&&(n="");var d=t.ommit_long_octet,D=l.substr(r,2);if(D=="01"){var E=a(l,r);return E=="00"?n+`BOOLEAN FALSE
`:n+`BOOLEAN TRUE
`}if(D=="02"){var E=a(l,r);return n+"INTEGER "+h(E,d)+`
`}if(D=="03"){var E=a(l,r);if(i.isASN1HEX(E.substr(2))){var p=n+`BITSTRING, encapsulates
`;return p=p+s(E.substr(2),t,0,n+" "),p}else return n+"BITSTRING "+h(E,d)+`
`}if(D=="04"){var E=a(l,r);if(i.isASN1HEX(E)){var p=n+`OCTETSTRING, encapsulates
`;return p=p+s(E,t,0,n+" "),p}else return n+"OCTETSTRING "+h(E,d)+`
`}if(D=="05")return n+`NULL
`;if(D=="06"){var f=a(l,r),w=m.asn1.ASN1Util.oidHexToInt(f),g=m.asn1.x509.OID.oid2name(w),y=w.replace(/\./g," ");return g!=""?n+"ObjectIdentifier "+g+" ("+y+`)
`:n+"ObjectIdentifier ("+y+`)
`}if(D=="0a")return n+"ENUMERATED "+parseInt(a(l,r))+`
`;if(D=="0c")return n+"UTF8String '"+yt(a(l,r))+`'
`;if(D=="13")return n+"PrintableString '"+yt(a(l,r))+`'
`;if(D=="14")return n+"TeletexString '"+yt(a(l,r))+`'
`;if(D=="16")return n+"IA5String '"+yt(a(l,r))+`'
`;if(D=="17")return n+"UTCTime "+yt(a(l,r))+`
`;if(D=="18")return n+"GeneralizedTime "+yt(a(l,r))+`
`;if(D=="1a")return n+"VisualString '"+yt(a(l,r))+`'
`;if(D=="1e")return n+"BMPString '"+Ad(a(l,r))+`'
`;if(D=="30"){if(l.substr(r,4)=="3000")return n+`SEQUENCE {}
`;var p=n+`SEQUENCE
`,A=o(l,r),S=t;if((A.length==2||A.length==3)&&l.substr(A[0],2)=="06"&&l.substr(A[A.length-1],2)=="04"){var g=i.oidname(a(l,A[0])),_=JSON.parse(JSON.stringify(t));_.x509ExtName=g,S=_}for(var I=0;I<A.length;I++)p=p+s(l,S,A[I],n+" ");return p}if(D=="31"){for(var p=n+`SET
`,A=o(l,r),I=0;I<A.length;I++)p=p+s(l,t,A[I],n+" ");return p}var D=parseInt(D,16);if(D&128){var H=D&31;if(D&32){for(var p=n+"["+H+`]
`,A=o(l,r),I=0;I<A.length;I++)p=p+s(l,t,A[I],n+" ");return p}else{var E=a(l,r);if(Ae.isASN1HEX(E)){var p=n+"["+H+`]
`;return p=p+s(E,t,0,n+" "),p}else(E.substr(0,8)=="68747470"||t.x509ExtName==="subjectAltName"&&H==2)&&(E=yt(E));var p=n+"["+H+"] "+E+`
`;return p}}return n+"UNKNOWN("+D+") "+a(l,r)+`
`};Ae.parse=function(e){var t=Ae,r=t.parse,n=t.isASN1HEX,i=t.getV,a=t.getTLV,s=t.getChildIdx,o=m.asn1,l=o.ASN1Util.oidHexToInt,h=o.x509.OID.oid2name,d=yt,E=Ad,p=E8,f={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},w=function(P){for(var k=[],L=s(P,0),q=0;q<L.length;q++){var J=L[q],z=a(P,J),K=r(z);k.push(K)}return k},g=e.substr(0,2),y={},A=i(e,0);if(g=="01")return e=="0101ff"?{bool:!0}:{bool:!1};if(g=="02")return{int:{hex:A}};if(g=="03")try{if(A.substr(0,2)!="00")throw"not encap";var S=A.substr(2);if(!n(S))throw"not encap";return{bitstr:{obj:r(S)}}}catch{var _=null;return A.length<=10&&(_=Zm(A)),_==null?{bitstr:{hex:A}}:{bitstr:{bin:_}}}else if(g=="04")try{if(!n(A))throw"not encap";return{octstr:{obj:r(A)}}}catch{return{octstr:{hex:A}}}else{if(g=="05")return{null:""};if(g=="06"){var I=l(A),D=h(I);return D==""?{oid:I}:{oid:D}}else{if(g=="0a")return A.length>4?{enum:{hex:A}}:{enum:parseInt(A,16)};if(g=="30"||g=="31")return y[f[g]]=w(e),y;if(g=="14"){var H=p(A);return y[f[g]]={str:H},y}else if(g=="1e"){var H=E(A);return y[f[g]]={str:H},y}else if(":0c:12:13:16:17:18:1a:".indexOf(g)!=-1){var H=d(A);return y[f[g]]={str:H},y}else if(g.match(/^8[0-9]$/)){var H=d(A);return H==null|H==""?{tag:{tag:g,explicit:!1,hex:A}}:H.match(/[\x00-\x1F\x7F-\x9F]/)!=null||H.match(/[\u0000-\u001F\u0080\u009F]/)!=null?{tag:{tag:g,explicit:!1,hex:A}}:{tag:{tag:g,explicit:!1,str:H}}}else if(g.match(/^a[0-9]$/))try{if(!n(A))throw new Error("not encap");return{tag:{tag:g,explicit:!0,obj:r(A)}}}catch{return{tag:{tag:g,explicit:!0,hex:A}}}else{var V=new m.asn1.ASN1Object;V.hV=A;var F=V.getLengthHexFromValue();return{asn1:{tlv:g+F+A}}}}}};Ae.isContextTag=function(e,t){e=e.toLowerCase();var r,n;try{r=parseInt(e,16)}catch{return-1}if(t===void 0)return(r&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(n=parseInt(t.substr(1,t.length-1),10),n>31)?!1:(r&192)==128&&(r&31)==n}catch{return!1}};Ae.isASN1HEX=function(e){var t=Ae;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),i=t.getL(e,0),a=e.length-n.length-i.length;return a==r*2};Ae.checkStrictDER=function(e,t,r,n,i){var a=Ae;if(r===void 0){if(typeof e!="string")throw new Error("not hex string");if(e=e.toLowerCase(),!m.lang.String.isHex(e))throw new Error("not hex string");r=e.length,n=e.length/2,n<128?i=1:i=Math.ceil(n.toString(16))+1}var s=a.getL(e,t);if(s.length>i*2)throw new Error("L of TLV too long: idx="+t);var o=a.getVblen(e,t);if(o>n)throw new Error("value of L too long than hex: idx="+t);var l=a.getTLV(e,t),h=l.length-2-a.getL(e,t).length;if(h!==o*2)throw new Error("V string length and L's value not the same:"+h+"/"+o*2);if(t===0&&e.length!=l.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+l.length);var d=e.substr(t,2);if(d==="02"){var E=a.getVidx(e,t);if(e.substr(E,2)=="00"&&e.charCodeAt(E+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(d,16)&32){for(var p=a.getVblen(e,t),f=0,w=a.getChildIdx(e,t),g=0;g<w.length;g++){var y=a.getTLV(e,w[g]);f+=y.length,a.checkStrictDER(e,w[g],r,n,i)}if(p*2!=f)throw new Error("sum of children's TLV length and L unmatch: "+p*2+"!="+f)}};Ae.oidname=function(e){var t=m.asn1;m.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return r===""&&(r=e),r};(typeof m>"u"||!m)&&(m={});(typeof m.asn1>"u"||!m.asn1)&&(m.asn1={});(typeof m.asn1.x509>"u"||!m.asn1.x509)&&(m.asn1.x509={});m.asn1.x509.Certificate=function(e){m.asn1.x509.Certificate.superclass.constructor.call(this);var t=m,r=t.asn1,n=r.DERBitString,i=r.DERSequence,a=r.x509,s=a.TBSCertificate,o=a.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(l){this.params=l},this.sign=function(){var l=this.params,h=l.sigalg;l.sigalg.name!=null&&(h=l.sigalg.name);var d=l.tbsobj.tohex(),E=new m.crypto.Signature({alg:h});E.init(l.cakey),E.updateHex(d),l.sighex=E.sign()},this.getPEM=function(){return Or(this.tohex(),"CERTIFICATE")},this.tohex=function(){var l=this.params;if((l.tbsobj==null||l.tbsobj==null)&&(l.tbsobj=new s(l)),l.sighex==null&&l.cakey!=null&&this.sign(),l.sighex==null)throw new Error("sighex or cakey parameter not defined");var h=[];h.push(l.tbsobj),h.push(new o({name:l.sigalg})),h.push(new n({hex:"00"+l.sighex}));var d=new i({array:h});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&(this.params=e)};he(m.asn1.x509.Certificate,m.asn1.ASN1Object);m.asn1.x509.TBSCertificate=function(e){m.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=m,r=t.asn1,n=r.x509,i=r.DERTaggedObject,a=r.DERInteger,s=r.DERSequence,o=n.AlgorithmIdentifier,l=n.Time,h=n.X500Name,d=n.Extensions,E=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(p){this.params=p},this.tohex=function(){var p=[],f=this.params;if(f.version!=null||f.version!=1){var w=2;f.version!=null&&(w=f.version-1);var g=new i({obj:new a({int:w})});p.push(g)}p.push(new a(f.serial)),p.push(new o({name:f.sigalg})),p.push(new h(f.issuer)),p.push(new s({array:[new l(f.notbefore),new l(f.notafter)]})),p.push(new h(f.subject)),p.push(new E(at.getKey(f.sbjpubkey))),f.ext!==void 0&&f.ext.length>0&&p.push(new i({tag:"a3",obj:new d(f.ext)}));var y=new m.asn1.DERSequence({array:p});return y.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.TBSCertificate,m.asn1.ASN1Object);m.asn1.x509.Extensions=function(e){m.asn1.x509.Extensions.superclass.constructor.call(this);var t=m,r=t.asn1,n=r.DERSequence,i=r.x509;this.aParam=[],this.setByParam=function(a){this.aParam=a},this.tohex=function(){for(var a=[],s=0;s<this.aParam.length;s++){var o=this.aParam[s],l=o.extname,h=null;if(o.extn!=null)h=new i.PrivateExtension(o);else if(l=="subjectKeyIdentifier")h=new i.SubjectKeyIdentifier(o);else if(l=="keyUsage")h=new i.KeyUsage(o);else if(l=="subjectAltName")h=new i.SubjectAltName(o);else if(l=="issuerAltName")h=new i.IssuerAltName(o);else if(l=="basicConstraints")h=new i.BasicConstraints(o);else if(l=="nameConstraints")h=new i.NameConstraints(o);else if(l=="cRLDistributionPoints")h=new i.CRLDistributionPoints(o);else if(l=="certificatePolicies")h=new i.CertificatePolicies(o);else if(l=="policyMappings")h=new i.PolicyMappings(o);else if(l=="policyConstraints")h=new i.PolicyConstraints(o);else if(l=="inhibitAnyPolicy")h=new i.InhibitAnyPolicy(o);else if(l=="authorityKeyIdentifier")h=new i.AuthorityKeyIdentifier(o);else if(l=="extKeyUsage")h=new i.ExtKeyUsage(o);else if(l=="authorityInfoAccess")h=new i.AuthorityInfoAccess(o);else if(l=="cRLNumber")h=new i.CRLNumber(o);else if(l=="cRLReason")h=new i.CRLReason(o);else if(l=="ocspNonce")h=new i.OCSPNonce(o);else if(l=="ocspNoCheck")h=new i.OCSPNoCheck(o);else if(l=="adobeTimeStamp")h=new i.AdobeTimeStamp(o);else if(l=="subjectDirectoryAttributes")h=new i.SubjectDirectoryAttributes(o);else throw new Error("extension not supported:"+JSON.stringify(o));h!=null&&a.push(h)}var d=new n({array:a});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.x509.Extensions,m.asn1.ASN1Object);m.asn1.x509.Extension=function(e){m.asn1.x509.Extension.superclass.constructor.call(this);var t=null,r=m,n=r.asn1,i=n.DERObjectIdentifier,a=n.DEROctetString,s=n.DERBitString,o=n.DERBoolean,l=n.DERSequence;this.tohex=function(){var h=new i({oid:this.oid}),d=new a({hex:this.getExtnValueHex()}),E=new Array;E.push(h),this.critical&&E.push(new o),E.push(d);var p=new l({array:E});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,e!==void 0&&e.critical!==void 0&&(this.critical=e.critical)};he(m.asn1.x509.Extension,m.asn1.ASN1Object);m.asn1.x509.KeyUsage=function(e){m.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=Error,r={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var n=this.getBinValue();return this.asn1ExtnValue=new m.asn1.DERBitString({bin:n}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var n=this.params;if(typeof n!="object"||typeof n.names!="object"&&typeof n.bin!="string")throw new t("parameter not yet set");if(n.names!=null)return lf(n.names,r);if(n.bin!=null)return n.bin;throw new t("parameter not set properly")},this.oid="2.5.29.15",e!==void 0&&(this.params=e)};he(m.asn1.x509.KeyUsage,m.asn1.x509.Extension);m.asn1.x509.BasicConstraints=function(e){m.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=m.asn1,r=t.DERBoolean,n=t.DERInteger,i=t.DERSequence,a=!1,s=-1;this.getExtnValueHex=function(){var o=new Array;this.cA&&o.push(new r),this.pathLen>-1&&o.push(new n({int:this.pathLen}));var l=new i({array:o});return this.asn1ExtnValue=l,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,e!==void 0&&(e.cA!==void 0&&(this.cA=e.cA),e.pathLen!==void 0&&(this.pathLen=e.pathLen))};he(m.asn1.x509.BasicConstraints,m.asn1.x509.Extension);m.asn1.x509.CRLDistributionPoints=function(e){m.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(i){for(var a=[],s=0;s<i.length;s++)if(i[s]instanceof m.asn1.ASN1Object)a.push(i[s]);else{var o=new n.DistributionPoint(i[s]);a.push(o)}this.asn1ExtnValue=new r.DERSequence({array:a})},this.setByOneURI=function(i){var a=new n.DistributionPoint({fulluri:i});this.setByDPArray([a])},this.oid="2.5.29.31",e!==void 0&&(e.array!==void 0?this.setByDPArray(e.array):e.uri!==void 0&&this.setByOneURI(e.uri))};he(m.asn1.x509.CRLDistributionPoints,m.asn1.x509.Extension);m.asn1.x509.DistributionPoint=function(e){m.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=null,r=m,n=r.asn1,i=n.x509.DistributionPointName;this.tohex=function(){var a=new n.DERSequence;if(this.asn1DP!=null){var s=new n.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});a.appendASN1Object(s)}return this.hTLV=a.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(e.dpobj!==void 0?this.asn1DP=e.dpobj:e.dpname!==void 0?this.asn1DP=new i(e.dpname):e.fulluri!==void 0&&(this.asn1DP=new i({full:[{uri:e.fulluri}]})))};he(m.asn1.x509.DistributionPoint,m.asn1.ASN1Object);m.asn1.x509.DistributionPointName=function(e){m.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=null,r=null,n=null,i=null,a=m,s=a.asn1,o=s.DERTaggedObject;if(this.tohex=function(){if(this.type!="full")throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new o({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0)if(s.x509.GeneralNames.prototype.isPrototypeOf(e))this.type="full",this.tag="a0",this.asn1V=e;else if(e.full!==void 0)this.type="full",this.tag="a0",this.asn1V=new s.x509.GeneralNames(e.full);else throw new Error("This class supports GeneralNames only as argument")};he(m.asn1.x509.DistributionPointName,m.asn1.ASN1Object);m.asn1.x509.CertificatePolicies=function(e){m.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.x509,i=r.DERSequence,a=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var s=[],o=0;o<this.params.array.length;o++)s.push(new a(this.params.array[o]));var l=new i({array:s});return this.asn1ExtnValue=l,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",e!==void 0&&(this.params=e)};he(m.asn1.x509.CertificatePolicies,m.asn1.x509.Extension);m.asn1.x509.PolicyInformation=function(e){m.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=m.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,i=t.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(this.params.policyoid===void 0&&this.params.array===void 0)throw new Error("parameter oid and array missing");var a=[new n(this.params.policyoid)];if(this.params.array!==void 0){for(var s=[],o=0;o<this.params.array.length;o++)s.push(new i(this.params.array[o]));s.length>0&&a.push(new r({array:s}))}var l=new r({array:a});return l.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};he(m.asn1.x509.PolicyInformation,m.asn1.ASN1Object);m.asn1.x509.PolicyQualifierInfo=function(e){m.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=m.asn1,r=t.DERSequence,n=t.DERIA5String,i=t.DERObjectIdentifier,a=t.x509.UserNotice;this.params=null,this.tohex=function(){if(this.params.cps!==void 0){var s=new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]});return s.tohex()}if(this.params.unotice!=null){var s=new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return s.tohex()}},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};he(m.asn1.x509.PolicyQualifierInfo,m.asn1.ASN1Object);m.asn1.x509.UserNotice=function(e){m.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=m.asn1.DERSequence,r=m.asn1.DERInteger,n=m.asn1.x509.DisplayText,i=m.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var a=[];this.params.noticeref!==void 0&&a.push(new i(this.params.noticeref)),this.params.exptext!==void 0&&a.push(new n(this.params.exptext));var s=new t({array:a});return s.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};he(m.asn1.x509.UserNotice,m.asn1.ASN1Object);m.asn1.x509.NoticeReference=function(e){m.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=m.asn1.DERSequence,r=m.asn1.DERInteger,n=m.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var i=[];if(this.params.org!==void 0&&i.push(new n(this.params.org)),this.params.noticenum!==void 0){for(var a=[],s=this.params.noticenum,o=0;o<s.length;o++)a.push(new r(s[o]));i.push(new t({array:a}))}if(i.length==0)throw new Error("parameter is empty");var l=new t({array:i});return l.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};he(m.asn1.x509.NoticeReference,m.asn1.ASN1Object);m.asn1.x509.DisplayText=function(e){m.asn1.x509.DisplayText.superclass.constructor.call(this,e),this.hT="0c",e!==void 0&&(e.type==="ia5"?this.hT="16":e.type==="vis"?this.hT="1a":e.type==="bmp"&&(this.hT="1e"))};he(m.asn1.x509.DisplayText,m.asn1.DERAbstractString);m.asn1.x509.PolicyMappings=function(e){m.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.x509,i=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){for(var a=this.params,s=[],o=0;o<a.array.length;o++){var l=a.array[o];s.push({seq:[{oid:l[0]},{oid:l[1]}]})}return this.asn1ExtnValue=i({seq:s}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",e!==void 0&&(this.params=e)};he(m.asn1.x509.PolicyMappings,m.asn1.x509.Extension);m.asn1.x509.PolicyConstraints=function(e){m.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.x509,i=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){var a=this.params,s=[];return a.reqexp!=null&&s.push({tag:{tagi:"80",obj:{int:a.reqexp}}}),a.inhibit!=null&&s.push({tag:{tagi:"81",obj:{int:a.inhibit}}}),this.asn1ExtnValue=i({seq:s}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",e!==void 0&&(this.params=e)};he(m.asn1.x509.PolicyConstraints,m.asn1.x509.Extension);m.asn1.x509.InhibitAnyPolicy=function(e){m.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.x509,i=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=i({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",e!==void 0&&(this.params=e)};he(m.asn1.x509.InhibitAnyPolicy,m.asn1.x509.Extension);m.asn1.x509.NameConstraints=function(e){m.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.x509,i=r.ASN1Util.newObject,a=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var s=this.params,o=[];if(s.permit!=null&&s.permit.length!=null){for(var l=[],h=0;h<s.permit.length;h++)l.push(new a(s.permit[h]));o.push({tag:{tagi:"a0",obj:{seq:l}}})}if(s.exclude!=null&&s.exclude.length!=null){for(var d=[],h=0;h<s.exclude.length;h++)d.push(new a(s.exclude[h]));o.push({tag:{tagi:"a1",obj:{seq:d}}})}return this.asn1ExtnValue=i({seq:o}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",e!==void 0&&(this.params=e)};he(m.asn1.x509.NameConstraints,m.asn1.x509.Extension);m.asn1.x509.GeneralSubtree=function(e){m.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=m.asn1,r=t.x509,n=r.GeneralName,i=t.ASN1Util.newObject;this.params=null,this.setByParam=function(a){this.params=a},this.tohex=function(){var a=this.params,s=[new n(a)];a.min!=null&&s.push({tag:{tagi:"80",obj:{int:a.min}}}),a.max!=null&&s.push({tag:{tagi:"81",obj:{int:a.max}}});var o=i({seq:s});return o.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.GeneralSubtree,m.asn1.ASN1Object);m.asn1.x509.ExtKeyUsage=function(e){m.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=m,r=t.asn1;this.setPurposeArray=function(n){this.asn1ExtnValue=new r.DERSequence;for(var i=0;i<n.length;i++){var a=new r.DERObjectIdentifier(n[i]);this.asn1ExtnValue.appendASN1Object(a)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",e!==void 0&&e.array!==void 0&&this.setPurposeArray(e.array)};he(m.asn1.x509.ExtKeyUsage,m.asn1.x509.Extension);m.asn1.x509.AuthorityKeyIdentifier=function(e){m.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.DERTaggedObject,i=r.x509.GeneralNames,a=t.crypto.Util.isKey;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var s=new Array;this.asn1KID&&s.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&s.push(new n({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&s.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var o=new r.DERSequence({array:s});return this.asn1ExtnValue=o,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(s){if(s.str!==void 0||s.hex!==void 0)this.asn1KID=new m.asn1.DEROctetString(s);else if(typeof s=="object"&&m.crypto.Util.isKey(s)||typeof s=="string"&&s.indexOf("BEGIN ")!=-1){var o=s;typeof s=="string"&&(o=at.getKey(s));var l=at.getKeyID(o);this.asn1KID=new m.asn1.DEROctetString({hex:l})}},this.setCertIssuerByParam=function(s){s.str!==void 0||s.ldapstr!==void 0||s.hex!==void 0||s.certsubject!==void 0||s.certissuer!==void 0?this.asn1CertIssuer=new m.asn1.x509.X500Name(s):typeof s=="string"&&s.indexOf("BEGIN ")!=-1&&s.indexOf("CERTIFICATE")!=-1&&(this.asn1CertIssuer=new m.asn1.x509.X500Name({certissuer:s}))},this.setCertSNByParam=function(s){if(s.str!==void 0||s.bigint!==void 0||s.hex!==void 0)this.asn1CertSN=new m.asn1.DERInteger(s);else if(typeof s=="string"&&s.indexOf("BEGIN ")!=-1&&s.indexOf("CERTIFICATE")){var o=new He;o.readCertPEM(s);var l=o.getSerialNumberHex();this.asn1CertSN=new m.asn1.DERInteger({hex:l})}},this.oid="2.5.29.35",e!==void 0&&(e.kid!==void 0&&this.setKIDByParam(e.kid),e.issuer!==void 0&&this.setCertIssuerByParam(e.issuer),e.sn!==void 0&&this.setCertSNByParam(e.sn),e.issuersn!==void 0&&typeof e.issuersn=="string"&&e.issuersn.indexOf("BEGIN ")!=-1&&e.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(e.issuersn),this.setCertIssuerByParam(e.issuersn)))};he(m.asn1.x509.AuthorityKeyIdentifier,m.asn1.x509.Extension);m.asn1.x509.SubjectKeyIdentifier=function(e){m.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(i){if(i.str!==void 0||i.hex!==void 0)this.asn1KID=new n(i);else if(typeof i=="object"&&m.crypto.Util.isKey(i)||typeof i=="string"&&i.indexOf("BEGIN")!=-1){var a=i;typeof i=="string"&&(a=at.getKey(i));var s=at.getKeyID(a);this.asn1KID=new m.asn1.DEROctetString({hex:s})}},this.oid="2.5.29.14",e!==void 0&&e.kid!==void 0&&this.setKIDByParam(e.kid)};he(m.asn1.x509.SubjectKeyIdentifier,m.asn1.x509.Extension);m.asn1.x509.AuthorityInfoAccess=function(e){m.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(t){for(var r=new Array,n=m,i=n.asn1,a=i.DERSequence,s=i.DERObjectIdentifier,o=i.x509.GeneralName,l=0;l<t.length;l++){var h,d=t[l];if(d.ocsp!==void 0)h=new a({array:[new s({oid:"1.3.6.1.5.5.7.48.1"}),new o({uri:d.ocsp})]});else if(d.caissuer!==void 0)h=new a({array:[new s({oid:"1.3.6.1.5.5.7.48.2"}),new o({uri:d.caissuer})]});else throw new Error("unknown AccessMethod parameter: "+JSON.stringify(d));r.push(h)}this.asn1ExtnValue=new a({array:r})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",e!==void 0&&e.array!==void 0&&this.setAccessDescriptionArray(e.array)};he(m.asn1.x509.AuthorityInfoAccess,m.asn1.x509.Extension);m.asn1.x509.SubjectAltName=function(e){m.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(t){this.asn1ExtnValue=new m.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",e!==void 0&&e.array!==void 0&&this.setNameArray(e.array)};he(m.asn1.x509.SubjectAltName,m.asn1.x509.Extension);m.asn1.x509.IssuerAltName=function(e){m.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(t){this.asn1ExtnValue=new m.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",e!==void 0&&e.array!==void 0&&this.setNameArray(e.array)};he(m.asn1.x509.IssuerAltName,m.asn1.x509.Extension);m.asn1.x509.SubjectDirectoryAttributes=function(e){m.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=m.asn1,r=t.DERSequence,n=t.ASN1Util.newObject,i=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var a=[],s=0;s<this.params.array.length;s++){var o=this.params.array[s];if(o.attr!=null&&o.array!=null){var l={seq:[{oid:o.attr},{set:o.array}]};a.push(n(l));continue}var h={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if(o.attr=="dateOfBirth")h.seq[0].oid=i(o.attr),h.seq[1].set[0]={gentime:o.str};else if(o.attr=="placeOfBirth")h.seq[0].oid=i(o.attr),h.seq[1].set[0]={utf8str:o.str};else if(o.attr=="gender")h.seq[0].oid=i(o.attr),h.seq[1].set[0]={prnstr:o.str};else if(o.attr=="countryOfCitizenship")h.seq[0].oid=i(o.attr),h.seq[1].set[0]={prnstr:o.str};else if(o.attr=="countryOfResidence")h.seq[0].oid=i(o.attr),h.seq[1].set[0]={prnstr:o.str};else throw new Error("unsupported attribute: "+o.attr);a.push(new n(h))}var d=new r({array:a});return this.asn1ExtnValue=d,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",e!==void 0&&(this.params=e)};he(m.asn1.x509.SubjectDirectoryAttributes,m.asn1.x509.Extension);m.asn1.x509.PrivateExtension=function(e){m.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=m,r=t.lang.String.isHex,n=t.asn1,i=n.x509.OID.name2oid,a=n.ASN1Util.newObject;this.params=null,this.setByParam=function(s){this.oid=i(s.extname),this.params=s},this.getExtnValueHex=function(){if(this.params.extname==null||this.params.extn==null)throw new Error("extname or extnhex not specified");var s=this.params.extn;if(typeof s=="string"&&r(s))return s;if(typeof s=="object")try{return a(s).tohex()}catch{}throw new Error("unsupported extn value")},e!=null&&this.setByParam(e)};he(m.asn1.x509.PrivateExtension,m.asn1.x509.Extension);m.asn1.x509.CRL=function(e){m.asn1.x509.CRL.superclass.constructor.call(this);var t=m,r=t.asn1,n=r.DERSequence,i=r.DERBitString,a=r.x509,s=a.AlgorithmIdentifier,o=a.TBSCertList;this.params=void 0,this.setByParam=function(l){this.params=l},this.sign=function(){var l=new o(this.params).tohex(),h=new m.crypto.Signature({alg:this.params.sigalg});h.init(this.params.cakey),h.updateHex(l);var d=h.sign();this.params.sighex=d},this.getPEM=function(){return Or(this.tohex(),"X509 CRL")},this.tohex=function(){var l=this.params;if(l.tbsobj==null&&(l.tbsobj=new o(l)),l.sighex==null&&l.cakey!=null&&this.sign(),l.sighex==null)throw new Error("sighex or cakey parameter not defined");var h=[];h.push(l.tbsobj),h.push(new s({name:l.sigalg})),h.push(new i({hex:"00"+l.sighex}));var d=new n({array:h});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&(this.params=e)};he(m.asn1.x509.CRL,m.asn1.ASN1Object);m.asn1.x509.TBSCertList=function(e){m.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=m,r=t.asn1,n=r.DERInteger,i=r.DERSequence,a=r.DERTaggedObject,s=r.DERObjectIdentifier,o=r.x509,l=o.AlgorithmIdentifier,h=o.Time,d=o.Extensions,E=o.X500Name;this.params=null,this.setByParam=function(p){this.params=p},this.getRevCertSequence=function(){for(var p=[],f=this.params.revcert,w=0;w<f.length;w++){var g=[new n(f[w].sn),new h(f[w].date)];f[w].ext!=null&&g.push(new d(f[w].ext)),p.push(new i({array:g}))}return new i({array:p})},this.tohex=function(){var p=[],f=this.params;if(f.version!=null){var w=f.version-1,g=new n({int:w});p.push(g)}if(p.push(new l({name:f.sigalg})),p.push(new E(f.issuer)),p.push(new h(f.thisupdate)),f.nextupdate!=null&&p.push(new h(f.nextupdate)),f.revcert!=null&&p.push(this.getRevCertSequence()),f.ext!=null){var y=new d(f.ext);p.push(new a({tag:"a0",explicit:!0,obj:y}))}var A=new i({array:p});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.TBSCertList,m.asn1.ASN1Object);m.asn1.x509.CRLEntry=function(e){m.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=null,r=null,n=m,i=n.asn1;this.setCertSerial=function(a){this.sn=new i.DERInteger(a)},this.setRevocationDate=function(a){this.time=new i.x509.Time(a)},this.tohex=function(){var a=new i.DERSequence({array:[this.sn,this.time]});return this.TLV=a.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(e.time!==void 0&&this.setRevocationDate(e.time),e.sn!==void 0&&this.setCertSerial(e.sn))};he(m.asn1.x509.CRLEntry,m.asn1.ASN1Object);m.asn1.x509.CRLNumber=function(e){m.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new m.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",e!=null&&(this.params=e)};he(m.asn1.x509.CRLNumber,m.asn1.x509.Extension);m.asn1.x509.CRLReason=function(e){m.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new m.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",e!=null&&(this.params=e)};he(m.asn1.x509.CRLReason,m.asn1.x509.Extension);m.asn1.x509.OCSPNonce=function(e){m.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new m.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",e!=null&&(this.params=e)};he(m.asn1.x509.OCSPNonce,m.asn1.x509.Extension);m.asn1.x509.OCSPNoCheck=function(e){m.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new m.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",e!=null&&(this.params=e)};he(m.asn1.x509.OCSPNoCheck,m.asn1.x509.Extension);m.asn1.x509.AdobeTimeStamp=function(e){m.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=m,r=t.asn1,n=r.DERInteger,i=r.DERBoolean,a=r.DERSequence,s=r.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var o=this.params,l=[new n(1)];return l.push(new s({uri:o.uri})),o.reqauth!=null&&l.push(new i(o.reqauth)),this.asn1ExtnValue=new a({array:l}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",e!==void 0&&this.setByParam(e)};he(m.asn1.x509.AdobeTimeStamp,m.asn1.x509.Extension);m.asn1.x509.X500Name=function(e){m.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=m,r=t.asn1,n=r.x509,i=n.RDN,a=kt;this.setByString=function(s,o){o!==void 0&&(this.sRule=o);var l=s.split("/");l.shift();for(var h=[],d=0;d<l.length;d++)if(l[d].match(/^[^=]+=.+$/))h.push(l[d]);else{var E=h.length-1;h[E]=h[E]+"/"+l[d]}for(var d=0;d<h.length;d++)this.asn1Array.push(new i({str:h[d],rule:this.sRule}))},this.setByLdapString=function(s,o){o!==void 0&&(this.sRule=o);var l=n.X500Name.ldapToCompat(s);this.setByString(l,o)},this.setByObject=function(s,o){o!==void 0&&(this.sRule=o);for(var l in s)if(s.hasOwnProperty(l)){var h=new i({str:l+"="+s[l],rule:this.sRule});this.asn1Array?this.asn1Array.push(h):this.asn1Array=[h]}},this.setByParam=function(s){if(s.rule!==void 0&&(this.sRule=s.rule),s.array!==void 0)this.paramArray=s.array;else if(s.str!==void 0)this.setByString(s.str);else if(s.ldapstr!==void 0)this.setByLdapString(s.ldapstr);else if(s.hex!==void 0)this.hTLV=s.hex;else if(s.certissuer!==void 0){var o=new He;o.readCertPEM(s.certissuer),this.hTLV=o.getIssuerHex()}else if(s.certsubject!==void 0){var o=new He;o.readCertPEM(s.certsubject),this.hTLV=o.getSubjectHex()}else typeof s=="object"&&s.certsubject===void 0&&s.certissuer===void 0&&this.setByObject(s)},this.tohex=function(){if(typeof this.hTLV=="string")return this.hTLV;if(this.asn1Array.length==0&&this.paramArray.length>0)for(var s=0;s<this.paramArray.length;s++){var o={array:this.paramArray[s]};this.sRule!="utf8"&&(o.rule=this.sRule);var l=new i(o);this.asn1Array.push(l)}var h=new r.DERSequence({array:this.asn1Array});return this.hTLV=h.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.X500Name,m.asn1.ASN1Object);m.asn1.x509.X500Name.compatToLDAP=function(e){if(e.substr(0,1)!=="/")throw"malformed input";var t="";e=e.substr(1);var r=e.split("/");return r.reverse(),r=r.map(function(n){return n.replace(/,/,"\\,")}),r.join(",")};m.asn1.x509.X500Name.onelineToLDAP=function(e){return m.asn1.x509.X500Name.compatToLDAP(e)};m.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),r=!1,n=[],i=0;t.length>0;i++){var a=t.shift();if(r===!0){var s=n.pop(),o=(s+","+a).replace(/\\,/g,",");n.push(o),r=!1}else n.push(a);a.substr(-1,1)==="\\"&&(r=!0)}return n=n.map(function(l){return l.replace("/","\\/")}),n.reverse(),"/"+n.join("/")};m.asn1.x509.X500Name.ldapToOneline=function(e){return m.asn1.x509.X500Name.ldapToCompat(e)};m.asn1.x509.RDN=function(e){m.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=m.asn1.x509.AttributeTypeAndValue;this.setByParam=function(r){r.rule!==void 0&&(this.sRule=r.rule),r.str!==void 0&&this.addByMultiValuedString(r.str),r.array!==void 0&&(this.paramArray=r.array)},this.addByString=function(r){this.asn1Array.push(new m.asn1.x509.AttributeTypeAndValue({str:r,rule:this.sRule}))},this.addByMultiValuedString=function(r){for(var n=m.asn1.x509.RDN.parseString(r),i=0;i<n.length;i++)this.addByString(n[i])},this.tohex=function(){if(this.asn1Array.length==0&&this.paramArray.length>0)for(var r=0;r<this.paramArray.length;r++){var n=this.paramArray[r];n.rule!==void 0&&this.sRule!="utf8"&&(n.rule=this.sRule);var i=new t(n);this.asn1Array.push(i)}var a=new m.asn1.DERSet({array:this.asn1Array});return this.TLV=a.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.RDN,m.asn1.ASN1Object);m.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),r=!1,n=[],i=0;t.length>0;i++){var a=t.shift();if(r===!0){var s=n.pop(),o=(s+"+"+a).replace(/\\\+/g,"+");n.push(o),r=!1}else n.push(a);a.substr(-1,1)==="\\"&&(r=!0)}for(var l=!1,h=[],i=0;n.length>0;i++){var a=n.shift();if(l===!0){var d=h.pop();if(a.match(/"$/)){var o=(d+"+"+a).replace(/^([^=]+)="(.*)"$/,"$1=$2");h.push(o),l=!1}else h.push(d+"+"+a)}else h.push(a);a.match(/^[^=]+="/)&&(l=!0)}return h};m.asn1.x509.AttributeTypeAndValue=function(e){m.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=m,r=t.asn1,n=r.DERSequence,i=r.DERUTF8String,a=r.DERPrintableString,s=r.DERTeletexString,o=r.DERIA5String,l=r.DERVisibleString,h=r.DERBMPString,d=t.lang.String.isMail,E=t.lang.String.isPrintable;this.setByParam=function(p){if(p.rule!==void 0&&(this.sRule=p.rule),p.ds!==void 0&&(this.dsType=p.ds),p.value===void 0&&p.str!==void 0){var f=p.str,w=f.match(/^([^=]+)=(.+)$/);if(w)this.sType=w[1],this.sValue=w[2];else throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}else this.sType=p.type,this.sValue=p.value},this.setByString=function(p,f){f!==void 0&&(this.sRule=f);var w=p.match(/^([^=]+)=(.+)$/);if(w)this.setByAttrTypeAndValueStr(w[1],w[2]);else throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)},this._getDsType=function(){var p=this.sType,f=this.sValue,w=this.sRule;return w==="prn"?p=="CN"&&d(f)?"ia5":E(f)?"prn":"utf8":w==="utf8"?p=="CN"&&d(f)?"ia5":p=="C"?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(p,f,w){w!==void 0&&(this.sRule=w),this.sType=p,this.sValue=f},this.getValueObj=function(p,f){if(p=="utf8")return new i({str:f});if(p=="prn")return new a({str:f});if(p=="tel")return new s({str:f});if(p=="ia5")return new o({str:f});if(p=="vis")return new l({str:f});if(p=="bmp")return new h({str:f});throw new Error("unsupported directory string type: type="+p+" value="+f)},this.tohex=function(){this.dsType==null&&(this.dsType=this._getDsType());var p=m.asn1.x509.OID.atype2obj(this.sType),f=this.getValueObj(this.dsType,this.sValue),w=new n({array:[p,f]});return this.TLV=w.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.AttributeTypeAndValue,m.asn1.ASN1Object);m.asn1.x509.SubjectPublicKeyInfo=function(e){m.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=null,r=null,n=m,i=n.asn1,a=i.DERInteger,s=i.DERBitString,o=i.DERObjectIdentifier,l=i.DERSequence,h=i.ASN1Util.newObject,d=i.x509,E=d.AlgorithmIdentifier,p=n.crypto,f=p.ECDSA,w=p.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null)throw"algId and/or subjPubKey not set";var g=new l({array:[this.asn1AlgId,this.asn1SubjPKey]});return g},this.tohex=function(){var g=this.getASN1Object();return this.hTLV=g.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(g){try{if(g instanceof ze){var y=h({seq:[{int:{bigint:g.n}},{int:{int:g.e}}]}),A=y.tohex();this.asn1AlgId=new E({name:"rsaEncryption"}),this.asn1SubjPKey=new s({hex:"00"+A})}}catch{}try{if(g instanceof m.crypto.ECDSA){var S=new o({name:g.curveName});this.asn1AlgId=new E({name:"ecPublicKey",asn1params:S}),this.asn1SubjPKey=new s({hex:"00"+g.pubKeyHex})}}catch{}try{if(g instanceof m.crypto.DSA){var S=new h({seq:[{int:{bigint:g.p}},{int:{bigint:g.q}},{int:{bigint:g.g}}]});this.asn1AlgId=new E({name:"dsa",asn1params:S});var _=new a({bigint:g.y});this.asn1SubjPKey=new s({hex:"00"+_.tohex()})}}catch{}},e!==void 0&&this.setPubKey(e)};he(m.asn1.x509.SubjectPublicKeyInfo,m.asn1.ASN1Object);m.asn1.x509.Time=function(e){m.asn1.x509.Time.superclass.constructor.call(this);var t=null,r=null,n=m,i=n.asn1,a=i.DERUTCTime,s=i.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(o){this.timeParams=o},this.setByParam=function(o){this.params=o},this.getType=function(o){return o.match(/^[0-9]{12}Z$/)?"utc":o.match(/^[0-9]{14}Z$/)?"gen":o.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":o.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var o=this.params,l=null;if(typeof o=="string"&&(o={str:o}),o!=null&&o.str&&(o.type==null||o.type==null)&&(o.type=this.getType(o.str)),o!=null&&o.str?(o.type=="utc"&&(l=new a(o.str)),o.type=="gen"&&(l=new s(o.str))):this.type=="gen"?l=new s:l=new a,l==null)throw new Error("wrong setting for Time");return this.TLV=l.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};m.asn1.x509.Time_bak=function(e){m.asn1.x509.Time_bak.superclass.constructor.call(this);var t=null,r=null,n=m,i=n.asn1,a=i.DERUTCTime,s=i.DERGeneralizedTime;this.setTimeParams=function(o){this.timeParams=o},this.tohex=function(){var o=null;return this.timeParams!=null?this.type=="utc"?o=new a(this.timeParams):o=new s(this.timeParams):this.type=="utc"?o=new a:o=new s,this.TLV=o.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",e!==void 0&&(e.type!==void 0?this.type=e.type:e.str!==void 0&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)};he(m.asn1.x509.Time,m.asn1.ASN1Object);m.asn1.x509.AlgorithmIdentifier=function(e){m.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=m,r=t.asn1,n=r.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(this.nameAlg===null&&this.asn1Alg===null)throw new Error("algorithm not specified");if(this.nameAlg!==null){var a=null;for(var s in n)s===this.nameAlg&&(a=n[s]);if(a!==null)return this.hTLV=a,this.hTLV}this.nameAlg!==null&&this.asn1Alg===null&&(this.asn1Alg=r.x509.OID.name2obj(this.nameAlg));var o=[this.asn1Alg];this.asn1Params!==null&&o.push(this.asn1Params);var l=new r.DERSequence({array:o});return this.hTLV=l.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(e.name!==void 0&&(this.nameAlg=e.name),e.asn1params!==void 0&&(this.asn1Params=e.asn1params),e.paramempty!==void 0&&(this.paramEmpty=e.paramempty)),this.asn1Params===null&&this.paramEmpty===!1&&this.nameAlg!==null){this.nameAlg.name!==void 0&&(this.nameAlg=this.nameAlg.name);var i=this.nameAlg.toLowerCase();i.substr(-7,7)!=="withdsa"&&i.substr(-9,9)!=="withecdsa"&&(this.asn1Params=new r.DERNull)}};he(m.asn1.x509.AlgorithmIdentifier,m.asn1.ASN1Object);m.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};m.asn1.x509.GeneralName=function(e){m.asn1.x509.GeneralName.superclass.constructor.call(this);var t={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87",otherName:"a0"},r=m,n=r.asn1,i=n.x509,a=i.X500Name,s=i.OtherName,o=n.DERIA5String,l=n.DERPrintableString,h=n.DEROctetString,d=n.DERTaggedObject,E=n.ASN1Object,p=Error;this.params=null,this.setByParam=function(f){this.params=f},this.tohex=function(){var f=this.params,w,y,g,y=!1;if(f.other!==void 0)w="a0",g=new s(f.other);else if(f.rfc822!==void 0)w="81",g=new o({str:f.rfc822});else if(f.dns!==void 0)w="82",g=new o({str:f.dns});else if(f.dn!==void 0)w="a4",y=!0,typeof f.dn=="string"?g=new a({str:f.dn}):f.dn instanceof m.asn1.x509.X500Name?g=f.dn:g=new a(f.dn);else if(f.ldapdn!==void 0)w="a4",y=!0,g=new a({ldapstr:f.ldapdn});else if(f.certissuer!==void 0||f.certsubj!==void 0){w="a4",y=!0;var A,S,_=null;if(f.certsubj!==void 0?(A=!1,S=f.certsubj):(A=!0,S=f.certissuer),S.match(/^[0-9A-Fa-f]+$/)&&_==S,S.indexOf("-----BEGIN ")!=-1&&(_=kt(S)),_==null)throw new Error("certsubj/certissuer not cert");var I=new He;I.hex=_;var D;A?D=I.getIssuerHex():D=I.getSubjectHex(),g=new E,g.hTLV=D}else if(f.uri!==void 0)w="86",g=new o({str:f.uri});else if(f.ip!==void 0){w="87";var H,V=f.ip;try{if(V.match(/^[0-9a-f]+$/)){var F=V.length;if(F==8||F==16||F==32||F==64)H=V;else throw"err"}else H=Ed(V)}catch(k){throw new p("malformed IP address: "+f.ip+":"+k.message)}g=new h({hex:H})}else throw new p("improper params");var P=new d({tag:w,explicit:y,obj:g});return P.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.GeneralName,m.asn1.ASN1Object);m.asn1.x509.GeneralNames=function(e){m.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=null,r=m,n=r.asn1;this.setByParamArray=function(i){for(var a=0;a<i.length;a++){var s=new n.x509.GeneralName(i[a]);this.asn1Array.push(s)}},this.tohex=function(){var i=new n.DERSequence({array:this.asn1Array});return i.tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,typeof e<"u"&&this.setByParamArray(e)};he(m.asn1.x509.GeneralNames,m.asn1.ASN1Object);m.asn1.x509.OtherName=function(e){m.asn1.x509.OtherName.superclass.constructor.call(this);var t=null,r=null,n=m,i=n.asn1,a=i.DERObjectIdentifier,s=i.DERSequence,o=i.ASN1Util.newObject;this.params=null,this.setByParam=function(l){this.params=l},this.tohex=function(){var l=this.params;if(l.oid==null||l.value==null)throw new Error("oid or value not specified");var h=new a({oid:l.oid}),d=o({tag:{tag:"a0",explicit:!0,obj:l.value}}),E=new s({array:[h,d]});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.x509.OtherName,m.asn1.ASN1Object);m.asn1.x509.OID=new function(){var e=m.asn1.DERObjectIdentifier;this.name2oidList={"aes128-CBC":"2.16.840.1.101.3.4.1.2","aes256-CBC":"2.16.840.1.101.3.4.1.42",sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",hmacWithSHA1:"1.2.840.113549.2.7",hmacWithSHA224:"1.2.840.113549.2.8",hmacWithSHA256:"1.2.840.113549.2.9",hmacWithSHA384:"1.2.840.113549.2.10",hmacWithSHA512:"1.2.840.113549.2.11",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]<"u")return this.objCache[t];if(typeof this.name2oidList[t]>"u")throw"Name of ObjectIdentifier not defined: "+t;var r=this.name2oidList[t],n=new e({oid:r});return this.objCache[t]=n,n},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var r;if(t.match(/^\d+\.\d+\.[0-9.]+$/))r=t;else if(this.atype2oidList[t]!==void 0)r=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)r=this.name2oidList[t];else throw new Error("AttributeType name undefined: "+t);var n=new e({oid:r});return this.objCache[t]=n,n},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var r in t)this.name2oidList[r]=t[r]},this.checkOIDs=function(t){try{var r=Object.keys(t);return r.length==0?!1:(r.map(function(n,i,a){var s=this[n];if(!s.match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")},t),!0)}catch{return!1}}};m.asn1.x509.OID.oid2name=function(e){var t=m.asn1.x509.OID.name2oidList;for(var r in t)if(t[r]==e)return r;return""};m.asn1.x509.OID.oid2atype=function(e){var t=m.asn1.x509.OID.atype2oidList;for(var r in t)if(t[r]==e)return r;return e};m.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=m.asn1.x509.OID.name2oidList;return t[e]===void 0?"":t[e]};m.asn1.x509.X509Util={};m.asn1.x509.X509Util.newCertPEM=function(e){var t=m.asn1.x509,r=t.TBSCertificate,n=t.Certificate,i=new n(e);return i.getPEM()};(typeof m>"u"||!m)&&(m={});(typeof m.asn1>"u"||!m.asn1)&&(m.asn1={});(typeof m.asn1.cms>"u"||!m.asn1.cms)&&(m.asn1.cms={});m.asn1.cms.Attribute=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.DERSet,s=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(o){this.params=o},this.getValueArray=function(){throw new t("not yet implemented abstract")},this.tohex=function(){var o=new s({oid:this.typeOid}),l=new a({array:this.getValueArray()}),h=new i({array:[o,l]});return h.tohex()},this.getEncodedHex=function(){return this.tohex()}};he(m.asn1.cms.Attribute,m.asn1.ASN1Object);m.asn1.cms.ContentType=function(e){var t=m,r=t.asn1;r.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){var n=new r.DERObjectIdentifier(this.params.type);return[n]},e!=null&&this.setByParam(e)};he(m.asn1.cms.ContentType,m.asn1.cms.Attribute);m.asn1.cms.MessageDigest=function(e){var t=m,r=t.asn1,n=r.DEROctetString,i=r.cms;i.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){var a=new n(this.params);return[a]},e!=null&&this.setByParam(e)};he(m.asn1.cms.MessageDigest,m.asn1.cms.Attribute);m.asn1.cms.SigningTime=function(e){var t=m,r=t.asn1;r.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){var n=new r.x509.Time(this.params);return[n]},e!=null&&this.setByParam(e)};he(m.asn1.cms.SigningTime,m.asn1.cms.Attribute);m.asn1.cms.SigningCertificate=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.cms,s=a.ESSCertID,o=r.crypto;a.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(this.params==null||this.params==null||this.params.array==null)throw new t("parameter 'array' not specified");for(var l=this.params.array,h=[],d=0;d<l.length;d++){var E=l[d];e.hasis==!1&&typeof E=="string"&&(E.indexOf("-----BEGIN")!=-1||Ae.isASN1HEX(E))&&(E={cert:E}),E.hasis!=!1&&e.hasis==!1&&(E.hasis=!1),h.push(new s(E))}var p=new i({array:h}),f=new i({array:[p]});return[f]},e!=null&&this.setByParam(e)};he(m.asn1.cms.SigningCertificate,m.asn1.cms.Attribute);m.asn1.cms.ESSCertID=function(e){m.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,r=m,n=r.asn1,i=n.DEROctetString,a=n.DERSequence,s=n.cms.IssuerSerial;this.params=null,this.getCertHash=function(o,l){if(o.hash!=null)return o.hash;if(typeof o=="string"&&o.indexOf("-----BEGIN")==-1&&!Ae.isASN1HEX(o))return o;var h;if(typeof o=="string")h=o;else if(o.cert!=null)h=o.cert;else throw new t("hash nor cert unspecified");var d;h.indexOf("-----BEGIN")!=-1?d=kt(h):d=h,typeof o=="string"&&(o.indexOf("-----BEGIN")!=-1?d=kt(o):Ae.isASN1HEX(o)&&(d=o));var E;if(o.alg!=null)E=o.alg;else if(l!=null)E=l;else throw new t("hash alg unspecified");return r.crypto.Util.hashHex(d,E)},this.tohex=function(){var o=this.params,l=this.getCertHash(o,"sha1"),h=[];h.push(new i({hex:l})),(typeof o=="string"&&o.indexOf("-----BEGIN")!=-1||o.cert!=null&&o.hasis!=!1||o.issuer!=null&&o.serial!=null)&&h.push(new s(o));var d=new a({array:h});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.ESSCertID,m.asn1.ASN1Object);m.asn1.cms.SigningCertificateV2=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.x509,s=n.cms,o=s.ESSCertIDv2,l=r.crypto;s.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(this.params==null||this.params==null||this.params.array==null)throw new t("parameter 'array' not specified");for(var h=this.params.array,d=[],E=0;E<h.length;E++){var p=h[E];(e.alg!=null||e.hasis==!1)&&typeof p=="string"&&(p.indexOf("-----BEGIN")!=-1||Ae.isASN1HEX(p))&&(p={cert:p}),p.alg==null&&e.alg!=null&&(p.alg=e.alg),p.hasis!=!1&&e.hasis==!1&&(p.hasis=!1),d.push(new o(p))}var f=new i({array:d}),w=new i({array:[f]});return[w]},e!=null&&this.setByParam(e)};he(m.asn1.cms.SigningCertificateV2,m.asn1.cms.Attribute);m.asn1.cms.ESSCertIDv2=function(e){m.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);var t=Error,r=m,n=r.asn1,i=n.DEROctetString,a=n.DERSequence,s=n.cms.IssuerSerial,o=n.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var l=this.params,h=this.getCertHash(l,"sha256"),d=[];l.alg!=null&&l.alg!="sha256"&&d.push(new o({name:l.alg})),d.push(new i({hex:h})),(typeof l=="string"&&l.indexOf("-----BEGIN")!=-1||l.cert!=null&&l.hasis!=!1||l.issuer!=null&&l.serial!=null)&&d.push(new s(l));var E=new a({array:d});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.ESSCertIDv2,m.asn1.cms.ESSCertID);m.asn1.cms.IssuerSerial=function(e){var t=Error,r=m,n=r.asn1,i=n.DERInteger,a=n.DERSequence,s=n.cms,o=n.x509,l=o.GeneralNames,h=He;s.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(d){this.params=d},this.tohex=function(){var d=this.params,E,p;if(typeof d=="string"&&d.indexOf("-----BEGIN")!=-1||d.cert!=null){var f;d.cert!=null?f=d.cert:f=d;var w=new h;w.readCertPEM(f),E=w.getIssuer(),p={hex:w.getSerialNumberHex()}}else if(d.issuer!=null&&d.serial)E=d.issuer,p=d.serial;else throw new t("cert or issuer and serial parameter not specified");var g=new l([{dn:E}]),y=new i(p),A=new a({array:[g,y]});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.IssuerSerial,m.asn1.ASN1Object);m.asn1.cms.SignerIdentifier=function(e){var t=m,r=t.asn1,n=r.DERInteger,i=r.DERSequence,a=r.cms,s=a.IssuerAndSerialNumber,o=a.SubjectKeyIdentifier,l=r.x509,h=l.X500Name,d=He,E=Error;a.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var p=this.params;if(p.type=="isssn"){var f=new s(p);return f.tohex()}else if(p.type=="skid"){var w=new o(p);return w.tohex()}else throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.SignerIdentifier,m.asn1.ASN1Object);m.asn1.cms.IssuerAndSerialNumber=function(e){var t=m,r=t.asn1,n=r.DERInteger,i=r.DERSequence,a=r.cms,s=r.x509,o=s.X500Name,l=He,h=Error;a.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params,E,p;if(typeof d=="string"&&d.indexOf("-----BEGIN")!=-1||d.cert!=null){var f;d.cert!=null?f=d.cert:f=d;var w=new l;w.readCertPEM(f),E=w.getIssuer(),p={hex:w.getSerialNumberHex()}}else if(d.issuer!=null&&d.serial)E=d.issuer,p=d.serial;else throw new h("cert or issuer and serial parameter not specified");var g=new o(E),y=new n(p),A=new i({array:[g,y]});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(d){this.params=d},e!=null&&this.setByParam(e)};he(m.asn1.cms.IssuerAndSerialNumber,m.asn1.ASN1Object);m.asn1.cms.SubjectKeyIdentifier=function(e){var t=m,r=t.asn1,n=r.DERInteger,i=r.DERSequence,a=r.ASN1Util.newObject,s=r.cms,o=s.IssuerAndSerialName,l=s.SubjectKeyIdentifier,h=r.x509,d=h.X500Name,E=He,p=Error;s.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var f=this.params;if(f.cert==null&&f.skid==null)throw new p("property cert nor skid undefined");var w;if(f.cert!=null){var g=new E(f.cert),y=g.getExtSubjectKeyIdentifier();w=y.kid.hex}else f.skid!=null&&(w=f.skid);var A=a({tag:{tage:"a0",obj:{octstr:{hex:w}}}});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.SubjectKeyIdentifier,m.asn1.ASN1Object);m.asn1.cms.AttributeList=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSet,a=n.cms;a.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(s){this.params=s},this.tohex=function(){var s=this.params;if(this.hTLV!=null)return this.hTLV;var o=!0;s.sortflag!=null&&(o=s.sortflag);for(var l=s.array,h=[],d=0;d<l.length;d++){var E=l[d],p=E.attr;if(p=="contentType")h.push(new a.ContentType(E));else if(p=="messageDigest")h.push(new a.MessageDigest(E));else if(p=="signingTime")h.push(new a.SigningTime(E));else if(p=="signingCertificate")h.push(new a.SigningCertificate(E));else if(p=="signingCertificateV2")h.push(new a.SigningCertificateV2(E));else if(p=="signaturePolicyIdentifier")h.push(new m.asn1.cades.SignaturePolicyIdentifier(E));else if(p=="signatureTimeStamp"||p=="timeStampToken")h.push(new m.asn1.cades.SignatureTimeStamp(E));else throw new t("unknown attr: "+p)}var f=new i({array:h,sortflag:o});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.AttributeList,m.asn1.ASN1Object);m.asn1.cms.SignerInfo=function(e){var t=Error,r=m,n=r.asn1,i=n.DERInteger,a=n.DEROctetString,s=n.DERSequence,o=n.DERTaggedObject,l=n.cms,h=l.SignerIdentifier,d=l.AttributeList,E=l.ContentType,p=l.EncapsulatedContentInfo,f=l.MessageDigest,w=l.SignedData,g=n.x509,y=g.AlgorithmIdentifier,A=r.crypto,S=at;l.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var _=this.params,I=_.sigalg,D=new d(_.sattrs).tohex(),H=S.getKey(_.signkey),V=new A.Signature({alg:I});V.init(H),V.updateHex(D);var F=V.sign();_.sighex=F},this.tohex=function(){var _=this.params,I=[];if(I.push(new i({int:_.version})),I.push(new h(_.id)),I.push(new y({name:_.hashalg})),_.sattrs!=null){var D=new d(_.sattrs);try{I.push(new o({tag:"a0",explicit:!1,obj:D}))}catch(V){throw new t("si sattr error: "+V)}}if(_.sigalgfield!=null?I.push(new y({name:_.sigalgfield})):I.push(new y({name:_.sigalg})),_.sighex==null&&_.signkey!=null&&this.sign(),I.push(new a({hex:_.sighex})),_.uattrs!=null){var D=new d(_.uattrs);try{I.push(new o({tag:"a1",explicit:!1,obj:D}))}catch(F){throw new t("si uattr error: "+F)}}var H=new s({array:I});return H.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.SignerInfo,m.asn1.ASN1Object);m.asn1.cms.EncapsulatedContentInfo=function(e){var t=m,r=t.asn1,n=r.DERTaggedObject,i=r.DERSequence,a=r.DERObjectIdentifier,s=r.DEROctetString,o=r.cms;o.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var l=this.params,h=[];if(h.push(new a(l.type)),l.content!=null&&(l.content.hex!=null||l.content.str!=null)&&l.isDetached!=!0){var d=new s(l.content),E=new n({tag:"a0",explicit:!0,obj:d});h.push(E)}var p=new i({array:h});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(l){this.params=l},e!=null&&this.setByParam(e)};he(m.asn1.cms.EncapsulatedContentInfo,m.asn1.ASN1Object);m.asn1.cms.ContentInfo=function(e){var t=m,r=t.asn1,n=r.DERTaggedObject,i=r.DERSequence,a=r.DERObjectIdentifier,s=r.x509,o=s.OID.name2obj;m.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var l=this.params,h=[];h.push(new a(l.type));var d=new n({tag:"a0",explicit:!0,obj:l.obj});h.push(d);var E=new i({array:h});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(l){this.params=l},e!=null&&this.setByParam(e)};he(m.asn1.cms.ContentInfo,m.asn1.ASN1Object);m.asn1.cms.SignedData=function(e){var t=Error,r=m,n=r.asn1,i=n.ASN1Object,a=n.DERInteger,s=n.DERSet,o=n.DERSequence,l=n.DERTaggedObject,h=n.cms,d=h.EncapsulatedContentInfo,E=h.SignerInfo,p=h.ContentInfo,f=h.CertificateSet,w=h.RevocationInfoChoices,g=n.x509,y=g.AlgorithmIdentifier;m.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var A=this.params;this._setDigestAlgs(A),this._setContentTypeByEContent(A),this._setMessageDigestByEContent(A),this._setSignerInfoVersion(A),this._setSignedDataVersion(A)},this._setDigestAlgs=function(A){for(var S={},_=A.sinfos,I=0;I<_.length;I++){var D=_[I];S[D.hashalg]=1}A.hashalgs=Object.keys(S).sort()},this._setContentTypeByEContent=function(A){for(var S=A.econtent.type,_=A.sinfos,I=0;I<_.length;I++){var D=_[I],H=this._getAttrParamByName(D,"contentType");H.type=S}},this._setMessageDigestByEContent=function(A){var S=A.econtent,_=A.econtent.type,I=S.content.hex;I==null&&S.type=="data"&&S.content.str!=null&&(I=Ii(S.content.str));for(var D=A.sinfos,H=0;H<D.length;H++){var V=D[H],F=V.hashalg,P=this._getAttrParamByName(V,"messageDigest"),k=m.crypto.Util.hashHex(I,F);P.hex=k}},this._getAttrParamByName=function(A,S){for(var _=A.sattrs.array,I=0;I<_.length;I++)if(_[I].attr==S)return _[I]},this._setSignerInfoVersion=function(A){for(var S=A.sinfos,_=0;_<S.length;_++){var I=S[_],D=1;I.id.type=="skid"&&(D=3),I.version=D}},this._setSignedDataVersion=function(A){var S=this._getSignedDataVersion(A);A.version=S},this._getSignedDataVersion=function(A){if(A.revinfos!=null)for(var S=A.revinfos,_=0;_<S.length;_++){var I=S[_];if(I.ocsp!=null)return 5}for(var D=A.sinfos,_=0;_<D.length;_++){var H=A.sinfos[_];if(H.version==3)return 3}return A.econtent.type!="data"?3:1},this.tohex=function(){var A=this.params;this.getEncodedHexPrepare!=null&&this.getEncodedHexPrepare(),A.fixed!=!0&&this.checkAndFixParam();var S=[];S.push(new a({int:A.version}));for(var _=[],I=0;I<A.hashalgs.length;I++){var D=A.hashalgs[I];_.push(new y({name:D}))}S.push(new s({array:_})),S.push(new d(A.econtent)),A.certs!=null&&S.push(new f(A.certs)),A.revinfos!=null&&S.push(new w(A.revinfos));for(var H=[],I=0;I<A.sinfos.length;I++){var V=A.sinfos[I];H.push(new E(V))}S.push(new s({array:H}));var F=new o({array:S});return F.tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){var A=new p({type:"signed-data",obj:this});return A},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.SignedData,m.asn1.ASN1Object);m.asn1.cms.CertificateSet=function(e){m.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,r=m.asn1,n=r.DERTaggedObject,i=r.DERSet,a=r.ASN1Object;this.params=null,this.tohex=function(){var s=this.params,o=[],l;if(s instanceof Array)l=s;else if(s.array!=null)l=s.array;else throw new t("cert array not specified");for(var h=0;h<l.length;h++){var d=l[h],E=kt(d),p=new a;p.hTLV=E,o.push(p)}var f={array:o};s.sortflag==!1&&(f.sortflag=!1);var w=new i(f),g=new n({tag:"a0",explicit:!1,obj:w});return g.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.CertificateSet,m.asn1.ASN1Object);m.asn1.cms.RevocationInfoChoices=function(e){m.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var r=[],n=0;n<t.length;n++)r.push(new m.asn1.cms.RevocationInfoChoice(t[n]));var i=m.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:r}}});return i.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.RevocationInfoChoices,m.asn1.ASN1Object);m.asn1.cms.RevocationInfoChoice=function(e){m.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(t.crl!=null&&typeof t.crl=="string"){var r=t.crl;return t.crl.indexOf("-----BEGIN")!=-1&&(r=kt(t.crl)),r}else if(t.ocsp!=null){var n=m.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new m.asn1.cms.OtherRevocationFormat(t)}});return n.tohex()}else throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.RevocationInfoChoice,m.asn1.ASN1Object);m.asn1.cms.OtherRevocationFormat=function(e){m.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,r=m,n=r.asn1,i=n.ASN1Util.newObject,a=r.lang.String.isHex;this.params=null,this.tohex=function(){var s=this.params;if(s.ocsp==null)throw new t("property ocsp not specified");if(!a(s.ocsp)||!Ae.isASN1HEX(s.ocsp))throw new t("ocsp value not ASN.1 hex string");var o=i({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:s.ocsp}}]});return o.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cms.OtherRevocationFormat,m.asn1.ASN1Object);m.asn1.cms.CMSUtil=new function(){};m.asn1.cms.CMSUtil.newSignedData=function(e){return new m.asn1.cms.SignedData(e)};m.asn1.cms.CMSUtil.verifySignedData=function(e){var t=m,r=t.asn1,n=r.cms,i=n.SignerInfo,a=n.SignedData,s=n.SigningTime,o=n.SigningCertificate,l=n.SigningCertificateV2,h=r.cades,d=h.SignaturePolicyIdentifier,E=t.lang.String.isHex,p=Ae,f=p.getVbyList,w=p.getTLVbyList,g=p.getIdxbyList,y=p.getChildIdx,A=p.getTLV,S=p.oidname,_=t.crypto.Util.hashHex;e.cms===void 0&&E(e.cms);var I=e.cms,D=function(K,X){for(var ie,be=3;be<6;be++)if(ie=g(K,0,[1,0,be]),ie!==void 0){var ye=K.substr(ie,2);ye==="a0"&&(X.certsIdx=ie),ye==="a1"&&(X.revinfosIdx=ie),ye==="31"&&(X.signerinfosIdx=ie)}},H=function(K,X){var ie=X.signerinfosIdx;if(ie!==void 0){var be=y(K,ie);X.signerInfoIdxList=be;for(var ye=0;ye<be.length;ye++){var $e=be[ye],qe={idx:$e};V(K,qe),X.signerInfos.push(qe)}}},V=function(K,X){var ie=X.idx;X.signerid_issuer1=w(K,ie,[1,0],"30"),X.signerid_serial1=f(K,ie,[1,1],"02"),X.hashalg=S(f(K,ie,[2,0],"06"));var be=g(K,ie,[3],"a0");X.idxSignedAttrs=be,F(K,X,be);var ye=y(K,ie),$e=ye.length;if($e<6)throw"malformed SignerInfo";X.sigalg=S(f(K,ie,[$e-2,0],"06")),X.sigval=f(K,ie,[$e-1],"04")},F=function(K,X,ie){var be=y(K,ie);X.signedAttrIdxList=be;for(var ye=0;ye<be.length;ye++){var $e=be[ye],qe=f(K,$e,[0],"06"),ce;qe==="2a864886f70d010905"?(ce=yt(f(K,$e,[1,0])),X.saSigningTime=ce):qe==="2a864886f70d010904"&&(ce=f(K,$e,[1,0],"04"),X.saMessageDigest=ce)}},P=function(K,X){if(f(K,0,[0],"06")!=="2a864886f70d010702")return X;X.cmsType="signedData",X.econtent=f(K,0,[1,0,2,1,0]),D(K,X),X.signerInfos=[],H(K,X)},k=function(K,X){for(var ie=X.parse.signerInfos,be=ie.length,ye=!0,$e=0;$e<be;$e++){var qe=ie[$e];q(K,X,qe,$e),qe.isValid||(ye=!1)}X.isValid=ye},L=function(K,X,ie,be){var ye=X.parse.certsIdx,$e;if(X.certs===void 0){$e=[],X.certkeys=[];for(var qe=y(K,ye),ce=0;ce<qe.length;ce++){var _e=A(K,qe[ce]),Le=new He;Le.readCertHex(_e),$e[ce]=Le,X.certkeys[ce]=Le.getPublicKey()}X.certs=$e}else $e=X.certs;X.cccc=$e.length,X.cccci=qe.length;for(var ce=0;ce<$e.length;ce++){var lr=Le.getIssuerHex(),Bt=Le.getSerialNumberHex();ie.signerid_issuer1===lr&&ie.signerid_serial1===Bt&&(ie.certkey_idx=ce)}},q=function(K,X,ie,be){ie.verifyDetail={};var ye=ie.verifyDetail,$e=X.parse.econtent,qe=ie.hashalg,ce=ie.saMessageDigest;ye.validMessageDigest=!1,_($e,qe)===ce&&(ye.validMessageDigest=!0),L(K,X,ie,be),ye.validSignatureValue=!1;var _e=ie.sigalg,Le="31"+A(K,ie.idxSignedAttrs).substr(2);ie.signedattrshex=Le;var lr=X.certs[ie.certkey_idx].getPublicKey(),Bt=new m.crypto.Signature({alg:_e});Bt.init(lr),Bt.updateHex(Le);var pt=Bt.verify(ie.sigval);ye.validSignatureValue_isValid=pt,pt===!0&&(ye.validSignatureValue=!0),ie.isValid=!1,ye.validMessageDigest&&ye.validSignatureValue&&(ie.isValid=!0)},J=function(){},z={isValid:!1,parse:{}};return P(I,z.parse),k(I,z),z};m.asn1.cms.CMSParser=function(){var e=Error,t=He,r=new t,n=Ae,i=n.getV,a=n.getTLV,s=n.getIdxbyList,o=n.getTLVbyList,l=n.getTLVbyListEx,h=n.getVbyList,d=n.getVbyListEx,E=n.getChildIdx;this.getCMSSignedData=function(p){var f=o(p,0,[1,0]),w=this.getSignedData(f);return w},this.getSignedData=function(p){var f=E(p,0),w={},g=i(p,f[0]),y=parseInt(g,16);w.version=y;var A=a(p,f[1]);w.hashalgs=this.getHashAlgArray(A);var S=a(p,f[2]);w.econtent=this.getEContent(S);var _=l(p,0,["[0]"]);_!=null&&(w.certs=this.getCertificateSet(_));var I=l(p,0,["[1]"]);I!=null;var D=l(p,0,[3]);return w.sinfos=this.getSignerInfos(D),w},this.getHashAlgArray=function(p){for(var f=E(p,0),w=new t,g=[],y=0;y<f.length;y++){var A=a(p,f[y]),S=w.getAlgorithmIdentifierName(A);g.push(S)}return g},this.getEContent=function(p){var f={},w=h(p,0,[0]),g=h(p,0,[1,0]);return f.type=m.asn1.x509.OID.oid2name(Ae.hextooidstr(w)),f.content={hex:g},f},this.getSignerInfos=function(p){for(var f=[],w=E(p,0),g=0;g<w.length;g++){var y=a(p,w[g]),A=this.getSignerInfo(y);f.push(A)}return f},this.getSignerInfo=function(p){var f={},w=E(p,0),g=n.getInt(p,w[0],-1);g!=-1&&(f.version=g);var y=a(p,w[1]),A=this.getIssuerAndSerialNumber(y);f.id=A;var S=a(p,w[2]),_=r.getAlgorithmIdentifierName(S);f.hashalg=_;var I=l(p,0,["[0]"]);if(I!=null){var D=this.getAttributeList(I);f.sattrs=D}var H=l(p,0,[3]),V=r.getAlgorithmIdentifierName(H);f.sigalg=V;var F=d(p,0,[4]);f.sighex=F;var P=l(p,0,["[1]"]);if(P!=null){var k=this.getAttributeList(P);f.uattrs=k}return f},this.getSignerIdentifier=function(p){if(p.substr(0,2)=="30")return this.getIssuerAndSerialNumber(p);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(p){var f={type:"isssn"},w=E(p,0),g=a(p,w[0]);f.issuer=r.getX500Name(g);var y=i(p,w[1]);return f.serial={hex:y},f},this.getAttributeList=function(p){for(var f=[],w=E(p,0),g=0;g<w.length;g++){var y=a(p,w[g]),A=this.getAttribute(y);f.push(A)}return{array:f}},this.getAttribute=function(p){var f={},w=E(p,0),g=n.getOID(p,w[0]),y=m.asn1.x509.OID.oid2name(g);f.attr=y;var A=a(p,w[1]),S=E(A,0);if(S.length==1)f.valhex=a(A,S[0]);else{for(var _=[],I=0;I<S.length;I++)_.push(a(A,S[I]));f.valhex=_}return y=="contentType"?this.setContentType(f):y=="messageDigest"?this.setMessageDigest(f):y=="signingTime"?this.setSigningTime(f):y=="signingCertificate"?this.setSigningCertificate(f):y=="signingCertificateV2"?this.setSigningCertificateV2(f):y=="signaturePolicyIdentifier"&&this.setSignaturePolicyIdentifier(f),f},this.setContentType=function(p){var f=n.getOIDName(p.valhex,0,null);f!=null&&(p.type=f,delete p.valhex)},this.setSigningTime=function(p){var f=i(p.valhex,0),w=yt(f);p.str=w,delete p.valhex},this.setMessageDigest=function(p){var f=i(p.valhex,0);p.hex=f,delete p.valhex},this.setSigningCertificate=function(p){var f=E(p.valhex,0);if(f.length>0){for(var w=a(p.valhex,f[0]),g=E(w,0),y=[],A=0;A<g.length;A++){var S=a(w,g[A]),_=this.getESSCertID(S);y.push(_)}p.array=y}if(f.length>1){var I=a(p.valhex,f[1]);p.polhex=I}delete p.valhex},this.setSignaturePolicyIdentifier=function(p){var f=E(p.valhex,0);if(f.length>0){var w=n.getOID(p.valhex,f[0]);p.oid=w}if(f.length>1){var g=new t,y=E(p.valhex,f[1]),A=a(p.valhex,y[0]),S=g.getAlgorithmIdentifierName(A);p.alg=S;var _=i(p.valhex,y[1]);p.hash=_}delete p.valhex},this.setSigningCertificateV2=function(p){var f=E(p.valhex,0);if(f.length>0){for(var w=a(p.valhex,f[0]),g=E(w,0),y=[],A=0;A<g.length;A++){var S=a(w,g[A]),_=this.getESSCertIDv2(S);y.push(_)}p.array=y}if(f.length>1){var I=a(p.valhex,f[1]);p.polhex=I}delete p.valhex},this.getESSCertID=function(p){var f={},w=E(p,0);if(w.length>0){var g=i(p,w[0]);f.hash=g}if(w.length>1){var y=a(p,w[1]),A=this.getIssuerSerial(y);A.serial!=null&&(f.serial=A.serial),A.issuer!=null&&(f.issuer=A.issuer)}return f},this.getESSCertIDv2=function(p){var f={},w=E(p,0);if(w.length<1||3<w.length)throw new e("wrong number of elements");var g=0;if(p.substr(w[0],2)=="30"){var y=a(p,w[0]);f.alg=r.getAlgorithmIdentifierName(y),g++}else f.alg="sha256";var A=i(p,w[g]);if(f.hash=A,w.length>g+1){var S=a(p,w[g+1]),_=this.getIssuerSerial(S);f.issuer=_.issuer,f.serial=_.serial}return f},this.getIssuerSerial=function(p){var f={},w=E(p,0),g=a(p,w[0]),y=r.getGeneralNames(g),A=y[0].dn;f.issuer=A;var S=i(p,w[1]);return f.serial={hex:S},f},this.getCertificateSet=function(p){for(var f=E(p,0),w=[],g=0;g<f.length;g++){var y=a(p,f[g]);if(y.substr(0,2)=="30"){var A=Or(y,"CERTIFICATE");w.push(A)}}return{array:w,sortflag:!1}}};(typeof m>"u"||!m)&&(m={});(typeof m.asn1>"u"||!m.asn1)&&(m.asn1={});(typeof m.asn1.tsp>"u"||!m.asn1.tsp)&&(m.asn1.tsp={});m.asn1.tsp.TimeStampToken=function(e){var t=m,r=t.asn1,n=r.tsp;n.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var i=new n.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=i.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.TimeStampToken,m.asn1.cms.SignedData);m.asn1.tsp.TSTInfo=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.DERInteger,s=n.DERBoolean,o=n.DERGeneralizedTime,l=n.DERObjectIdentifier,h=n.DERTaggedObject,d=n.tsp,E=d.MessageImprint,p=d.Accuracy,f=n.x509.X500Name,w=n.x509.GeneralName;if(d.TSTInfo.superclass.constructor.call(this),this.dVersion=new a({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var g=[this.dVersion];if(this.dPolicy==null)throw new Error("policy shall be specified.");if(g.push(this.dPolicy),this.dMessageImprint==null)throw new Error("messageImprint shall be specified.");if(g.push(this.dMessageImprint),this.dSerial==null)throw new Error("serialNumber shall be specified.");if(g.push(this.dSerial),this.dGenTime==null)throw new Error("genTime shall be specified.");g.push(this.dGenTime),this.dAccuracy!=null&&g.push(this.dAccuracy),this.dOrdering!=null&&g.push(this.dOrdering),this.dNonce!=null&&g.push(this.dNonce),this.dTsa!=null&&g.push(this.dTsa);var y=new i({array:g});return this.hTLV=y.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0){if(typeof e.policy=="string"){if(!e.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new l({oid:e.policy})}e.messageImprint!==void 0&&(this.dMessageImprint=new E(e.messageImprint)),e.serial!==void 0&&(this.dSerial=new a(e.serial)),e.genTime!==void 0&&(this.dGenTime=new o(e.genTime)),e.accuracy!==void 0&&(this.dAccuracy=new p(e.accuracy)),e.ordering!==void 0&&e.ordering==!0&&(this.dOrdering=new s),e.nonce!==void 0&&(this.dNonce=new a(e.nonce)),e.tsa!==void 0&&(this.dTsa=new h({tag:"a0",explicit:!0,obj:new w({dn:e.tsa})}))}};he(m.asn1.tsp.TSTInfo,m.asn1.ASN1Object);m.asn1.tsp.Accuracy=function(e){var t=m,r=t.asn1,n=r.ASN1Util.newObject;r.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var i=this.params,a=[];return i.seconds!=null&&typeof i.seconds=="number"&&a.push({int:i.seconds}),i.millis!=null&&typeof i.millis=="number"&&a.push({tag:{tagi:"80",obj:{int:i.millis}}}),i.micros!=null&&typeof i.micros=="number"&&a.push({tag:{tagi:"81",obj:{int:i.micros}}}),n({seq:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.Accuracy,m.asn1.ASN1Object);m.asn1.tsp.MessageImprint=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.DEROctetString,a=r.x509,s=a.AlgorithmIdentifier;r.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var o=this.params,l=new s({name:o.alg}),h=new i({hex:o.hash}),d=new n({array:[l,h]});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.tsp.MessageImprint,m.asn1.ASN1Object);m.asn1.tsp.TimeStampReq=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.DERInteger,a=r.DERBoolean,s=r.ASN1Object,o=r.DERObjectIdentifier,l=r.tsp,h=l.MessageImprint;l.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params,E=[];E.push(new i({int:1})),d.messageImprint instanceof m.asn1.ASN1Object?E.push(d.messageImprint):E.push(new h(d.messageImprint)),d.policy!=null&&E.push(new o(d.policy)),d.nonce!=null&&E.push(new i(d.nonce)),d.certreq==!0&&E.push(new a);var p=new n({array:E});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.TimeStampReq,m.asn1.ASN1Object);m.asn1.tsp.TimeStampResp=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.ASN1Object,a=r.tsp,s=a.PKIStatusInfo;a.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var o=this.params,l=[];if(o.econtent!=null||o.tst!=null)if(o.statusinfo!=null?l.push(new s(o.statusinfo)):l.push(new s("granted")),o.econtent!=null)l.push(new a.TimeStampToken(o).getContentInfo());else if(o.tst instanceof r.ASN1Object)l.push(o.tst);else throw new Error("improper member tst value");else if(o.statusinfo!=null)l.push(new s(o.statusinfo));else throw new Error("parameter for token nor statusinfo not specified");var h=new n({array:l});return h.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.TimeStampResp,m.asn1.ASN1Object);m.asn1.tsp.PKIStatusInfo=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.tsp,s=a.PKIStatus,o=a.PKIFreeText,l=a.PKIFailureInfo;a.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var h=this.params,d=[];if(typeof h=="string")d.push(new s(h));else{if(h.status==null)throw new t("property 'status' unspecified");d.push(new s(h.status)),h.statusstr!=null&&d.push(new o(h.statusstr)),h.failinfo!=null&&d.push(new l(h.failinfo))}var E=new i({array:d});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.PKIStatusInfo,m.asn1.ASN1Object);m.asn1.tsp.PKIStatus=function(e){var t=Error,r=m,n=r.asn1,i=n.DERInteger,a=n.tsp;a.PKIStatus.superclass.constructor.call(this);var s={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var o=this.params,l,h;if(typeof o=="string")try{h=s[o]}catch{throw new t("undefined name: "+o)}else if(typeof o=="number")h=o;else throw new t("unsupported params");return new i({int:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.PKIStatus,m.asn1.ASN1Object);m.asn1.tsp.PKIFreeText=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.DERUTF8String,s=n.tsp;s.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var o=this.params;if(!o instanceof Array)throw new t("wrong params: not array");for(var l=[],h=0;h<o.length;h++)l.push(new a({str:o[h]}));var d=new i({array:l});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.PKIFreeText,m.asn1.ASN1Object);m.asn1.tsp.PKIFailureInfo=function(e){var t=Error,r=m,n=r.asn1,i=n.DERBitString,a=n.tsp,s=a.PKIFailureInfo,o={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};s.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var l=this.params,h=0;if(typeof l=="number"&&0<=l&&l<=25){h|=1<<l;for(var d=h.toString(2),E="",p=d.length-1;p>=0;p--)E+=d[p];return E}else{if(typeof l=="string"&&o[l]!=null)return lf([l],o);if(typeof l=="object"&&l.length!=null)return lf(l,o);throw new t("wrong params")}},this.tohex=function(){var l=this.params,h=this.getBinValue();return new i({bin:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.tsp.PKIFailureInfo,m.asn1.ASN1Object);m.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(t,r){throw"not implemented yet"}};m.asn1.tsp.SimpleTSAAdapter=function(e){var t=m,r=t.asn1,n=r.tsp,i=t.crypto.Util.hashHex;n.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(a,s){var o=i(a,s);this.params.econtent.content.messageImprint={alg:s,hash:o},this.params.econtent.content.serial={int:this.serial++};var l=Math.floor(Math.random()*1e9);this.params.econtent.content.nonce={int:l};var h=new n.TimeStampToken(this.params);return h.getContentInfoEncodedHex()},e!==void 0&&(this.params=e)};he(m.asn1.tsp.SimpleTSAAdapter,m.asn1.tsp.AbstractTSAAdapter);m.asn1.tsp.FixedTSAAdapter=function(e){var t=m,r=t.asn1,n=r.tsp,i=t.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(a,s){var o=i(a,s);this.params.econtent.content.messageImprint={alg:s,hash:o};var l=new n.TimeStampToken(this.params);return l.getContentInfoEncodedHex()},e!==void 0&&(this.params=e)};he(m.asn1.tsp.FixedTSAAdapter,m.asn1.tsp.AbstractTSAAdapter);m.asn1.tsp.TSPUtil=new function(){};m.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new m.asn1.tsp.TimeStampToken(e)};m.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){var t=new m.asn1.tsp.TSPParser;return t.getTimeStampReq(e)};m.asn1.tsp.TSPUtil.parseMessageImprint=function(e){var t=new m.asn1.tsp.TSPParser;return t.getMessageImprint(e)};m.asn1.tsp.TSPParser=function(){var e=Error,t=He,r=new t,n=Ae,i=n.getV,a=n.getTLV,s=n.getIdxbyList,o=n.getTLVbyListEx,l=n.getChildIdx,h=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],d={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(E){var p=l(E,0);if(p.length==1)return this.getPKIStatusInfo(a(E,p[0]));if(p.length>1){var f=this.getPKIStatusInfo(a(E,p[0])),w=a(E,p[1]),g=this.getToken(w);return g.statusinfo=f,g}},this.getToken=function(E){var p=new m.asn1.cms.CMSParser,f=p.getCMSSignedData(E);return this.setTSTInfo(f),f},this.setTSTInfo=function(E){var p=E.econtent;if(p.type=="tstinfo"){var f=p.content.hex,w=this.getTSTInfo(f);p.content=w}},this.getTSTInfo=function(E){var p={},f=l(E,0),w=i(E,f[1]);p.policy=Af(w);var g=a(E,f[2]);p.messageImprint=this.getMessageImprint(g);var y=i(E,f[3]);p.serial={hex:y};var A=i(E,f[4]);p.genTime={str:yt(A)};var S=0;if(f.length>5&&E.substr(f[5],2)=="30"){var _=a(E,f[5]);p.accuracy=this.getAccuracy(_),S++}if(f.length>5+S&&E.substr(f[5+S],2)=="01"){var I=i(E,f[5+S]);I=="ff"&&(p.ordering=!0),S++}if(f.length>5+S&&E.substr(f[5+S],2)=="02"){var D=i(E,f[5+S]);p.nonce={hex:D},S++}if(f.length>5+S&&E.substr(f[5+S],2)=="a0"){var H=a(E,f[5+S]);H="30"+H.substr(2),pGeneralNames=r.getGeneralNames(H);var V=pGeneralNames[0].dn;p.tsa=V,S++}if(f.length>5+S&&E.substr(f[5+S],2)=="a1"){var F=a(E,f[5+S]);F="30"+F.substr(2);var P=r.getExtParamArray(F);p.ext=P,S++}return p},this.getAccuracy=function(E){for(var p={},f=l(E,0),w=0;w<f.length;w++){var g=E.substr(f[w],2),y=i(E,f[w]),A=parseInt(y,16);g=="02"?p.seconds=A:g=="80"?p.millis=A:g=="81"&&(p.micros=A)}return p},this.getMessageImprint=function(E){if(E.substr(0,2)!="30")throw new Error("head of messageImprint hex shall be x30");var p={},f=l(E,0),w=s(E,0,[0,0]),g=i(E,w),y=n.hextooidstr(g),A=m.asn1.x509.OID.oid2name(y);if(A=="")throw new Error("hashAlg name undefined: "+y);var S=A,_=s(E,0,[1]);return p.alg=S,p.hash=i(E,_),p},this.getPKIStatusInfo=function(E){var p={},f=l(E,0),w=0;try{var g=i(E,f[0]),y=parseInt(g,16);p.status=h[y]}catch{}if(f.length>1&&E.substr(f[1],2)=="30"){var A=a(E,f[1]);p.statusstr=this.getPKIFreeText(A),w++}if(f.length>w&&E.substr(f[1+w],2)=="03"){var S=a(E,f[1+w]);p.failinfo=this.getPKIFailureInfo(S)}return p},this.getPKIFreeText=function(E){for(var p=[],f=l(E,0),w=0;w<f.length;w++)p.push(n.getString(E,f[w]));return p},this.getPKIFailureInfo=function(E){var p=n.getInt(E,0);return d[p]!=null?d[p]:p},this.getTimeStampReq=function(E){var p={};p.certreq=!1;var f=l(E,0);if(f.length<2)throw new Error("TimeStampReq must have at least 2 items");var w=a(E,f[1]);p.messageImprint=m.asn1.tsp.TSPUtil.parseMessageImprint(w);for(var g=2;g<f.length;g++){var y=f[g],A=E.substr(y,2);if(A=="06"){var S=i(E,y);p.policy=n.hextooidstr(S)}A=="02"&&(p.nonce=i(E,y)),A=="01"&&(p.certreq=!0)}return p}};(typeof m>"u"||!m)&&(m={});(typeof m.asn1>"u"||!m.asn1)&&(m.asn1={});(typeof m.asn1.cades>"u"||!m.asn1.cades)&&(m.asn1.cades={});m.asn1.cades.SignaturePolicyIdentifier=function(e){var t=m,r=t.asn1,n=r.cades,i=n.SignaturePolicyId;n.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new i(this.params)]},this.setByParam=function(a){this.params=a},e!=null&&this.setByParam(e)};he(m.asn1.cades.SignaturePolicyIdentifier,m.asn1.cms.Attribute);m.asn1.cades.SignaturePolicyId=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.DERObjectIdentifier,a=r.x509,s=a.AlgorithmIdentifier,o=r.cades,l=o.SignaturePolicyId,h=o.OtherHashAlgAndValue;l.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params,E=[];E.push(new i(d.oid)),E.push(new h(d));var p=new n({array:E});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(d){this.params=d},e!=null&&this.setByParam(e)};he(m.asn1.cades.SignaturePolicyId,m.asn1.ASN1Object);m.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.DEROctetString,s=n.x509,o=s.AlgorithmIdentifier,l=n.cades,h=l.OtherHashAlgAndValue;h.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params;if(d.alg==null)throw new t("property 'alg' not specified");if(d.hash==null&&d.cert==null)throw new t("property 'hash' nor 'cert' not specified");var E=null;if(d.hash!=null)E=d.hash;else if(d.cert!=null){if(typeof d.cert!="string")throw new t("cert not string");var p=d.cert;d.cert.indexOf("-----BEGIN")!=-1&&(p=kt(d.cert)),E=m.crypto.Util.hashHex(p,d.alg)}var f=[];f.push(new o({name:d.alg})),f.push(new a({hex:E}));var w=new i({array:f});return w.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cades.OtherHashAlgAndValue,m.asn1.ASN1Object);m.asn1.cades.OtherHashValue=function(e){m.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,r=m,n=r.lang.String.isHex,i=r.asn1,a=i.DEROctetString,s=r.crypto.Util.hashHex;this.params=null,this.tohex=function(){var o=this.params;if(o.hash==null&&o.cert==null)throw new t("hash or cert not specified");var l=null;if(o.hash!=null)l=o.hash;else if(o.cert!=null){if(typeof o.cert!="string")throw new t("cert not string");var h=o.cert;o.cert.indexOf("-----BEGIN")!=-1&&(h=kt(o.cert)),l=m.crypto.Util.hashHex(h,"sha1")}return new a({hex:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cades.OtherHashValue,m.asn1.ASN1Object);m.asn1.cades.SignatureTimeStamp=function(e){var t=Error,r=m,n=r.lang.String.isHex,i=r.asn1,a=i.ASN1Object,s=i.x509,o=i.cades;o.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var l=this.params;if(l.tst!=null)if(n(l.tst)){var h=new a;return h.hTLV=l.tst,[h]}else{if(l.tst instanceof a)return[l.tst];throw new t("params.tst has wrong value")}else if(l.res!=null){var d=l.res;if(d instanceof a&&(d=d.tohex()),typeof d!="string"||!n(d))throw new t("params.res has wrong value");var E=Ae.getTLVbyList(d,0,[1]),h=new a;return h.hTLV=l.tst,[h]}},e!=null&&this.setByParam(e)};he(m.asn1.cades.SignatureTimeStamp,m.asn1.cms.Attribute);m.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.cades,s=a.OtherCertID,o=r.lang.String.isHex;a.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var l=this.params,h=[],d=0;d<l.array.length;d++){var E=l.array[d];if(typeof E=="string")if(E.indexOf("-----BEGIN")!=-1)E={cert:E};else if(o(E))E={hash:E};else throw new t("unsupported value: "+E);l.alg!=null&&E.alg==null&&(E.alg=l.alg),l.hasis!=null&&E.hasis==null&&(E.hasis=l.hasis);var p=new s(E);h.push(p)}var f=new i({array:h});return[f]},e!=null&&this.setByParam(e)};he(m.asn1.cades.CompleteCertificateRefs,m.asn1.cms.Attribute);m.asn1.cades.OtherCertID=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.cms,a=i.IssuerSerial,s=r.cades,o=s.OtherHashValue,l=s.OtherHashAlgAndValue;s.OtherCertID.superclass.constructor.call(this),this.params=e,this.tohex=function(){var h=this.params;typeof h=="string"&&(h.indexOf("-----BEGIN")!=-1?h={cert:h}:_isHex(h)&&(h={hash:h}));var d=[],E=null;if(h.alg!=null?E=new l(h):E=new o(h),d.push(E),h.cert!=null&&h.hasis==!0||h.issuer!=null&&h.serial!=null){var p=new a(h);d.push(p)}var f=new n({array:d});return f.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cades.OtherCertID,m.asn1.ASN1Object);m.asn1.cades.OtherHash=function(e){var t=Error,r=m,n=r.asn1,i=n.cms,a=n.cades,s=a.OtherHashAlgAndValue,o=a.OtherHashValue,l=r.crypto.Util.hashHex,h=r.lang.String.isHex;a.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params;typeof d=="string"&&(d.indexOf("-----BEGIN")!=-1?d={cert:d}:h(d)&&(d={hash:d}));var E=null;return d.alg!=null?E=new s(d):E=new o(d),E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};he(m.asn1.cades.OtherHash,m.asn1.ASN1Object);m.asn1.cades.CAdESUtil=new function(){};m.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){var t=new m.asn1.cms.CMSParser,r=t.getCMSSignedData(e);return r};m.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,r){var n=Ae,i=n.getChildIdx,a=n.getTLV,s=n.getV,o=m,l=o.asn1,h=l.ASN1Object,d=l.cms,E=d.AttributeList,p=d.SignerInfo,f={},w=i(e,t);if(w.length!=6)throw"not supported items for SignerInfo (!=6)";var g=w.shift();f.version=a(e,g);var y=w.shift();f.si=a(e,y);var A=w.shift();f.digalg=a(e,A);var S=w.shift();f.sattrs=a(e,S);var _=w.shift();f.sigalg=a(e,_);var I=w.shift();f.sig=a(e,I),f.sigval=s(e,I);var D=null;return f.obj=new p,D=new h,D.hTLV=f.version,f.obj.dCMSVersion=D,D=new h,D.hTLV=f.si,f.obj.dSignerIdentifier=D,D=new h,D.hTLV=f.digalg,f.obj.dDigestAlgorithm=D,D=new h,D.hTLV=f.sattrs,f.obj.dSignedAttrs=D,D=new h,D.hTLV=f.sigalg,f.obj.dSigAlg=D,D=new h,D.hTLV=f.sig,f.obj.dSig=D,f.obj.dUnsignedAttrs=new E,f};(typeof m.asn1.csr>"u"||!m.asn1.csr)&&(m.asn1.csr={});m.asn1.csr.CertificationRequest=function(e){var t=m,r=t.asn1,n=r.DERBitString,i=r.DERSequence,a=r.csr,s=r.x509,o=a.CertificationRequestInfo;a.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(l){this.params=l},this.sign=function(){var l=new o(this.params).tohex(),h=new m.crypto.Signature({alg:this.params.sigalg});h.init(this.params.sbjprvkey),h.updateHex(l);var d=h.sign();this.params.sighex=d},this.getPEM=function(){return Or(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var l=this.params,h=new m.asn1.csr.CertificationRequestInfo(this.params),d=new m.asn1.x509.AlgorithmIdentifier({name:l.sigalg});if(l.sighex==null&&l.sbjprvkey!=null&&this.sign(),l.sighex==null)throw new Error("sighex or sbjprvkey parameter not defined");var E=new n({hex:"00"+l.sighex}),p=new i({array:[h,d,E]});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.csr.CertificationRequest,m.asn1.ASN1Object);m.asn1.csr.CertificationRequestInfo=function(e){var t=m,r=t.asn1,n=r.DERBitString,i=r.DERSequence,a=r.DERInteger,s=r.DERUTF8String,o=r.DERTaggedObject,l=r.ASN1Util.newObject,h=r.csr,d=r.x509,E=d.X500Name,p=d.Extensions,f=d.SubjectPublicKeyInfo,w=h.AttributeList;h.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(y){y!=null&&(this.params=y)},this.tohex=function(){var y=this.params,A=[];if(A.push(new a({int:0})),A.push(new E(y.subject)),A.push(new f(at.getKey(y.sbjpubkey))),y.attrs!=null){var S=g(y.attrs),_=l({tag:{tage:"a0",obj:S}});A.push(_)}else if(y.extreq!=null){var I=new p(y.extreq),_=l({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[I]}]}}});A.push(_)}else A.push(new o({tag:"a0",explicit:!1,obj:new s({str:""})}));var D=new i({array:A});return D.tohex()},this.getEncodedHex=function(){return this.tohex()};function g(y){for(var A=Error,S=m.asn1.x509.Extensions,_=[],I=0;I<y.length;I++){var D=y[I],H=D.attr;if(H=="extensionRequest"){var V=new S(D.ext),F={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[V]}]};_.push(F)}else if(H=="unstructuredName"){var F={seq:[{oid:"1.2.840.113549.1.9.2"},{set:D.names}]};_.push(F)}else if(H=="challengePassword"){var F={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:D.password}]}]};_.push(F)}else throw new A("unknown CSR attribute")}return{set:_}}e!=null&&this.setByParam(e)};he(m.asn1.csr.CertificationRequestInfo,m.asn1.ASN1Object);m.asn1.csr.AttributeList=function(e){function t(r){}};he(m.asn1.csr.AttributeList,m.asn1.ASN1Object);m.asn1.csr.CSRUtil=new function(){};m.asn1.csr.CSRUtil.newCSRPEM=function(e){var t=at,r=m.asn1.csr,n=new r.CertificationRequest(e),i=n.getPEM();return i};m.asn1.csr.CSRUtil.getParam=function(e,t){var r=Ae,n=r.getV,i=r.getIdxbyList,a=r.getTLVbyList,s=r.getTLVbyListEx,o=r.getVbyListEx,l=function(S){var _=i(S,0,[0,3,0,0],"06");return n(S,_)!="2a864886f70d01090e"?null:a(S,0,[0,3,0,1,0],"30")},h={};if(e.indexOf("-----BEGIN CERTIFICATE REQUEST")==-1)throw new Error("argument is not PEM file");var d=kt(e,"CERTIFICATE REQUEST");t&&(h.tbs=a(d,0,[0]));try{var E=s(d,0,[0,1]);if(E=="3000")h.subject={};else{var g=new He;h.subject=g.getX500Name(E)}}catch{}var p=s(d,0,[0,2]),f=at.getKey(p,null,"pkcs8pub");h.sbjpubkey=at.getPEM(f,"PKCS8PUB");var w=l(d),g=new He;w!=null&&(h.extreq=g.getExtParamArray(w));try{var y=s(d,0,[1],"30"),g=new He;h.sigalg=g.getAlgorithmIdentifierName(y)}catch{}try{var A=o(d,0,[2]);h.sighex=A}catch{}return h};m.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if(typeof e=="string"&&e.indexOf("-----BEGIN CERTIFICATE REQUEST")!=-1?t=m.asn1.csr.CSRUtil.getParam(e,!0):typeof e=="object"&&e.sbjpubkey!=null&&e.sigalg!=null&&e.sighex!=null&&e.tbs!=null&&(t=e),t==null)return!1;var r=new m.crypto.Signature({alg:t.sigalg});return r.init(t.sbjpubkey),r.updateHex(t.tbs),r.verify(t.sighex)}catch(n){return alert(n),!1}};(typeof m>"u"||!m)&&(m={});(typeof m.asn1>"u"||!m.asn1)&&(m.asn1={});(typeof m.asn1.ocsp>"u"||!m.asn1.ocsp)&&(m.asn1.ocsp={});m.asn1.ocsp.DEFAULT_HASH="sha1";m.asn1.ocsp.OCSPResponse=function(e){m.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);var t=m.asn1.DEREnumerated,r=m.asn1.ASN1Util.newObject,n=m.asn1.ocsp.ResponseBytes,i=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var a=this.params.resstatus;return typeof a=="number"?a:typeof a!="string"?-1:i.indexOf(a)},this.setByParam=function(a){this.params=a},this.tohex=function(){var a=this.params,s=this._getStatusCode();if(s==-1)throw new Error("responseStatus not supported: "+a.resstatus);if(s!=0)return r({seq:[{enum:{int:s}}]}).tohex();var o=new n(a);return r({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:o}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.OCSPResponse,m.asn1.ASN1Object);m.asn1.ocsp.ResponseBytes=function(e){m.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=m.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,i=t.DEROctetString,a=t.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(s){this.params=s},this.tohex=function(){var s=this.params;if(s.restype!="ocspBasic")throw new Error("not supported responseType: "+s.restype);var o=new a(s),l=[];l.push(new n({name:"ocspBasic"})),l.push(new i({hex:o.tohex()}));var h=new r({array:l});return h.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.ResponseBytes,m.asn1.ASN1Object);m.asn1.ocsp.BasicOCSPResponse=function(e){m.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,r=m.asn1,n=r.ASN1Object,i=r.DERSequence,a=r.DERGeneralizedTime,s=r.DERTaggedObject,o=r.DERBitString,l=r.x509.Extensions,h=r.x509.AlgorithmIdentifier,d=r.ocsp,E=d.ResponderID;_SingleResponseList=d.SingleResponseList,_ResponseData=d.ResponseData,this.params=null,this.setByParam=function(p){this.params=p},this.sign=function(){var p=this.params,f=p.tbsresp.tohex(),w=new m.crypto.Signature({alg:p.sigalg});w.init(p.reskey),w.updateHex(f),p.sighex=w.sign()},this.tohex=function(){var p=this.params;p.tbsresp==null&&(p.tbsresp=new _ResponseData(p)),p.sighex==null&&p.reskey!=null&&this.sign();var f=[];if(f.push(p.tbsresp),f.push(new h({name:p.sigalg})),f.push(new o({hex:"00"+p.sighex})),p.certs!=null&&p.certs.length!=null){for(var w=[],g=0;g<p.certs.length;g++){var y=p.certs[g],A=null;if(Ae.isASN1HEX(y))A=y;else if(y.match(/-----BEGIN/))A=kt(y);else throw new t("certs["+g+"] not hex or PEM");w.push(new n({tlv:A}))}var S=new i({array:w});f.push(new s({tag:"a0",explicit:!0,obj:S}))}var _=new i({array:f});return _.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.BasicOCSPResponse,m.asn1.ASN1Object);m.asn1.ocsp.ResponseData=function(e){m.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,r=m.asn1,n=r.DERSequence,i=r.DERGeneralizedTime,a=r.DERTaggedObject,s=r.x509.Extensions,o=r.ocsp,l=o.ResponderID;_SingleResponseList=o.SingleResponseList,this.params=null,this.tohex=function(){var h=this.params;h.respid!=null&&new t("respid not specified"),h.prodat!=null&&new t("prodat not specified"),h.array!=null&&new t("array not specified");var d=[];if(d.push(new l(h.respid)),d.push(new i(h.prodat)),d.push(new _SingleResponseList(h.array)),h.ext!=null){var E=new s(h.ext);d.push(new a({tag:"a1",explicit:!0,obj:E}))}var p=new n({array:d});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(h){this.params=h},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.ResponseData,m.asn1.ASN1Object);m.asn1.ocsp.ResponderID=function(e){m.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=m,r=t.asn1,n=r.ASN1Util.newObject,i=r.x509.X500Name,a=t.lang.String.isHex,s=Error;this.params=null,this.tohex=function(){var o=this.params;if(o.key!=null){var l=null;if(typeof o.key=="string"){if(a(o.key)&&(l=o.key),o.key.match(/-----BEGIN CERTIFICATE/)){var h=new He(o.key),d=h.getExtSubjectKeyIdentifier();d!=null&&(l=d.kid.hex)}}else if(o.key instanceof He){var d=o.key.getExtSubjectKeyIdentifier();d!=null&&(l=d.kid.hex)}if(l==null)throw new s("wrong key member value");var E=n({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:l}}}});return E.tohex()}else if(o.name!=null){var p=null;if(typeof o.name=="string"&&o.name.match(/-----BEGIN CERTIFICATE/)){var h=new He(o.name);p=h.getSubject()}else o.name instanceof He?p=o.name.getSubject():typeof o.name=="object"&&(o.name.array!=null||o.name.str!=null)&&(p=o.name);if(p==null)throw new s("wrong name member value");var E=n({tag:{tag:"a1",explicit:!0,obj:new i(p)}});return E.tohex()}throw new s("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(o){this.params=o},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.ResponderID,m.asn1.ASN1Object);m.asn1.ocsp.SingleResponseList=function(e){m.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=m.asn1,r=t.DERSequence,n=t.ocsp.SingleResponse;this.params=null,this.tohex=function(){var i=this.params;if(typeof i!="object"||i.length==null)throw new Error("params not specified properly");for(var a=[],s=0;s<i.length;s++)a.push(new n(i[s]));var o=new r({array:a});return o.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(i){this.params=i},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.SingleResponseList,m.asn1.ASN1Object);m.asn1.ocsp.SingleResponse=function(e){var t=Error,r=m,n=r.asn1,i=n.DERSequence,a=n.DERGeneralizedTime,s=n.DERTaggedObject,o=n.ocsp,l=o.CertID,h=o.CertStatus,d=n.x509,E=d.Extensions;o.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var p=this.params,f=[];if(p.certid==null)throw new t("certid unspecified");if(p.status==null)throw new t("status unspecified");if(p.thisupdate==null)throw new t("thisupdate unspecified");if(f.push(new l(p.certid)),f.push(new h(p.status)),f.push(new a(p.thisupdate)),p.nextupdate!=null){var w=new a(p.nextupdate);f.push(new s({tag:"a0",explicit:!0,obj:w}))}if(p.ext!=null){var g=new E(p.ext);f.push(new s({tag:"a1",explicit:!0,obj:g}))}var y=new i({array:f});return y.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(p){this.params=p},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.SingleResponse,m.asn1.ASN1Object);m.asn1.ocsp.CertID=function(e){var t=m,r=t.asn1,n=r.DEROctetString,i=r.DERInteger,a=r.DERSequence,s=r.x509,o=s.AlgorithmIdentifier,l=r.ocsp,h=l.DEFAULT_HASH,d=t.crypto,E=d.Util.hashHex,p=He,f=Ae,w=f.getVbyList;l.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(g,y,A,S){S==null&&(S=this.DEFAULT_HASH),this.params={alg:S,issname:g,isskey:y,sbjsn:A}},this.setByCert=function(g,y,A){A==null&&(A=this.DEFAULT_HASH),this.params={alg:A,issuerCert:g,subjectCert:y}},this.getParamByCerts=function(g,y,A){A==null&&(A=this.DEFAULT_HASH);var S=new p(g),_=new p(y),I=E(S.getSubjectHex(),A),D=S.getPublicKeyHex(),H=E(w(D,0,[1],"03",!0),A),V=_.getSerialNumberHex(),F={alg:A,issname:I,isskey:H,sbjsn:V};return F},this.tohex=function(){if(typeof this.params!="object")throw new Error("params not set");var g=this.params,y,A,S,_;if(g.alg==null?_=this.DEFAULT_HASH:_=g.alg,g.issuerCert!=null&&g.subjectCert!=null){var I=this.getParamByCerts(g.issuerCert,g.subjectCert,_);y=I.issname,A=I.isskey,S=I.sbjsn}else if(g.issname!=null&&g.isskey!=null&&g.sbjsn!=null)y=g.issname,A=g.isskey,S=g.sbjsn;else throw new Error("required param members not defined");var D=new o({name:_}),H=new n({hex:y}),V=new n({hex:A}),F=new i({hex:S}),P=new a({array:[D,H,V,F]});return this.hTLV=P.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.CertID,m.asn1.ASN1Object);m.asn1.ocsp.CertStatus=function(e){m.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(t.status=="good")return"8000";if(t.status=="unknown")return"8200";if(t.status=="revoked"){var r=[{gentime:{str:t.time}}];t.reason!=null&&r.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var n={tag:"a1",explicit:!1,obj:{seq:r}};return m.asn1.ASN1Util.newObject({tag:n}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},e!==void 0&&this.setByParam(e)};he(m.asn1.ocsp.CertStatus,m.asn1.ASN1Object);m.asn1.ocsp.Request=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.ocsp;if(i.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var s=[];if(this.dReqCert===null)throw"reqCert not set";s.push(this.dReqCert);var o=new n({array:s});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},typeof e<"u"){var a=new i.CertID(e);this.dReqCert=a}};he(m.asn1.ocsp.Request,m.asn1.ASN1Object);m.asn1.ocsp.TBSRequest=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.ocsp;i.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(a){for(var s=[],o=0;o<a.length;o++){var l=new i.Request(a[0]);s.push(l)}this.dRequestList=s},this.tohex=function(){var a=[];if(this.version!==0)throw"not supported version: "+this.version;if(this.dRequestorName!==null)throw"requestorName not supported";var s=new n({array:this.dRequestList});if(a.push(s),this.dRequestExt!==null)throw"requestExtensions not supported";var o=new n({array:a});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&e.reqList!==void 0&&this.setRequestListByParam(e.reqList)};he(m.asn1.ocsp.TBSRequest,m.asn1.ASN1Object);m.asn1.ocsp.OCSPRequest=function(e){var t=m,r=t.asn1,n=r.DERSequence,i=r.ocsp;if(i.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var s=[];if(this.dTbsRequest!==null)s.push(this.dTbsRequest);else throw"tbsRequest not set";if(this.dOptionalSignature!==null)throw"optionalSignature not supported";var o=new n({array:s});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&e.reqList!==void 0){var a=new i.TBSRequest(e);this.dTbsRequest=a}};he(m.asn1.ocsp.OCSPRequest,m.asn1.ASN1Object);m.asn1.ocsp.OCSPUtil={};m.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,r){var n=m,i=n.asn1,a=i.ocsp;r===void 0&&(r=a.DEFAULT_HASH);var s={alg:r,issuerCert:e,subjectCert:t},o=new a.OCSPRequest({reqList:[s]});return o.tohex()};m.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=Ae,r=t.getVbyList,n=t.getVbyListEx,i=t.getIdxbyList,a=t.getIdxbyListEx,s=t.getV,o={};try{var l=n(e,0,[0],"0a");o.responseStatus=parseInt(l,16)}catch{}if(o.responseStatus!==0)return o;try{var h=i(e,0,[1,0,1,0,0,2,0,1]);e.substr(h,2)==="80"?o.certStatus="good":e.substr(h,2)==="a1"?(o.certStatus="revoked",o.revocationTime=yt(r(e,h,[0]))):e.substr(h,2)==="82"&&(o.certStatus="unknown")}catch{}try{var d=i(e,0,[1,0,1,0,0,2,0,2]);o.thisUpdate=yt(s(e,d))}catch{}try{var E=i(e,0,[1,0,1,0,0,2,0,3]);e.substr(E,2)==="a0"&&(o.nextUpdate=yt(r(e,E,[0])))}catch{}return o};m.asn1.ocsp.OCSPParser=function(){var e=Error,t=He,r=new t,n=Ae,i=n.getV,a=n.getTLV,s=n.getIdxbyList,o=n.getVbyList,l=n.getTLVbyList,h=n.getVbyListEx,d=n.getTLVbyListEx,E=n.getChildIdx;this.getOCSPRequest=function(p){var f=E(p,0);if(f.length!=1&&f.length!=2)throw new e("wrong number elements: "+f.length);var w=this.getTBSRequest(a(p,f[0]));return w},this.getTBSRequest=function(p){var f={},w=d(p,0,[0],"30");f.array=this.getRequestList(w);var g=d(p,0,["[2]",0],"30");return g!=null&&(f.ext=r.getExtParamArray(g)),f},this.getRequestList=function(p){for(var f=[],w=E(p,0),g=0;g<w.length;g++){var p=a(p,w[g]);f.push(this.getRequest(p))}return f},this.getRequest=function(p){var f=E(p,0);if(f.length!=1&&f.length!=2)throw new e("wrong number elements: "+f.length);var w=this.getCertID(a(p,f[0]));if(f.length==2){var g=s(p,0,[1,0]);w.ext=r.getExtParamArray(a(p,g))}return w},this.getCertID=function(p){var f=E(p,0);if(f.length!=4)throw new e("wrong number elements: "+f.length);var w=new t,g={};return g.alg=w.getAlgorithmIdentifierName(a(p,f[0])),g.issname=i(p,f[1]),g.isskey=i(p,f[2]),g.sbjsn=i(p,f[3]),g},this.getOCSPResponse=function(p){var f=E(p,0),w,g=i(p,f[0]),y=parseInt(g);if(f.length==1)return{resstatus:y};var A=l(p,0,[1,0]);return w=this.getResponseBytes(A),w.resstatus=y,w},this.getResponseBytes=function(p){var f=E(p,0),w,g=l(p,0,[1,0]);w=this.getBasicOCSPResponse(g);var y=i(p,f[0]);return w.restype=m.asn1.x509.OID.oid2name(Af(y)),w},this.getBasicOCSPResponse=function(p){var f=E(p,0),w;w=this.getResponseData(a(p,f[0]));var g=new He;w.alg=g.getAlgorithmIdentifierName(a(p,f[1]));var y=i(p,f[2]);w.sighex=y.substr(2);var A=h(p,0,["[0]"]);if(A!=null){for(var S=E(A,0),_=[],I=0;I<S.length;I++){var D=a(A,S[I]);_.push(D)}w.certs=_}return w},this.getResponseData=function(p){var f=E(p,0),w=f.length,g={},y=0;p.substr(f[0],2)=="a0"&&y++,g.respid=this.getResponderID(a(p,f[y++]));var A=i(p,f[y++]);if(g.prodat=yt(A),g.array=this.getSingleResponseList(a(p,f[y++])),p.substr(f[w-1],2)=="a1"){var S=l(p,f[w-1],[0]),_=new He;g.ext=_.getExtParamArray(S)}return g},this.getResponderID=function(p){var f={};if(p.substr(0,2)=="a2"){var w=o(p,0,[0]);f.key=w}if(p.substr(0,2)=="a1"){var g=l(p,0,[0]),y=new He;f.name=y.getX500Name(g)}return f},this.getSingleResponseList=function(p){for(var f=E(p,0),w=[],g=0;g<f.length;g++){var y=this.getSingleResponse(a(p,f[g]));w.push(y)}return w},this.getSingleResponse=function(p){var f=E(p,0),w={},g=this.getCertID(a(p,f[0]));w.certid=g;var y=this.getCertStatus(a(p,f[1]));if(w.status=y,p.substr(f[2],2)=="18"){var A=i(p,f[2]);w.thisupdate=yt(A)}for(var S=3;S<f.length;S++){if(p.substr(f[S],2)=="a0"){var _=o(p,f[S],[0],"18");w.nextupdate=yt(_)}if(p.substr(f[S],2)=="a1"){var I=new He,D=l(p,0,[S,0]);w.ext=I.getExtParamArray(D)}}return w},this.getCertStatus=function(p){var f={};if(p=="8000")return{status:"good"};if(p=="8200")return{status:"unknown"};if(p.substr(0,2)=="a1"){f.status="revoked";var w=o(p,0,[0]),g=yt(w);f.time=g}return f}};var m;(typeof m>"u"||!m)&&(m={});(typeof m.lang>"u"||!m.lang)&&(m.lang={});m.lang.String=function(){};function Mm(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function qm(e){for(var t="",r=0;r<e.length;r++)t=t+String.fromCharCode(e[r]);return t}function pf(e){for(var t="",r=0;r<e.length;r++){var n=e[r].toString(16);n.length==1&&(n="0"+n),t=t+n}return t}function pn(e){return pf(Mm(e))}function p8(e){return gs(pn(e))}function d8(e){return Ju(gs(pn(e)))}function g8(e){return qm(Nm(bc(e)))}function Ju(e){return e=e.replace(/\=/g,""),e=e.replace(/\+/g,"-"),e=e.replace(/\//g,"_"),e}function bc(e){return e.length%4==2?e=e+"==":e.length%4==3&&(e=e+"="),e=e.replace(/-/g,"+"),e=e.replace(/_/g,"/"),e}function sr(e){return e.length%2==1&&(e="0"+e),Ju(gs(e))}function Pt(e){return Zu(bc(e))}var yc,ci;typeof Buffer=="function"?(yc=function(e){return Ju(Buffer.from(e,"utf8").toString("base64"))},ci=function(e){return Buffer.from(bc(e),"base64").toString("utf8")}):(yc=function(e){return sr(mf(Ef(e)))},ci=function(e){return decodeURIComponent(vf(Pt(e)))});function m8(e){return gs(mf(Ef(e)))}function v8(e){return decodeURIComponent(vf(Zu(e)))}function df(e){return mf(Ef(e)).toLowerCase()}function yt(e){try{return decodeURIComponent(vf(e))}catch{return null}}function E8(e){return yt(A8(e))}function A8(e){for(var t=e.match(/.{1,2}/g),r=[],n=0;n<t.length;n++){var i=parseInt(t[n],16);161<=i&&i<=191?(r.push("c2"),r.push(t[n])):192<=i&&i<=255?(r.push("c3"),r.push((i-64).toString(16))):r.push(t[n])}return r.join("")}function dn(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function Ii(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function md(e){return gs(e)}function w8(e){return gf(md(e),64)}function gf(e,t){return e=e.replace(new RegExp("(.{"+t+"})","g"),`$1\r
`),e=e.replace(/\s+$/,""),e}function Vm(e){var t=e.replace(/[^0-9A-Za-z\/+=]*/g,""),r=Zu(t);return r}function y8(e,t){return"-----BEGIN "+t+`-----\r
`+gf(e,64)+`\r
-----END `+t+`-----\r
`}function Or(e,t){return"-----BEGIN "+t+`-----\r
`+gf(md(e),64)+`\r
-----END `+t+`-----\r
`}function kt(e,t){if(e.indexOf("-----BEGIN ")==-1)throw new Error("can't find PEM header");return t!==void 0?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),""),e=e.replace(new RegExp("-----END "+t+"-----[^]*$"),"")):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,""),e=e.replace(/-----END [^-]+-----[^]*$/,"")),Vm(e)}function S8(e){return e.indexOf("-----BEGIN ")==-1||e.indexOf("-----END ")==-1?null:(e=e.replace(/^[\s\S]*?-----BEGIN [^-]+-----/m,""),e=e.replace(/-----END [\s\S]+$/m,""),e=e.replace(/\s+/g,""),e.match(/^[0-9a-zA-Z+/=]+$/)?e:null)}function b8(e){if(e.length%2!=0)throw"input is not even length";if(e.match(/^[0-9A-Fa-f]+$/)==null)throw"input is not hexadecimal";for(var t=new ArrayBuffer(e.length/2),r=new DataView(t),n=0;n<e.length/2;n++)r.setUint8(n,parseInt(e.substr(n*2,2),16));return t}function C8(e){for(var t="",r=new DataView(e),n=0;n<e.byteLength;n++)t+=("00"+r.getUint8(n).toString(16)).slice(-2);return t}function vd(e){var t,r,n,i,a,s,o,l,h,d,E,p;if(e=Gm(e),p=e.match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/),p)return t=parseInt(p[1]),r=parseInt(p[2])-1,n=parseInt(p[3]),i=parseInt(p[4]),a=parseInt(p[5]),s=parseInt(p[6]),o=0,d=p[7],d!==""&&(E=(d.substr(1)+"00").substr(0,3),o=parseInt(E)),Date.UTC(t,r,n,i,a,s,o);throw new Error("unsupported zulu format: "+e)}function F8(e){var t=new Date(e),r=("0000"+t.getUTCFullYear()).slice(-4),n=("00"+(t.getUTCMonth()+1)).slice(-2),i=("00"+t.getUTCDate()).slice(-2),a=("00"+t.getUTCHours()).slice(-2),s=("00"+t.getUTCMinutes()).slice(-2),o=("00"+t.getUTCSeconds()).slice(-2),l=("000"+t.getUTCMilliseconds()).slice(-3);return l=l.replace(/0+$/,""),l=l!=""?"."+l:l,r+n+i+a+s+o+l+"Z"}function Km(e){return Math.round(vd(e)/1e3)}function _8(e){return new Date(vd(e))}function I8(e,t,r){var n,i=e.getUTCFullYear();if(t){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;n=(""+i).slice(-2)}else n=("000"+i).slice(-4);if(n+=("0"+(e.getUTCMonth()+1)).slice(-2),n+=("0"+e.getUTCDate()).slice(-2),n+=("0"+e.getUTCHours()).slice(-2),n+=("0"+e.getUTCMinutes()).slice(-2),n+=("0"+e.getUTCSeconds()).slice(-2),r){var a=e.getUTCMilliseconds();a!==0&&(a=("00"+a).slice(-3),a=a.replace(/0+$/g,""),n+="."+a)}return n+="Z",n}function Gm(e){return e.match(/^[0-9]{12}Z$/)||e.match(/^[0-9]{12}[.][0-9]*Z$/)?e.match(/^[0-4]/)?"20"+e:"19"+e:e}function mf(e){return e.replace(/%/g,"")}function vf(e){return e.replace(/(..)/g,"%$1")}function cd(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;e=e.toLowerCase();var r=e.split(":").length-1;if(r<2)throw t;var n=":".repeat(7-r+2);e=e.replace("::",n);var i=e.split(":");if(i.length!=8)throw t;for(var a=0;a<8;a++)i[a]=("0000"+i[a]).slice(-4);return i.join("")}function ld(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+e);e=e.toLowerCase();var t=e.match(/.{1,4}/g);t=t.map(function(i){return i.replace(/^0+/,"")}),t=t.map(function(i){return i==""?"0":i}),e=":"+t.join(":")+":";var r=e.match(/:(0:){2,}/g);if(r==null)return e.slice(1,-1);var n=r.sort().slice(-1)[0];return e=e.replace(n.substr(0,n.length-1),":"),e.substr(0,2)!="::"&&(e=e.substr(1)),e.substr(-2,2)!="::"&&(e=e.substr(0,e.length-1)),e}function of(e){var t=new Error("malformed hex value");if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(e.length==8){var r;try{return r=parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16),r}catch{throw t}}else if(e.length==16)try{return of(e.substr(0,8))+"/"+xm(e.substr(8))}catch{throw t}else{if(e.length==32)return ld(e);if(e.length==64){try{return ld(e.substr(0,32))+"/"+xm(e.substr(32))}catch{throw t}return}else return e}}function xm(e){var t=new Error("malformed mask"),r;try{r=new ee(e,16).toString(2)}catch{throw t}if(!r.match(/^1*0*$/))throw t;return r.replace(/0+$/,"").length}function Ed(e){var t=new Error("malformed IP address");if(e=e.toLowerCase(e),!e.match(/^[0-9a-f.:/]+$/))throw t;if(e.match(/^[0-9.]+$/)){var r=e.split(".");if(r.length!==4)throw t;var n="";try{for(var i=0;i<4;i++){var a=parseInt(r[i]);n+=("0"+a.toString(16)).slice(-2)}return n}catch{throw t}}else if(e.match(/^[0-9.]+\/[0-9]+$/)){var s=e.split("/");return Ed(s[0])+Om(parseInt(s[1]),32)}else{if(e.match(/^[0-9a-f:]+$/)&&e.indexOf(":")!==-1)return cd(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&e.indexOf(":")!==-1){var s=e.split("/");return cd(s[0])+Om(parseInt(s[1]),128)}else throw t}}function Om(e,t){if(t==32&&e==0)return"00000000";if(t==128&&e==0)return"00000000000000000000000000000000";var r=Array(e+1).join("1")+Array(t-e+1).join("0");return new ee(r,2).toString(16)}function Ad(e){function t(i){var a=parseInt(i.substr(0,2),16),s=parseInt(i.substr(2),16);if(a==0&s<128)return String.fromCharCode(s);if(a<8){var o=192|(a&7)<<3|(s&192)>>6,l=128|s&63;return yt(o.toString(16)+l.toString(16))}var o=224|(a&240)>>4,l=128|(a&15)<<2|(s&192)>>6,h=128|s&63;return yt(o.toString(16)+l.toString(16)+h.toString(16))}var r=e.match(/.{4}/g),n=r.map(t);return n.join("")}function Ef(e){for(var t=encodeURIComponent(e),r="",n=0;n<t.length;n++)t[n]=="%"?(r=r+t.substr(n,3),n=n+2):r=r+"%"+pn(t[n]);return r}function D8(e){return e=e.replace(/\r\n/mg,`
`),e}function B8(e){return e=e.replace(/\r\n/mg,`
`),e=e.replace(/\n/mg,`\r
`),e}m.lang.String.isInteger=function(e){return e.match(/^[0-9]+$/)?!0:!!e.match(/^-[0-9]+$/)};m.lang.String.isHex=function(e){return zm(e)};function zm(e){return!!(e.length%2==0&&(e.match(/^[0-9a-f]+$/)||e.match(/^[0-9A-F]+$/)))}m.lang.String.isBase64=function(e){return e=e.replace(/\s+/g,""),!!(e.match(/^[0-9A-Za-z+\/]+={0,3}$/)&&e.length%4==0)};m.lang.String.isBase64URL=function(e){return e.match(/[+/=]/)?!1:(e=bc(e),m.lang.String.isBase64(e))};function wd(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}m.lang.String.isIntegerArray=function(e){return e=e.replace(/\s+/g,""),!!e.match(/^\[[0-9,]+\]$/)};m.lang.String.isPrintable=function(e){return e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)!==null};m.lang.String.isIA5=function(e){return e.match(/^[\x20-\x21\x23-\x7f]*$/)!==null};m.lang.String.isMail=function(e){return e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};function fd(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}function $8(e){e=e.replace(/^\s*\[\s*/,""),e=e.replace(/\s*\]\s*$/,""),e=e.replace(/\s*/g,"");try{var t=e.split(/,/).map(function(r,n,i){var a=parseInt(r);if(a<0||255<a)throw"integer not in range 0-255";var s=("00"+a.toString(16)).slice(-2);return s}).join("");return t}catch(r){throw"malformed integer array string: "+r}}var P8=function(e,t){var r=e.length;e.length>t.length&&(r=t.length);for(var n=0;n<r;n++)if(e.charCodeAt(n)!=t.charCodeAt(n))return n;return e.length!=t.length?r:-1};function Ym(e){var t=function(o){var l=o.toString(16);return l.length==1&&(l="0"+l),l},r=function(o){var l="",h=parseInt(o,10),d=h.toString(2),E=7-d.length%7;E==7&&(E=0);for(var p="",f=0;f<E;f++)p+="0";d=p+d;for(var f=0;f<d.length-1;f+=7){var w=d.substr(f,7);f!=d.length-7&&(w="1"+w),l+=t(parseInt(w,2))}return l};try{if(!e.match(/^[0-9.]+$/))return null;var n="",i=e.split("."),a=parseInt(i[0],10)*40+parseInt(i[1],10);n+=t(a),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n}catch{return null}}function Af(e){if(!zm(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),a=[],s=0;s<i.length/2;s++)a.push(parseInt(i.substr(s*2,2),16));for(var o=[],l="",s=0;s<a.length;s++)a[s]&128?l=l+cf((a[s]&127).toString(2),7):(l=l+cf((a[s]&127).toString(2),7),o.push(new String(parseInt(l,2))),l="");var h=t.join(".");return o.length>0&&(h=h+"."+o.join(".")),h}catch{return null}}function Wm(e){var t=new ee(String(e),10);return Cc(t)}function Cc(e){var t=e.toString(16);if(t.substr(0,1)!="-")return t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t),t;var r=t.substr(1),n=r.length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var i="",a=0;a<n;a++)i+="f";var s=new ee(i,16),o=s.xor(e).add(ee.ONE);return t=o.toString(16).replace(/^-/,""),t}var cf=function(e,t,r){return r==null&&(r="0"),e.length>=t?e:new Array(t-e.length+1).join(r)+e};function Xm(e){if(e.length%2!=0||(e=e.toLowerCase(),e.match(/^[0-9a-f]+$/)==null))return-1;try{var t=e.substr(0,2);if(t=="00")return parseInt(e.substr(2),16);var r=parseInt(t,16);if(r>7)return-1;var n=e.substr(2),i=parseInt(n,16).toString(2);i=="0"&&(i="00000000"),i=i.slice(0,0-r);var a=parseInt(i,2);return a==NaN?-1:a}catch{return-1}}function Jm(e){if(typeof e!="number"||e<0)return null;var t=Number(e).toString(2),r=8-t.length%8;r==8&&(r=0),t=t+cf("",r,"0");var n=parseInt(t,2).toString(16);n.length%2==1&&(n="0"+n);var i="0"+r;return i+n}function Zm(e){if(typeof e!="string"||e.length%2!=0||!e.match(/^[0-9a-f]+$/))return null;try{var t=parseInt(e.substr(0,2),16);if(t<0||7<t)return null;for(var r=e.substr(2),n="",i=0;i<r.length;i+=2){var a=r.substr(i,2),s=parseInt(a,16).toString(2);s=("0000000"+s).slice(-8),n+=s}return n.substr(0,n.length-t)}catch{return null}}function R8(e){if(typeof e!="string"||e.match(/^[01]+$/)==null)return null;try{var t=parseInt(e,2);return Jm(t)}catch{return null}}function lf(e,t){for(var r=0,n=0;n<e.length;n++)r|=1<<t[e[n]];for(var i=r.toString(2),a="",n=i.length-1;n>=0;n--)a+=i[n];return a}function _t(e,n,r){if(typeof e=="object"){for(var n=String(n).split("."),i=0;i<n.length&&e;i++){var a=n[i];a.match(/^[0-9]+$/)&&(a=parseInt(a)),e=e[a]}return e||e===!1?e:r}}function he(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}(typeof m>"u"||!m)&&(m={});(typeof m.crypto>"u"||!m.crypto)&&(m.crypto={});m.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:Ce.algo.MD5,sha1:Ce.algo.SHA1,sha224:Ce.algo.SHA224,sha256:Ce.algo.SHA256,sha384:Ce.algo.SHA384,sha512:Ce.algo.SHA512,ripemd160:Ce.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(typeof this.DIGESTINFOHEAD[t]>"u")throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+t;for(var a="0001",s="00"+n,o="",l=i-a.length-s.length,h=0;h<l;h+=2)o+="ff";var d=a+o+s;return d},this.hashString=function(e,t){var r=new m.crypto.MessageDigest({alg:t});return r.digestString(e)},this.hashHex=function(e,t){var r=new m.crypto.MessageDigest({alg:t});return r.digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ze||e instanceof m.crypto.DSA||e instanceof m.crypto.ECDSA}};m.crypto.Util.md5=function(e){var t=new m.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return t.digestString(e)};m.crypto.Util.ripemd160=function(e){var t=new m.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return t.digestString(e)};m.crypto.Util.SECURERANDOMGEN=new to;m.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return m.crypto.Util.SECURERANDOMGEN.nextBytes(t),pf(t)};m.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new ee(m.crypto.Util.getRandomHexOfNbytes(e),16)};m.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=(e-t)/8,n=new Array(r+1);return m.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],pf(n)};m.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new ee(m.crypto.Util.getRandomHexOfNbits(e),16)};m.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var r=m.crypto.Util.getRandomBigIntegerOfNbits(t);if(e.compareTo(r)!=-1)return r}};m.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var r=e.compareTo(t);if(r==1)throw"biMin is greater than biMax";if(r==0)return e;var n=t.subtract(e),i=m.crypto.Util.getRandomBigIntegerZeroToMax(n);return i.add(e)};m.crypto.MessageDigest=function(e){var t=null,r=null,n=null;this.setAlgAndProvider=function(i,a){if(i=m.crypto.MessageDigest.getCanonicalAlgName(i),i!==null&&a===void 0&&(a=m.crypto.Util.DEFAULTPROVIDER[i]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(i)!=-1&&a=="cryptojs"){try{this.md=m.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[i].create()}catch(s){throw"setAlgAndProvider hash alg set fail alg="+i+"/"+s}this.updateString=function(s){this.md.update(s)},this.updateHex=function(s){var o=Ce.enc.Hex.parse(s);this.md.update(o)},this.digest=function(){var s=this.md.finalize();return s.toString(Ce.enc.Hex)},this.digestString=function(s){return this.updateString(s),this.digest()},this.digestHex=function(s){return this.updateHex(s),this.digest()}}if(":sha256:".indexOf(i)!=-1&&a=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(s){throw"setAlgAndProvider hash alg set fail alg="+i+"/"+s}this.updateString=function(s){this.md.update(s)},this.updateHex=function(s){var o=sjcl.codec.hex.toBits(s);this.md.update(o)},this.digest=function(){var s=this.md.finalize();return sjcl.codec.hex.fromBits(s)},this.digestString=function(s){return this.updateString(s),this.digest()},this.digestHex=function(s){return this.updateHex(s),this.digest()}}},this.updateString=function(i){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(i){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(i){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(i){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},e!==void 0&&e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0&&(this.provName=m.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};m.crypto.MessageDigest.getCanonicalAlgName=function(e){return typeof e=="string"&&(e=e.toLowerCase(),e=e.replace(/-/,"")),e};m.crypto.MessageDigest.getHashLength=function(e){var t=m.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(t.HASHLENGTH[r]===void 0)throw"not supported algorithm: "+e;return t.HASHLENGTH[r]};m.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};m.crypto.Mac=function(e){var t=null,r=null,n=null,i=null,a=null;this.setAlgAndProvider=function(s,o){if(s=s.toLowerCase(),s==null&&(s="hmacsha1"),s=s.toLowerCase(),s.substr(0,4)!="hmac")throw"setAlgAndProvider unsupported HMAC alg: "+s;o===void 0&&(o=m.crypto.Util.DEFAULTPROVIDER[s]),this.algProv=s+"/"+o;var l=s.substr(4);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(l)!=-1&&o=="cryptojs"){try{var h=m.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[l];this.mac=Ce.algo.HMAC.create(h,this.pass)}catch(d){throw"setAlgAndProvider hash alg set fail hashAlg="+l+"/"+d}this.updateString=function(d){this.mac.update(d)},this.updateHex=function(d){var E=Ce.enc.Hex.parse(d);this.mac.update(E)},this.doFinal=function(){var d=this.mac.finalize();return d.toString(Ce.enc.Hex)},this.doFinalString=function(d){return this.updateString(d),this.doFinal()},this.doFinalHex=function(d){return this.updateHex(d),this.doFinal()}}},this.updateString=function(s){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(s){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(s){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(s){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(s){if(typeof s=="string"){var o=s;(s.length%2==1||!s.match(/^[0-9A-Fa-f]+$/))&&(o=Ii(s)),this.pass=Ce.enc.Hex.parse(o);return}if(typeof s!="object")throw"KJUR.crypto.Mac unsupported password type: "+s;var o=null;if(s.hex!==void 0){if(s.hex.length%2!=0||!s.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+s.hex;o=s.hex}if(s.utf8!==void 0&&(o=df(s.utf8)),s.rstr!==void 0&&(o=Ii(s.rstr)),s.b64!==void 0&&(o=Zu(s.b64)),s.b64u!==void 0&&(o=Pt(s.b64u)),o==null)throw"KJUR.crypto.Mac unsupported password type: "+s;this.pass=Ce.enc.Hex.parse(o)},e!==void 0&&(e.pass!==void 0&&this.setPassword(e.pass),e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0&&(this.provName=m.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))};m.crypto.Signature=function(e){var t=null,r=null,n=null,i=null,a=null,s=null,o=null,l=null,h=null,d=null,E=-1,p=null,f=null,w=null,g=null,y=null;if(this._setAlgNames=function(){var A=this.algName.match(/^(.+)with(.+)$/);A&&(this.mdAlgName=A[1].toLowerCase(),this.pubkeyAlgName=A[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(A,S){for(var _="",I=S/4-A.length,D=0;D<I;D++)_=_+"0";return _+A},this.setAlgAndProvider=function(A,S){if(this._setAlgNames(),S!="cryptojs/jsrsa")throw new Error("provider not supported: "+S);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new m.crypto.MessageDigest({alg:this.mdAlgName})}catch(_){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+_)}this.init=function(_,I){var D=null;try{I===void 0?D=at.getKey(_):D=at.getKey(_,I)}catch(H){throw"init failed:"+H}if(D.isPrivate===!0)this.prvKey=D,this.state="SIGN";else if(D.isPublic===!0)this.pubKey=D,this.state="VERIFY";else throw"init failed.:"+D},this.updateString=function(_){this.md.updateString(_)},this.updateHex=function(_){this.md.updateHex(_)},this.sign=function(){if(this.sHashHex=this.md.digest(),this.prvKey===void 0&&this.ecprvhex!==void 0&&this.eccurvename!==void 0&&m.crypto.ECDSA!==void 0&&(this.prvKey=new m.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ze&&this.pubkeyAlgName==="rsaandmgf1")this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ze&&this.pubkeyAlgName==="rsa")this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof m.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else if(this.prvKey instanceof m.crypto.DSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;return this.hSign},this.signString=function(_){return this.updateString(_),this.sign()},this.signHex=function(_){return this.updateHex(_),this.sign()},this.verify=function(_){if(this.sHashHex=this.md.digest(),this.pubKey===void 0&&this.ecpubhex!==void 0&&this.eccurvename!==void 0&&m.crypto.ECDSA!==void 0&&(this.pubKey=new m.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ze&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,_,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ze&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,_);if(m.crypto.ECDSA!==void 0&&this.pubKey instanceof m.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,_);if(m.crypto.DSA!==void 0&&this.pubKey instanceof m.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,_);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(A,S){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(A){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(A){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(A){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(A){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(A){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,e!==void 0&&(e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0?this.provName=m.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),e.psssaltlen!==void 0&&(this.pssSaltLen=e.psssaltlen),e.prvkeypem!==void 0)){if(e.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{var t=at.getKey(e.prvkeypem);this.init(t)}catch(A){throw"fatal error to load pem private key: "+A}}};m.crypto.Cipher=function(e){};m.crypto.Cipher.encrypt=function(e,t,r,n){if(_t(n,"enclag")!=null&&(r=n.encalg),typeof r=="string"&&r.substr(-4)=="-CBC"){var i=t,a=e;_t(n,"key")!=null&&(i=n.key),_t(n,"enc")!=null&&(hEnc=n.enc);var s=Ce.enc.Hex.parse(i),o=Ce.enc.Hex.parse(a),l=Ce.enc.Hex.parse(n.iv),h;if(r=="des-EDE3-CBC")h=Ce.TripleDES.encrypt(o,s,{iv:l});else if(r=="aes128-CBC"||r=="aes256-CBC")h=Ce.AES.encrypt(o,s,{iv:l});else throw new Error("unsupported algorithm: "+r);return h+""}else throw new Error("Cipher.encrypt: unsupported key or algorithm")};m.crypto.Cipher.decrypt=function(e,t,r,n){if(_t(n,"enclag")!=null&&(r=n.encalg),typeof r=="string"&&r.substr(-4)=="-CBC"){var i=t,a=e;_t(n,"key")!=null&&(i=n.key),_t(n,"enc")!=null&&(a=n.enc);var s=Ce.enc.Hex.parse(i),o=Ce.enc.Hex.parse(a),l=Ce.enc.Hex.parse(n.iv),h;if(r=="des-EDE3-CBC")h=Ce.TripleDES.decrypt({ciphertext:o},s,{iv:l});else if(r=="aes128-CBC"||r=="aes256-CBC")h=Ce.AES.decrypt({ciphertext:o},s,{iv:l});else throw new Error("unsupported algorithm: "+r);return Ce.enc.Hex.stringify(h)}else throw new Error("Cipher.decrypt: unsupported key or algorithm")};m.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};(typeof m>"u"||!m)&&(m={});(typeof m.crypto>"u"||!m.crypto)&&(m.crypto={});m.crypto.ECDSA=function(e){var t="secp256r1",r=null,n=null,i=null,a=Error,s=ee,o=dt,l=m.crypto.ECDSA,h=m.crypto.ECParameterDB,d=l.getName,E=Ae,p=E.getVbyListEx,f=E.isASN1HEX,w=new to,g=null;this.type="EC",this.isPrivate=!1,this.isPublic=!1;function y(A,S,_,I){for(var D=Math.max(S.bitLength(),I.bitLength()),H=A.add2D(_),V=A.curve.getInfinity(),F=D-1;F>=0;--F)V=V.twice2D(),V.z=s.ONE,S.testBit(F)?I.testBit(F)?V=V.add2D(H):V=V.add2D(A):I.testBit(F)&&(V=V.add2D(_));return V}this.getBigRandom=function(A){return new s(A.bitLength(),w).mod(A.subtract(s.ONE)).add(s.ONE)},this.setNamedCurve=function(A){this.ecparams=h.getByName(A),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=A},this.setPrivateKeyHex=function(A){this.isPrivate=!0,this.prvKeyHex=A},this.setPublicKeyHex=function(A){this.isPublic=!0,this.pubKeyHex=A},this.getPublicKeyXYHex=function(){var A=this.pubKeyHex;if(A.substr(0,2)!=="04")throw"this method supports uncompressed format(04) only";var S=this.ecparams.keycharlen;if(A.length!==2+S*2)throw"malformed public key hex length";var _={};return _.x=A.substr(2,S),_.y=A.substr(2+S),_},this.getShortNISTPCurveName=function(){var A=this.curveName;return A==="secp256r1"||A==="NIST P-256"||A==="P-256"||A==="prime256v1"?"P-256":A==="secp384r1"||A==="NIST P-384"||A==="P-384"?"P-384":A==="secp521r1"||A==="NIST P-521"||A==="P-521"?"P-521":null},this.generateKeyPairHex=function(){var A=this.ecparams.n,S=this.getBigRandom(A),_=this.ecparams.keycharlen,I=("0000000000"+S.toString(16)).slice(-_);this.setPrivateKeyHex(I);var D=this.generatePublicKeyHex();return{ecprvhex:I,ecpubhex:D}},this.generatePublicKeyHex=function(){var A=new s(this.prvKeyHex,16),S=this.ecparams.G.multiply(A),_=S.getX().toBigInteger(),I=S.getY().toBigInteger(),D=this.ecparams.keycharlen,H=("0000000000"+_.toString(16)).slice(-D),V=("0000000000"+I.toString(16)).slice(-D),F="04"+H+V;return this.setPublicKeyHex(F),F},this.signWithMessageHash=function(A){return this.signHex(A,this.prvKeyHex)},this.signHex=function(A,S){var _=new s(S,16),I=this.ecparams.n,D=new s(A.substring(0,this.ecparams.keycharlen),16);do var H=this.getBigRandom(I),V=this.ecparams.G,F=V.multiply(H),P=F.getX().toBigInteger().mod(I);while(P.compareTo(s.ZERO)<=0);var k=H.modInverse(I).multiply(D.add(_.multiply(P))).mod(I);return l.biRSSigToASN1Sig(P,k)},this.sign=function(A,S){var _=S,I=this.ecparams.n,D=s.fromByteArrayUnsigned(A);do var H=this.getBigRandom(I),V=this.ecparams.G,F=V.multiply(H),P=F.getX().toBigInteger().mod(I);while(P.compareTo(ee.ZERO)<=0);var k=H.modInverse(I).multiply(D.add(_.multiply(P))).mod(I);return this.serializeSig(P,k)},this.verifyWithMessageHash=function(A,S){return this.verifyHex(A,S,this.pubKeyHex)},this.verifyHex=function(A,S,_){try{var I,D,H=l.parseSigHex(S);I=H.r,D=H.s;var V=o.decodeFromHex(this.ecparams.curve,_),F=new s(A.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(F,I,D,V)}catch{return!1}},this.verify=function(A,S,_){var I,D;if(Bitcoin.Util.isArray(S)){var H=this.parseSig(S);I=H.r,D=H.s}else if(typeof S=="object"&&S.r&&S.s)I=S.r,D=S.s;else throw"Invalid value for signature";var V;if(_ instanceof dt)V=_;else if(Bitcoin.Util.isArray(_))V=o.decodeFrom(this.ecparams.curve,_);else throw"Invalid format for pubkey value, must be byte array or ECPointFp";var F=s.fromByteArrayUnsigned(A);return this.verifyRaw(F,I,D,V)},this.verifyRaw=function(A,S,_,I){var D=this.ecparams.n,H=this.ecparams.G;if(S.compareTo(s.ONE)<0||S.compareTo(D)>=0||_.compareTo(s.ONE)<0||_.compareTo(D)>=0)return!1;var V=_.modInverse(D),F=A.multiply(V).mod(D),P=S.multiply(V).mod(D),k=H.multiply(F).add(I.multiply(P)),L=k.getX().toBigInteger().mod(D);return L.equals(S)},this.serializeSig=function(A,S){var _=A.toByteArraySigned(),I=S.toByteArraySigned(),D=[];return D.push(2),D.push(_.length),D=D.concat(_),D.push(2),D.push(I.length),D=D.concat(I),D.unshift(D.length),D.unshift(48),D},this.parseSig=function(A){var S;if(A[0]!=48)throw new Error("Signature not a valid DERSequence");if(S=2,A[S]!=2)throw new Error("First element in signature must be a DERInteger");var _=A.slice(S+2,S+2+A[S+1]);if(S+=2+A[S+1],A[S]!=2)throw new Error("Second element in signature must be a DERInteger");var I=A.slice(S+2,S+2+A[S+1]);S+=2+A[S+1];var D=s.fromByteArrayUnsigned(_),H=s.fromByteArrayUnsigned(I);return{r:D,s:H}},this.parseSigCompact=function(A){if(A.length!==65)throw"Signature has the wrong length";var S=A[0]-27;if(S<0||S>7)throw"Invalid signature type";var _=this.ecparams.n,I=s.fromByteArrayUnsigned(A.slice(1,33)).mod(_),D=s.fromByteArrayUnsigned(A.slice(33,65)).mod(_);return{r:I,s:D,i:S}},this.readPKCS5PrvKeyHex=function(A){if(f(A)===!1)throw new Error("not ASN.1 hex string");var S,_,I;try{S=p(A,0,["[0]",0],"06"),_=p(A,0,[1],"04");try{I=p(A,0,["[1]",0],"03")}catch{}}catch{throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=d(S),this.curveName===void 0)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(I),this.setPrivateKeyHex(_),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(A){if(f(A)===!1)throw new a("not ASN.1 hex string");var S,_,I,D;try{S=p(A,0,[1,0],"06"),_=p(A,0,[1,1],"06"),I=p(A,0,[2,0,1],"04");try{D=p(A,0,[2,0,"[1]",0],"03")}catch{}}catch{throw new a("malformed PKCS#8 plain ECC private key")}if(this.curveName=d(_),this.curveName===void 0)throw new a("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(D),this.setPrivateKeyHex(I),this.isPublic=!1},this.readPKCS8PubKeyHex=function(A){if(f(A)===!1)throw new a("not ASN.1 hex string");var S,_,I;try{S=p(A,0,[0,0],"06"),_=p(A,0,[0,1],"06"),I=p(A,0,[1],"03")}catch{throw new a("malformed PKCS#8 ECC public key")}if(this.curveName=d(_),this.curveName===null)throw new a("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(I)},this.readCertPubKeyHex=function(A,S){if(f(A)===!1)throw new a("not ASN.1 hex string");var _,I;try{_=p(A,0,[0,5,0,1],"06"),I=p(A,0,[0,5,1],"03")}catch{throw new a("malformed X.509 certificate ECC public key")}if(this.curveName=d(_),this.curveName===null)throw new a("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(I)},e!==void 0&&e.curve!==void 0&&(this.curveName=e.curve),this.curveName===void 0&&(this.curveName=t),this.setNamedCurve(this.curveName),e!==void 0&&(e.prv!==void 0&&this.setPrivateKeyHex(e.prv),e.pub!==void 0&&this.setPublicKeyHex(e.pub))};m.crypto.ECDSA.parseSigHex=function(e){var t=m.crypto.ECDSA.parseSigHexInHexRS(e),r=new ee(t.r,16),n=new ee(t.s,16);return{r,s:n}};m.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=Ae,r=t.getChildIdx,n=t.getV;if(t.checkStrictDER(e,0),e.substr(0,2)!="30")throw new Error("signature is not a ASN.1 sequence");var i=r(e,0);if(i.length!=2)throw new Error("signature shall have two elements");var a=i[0],s=i[1];if(e.substr(a,2)!="02")throw new Error("1st item not ASN.1 integer");if(e.substr(s,2)!="02")throw new Error("2nd item not ASN.1 integer");var o=n(e,a),l=n(e,s);return{r:o,s:l}};m.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=m.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");r.substr(0,2)=="00"&&(r=r.substr(2)),n.substr(0,2)=="00"&&(n=n.substr(2));var i=Math.max(r.length,n.length);return r=("000000"+r).slice(-i),n=("000000"+n).slice(-i),r+n}if(r.substr(0,2)=="00"&&r.length%32==2&&(r=r.substr(2)),n.substr(0,2)=="00"&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n};m.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return m.crypto.ECDSA.hexRSSigToASN1Sig(t,r)};m.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new ee(e,16),n=new ee(t,16);return m.crypto.ECDSA.biRSSigToASN1Sig(r,n)};m.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=m.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t}),a=new r.DERSequence({array:[n,i]});return a.tohex()};m.crypto.ECDSA.getName=function(e){return e==="2b8104001f"?"secp192k1":e==="2a8648ce3d030107"?"secp256r1":e==="2b8104000a"?"secp256k1":e==="2b81040021"?"secp224r1":e==="2b81040022"?"secp384r1":e==="2b81040023"?"secp521r1":"|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)!==-1?"secp256r1":"|secp256k1|".indexOf(e)!==-1?"secp256k1":"|secp224r1|NIST P-224|P-224|".indexOf(e)!==-1?"secp224r1":"|secp384r1|NIST P-384|P-384|".indexOf(e)!==-1?"secp384r1":"|secp521r1|NIST P-521|P-521|".indexOf(e)!==-1?"secp521r1":null};(typeof m>"u"||!m)&&(m={});(typeof m.crypto>"u"||!m.crypto)&&(m.crypto={});m.crypto.ECParameterDB=new function(){var e={},t={};function r(n){return new ee(n,16)}this.getByName=function(n){var i=n;if(typeof t[i]<"u"&&(i=t[n]),typeof e[i]<"u")return e[i];throw"unregistered EC curve name: "+i},this.regist=function(n,i,a,s,o,l,h,d,E,p,f,w){e[n]={};var g=r(a),y=r(s),A=r(o),S=r(l),_=r(h),I=new ms(g,y,A),D=I.decodePointHex("04"+d+E);e[n].name=n,e[n].keylen=i,e[n].keycharlen=Math.ceil(i/8)*2,e[n].curve=I,e[n].G=D,e[n].n=S,e[n].h=_,e[n].oid=f,e[n].info=w;for(var H=0;H<p.length;H++)t[p[H]]=n}};m.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field");m.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field");m.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field");m.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]);m.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]);m.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]);m.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]);m.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]);m.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]);m.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);(typeof m>"u"||!m)&&(m={});(typeof m.crypto>"u"||!m.crypto)&&(m.crypto={});m.crypto.DSA=function(){var e=Ae,t=e.getVbyList,r=e.getVbyListEx,n=e.isASN1HEX,i=ee;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(a,s,o,l,h){this.isPrivate=!0,this.p=a,this.q=s,this.g=o,this.y=l,this.x=h},this.setPrivateHex=function(a,s,o,l,h){var d,E,p,f,w;d=new ee(a,16),E=new ee(s,16),p=new ee(o,16),typeof l=="string"&&l.length>1?f=new ee(l,16):f=null,w=new ee(h,16),this.setPrivate(d,E,p,f,w)},this.setPublic=function(a,s,o,l){this.isPublic=!0,this.p=a,this.q=s,this.g=o,this.y=l,this.x=null},this.setPublicHex=function(a,s,o,l){var h,d,E,p;h=new ee(a,16),d=new ee(s,16),E=new ee(o,16),p=new ee(l,16),this.setPublic(h,d,E,p)},this.signWithMessageHash=function(a){var s=this.p,o=this.q,l=this.g,h=this.y,d=this.x,E=m.crypto.Util.getRandomBigIntegerMinToMax(ee.ONE.add(ee.ONE),o.subtract(ee.ONE)),p=a.substr(0,o.bitLength()/4),f=new ee(p,16),w=l.modPow(E,s).mod(o),g=E.modInverse(o).multiply(f.add(d.multiply(w))).mod(o),y=m.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:w}},{int:{bigint:g}}]});return y},this.verifyWithMessageHash=function(a,s){var o=this.p,l=this.q,h=this.g,d=this.y,E=this.parseASN1Signature(s),p=E[0],f=E[1],w=a.substr(0,l.bitLength()/4),g=new ee(w,16);if(ee.ZERO.compareTo(p)>0||p.compareTo(l)>0||ee.ZERO.compareTo(f)>=0||f.compareTo(l)>0)throw"invalid DSA signature";var y=f.modInverse(l),A=g.multiply(y).mod(l),S=p.multiply(y).mod(l),_=h.modPow(A,o).multiply(d.modPow(S,o)).mod(o).mod(l);return _.compareTo(p)==0},this.parseASN1Signature=function(a){try{var s=new i(r(a,0,[0],"02"),16),o=new i(r(a,0,[1],"02"),16);return[s,o]}catch{throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(a){var s,o,l,h,d;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{s=r(a,0,[1],"02"),o=r(a,0,[2],"02"),l=r(a,0,[3],"02"),h=r(a,0,[4],"02"),d=r(a,0,[5],"02")}catch{throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(s,o,l,h,d)},this.readPKCS8PrvKeyHex=function(a){var s,o,l,h;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{s=r(a,0,[1,1,0],"02"),o=r(a,0,[1,1,1],"02"),l=r(a,0,[1,1,2],"02"),h=r(a,0,[2,0],"02")}catch{throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(s,o,l,null,h)},this.readPKCS8PubKeyHex=function(a){var s,o,l,h;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{s=r(a,0,[0,1,0],"02"),o=r(a,0,[0,1,1],"02"),l=r(a,0,[0,1,2],"02"),h=r(a,0,[1,0],"02")}catch{throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(s,o,l,h)},this.readCertPubKeyHex=function(a,s){var o,l,h,d;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{o=r(a,0,[0,5,0,1,0],"02"),l=r(a,0,[0,5,0,1,1],"02"),h=r(a,0,[0,5,0,1,2],"02"),d=r(a,0,[0,5,1,0],"02")}catch{throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(o,l,h,d)}};var at=function(){var e=function(g,y,A){return n(Ce.AES,g,y,A)},t=function(g,y,A){return n(Ce.TripleDES,g,y,A)},r=function(g,y,A){return n(Ce.DES,g,y,A)},n=function(g,y,A,S){var _=Ce.enc.Hex.parse(y),I=Ce.enc.Hex.parse(A),D=Ce.enc.Hex.parse(S),H={};H.key=I,H.iv=D,H.ciphertext=_;var V=g.decrypt(H,I,{iv:D});return Ce.enc.Hex.stringify(V)},i=function(g,y,A){return o(Ce.AES,g,y,A)},a=function(g,y,A){return o(Ce.TripleDES,g,y,A)},s=function(g,y,A){return o(Ce.DES,g,y,A)},o=function(g,y,A,S){var _=Ce.enc.Hex.parse(y),I=Ce.enc.Hex.parse(A),D=Ce.enc.Hex.parse(S),H=g.encrypt(_,I,{iv:D}),V=Ce.enc.Hex.parse(H.toString()),F=Ce.enc.Base64.stringify(V);return F},l={"AES-256-CBC":{proc:e,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:t,eproc:a,keylen:24,ivlen:8},"DES-CBC":{proc:r,eproc:s,keylen:8,ivlen:8}},h=function(g){return l[g].proc},d=function(g){var y=Ce.lib.WordArray.random(g),A=Ce.enc.Hex.stringify(y);return A},E=function(g){var y={},A=g.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));A&&(y.cipher=A[1],y.ivsalt=A[2]);var S=g.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));S&&(y.type=S[1]);var _=-1,I=0;g.indexOf(`\r
\r
`)!=-1&&(_=g.indexOf(`\r
\r
`),I=2),g.indexOf(`
`)!=-1&&(_=g.indexOf(`
`),I=1);var D=g.indexOf("-----END");if(_!=-1&&D!=-1){var H=g.substring(_+I*2,D-I);H=H.replace(/\s+/g,""),y.data=H}return y},p=function(g,y,A){for(var S=A.substring(0,16),_=Ce.enc.Hex.parse(S),I=Ce.enc.Utf8.parse(y),D=l[g].keylen+l[g].ivlen,H="",V=null;;){var F=Ce.algo.MD5.create();if(V!=null&&F.update(V),F.update(I),F.update(_),V=F.finalize(),H=H+Ce.enc.Hex.stringify(V),H.length>=D*2)break}var P={};return P.keyhex=H.substr(0,l[g].keylen*2),P.ivhex=H.substr(l[g].keylen*2,l[g].ivlen*2),P},f=function(g,y,A,S){var _=Ce.enc.Base64.parse(g),I=Ce.enc.Hex.stringify(_),D=l[y].proc,H=D(I,A,S);return H},w=function(g,y,A,S){var _=l[y].eproc,I=_(g,A,S);return I};return{version:"1.0.0",parsePKCS5PEM:function(g){return E(g)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(g,y,A){return p(g,y,A)},decryptKeyB64:function(g,y,A,S){return f(g,y,A,S)},getDecryptedKeyHex:function(g,y){var A=E(g),S=A.type,_=A.cipher,I=A.ivsalt,D=A.data,H=p(_,y,I),V=H.keyhex,F=f(D,_,V,I);return F},getEncryptedPKCS5PEMFromPrvKeyHex:function(g,y,A,S,_){var k="";if((typeof S>"u"||S==null)&&(S="AES-256-CBC"),typeof l[S]>"u")throw new Error("KEYUTIL unsupported algorithm: "+S);if(typeof _>"u"||_==null){var I=l[S].ivlen,D=d(I);_=D.toUpperCase()}var H=p(S,A,_),V=H.keyhex,F=w(y,S,V,_),P=F.replace(/(.{64})/g,`$1\r
`),k="-----BEGIN "+g+` PRIVATE KEY-----\r
`;return k+=`Proc-Type: 4,ENCRYPTED\r
`,k+="DEK-Info: "+S+","+_+`\r
`,k+=`\r
`,k+=P,k+=`\r
-----END `+g+` PRIVATE KEY-----\r
`,k},getEncryptedPKCS8PEM:function(g,y,A){var S=this.getEncryptedPKCS8Hex(g,y,A);return Or(S,"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(g,y,A){var S;A==null||A==null?S={}:S=JSON.parse(JSON.stringify(A)),S.plain=g,this.initPBES2Param(S),this.encryptPBES2Param(S,y);var _=this.generatePBES2ASN1Param(S);return m.asn1.ASN1Util.newObject(_).tohex()},initPBES2Param:function(g){if(_t(g,"encalg")==null&&(g.encalg="aes256-CBC"),_t(g,"iter")==null&&(g.iter=2048),_t(g,"prf")==null&&(g.prf="hmacWithSHA256"),_t(g,"salt")==null&&(g.salt=Ce.enc.Hex.stringify(Ce.lib.WordArray.random(8))),_t(g,"enciv")==null){var y;g.encalg=="des-EDE3-CBC"&&(y=8),g.encalg=="aes128-CBC"&&(y=16),g.encalg=="aes256-CBC"&&(y=16),g.enciv=Ce.enc.Hex.stringify(Ce.lib.WordArray.random(y))}},encryptPBES2Param:function(g,y){var A=at.getDKFromPBES2Param(g,y);try{var S=m.crypto.Cipher.encrypt(g.plain,A,g.encalg,{iv:g.enciv})}catch{throw new Error("encrypt error: "+g.plain+" "+A+" "+g.encalg+" "+g.enciv)}g.enc=S},generatePBES2ASN1Param:function(g){var y={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:g.salt}},{int:{hex:Wm(g.iter)}}]}]},{seq:[{oid:g.encalg},{octstr:{hex:g.enciv}}]}]}]},{octstr:{hex:g.enc}}]};return g.prf!="hmacWithSHA1"&&y.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:g.prf},{null:""}]}),y},parseHexOfEncryptedPKCS8:function(g){var y=Ae,A=y.getChildIdx,S=y.getV,_={},I=A(g,0);if(I.length!=2)throw new Error("malformed format: SEQUENCE(0).items != 2: "+I.length);_.ciphertext=S(g,I[1]);var D=A(g,I[0]);if(D.length!=2)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+D.length);if(S(g,D[0])!="2a864886f70d01050d")throw new Error("this only supports pkcs5PBES2");var H=A(g,D[1]);if(D.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+H.length);var V=A(g,H[1]);if(V.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+V.length);if(S(g,V[0])!="2a864886f70d0307")throw"this only supports TripleDES";_.encryptionSchemeAlg="TripleDES",_.encryptionSchemeIV=S(g,V[1]);var F=A(g,H[0]);if(F.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+F.length);if(S(g,F[0])!="2a864886f70d01050c")throw new Error("this only supports pkcs5PBKDF2");var P=A(g,F[1]);if(P.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+P.length);_.pbkdf2Salt=S(g,P[0]);var k=S(g,P[1]);try{_.pbkdf2Iter=parseInt(k,16)}catch{throw new Error("malformed format pbkdf2Iter: "+k)}return _},getPBKDF2KeyHexFromParam:function(g,y){var A=Ce.enc.Hex.parse(g.pbkdf2Salt),S=g.pbkdf2Iter,_=Ce.PBKDF2(y,A,{keySize:192/32,iterations:S}),I=Ce.enc.Hex.stringify(_);return I},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(g,y){var A=kt(g,"ENCRYPTED PRIVATE KEY"),S=this.parseHexOfEncryptedPKCS8(A),_=at.getPBKDF2KeyHexFromParam(S,y),I={};I.ciphertext=Ce.enc.Hex.parse(S.ciphertext);var D=Ce.enc.Hex.parse(_),H=Ce.enc.Hex.parse(S.encryptionSchemeIV),V=Ce.TripleDES.decrypt(I,D,{iv:H}),F=Ce.enc.Hex.stringify(V);return F},parsePBES2:function(g){var y=Ae.parse(g);if(_t(y,"seq.0.seq.0.oid")!="pkcs5PBES2"||_t(y,"seq.0.seq.1.seq.0.seq.0.oid")!="pkcs5PBKDF2")throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var A=_t(y,"seq.0.seq.1.seq.0.seq.1.seq");if(A==null)throw new Error("PBKDF2 parameter not found");var S=_t(A,"0.octstr.hex"),_=_t(A,"1.int.hex"),I=_t(A,"2.seq.0.oid","hmacWithSHA1"),D=-1;try{D=parseInt(_,16)}catch{throw new Error("iter not proper value")}var H=_t(y,"seq.0.seq.1.seq.1.seq.0.oid"),V=_t(y,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),F=_t(y,"seq.1.octstr.hex");if(H==null||V==null||F==null)throw new Error("encalg, enciv or enc is undefined");var P={salt:S,iter:D,prf:I,encalg:H,enciv:V,enc:F};return P},getDKFromPBES2Param:function(g,y){var A={hmacWithSHA1:Ce.algo.SHA1,hmacWithSHA224:Ce.algo.SHA224,hmacWithSHA256:Ce.algo.SHA256,hmacWithSHA384:Ce.algo.SHA384,hmacWithSHA512:Ce.algo.SHA512},S={"des-EDE3-CBC":192/32,"aes128-CBC":128/32,"aes256-CBC":256/32},_=A[g.prf];if(_==null)throw new Error("unsupported prf");var I=S[g.encalg];if(I==null)throw new Error("unsupported encalg");var D=Ce.enc.Hex.parse(g.salt),H=g.iter;try{var V=Ce.PBKDF2(y,D,{keySize:I,iterations:H,hasher:_});return Ce.enc.Hex.stringify(V)}catch(F){throw new Error("PBKDF2 error: "+F+" "+JSON.stringify(g)+" "+y)}},getPlainHexFromEncryptedPKCS8PEM:function(g,y){if(g.indexOf("BEGIN ENCRYPTED PRIVATE KEY")==-1)throw new Error("not Encrypted PKCS#8 PEM string");var A=kt(g),S;try{S=at.parsePBES2(A)}catch(I){throw new Error("malformed PBES2 format: "+I.message)}var _=at.getDKFromPBES2Param(S,y);return m.crypto.Cipher.decrypt(S.enc,_,S.encalg,{iv:S.enciv})},getKeyFromEncryptedPKCS8PEM:function(g,y){var A=this.getPlainHexFromEncryptedPKCS8PEM(g,y),S=this.getKeyFromPlainPrivatePKCS8Hex(A);return S},parsePlainPrivatePKCS8Hex:function(g){var y=Ae,A=y.getChildIdx,S=y.getV,_={};if(_.algparam=null,g.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var I=A(g,0);if(I.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(g.substr(I[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var D=A(g,I[1]);if(D.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(g.substr(D[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(_.algoid=S(g,D[0]),g.substr(D[1],2)=="06"&&(_.algparam=S(g,D[1])),g.substr(I[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return _.keyidx=y.getVidx(g,I[2]),_},getKeyFromPlainPrivatePKCS8PEM:function(g){var y=kt(g,"PRIVATE KEY"),A=this.getKeyFromPlainPrivatePKCS8Hex(y);return A},getKeyFromPlainPrivatePKCS8Hex:function(g){var y=this.parsePlainPrivatePKCS8Hex(g),A;if(y.algoid=="2a864886f70d010101")A=new ze;else if(y.algoid=="2a8648ce380401")A=new m.crypto.DSA;else if(y.algoid=="2a8648ce3d0201")A=new m.crypto.ECDSA;else throw new Error("unsupported private key algorithm");return A.readPKCS8PrvKeyHex(g),A},_getKeyFromPublicPKCS8Hex:function(g){var y,A=Ae.getVbyList(g,0,[0,0],"06");if(A==="2a864886f70d010101")y=new ze;else if(A==="2a8648ce380401")y=new m.crypto.DSA;else if(A==="2a8648ce3d0201")y=new m.crypto.ECDSA;else throw new Error("unsupported PKCS#8 public key hex");return y.readPKCS8PubKeyHex(g),y},parsePublicRawRSAKeyHex:function(g){var y=Ae,A=y.getChildIdx,S=y.getV,_={};if(g.substr(0,2)!="30")throw new Error("malformed RSA key(code:001)");var I=A(g,0);if(I.length!=2)throw new Error("malformed RSA key(code:002)");if(g.substr(I[0],2)!="02")throw new Error("malformed RSA key(code:003)");if(_.n=S(g,I[0]),g.substr(I[1],2)!="02")throw new Error("malformed RSA key(code:004)");return _.e=S(g,I[1]),_},parsePublicPKCS8Hex:function(g){var y=Ae,A=y.getChildIdx,S=y.getV,_={};_.algparam=null;var I=A(g,0);if(I.length!=2)throw new Error("outer DERSequence shall have 2 elements: "+I.length);var D=I[0];if(g.substr(D,2)!="30")throw new Error("malformed PKCS8 public key(code:001)");var H=A(g,D);if(H.length!=2)throw new Error("malformed PKCS8 public key(code:002)");if(g.substr(H[0],2)!="06")throw new Error("malformed PKCS8 public key(code:003)");if(_.algoid=S(g,H[0]),g.substr(H[1],2)=="06"?_.algparam=S(g,H[1]):g.substr(H[1],2)=="30"&&(_.algparam={},_.algparam.p=y.getVbyList(g,H[1],[0],"02"),_.algparam.q=y.getVbyList(g,H[1],[1],"02"),_.algparam.g=y.getVbyList(g,H[1],[2],"02")),g.substr(I[1],2)!="03")throw new Error("malformed PKCS8 public key(code:004)");return _.key=S(g,I[1]).substr(2),_}}}();at.getKey=function(e,t,r){var n=Ae,i=n.getChildIdx,a=n.getV,s=n.getVbyList,o=m.crypto,l=o.ECDSA,h=o.DSA,d=ze,E=kt,p=at;if(typeof d<"u"&&e instanceof d||typeof l<"u"&&e instanceof l||typeof h<"u"&&e instanceof h)return e;if(e.curve!==void 0&&e.xy!==void 0&&e.d===void 0)return new l({pub:e.xy,curve:e.curve});if(e.curve!==void 0&&e.d!==void 0)return new l({prv:e.d,curve:e.curve});if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d===void 0){var f=new d;return f.setPublic(e.n,e.e),f}if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p!==void 0&&e.q!==void 0&&e.dp!==void 0&&e.dq!==void 0&&e.co!==void 0&&e.qi===void 0){var f=new d;return f.setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),f}if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p===void 0){var f=new d;return f.setPrivate(e.n,e.e,e.d),f}if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x===void 0){var f=new h;return f.setPublic(e.p,e.q,e.g,e.y),f}if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x!==void 0){var f=new h;return f.setPrivate(e.p,e.q,e.g,e.y,e.x),f}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d===void 0){var f=new d;return f.setPublic(Pt(e.n),Pt(e.e)),f}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p!==void 0&&e.q!==void 0&&e.dp!==void 0&&e.dq!==void 0&&e.qi!==void 0){var f=new d;return f.setPrivateEx(Pt(e.n),Pt(e.e),Pt(e.d),Pt(e.p),Pt(e.q),Pt(e.dp),Pt(e.dq),Pt(e.qi)),f}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0){var f=new d;return f.setPrivate(Pt(e.n),Pt(e.e),Pt(e.d)),f}if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d===void 0){var w=new l({curve:e.crv}),g=w.ecparams.keycharlen,y=("0000000000"+Pt(e.x)).slice(-g),A=("0000000000"+Pt(e.y)).slice(-g),S="04"+y+A;return w.setPublicKeyHex(S),w}if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d!==void 0){var w=new l({curve:e.crv}),g=w.ecparams.keycharlen,y=("0000000000"+Pt(e.x)).slice(-g),A=("0000000000"+Pt(e.y)).slice(-g),S="04"+y+A,_=("0000000000"+Pt(e.d)).slice(-g);return w.setPublicKeyHex(S),w.setPrivateKeyHex(_),w}if(r==="pkcs5prv"){var I=e,n=Ae,D,f;if(D=i(I,0),D.length===9)f=new d,f.readPKCS5PrvKeyHex(I);else if(D.length===6)f=new h,f.readPKCS5PrvKeyHex(I);else if(D.length>2&&I.substr(D[1],2)==="04")f=new l,f.readPKCS5PrvKeyHex(I);else throw new Error("unsupported PKCS#1/5 hexadecimal key");return f}if(r==="pkcs8prv"){var f=p.getKeyFromPlainPrivatePKCS8Hex(e);return f}if(r==="pkcs8pub")return p._getKeyFromPublicPKCS8Hex(e);if(r==="x509pub")return He.getPublicKeyFromCertHex(e);if(e.indexOf("-END CERTIFICATE-",0)!=-1||e.indexOf("-END X509 CERTIFICATE-",0)!=-1||e.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return He.getPublicKeyFromCertPEM(e);if(e.indexOf("-END PUBLIC KEY-")!=-1){var H=kt(e,"PUBLIC KEY");return p._getKeyFromPublicPKCS8Hex(H)}if(e.indexOf("-END RSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var V=E(e,"RSA PRIVATE KEY");return p.getKey(V,null,"pkcs5prv")}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var F=E(e,"DSA PRIVATE KEY"),P=s(F,0,[1],"02"),k=s(F,0,[2],"02"),L=s(F,0,[3],"02"),q=s(F,0,[4],"02"),J=s(F,0,[5],"02"),f=new h;return f.setPrivate(new ee(P,16),new ee(k,16),new ee(L,16),new ee(q,16),new ee(J,16)),f}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var V=E(e,"EC PRIVATE KEY");return p.getKey(V,null,"pkcs5prv")}if(e.indexOf("-END PRIVATE KEY-")!=-1)return p.getKeyFromPlainPrivatePKCS8PEM(e);if(e.indexOf("-END RSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var z=p.getDecryptedKeyHex(e,t),K=new ze;return K.readPKCS5PrvKeyHex(z),K}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var F=p.getDecryptedKeyHex(e,t),f=s(F,0,[1],"04"),X=s(F,0,[2,0],"06"),ie=s(F,0,[3,0],"03").substr(2),be="";if(m.crypto.OID.oidhex2name[X]!==void 0)be=m.crypto.OID.oidhex2name[X];else throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+X);var w=new l({curve:be});return w.setPublicKeyHex(ie),w.setPrivateKeyHex(f),w.isPublic=!1,w}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var F=p.getDecryptedKeyHex(e,t),P=s(F,0,[1],"02"),k=s(F,0,[2],"02"),L=s(F,0,[3],"02"),q=s(F,0,[4],"02"),J=s(F,0,[5],"02"),f=new h;return f.setPrivate(new ee(P,16),new ee(k,16),new ee(L,16),new ee(q,16),new ee(J,16)),f}if(e.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return p.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")};at.generateKeypair=function(e,t){if(e=="RSA"){var r=t,n=new ze;n.generate(r,"10001"),n.isPrivate=!0,n.isPublic=!0;var i=new ze,a=n.n.toString(16),s=n.e.toString(16);i.setPublic(a,s),i.isPrivate=!1,i.isPublic=!0;var o={};return o.prvKeyObj=n,o.pubKeyObj=i,o}else if(e=="EC"){var l=t,h=new m.crypto.ECDSA({curve:l}),d=h.generateKeyPairHex(),n=new m.crypto.ECDSA({curve:l});n.setPublicKeyHex(d.ecpubhex),n.setPrivateKeyHex(d.ecprvhex),n.isPrivate=!0,n.isPublic=!1;var i=new m.crypto.ECDSA({curve:l});i.setPublicKeyHex(d.ecpubhex),i.isPrivate=!1,i.isPublic=!0;var o={};return o.prvKeyObj=n,o.pubKeyObj=i,o}else throw new Error("unknown algorithm: "+e)};at.getPEM=function(e,t,r,n,i,a){var s=m,o=s.asn1,l=o.DERObjectIdentifier,h=o.DERInteger,d=o.ASN1Util.newObject,E=o.x509,p=E.SubjectPublicKeyInfo,f=s.crypto,w=f.DSA,g=f.ECDSA,y=ze;function A(K){var X=d({seq:[{int:0},{int:{bigint:K.n}},{int:K.e},{int:{bigint:K.d}},{int:{bigint:K.p}},{int:{bigint:K.q}},{int:{bigint:K.dmp1}},{int:{bigint:K.dmq1}},{int:{bigint:K.coeff}}]});return X}function S(K){var X=d({seq:[{int:1},{octstr:{hex:K.prvKeyHex}},{tag:["a0",!0,{oid:{name:K.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+K.pubKeyHex}}]}]});return X}function _(K){var X=d({seq:[{int:0},{int:{bigint:K.p}},{int:{bigint:K.q}},{int:{bigint:K.g}},{int:{bigint:K.y}},{int:{bigint:K.x}}]});return X}if((y!==void 0&&e instanceof y||w!==void 0&&e instanceof w||g!==void 0&&e instanceof g)&&e.isPublic==!0&&(t===void 0||t=="PKCS8PUB")){var I=new p(e),D=I.tohex();return Or(D,"PUBLIC KEY")}if(t=="PKCS1PRV"&&y!==void 0&&e instanceof y&&(r===void 0||r==null)&&e.isPrivate==!0){var I=A(e),D=I.tohex();return Or(D,"RSA PRIVATE KEY")}if(t=="PKCS1PRV"&&g!==void 0&&e instanceof g&&(r===void 0||r==null)&&e.isPrivate==!0){var H=new l({name:e.curveName}),V=H.tohex(),F=S(e),P=F.tohex(),k="";return k+=Or(V,"EC PARAMETERS"),k+=Or(P,"EC PRIVATE KEY"),k}if(t=="PKCS1PRV"&&w!==void 0&&e instanceof w&&(r===void 0||r==null)&&e.isPrivate==!0){var I=_(e),D=I.tohex();return Or(D,"DSA PRIVATE KEY")}if(t=="PKCS5PRV"&&y!==void 0&&e instanceof y&&r!==void 0&&r!=null&&e.isPrivate==!0){var I=A(e),D=I.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",D,r,n,a)}if(t=="PKCS5PRV"&&g!==void 0&&e instanceof g&&r!==void 0&&r!=null&&e.isPrivate==!0){var I=S(e),D=I.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",D,r,n,a)}if(t=="PKCS5PRV"&&w!==void 0&&e instanceof w&&r!==void 0&&r!=null&&e.isPrivate==!0){var I=_(e),D=I.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",D,r,n,a)}var L=function(K,X){if(typeof X=="string")return at.getEncryptedPKCS8PEM(K,X);if(typeof X=="object"&&_t(X,"passcode")!=null){var ie=JSON.parse(JSON.stringify(X)),be=ie.passcode;return delete ie.passcode,at.getEncryptedPKCS8PEM(K,be,ie)}};if(t=="PKCS8PRV"&&y!=null&&e instanceof y&&e.isPrivate==!0){var q=A(e),J=q.tohex(),I=d({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:J}}]}),D=I.tohex();return r===void 0||r==null?Or(D,"PRIVATE KEY"):L(D,r)}if(t=="PKCS8PRV"&&g!==void 0&&e instanceof g&&e.isPrivate==!0){var z={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};typeof e.pubKeyHex=="string"&&z.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});var q=new d(z),J=q.tohex(),I=d({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:J}}]}),D=I.tohex();return r===void 0||r==null?Or(D,"PRIVATE KEY"):L(D,r)}if(t=="PKCS8PRV"&&w!==void 0&&e instanceof w&&e.isPrivate==!0){var q=new h({bigint:e.x}),J=q.tohex(),I=d({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:J}}]}),D=I.tohex();return r===void 0||r==null?Or(D,"PRIVATE KEY"):L(D,r)}throw new Error("unsupported object nor format")};at.getKeyFromCSRPEM=function(e){var t=kt(e,"CERTIFICATE REQUEST"),r=at.getKeyFromCSRHex(t);return r};at.getKeyFromCSRHex=function(e){var t=at.parseCSRHex(e),r=at.getKey(t.p8pubkeyhex,null,"pkcs8pub");return r};at.parseCSRHex=function(e){var t=Ae,r=t.getChildIdx,n=t.getTLV,i={},a=e;if(a.substr(0,2)!="30")throw new Error("malformed CSR(code:001)");var s=r(a,0);if(s.length<1)throw new Error("malformed CSR(code:002)");if(a.substr(s[0],2)!="30")throw new Error("malformed CSR(code:003)");var o=r(a,s[0]);if(o.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(a,o[2]),i};at.getKeyID=function(e){var t=at,r=Ae;typeof e=="string"&&e.indexOf("BEGIN ")!=-1&&(e=t.getKey(e));var n=kt(t.getPEM(e)),i=r.getIdxbyList(n,0,[1]),a=r.getV(n,i).substring(2);return m.crypto.Util.hashHex(a,"sha1")};at.getJWK=function(e,t,r,n,i){var a,s={},o,l=m.crypto.Util.hashHex;if(typeof e=="string")a=at.getKey(e),e.indexOf("CERTIFICATE")!=-1&&(o=kt(e));else if(typeof e=="object")e instanceof He?(a=e.getPublicKey(),o=e.hex):a=e;else throw new Error("unsupported keyinfo type");if(a instanceof ze&&a.isPrivate)s.kty="RSA",s.n=sr(a.n.toString(16)),s.e=sr(a.e.toString(16)),s.d=sr(a.d.toString(16)),s.p=sr(a.p.toString(16)),s.q=sr(a.q.toString(16)),s.dp=sr(a.dmp1.toString(16)),s.dq=sr(a.dmq1.toString(16)),s.qi=sr(a.coeff.toString(16));else if(a instanceof ze&&a.isPublic)s.kty="RSA",s.n=sr(a.n.toString(16)),s.e=sr(a.e.toString(16));else if(a instanceof m.crypto.ECDSA&&a.isPrivate){var h=a.getShortNISTPCurveName();if(h!=="P-256"&&h!=="P-384"&&h!=="P-521")throw new Error("unsupported curve name for JWT: "+h);var d=a.getPublicKeyXYHex();s.kty="EC",s.crv=h,s.x=sr(d.x),s.y=sr(d.y),s.d=sr(a.prvKeyHex)}else if(a instanceof m.crypto.ECDSA&&a.isPublic){var h=a.getShortNISTPCurveName();if(h!=="P-256"&&h!=="P-384"&&h!=="P-521")throw new Error("unsupported curve name for JWT: "+h);var d=a.getPublicKeyXYHex();s.kty="EC",s.crv=h,s.x=sr(d.x),s.y=sr(d.y)}if(s.kty==null)throw new Error("unsupported keyinfo");return!a.isPrivate&&t!=!0&&(s.kid=m.jws.JWS.getJWKthumbprint(s)),o!=null&&r!=!0&&(s.x5c=[gs(o)]),o!=null&&n!=!0&&(s.x5t=Ju(gs(l(o,"sha1")))),o!=null&&i!=!0&&(s["x5t#S256"]=Ju(gs(l(o,"sha256")))),s};at.getJWKFromKey=function(e){return at.getJWK(e,!0,!0,!0,!0)};ze.getPosArrayOfChildrenFromHex=function(e){return Ae.getChildIdx(e,0)};ze.getHexValueArrayOfChildrenFromHex=function(e){var t=Ae,r=t.getV,p=ze.getPosArrayOfChildrenFromHex(e),n=r(e,p[0]),i=r(e,p[1]),a=r(e,p[2]),s=r(e,p[3]),o=r(e,p[4]),l=r(e,p[5]),h=r(e,p[6]),d=r(e,p[7]),E=r(e,p[8]),p=new Array;return p.push(n,i,a,s,o,l,h,d,E),p};ze.prototype.readPrivateKeyFromPEMString=function(e){var t=kt(e),r=ze.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])};ze.prototype.readPKCS5PrvKeyHex=function(e){var t=ze.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};ze.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,a,s,o,l,h=Ae,d=h.getVbyListEx;if(h.isASN1HEX(e)===!1)throw new Error("not ASN.1 hex string");try{t=d(e,0,[2,0,1],"02"),r=d(e,0,[2,0,2],"02"),n=d(e,0,[2,0,3],"02"),i=d(e,0,[2,0,4],"02"),a=d(e,0,[2,0,5],"02"),s=d(e,0,[2,0,6],"02"),o=d(e,0,[2,0,7],"02"),l=d(e,0,[2,0,8],"02")}catch{throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,a,s,o,l)};ze.prototype.readPKCS5PubKeyHex=function(e){var t=Ae,r=t.getV;if(t.isASN1HEX(e)===!1)throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(n.length!==2||e.substr(n[0],2)!=="02"||e.substr(n[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=r(e,n[0]),a=r(e,n[1]);this.setPublic(i,a)};ze.prototype.readPKCS8PubKeyHex=function(e){var t=Ae;if(t.isASN1HEX(e)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(e,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)};ze.prototype.readCertPubKeyHex=function(e,t){var r,n;r=new He,r.readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)};var qP=new RegExp("[^0-9a-f]","gi");function Qm(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r=r+"0";return r+e}ze.prototype.sign=function(e,t){var r=function(i){return m.crypto.Util.hashString(i,t)},n=r(e);return this.signWithMessageHash(n,t)};ze.prototype.signWithMessageHash=function(e,t){var r=m.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),n=hn(r,16),i=this.doPrivate(n),a=i.toString(16);return Qm(a,this.n.bitLength())};function ev(e,t,r){for(var n="",i=0;n.length<t;)n+=dn(r(Ii(e+String.fromCharCode.apply(String,[(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255])))),i+=1;return n}ze.prototype.signPSS=function(e,t,r){var n=function(a){return m.crypto.Util.hashHex(a,t)},i=n(Ii(e));return r===void 0&&(r=-1),this.signWithMessageHashPSS(i,t,r)};ze.prototype.signWithMessageHashPSS=function(e,t,r){var n=dn(e),i=n.length,a=this.n.bitLength()-1,s=Math.ceil(a/8),o,l=function(y){return m.crypto.Util.hashHex(y,t)};if(r===-1||r===void 0)r=i;else if(r===-2)r=s-i-2;else if(r<-2)throw new Error("invalid salt length");if(s<i+r+2)throw new Error("data too long");var h="";r>0&&(h=new Array(r),new to().nextBytes(h),h=String.fromCharCode.apply(String,h));var d=dn(l(Ii("\0\0\0\0\0\0\0\0"+n+h))),E=[];for(o=0;o<s-r-i-2;o+=1)E[o]=0;var p=String.fromCharCode.apply(String,E)+""+h,f=ev(d,p.length,l),w=[];for(o=0;o<p.length;o+=1)w[o]=p.charCodeAt(o)^f.charCodeAt(o);var g=65280>>8*s-a&255;for(w[0]&=~g,o=0;o<i;o++)w.push(d.charCodeAt(o));return w.push(188),Qm(this.doPrivate(new ee(w)).toString(16),this.n.bitLength())};function tv(e){for(var t in m.crypto.Util.DIGESTINFOHEAD){var r=m.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r){var i=[t,e.substring(n)];return i}}return[]}ze.prototype.verify=function(e,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var r=hn(t,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var i=this.doPublic(r),a=i.toString(16);if(a.length+3!=n/4)return!1;var s=a.replace(/^1f+00/,""),o=tv(s);if(o.length==0)return!1;var l=o[0],h=o[1],d=function(p){return m.crypto.Util.hashString(p,l)},E=d(e);return h==E};ze.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=hn(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=this.doPublic(r),i=n.toString(16).replace(/^1f+00/,""),a=tv(i);if(a.length==0)return!1;var s=a[0],o=a[1];return o==e};ze.prototype.verifyPSS=function(e,t,r,n){var i=function(s){return m.crypto.Util.hashHex(s,r)},a=i(Ii(e));return n===void 0&&(n=-1),this.verifyWithMessageHashPSS(a,t,r,n)};ze.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new ee(t,16),a=function(S){return m.crypto.Util.hashHex(S,r)},s=dn(e),o=s.length,l=this.n.bitLength()-1,h=Math.ceil(l/8),d;if(n===-1||n===void 0)n=o;else if(n===-2)n=h-o-2;else if(n<-2)throw new Error("invalid salt length");if(h<o+n+2)throw new Error("data too long");var E=this.doPublic(i).toByteArray();for(d=0;d<E.length;d+=1)E[d]&=255;for(;E.length<h;)E.unshift(0);if(E[h-1]!==188)throw new Error("encoded message does not end in 0xbc");E=String.fromCharCode.apply(String,E);var p=E.substr(0,h-o-1),f=E.substr(p.length,o),w=65280>>8*h-l&255;if(p.charCodeAt(0)&w)throw new Error("bits beyond keysize not zero");var g=ev(f,p.length,a),y=[];for(d=0;d<p.length;d+=1)y[d]=p.charCodeAt(d)^g.charCodeAt(d);y[0]&=~w;var A=h-o-n-2;for(d=0;d<A;d+=1)if(y[d]!==0)throw new Error("leftmost octets not zero");if(y[A]!==1)throw new Error("0x01 marker not found");return f===dn(a(Ii("\0\0\0\0\0\0\0\0"+s+String.fromCharCode.apply(String,y.slice(-n)))))};ze.SALT_LEN_HLEN=-1;ze.SALT_LEN_MAX=-2;ze.SALT_LEN_RECOVER=-2;function He(e){var t=Ae,r=t.getChildIdx,n=t.getV,i=t.dump,a=t.parse,s=t.getTLV,o=t.getVbyList,l=t.getVbyListEx,h=t.getTLVbyList,d=t.getTLVbyListEx,E=t.getIdxbyList,p=t.getIdxbyListEx,f=t.getVidx,w=t.getInt,g=t.oidname,y=t.hextooidstr,A=He,S=kt,_,I=Error;try{_=m.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch{}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var F=h(this.hex,0,[0,0]);if(F.substr(0,2)=="a0"){var P=h(F,0,[0]),k=w(P,0);if(k<0||2<k)throw new Error("malformed version field");return this.version=k+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return l(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var F=d(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(F)},this.getAlgorithmIdentifierName=function(F){for(var P in _)if(F===_[P])return P;return g(l(F,0,[0],"06"))},this.getIssuer=function(F,P){return this.getX500Name(this.getIssuerHex(),F,P)},this.getIssuerHex=function(){return h(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var F=this.getIssuer();return F.str},this.getSubject=function(F,P){return this.getX500Name(this.getSubjectHex(),F,P)},this.getSubjectHex=function(){return h(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var F=this.getSubject();return F.str},this.getNotBefore=function(){var F=o(this.hex,0,[0,4+this.foffset,0]);return F=F.replace(/(..)/g,"%$1"),F=decodeURIComponent(F),F},this.getNotAfter=function(){var F=o(this.hex,0,[0,4+this.foffset,1]);return F=F.replace(/(..)/g,"%$1"),F=decodeURIComponent(F),F},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var F=this.getSPKI();return F==null?null:o(F,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return E(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var F=this.getPublicKeyIdx();return E(this.hex,F,[1,0],"30")},this.getPublicKey=function(){return at.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var F=h(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(F)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(F){var P=this.getSignatureAlgorithmField(),k=this.getSignatureValueHex(),L=h(this.hex,0,[0],"30"),q=new m.crypto.Signature({alg:P});return q.init(F),q.updateHex(L),q.verify(k)},this.parseExt=function(F){var P,k,L;if(F===void 0){if(L=this.hex,this.version!==3)return-1;P=E(L,0,[0,7,0],"30"),k=r(L,P)}else{L=kt(F);var q=E(L,0,[0,3,0,0],"06");if(n(L,q)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}P=E(L,0,[0,3,0,1,0],"30"),k=r(L,P),this.hex=L}this.aExtInfo=new Array;for(var J=0;J<k.length;J++){var z={};z.critical=!1;var K=r(L,k[J]),X=0;K.length===3&&(z.critical=!0,X=1),z.oid=t.hextooidstr(o(L,k[J],[0],"06"));var ie=E(L,k[J],[1+X]);z.vidx=f(L,ie),this.aExtInfo.push(z)}},this.getExtInfo=function(F){var P=this.aExtInfo,k=F;if(F.match(/^[0-9.]+$/)||(k=m.asn1.x509.OID.name2oid(F)),k!==""){for(var L=0;L<P.length;L++)if(P[L].oid===k)return P[L]}},this.getCriticalExtV=function(F,P,k){if(P!=null)return[P,k];var L=this.getExtInfo(F);return L==null?[null,null]:[s(this.hex,L.vidx),L.critical]},this.getExtBasicConstraints=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("basicConstraints");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"basicConstraints"};if(P&&(L.critical=!0),F==="3000")return L;if(F==="30030101ff")return L.cA=!0,L;if(F.substr(0,12)==="30060101ff02"){var q=n(F,10),J=parseInt(q,16);return L.cA=!0,L.pathLen=J,L}throw new Error("hExtV parse error: "+F)},this.getExtNameConstraints=function(F,P){var k=this.getCriticalExtV("nameConstraints",F,P);if(F=k[0],P=k[1],F!=null){var L={extname:"nameConstraints"};P&&(L.critical=!0);for(var q=r(F,0),J=0;J<q.length;J++){for(var z=[],K=r(F,q[J]),X=0;X<K.length;X++){var ie=s(F,K[X]),be=this.getGeneralSubtree(ie);z.push(be)}var ye=F.substr(q[J],2);ye=="a0"?L.permit=z:ye=="a1"&&(L.exclude=z)}return L}},this.getGeneralSubtree=function(F){var P=r(F,0),k=P.length;if(k<1||2<k)throw new Error("wrong num elements");for(var L=this.getGeneralName(s(F,P[0])),q=1;q<k;q++){var J=F.substr(P[q],2),z=n(F,P[q]),K=parseInt(z,16);J=="80"&&(L.min=K),J=="81"&&(L.max=K)}return L},this.getExtKeyUsage=function(F,P){var k=this.getCriticalExtV("keyUsage",F,P);if(F=k[0],P=k[1],F!=null){var L={extname:"keyUsage"};return P&&(L.critical=!0),L.names=this.getExtKeyUsageString(F).split(","),L}},this.getExtKeyUsageBin=function(F){if(F===void 0){var P=this.getExtInfo("keyUsage");if(P===void 0)return"";F=s(this.hex,P.vidx)}if(F.length!=8&&F.length!=10)throw new Error("malformed key usage value: "+F);var k="000000000000000"+parseInt(F.substr(6),16).toString(2);return F.length==8&&(k=k.slice(-8)),F.length==10&&(k=k.slice(-16)),k=k.replace(/0+$/,""),k==""&&(k="0"),k},this.getExtKeyUsageString=function(F){for(var P=this.getExtKeyUsageBin(F),k=new Array,L=0;L<P.length;L++)P.substr(L,1)=="1"&&k.push(He.KEYUSAGE_NAME[L]);return k.join(",")},this.getExtSubjectKeyIdentifier=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("subjectKeyIdentifier");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"subjectKeyIdentifier"};P&&(L.critical=!0);var q=n(F,0);return L.kid={hex:q},L},this.getExtAuthorityKeyIdentifier=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("authorityKeyIdentifier");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"authorityKeyIdentifier"};P&&(L.critical=!0);for(var q=r(F,0),J=0;J<q.length;J++){var z=F.substr(q[J],2);if(z==="80"&&(L.kid={hex:n(F,q[J])}),z==="a1"){var K=s(F,q[J]),X=this.getGeneralNames(K);L.issuer=X[0].dn}z==="82"&&(L.sn={hex:n(F,q[J])})}return L},this.getExtExtKeyUsage=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("extKeyUsage");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"extKeyUsage",array:[]};P&&(L.critical=!0);for(var q=r(F,0),J=0;J<q.length;J++)L.array.push(g(n(F,q[J])));return L},this.getExtExtKeyUsageName=function(){var F=this.getExtInfo("extKeyUsage");if(F===void 0)return F;var P=new Array,k=s(this.hex,F.vidx);if(k==="")return P;for(var L=r(k,0),q=0;q<L.length;q++)P.push(g(n(k,L[q])));return P},this.getExtSubjectAltName=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("subjectAltName");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"subjectAltName",array:[]};return P&&(L.critical=!0),L.array=this.getGeneralNames(F),L},this.getExtIssuerAltName=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("issuerAltName");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"issuerAltName",array:[]};return P&&(L.critical=!0),L.array=this.getGeneralNames(F),L},this.getGeneralNames=function(F){for(var P=r(F,0),k=[],L=0;L<P.length;L++){var q=this.getGeneralName(s(F,P[L]));q!==void 0&&k.push(q)}return k},this.getGeneralName=function(F){var P=F.substr(0,2),k=n(F,0),L=dn(k);if(P=="81")return{rfc822:L};if(P=="82")return{dns:L};if(P=="86")return{uri:L};if(P=="87")return{ip:of(k)};if(P=="a4")return{dn:this.getX500Name(k)};if(P=="a0")return{other:this.getOtherName(F)}},this.getExtSubjectAltName2=function(){var F,P,k,L=this.getExtInfo("subjectAltName");if(L===void 0)return L;for(var q=new Array,J=s(this.hex,L.vidx),z=r(J,0),K=0;K<z.length;K++)k=J.substr(z[K],2),F=n(J,z[K]),k==="81"&&(P=yt(F),q.push(["MAIL",P])),k==="82"&&(P=yt(F),q.push(["DNS",P])),k==="84"&&(P=He.hex2dn(F,0),q.push(["DN",P])),k==="86"&&(P=yt(F),q.push(["URI",P])),k==="87"&&(P=of(F),q.push(["IP",P]));return q},this.getExtCRLDistributionPoints=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("cRLDistributionPoints");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"cRLDistributionPoints",array:[]};P&&(L.critical=!0);for(var q=r(F,0),J=0;J<q.length;J++){var z=s(F,q[J]);L.array.push(this.getDistributionPoint(z))}return L},this.getDistributionPoint=function(F){for(var P={},k=r(F,0),L=0;L<k.length;L++){var q=F.substr(k[L],2),J=s(F,k[L]);q=="a0"&&(P.dpname=this.getDistributionPointName(J))}return P},this.getDistributionPointName=function(F){for(var P={},k=r(F,0),L=0;L<k.length;L++){var q=F.substr(k[L],2),J=s(F,k[L]);q=="a0"&&(P.full=this.getGeneralNames(J))}return P},this.getExtCRLDistributionPointsURI=function(){var F=this.getExtCRLDistributionPoints();if(F==null)return F;for(var P=F.array,k=[],L=0;L<P.length;L++)try{P[L].dpname.full[0].uri!=null&&k.push(P[L].dpname.full[0].uri)}catch{}return k},this.getExtAIAInfo=function(){var F=this.getExtInfo("authorityInfoAccess");if(F===void 0)return F;for(var P={ocsp:[],caissuer:[]},k=r(this.hex,F.vidx),L=0;L<k.length;L++){var q=o(this.hex,k[L],[0],"06"),J=o(this.hex,k[L],[1],"86");q==="2b06010505073001"&&P.ocsp.push(yt(J)),q==="2b06010505073002"&&P.caissuer.push(yt(J))}return P},this.getExtAuthorityInfoAccess=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("authorityInfoAccess");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"authorityInfoAccess",array:[]};P&&(L.critical=!0);for(var q=r(F,0),J=0;J<q.length;J++){var z=l(F,q[J],[0],"06"),K=o(F,q[J],[1],"86"),X=yt(K);if(z=="2b06010505073001")L.array.push({ocsp:X});else if(z=="2b06010505073002")L.array.push({caissuer:X});else throw new Error("unknown method: "+z)}return L},this.getExtCertificatePolicies=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("certificatePolicies");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"certificatePolicies",array:[]};P&&(L.critical=!0);for(var q=r(F,0),J=0;J<q.length;J++){var z=s(F,q[J]),K=this.getPolicyInformation(z);L.array.push(K)}return L},this.getPolicyInformation=function(F){var P={},k=o(F,0,[0],"06");P.policyoid=g(k);var L=p(F,0,[1],"30");if(L!=-1){P.array=[];for(var q=r(F,L),J=0;J<q.length;J++){var z=s(F,q[J]),K=this.getPolicyQualifierInfo(z);P.array.push(K)}}return P},this.getOtherName=function(F){var P={},k=r(F,0),L=o(F,k[0],[],"06"),q=o(F,k[1],[]);return P.oid=g(L),P.value=a(q),P},this.getPolicyQualifierInfo=function(F){var P={},k=o(F,0,[0],"06");if(k==="2b06010505070201"){var L=l(F,0,[1],"16");P.cps=dn(L)}else if(k==="2b06010505070202"){var q=h(F,0,[1],"30");P.unotice=this.getUserNotice(q)}return P},this.getUserNotice=function(F){var P=null,k={};try{P=t.parse(F);var L=this._asn1ToUnotice(P);return L}catch{return}},this._asn1ToUnotice=function(F){try{for(var P={},k=_t(F,"seq"),L=0;L<k.length;L++){var q=this._asn1ToNoticeRef(k[L]);q!=null&&(P.noticeref=q);var J=this.asn1ToDisplayText(k[L]);J!=null&&(P.exptext=J)}return Object.keys(P).length>0?P:void 0}catch{return}},this._asn1ToNoticeRef=function(F){try{for(var P={},k=_t(F,"seq"),L=0;L<k.length;L++){var q=this._asn1ToNoticeNum(k[L]);q!=null&&(P.noticenum=q);var J=this.asn1ToDisplayText(k[L]);J!=null&&(P.org=J)}return Object.keys(P).length>0?P:void 0}catch{return}},this._asn1ToNoticeNum=function(F){try{for(var P=_t(F,"seq"),k=[],L=0;L<P.length;L++){var q=P[L];k.push(parseInt(_t(q,"int.hex"),16))}return k}catch{return}},this.getDisplayText=function(F){var P={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},k={};return k.type=P[F.substr(0,2)],k.str=dn(n(F,0)),k},this.asn1ToDisplayText=function(F){if(F.utf8str!=null)return{type:"utf8",str:F.utf8str.str};if(F.ia5str!=null)return{type:"ia5",str:F.ia5str.str};if(F.visstr!=null)return{type:"vis",str:F.visstr.str};if(F.bmpstr!=null)return{type:"bmp",str:F.bmpstr.str};if(F.prnstr!=null)return{type:"prn",str:F.prnstr.str}},this.getExtPolicyMappings=function(F,P){var k=this.getCriticalExtV("policyMappings",F,P);if(F=k[0],P=k[1],F!=null){var L={extname:"policyMappings"};P&&(L.critical=!0);try{for(var q=a(F),J=q.seq,z=[],K=0;K<J.length;K++){var X=J[K].seq;z.push([X[0].oid,X[1].oid])}L.array=z}catch{throw new I("malformed policyMappings")}return L}},this.getExtPolicyConstraints=function(F,P){var k=this.getCriticalExtV("policyConstraints",F,P);if(F=k[0],P=k[1],F!=null){var L={extname:"policyConstraints"};P&&(L.critical=!0);var q=a(F);try{for(var J=q.seq,z=0;z<J.length;z++){var K=J[z].tag;K.explicit==!1&&(K.tag=="80"&&(L.reqexp=parseInt(K.hex,16)),K.tag=="81"&&(L.inhibit=parseInt(K.hex,16)))}}catch{return new I("malformed policyConstraints value")}return L}},this.getExtInhibitAnyPolicy=function(F,P){var k=this.getCriticalExtV("inhibitAnyPolicy",F,P);if(F=k[0],P=k[1],F!=null){var L={extname:"inhibitAnyPolicy"};P&&(L.critical=!0);var q=w(F,0);return q==-1?new I("wrong value"):(L.skip=q,L)}},this.getExtCRLNumber=function(F,P){var k={extname:"cRLNumber"};if(P&&(k.critical=!0),F.substr(0,2)=="02")return k.num={hex:n(F,0)},k;throw new I("hExtV parse error: "+F)},this.getExtCRLReason=function(F,P){var k={extname:"cRLReason"};if(P&&(k.critical=!0),F.substr(0,2)=="0a")return k.code=parseInt(n(F,0),16),k;throw new Error("hExtV parse error: "+F)},this.getExtOcspNonce=function(F,P){var k={extname:"ocspNonce"};P&&(k.critical=!0);var L=n(F,0);return k.hex=L,k},this.getExtOcspNoCheck=function(F,P){var k={extname:"ocspNoCheck"};return P&&(k.critical=!0),k},this.getExtAdobeTimeStamp=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("adobeTimeStamp");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"adobeTimeStamp"};P&&(L.critical=!0);var q=r(F,0);if(q.length>1){var J=s(F,q[1]),z=this.getGeneralName(J);z.uri!=null&&(L.uri=z.uri)}if(q.length>2){var K=s(F,q[2]);K=="0101ff"&&(L.reqauth=!0),K=="010100"&&(L.reqauth=!1)}return L},this.getExtSubjectDirectoryAttributes=function(F,P){if(F===void 0&&P===void 0){var k=this.getExtInfo("subjectDirectoryAttributes");if(k===void 0)return;F=s(this.hex,k.vidx),P=k.critical}var L={extname:"subjectDirectoryAttributes"};P&&(L.critical=!0);try{for(var q=a(F),J=[],z=0;z<q.seq.length;z++){var K=q.seq[z],X=_t(K,"seq.0.oid"),ie=_t(K,"seq.1.set");if(X==null||ie==null)throw"error";J.push({attr:X,array:ie})}return L.array=J,L}catch{throw new Error("malformed subjectDirectoryAttributes extension value")}};var D=function(F){var P={};try{var k=F.seq[0].oid,L=m.asn1.x509.OID.name2oid(k);P.type=m.asn1.x509.OID.oid2atype(L);var q=F.seq[1];if(q.utf8str!=null)P.ds="utf8",P.value=q.utf8str.str;else if(q.numstr!=null)P.ds="num",P.value=q.numstr.str;else if(q.telstr!=null)P.ds="tel",P.value=q.telstr.str;else if(q.prnstr!=null)P.ds="prn",P.value=q.prnstr.str;else if(q.ia5str!=null)P.ds="ia5",P.value=q.ia5str.str;else if(q.visstr!=null)P.ds="vis",P.value=q.visstr.str;else if(q.bmpstr!=null)P.ds="bmp",P.value=q.bmpstr.str;else throw"error";return P}catch{throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},H=function(F){try{return F.set.map(function(P){return D(P)})}catch(P){throw new Error("improper ASN.1 parsed RDN: "+P)}},V=function(F){try{return F.seq.map(function(P){return H(P)})}catch(P){throw new Error("improper ASN.1 parsed X500Name: "+P)}};this.getX500NameRule=function(F){for(var P=!0,k=!0,L=!1,q="",J="",z=null,K=[],X=0;X<F.length;X++)for(var ie=F[X],be=0;be<ie.length;be++)K.push(ie[be]);for(var X=0;X<K.length;X++){var ye=K[X],$e=ye.ds,qe=ye.value,ce=ye.type;if(q+=":"+$e,$e!="prn"&&$e!="utf8"&&$e!="ia5")return"mixed";if($e=="ia5"){if(ce!="CN")return"mixed";if(m.lang.String.isMail(qe))continue;return"mixed"}if(ce=="C"){if($e=="prn")continue;return"mixed"}if(J+=":"+$e,z==null)z=$e;else if(z!==$e)return"mixed"}return z??"prn"},this.getAttrTypeAndValue=function(F){var P=a(F);return D(P)},this.getRDN=function(F){var P=a(F);return H(P)},this.getX500NameArray=function(F){var P=a(F);return V(P)},this.getX500Name=function(F,P,k){var L=this.getX500NameArray(F),q=this.dnarraytostr(L),J={str:q};return J.array=L,k==!0&&(J.hex=F),P==!0&&(J.canon=this.c14nRDNArray(L)),J},this.readCertPEM=function(F){this.readCertHex(S(F))},this.readCertHex=function(F){this.hex=F,this.getVersion();try{E(this.hex,0,[0,7],"a3"),this.parseExt()}catch{}},this.getParam=function(F){var P={};return F==null&&(F={}),P.version=this.getVersion(),P.serial={hex:this.getSerialNumberHex()},P.sigalg=this.getSignatureAlgorithmField(),P.issuer=this.getIssuer(F.dncanon,F.dnhex),P.notbefore=this.getNotBefore(),P.notafter=this.getNotAfter(),P.subject=this.getSubject(F.dncanon,F.dnhex),P.sbjpubkey=Or(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo!=null&&this.aExtInfo.length>0&&(P.ext=this.getExtParamArray()),P.sighex=this.getSignatureValueHex(),F.tbshex==!0&&(P.tbshex=h(this.hex,0,[0])),F.nodnarray==!0&&(delete P.issuer.array,delete P.subject.array),P},this.getExtParamArray=function(F){if(F==null){var P=p(this.hex,0,[0,"[3]"]);P!=-1&&(F=d(this.hex,0,[0,"[3]",0],"30"))}for(var k=[],L=r(F,0),q=0;q<L.length;q++){var J=s(F,L[q]),z=this.getExtParam(J);z!=null&&k.push(z)}return k},this.getExtParam=function(F){var P={},k=r(F,0),L=k.length;if(L!=2&&L!=3)throw new Error("wrong number elements in Extension: "+L+" "+F);var q=y(o(F,0,[0],"06")),J=!1;L==3&&h(F,0,[1])=="0101ff"&&(J=!0);var z=h(F,0,[L-1,0]),K=void 0;if(q=="2.5.29.14"?K=this.getExtSubjectKeyIdentifier(z,J):q=="2.5.29.15"?K=this.getExtKeyUsage(z,J):q=="2.5.29.17"?K=this.getExtSubjectAltName(z,J):q=="2.5.29.18"?K=this.getExtIssuerAltName(z,J):q=="2.5.29.19"?K=this.getExtBasicConstraints(z,J):q=="2.5.29.30"?K=this.getExtNameConstraints(z,J):q=="2.5.29.31"?K=this.getExtCRLDistributionPoints(z,J):q=="2.5.29.32"?K=this.getExtCertificatePolicies(z,J):q=="2.5.29.33"?K=this.getExtPolicyMappings(z,J):q=="2.5.29.35"?K=this.getExtAuthorityKeyIdentifier(z,J):q=="2.5.29.36"?K=this.getExtPolicyConstraints(z,J):q=="2.5.29.37"?K=this.getExtExtKeyUsage(z,J):q=="2.5.29.54"?K=this.getExtInhibitAnyPolicy(z,J):q=="1.3.6.1.5.5.7.1.1"?K=this.getExtAuthorityInfoAccess(z,J):q=="2.5.29.20"?K=this.getExtCRLNumber(z,J):q=="2.5.29.21"?K=this.getExtCRLReason(z,J):q=="2.5.29.9"?K=this.getExtSubjectDirectoryAttributes(z,J):q=="1.3.6.1.5.5.7.48.1.2"?K=this.getExtOcspNonce(z,J):q=="1.3.6.1.5.5.7.48.1.5"?K=this.getExtOcspNoCheck(z,J):q=="1.2.840.113583.1.1.9.1"?K=this.getExtAdobeTimeStamp(z,J):He.EXT_PARSER[q]!=null&&(K=He.EXT_PARSER[q](q,J,z)),K!=null)return K;var X={extname:q,extn:z};try{X.extn=a(z)}catch{}return J&&(X.critical=!0),X},this.findExt=function(F,P){for(var k=0;k<F.length;k++)if(F[k].extname==P)return F[k];return null},this.updateExtCDPFullURI=function(F,P){var k=this.findExt(F,"cRLDistributionPoints");if(k!=null&&k.array!=null){for(var L=k.array,q=0;q<L.length;q++)if(L[q].dpname!=null&&L[q].dpname.full!=null)for(var J=L[q].dpname.full,z=0;z<J.length;z++){var K=J[q];K.uri!=null&&(K.uri=P)}}},this.updateExtAIAOCSP=function(F,P){var k=this.findExt(F,"authorityInfoAccess");if(k!=null&&k.array!=null)for(var L=k.array,q=0;q<L.length;q++)L[q].ocsp!=null&&(L[q].ocsp=P)},this.updateExtAIACAIssuer=function(F,P){var k=this.findExt(F,"authorityInfoAccess");if(k!=null&&k.array!=null)for(var L=k.array,q=0;q<L.length;q++)L[q].caissuer!=null&&(L[q].caissuer=P)},this.dnarraytostr=function(F){function P(L){return L.map(function(q){return k(q).replace(/\+/,"\\+")}).join("+")}function k(L){return L.type+"="+L.value}return"/"+F.map(function(L){return P(L).replace(/\//,"\\/")}).join("/")},this.setCanonicalizedDN=function(F){var P;if(F.str!=null&&F.array==null){var k=new m.asn1.x509.X500Name({str:F.str}),L=k.tohex();P=this.getX500NameArray(L)}else P=F.array;F.canon==null&&(F.canon=this.c14nRDNArray(P))},this.c14nRDNArray=function(F){for(var P=[],k=0;k<F.length;k++){for(var L=F[k],q=[],J=0;J<L.length;J++){var z=L[J],K=z.value;K=K.replace(/^\s*/,""),K=K.replace(/\s*$/,""),K=K.replace(/\s+/g," "),K=K.toLowerCase(),q.push(z.type.toLowerCase()+"="+K)}P.push(q.join("+"))}return"/"+P.join("/")},this.getInfo=function(){var F=function(Tt){for(var nt="",It=" ",tt=`
`,gt=Tt.array,Yt=0;Yt<gt.length;Yt++){var Je=gt[Yt];if(Je.dn!=null&&(nt+=It+"dn: "+Je.dn.str+tt),Je.ip!=null&&(nt+=It+"ip: "+Je.ip+tt),Je.rfc822!=null&&(nt+=It+"rfc822: "+Je.rfc822+tt),Je.dns!=null&&(nt+=It+"dns: "+Je.dns+tt),Je.uri!=null&&(nt+=It+"uri: "+Je.uri+tt),Je.other!=null){var Ut=Je.other.oid,Un=JSON.stringify(Je.other.value).replace(/\"/g,"");nt+=It+"other: "+Ut+"="+Un+tt}}return nt=nt.replace(/\n$/,""),nt},P=function(Tt){for(var nt="",It=Tt.array,tt=0;tt<It.length;tt++){var gt=It[tt];if(nt+=" policy oid: "+gt.policyoid+`
`,gt.array!==void 0)for(var Yt=0;Yt<gt.array.length;Yt++){var Je=gt.array[Yt];Je.cps!==void 0&&(nt+=" cps: "+Je.cps+`
`)}}return nt},k=function(Tt){for(var nt="",It=Tt.array,tt=0;tt<It.length;tt++){var gt=It[tt];try{gt.dpname.full[0].uri!==void 0&&(nt+=" "+gt.dpname.full[0].uri+`
`)}catch{}try{gt.dname.full[0].dn.hex!==void 0&&(nt+=" "+He.hex2dn(gt.dpname.full[0].dn.hex)+`
`)}catch{}}return nt},L=function(Tt){for(var nt="",It=Tt.array,tt=0;tt<It.length;tt++){var gt=It[tt];gt.caissuer!==void 0&&(nt+=" caissuer: "+gt.caissuer+`
`),gt.ocsp!==void 0&&(nt+=" ocsp: "+gt.ocsp+`
`)}return nt},q=He,J,z,K;if(J=`Basic Fields
`,J+=" serial number: "+this.getSerialNumberHex()+`
`,J+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
`,J+=" issuer: "+this.getIssuerString()+`
`,J+=" notBefore: "+this.getNotBefore()+`
`,J+=" notAfter: "+this.getNotAfter()+`
`,J+=" subject: "+this.getSubjectString()+`
`,J+=` subject public key info:
`,z=this.getPublicKey(),J+=" key algorithm: "+z.type+`
`,z.type==="RSA"&&(J+=" n="+fd(z.n.toString(16)).substr(0,16)+`...
`,J+=" e="+fd(z.e.toString(16))+`
`),K=this.aExtInfo,K!=null){J+=`X509v3 Extensions:
`;for(var X=0;X<K.length;X++){var ie=K[X],be=m.asn1.x509.OID.oid2name(ie.oid);be===""&&(be=ie.oid);var ye="";if(ie.critical===!0&&(ye="CRITICAL"),J+=" "+be+" "+ye+`:
`,be==="basicConstraints"){var $e=this.getExtBasicConstraints();$e.cA===void 0?J+=` {}
`:(J+=" cA=true",$e.pathLen!==void 0&&(J+=", pathLen="+$e.pathLen),J+=`
`)}else if(be=="policyMappings"){var qe=this.getExtPolicyMappings().array,ce=qe.map(function(Tt){var nt=Tt;return nt[0]+":"+nt[1]}).join(", ");J+=" "+ce+`
`}else if(be=="policyConstraints"){var _e=this.getExtPolicyConstraints();J+=" ",_e.reqexp!=null&&(J+=" reqexp="+_e.reqexp),_e.inhibit!=null&&(J+=" inhibit="+_e.inhibit),J+=`
`}else if(be=="inhibitAnyPolicy"){var _e=this.getExtInhibitAnyPolicy();J+=" skip="+_e.skip+`
`}else if(be=="keyUsage")J+=" "+this.getExtKeyUsageString()+`
`;else if(be=="subjectKeyIdentifier")J+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
`;else if(be=="authorityKeyIdentifier"){var Le=this.getExtAuthorityKeyIdentifier();Le.kid!==void 0&&(J+=" kid="+Le.kid.hex+`
`)}else if(be=="extKeyUsage"){var lr=this.getExtExtKeyUsage().array;J+=" "+lr.join(", ")+`
`}else if(be=="subjectAltName"){var Bt=F(this.getExtSubjectAltName());J+=Bt+`
`}else if(be=="cRLDistributionPoints"){var pt=this.getExtCRLDistributionPoints();J+=k(pt)}else if(be=="authorityInfoAccess"){var zt=this.getExtAuthorityInfoAccess();J+=L(zt)}else be=="certificatePolicies"&&(J+=P(this.getExtCertificatePolicies()))}}return J+="signature algorithm: "+this.getSignatureAlgorithmName()+`
`,J+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
`,J},typeof e=="string"&&(e.indexOf("-----BEGIN")!=-1?this.readCertPEM(e):m.lang.String.isHex(e)&&this.readCertHex(e))}He.EXT_PARSER={};He.registExtParser=function(e,t){He.EXT_PARSER[e]=t};He.hex2dn=function(e,t){t===void 0&&(t=0);var r=new He,n=Ae.getTLV(e,t),i=r.getX500Name(e);return i.str};He.hex2rdn=function(e,t){if(t===void 0&&(t=0),e.substr(t,2)!=="31")throw new Error("malformed RDN");for(var r=new Array,n=Ae.getChildIdx(e,t),i=0;i<n.length;i++)r.push(He.hex2attrTypeValue(e,n[i]));return r=r.map(function(a){return a.replace("+","\\+")}),r.join("+")};He.hex2attrTypeValue=function(e,t){var r=Ae,n=r.getV;if(t===void 0&&(t=0),e.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=r.getChildIdx(e,t);i.length!==2||e.substr(i[0],2);var a=n(e,i[0]),s=m.asn1.ASN1Util.oidHexToInt(a),o=m.asn1.x509.OID.oid2atype(s),l=n(e,i[1]),h=dn(l);return o+"="+h};He.getPublicKeyFromCertHex=function(e){var t=new He;return t.readCertHex(e),t.getPublicKey()};He.getPublicKeyFromCertPEM=function(e){var t=new He;return t.readCertPEM(e),t.getPublicKey()};He.getPublicKeyInfoPropOfCertPEM=function(e){var t=Ae,r=t.getVbyList,n={},i,a,s;return n.algparam=null,i=new He,i.readCertPEM(e),a=i.getPublicKeyHex(),n.keyhex=r(a,0,[1],"03").substr(2),n.algoid=r(a,0,[0,0],"06"),n.algoid==="2a8648ce3d0201"&&(n.algparam=r(a,0,[0,1],"06")),n};He.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var T8=function(e){var t=m,r=t.lang.String.isHex,n=Ae,i=n.getV,a=n.getTLV,s=n.getVbyList,o=n.getTLVbyList,l=n.getTLVbyListEx,h=n.getIdxbyList,d=n.getIdxbyListEx,E=n.getChildIdx,p=new He;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var f=h(this.hex,0,[0,0]),w=this.hex.substr(f,2);if(w=="02")this.posSigAlg=1;else if(w=="30")this.posSigAlg=0;else throw new Error("malformed 1st item of TBSCertList: "+w);var g=h(this.hex,0,[0,this.posSigAlg+3]),y=this.hex.substr(g,2);if(y=="17"||y=="18"){var A,S;A=h(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,A!=-1&&(S=this.hex.substr(A,2),S=="30"&&(this.posRevCert=this.posSigAlg+4))}else if(y=="30")this.posRevCert=this.posSigAlg+3;else if(y=="a0")this.posRevCert=null;else throw new Error("malformed nextUpdate or revCert tag: "+y)},this.getVersion=function(){return this.posSigAlg==0?null:parseInt(s(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var f=o(this.hex,0,[0,this.posSigAlg],"30");return p.getAlgorithmIdentifierName(f)},this.getIssuer=function(){return p.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return o(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var f=s(this.hex,0,[0,this.posSigAlg+2]);return result=dn(f)},this.getNextUpdate=function(){var f=h(this.hex,0,[0,this.posSigAlg+3]),w=this.hex.substr(f,2);return w!="17"&&w!="18"?null:dn(i(this.hex,f))},this.getRevCertArray=function(){if(this.posRevCert==null)return null;for(var f=[],w=h(this.hex,0,[0,this.posRevCert]),g=E(this.hex,w),y=0;y<g.length;y++){var A=a(this.hex,g[y]);f.push(this.getRevCert(A))}return f},this.getRevCert=function(f){var w={},g=E(f,0);return w.sn={hex:s(f,0,[0],"02")},w.date=dn(s(f,0,[1])),g.length==3&&(w.ext=p.getExtParamArray(o(f,0,[2]))),w},this.findRevCert=function(f){var w=new He(f),g=w.getSerialNumberHex();return this.findRevCertBySN(g)},this.findRevCertBySN=function(f){if(this.parsed==null&&this.getParam(),this.parsed.revcert==null)return null;for(var w=this.parsed.revcert,g=0;g<w.length;g++)if(f==w[g].sn.hex)return w[g];return null},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(f){var w=this.getSignatureAlgorithmField(),g=this.getSignatureValueHex(),y=o(this.hex,0,[0],"30"),A=new m.crypto.Signature({alg:w});return A.init(f),A.updateHex(y),A.verify(g)},this.getParam=function(f){var w={},g=this.getVersion();g!=null&&(w.version=g),w.sigalg=this.getSignatureAlgorithmField(),w.issuer=this.getIssuer(),w.thisupdate=this.getThisUpdate();var y=this.getNextUpdate();y!=null&&(w.nextupdate=y);var A=this.getRevCertArray();A!=null&&(w.revcert=A);var S=d(this.hex,0,[0,"[0]"]);if(S!=-1){var _=l(this.hex,0,[0,"[0]",0]);w.ext=p.getExtParamArray(_)}return w.sighex=this.getSignatureValueHex(),this.parsed=w,typeof f=="object"&&(f.tbshex==!0&&(w.tbshex=o(this.hex,0,[0])),f.nodnarray==!0&&delete w.issuer.array),w},typeof e=="string"&&(r(e)?this.hex=e:e.match(/-----BEGIN X509 CRL/)&&(this.hex=kt(e)),this._setPos())};(typeof m>"u"||!m)&&(m={});(typeof m.jws>"u"||!m.jws)&&(m.jws={});m.jws.JWS=function(){var e=m,t=e.jws.JWS,r=t.isSafeJSONString;this.parseJWS=function(n,i){if(!(this.parsedJWS!==void 0&&(i||this.parsedJWS.sigvalH!==void 0))){var a=n.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(a==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var s=a[1],o=a[2],l=a[3],h=s+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=s,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=l,this.parsedJWS.si=h,!i){var d=Pt(l),E=hn(d,16);this.parsedJWS.sigvalH=d,this.parsedJWS.sigvalBI=E}var p=ci(s),f=ci(o);if(this.parsedJWS.headS=p,this.parsedJWS.payloadS=f,!r(p,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+p}}};m.jws.JWS.sign=function(e,t,r,n,i){var a=m,s=a.jws,o=s.JWS,l=o.readSafeJSONString,h=o.isSafeJSONString,d=a.crypto,E=d.ECDSA,p=d.Mac,f=d.Signature,w=JSON,g,y,A;if(typeof t!="string"&&typeof t!="object")throw"spHeader must be JSON string or object: "+t;if(typeof t=="object"&&(y=t,g=w.stringify(y)),typeof t=="string"){if(g=t,!h(g))throw"JWS Head is not safe JSON string: "+g;y=l(g)}if(A=r,typeof r=="object"&&(A=w.stringify(r)),(e==""||e==null)&&y.alg!==void 0&&(e=y.alg),e!=""&&e!=null&&y.alg===void 0&&(y.alg=e,g=w.stringify(y)),e!==y.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+y.alg;var S=null;if(o.jwsalg2sigalg[e]===void 0)throw"unsupported alg name: "+e;S=o.jwsalg2sigalg[e];var _=yc(g),I=yc(A),D=_+"."+I,H="";if(S.substr(0,4)=="Hmac"){if(n===void 0)throw"mac key shall be specified for HS* alg";var V=new p({alg:S,prov:"cryptojs",pass:n});V.updateString(D),H=V.doFinal()}else if(S.indexOf("withECDSA")!=-1){var F=new f({alg:S});F.init(n,i),F.updateString(D);var P=F.sign();H=m.crypto.ECDSA.asn1SigToConcatSig(P)}else if(S!="none"){var F=new f({alg:S});F.init(n,i),F.updateString(D),H=F.sign()}var k=sr(H);return D+"."+k};m.jws.JWS.verify=function(e,t,r){var n=m,i=n.jws,a=i.JWS,s=a.readSafeJSONString,o=n.crypto,l=o.ECDSA,h=o.Mac,d=o.Signature,E;if(typeof ze!==void 0&&(E=ze),!wd(e))return!1;var p=e.split(".");if(p.length!==3)return!1;var f=p[0],w=p[1],g=f+"."+w,y=Pt(p[2]),A=s(ci(p[0])),S=null,_=null;if(A.alg===void 0)throw"algorithm not specified in header";if(S=A.alg,_=S.substr(0,2),r!=null&&Object.prototype.toString.call(r)==="[object Array]"&&r.length>0){var I=":"+r.join(":")+":";if(I.indexOf(":"+S+":")==-1)throw"algorithm '"+S+"' not accepted in the list"}if(S!="none"&&t===null)throw"key shall be specified to verify.";if(typeof t=="string"&&t.indexOf("-----BEGIN ")!=-1&&(t=at.getKey(t)),(_=="RS"||_=="PS")&&!(t instanceof E))throw"key shall be a RSAKey obj for RS* and PS* algs";if(_=="ES"&&!(t instanceof l))throw"key shall be a ECDSA obj for ES* algs";S=="none";var D=null;if(a.jwsalg2sigalg[A.alg]===void 0)throw"unsupported alg name: "+S;if(D=a.jwsalg2sigalg[S],D=="none")throw"not supported";if(D.substr(0,4)=="Hmac"){var H=null;if(t===void 0)throw"hexadecimal key shall be specified for HMAC";var V=new h({alg:D,pass:t});return V.updateString(g),H=V.doFinal(),y==H}else if(D.indexOf("withECDSA")!=-1){var F=null;try{F=l.concatSigToASN1Sig(y)}catch{return!1}var P=new d({alg:D});return P.init(t),P.updateString(g),P.verify(F)}else{var P=new d({alg:D});return P.init(t),P.updateString(g),P.verify(y)}};m.jws.JWS.parse=function(e){var t=e.split("."),r={},n,i,a;if(t.length!=2&&t.length!=3)throw"malformed sJWS: wrong number of '.' splitted elements";return n=t[0],i=t[1],t.length==3&&(a=t[2]),r.headerObj=m.jws.JWS.readSafeJSONString(ci(n)),r.payloadObj=m.jws.JWS.readSafeJSONString(ci(i)),r.headerPP=JSON.stringify(r.headerObj,null," "),r.payloadObj==null?r.payloadPP=ci(i):r.payloadPP=JSON.stringify(r.payloadObj,null," "),a!==void 0&&(r.sigHex=Pt(a)),r};m.jws.JWS.verifyJWT=function(e,t,r){var n=m,i=n.jws,a=i.JWS,s=a.readSafeJSONString,o=a.inArray,l=a.includedArray;if(!wd(e))return!1;var h=e.split(".");if(h.length!=3)return!1;var d=h[0],E=h[1],p=d+"."+E,f=Pt(h[2]),w=s(ci(d)),g=s(ci(E));if(w.alg===void 0)return!1;if(r.alg===void 0)throw"acceptField.alg shall be specified";if(!o(w.alg,r.alg)||g.iss!==void 0&&typeof r.iss=="object"&&!o(g.iss,r.iss)||g.sub!==void 0&&typeof r.sub=="object"&&!o(g.sub,r.sub))return!1;if(g.aud!==void 0&&typeof r.aud=="object"){if(typeof g.aud=="string"){if(!o(g.aud,r.aud))return!1}else if(typeof g.aud=="object"&&!l(g.aud,r.aud))return!1}var y=i.IntDate.getNow();return r.verifyAt!==void 0&&typeof r.verifyAt=="number"&&(y=r.verifyAt),(r.gracePeriod===void 0||typeof r.gracePeriod!="number")&&(r.gracePeriod=0),!(g.exp!==void 0&&typeof g.exp=="number"&&g.exp+r.gracePeriod<y||g.nbf!==void 0&&typeof g.nbf=="number"&&y<g.nbf-r.gracePeriod||g.iat!==void 0&&typeof g.iat=="number"&&y<g.iat-r.gracePeriod||g.jti!==void 0&&r.jti!==void 0&&g.jti!==r.jti||!a.verify(e,t,r.alg))};m.jws.JWS.includedArray=function(e,t){var r=m.jws.JWS.inArray;if(e===null||typeof e!="object"||typeof e.length!="number")return!1;for(var n=0;n<e.length;n++)if(!r(e[n],t))return!1;return!0};m.jws.JWS.inArray=function(e,t){if(t===null||typeof t!="object"||typeof t.length!="number")return!1;for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1};m.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"};m.jws.JWS.isSafeJSONString=function(e,t,r){var n=null;try{return n=jm(e),typeof n!="object"||n.constructor===Array?0:(t&&(t[r]=n),1)}catch{return 0}};m.jws.JWS.readSafeJSONString=function(e){var t=null;try{return t=jm(e),typeof t!="object"||t.constructor===Array?null:t}catch{return null}};m.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(t==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]};m.jws.JWS.getJWKthumbprint=function(e){if(e.kty!=="RSA"&&e.kty!=="EC"&&e.kty!=="oct")throw"unsupported algorithm for JWK Thumprint";var t="{";if(e.kty==="RSA"){if(typeof e.n!="string"||typeof e.e!="string")throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if(e.kty==="EC"){if(typeof e.crv!="string"||typeof e.x!="string"||typeof e.y!="string")throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if(e.kty==="oct"){if(typeof e.k!="string")throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var r=Ii(t),n=m.crypto.Util.hashHex(r,"sha256"),i=sr(n);return i};m.jws.IntDate={};m.jws.IntDate.get=function(e){var t=m.jws.IntDate,r=t.getNow,n=t.getZulu;if(e=="now")return r();if(e=="now + 1hour")return r()+60*60;if(e=="now + 1day")return r()+60*60*24;if(e=="now + 1month")return r()+60*60*24*30;if(e=="now + 1year")return r()+60*60*24*365;if(e.match(/Z$/))return n(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e};m.jws.IntDate.getZulu=function(e){return Km(e)};m.jws.IntDate.getNow=function(){var e=~~(new Date/1e3);return e};m.jws.IntDate.intDate2UTCString=function(e){var t=new Date(e*1e3);return t.toUTCString()};m.jws.IntDate.intDate2Zulu=function(e){var t=new Date(e*1e3),r=("0000"+t.getUTCFullYear()).slice(-4),n=("00"+(t.getUTCMonth()+1)).slice(-2),i=("00"+t.getUTCDate()).slice(-2),a=("00"+t.getUTCHours()).slice(-2),s=("00"+t.getUTCMinutes()).slice(-2),o=("00"+t.getUTCSeconds()).slice(-2);return r+n+i+a+s+o+"Z"};(typeof m>"u"||!m)&&(m={});(typeof m.jws>"u"||!m.jws)&&(m.jws={});m.jws.JWSJS=function(){var e=m,t=e.jws,r=t.JWS,n=r.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(i){this.init();var a=i.split(".");if(a.length!=3)throw"malformed input JWS";this.aHeader.push(a[0]),this.sPayload=a[1],this.aSignature.push(a[2])},this.addSignature=function(i,a,s,o){if(this.sPayload===void 0||this.sPayload===null)throw"there's no JSON-JS signature to add.";var l=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var h=m.jws.JWS.sign(i,a,this.sPayload,s,o),d=h.split("."),E=d[0],p=d[2];this.aHeader.push(d[0]),this.aSignature.push(d[2])}catch(f){throw this.aHeader.length>l&&this.aHeader.pop(),this.aSignature.length>l&&this.aSignature.pop(),"addSignature failed: "+f}},this.verifyAll=function(i){if(this.aHeader.length!==i.length||this.aSignature.length!==i.length)return!1;for(var a=0;a<i.length;a++){var s=i[a];if(s.length!==2)return!1;var o=this.verifyNth(a,s[0],s[1]);if(o===!1)return!1}return!0},this.verifyNth=function(i,a,s){if(this.aHeader.length<=i||this.aSignature.length<=i)return!1;var o=this.aHeader[i],l=this.aSignature[i],h=o+"."+this.sPayload+"."+l,d=!1;try{d=r.verify(h,a,s)}catch{return!1}return d},this.readJWSJS=function(i){if(typeof i=="string"){var a=n(i);if(a==null)throw"argument is not safe JSON object string";this.aHeader=a.headers,this.sPayload=a.payload,this.aSignature=a.signatures}else try{if(i.headers.length>0)this.aHeader=i.headers;else throw"malformed header";if(typeof i.payload=="string")this.sPayload=i.payload;else throw"malformed signatures";if(i.signatures.length>0)this.aSignature=i.signatures;else throw"malformed signatures"}catch(s){throw"malformed JWS-JS JSON object: "+s}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return this.aHeader.length==0?1:0}};Se.SecureRandom=to;Se.rng_seed_time=gd;Se.BigInteger=ee;Se.RSAKey=ze;Se.ECDSA=m.crypto.ECDSA;Se.DSA=m.crypto.DSA;Se.Signature=m.crypto.Signature;Se.MessageDigest=m.crypto.MessageDigest;Se.Mac=m.crypto.Mac;Se.KEYUTIL=at;Se.ASN1HEX=Ae;Se.X509=He;Se.X509CRL=T8;Se.CryptoJS=Ce;Se.b64tohex=Zu;Se.b64toBA=Nm;Se.ECFieldElementFp=ar;Se.ECPointFp=dt;Se.ECCurveFp=ms;Se.stoBA=Mm;Se.BAtos=qm;Se.BAtohex=pf;Se.stohex=pn;Se.stob64=p8;Se.stob64u=d8;Se.b64utos=g8;Se.b64tob64u=Ju;Se.b64utob64=bc;Se.hex2b64=gs;Se.hextob64u=sr;Se.b64utohex=Pt;Se.utf8tob64u=yc;Se.b64utoutf8=ci;Se.utf8tob64=m8;Se.b64toutf8=v8;Se.utf8tohex=df;Se.hextoutf8=yt;Se.hextorstr=dn;Se.rstrtohex=Ii;Se.hextob64=md;Se.hextob64nl=w8;Se.b64nltohex=Vm;Se.hextopem=Or;Se.pemtohex=kt;Se.hextoArrayBuffer=b8;Se.ArrayBuffertohex=C8;Se.zulutomsec=vd;Se.msectozulu=F8;Se.zulutosec=Km;Se.zulutodate=_8;Se.datetozulu=I8;Se.uricmptohex=mf;Se.hextouricmp=vf;Se.ipv6tohex=cd;Se.hextoipv6=ld;Se.hextoip=of;Se.iptohex=Ed;Se.ucs2hextoutf8=Ad;Se.encodeURIComponentAll=Ef;Se.newline_toUnix=D8;Se.newline_toDos=B8;Se.hextoposhex=fd;Se.intarystrtohex=$8;Se.strdiffidx=P8;Se.oidtohex=Ym;Se.hextooid=Af;Se.strpad=cf;Se.bitstrtoint=Xm;Se.inttobitstr=Jm;Se.bitstrtobinstr=Zm;Se.binstrtobitstr=R8;Se.isBase64URLDot=wd;Se.namearraytobinstr=lf;Se.extendClass=he;Se.foldnl=gf;Se.b64topem=y8;Se.pemtob64=S8;Se.timeogen=Gm;Se.aryval=_t;Se.inttohex=Wm;Se.twoscompl=Cc;Se.KJUR=m;Se.crypto=m.crypto;Se.asn1=m.asn1;Se.jws=m.jws;Se.lang=m.lang;Se.VERSION=Mb;Se.VERSION_FULL=qb});var Ka=we((GP,Va)=>{"use strict";function iv(e){return typeof e>"u"||e===null}function O8(e){return typeof e=="object"&&e!==null}function N8(e){return Array.isArray(e)?e:iv(e)?[]:[e]}function k8(e,t){var r,n,i,a;if(t)for(a=Object.keys(t),r=0,n=a.length;r<n;r+=1)i=a[r],e[i]=t[i];return e}function L8(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function U8(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Va.exports.isNothing=iv;Va.exports.isObject=O8;Va.exports.toArray=N8;Va.exports.repeat=L8;Va.exports.isNegativeZero=U8;Va.exports.extend=k8});var ro=we((zP,sv)=>{"use strict";function Fc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Fc.prototype=Object.create(Error.prototype);Fc.prototype.constructor=Fc;Fc.prototype.toString=function(t){var r=this.name+": ";return r+=this.reason||"(unknown reason)",!t&&this.mark&&(r+=" "+this.mark.toString()),r};sv.exports=Fc});var ov=we((YP,uv)=>{"use strict";var av=Ka();function Sd(e,t,r,n,i){this.name=e,this.buffer=t,this.position=r,this.line=n,this.column=i}Sd.prototype.getSnippet=function(t,r){var n,i,a,s,o;if(!this.buffer)return null;for(t=t||4,r=r||75,n="",i=this.position;i>0&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(i-1))===-1;)if(i-=1,this.position-i>r/2-1){n=" ... ",i+=5;break}for(a="",s=this.position;s<this.buffer.length&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(s))===-1;)if(s+=1,s-this.position>r/2-1){a=" ... ",s-=5;break}return o=this.buffer.slice(i,s),av.repeat(" ",t)+n+o+a+`
`+av.repeat(" ",t+this.position-i+n.length)+"^"};Sd.prototype.toString=function(t){var r,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(r=this.getSnippet(),r&&(n+=`:
`+r)),n};uv.exports=Sd});var ur=we((WP,lv)=>{"use strict";var cv=ro(),H8=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],j8=["scalar","sequence","mapping"];function M8(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function q8(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(H8.indexOf(r)===-1)throw new cv('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=M8(t.styleAliases||null),j8.indexOf(this.kind)===-1)throw new cv('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}lv.exports=q8});var Ga=we((XP,hv)=>{"use strict";var fv=Ka(),wf=ro(),V8=ur();function bd(e,t,r){var n=[];return e.include.forEach(function(i){r=bd(i,t,r)}),e[t].forEach(function(i){r.forEach(function(a,s){a.tag===i.tag&&a.kind===i.kind&&n.push(s)}),r.push(i)}),r.filter(function(i,a){return n.indexOf(a)===-1})}function K8(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,r;function n(i){e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function no(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new wf("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=bd(this,"implicit",[]),this.compiledExplicit=bd(this,"explicit",[]),this.compiledTypeMap=K8(this.compiledImplicit,this.compiledExplicit)}no.DEFAULT=null;no.create=function(){var t,r;switch(arguments.length){case 1:t=no.DEFAULT,r=arguments[0];break;case 2:t=arguments[0],r=arguments[1];break;default:throw new wf("Wrong number of arguments for Schema.create function")}if(t=fv.toArray(t),r=fv.toArray(r),!t.every(function(n){return n instanceof no}))throw new wf("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(n){return n instanceof V8}))throw new wf("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new no({include:t,explicit:r})};hv.exports=no});var dv=we((JP,pv)=>{"use strict";var G8=ur();pv.exports=new G8("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var mv=we((ZP,gv)=>{"use strict";var z8=ur();gv.exports=new z8("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var Ev=we((QP,vv)=>{"use strict";var Y8=ur();vv.exports=new Y8("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var yf=we((eR,Av)=>{"use strict";var W8=Ga();Av.exports=new W8({explicit:[dv(),mv(),Ev()]})});var yv=we((tR,wv)=>{"use strict";var X8=ur();function J8(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Z8(){return null}function Q8(e){return e===null}wv.exports=new X8("tag:yaml.org,2002:null",{kind:"scalar",resolve:J8,construct:Z8,predicate:Q8,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var bv=we((rR,Sv)=>{"use strict";var e_=ur();function t_(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function r_(e){return e==="true"||e==="True"||e==="TRUE"}function n_(e){return Object.prototype.toString.call(e)==="[object Boolean]"}Sv.exports=new e_("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t_,construct:r_,predicate:n_,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})});var Fv=we((nR,Cv)=>{"use strict";var i_=Ka(),s_=ur();function a_(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function u_(e){return 48<=e&&e<=55}function o_(e){return 48<=e&&e<=57}function c_(e){if(e===null)return!1;var t=e.length,r=0,n=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!a_(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}for(;r<t;r++)if(i=e[r],i!=="_"){if(!u_(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(i===":")break;if(!o_(e.charCodeAt(r)))return!1;n=!0}return!n||i==="_"?!1:i!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(r))}function l_(e){var t=e,r=1,n,i,a=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0"?0:n==="0"?t[1]==="b"?r*parseInt(t.slice(2),2):t[1]==="x"?r*parseInt(t,16):r*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(s){a.unshift(parseInt(s,10))}),t=0,i=1,a.forEach(function(s){t+=s*i,i*=60}),r*t):r*parseInt(t,10)}function f_(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!i_.isNegativeZero(e)}Cv.exports=new s_("tag:yaml.org,2002:int",{kind:"scalar",resolve:c_,construct:l_,predicate:f_,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var Dv=we((iR,Iv)=>{"use strict";var _v=Ka(),h_=ur(),p_=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function d_(e){return!(e===null||!p_.test(e)||e[e.length-1]==="_")}function g_(e){var t,r,n,i;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(a){i.unshift(parseFloat(a,10))}),t=0,n=1,i.forEach(function(a){t+=a*n,n*=60}),r*t):r*parseFloat(t,10)}var m_=/^[-+]?[0-9]+e/;function v_(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_v.isNegativeZero(e))return"-0.0";return r=e.toString(10),m_.test(r)?r.replace("e",".e"):r}function E_(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||_v.isNegativeZero(e))}Iv.exports=new h_("tag:yaml.org,2002:float",{kind:"scalar",resolve:d_,construct:g_,predicate:E_,represent:v_,defaultStyle:"lowercase"})});var Cd=we((sR,Bv)=>{"use strict";var A_=Ga();Bv.exports=new A_({include:[yf()],implicit:[yv(),bv(),Fv(),Dv()]})});var Fd=we((aR,$v)=>{"use strict";var w_=Ga();$v.exports=new w_({include:[Cd()]})});var xv=we((uR,Tv)=>{"use strict";var y_=ur(),Pv=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Rv=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function S_(e){return e===null?!1:Pv.exec(e)!==null||Rv.exec(e)!==null}function b_(e){var t,r,n,i,a,s,o,l=0,h=null,d,E,p;if(t=Pv.exec(e),t===null&&(t=Rv.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(a=+t[4],s=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(d=+t[10],E=+(t[11]||0),h=(d*60+E)*6e4,t[9]==="-"&&(h=-h)),p=new Date(Date.UTC(r,n,i,a,s,o,l)),h&&p.setTime(p.getTime()-h),p}function C_(e){return e.toISOString()}Tv.exports=new y_("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:S_,construct:b_,instanceOf:Date,represent:C_})});var Nv=we((oR,Ov)=>{"use strict";var F_=ur();function __(e){return e==="<<"||e===null}Ov.exports=new F_("tag:yaml.org,2002:merge",{kind:"scalar",resolve:__})});var Uv=we((cR,Lv)=>{"use strict";var za;try{kv=Oa,za=kv("buffer").Buffer}catch{}var kv,I_=ur(),_d=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function D_(e){if(e===null)return!1;var t,r,n=0,i=e.length,a=_d;for(r=0;r<i;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function B_(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,a=_d,s=0,o=[];for(t=0;t<i;t++)t%4===0&&t&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(t));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),za?za.from?za.from(o):new za(o):o}function $_(e){var t="",r=0,n,i,a=e.length,s=_d;for(n=0;n<a;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return i=a%3,i===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):i===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):i===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function P_(e){return za&&za.isBuffer(e)}Lv.exports=new I_("tag:yaml.org,2002:binary",{kind:"scalar",resolve:D_,construct:B_,predicate:P_,represent:$_})});var jv=we((fR,Hv)=>{"use strict";var R_=ur(),T_=Object.prototype.hasOwnProperty,x_=Object.prototype.toString;function O_(e){if(e===null)return!0;var t=[],r,n,i,a,s,o=e;for(r=0,n=o.length;r<n;r+=1){if(i=o[r],s=!1,x_.call(i)!=="[object Object]")return!1;for(a in i)if(T_.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function N_(e){return e!==null?e:[]}Hv.exports=new R_("tag:yaml.org,2002:omap",{kind:"sequence",resolve:O_,construct:N_})});var qv=we((hR,Mv)=>{"use strict";var k_=ur(),L_=Object.prototype.toString;function U_(e){if(e===null)return!0;var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],L_.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;a[t]=[i[0],n[i[0]]]}return!0}function H_(e){if(e===null)return[];var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],i=Object.keys(n),a[t]=[i[0],n[i[0]]];return a}Mv.exports=new k_("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:U_,construct:H_})});var Kv=we((pR,Vv)=>{"use strict";var j_=ur(),M_=Object.prototype.hasOwnProperty;function q_(e){if(e===null)return!0;var t,r=e;for(t in r)if(M_.call(r,t)&&r[t]!==null)return!1;return!0}function V_(e){return e!==null?e:{}}Vv.exports=new j_("tag:yaml.org,2002:set",{kind:"mapping",resolve:q_,construct:V_})});var io=we((dR,Gv)=>{"use strict";var K_=Ga();Gv.exports=new K_({include:[Fd()],implicit:[xv(),Nv()],explicit:[Uv(),jv(),qv(),Kv()]})});var Yv=we((gR,zv)=>{"use strict";var G_=ur();function z_(){return!0}function Y_(){}function W_(){return""}function X_(e){return typeof e>"u"}zv.exports=new G_("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:z_,construct:Y_,predicate:X_,represent:W_})});var Xv=we((mR,Wv)=>{"use strict";var J_=ur();function Z_(e){if(e===null||e.length===0)return!1;var t=e,r=/\/([gim]*)$/.exec(e),n="";return!(t[0]==="/"&&(r&&(n=r[1]),n.length>3||t[t.length-n.length-1]!=="/"))}function Q_(e){var t=e,r=/\/([gim]*)$/.exec(e),n="";return t[0]==="/"&&(r&&(n=r[1]),t=t.slice(1,t.length-n.length-1)),new RegExp(t,n)}function eI(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function tI(e){return Object.prototype.toString.call(e)==="[object RegExp]"}Wv.exports=new J_("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Z_,construct:Q_,predicate:tI,represent:eI})});var Qv=we((vR,Zv)=>{"use strict";var Sf;try{Jv=Oa,Sf=Jv("esprima")}catch{typeof window<"u"&&(Sf=window.esprima)}var Jv,rI=ur();function nI(e){if(e===null)return!1;try{var t="("+e+")",r=Sf.parse(t,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function iI(e){var t="("+e+")",r=Sf.parse(t,{range:!0}),n=[],i;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(a){n.push(a.name)}),i=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement"?new Function(n,t.slice(i[0]+1,i[1]-1)):new Function(n,"return "+t.slice(i[0],i[1]))}function sI(e){return e.toString()}function aI(e){return Object.prototype.toString.call(e)==="[object Function]"}Zv.exports=new rI("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:nI,construct:iI,predicate:aI,represent:sI})});var _c=we((AR,t2)=>{"use strict";var e2=Ga();t2.exports=e2.DEFAULT=new e2({include:[io()],explicit:[Yv(),Xv(),Qv()]})});var w2=we((wR,Ic)=>{"use strict";var vs=Ka(),o2=ro(),uI=ov(),c2=io(),oI=_c(),ta=Object.prototype.hasOwnProperty,bf=1,l2=2,f2=3,Cf=4,Id=1,cI=2,r2=3,lI=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,fI=/[\x85\u2028\u2029]/,hI=/[,\[\]\{\}]/,h2=/^(?:!|!!|![a-z\-]+!)$/i,p2=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function n2(e){return Object.prototype.toString.call(e)}function Di(e){return e===10||e===13}function Wa(e){return e===9||e===32}function gn(e){return e===9||e===32||e===10||e===13}function so(e){return e===44||e===91||e===93||e===123||e===125}function pI(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function dI(e){return e===120?2:e===117?4:e===85?8:0}function gI(e){return 48<=e&&e<=57?e-48:-1}function i2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function mI(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var d2=new Array(256),g2=new Array(256);for(Ya=0;Ya<256;Ya++)d2[Ya]=i2(Ya)?1:0,g2[Ya]=i2(Ya);var Ya;function vI(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||oI,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function m2(e,t){return new o2(t,new uI(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Me(e,t){throw m2(e,t)}function Ff(e,t){e.onWarning&&e.onWarning.call(null,m2(e,t))}var s2={YAML:function(t,r,n){var i,a,s;t.version!==null&&Me(t,"duplication of %YAML directive"),n.length!==1&&Me(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Me(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Me(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Ff(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var i,a;n.length!==2&&Me(t,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],h2.test(i)||Me(t,"ill-formed tag handle (first argument) of the TAG directive"),ta.call(t.tagMap,i)&&Me(t,'there is a previously declared suffix for "'+i+'" tag handle'),p2.test(a)||Me(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=a}};function ea(e,t,r,n){var i,a,s,o;if(t<r){if(o=e.input.slice(t,r),n)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||Me(e,"expected valid JSON character");else lI.test(o)&&Me(e,"the stream contains non-printable characters");e.result+=o}}function a2(e,t,r,n){var i,a,s,o;for(vs.isObject(r)||Me(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),s=0,o=i.length;s<o;s+=1)a=i[s],ta.call(t,a)||(t[a]=r[a],n[a]=!0)}function ao(e,t,r,n,i,a,s,o){var l,h;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,h=i.length;l<h;l+=1)Array.isArray(i[l])&&Me(e,"nested arrays are not supported inside keys"),typeof i=="object"&&n2(i[l])==="[object Object]"&&(i[l]="[object Object]");if(typeof i=="object"&&n2(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(l=0,h=a.length;l<h;l+=1)a2(e,t,a[l],r);else a2(e,t,a,r);else!e.json&&!ta.call(r,i)&&ta.call(t,i)&&(e.line=s||e.line,e.position=o||e.position,Me(e,"duplicated mapping key")),t[i]=a,delete r[i];return t}function Dd(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Me(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function rr(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Wa(i);)i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Di(i))for(Dd(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&Ff(e,"deficient indentation"),n}function _f(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||gn(r)))}function Bd(e,t){t===1?e.result+=" ":t>1&&(e.result+=vs.repeat(`
`,t-1))}function EI(e,t,r){var n,i,a,s,o,l,h,d,E=e.kind,p=e.result,f;if(f=e.input.charCodeAt(e.position),gn(f)||so(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(i=e.input.charCodeAt(e.position+1),gn(i)||r&&so(i)))return!1;for(e.kind="scalar",e.result="",a=s=e.position,o=!1;f!==0;){if(f===58){if(i=e.input.charCodeAt(e.position+1),gn(i)||r&&so(i))break}else if(f===35){if(n=e.input.charCodeAt(e.position-1),gn(n))break}else{if(e.position===e.lineStart&&_f(e)||r&&so(f))break;if(Di(f))if(l=e.line,h=e.lineStart,d=e.lineIndent,rr(e,!1,-1),e.lineIndent>=t){o=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=h,e.lineIndent=d;break}}o&&(ea(e,a,s,!1),Bd(e,e.line-l),a=s=e.position,o=!1),Wa(f)||(s=e.position+1),f=e.input.charCodeAt(++e.position)}return ea(e,a,s,!1),e.result?!0:(e.kind=E,e.result=p,!1)}function AI(e,t){var r,n,i;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(ea(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,i=e.position;else return!0;else Di(r)?(ea(e,n,i,!0),Bd(e,rr(e,!1,t)),n=i=e.position):e.position===e.lineStart&&_f(e)?Me(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Me(e,"unexpected end of the stream within a single quoted scalar")}function wI(e,t){var r,n,i,a,s,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return ea(e,r,e.position,!0),e.position++,!0;if(o===92){if(ea(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),Di(o))rr(e,!1,t);else if(o<256&&d2[o])e.result+=g2[o],e.position++;else if((s=dI(o))>0){for(i=s,a=0;i>0;i--)o=e.input.charCodeAt(++e.position),(s=pI(o))>=0?a=(a<<4)+s:Me(e,"expected hexadecimal character");e.result+=mI(a),e.position++}else Me(e,"unknown escape sequence");r=n=e.position}else Di(o)?(ea(e,r,n,!0),Bd(e,rr(e,!1,t)),r=n=e.position):e.position===e.lineStart&&_f(e)?Me(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Me(e,"unexpected end of the stream within a double quoted scalar")}function yI(e,t){var r=!0,n,i=e.tag,a,s=e.anchor,o,l,h,d,E,p={},f,w,g,y;if(y=e.input.charCodeAt(e.position),y===91)l=93,E=!1,a=[];else if(y===123)l=125,E=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),y=e.input.charCodeAt(++e.position);y!==0;){if(rr(e,!0,t),y=e.input.charCodeAt(e.position),y===l)return e.position++,e.tag=i,e.anchor=s,e.kind=E?"mapping":"sequence",e.result=a,!0;r||Me(e,"missed comma between flow collection entries"),w=f=g=null,h=d=!1,y===63&&(o=e.input.charCodeAt(e.position+1),gn(o)&&(h=d=!0,e.position++,rr(e,!0,t))),n=e.line,uo(e,t,bf,!1,!0),w=e.tag,f=e.result,rr(e,!0,t),y=e.input.charCodeAt(e.position),(d||e.line===n)&&y===58&&(h=!0,y=e.input.charCodeAt(++e.position),rr(e,!0,t),uo(e,t,bf,!1,!0),g=e.result),E?ao(e,a,p,w,f,g):h?a.push(ao(e,null,p,w,f,g)):a.push(f),rr(e,!0,t),y=e.input.charCodeAt(e.position),y===44?(r=!0,y=e.input.charCodeAt(++e.position)):r=!1}Me(e,"unexpected end of the stream within a flow collection")}function SI(e,t){var r,n,i=Id,a=!1,s=!1,o=t,l=0,h=!1,d,E;if(E=e.input.charCodeAt(e.position),E===124)n=!1;else if(E===62)n=!0;else return!1;for(e.kind="scalar",e.result="";E!==0;)if(E=e.input.charCodeAt(++e.position),E===43||E===45)Id===i?i=E===43?r2:cI:Me(e,"repeat of a chomping mode identifier");else if((d=gI(E))>=0)d===0?Me(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Me(e,"repeat of an indentation width identifier"):(o=t+d-1,s=!0);else break;if(Wa(E)){do E=e.input.charCodeAt(++e.position);while(Wa(E));if(E===35)do E=e.input.charCodeAt(++e.position);while(!Di(E)&&E!==0)}for(;E!==0;){for(Dd(e),e.lineIndent=0,E=e.input.charCodeAt(e.position);(!s||e.lineIndent<o)&&E===32;)e.lineIndent++,E=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>o&&(o=e.lineIndent),Di(E)){l++;continue}if(e.lineIndent<o){i===r2?e.result+=vs.repeat(`
`,a?1+l:l):i===Id&&a&&(e.result+=`
`);break}for(n?Wa(E)?(h=!0,e.result+=vs.repeat(`
`,a?1+l:l)):h?(h=!1,e.result+=vs.repeat(`
`,l+1)):l===0?a&&(e.result+=" "):e.result+=vs.repeat(`
`,l):e.result+=vs.repeat(`
`,a?1+l:l),a=!0,s=!0,l=0,r=e.position;!Di(E)&&E!==0;)E=e.input.charCodeAt(++e.position);ea(e,r,e.position,!1)}return!0}function u2(e,t){var r,n=e.tag,i=e.anchor,a=[],s,o=!1,l;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),l=e.input.charCodeAt(e.position);l!==0&&!(l!==45||(s=e.input.charCodeAt(e.position+1),!gn(s)));){if(o=!0,e.position++,rr(e,!0,-1)&&e.lineIndent<=t){a.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,uo(e,t,f2,!1,!0),a.push(e.result),rr(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)Me(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=n,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function bI(e,t,r){var n,i,a,s,o=e.tag,l=e.anchor,h={},d={},E=null,p=null,f=null,w=!1,g=!1,y;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),y=e.input.charCodeAt(e.position);y!==0;){if(n=e.input.charCodeAt(e.position+1),a=e.line,s=e.position,(y===63||y===58)&&gn(n))y===63?(w&&(ao(e,h,d,E,p,null),E=p=f=null),g=!0,w=!0,i=!0):w?(w=!1,i=!0):Me(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,y=n;else if(uo(e,r,l2,!1,!0))if(e.line===a){for(y=e.input.charCodeAt(e.position);Wa(y);)y=e.input.charCodeAt(++e.position);if(y===58)y=e.input.charCodeAt(++e.position),gn(y)||Me(e,"a whitespace character is expected after the key-value separator within a block mapping"),w&&(ao(e,h,d,E,p,null),E=p=f=null),g=!0,w=!1,i=!1,E=e.tag,p=e.result;else if(g)Me(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=o,e.anchor=l,!0}else if(g)Me(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=o,e.anchor=l,!0;else break;if((e.line===a||e.lineIndent>t)&&(uo(e,t,Cf,!0,i)&&(w?p=e.result:f=e.result),w||(ao(e,h,d,E,p,f,a,s),E=p=f=null),rr(e,!0,-1),y=e.input.charCodeAt(e.position)),e.lineIndent>t&&y!==0)Me(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return w&&ao(e,h,d,E,p,null),g&&(e.tag=o,e.anchor=l,e.kind="mapping",e.result=h),g}function CI(e){var t,r=!1,n=!1,i,a,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&Me(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(a=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):Me(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!gn(s);)s===33&&(n?Me(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),h2.test(i)||Me(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),hI.test(a)&&Me(e,"tag suffix cannot contain flow indicator characters")}return a&&!p2.test(a)&&Me(e,"tag name cannot contain such characters: "+a),r?e.tag=a:ta.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:Me(e,'undeclared tag handle "'+i+'"'),!0}function FI(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Me(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!gn(r)&&!so(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Me(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function _I(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!gn(n)&&!so(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Me(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),ta.call(e.anchorMap,r)||Me(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],rr(e,!0,-1),!0}function uo(e,t,r,n,i){var a,s,o,l=1,h=!1,d=!1,E,p,f,w,g;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=o=Cf===r||f2===r,n&&rr(e,!0,-1)&&(h=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;CI(e)||FI(e);)rr(e,!0,-1)?(h=!0,o=a,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):o=!1;if(o&&(o=h||i),(l===1||Cf===r)&&(bf===r||l2===r?w=t:w=t+1,g=e.position-e.lineStart,l===1?o&&(u2(e,g)||bI(e,g,w))||yI(e,w)?d=!0:(s&&SI(e,w)||AI(e,w)||wI(e,w)?d=!0:_I(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&Me(e,"alias node should not have any properties")):EI(e,w,bf===r)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=o&&u2(e,g))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Me(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),E=0,p=e.implicitTypes.length;E<p;E+=1)if(f=e.implicitTypes[E],f.resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else ta.call(e.typeMap[e.kind||"fallback"],e.tag)?(f=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&f.kind!==e.kind&&Me(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result)?(e.result=f.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Me(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):Me(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function II(e){var t=e.position,r,n,i,a=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(s=e.input.charCodeAt(e.position))!==0&&(rr(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(a=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!gn(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),i=[],n.length<1&&Me(e,"directive name must not be less than one character in length");s!==0;){for(;Wa(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Di(s));break}if(Di(s))break;for(r=e.position;s!==0&&!gn(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(r,e.position))}s!==0&&Dd(e),ta.call(s2,n)?s2[n](e,n,i):Ff(e,'unknown document directive "'+n+'"')}if(rr(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,rr(e,!0,-1)):a&&Me(e,"directives end mark is expected"),uo(e,e.lineIndent-1,Cf,!1,!0),rr(e,!0,-1),e.checkLineBreaks&&fI.test(e.input.slice(t,e.position))&&Ff(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&_f(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,rr(e,!0,-1));return}if(e.position<e.length-1)Me(e,"end of the stream or a document separator is expected");else return}function v2(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new vI(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,Me(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)II(r);return r.documents}function E2(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=v2(e,r);if(typeof t!="function")return n;for(var i=0,a=n.length;i<a;i+=1)t(n[i])}function A2(e,t){var r=v2(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new o2("expected a single document in the stream, but found more")}}function DI(e,t,r){return typeof t=="object"&&t!==null&&typeof r>"u"&&(r=t,t=null),E2(e,t,vs.extend({schema:c2},r))}function BI(e,t){return A2(e,vs.extend({schema:c2},t))}Ic.exports.loadAll=E2;Ic.exports.load=A2;Ic.exports.safeLoadAll=DI;Ic.exports.safeLoad=BI});var q2=we((yR,Td)=>{"use strict";var Bc=Ka(),$c=ro(),$I=_c(),PI=io(),D2=Object.prototype.toString,B2=Object.prototype.hasOwnProperty,RI=9,Dc=10,TI=13,xI=32,OI=33,NI=34,$2=35,kI=37,LI=38,UI=39,HI=42,P2=44,jI=45,R2=58,MI=61,qI=62,VI=63,KI=64,T2=91,x2=93,GI=96,O2=123,zI=124,N2=125,Nr={};Nr[0]="\\0";Nr[7]="\\a";Nr[8]="\\b";Nr[9]="\\t";Nr[10]="\\n";Nr[11]="\\v";Nr[12]="\\f";Nr[13]="\\r";Nr[27]="\\e";Nr[34]='\\"';Nr[92]="\\\\";Nr[133]="\\N";Nr[160]="\\_";Nr[8232]="\\L";Nr[8233]="\\P";var YI=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function WI(e,t){var r,n,i,a,s,o,l;if(t===null)return{};for(r={},n=Object.keys(t),i=0,a=n.length;i<a;i+=1)s=n[i],o=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&B2.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[s]=o;return r}function y2(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new $c("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Bc.repeat("0",n-t.length)+t}function XI(e){this.schema=e.schema||$I,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Bc.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=WI(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function S2(e,t){for(var r=Bc.repeat(" ",t),n=0,i=-1,a="",s,o=e.length;n<o;)i=e.indexOf(`
`,n),i===-1?(s=e.slice(n),n=o):(s=e.slice(n,i+1),n=i+1),s.length&&s!==`
`&&(a+=r),a+=s;return a}function $d(e,t){return`
`+Bc.repeat(" ",e.indent*t)}function JI(e,t){var r,n,i;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(i=e.implicitTypes[r],i.resolve(t))return!0;return!1}function Rd(e){return e===xI||e===RI}function oo(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function ZI(e){return oo(e)&&!Rd(e)&&e!==65279&&e!==TI&&e!==Dc}function b2(e,t){return oo(e)&&e!==65279&&e!==P2&&e!==T2&&e!==x2&&e!==O2&&e!==N2&&e!==R2&&(e!==$2||t&&ZI(t))}function QI(e){return oo(e)&&e!==65279&&!Rd(e)&&e!==jI&&e!==VI&&e!==R2&&e!==P2&&e!==T2&&e!==x2&&e!==O2&&e!==N2&&e!==$2&&e!==LI&&e!==HI&&e!==OI&&e!==zI&&e!==MI&&e!==qI&&e!==UI&&e!==NI&&e!==kI&&e!==KI&&e!==GI}function k2(e){var t=/^\n* /;return t.test(e)}var L2=1,U2=2,H2=3,j2=4,If=5;function e9(e,t,r,n,i){var a,s,o,l=!1,h=!1,d=n!==-1,E=-1,p=QI(e.charCodeAt(0))&&!Rd(e.charCodeAt(e.length-1));if(t)for(a=0;a<e.length;a++){if(s=e.charCodeAt(a),!oo(s))return If;o=a>0?e.charCodeAt(a-1):null,p=p&&b2(s,o)}else{for(a=0;a<e.length;a++){if(s=e.charCodeAt(a),s===Dc)l=!0,d&&(h=h||a-E-1>n&&e[E+1]!==" ",E=a);else if(!oo(s))return If;o=a>0?e.charCodeAt(a-1):null,p=p&&b2(s,o)}h=h||d&&a-E-1>n&&e[E+1]!==" "}return!l&&!h?p&&!i(e)?L2:U2:r>9&&k2(e)?If:h?j2:H2}function t9(e,t,r,n){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&YI.indexOf(t)!==-1)return"'"+t+"'";var i=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=n||e.flowLevel>-1&&r>=e.flowLevel;function o(l){return JI(e,l)}switch(e9(t,s,e.indent,a,o)){case L2:return t;case U2:return"'"+t.replace(/'/g,"''")+"'";case H2:return"|"+C2(t,e.indent)+F2(S2(t,i));case j2:return">"+C2(t,e.indent)+F2(S2(r9(t,a),i));case If:return'"'+n9(t,a)+'"';default:throw new $c("impossible error: invalid scalar style")}}()}function C2(e,t){var r=k2(e)?String(t):"",n=e[e.length-1]===`
`,i=n&&(e[e.length-2]===`
`||e===`
`),a=i?"+":n?"":"-";return r+a+`
`}function F2(e){return e[e.length-1]===`
`?e.slice(0,-1):e}function r9(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var h=e.indexOf(`
`);return h=h!==-1?h:e.length,r.lastIndex=h,_2(e.slice(0,h),t)}(),i=e[0]===`
`||e[0]===" ",a,s;s=r.exec(e);){var o=s[1],l=s[2];a=l[0]===" ",n+=o+(!i&&!a&&l!==""?`
`:"")+_2(l,t),i=a}return n}function _2(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(e);)o=n.index,o-i>t&&(a=s>i?s:o,l+=`
`+e.slice(i,a),i=a+1),s=o;return l+=`
`,e.length-i>t&&s>i?l+=e.slice(i,s)+`
`+e.slice(s+1):l+=e.slice(i),l.slice(1)}function n9(e){for(var t="",r,n,i,a=0;a<e.length;a++){if(r=e.charCodeAt(a),r>=55296&&r<=56319&&(n=e.charCodeAt(a+1),n>=56320&&n<=57343)){t+=y2((r-55296)*1024+n-56320+65536),a++;continue}i=Nr[r],t+=!i&&oo(r)?e[a]:i||y2(r)}return t}function i9(e,t,r){var n="",i=e.tag,a,s;for(a=0,s=r.length;a<s;a+=1)Xa(e,t,r[a],!1,!1)&&(a!==0&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}function s9(e,t,r,n){var i="",a=e.tag,s,o;for(s=0,o=r.length;s<o;s+=1)Xa(e,t+1,r[s],!0,!0)&&((!n||s!==0)&&(i+=$d(e,t)),e.dump&&Dc===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function a9(e,t,r){var n="",i=e.tag,a=Object.keys(r),s,o,l,h,d;for(s=0,o=a.length;s<o;s+=1)d="",s!==0&&(d+=", "),e.condenseFlow&&(d+='"'),l=a[s],h=r[l],Xa(e,t,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Xa(e,t,h,!1,!1)&&(d+=e.dump,n+=d));e.tag=i,e.dump="{"+n+"}"}function u9(e,t,r,n){var i="",a=e.tag,s=Object.keys(r),o,l,h,d,E,p;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new $c("sortKeys must be a boolean or a function");for(o=0,l=s.length;o<l;o+=1)p="",(!n||o!==0)&&(p+=$d(e,t)),h=s[o],d=r[h],Xa(e,t+1,h,!0,!0,!0)&&(E=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,E&&(e.dump&&Dc===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,E&&(p+=$d(e,t)),Xa(e,t+1,d,!0,E)&&(e.dump&&Dc===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=a,e.dump=i||"{}"}function I2(e,t,r){var n,i,a,s,o,l;for(i=r?e.explicitTypes:e.implicitTypes,a=0,s=i.length;a<s;a+=1)if(o=i[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(e.tag=r?o.tag:"?",o.represent){if(l=e.styleMap[o.tag]||o.defaultStyle,D2.call(o.represent)==="[object Function]")n=o.represent(t,l);else if(B2.call(o.represent,l))n=o.represent[l](t,l);else throw new $c("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');e.dump=n}return!0}return!1}function Xa(e,t,r,n,i,a){e.tag=null,e.dump=r,I2(e,r,!1)||I2(e,r,!0);var s=D2.call(e.dump);n&&(n=e.flowLevel<0||e.flowLevel>t);var o=s==="[object Object]"||s==="[object Array]",l,h;if(o&&(l=e.duplicates.indexOf(r),h=l!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)&&(i=!1),h&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(o&&h&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),s==="[object Object]")n&&Object.keys(e.dump).length!==0?(u9(e,t,e.dump,i),h&&(e.dump="&ref_"+l+e.dump)):(a9(e,t,e.dump),h&&(e.dump="&ref_"+l+" "+e.dump));else if(s==="[object Array]"){var d=e.noArrayIndent&&t>0?t-1:t;n&&e.dump.length!==0?(s9(e,d,e.dump,i),h&&(e.dump="&ref_"+l+e.dump)):(i9(e,d,e.dump),h&&(e.dump="&ref_"+l+" "+e.dump))}else if(s==="[object String]")e.tag!=="?"&&t9(e,e.dump,t,a);else{if(e.skipInvalid)return!1;throw new $c("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function o9(e,t){var r=[],n=[],i,a;for(Pd(e,r,n),i=0,a=n.length;i<a;i+=1)t.duplicates.push(r[n[i]]);t.usedDuplicates=new Array(a)}function Pd(e,t,r){var n,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)Pd(e[i],t,r);else for(n=Object.keys(e),i=0,a=n.length;i<a;i+=1)Pd(e[n[i]],t,r)}function M2(e,t){t=t||{};var r=new XI(t);return r.noRefs||o9(e,r),Xa(r,0,e,!0,!0)?r.dump+`
`:""}function c9(e,t){return M2(e,Bc.extend({schema:PI},t))}Td.exports.dump=M2;Td.exports.safeDump=c9});var K2=we((SR,Vt)=>{"use strict";var Df=w2(),V2=q2();function Bf(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}Vt.exports.Type=ur();Vt.exports.Schema=Ga();Vt.exports.FAILSAFE_SCHEMA=yf();Vt.exports.JSON_SCHEMA=Cd();Vt.exports.CORE_SCHEMA=Fd();Vt.exports.DEFAULT_SAFE_SCHEMA=io();Vt.exports.DEFAULT_FULL_SCHEMA=_c();Vt.exports.load=Df.load;Vt.exports.loadAll=Df.loadAll;Vt.exports.safeLoad=Df.safeLoad;Vt.exports.safeLoadAll=Df.safeLoadAll;Vt.exports.dump=V2.dump;Vt.exports.safeDump=V2.safeDump;Vt.exports.YAMLException=ro();Vt.exports.MINIMAL_SCHEMA=yf();Vt.exports.SAFE_SCHEMA=io();Vt.exports.DEFAULT_SCHEMA=_c();Vt.exports.scan=Bf("scan");Vt.exports.parse=Bf("parse");Vt.exports.compose=Bf("compose");Vt.exports.addConstructor=Bf("addConstructor")});var z2=we((bR,G2)=>{"use strict";var l9=K2();G2.exports=l9});var W2=we((CR,Y2)=>{"use strict";var $f=z2();Y2.exports={safeLoad:$f.safeLoad,load:$f.load,safeDump:$f.safeDump,dump:$f.dump}});var Od=we(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.isCorrect=co.isInSubnet=void 0;function w9(e){return this.subnetMask<e.subnetMask?!1:this.mask(e.subnetMask)===e.mask()}co.isInSubnet=w9;function y9(e){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===e&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}co.isCorrect=y9});var Nd=we(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.RE_SUBNET_STRING=Bi.RE_ADDRESS=Bi.GROUPS=Bi.BITS=void 0;Bi.BITS=32;Bi.GROUPS=4;Bi.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Bi.RE_SUBNET_STRING=/\/\d{1,2}$/});var xf=we(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.AddressError=void 0;var kd=class extends Error{constructor(t,r){super(t),this.name="AddressError",r!==null&&(this.parseMessage=r)}};Tf.AddressError=kd});var Ld=we((Of,Z2)=>{(function(){var e,t=0xdeadbeefcafe,r=(t&16777215)==15715070;function n(R,x,j){R!=null&&(typeof R=="number"?this.fromNumber(R,x,j):x==null&&typeof R!="string"?this.fromString(R,256):this.fromString(R,x))}function i(){return new n(null)}function a(R,x,j,Q,de,ve){for(;--ve>=0;){var Fe=x*this[R++]+j[Q]+de;de=Math.floor(Fe/67108864),j[Q++]=Fe&67108863}return de}function s(R,x,j,Q,de,ve){for(var Fe=x&32767,Pe=x>>15;--ve>=0;){var St=this[R]&32767,jt=this[R++]>>15,yr=Pe*St+jt*Fe;St=Fe*St+((yr&32767)<<15)+j[Q]+(de&1073741823),de=(St>>>30)+(yr>>>15)+Pe*jt+(de>>>30),j[Q++]=St&1073741823}return de}function o(R,x,j,Q,de,ve){for(var Fe=x&16383,Pe=x>>14;--ve>=0;){var St=this[R]&16383,jt=this[R++]>>14,yr=Pe*St+jt*Fe;St=Fe*St+((yr&16383)<<14)+j[Q]+de,de=(St>>28)+(yr>>14)+Pe*jt,j[Q++]=St&268435455}return de}var l=typeof navigator<"u";l&&r&&navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=s,e=30):l&&r&&navigator.appName!="Netscape"?(n.prototype.am=a,e=26):(n.prototype.am=o,e=28),n.prototype.DB=e,n.prototype.DM=(1<<e)-1,n.prototype.DV=1<<e;var h=52;n.prototype.FV=Math.pow(2,h),n.prototype.F1=h-e,n.prototype.F2=2*e-h;var d="0123456789abcdefghijklmnopqrstuvwxyz",E=new Array,p,f;for(p=48,f=0;f<=9;++f)E[p++]=f;for(p=97,f=10;f<36;++f)E[p++]=f;for(p=65,f=10;f<36;++f)E[p++]=f;function w(R){return d.charAt(R)}function g(R,x){var j=E[R.charCodeAt(x)];return j??-1}function y(R){for(var x=this.t-1;x>=0;--x)R[x]=this[x];R.t=this.t,R.s=this.s}function A(R){this.t=1,this.s=R<0?-1:0,R>0?this[0]=R:R<-1?this[0]=R+this.DV:this.t=0}function S(R){var x=i();return x.fromInt(R),x}function _(R,x){var j;if(x==16)j=4;else if(x==8)j=3;else if(x==256)j=8;else if(x==2)j=1;else if(x==32)j=5;else if(x==4)j=2;else{this.fromRadix(R,x);return}this.t=0,this.s=0;for(var Q=R.length,de=!1,ve=0;--Q>=0;){var Fe=j==8?R[Q]&255:g(R,Q);if(Fe<0){R.charAt(Q)=="-"&&(de=!0);continue}de=!1,ve==0?this[this.t++]=Fe:ve+j>this.DB?(this[this.t-1]|=(Fe&(1<<this.DB-ve)-1)<<ve,this[this.t++]=Fe>>this.DB-ve):this[this.t-1]|=Fe<<ve,ve+=j,ve>=this.DB&&(ve-=this.DB)}j==8&&R[0]&128&&(this.s=-1,ve>0&&(this[this.t-1]|=(1<<this.DB-ve)-1<<ve)),this.clamp(),de&&n.ZERO.subTo(this,this)}function I(){for(var R=this.s&this.DM;this.t>0&&this[this.t-1]==R;)--this.t}function D(R){if(this.s<0)return"-"+this.negate().toString(R);var x;if(R==16)x=4;else if(R==8)x=3;else if(R==2)x=1;else if(R==32)x=5;else if(R==4)x=2;else return this.toRadix(R);var j=(1<<x)-1,Q,de=!1,ve="",Fe=this.t,Pe=this.DB-Fe*this.DB%x;if(Fe-- >0)for(Pe<this.DB&&(Q=this[Fe]>>Pe)>0&&(de=!0,ve=w(Q));Fe>=0;)Pe<x?(Q=(this[Fe]&(1<<Pe)-1)<<x-Pe,Q|=this[--Fe]>>(Pe+=this.DB-x)):(Q=this[Fe]>>(Pe-=x)&j,Pe<=0&&(Pe+=this.DB,--Fe)),Q>0&&(de=!0),de&&(ve+=w(Q));return de?ve:"0"}function H(){var R=i();return n.ZERO.subTo(this,R),R}function V(){return this.s<0?this.negate():this}function F(R){var x=this.s-R.s;if(x!=0)return x;var j=this.t;if(x=j-R.t,x!=0)return this.s<0?-x:x;for(;--j>=0;)if((x=this[j]-R[j])!=0)return x;return 0}function P(R){var x=1,j;return(j=R>>>16)!=0&&(R=j,x+=16),(j=R>>8)!=0&&(R=j,x+=8),(j=R>>4)!=0&&(R=j,x+=4),(j=R>>2)!=0&&(R=j,x+=2),(j=R>>1)!=0&&(R=j,x+=1),x}function k(){return this.t<=0?0:this.DB*(this.t-1)+P(this[this.t-1]^this.s&this.DM)}function L(R,x){var j;for(j=this.t-1;j>=0;--j)x[j+R]=this[j];for(j=R-1;j>=0;--j)x[j]=0;x.t=this.t+R,x.s=this.s}function q(R,x){for(var j=R;j<this.t;++j)x[j-R]=this[j];x.t=Math.max(this.t-R,0),x.s=this.s}function J(R,x){var j=R%this.DB,Q=this.DB-j,de=(1<<Q)-1,ve=Math.floor(R/this.DB),Fe=this.s<<j&this.DM,Pe;for(Pe=this.t-1;Pe>=0;--Pe)x[Pe+ve+1]=this[Pe]>>Q|Fe,Fe=(this[Pe]&de)<<j;for(Pe=ve-1;Pe>=0;--Pe)x[Pe]=0;x[ve]=Fe,x.t=this.t+ve+1,x.s=this.s,x.clamp()}function z(R,x){x.s=this.s;var j=Math.floor(R/this.DB);if(j>=this.t){x.t=0;return}var Q=R%this.DB,de=this.DB-Q,ve=(1<<Q)-1;x[0]=this[j]>>Q;for(var Fe=j+1;Fe<this.t;++Fe)x[Fe-j-1]|=(this[Fe]&ve)<<de,x[Fe-j]=this[Fe]>>Q;Q>0&&(x[this.t-j-1]|=(this.s&ve)<<de),x.t=this.t-j,x.clamp()}function K(R,x){for(var j=0,Q=0,de=Math.min(R.t,this.t);j<de;)Q+=this[j]-R[j],x[j++]=Q&this.DM,Q>>=this.DB;if(R.t<this.t){for(Q-=R.s;j<this.t;)Q+=this[j],x[j++]=Q&this.DM,Q>>=this.DB;Q+=this.s}else{for(Q+=this.s;j<R.t;)Q-=R[j],x[j++]=Q&this.DM,Q>>=this.DB;Q-=R.s}x.s=Q<0?-1:0,Q<-1?x[j++]=this.DV+Q:Q>0&&(x[j++]=Q),x.t=j,x.clamp()}function X(R,x){var j=this.abs(),Q=R.abs(),de=j.t;for(x.t=de+Q.t;--de>=0;)x[de]=0;for(de=0;de<Q.t;++de)x[de+j.t]=j.am(0,Q[de],x,de,0,j.t);x.s=0,x.clamp(),this.s!=R.s&&n.ZERO.subTo(x,x)}function ie(R){for(var x=this.abs(),j=R.t=2*x.t;--j>=0;)R[j]=0;for(j=0;j<x.t-1;++j){var Q=x.am(j,x[j],R,2*j,0,1);(R[j+x.t]+=x.am(j+1,2*x[j],R,2*j+1,Q,x.t-j-1))>=x.DV&&(R[j+x.t]-=x.DV,R[j+x.t+1]=1)}R.t>0&&(R[R.t-1]+=x.am(j,x[j],R,2*j,0,1)),R.s=0,R.clamp()}function be(R,x,j){var Q=R.abs();if(!(Q.t<=0)){var de=this.abs();if(de.t<Q.t){x?.fromInt(0),j!=null&&this.copyTo(j);return}j==null&&(j=i());var ve=i(),Fe=this.s,Pe=R.s,St=this.DB-P(Q[Q.t-1]);St>0?(Q.lShiftTo(St,ve),de.lShiftTo(St,j)):(Q.copyTo(ve),de.copyTo(j));var jt=ve.t,yr=ve[jt-1];if(yr!=0){var Sr=yr*(1<<this.F1)+(jt>1?ve[jt-2]>>this.F2:0),An=this.FV/Sr,Us=(1<<this.F1)/Sr,Vr=1<<this.F2,br=j.t,Hs=br-jt,Hn=x??i();for(ve.dlShiftTo(Hs,Hn),j.compareTo(Hn)>=0&&(j[j.t++]=1,j.subTo(Hn,j)),n.ONE.dlShiftTo(jt,Hn),Hn.subTo(ve,ve);ve.t<jt;)ve[ve.t++]=0;for(;--Hs>=0;){var Ca=j[--br]==yr?this.DM:Math.floor(j[br]*An+(j[br-1]+Vr)*Us);if((j[br]+=ve.am(0,Ca,j,Hs,0,jt))<Ca)for(ve.dlShiftTo(Hs,Hn),j.subTo(Hn,j);j[br]<--Ca;)j.subTo(Hn,j)}x!=null&&(j.drShiftTo(jt,x),Fe!=Pe&&n.ZERO.subTo(x,x)),j.t=jt,j.clamp(),St>0&&j.rShiftTo(St,j),Fe<0&&n.ZERO.subTo(j,j)}}}function ye(R){var x=i();return this.abs().divRemTo(R,null,x),this.s<0&&x.compareTo(n.ZERO)>0&&R.subTo(x,x),x}function $e(R){this.m=R}function qe(R){return R.s<0||R.compareTo(this.m)>=0?R.mod(this.m):R}function ce(R){return R}function _e(R){R.divRemTo(this.m,null,R)}function Le(R,x,j){R.multiplyTo(x,j),this.reduce(j)}function lr(R,x){R.squareTo(x),this.reduce(x)}$e.prototype.convert=qe,$e.prototype.revert=ce,$e.prototype.reduce=_e,$e.prototype.mulTo=Le,$e.prototype.sqrTo=lr;function Bt(){if(this.t<1)return 0;var R=this[0];if(!(R&1))return 0;var x=R&3;return x=x*(2-(R&15)*x)&15,x=x*(2-(R&255)*x)&255,x=x*(2-((R&65535)*x&65535))&65535,x=x*(2-R*x%this.DV)%this.DV,x>0?this.DV-x:-x}function pt(R){this.m=R,this.mp=R.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<R.DB-15)-1,this.mt2=2*R.t}function zt(R){var x=i();return R.abs().dlShiftTo(this.m.t,x),x.divRemTo(this.m,null,x),R.s<0&&x.compareTo(n.ZERO)>0&&this.m.subTo(x,x),x}function Tt(R){var x=i();return R.copyTo(x),this.reduce(x),x}function nt(R){for(;R.t<=this.mt2;)R[R.t++]=0;for(var x=0;x<this.m.t;++x){var j=R[x]&32767,Q=j*this.mpl+((j*this.mph+(R[x]>>15)*this.mpl&this.um)<<15)&R.DM;for(j=x+this.m.t,R[j]+=this.m.am(0,Q,R,x,0,this.m.t);R[j]>=R.DV;)R[j]-=R.DV,R[++j]++}R.clamp(),R.drShiftTo(this.m.t,R),R.compareTo(this.m)>=0&&R.subTo(this.m,R)}function It(R,x){R.squareTo(x),this.reduce(x)}function tt(R,x,j){R.multiplyTo(x,j),this.reduce(j)}pt.prototype.convert=zt,pt.prototype.revert=Tt,pt.prototype.reduce=nt,pt.prototype.mulTo=tt,pt.prototype.sqrTo=It;function gt(){return(this.t>0?this[0]&1:this.s)==0}function Yt(R,x){if(R>4294967295||R<1)return n.ONE;var j=i(),Q=i(),de=x.convert(this),ve=P(R)-1;for(de.copyTo(j);--ve>=0;)if(x.sqrTo(j,Q),(R&1<<ve)>0)x.mulTo(Q,de,j);else{var Fe=j;j=Q,Q=Fe}return x.revert(j)}function Je(R,x){var j;return R<256||x.isEven()?j=new $e(x):j=new pt(x),this.exp(R,j)}n.prototype.copyTo=y,n.prototype.fromInt=A,n.prototype.fromString=_,n.prototype.clamp=I,n.prototype.dlShiftTo=L,n.prototype.drShiftTo=q,n.prototype.lShiftTo=J,n.prototype.rShiftTo=z,n.prototype.subTo=K,n.prototype.multiplyTo=X,n.prototype.squareTo=ie,n.prototype.divRemTo=be,n.prototype.invDigit=Bt,n.prototype.isEven=gt,n.prototype.exp=Yt,n.prototype.toString=D,n.prototype.negate=H,n.prototype.abs=V,n.prototype.compareTo=F,n.prototype.bitLength=k,n.prototype.mod=ye,n.prototype.modPowInt=Je,n.ZERO=S(0),n.ONE=S(1);function Ut(){var R=i();return this.copyTo(R),R}function Un(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function fr(){return this.t==0?this.s:this[0]<<24>>24}function wr(){return this.t==0?this.s:this[0]<<16>>16}function Zt(R){return Math.floor(Math.LN2*this.DB/Math.log(R))}function $r(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function la(R){if(R==null&&(R=10),this.signum()==0||R<2||R>36)return"0";var x=this.chunkSize(R),j=Math.pow(R,x),Q=S(j),de=i(),ve=i(),Fe="";for(this.divRemTo(Q,de,ve);de.signum()>0;)Fe=(j+ve.intValue()).toString(R).substr(1)+Fe,de.divRemTo(Q,de,ve);return ve.intValue().toString(R)+Fe}function Mr(R,x){this.fromInt(0),x==null&&(x=10);for(var j=this.chunkSize(x),Q=Math.pow(x,j),de=!1,ve=0,Fe=0,Pe=0;Pe<R.length;++Pe){var St=g(R,Pe);if(St<0){R.charAt(Pe)=="-"&&this.signum()==0&&(de=!0);continue}Fe=x*Fe+St,++ve>=j&&(this.dMultiply(Q),this.dAddOffset(Fe,0),ve=0,Fe=0)}ve>0&&(this.dMultiply(Math.pow(x,ve)),this.dAddOffset(Fe,0)),de&&n.ZERO.subTo(this,this)}function mt(R,x,j){if(typeof x=="number")if(R<2)this.fromInt(1);else for(this.fromNumber(R,j),this.testBit(R-1)||this.bitwiseTo(n.ONE.shiftLeft(R-1),Gi,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(x);)this.dAddOffset(2,0),this.bitLength()>R&&this.subTo(n.ONE.shiftLeft(R-1),this);else{var Q=new Array,de=R&7;Q.length=(R>>3)+1,x.nextBytes(Q),de>0?Q[0]&=(1<<de)-1:Q[0]=0,this.fromString(Q,256)}}function Qt(){var R=this.t,x=new Array;x[0]=this.s;var j=this.DB-R*this.DB%8,Q,de=0;if(R-- >0)for(j<this.DB&&(Q=this[R]>>j)!=(this.s&this.DM)>>j&&(x[de++]=Q|this.s<<this.DB-j);R>=0;)j<8?(Q=(this[R]&(1<<j)-1)<<8-j,Q|=this[--R]>>(j+=this.DB-8)):(Q=this[R]>>(j-=8)&255,j<=0&&(j+=this.DB,--R)),Q&128&&(Q|=-256),de==0&&(this.s&128)!=(Q&128)&&++de,(de>0||Q!=this.s)&&(x[de++]=Q);return x}function Ze(R){return this.compareTo(R)==0}function Pr(R){return this.compareTo(R)<0?this:R}function fa(R){return this.compareTo(R)>0?this:R}function ha(R,x,j){var Q,de,ve=Math.min(R.t,this.t);for(Q=0;Q<ve;++Q)j[Q]=x(this[Q],R[Q]);if(R.t<this.t){for(de=R.s&this.DM,Q=ve;Q<this.t;++Q)j[Q]=x(this[Q],de);j.t=this.t}else{for(de=this.s&this.DM,Q=ve;Q<R.t;++Q)j[Q]=x(de,R[Q]);j.t=R.t}j.s=x(this.s,R.s),j.clamp()}function pa(R,x){return R&x}function da(R){var x=i();return this.bitwiseTo(R,pa,x),x}function Gi(R,x){return R|x}function ga(R){var x=i();return this.bitwiseTo(R,Gi,x),x}function Os(R,x){return R^x}function gi(R){var x=i();return this.bitwiseTo(R,Os,x),x}function zi(R,x){return R&~x}function uu(R){var x=i();return this.bitwiseTo(R,zi,x),x}function ou(){for(var R=i(),x=0;x<this.t;++x)R[x]=this.DM&~this[x];return R.t=this.t,R.s=~this.s,R}function cu(R){var x=i();return R<0?this.rShiftTo(-R,x):this.lShiftTo(R,x),x}function lu(R){var x=i();return R<0?this.lShiftTo(-R,x):this.rShiftTo(R,x),x}function fu(R){if(R==0)return-1;var x=0;return R&65535||(R>>=16,x+=16),R&255||(R>>=8,x+=8),R&15||(R>>=4,x+=4),R&3||(R>>=2,x+=2),R&1||++x,x}function hu(){for(var R=0;R<this.t;++R)if(this[R]!=0)return R*this.DB+fu(this[R]);return this.s<0?this.t*this.DB:-1}function pu(R){for(var x=0;R!=0;)R&=R-1,++x;return x}function Do(){for(var R=0,x=this.s&this.DM,j=0;j<this.t;++j)R+=pu(this[j]^x);return R}function du(R){var x=Math.floor(R/this.DB);return x>=this.t?this.s!=0:(this[x]&1<<R%this.DB)!=0}function Bo(R,x){var j=n.ONE.shiftLeft(R);return this.bitwiseTo(j,x,j),j}function $o(R){return this.changeBit(R,Gi)}function Po(R){return this.changeBit(R,zi)}function Ns(R){return this.changeBit(R,Os)}function Ro(R,x){for(var j=0,Q=0,de=Math.min(R.t,this.t);j<de;)Q+=this[j]+R[j],x[j++]=Q&this.DM,Q>>=this.DB;if(R.t<this.t){for(Q+=R.s;j<this.t;)Q+=this[j],x[j++]=Q&this.DM,Q>>=this.DB;Q+=this.s}else{for(Q+=this.s;j<R.t;)Q+=R[j],x[j++]=Q&this.DM,Q>>=this.DB;Q+=R.s}x.s=Q<0?-1:0,Q>0?x[j++]=Q:Q<-1&&(x[j++]=this.DV+Q),x.t=j,x.clamp()}function ma(R){var x=i();return this.addTo(R,x),x}function To(R){var x=i();return this.subTo(R,x),x}function xo(R){var x=i();return this.multiplyTo(R,x),x}function Oo(){var R=i();return this.squareTo(R),R}function No(R){var x=i();return this.divRemTo(R,x,null),x}function ko(R){var x=i();return this.divRemTo(R,null,x),x}function Lo(R){var x=i(),j=i();return this.divRemTo(R,x,j),new Array(x,j)}function Uo(R){this[this.t]=this.am(0,R-1,this,0,0,this.t),++this.t,this.clamp()}function Ho(R,x){if(R!=0){for(;this.t<=x;)this[this.t++]=0;for(this[x]+=R;this[x]>=this.DV;)this[x]-=this.DV,++x>=this.t&&(this[this.t++]=0),++this[x]}}function mi(){}function gu(R){return R}function jo(R,x,j){R.multiplyTo(x,j)}function Mo(R,x){R.squareTo(x)}mi.prototype.convert=gu,mi.prototype.revert=gu,mi.prototype.mulTo=jo,mi.prototype.sqrTo=Mo;function qo(R){return this.exp(R,new mi)}function mu(R,x,j){var Q=Math.min(this.t+R.t,x);for(j.s=0,j.t=Q;Q>0;)j[--Q]=0;var de;for(de=j.t-this.t;Q<de;++Q)j[Q+this.t]=this.am(0,R[Q],j,Q,0,this.t);for(de=Math.min(R.t,x);Q<de;++Q)this.am(0,R[Q],j,Q,0,x-Q);j.clamp()}function vi(R,x,j){--x;var Q=j.t=this.t+R.t-x;for(j.s=0;--Q>=0;)j[Q]=0;for(Q=Math.max(x-this.t,0);Q<R.t;++Q)j[this.t+Q-x]=this.am(x-Q,R[Q],j,0,0,this.t+Q-x);j.clamp(),j.drShiftTo(1,j)}function en(R){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*R.t,this.r2),this.mu=this.r2.divide(R),this.m=R}function Vo(R){if(R.s<0||R.t>2*this.m.t)return R.mod(this.m);if(R.compareTo(this.m)<0)return R;var x=i();return R.copyTo(x),this.reduce(x),x}function ks(R){return R}function En(R){for(R.drShiftTo(this.m.t-1,this.r2),R.t>this.m.t+1&&(R.t=this.m.t+1,R.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);R.compareTo(this.r2)<0;)R.dAddOffset(1,this.m.t+1);for(R.subTo(this.r2,R);R.compareTo(this.m)>=0;)R.subTo(this.m,R)}function Ko(R,x){R.squareTo(x),this.reduce(x)}function Go(R,x,j){R.multiplyTo(x,j),this.reduce(j)}en.prototype.convert=Vo,en.prototype.revert=ks,en.prototype.reduce=En,en.prototype.mulTo=Go,en.prototype.sqrTo=Ko;function vu(R,x){var j=R.bitLength(),Q,de=S(1),ve;if(j<=0)return de;j<18?Q=1:j<48?Q=3:j<144?Q=4:j<768?Q=5:Q=6,j<8?ve=new $e(x):x.isEven()?ve=new en(x):ve=new pt(x);var Fe=new Array,Pe=3,St=Q-1,jt=(1<<Q)-1;if(Fe[1]=ve.convert(this),Q>1){var yr=i();for(ve.sqrTo(Fe[1],yr);Pe<=jt;)Fe[Pe]=i(),ve.mulTo(yr,Fe[Pe-2],Fe[Pe]),Pe+=2}var Sr=R.t-1,An,Us=!0,Vr=i(),br;for(j=P(R[Sr])-1;Sr>=0;){for(j>=St?An=R[Sr]>>j-St&jt:(An=(R[Sr]&(1<<j+1)-1)<<St-j,Sr>0&&(An|=R[Sr-1]>>this.DB+j-St)),Pe=Q;!(An&1);)An>>=1,--Pe;if((j-=Pe)<0&&(j+=this.DB,--Sr),Us)Fe[An].copyTo(de),Us=!1;else{for(;Pe>1;)ve.sqrTo(de,Vr),ve.sqrTo(Vr,de),Pe-=2;Pe>0?ve.sqrTo(de,Vr):(br=de,de=Vr,Vr=br),ve.mulTo(Vr,Fe[An],de)}for(;Sr>=0&&!(R[Sr]&1<<j);)ve.sqrTo(de,Vr),br=de,de=Vr,Vr=br,--j<0&&(j=this.DB-1,--Sr)}return ve.revert(de)}function va(R){var x=this.s<0?this.negate():this.clone(),j=R.s<0?R.negate():R.clone();if(x.compareTo(j)<0){var Q=x;x=j,j=Q}var de=x.getLowestSetBit(),ve=j.getLowestSetBit();if(ve<0)return x;for(de<ve&&(ve=de),ve>0&&(x.rShiftTo(ve,x),j.rShiftTo(ve,j));x.signum()>0;)(de=x.getLowestSetBit())>0&&x.rShiftTo(de,x),(de=j.getLowestSetBit())>0&&j.rShiftTo(de,j),x.compareTo(j)>=0?(x.subTo(j,x),x.rShiftTo(1,x)):(j.subTo(x,j),j.rShiftTo(1,j));return ve>0&&j.lShiftTo(ve,j),j}function Eu(R){if(R<=0)return 0;var x=this.DV%R,j=this.s<0?R-1:0;if(this.t>0)if(x==0)j=this[0]%R;else for(var Q=this.t-1;Q>=0;--Q)j=(x*j+this[Q])%R;return j}function Ls(R){var x=R.isEven();if(this.isEven()&&x||R.signum()==0)return n.ZERO;for(var j=R.clone(),Q=this.clone(),de=S(1),ve=S(0),Fe=S(0),Pe=S(1);j.signum()!=0;){for(;j.isEven();)j.rShiftTo(1,j),x?((!de.isEven()||!ve.isEven())&&(de.addTo(this,de),ve.subTo(R,ve)),de.rShiftTo(1,de)):ve.isEven()||ve.subTo(R,ve),ve.rShiftTo(1,ve);for(;Q.isEven();)Q.rShiftTo(1,Q),x?((!Fe.isEven()||!Pe.isEven())&&(Fe.addTo(this,Fe),Pe.subTo(R,Pe)),Fe.rShiftTo(1,Fe)):Pe.isEven()||Pe.subTo(R,Pe),Pe.rShiftTo(1,Pe);j.compareTo(Q)>=0?(j.subTo(Q,j),x&&de.subTo(Fe,de),ve.subTo(Pe,ve)):(Q.subTo(j,Q),x&&Fe.subTo(de,Fe),Pe.subTo(ve,Pe))}if(Q.compareTo(n.ONE)!=0)return n.ZERO;if(Pe.compareTo(R)>=0)return Pe.subtract(R);if(Pe.signum()<0)Pe.addTo(R,Pe);else return Pe;return Pe.signum()<0?Pe.add(R):Pe}var Ht=[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],zo=(1<<26)/Ht[Ht.length-1];function Yo(R){var x,j=this.abs();if(j.t==1&&j[0]<=Ht[Ht.length-1]){for(x=0;x<Ht.length;++x)if(j[0]==Ht[x])return!0;return!1}if(j.isEven())return!1;for(x=1;x<Ht.length;){for(var Q=Ht[x],de=x+1;de<Ht.length&&Q<zo;)Q*=Ht[de++];for(Q=j.modInt(Q);x<de;)if(Q%Ht[x++]==0)return!1}return j.millerRabin(R)}function Au(R){var x=this.subtract(n.ONE),j=x.getLowestSetBit();if(j<=0)return!1;var Q=x.shiftRight(j);R=R+1>>1,R>Ht.length&&(R=Ht.length);for(var de=i(),ve=0;ve<R;++ve){de.fromInt(Ht[Math.floor(Math.random()*Ht.length)]);var Fe=de.modPow(Q,this);if(Fe.compareTo(n.ONE)!=0&&Fe.compareTo(x)!=0){for(var Pe=1;Pe++<j&&Fe.compareTo(x)!=0;)if(Fe=Fe.modPowInt(2,this),Fe.compareTo(n.ONE)==0)return!1;if(Fe.compareTo(x)!=0)return!1}}return!0}n.prototype.chunkSize=Zt,n.prototype.toRadix=la,n.prototype.fromRadix=Mr,n.prototype.fromNumber=mt,n.prototype.bitwiseTo=ha,n.prototype.changeBit=Bo,n.prototype.addTo=Ro,n.prototype.dMultiply=Uo,n.prototype.dAddOffset=Ho,n.prototype.multiplyLowerTo=mu,n.prototype.multiplyUpperTo=vi,n.prototype.modInt=Eu,n.prototype.millerRabin=Au,n.prototype.clone=Ut,n.prototype.intValue=Un,n.prototype.byteValue=fr,n.prototype.shortValue=wr,n.prototype.signum=$r,n.prototype.toByteArray=Qt,n.prototype.equals=Ze,n.prototype.min=Pr,n.prototype.max=fa,n.prototype.and=da,n.prototype.or=ga,n.prototype.xor=gi,n.prototype.andNot=uu,n.prototype.not=ou,n.prototype.shiftLeft=cu,n.prototype.shiftRight=lu,n.prototype.getLowestSetBit=hu,n.prototype.bitCount=Do,n.prototype.testBit=du,n.prototype.setBit=$o,n.prototype.clearBit=Po,n.prototype.flipBit=Ns,n.prototype.add=ma,n.prototype.subtract=To,n.prototype.multiply=xo,n.prototype.divide=No,n.prototype.remainder=ko,n.prototype.divideAndRemainder=Lo,n.prototype.modPow=vu,n.prototype.modInverse=Ls,n.prototype.pow=qo,n.prototype.gcd=va,n.prototype.isProbablePrime=Yo,n.prototype.square=Oo,n.prototype.Barrett=en;var Ei,hr,Rt;function Wo(R){hr[Rt++]^=R&255,hr[Rt++]^=R>>8&255,hr[Rt++]^=R>>16&255,hr[Rt++]^=R>>24&255,Rt>=qr&&(Rt-=qr)}function Ea(){Wo(new Date().getTime())}if(hr==null){hr=new Array,Rt=0;var pr;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var Aa=new Uint8Array(32);for(window.crypto.getRandomValues(Aa),pr=0;pr<32;++pr)hr[Rt++]=Aa[pr]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var wu=window.crypto.random(32);for(pr=0;pr<wu.length;++pr)hr[Rt++]=wu.charCodeAt(pr)&255}}for(;Rt<qr;)pr=Math.floor(65536*Math.random()),hr[Rt++]=pr>>>8,hr[Rt++]=pr&255;Rt=0,Ea()}function yu(){if(Ei==null){for(Ea(),Ei=ba(),Ei.init(hr),Rt=0;Rt<hr.length;++Rt)hr[Rt]=0;Rt=0}return Ei.next()}function wa(R){var x;for(x=0;x<R.length;++x)R[x]=yu()}function Ai(){}Ai.prototype.nextBytes=wa;function ya(){this.i=0,this.j=0,this.S=new Array}function Su(R){var x,j,Q;for(x=0;x<256;++x)this.S[x]=x;for(j=0,x=0;x<256;++x)j=j+this.S[x]+R[x%R.length]&255,Q=this.S[x],this.S[x]=this.S[j],this.S[j]=Q;this.i=0,this.j=0}function Sa(){var R;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,R=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=R,this.S[R+this.S[this.i]&255]}ya.prototype.init=Su,ya.prototype.next=Sa;function ba(){return new ya}var qr=256;typeof Of<"u"?Of=Z2.exports={default:n,BigInteger:n,SecureRandom:Ai}:this.jsbn={BigInteger:n,SecureRandom:Ai}}).call(Of)});var Rc=we(Nf=>{(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(s){return n(a(s),arguments)}function r(s,o){return t.apply(null,[s].concat(o||[]))}function n(s,o){var l=1,h=s.length,d,E="",p,f,w,g,y,A,S,_;for(p=0;p<h;p++)if(typeof s[p]=="string")E+=s[p];else if(typeof s[p]=="object"){if(w=s[p],w.keys)for(d=o[l],f=0;f<w.keys.length;f++){if(d==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',w.keys[f],w.keys[f-1]));d=d[w.keys[f]]}else w.param_no?d=o[w.param_no]:d=o[l++];if(e.not_type.test(w.type)&&e.not_primitive.test(w.type)&&d instanceof Function&&(d=d()),e.numeric_arg.test(w.type)&&typeof d!="number"&&isNaN(d))throw new TypeError(t("[sprintf] expecting number but found %T",d));switch(e.number.test(w.type)&&(S=d>=0),w.type){case"b":d=parseInt(d,10).toString(2);break;case"c":d=String.fromCharCode(parseInt(d,10));break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,w.width?parseInt(w.width):0);break;case"e":d=w.precision?parseFloat(d).toExponential(w.precision):parseFloat(d).toExponential();break;case"f":d=w.precision?parseFloat(d).toFixed(w.precision):parseFloat(d);break;case"g":d=w.precision?String(Number(d.toPrecision(w.precision))):parseFloat(d);break;case"o":d=(parseInt(d,10)>>>0).toString(8);break;case"s":d=String(d),d=w.precision?d.substring(0,w.precision):d;break;case"t":d=String(!!d),d=w.precision?d.substring(0,w.precision):d;break;case"T":d=Object.prototype.toString.call(d).slice(8,-1).toLowerCase(),d=w.precision?d.substring(0,w.precision):d;break;case"u":d=parseInt(d,10)>>>0;break;case"v":d=d.valueOf(),d=w.precision?d.substring(0,w.precision):d;break;case"x":d=(parseInt(d,10)>>>0).toString(16);break;case"X":d=(parseInt(d,10)>>>0).toString(16).toUpperCase();break}e.json.test(w.type)?E+=d:(e.number.test(w.type)&&(!S||w.sign)?(_=S?"+":"-",d=d.toString().replace(e.sign,"")):_="",y=w.pad_char?w.pad_char==="0"?"0":w.pad_char.charAt(1):" ",A=w.width-(_+d).length,g=w.width&&A>0?y.repeat(A):"",E+=w.align?_+d+g:y==="0"?_+g+d:g+_+d)}return E}var i=Object.create(null);function a(s){if(i[s])return i[s];for(var o=s,l,h=[],d=0;o;){if((l=e.text.exec(o))!==null)h.push(l[0]);else if((l=e.modulo.exec(o))!==null)h.push("%");else if((l=e.placeholder.exec(o))!==null){if(l[2]){d|=1;var E=[],p=l[2],f=[];if((f=e.key.exec(p))!==null)for(E.push(f[1]);(p=p.substring(f[0].length))!=="";)if((f=e.key_access.exec(p))!==null)E.push(f[1]);else if((f=e.index_access.exec(p))!==null)E.push(f[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=E}else d|=2;if(d===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");h.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");o=o.substring(l[0].length)}return i[s]=h}typeof Nf<"u"&&(Nf.sprintf=t,Nf.vsprintf=r),typeof window<"u"&&(window.sprintf=t,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}}))})()});var Hd=we($i=>{"use strict";var S9=$i&&$i.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),b9=$i&&$i.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tE=$i&&$i.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&S9(t,e,r);return b9(t,e),t};Object.defineProperty($i,"__esModule",{value:!0});$i.Address4=void 0;var Q2=tE(Od()),fi=tE(Nd()),eE=xf(),Tc=Ld(),lo=Rc(),Ud=class e{constructor(t){this.groups=fi.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Q2.isCorrect(fi.BITS),this.isInSubnet=Q2.isInSubnet,this.address=t;let r=fi.RE_SUBNET_STRING.exec(t);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>fi.BITS)throw new eE.AddressError("Invalid subnet mask.");t=t.replace(fi.RE_SUBNET_STRING,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}static isValid(t){try{return new e(t),!0}catch{return!1}}parse(t){let r=t.split(".");if(!t.match(fi.RE_ADDRESS))throw new eE.AddressError("Invalid IPv4 address.");return r}correctForm(){return this.parsedAddress.map(t=>parseInt(t,10)).join(".")}static fromHex(t){let r=t.replace(/:/g,"").padStart(8,"0"),n=[],i;for(i=0;i<8;i+=2){let a=r.slice(i,i+2);n.push(parseInt(a,16))}return new e(n.join("."))}static fromInteger(t){return e.fromHex(t.toString(16))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new e(n)}toHex(){return this.parsedAddress.map(t=>(0,lo.sprintf)("%02x",parseInt(t,10))).join(":")}toArray(){return this.parsedAddress.map(t=>parseInt(t,10))}toGroup6(){let t=[],r;for(r=0;r<fi.GROUPS;r+=2){let n=(0,lo.sprintf)("%02x%02x",parseInt(this.parsedAddress[r],10),parseInt(this.parsedAddress[r+1],10));t.push((0,lo.sprintf)("%x",parseInt(n,16)))}return t.join(":")}bigInteger(){return new Tc.BigInteger(this.parsedAddress.map(t=>(0,lo.sprintf)("%02x",parseInt(t,10))).join(""),16)}_startAddress(){return new Tc.BigInteger(this.mask()+"0".repeat(fi.BITS-this.subnetMask),2)}startAddress(){return e.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new Tc.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new Tc.BigInteger(this.mask()+"1".repeat(fi.BITS-this.subnetMask),2)}endAddress(){return e.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new Tc.BigInteger("1");return e.fromBigInteger(this._endAddress().subtract(t))}static fromBigInteger(t){return e.fromInteger(parseInt(t.toString(),10))}mask(t){return t===void 0&&(t=this.subnetMask),this.getBitsBase2(0,t)}getBitsBase2(t,r){return this.binaryZeroPad().slice(t,r)}reverseForm(t){t||(t={});let r=this.correctForm().split(".").reverse().join(".");return t.omitSuffix?r:(0,lo.sprintf)("%s.in-addr.arpa.",r)}isMulticast(){return this.isInSubnet(new e("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(fi.BITS,"0")}groupForV6(){let t=this.parsedAddress;return this.address.replace(fi.RE_ADDRESS,(0,lo.sprintf)('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',t.slice(0,2).join("."),t.slice(2,4).join(".")))}};$i.Address4=Ud});var jd=we(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.RE_URL_WITH_PORT=Kt.RE_URL=Kt.RE_ZONE_STRING=Kt.RE_SUBNET_STRING=Kt.RE_BAD_ADDRESS=Kt.RE_BAD_CHARACTERS=Kt.TYPES=Kt.SCOPES=Kt.GROUPS=Kt.BITS=void 0;Kt.BITS=128;Kt.GROUPS=8;Kt.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};Kt.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};Kt.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;Kt.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;Kt.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;Kt.RE_ZONE_STRING=/%.*$/;Kt.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);Kt.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var Md=we(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.simpleGroup=Pi.spanLeadingZeroes=Pi.spanAll=Pi.spanAllZeroes=void 0;var rE=Rc();function nE(e){return e.replace(/(0+)/g,'<span class="zero">$1</span>')}Pi.spanAllZeroes=nE;function C9(e,t=0){return e.split("").map((n,i)=>(0,rE.sprintf)('<span class="digit value-%s position-%d">%s</span>',n,i+t,nE(n))).join("")}Pi.spanAll=C9;function iE(e){return e.replace(/^(0+)/,'<span class="zero">$1</span>')}function F9(e){return e.split(":").map(r=>iE(r)).join(":")}Pi.spanLeadingZeroes=F9;function _9(e,t=0){return e.split(":").map((n,i)=>/group-v4/.test(n)?n:(0,rE.sprintf)('<span class="hover-group group-%d">%s</span>',i+t,iE(n)))}Pi.simpleGroup=_9});var sE=we(vr=>{"use strict";var I9=vr&&vr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),D9=vr&&vr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B9=vr&&vr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&I9(t,e,r);return D9(t,e),t};Object.defineProperty(vr,"__esModule",{value:!0});vr.possibleElisions=vr.simpleRegularExpression=vr.ADDRESS_BOUNDARY=vr.padGroup=vr.groupPossibilities=void 0;var $9=B9(jd()),fo=Rc();function Lf(e){return(0,fo.sprintf)("(%s)",e.join("|"))}vr.groupPossibilities=Lf;function kf(e){return e.length<4?(0,fo.sprintf)("0{0,%d}%s",4-e.length,e):e}vr.padGroup=kf;vr.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function P9(e){let t=[];e.forEach((n,i)=>{parseInt(n,16)===0&&t.push(i)});let r=t.map(n=>e.map((i,a)=>{if(a===n){let s=a===0||a===$9.GROUPS-1?":":"";return Lf([kf(i),s])}return kf(i)}).join(":"));return r.push(e.map(kf).join(":")),Lf(r)}vr.simpleRegularExpression=P9;function R9(e,t,r){let n=t?"":":",i=r?"":":",a=[];!t&&!r&&a.push("::"),t&&r&&a.push(""),(r&&!t||!r&&t)&&a.push(":"),a.push((0,fo.sprintf)("%s(:0{1,4}){1,%d}",n,e-1)),a.push((0,fo.sprintf)("(0{1,4}:){1,%d}%s",e-1,i)),a.push((0,fo.sprintf)("(0{1,4}:){%d}0{1,4}",e-1));for(let s=1;s<e-1;s++)for(let o=1;o<e-s;o++)a.push((0,fo.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",o,e-o-s-1));return Lf(a)}vr.possibleElisions=R9});var cE=we(Ri=>{"use strict";var T9=Ri&&Ri.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),x9=Ri&&Ri.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Hf=Ri&&Ri.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&T9(t,e,r);return x9(t,e),t};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.Address6=void 0;var aE=Hf(Od()),qd=Hf(Nd()),$t=Hf(jd()),Vd=Hf(Md()),Za=Hd(),Qa=sE(),Es=xf(),Jr=Ld(),Zr=Rc();function Uf(e){if(!e)throw new Error("Assertion failed.")}function O9(e){let t=/(\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function N9(e){return e=e.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),e=e.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),e}function k9(e,t){let r=[],n=[],i;for(i=0;i<e.length;i++)i<t[0]?r.push(e[i]):i>t[1]&&n.push(e[i]);return r.concat(["compact"]).concat(n)}function uE(e){return(0,Zr.sprintf)("%04x",parseInt(e,16))}function oE(e){return e&255}var Kd=class e{constructor(t,r){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=aE.isInSubnet,this.isCorrect=aE.isCorrect($t.BITS),r===void 0?this.groups=$t.GROUPS:this.groups=r,this.address=t;let n=$t.RE_SUBNET_STRING.exec(t);if(n){if(this.parsedSubnet=n[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>$t.BITS)throw new Es.AddressError("Invalid subnet mask.");t=t.replace($t.RE_SUBNET_STRING,"")}else if(/\//.test(t))throw new Es.AddressError("Invalid subnet mask.");let i=$t.RE_ZONE_STRING.exec(t);i&&(this.zone=i[0],t=t.replace($t.RE_ZONE_STRING,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new e(t),!0}catch{return!1}}static fromBigInteger(t){let r=t.toString(16).padStart(32,"0"),n=[],i;for(i=0;i<$t.GROUPS;i++)n.push(r.slice(i*4,(i+1)*4));return new e(n.join(":"))}static fromURL(t){let r,n=null,i;if(t.indexOf("[")!==-1&&t.indexOf("]:")!==-1){if(i=$t.RE_URL_WITH_PORT.exec(t),i===null)return{error:"failed to parse address with port",address:null,port:null};r=i[1],n=i[2]}else if(t.indexOf("/")!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,""),i=$t.RE_URL.exec(t),i===null)return{error:"failed to parse address from URL",address:null,port:null};r=i[1]}else r=t;return n?(n=parseInt(n,10),(n<0||n>65536)&&(n=null)):n=null,{address:new e(r),port:n}}static fromAddress4(t){let r=new Za.Address4(t),n=$t.BITS-(qd.BITS-r.subnetMask);return new e(`::ffff:${r.correctForm()}/${n}`)}static fromArpa(t){let r=t.replace(/(\.ip6\.arpa)?\.$/,""),n=7;if(r.length!==63)throw new Es.AddressError("Invalid 'ip6.arpa' form.");let i=r.split(".").reverse();for(let a=n;a>0;a--){let s=a*4;i.splice(s,0,":")}return r=i.join(""),new e(r)}microsoftTranscription(){return(0,Zr.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(t=this.subnetMask){return this.getBitsBase2(0,t)}possibleSubnets(t=128){let r=$t.BITS-this.subnetMask,n=Math.abs(t-$t.BITS),i=r-n;return i<0?"0":O9(new Jr.BigInteger("2",10).pow(i).toString(10))}_startAddress(){return new Jr.BigInteger(this.mask()+"0".repeat($t.BITS-this.subnetMask),2)}startAddress(){return e.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new Jr.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new Jr.BigInteger(this.mask()+"1".repeat($t.BITS-this.subnetMask),2)}endAddress(){return e.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new Jr.BigInteger("1");return e.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=$t.SCOPES[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&t!=="Link local"&&(t="Global"),t||"Unknown"}getType(){for(let t of Object.keys($t.TYPES))if(this.isInSubnet(new e(t)))return $t.TYPES[t];return"Global unicast"}getBits(t,r){return new Jr.BigInteger(this.getBitsBase2(t,r),2)}getBitsBase2(t,r){return this.binaryZeroPad().slice(t,r)}getBitsBase16(t,r){let n=r-t;if(n%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(t,r).toString(16).padStart(n/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,$t.BITS)}reverseForm(t){t||(t={});let r=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,"").split("").slice(0,r).reverse().join(".");return r>0?t.omitSuffix?n:(0,Zr.sprintf)("%s.ip6.arpa.",n):t.omitSuffix?"":"ip6.arpa."}correctForm(){let t,r=[],n=0,i=[];for(t=0;t<this.parsedAddress.length;t++){let o=parseInt(this.parsedAddress[t],16);o===0&&n++,o!==0&&n>0&&(n>1&&i.push([t-n,t-1]),n=0)}n>1&&i.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let a=i.map(o=>o[1]-o[0]+1);if(i.length>0){let o=a.indexOf(Math.max(...a));r=k9(this.parsedAddress,i[o])}else r=this.parsedAddress;for(t=0;t<r.length;t++)r[t]!=="compact"&&(r[t]=parseInt(r[t],16).toString(16));let s=r.join(":");return s=s.replace(/^compact$/,"::"),s=s.replace(/^compact|compact$/,":"),s=s.replace(/compact/,""),s}binaryZeroPad(){return this.bigInteger().toString(2).padStart($t.BITS,"0")}parse4in6(t){let r=t.split(":"),i=r.slice(-1)[0].match(qd.RE_ADDRESS);if(i){this.parsedAddress4=i[0],this.address4=new Za.Address4(this.parsedAddress4);for(let a=0;a<this.address4.groups;a++)if(/^0[0-9]+/.test(this.address4.parsedAddress[a]))throw new Es.AddressError("IPv4 addresses can't have leading zeroes.",t.replace(qd.RE_ADDRESS,this.address4.parsedAddress.map(N9).join(".")));this.v4=!0,r[r.length-1]=this.address4.toGroup6(),t=r.join(":")}return t}parse(t){t=this.parse4in6(t);let r=t.match($t.RE_BAD_CHARACTERS);if(r)throw new Es.AddressError((0,Zr.sprintf)("Bad character%s detected in address: %s",r.length>1?"s":"",r.join("")),t.replace($t.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let n=t.match($t.RE_BAD_ADDRESS);if(n)throw new Es.AddressError((0,Zr.sprintf)("Address failed regex: %s",n.join("")),t.replace($t.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let i=[],a=t.split("::");if(a.length===2){let s=a[0].split(":"),o=a[1].split(":");s.length===1&&s[0]===""&&(s=[]),o.length===1&&o[0]===""&&(o=[]);let l=this.groups-(s.length+o.length);if(!l)throw new Es.AddressError("Error parsing groups");this.elidedGroups=l,this.elisionBegin=s.length,this.elisionEnd=s.length+this.elidedGroups,i=i.concat(s);for(let h=0;h<l;h++)i.push("0");i=i.concat(o)}else if(a.length===1)i=t.split(":"),this.elidedGroups=0;else throw new Es.AddressError("Too many :: groups found");if(i=i.map(s=>(0,Zr.sprintf)("%x",parseInt(s,16))),i.length!==this.groups)throw new Es.AddressError("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(uE).join(":")}decimal(){return this.parsedAddress.map(t=>(0,Zr.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new Jr.BigInteger(this.parsedAddress.map(uE).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return Za.Address4.fromHex(new Jr.BigInteger(t.slice(96,128).join(""),2).toString(16))}to4in6(){let t=this.to4(),n=new e(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(n)||(i=":"),n+i+t.address}inspectTeredo(){let t=this.getBitsBase16(0,32),r=this.getBits(80,96).xor(new Jr.BigInteger("ffff",16)).toString(),n=Za.Address4.fromHex(this.getBitsBase16(32,64)),i=Za.Address4.fromHex(this.getBits(96,128).xor(new Jr.BigInteger("ffffffff",16)).toString(16)),a=this.getBits(64,80),s=this.getBitsBase2(64,80),o=a.testBit(15),l=a.testBit(14),h=a.testBit(8),d=a.testBit(9),E=new Jr.BigInteger(s.slice(2,6)+s.slice(8,16),2).toString(10);return{prefix:(0,Zr.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:i.address,flags:s,coneNat:o,microsoft:{reserved:l,universalLocal:d,groupIndividual:h,nonce:E},udpPort:r}}inspect6to4(){let t=this.getBitsBase16(0,16),r=Za.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:(0,Zr.sprintf)("%s",t.slice(0,4)),gateway:r.address}}to6to4(){if(!this.is4())return null;let t=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new e(t)}toByteArray(){let t=this.bigInteger().toByteArray();return t.length===17&&t[0]===0?t.slice(1):t}toUnsignedByteArray(){return this.toByteArray().map(oE)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(oE))}static fromUnsignedByteArray(t){let r=new Jr.BigInteger("256",10),n=new Jr.BigInteger("0",10),i=new Jr.BigInteger("1",10);for(let a=t.length-1;a>=0;a--)n=n.add(i.multiply(new Jr.BigInteger(t[a].toString(10),10))),i=i.multiply(r);return e.fromBigInteger(n)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new e("2001::/32"))}is6to4(){return this.isInSubnet(new e("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(t){return t===void 0?t="":t=(0,Zr.sprintf)(":%s",t),(0,Zr.sprintf)("http://[%s]%s/",this.correctForm(),t)}link(t){t||(t={}),t.className===void 0&&(t.className=""),t.prefix===void 0&&(t.prefix="/#address="),t.v4===void 0&&(t.v4=!1);let r=this.correctForm;return t.v4&&(r=this.to4in6),t.className?(0,Zr.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,r.call(this),t.className):(0,Zr.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,r.call(this))}group(){if(this.elidedGroups===0)return Vd.simpleGroup(this.address).join(":");Uf(typeof this.elidedGroups=="number"),Uf(typeof this.elisionBegin=="number");let t=[],[r,n]=this.address.split("::");r.length?t.push(...Vd.simpleGroup(r)):t.push("");let i=["hover-group"];for(let a=this.elisionBegin;a<this.elisionBegin+this.elidedGroups;a++)i.push((0,Zr.sprintf)("group-%d",a));return t.push((0,Zr.sprintf)('<span class="%s"></span>',i.join(" "))),n.length?t.push(...Vd.simpleGroup(n,this.elisionEnd)):t.push(""),this.is4()&&(Uf(this.address4 instanceof Za.Address4),t.pop(),t.push(this.address4.groupForV6())),t.join(":")}regularExpressionString(t=!1){let r=[],n=new e(this.correctForm());if(n.elidedGroups===0)r.push((0,Qa.simpleRegularExpression)(n.parsedAddress));else if(n.elidedGroups===$t.GROUPS)r.push((0,Qa.possibleElisions)($t.GROUPS));else{let i=n.address.split("::");i[0].length&&r.push((0,Qa.simpleRegularExpression)(i[0].split(":"))),Uf(typeof n.elidedGroups=="number"),r.push((0,Qa.possibleElisions)(n.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&r.push((0,Qa.simpleRegularExpression)(i[1].split(":"))),r=[r.join(":")]}return t||(r=["(?=^|",Qa.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...r,")(?=[^\\w\\:]|",Qa.ADDRESS_BOUNDARY,"|$)"]),r.join("")}regularExpression(t=!1){return new RegExp(this.regularExpressionString(t),"i")}};Ri.Address6=Kd});var lE=we(jr=>{"use strict";var L9=jr&&jr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),U9=jr&&jr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),H9=jr&&jr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&L9(t,e,r);return U9(t,e),t};Object.defineProperty(jr,"__esModule",{value:!0});jr.v6=jr.AddressError=jr.Address6=jr.Address4=void 0;var j9=Hd();Object.defineProperty(jr,"Address4",{enumerable:!0,get:function(){return j9.Address4}});var M9=cE();Object.defineProperty(jr,"Address6",{enumerable:!0,get:function(){return M9.Address6}});var q9=xf();Object.defineProperty(jr,"AddressError",{enumerable:!0,get:function(){return q9.AddressError}});var V9=H9(Md());jr.v6={helpers:V9}});var TE=we(r0=>{"use strict";r0.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e};r0.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}});var xE=we(n0=>{"use strict";n0.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e};n0.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var OE=we(i0=>{"use strict";i0.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e};i0.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var NE=we(s0=>{"use strict";s0.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e};s0.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var kE=we(a0=>{"use strict";a0.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:`OPTION_${e}`};a0.toCode=function(e){if(typeof e=="number")return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}});var HE=we((UE,u0)=>{var LE=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=E,e.encode=d,e.familyOf=h,e.name=void 0,e.sizeOf=l,e.v6=e.v4=void 0;let t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=4,n=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,i=16,a={name:"v4",size:r,isFormat:p=>t.test(p),encode(p,f,w){w=~~w,f=f||new Uint8Array(w+r);let g=p.length,y=0;for(let A=0;A<g;){let S=p.charCodeAt(A++);S===46?(f[w++]=y,y=0):y=y*10+(S-48)}return f[w]=y,f},decode(p,f){return f=~~f,`${p[f++]}.${p[f++]}.${p[f++]}.${p[f]}`}};e.v4=a;let s={name:"v6",size:i,isFormat:p=>p.length>0&&n.test(p),encode(p,f,w){w=~~w;let g=w+i,y=-1,A=0,S=0,_=!0,I=!1;f=f||new Uint8Array(w+i);for(let D=0;D<p.length;D++){let H=p.charCodeAt(D);H===58?(_?y!==-1?(w<g&&(f[w]=0),w<g-1&&(f[w+1]=0),w+=2):w<g&&(y=w):(I===!0?(w<g&&(f[w]=S),w++):(w<g&&(f[w]=A>>8),w<g-1&&(f[w+1]=A&255),w+=2),A=0,S=0),_=!0,I=!1):H===46?(w<g&&(f[w]=S),w++,S=0,A=0,_=!1,I=!0):(_=!1,H>=97?H-=87:H>=65?H-=55:(H-=48,S=S*10+H),A=(A<<4)+H)}if(_===!1)I===!0?(w<g&&(f[w]=S),w++):(w<g&&(f[w]=A>>8),w<g-1&&(f[w+1]=A&255),w+=2);else if(y===0)w<g&&(f[w]=0),w<g-1&&(f[w+1]=0),w+=2;else if(y!==-1){w+=2;for(let D=Math.min(w-1,g-1);D>=y+2;D--)f[D]=f[D-2];f[y]=0,f[y+1]=0,y=w}if(y!==w&&y!==-1)for(w>g-2&&(w=g-2);g>y;)f[--g]=w<g&&w>y?f[--w]:0;else for(;w<g;)f[w++]=0;return f},decode(p,f){f=~~f;let w="";for(let g=0;g<i;g+=2)g!==0&&(w+=":"),w+=(p[f+g]<<8|p[f+g+1]).toString(16);return w.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=s;let o="ip";e.name=o;function l(p){if(a.isFormat(p))return a.size;if(s.isFormat(p))return s.size;throw Error(`Invalid ip address: ${p}`)}function h(p){return l(p)===a.size?1:2}function d(p,f,w){w=~~w;let g=l(p);return typeof f=="function"&&(f=f(w+g)),g===a.size?a.encode(p,f,w):s.encode(p,f,w)}function E(p,f,w){if(f=~~f,w=w||p.length-f,w===a.size)return a.decode(p,f,w);if(w===s.size)return s.decode(p,f,w);throw Error(`Invalid buffer size needs to be ${a.size} for v4 or ${s.size} for v6.`)}return"default"in e?e.default:e}({});typeof define=="function"&&define.amd?define([],function(){return LE}):typeof u0=="object"&&typeof UE=="object"&&(u0.exports=LE)});var qE=we(Ne=>{"use strict";var ke=af().Buffer,Bs=TE(),hD=xE(),pD=OE(),Zf=NE(),o0=kE(),tu=HE(),dD=0,jE=32768,c0=32768,gD=~c0,ME=32768,mD=~ME,De=Ne.name={};De.encode=function(e,t,r,{mail:n=!1}={}){t||(t=ke.alloc(De.encodingLength(e))),r||(r=0);let i=r,a=e.replace(/^\.|\.$/gm,"");if(a.length){let s=[];if(n){let o="";a.split(".").forEach(l=>{l.endsWith("\\")?o+=(o.length?".":"")+l.slice(0,-1):s.length===0&&o.length?s.push(o+"."+l):s.push(l)})}else s=a.split(".");for(let o=0;o<s.length;o++){let l=t.write(s[o],r+1);t[r]=l,r+=l+1}}return t[r++]=0,De.encode.bytes=r-i,t};De.encode.bytes=0;De.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let n=[],i=t,a=0,s=0,o=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(s+=o?0:1,l===0)break;if(l&192)if((l&192)===192){if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");let h=e.readUInt16BE(t-1)-49152;if(h>=i)throw new Error("Cannot decode name (bad pointer)");t=h,i=h,s+=o?0:1,o=!0}else throw new Error("Cannot decode name (bad label)");else{if(t+l>e.length)throw new Error("Cannot decode name (buffer overflow)");if(a+=l+1,a>254)throw new Error("Cannot decode name (name too long)");let h=e.toString("utf-8",t,t+l);r&&(h=h.replace(/\./g,"\\.")),n.push(h),t+=l,s+=o?0:l}}return De.decode.bytes=s,n.length===0?".":n.join(".")};De.decode.bytes=0;De.encodingLength=function(e){return e==="."||e===".."?1:ke.byteLength(e.replace(/^\.|\.$/gm,""))+2};var st={};st.encode=function(e,t,r){t||(t=ke.alloc(st.encodingLength(e))),r||(r=0);let n=t.write(e,r+1);return t[r]=n,st.encode.bytes=n+1,t};st.encode.bytes=0;st.decode=function(e,t){t||(t=0);let r=e[t],n=e.toString("utf-8",t+1,t+1+r);return st.decode.bytes=r+1,n};st.decode.bytes=0;st.encodingLength=function(e){return ke.byteLength(e)+1};var di={};di.encode=function(e,t,r){t||(t=di.encodingLength(e)),r||(r=0);let n=(e.flags||0)&32767,i=e.type==="response"?jE:dD;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(n|i,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t};di.encode.bytes=12;di.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");let r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:r&jE?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:pD.toString(r>>11&15),flag_aa:(r>>10&1)===1,flag_tc:(r>>9&1)===1,flag_rd:(r>>8&1)===1,flag_ra:(r>>7&1)===1,flag_z:(r>>6&1)===1,flag_ad:(r>>5&1)===1,flag_cd:(r>>4&1)===1,rcode:hD.toString(r&15),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}};di.decode.bytes=12;di.encodingLength=function(){return 12};var ws=Ne.unknown={};ws.encode=function(e,t,r){return t||(t=ke.alloc(ws.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),ws.encode.bytes=e.length+2,t};ws.encode.bytes=0;ws.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n=e.slice(t+2,t+2+r);return ws.decode.bytes=r+2,n};ws.decode.bytes=0;ws.encodingLength=function(e){return e.length+2};var ys=Ne.ns={};ys.encode=function(e,t,r){return t||(t=ke.alloc(ys.encodingLength(e))),r||(r=0),De.encode(e,t,r+2),t.writeUInt16BE(De.encode.bytes,r),ys.encode.bytes=De.encode.bytes+2,t};ys.encode.bytes=0;ys.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n=De.decode(e,t+2);return ys.decode.bytes=r+2,n};ys.decode.bytes=0;ys.encodingLength=function(e){return De.encodingLength(e)+2};var Ss=Ne.soa={};Ss.encode=function(e,t,r){t||(t=ke.alloc(Ss.encodingLength(e))),r||(r=0);let n=r;return r+=2,De.encode(e.mname,t,r),r+=De.encode.bytes,De.encode(e.rname,t,r,{mail:!0}),r+=De.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-n-2,n),Ss.encode.bytes=r-n,t};Ss.encode.bytes=0;Ss.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.mname=De.decode(e,t),t+=De.decode.bytes,n.rname=De.decode(e,t,{mail:!0}),t+=De.decode.bytes,n.serial=e.readUInt32BE(t),t+=4,n.refresh=e.readUInt32BE(t),t+=4,n.retry=e.readUInt32BE(t),t+=4,n.expire=e.readUInt32BE(t),t+=4,n.minimum=e.readUInt32BE(t),t+=4,Ss.decode.bytes=t-r,n};Ss.decode.bytes=0;Ss.encodingLength=function(e){return 22+De.encodingLength(e.mname)+De.encodingLength(e.rname)};var bs=Ne.txt={};bs.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let i=0;i<e.length;i++)if(typeof e[i]=="string"&&(e[i]=ke.from(e[i])),!ke.isBuffer(e[i]))throw new Error("Must be a Buffer");t||(t=ke.alloc(bs.encodingLength(e))),r||(r=0);let n=r;return r+=2,e.forEach(function(i){t[r++]=i.length,i.copy(t,r,0,i.length),r+=i.length}),t.writeUInt16BE(r-n-2,n),bs.encode.bytes=r-n,t};bs.encode.bytes=0;bs.decode=function(e,t){t||(t=0);let r=t,n=e.readUInt16BE(t);t+=2;let i=[];for(;n>0;){let a=e[t++];if(--n,n<a)throw new Error("Buffer overflow");i.push(e.slice(t,t+a)),t+=a,n-=a}return bs.decode.bytes=t-r,i};bs.decode.bytes=0;bs.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=ke.byteLength(r)+1:t+=r.length+1}),t};var Cs=Ne.null={};Cs.encode=function(e,t,r){t||(t=ke.alloc(Cs.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=ke.from(e)),e||(e=ke.alloc(0));let n=r;r+=2;let i=e.length;return e.copy(t,r,0,i),r+=i,t.writeUInt16BE(r-n-2,n),Cs.encode.bytes=r-n,t};Cs.encode.bytes=0;Cs.decode=function(e,t){t||(t=0);let r=t,n=e.readUInt16BE(t);t+=2;let i=e.slice(t,t+n);return t+=n,Cs.decode.bytes=t-r,i};Cs.decode.bytes=0;Cs.encodingLength=function(e){return e?(ke.isBuffer(e)?e.length:ke.byteLength(e))+2:2};var Fs=Ne.hinfo={};Fs.encode=function(e,t,r){t||(t=ke.alloc(Fs.encodingLength(e))),r||(r=0);let n=r;return r+=2,st.encode(e.cpu,t,r),r+=st.encode.bytes,st.encode(e.os,t,r),r+=st.encode.bytes,t.writeUInt16BE(r-n-2,n),Fs.encode.bytes=r-n,t};Fs.encode.bytes=0;Fs.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.cpu=st.decode(e,t),t+=st.decode.bytes,n.os=st.decode(e,t),t+=st.decode.bytes,Fs.decode.bytes=t-r,n};Fs.decode.bytes=0;Fs.encodingLength=function(e){return st.encodingLength(e.cpu)+st.encodingLength(e.os)+2};var hi=Ne.ptr={},vD=Ne.cname=hi,ED=Ne.dname=hi;hi.encode=function(e,t,r){return t||(t=ke.alloc(hi.encodingLength(e))),r||(r=0),De.encode(e,t,r+2),t.writeUInt16BE(De.encode.bytes,r),hi.encode.bytes=De.encode.bytes+2,t};hi.encode.bytes=0;hi.decode=function(e,t){t||(t=0);let r=De.decode(e,t+2);return hi.decode.bytes=De.decode.bytes+2,r};hi.decode.bytes=0;hi.encodingLength=function(e){return De.encodingLength(e)+2};var _s=Ne.srv={};_s.encode=function(e,t,r){t||(t=ke.alloc(_s.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),De.encode(e.target,t,r+8);let n=De.encode.bytes+6;return t.writeUInt16BE(n,r),_s.encode.bytes=n+2,t};_s.encode.bytes=0;_s.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n={};return n.priority=e.readUInt16BE(t+2),n.weight=e.readUInt16BE(t+4),n.port=e.readUInt16BE(t+6),n.target=De.decode(e,t+8),_s.decode.bytes=r+2,n};_s.decode.bytes=0;_s.encodingLength=function(e){return 8+De.encodingLength(e.target)};var $n=Ne.caa={};$n.ISSUER_CRITICAL=128;$n.encode=function(e,t,r){let n=$n.encodingLength(e);return t||(t=ke.alloc($n.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=$n.ISSUER_CRITICAL),t.writeUInt16BE(n-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,st.encode(e.tag,t,r),r+=st.encode.bytes,t.write(e.value,r),r+=ke.byteLength(e.value),$n.encode.bytes=n,t};$n.encode.bytes=0;$n.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t);t+=2;let n=t,i={};return i.flags=e.readUInt8(t),t+=1,i.tag=st.decode(e,t),t+=st.decode.bytes,i.value=e.toString("utf-8",t,n+r),i.issuerCritical=!!(i.flags&$n.ISSUER_CRITICAL),$n.decode.bytes=r+2,i};$n.decode.bytes=0;$n.encodingLength=function(e){return st.encodingLength(e.tag)+st.encodingLength(e.value)+2};var na=Ne.mx={};na.encode=function(e,t,r){t||(t=ke.alloc(na.encodingLength(e))),r||(r=0);let n=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,De.encode(e.exchange,t,r),r+=De.encode.bytes,t.writeUInt16BE(r-n-2,n),na.encode.bytes=r-n,t};na.encode.bytes=0;na.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.preference=e.readUInt16BE(t),t+=2,n.exchange=De.decode(e,t),t+=De.decode.bytes,na.decode.bytes=t-r,n};na.encodingLength=function(e){return 4+De.encodingLength(e.exchange)};var Is=Ne.a={};Is.encode=function(e,t,r){return t||(t=ke.alloc(Is.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,tu.v4.encode(e,t,r),Is.encode.bytes=6,t};Is.encode.bytes=0;Is.decode=function(e,t){t||(t=0),t+=2;let r=tu.v4.decode(e,t);return Is.decode.bytes=6,r};Is.decode.bytes=0;Is.encodingLength=function(){return 6};var Ds=Ne.aaaa={};Ds.encode=function(e,t,r){return t||(t=ke.alloc(Ds.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,tu.v6.encode(e,t,r),Ds.encode.bytes=18,t};Ds.encode.bytes=0;Ds.decode=function(e,t){t||(t=0),t+=2;let r=tu.v6.decode(e,t);return Ds.decode.bytes=18,r};Ds.decode.bytes=0;Ds.encodingLength=function(){return 18};var mn=Ne.option={};mn.encode=function(e,t,r){t||(t=ke.alloc(mn.encodingLength(e))),r||(r=0);let n=r,i=o0.toCode(e.code);if(t.writeUInt16BE(i,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(i){case 8:let a=e.sourcePrefixLength||0,s=e.family||tu.familyOf(e.ip),o=tu.encode(e.ip,ke.alloc),l=Math.ceil(a/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(s,r),r+=2,t.writeUInt8(a,r++),t.writeUInt8(e.scopePrefixLength||0,r++),o.copy(t,r,0,l),r+=l;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:let h=e.length||0;t.writeUInt16BE(h,r),r+=2,t.fill(0,r,r+h),r+=h;break;case 14:let d=e.tags.length*2;t.writeUInt16BE(d,r),r+=2;for(let E of e.tags)t.writeUInt16BE(E,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return mn.encode.bytes=r-n,t};mn.encode.bytes=0;mn.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=o0.toString(r.code),t+=2;let n=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+n),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);let i=ke.alloc(r.family===1?4:16);e.copy(i,0,t,t+n-4),r.ip=tu.decode(i);break;case 11:n>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let a=0;a<n;a+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return mn.decode.bytes=n+4,r};mn.decode.bytes=0;mn.encodingLength=function(e){if(e.data)return e.data.length+4;switch(o0.toCode(e.code)){case 8:let r=e.sourcePrefixLength||0;return Math.ceil(r/8)+8;case 11:return typeof e.timeout=="number"?6:4;case 12:return e.length+4;case 14:return 4+e.tags.length*2}throw new Error(`Unknown roption code: ${e.code}`)};var Rn=Ne.opt={};Rn.encode=function(e,t,r){t||(t=ke.alloc(Rn.encodingLength(e))),r||(r=0);let n=r,i=Ao(e,mn);return t.writeUInt16BE(i,r),r=Uc(e,mn,t,r+2),Rn.encode.bytes=r-n,t};Rn.encode.bytes=0;Rn.decode=function(e,t){t||(t=0);let r=t,n=[],i=e.readUInt16BE(t);t+=2;let a=0;for(;i>0;)n[a++]=mn.decode(e,t),t+=mn.decode.bytes,i-=mn.decode.bytes;return Rn.decode.bytes=t-r,n};Rn.decode.bytes=0;Rn.encodingLength=function(e){return 2+Ao(e||[],mn)};var Qr=Ne.dnskey={};Qr.PROTOCOL_DNSSEC=3;Qr.ZONE_KEY=128;Qr.SECURE_ENTRYPOINT=32768;Qr.encode=function(e,t,r){t||(t=ke.alloc(Qr.encodingLength(e))),r||(r=0);let n=r,i=e.key;if(!ke.isBuffer(i))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(Qr.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,Qr.encode.bytes=r-n,t.writeUInt16BE(Qr.encode.bytes-2,n),t};Qr.encode.bytes=0;Qr.decode=function(e,t){t||(t=0);let r=t;var n={},i=e.readUInt16BE(t);if(t+=2,n.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==Qr.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,n.algorithm=e.readUInt8(t),t+=1,n.key=e.slice(t,r+i+2),t+=n.key.length,Qr.decode.bytes=t-r,n};Qr.decode.bytes=0;Qr.encodingLength=function(e){return 6+ke.byteLength(e.key)};var Oi=Ne.rrsig={};Oi.encode=function(e,t,r){t||(t=ke.alloc(Oi.encodingLength(e))),r||(r=0);let n=r,i=e.signature;if(!ke.isBuffer(i))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(Bs.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,De.encode(e.signersName,t,r),r+=De.encode.bytes,i.copy(t,r,0,i.length),r+=i.length,Oi.encode.bytes=r-n,t.writeUInt16BE(Oi.encode.bytes-2,n),t};Oi.encode.bytes=0;Oi.decode=function(e,t){t||(t=0);let r=t;var n={},i=e.readUInt16BE(t);return t+=2,n.typeCovered=Bs.toString(e.readUInt16BE(t)),t+=2,n.algorithm=e.readUInt8(t),t+=1,n.labels=e.readUInt8(t),t+=1,n.originalTTL=e.readUInt32BE(t),t+=4,n.expiration=e.readUInt32BE(t),t+=4,n.inception=e.readUInt32BE(t),t+=4,n.keyTag=e.readUInt16BE(t),t+=2,n.signersName=De.decode(e,t),t+=De.decode.bytes,n.signature=e.slice(t,r+i+2),t+=n.signature.length,Oi.decode.bytes=t-r,n};Oi.decode.bytes=0;Oi.encodingLength=function(e){return 20+De.encodingLength(e.signersName)+ke.byteLength(e.signature)};var Ni=Ne.rp={};Ni.encode=function(e,t,r){t||(t=ke.alloc(Ni.encodingLength(e))),r||(r=0);let n=r;return r+=2,De.encode(e.mbox||".",t,r,{mail:!0}),r+=De.encode.bytes,De.encode(e.txt||".",t,r),r+=De.encode.bytes,Ni.encode.bytes=r-n,t.writeUInt16BE(Ni.encode.bytes-2,n),t};Ni.encode.bytes=0;Ni.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.mbox=De.decode(e,t,{mail:!0})||".",t+=De.decode.bytes,n.txt=De.decode(e,t)||".",t+=De.decode.bytes,Ni.decode.bytes=t-r,n};Ni.decode.bytes=0;Ni.encodingLength=function(e){return 2+De.encodingLength(e.mbox||".")+De.encodingLength(e.txt||".")};var Ar={};Ar.encode=function(e,t,r){t||(t=ke.alloc(Ar.encodingLength(e))),r||(r=0);let n=r;for(var i=[],a=0;a<e.length;a++){var s=Bs.toType(e[a]);i[s>>8]===void 0&&(i[s>>8]=[]),i[s>>8][s>>3&31]|=1<<7-(s&7)}for(a=0;a<i.length;a++)if(i[a]!==void 0){var o=ke.from(i[a]);t.writeUInt8(a,r),r+=1,t.writeUInt8(o.length,r),r+=1,o.copy(t,r),r+=o.length}return Ar.encode.bytes=r-n,t};Ar.encode.bytes=0;Ar.decode=function(e,t,r){t||(t=0);let n=t;for(var i=[];t-n<r;){var a=e.readUInt8(t);t+=1;var s=e.readUInt8(t);t+=1;for(var o=0;o<s;o++)for(var l=e.readUInt8(t+o),h=0;h<8;h++)if(l&1<<7-h){var d=Bs.toString(a<<8|o<<3|h);i.push(d)}t+=s}return Ar.decode.bytes=t-n,i};Ar.decode.bytes=0;Ar.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var n=Bs.toType(e[r]);t[n>>8]=Math.max(t[n>>8]||0,n&255)}var i=0;for(r=0;r<t.length;r++)t[r]!==void 0&&(i+=2+Math.ceil((t[r]+1)/8));return i};var ki=Ne.nsec={};ki.encode=function(e,t,r){t||(t=ke.alloc(ki.encodingLength(e))),r||(r=0);let n=r;return r+=2,De.encode(e.nextDomain,t,r),r+=De.encode.bytes,Ar.encode(e.rrtypes,t,r),r+=Ar.encode.bytes,ki.encode.bytes=r-n,t.writeUInt16BE(ki.encode.bytes-2,n),t};ki.encode.bytes=0;ki.decode=function(e,t){t||(t=0);let r=t;var n={},i=e.readUInt16BE(t);return t+=2,n.nextDomain=De.decode(e,t),t+=De.decode.bytes,n.rrtypes=Ar.decode(e,t,i-(t-r)),t+=Ar.decode.bytes,ki.decode.bytes=t-r,n};ki.decode.bytes=0;ki.encodingLength=function(e){return 2+De.encodingLength(e.nextDomain)+Ar.encodingLength(e.rrtypes)};var Li=Ne.nsec3={};Li.encode=function(e,t,r){t||(t=ke.alloc(Li.encodingLength(e))),r||(r=0);let n=r,i=e.salt;if(!ke.isBuffer(i))throw new Error("salt must be a Buffer");let a=e.nextDomain;if(!ke.isBuffer(a))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(i.length,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,t.writeUInt8(a.length,r),r+=1,a.copy(t,r,0,a.length),r+=a.length,Ar.encode(e.rrtypes,t,r),r+=Ar.encode.bytes,Li.encode.bytes=r-n,t.writeUInt16BE(Li.encode.bytes-2,n),t};Li.encode.bytes=0;Li.decode=function(e,t){t||(t=0);let r=t;var n={},i=e.readUInt16BE(t);t+=2,n.algorithm=e.readUInt8(t),t+=1,n.flags=e.readUInt8(t),t+=1,n.iterations=e.readUInt16BE(t),t+=2;let a=e.readUInt8(t);t+=1,n.salt=e.slice(t,t+a),t+=a;let s=e.readUInt8(t);return t+=1,n.nextDomain=e.slice(t,t+s),t+=s,n.rrtypes=Ar.decode(e,t,i-(t-r)),t+=Ar.decode.bytes,Li.decode.bytes=t-r,n};Li.decode.bytes=0;Li.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+Ar.encodingLength(e.rrtypes)};var Ui=Ne.ds={};Ui.encode=function(e,t,r){t||(t=ke.alloc(Ui.encodingLength(e))),r||(r=0);let n=r,i=e.digest;if(!ke.isBuffer(i))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,Ui.encode.bytes=r-n,t.writeUInt16BE(Ui.encode.bytes-2,n),t};Ui.encode.bytes=0;Ui.decode=function(e,t){t||(t=0);let r=t;var n={},i=e.readUInt16BE(t);return t+=2,n.keyTag=e.readUInt16BE(t),t+=2,n.algorithm=e.readUInt8(t),t+=1,n.digestType=e.readUInt8(t),t+=1,n.digest=e.slice(t,r+i+2),t+=n.digest.length,Ui.decode.bytes=t-r,n};Ui.decode.bytes=0;Ui.encodingLength=function(e){return 6+ke.byteLength(e.digest)};var Pn=Ne.sshfp={};Pn.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};Pn.encode=function(t,r,n){r||(r=ke.alloc(Pn.encodingLength(t))),n||(n=0);let i=n;n+=2,r[n]=t.algorithm,n+=1,r[n]=t.hash,n+=1;let a=ke.from(t.fingerprint.toUpperCase(),"hex");if(a.length!==Pn.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return a.copy(r,n),n+=a.byteLength,Pn.encode.bytes=n-i,r.writeUInt16BE(Pn.encode.bytes-2,i),r};Pn.encode.bytes=0;Pn.decode=function(t,r){r||(r=0);let n=r,i={};r+=2,i.algorithm=t[r],r+=1,i.hash=t[r],r+=1;let a=Pn.getFingerprintLengthForHashType(i.hash);return i.fingerprint=t.slice(r,r+a).toString("hex").toUpperCase(),r+=a,Pn.decode.bytes=r-n,i};Pn.decode.bytes=0;Pn.encodingLength=function(e){return 4+ke.from(e.fingerprint,"hex").byteLength};var Hi=Ne.naptr={};Hi.encode=function(e,t,r){t||(t=ke.alloc(Hi.encodingLength(e))),r||(r=0);let n=r;return r+=2,t.writeUInt16BE(e.order||0,r),r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,st.encode(e.flags,t,r),r+=st.encode.bytes,st.encode(e.services,t,r),r+=st.encode.bytes,st.encode(e.regexp,t,r),r+=st.encode.bytes,De.encode(e.replacement,t,r),r+=De.encode.bytes,Hi.encode.bytes=r-n,t.writeUInt16BE(Hi.encode.bytes-2,n),t};Hi.encode.bytes=0;Hi.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.order=e.readUInt16BE(t),t+=2,n.preference=e.readUInt16BE(t),t+=2,n.flags=st.decode(e,t),t+=st.decode.bytes,n.services=st.decode(e,t),t+=st.decode.bytes,n.regexp=st.decode(e,t),t+=st.decode.bytes,n.replacement=De.decode(e,t),t+=De.decode.bytes,Hi.decode.bytes=t-r,n};Hi.decode.bytes=0;Hi.encodingLength=function(e){return st.encodingLength(e.flags)+st.encodingLength(e.services)+st.encodingLength(e.regexp)+De.encodingLength(e.replacement)+6};var ji=Ne.tlsa={};ji.encode=function(e,t,r){t||(t=ke.alloc(ji.encodingLength(e))),r||(r=0);let n=r,i=e.certificate;if(!ke.isBuffer(i))throw new Error("Certificate must be a Buffer");return r+=2,t.writeUInt8(e.usage,r),r+=1,t.writeUInt8(e.selector,r),r+=1,t.writeUInt8(e.matchingType,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,ji.encode.bytes=r-n,t.writeUInt16BE(ji.encode.bytes-2,n),t};ji.encode.bytes=0;ji.decode=function(e,t){t||(t=0);let r=t,n={},i=e.readUInt16BE(t);return t+=2,n.usage=e.readUInt8(t),t+=1,n.selector=e.readUInt8(t),t+=1,n.matchingType=e.readUInt8(t),t+=1,n.certificate=e.slice(t,r+i+2),t+=n.certificate.length,ji.decode.bytes=t-r,n};ji.decode.bytes=0;ji.encodingLength=function(e){return 5+ke.byteLength(e.certificate)};var l0=Ne.record=function(e){switch(e.toUpperCase()){case"A":return Is;case"PTR":return hi;case"CNAME":return vD;case"DNAME":return ED;case"TXT":return bs;case"NULL":return Cs;case"AAAA":return Ds;case"SRV":return _s;case"HINFO":return Fs;case"CAA":return $n;case"NS":return ys;case"SOA":return Ss;case"MX":return na;case"OPT":return Rn;case"DNSKEY":return Qr;case"RRSIG":return Oi;case"RP":return Ni;case"NSEC":return ki;case"NSEC3":return Li;case"SSHFP":return Pn;case"DS":return Ui;case"NAPTR":return Hi;case"TLSA":return ji}return ws},Dr=Ne.answer={};Dr.encode=function(e,t,r){t||(t=ke.alloc(Dr.encodingLength(e))),r||(r=0);let n=r;if(De.encode(e.name,t,r),r+=De.encode.bytes,t.writeUInt16BE(Bs.toType(e.type),r),e.type.toUpperCase()==="OPT"){if(e.name!==".")throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,Rn.encode(e.options||[],t,r),r+=Rn.encode.bytes}else{let i=Zf.toClass(e.class===void 0?"IN":e.class);e.flush&&(i|=c0),t.writeUInt16BE(i,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let a=l0(e.type);a.encode(e.data,t,r),r+=a.encode.bytes}return Dr.encode.bytes=r-n,t};Dr.encode.bytes=0;Dr.decode=function(e,t){t||(t=0);let r={},n=t;if(r.name=De.decode(e,t),t+=De.decode.bytes,r.type=Bs.toString(e.readUInt16BE(t)),r.type==="OPT")r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=(r.flags>>15&1)===1,r.options=Rn.decode(e,t+8),t+=8+Rn.decode.bytes;else{let i=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=Zf.toString(i&gD),r.flush=!!(i&c0);let a=l0(r.type);r.data=a.decode(e,t+8),t+=8+a.decode.bytes}return Dr.decode.bytes=t-n,r};Dr.decode.bytes=0;Dr.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return De.encodingLength(e.name)+8+l0(e.type).encodingLength(t)};var pi=Ne.question={};pi.encode=function(e,t,r){t||(t=ke.alloc(pi.encodingLength(e))),r||(r=0);let n=r;return De.encode(e.name,t,r),r+=De.encode.bytes,t.writeUInt16BE(Bs.toType(e.type),r),r+=2,t.writeUInt16BE(Zf.toClass(e.class===void 0?"IN":e.class),r),r+=2,pi.encode.bytes=r-n,e};pi.encode.bytes=0;pi.decode=function(e,t){t||(t=0);let r=t,n={};return n.name=De.decode(e,t),t+=De.decode.bytes,n.type=Bs.toString(e.readUInt16BE(t)),t+=2,n.class=Zf.toString(e.readUInt16BE(t)),t+=2,!!(n.class&ME)&&(n.class&=mD),pi.decode.bytes=t-r,n};pi.decode.bytes=0;pi.encodingLength=function(e){return De.encodingLength(e.name)+4};Ne.AUTHORITATIVE_ANSWER=1024;Ne.TRUNCATED_RESPONSE=512;Ne.RECURSION_DESIRED=256;Ne.RECURSION_AVAILABLE=128;Ne.AUTHENTIC_DATA=32;Ne.CHECKING_DISABLED=16;Ne.DNSSEC_OK=32768;Ne.encode=function(e,t,r){let n=!t;n&&(t=ke.alloc(Ne.encodingLength(e))),r||(r=0);let i=r;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),di.encode(e,t,r),r+=di.encode.bytes,r=Uc(e.questions,pi,t,r),r=Uc(e.answers,Dr,t,r),r=Uc(e.authorities,Dr,t,r),r=Uc(e.additionals,Dr,t,r),Ne.encode.bytes=r-i,n&&Ne.encode.bytes!==t.length?t.slice(0,Ne.encode.bytes):t};Ne.encode.bytes=0;Ne.decode=function(e,t){t||(t=0);let r=t,n=di.decode(e,t);return t+=di.decode.bytes,t=Jf(n.questions,pi,e,t),t=Jf(n.answers,Dr,e,t),t=Jf(n.authorities,Dr,e,t),t=Jf(n.additionals,Dr,e,t),Ne.decode.bytes=t-r,n};Ne.decode.bytes=0;Ne.encodingLength=function(e){return di.encodingLength(e)+Ao(e.questions||[],pi)+Ao(e.answers||[],Dr)+Ao(e.authorities||[],Dr)+Ao(e.additionals||[],Dr)};Ne.streamEncode=function(e){let t=Ne.encode(e),r=ke.alloc(2);r.writeUInt16BE(t.byteLength);let n=ke.concat([r,t]);return Ne.streamEncode.bytes=n.byteLength,n};Ne.streamEncode.bytes=0;Ne.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=Ne.decode(e.slice(2));return Ne.streamDecode.bytes=Ne.decode.bytes,r};Ne.streamDecode.bytes=0;function Ao(e,t){let r=0;for(let n=0;n<e.length;n++)r+=t.encodingLength(e[n]);return r}function Uc(e,t,r,n){for(let i=0;i<e.length;i++)t.encode(e[i],r,n),n+=t.encode.bytes;return n}function Jf(e,t,r,n){for(let i=0;i<e.length;i++)e[i]=t.decode(r,n),n+=t.decode.bytes;return n}});var f0=we((yo,Hc)=>{(function(){var e,t="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",o=500,l="__lodash_placeholder__",h=1,d=2,E=4,p=1,f=2,w=1,g=2,y=4,A=8,S=16,_=32,I=64,D=128,H=256,V=512,F=30,P="...",k=800,L=16,q=1,J=2,z=3,K=1/0,X=9007199254740991,ie=17976931348623157e292,be=NaN,ye=4294967295,$e=ye-1,qe=ye>>>1,ce=[["ary",D],["bind",w],["bindKey",g],["curry",A],["curryRight",S],["flip",V],["partial",_],["partialRight",I],["rearg",H]],_e="[object Arguments]",Le="[object Array]",lr="[object AsyncFunction]",Bt="[object Boolean]",pt="[object Date]",zt="[object DOMException]",Tt="[object Error]",nt="[object Function]",It="[object GeneratorFunction]",tt="[object Map]",gt="[object Number]",Yt="[object Null]",Je="[object Object]",Ut="[object Promise]",Un="[object Proxy]",fr="[object RegExp]",wr="[object Set]",Zt="[object String]",$r="[object Symbol]",la="[object Undefined]",Mr="[object WeakMap]",mt="[object WeakSet]",Qt="[object ArrayBuffer]",Ze="[object DataView]",Pr="[object Float32Array]",fa="[object Float64Array]",ha="[object Int8Array]",pa="[object Int16Array]",da="[object Int32Array]",Gi="[object Uint8Array]",ga="[object Uint8ClampedArray]",Os="[object Uint16Array]",gi="[object Uint32Array]",zi=/\b__p \+= '';/g,uu=/\b(__p \+=) '' \+/g,ou=/(__e\(.*?\)|\b__t\)) \+\n'';/g,cu=/&(?:amp|lt|gt|quot|#39);/g,lu=/[&<>"']/g,fu=RegExp(cu.source),hu=RegExp(lu.source),pu=/<%-([\s\S]+?)%>/g,Do=/<%([\s\S]+?)%>/g,du=/<%=([\s\S]+?)%>/g,Bo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$o=/^\w*$/,Po=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ns=/[\\^$.*+?()[\]{}|]/g,Ro=RegExp(Ns.source),ma=/^\s+/,To=/\s/,xo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Oo=/\{\n\/\* \[wrapped with (.+)\] \*/,No=/,? & /,ko=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Lo=/[()=,{}\[\]\/\s]/,Uo=/\\(\\)?/g,Ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mi=/\w*$/,gu=/^[-+]0x[0-9a-f]+$/i,jo=/^0b[01]+$/i,Mo=/^\[object .+?Constructor\]$/,qo=/^0o[0-7]+$/i,mu=/^(?:0|[1-9]\d*)$/,vi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,en=/($^)/,Vo=/['\n\r\u2028\u2029\\]/g,ks="\\ud800-\\udfff",En="\\u0300-\\u036f",Ko="\\ufe20-\\ufe2f",Go="\\u20d0-\\u20ff",vu=En+Ko+Go,va="\\u2700-\\u27bf",Eu="a-z\\xdf-\\xf6\\xf8-\\xff",Ls="\\xac\\xb1\\xd7\\xf7",Ht="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zo="\\u2000-\\u206f",Yo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Au="A-Z\\xc0-\\xd6\\xd8-\\xde",Ei="\\ufe0e\\ufe0f",hr=Ls+Ht+zo+Yo,Rt="['\u2019]",Wo="["+ks+"]",Ea="["+hr+"]",pr="["+vu+"]",Aa="\\d+",wu="["+va+"]",yu="["+Eu+"]",wa="[^"+ks+hr+Aa+va+Eu+Au+"]",Ai="\\ud83c[\\udffb-\\udfff]",ya="(?:"+pr+"|"+Ai+")",Su="[^"+ks+"]",Sa="(?:\\ud83c[\\udde6-\\uddff]){2}",ba="[\\ud800-\\udbff][\\udc00-\\udfff]",qr="["+Au+"]",R="\\u200d",x="(?:"+yu+"|"+wa+")",j="(?:"+qr+"|"+wa+")",Q="(?:"+Rt+"(?:d|ll|m|re|s|t|ve))?",de="(?:"+Rt+"(?:D|LL|M|RE|S|T|VE))?",ve=ya+"?",Fe="["+Ei+"]?",Pe="(?:"+R+"(?:"+[Su,Sa,ba].join("|")+")"+Fe+ve+")*",St="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yr=Fe+ve+Pe,Sr="(?:"+[wu,Sa,ba].join("|")+")"+yr,An="(?:"+[Su+pr+"?",pr,Sa,ba,Wo].join("|")+")",Us=RegExp(Rt,"g"),Vr=RegExp(pr,"g"),br=RegExp(Ai+"(?="+Ai+")|"+An+yr,"g"),Hs=RegExp([qr+"?"+yu+"+"+Q+"(?="+[Ea,qr,"$"].join("|")+")",j+"+"+de+"(?="+[Ea,qr+x,"$"].join("|")+")",qr+"?"+x+"+"+Q,qr+"+"+de,jt,St,Aa,Sr].join("|"),"g"),Hn=RegExp("["+R+ks+vu+Ei+"]"),Ca=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Eh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ah=-1,Dt={};Dt[Pr]=Dt[fa]=Dt[ha]=Dt[pa]=Dt[da]=Dt[Gi]=Dt[ga]=Dt[Os]=Dt[gi]=!0,Dt[_e]=Dt[Le]=Dt[Qt]=Dt[Bt]=Dt[Ze]=Dt[pt]=Dt[Tt]=Dt[nt]=Dt[tt]=Dt[gt]=Dt[Je]=Dt[fr]=Dt[wr]=Dt[Zt]=Dt[Mr]=!1;var Ft={};Ft[_e]=Ft[Le]=Ft[Qt]=Ft[Ze]=Ft[Bt]=Ft[pt]=Ft[Pr]=Ft[fa]=Ft[ha]=Ft[pa]=Ft[da]=Ft[tt]=Ft[gt]=Ft[Je]=Ft[fr]=Ft[wr]=Ft[Zt]=Ft[$r]=Ft[Gi]=Ft[ga]=Ft[Os]=Ft[gi]=!0,Ft[Tt]=Ft[nt]=Ft[Mr]=!1;var wh={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},yh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sh={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},bh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ch=parseFloat,Fh=parseInt,Qc=typeof global=="object"&&global&&global.Object===Object&&global,_h=typeof self=="object"&&self&&self.Object===Object&&self,er=Qc||_h||Function("return this")(),Xo=typeof yo=="object"&&yo&&!yo.nodeType&&yo,Yi=Xo&&typeof Hc=="object"&&Hc&&!Hc.nodeType&&Hc,el=Yi&&Yi.exports===Xo,Jo=el&&Qc.process,tn=function(){try{var re=Yi&&Yi.require&&Yi.require("util").types;return re||Jo&&Jo.binding&&Jo.binding("util")}catch{}}(),tl=tn&&tn.isArrayBuffer,rl=tn&&tn.isDate,nl=tn&&tn.isMap,il=tn&&tn.isRegExp,sl=tn&&tn.isSet,al=tn&&tn.isTypedArray;function Kr(re,le,ue){switch(ue.length){case 0:return re.call(le);case 1:return re.call(le,ue[0]);case 2:return re.call(le,ue[0],ue[1]);case 3:return re.call(le,ue[0],ue[1],ue[2])}return re.apply(le,ue)}function Ih(re,le,ue,Re){for(var Ge=-1,ct=re==null?0:re.length;++Ge<ct;){var Ot=re[Ge];le(Re,Ot,ue(Ot),re)}return Re}function rn(re,le){for(var ue=-1,Re=re==null?0:re.length;++ue<Re&&le(re[ue],ue,re)!==!1;);return re}function B(re,le){for(var ue=re==null?0:re.length;ue--&&le(re[ue],ue,re)!==!1;);return re}function Ye(re,le){for(var ue=-1,Re=re==null?0:re.length;++ue<Re;)if(!le(re[ue],ue,re))return!1;return!0}function wn(re,le){for(var ue=-1,Re=re==null?0:re.length,Ge=0,ct=[];++ue<Re;){var Ot=re[ue];le(Ot,ue,re)&&(ct[Ge++]=Ot)}return ct}function Gr(re,le){var ue=re==null?0:re.length;return!!ue&&js(re,le,0)>-1}function Fa(re,le,ue){for(var Re=-1,Ge=re==null?0:re.length;++Re<Ge;)if(ue(le,re[Re]))return!0;return!1}function te(re,le){for(var ue=-1,Re=re==null?0:re.length,Ge=Array(Re);++ue<Re;)Ge[ue]=le(re[ue],ue,re);return Ge}function yn(re,le){for(var ue=-1,Re=le.length,Ge=re.length;++ue<Re;)re[Ge+ue]=le[ue];return re}function Zo(re,le,ue,Re){var Ge=-1,ct=re==null?0:re.length;for(Re&&ct&&(ue=re[++Ge]);++Ge<ct;)ue=le(ue,re[Ge],Ge,re);return ue}function J0(re,le,ue,Re){var Ge=re==null?0:re.length;for(Re&&Ge&&(ue=re[--Ge]);Ge--;)ue=le(ue,re[Ge],Ge,re);return ue}function ul(re,le){for(var ue=-1,Re=re==null?0:re.length;++ue<Re;)if(le(re[ue],ue,re))return!0;return!1}var xt=Wi("length");function Z0(re){return re.split("")}function Qo(re){return re.match(ko)||[]}function Ue(re,le,ue){var Re;return ue(re,function(Ge,ct,Ot){if(le(Ge,ct,Ot))return Re=ct,!1}),Re}function tr(re,le,ue,Re){for(var Ge=re.length,ct=ue+(Re?1:-1);Re?ct--:++ct<Ge;)if(le(re[ct],ct,re))return ct;return-1}function js(re,le,ue){return le===le?pl(re,le,ue):tr(re,jn,ue)}function Dh(re,le,ue,Re){for(var Ge=ue-1,ct=re.length;++Ge<ct;)if(Re(re[Ge],le))return Ge;return-1}function jn(re){return re!==re}function ec(re,le){var ue=re==null?0:re.length;return ue?bu(re,le)/ue:be}function Wi(re){return function(le){return le==null?e:le[re]}}function pe(re){return function(le){return re==null?e:re[le]}}function ol(re,le,ue,Re,Ge){return Ge(re,function(ct,Ot,bt){ue=Re?(Re=!1,ct):le(ue,ct,Ot,bt)}),ue}function cl(re,le){var ue=re.length;for(re.sort(le);ue--;)re[ue]=re[ue].value;return re}function bu(re,le){for(var ue,Re=-1,Ge=re.length;++Re<Ge;){var ct=le(re[Re]);ct!==e&&(ue=ue===e?ct:ue+ct)}return ue}function tc(re,le){for(var ue=-1,Re=Array(re);++ue<re;)Re[ue]=le(ue);return Re}function Bh(re,le){return te(le,function(ue){return[ue,re[ue]]})}function rc(re){return re&&re.slice(0,_u(re)+1).replace(ma,"")}function Rr(re){return function(le){return re(le)}}function _a(re,le){return te(le,function(ue){return re[ue]})}function Ia(re,le){return re.has(le)}function Cu(re,le){for(var ue=-1,Re=re.length;++ue<Re&&js(le,re[ue],0)>-1;);return ue}function ll(re,le){for(var ue=re.length;ue--&&js(le,re[ue],0)>-1;);return ue}function fl(re,le){for(var ue=re.length,Re=0;ue--;)re[ue]===le&&++Re;return Re}var nc=pe(wh),$h=pe(yh);function hl(re){return"\\"+bh[re]}function Ph(re,le){return re==null?e:re[le]}function Xi(re){return Hn.test(re)}function Rh(re){return Ca.test(re)}function Th(re){for(var le,ue=[];!(le=re.next()).done;)ue.push(le.value);return ue}function ic(re){var le=-1,ue=Array(re.size);return re.forEach(function(Re,Ge){ue[++le]=[Ge,Re]}),ue}function Cr(re,le){return function(ue){return re(le(ue))}}function Sn(re,le){for(var ue=-1,Re=re.length,Ge=0,ct=[];++ue<Re;){var Ot=re[ue];(Ot===le||Ot===l)&&(re[ue]=l,ct[Ge++]=ue)}return ct}function bn(re){var le=-1,ue=Array(re.size);return re.forEach(function(Re){ue[++le]=Re}),ue}function Fu(re){var le=-1,ue=Array(re.size);return re.forEach(function(Re){ue[++le]=[Re,Re]}),ue}function pl(re,le,ue){for(var Re=ue-1,Ge=re.length;++Re<Ge;)if(re[Re]===le)return Re;return-1}function xh(re,le,ue){for(var Re=ue+1;Re--;)if(re[Re]===le)return Re;return Re}function Ji(re){return Xi(re)?gl(re):xt(re)}function nn(re){return Xi(re)?Oh(re):Z0(re)}function _u(re){for(var le=re.length;le--&&To.test(re.charAt(le)););return le}var dl=pe(Sh);function gl(re){for(var le=br.lastIndex=0;br.test(re);)++le;return le}function Oh(re){return re.match(br)||[]}function Nh(re){return re.match(Hs)||[]}var kh=function re(le){le=le==null?er:Mn.defaults(er.Object(),le,Mn.pick(er,Eh));var ue=le.Array,Re=le.Date,Ge=le.Error,ct=le.Function,Ot=le.Math,bt=le.Object,Iu=le.RegExp,Lh=le.String,sn=le.TypeError,Du=ue.prototype,ml=ct.prototype,Zi=bt.prototype,ni=le["__core-js_shared__"],Bu=ml.toString,ht=Zi.hasOwnProperty,Uh=0,$u=function(){var u=/[^.]+$/.exec(ni&&ni.keys&&ni.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Pu=Zi.toString,Hh=Bu.call(bt),jh=er._,Mh=Iu("^"+Bu.call(ht).replace(Ns,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ru=el?le.Buffer:e,wi=le.Symbol,Tu=le.Uint8Array,vl=Ru?Ru.allocUnsafe:e,xu=Cr(bt.getPrototypeOf,bt),El=bt.create,Al=Zi.propertyIsEnumerable,vt=Du.splice,wl=wi?wi.isConcatSpreadable:e,Qi=wi?wi.iterator:e,es=wi?wi.toStringTag:e,Ou=function(){try{var u=Ra(bt,"defineProperty");return u({},"",{}),u}catch{}}(),b=le.clearTimeout!==er.clearTimeout&&le.clearTimeout,O=Re&&Re.now!==er.Date.now&&Re.now,W=le.setTimeout!==er.setTimeout&&le.setTimeout,M=Ot.ceil,se=Ot.floor,oe=bt.getOwnPropertySymbols,Ct=Ru?Ru.isBuffer:e,Mt=le.isFinite,Fw=Du.join,_w=Cr(bt.keys,bt),ir=Ot.max,Tr=Ot.min,Iw=Re.now,Dw=le.parseInt,Q0=Ot.random,Bw=Du.reverse,qh=Ra(le,"DataView"),sc=Ra(le,"Map"),Vh=Ra(le,"Promise"),Nu=Ra(le,"Set"),ac=Ra(le,"WeakMap"),uc=Ra(bt,"create"),yl=ac&&new ac,ku={},$w=Ta(qh),Pw=Ta(sc),Rw=Ta(Vh),Tw=Ta(Nu),xw=Ta(ac),Sl=wi?wi.prototype:e,oc=Sl?Sl.valueOf:e,e1=Sl?Sl.toString:e;function N(u){if(qt(u)&&!We(u)&&!(u instanceof ot)){if(u instanceof qn)return u;if(ht.call(u,"__wrapped__"))return tg(u)}return new qn(u)}var Lu=function(){function u(){}return function(c){if(!Nt(c))return{};if(El)return El(c);u.prototype=c;var v=new u;return u.prototype=e,v}}();function bl(){}function qn(u,c){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}N.templateSettings={escape:pu,evaluate:Do,interpolate:du,variable:"",imports:{_:N}},N.prototype=bl.prototype,N.prototype.constructor=N,qn.prototype=Lu(bl.prototype),qn.prototype.constructor=qn;function ot(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function Ow(){var u=new ot(this.__wrapped__);return u.__actions__=an(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=an(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=an(this.__views__),u}function Nw(){if(this.__filtered__){var u=new ot(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function kw(){var u=this.__wrapped__.value(),c=this.__dir__,v=We(u),C=c<0,T=v?u.length:0,U=Wy(0,T,this.__views__),Y=U.start,Z=U.end,ne=Z-Y,ge=C?Z:Y-1,me=this.__iteratees__,Ee=me.length,Ie=0,Oe=Tr(ne,this.__takeCount__);if(!v||!C&&T==ne&&Oe==ne)return C1(u,this.__actions__);var Ve=[];e:for(;ne--&&Ie<Oe;){ge+=c;for(var rt=-1,Ke=u[ge];++rt<Ee;){var ut=me[rt],lt=ut.iteratee,_n=ut.type,Wr=lt(Ke);if(_n==J)Ke=Wr;else if(!Wr){if(_n==q)continue e;break e}}Ve[Ie++]=Ke}return Ve}ot.prototype=Lu(bl.prototype),ot.prototype.constructor=ot;function Da(u){var c=-1,v=u==null?0:u.length;for(this.clear();++c<v;){var C=u[c];this.set(C[0],C[1])}}function Lw(){this.__data__=uc?uc(null):{},this.size=0}function Uw(u){var c=this.has(u)&&delete this.__data__[u];return this.size-=c?1:0,c}function Hw(u){var c=this.__data__;if(uc){var v=c[u];return v===s?e:v}return ht.call(c,u)?c[u]:e}function jw(u){var c=this.__data__;return uc?c[u]!==e:ht.call(c,u)}function Mw(u,c){var v=this.__data__;return this.size+=this.has(u)?0:1,v[u]=uc&&c===e?s:c,this}Da.prototype.clear=Lw,Da.prototype.delete=Uw,Da.prototype.get=Hw,Da.prototype.has=jw,Da.prototype.set=Mw;function ts(u){var c=-1,v=u==null?0:u.length;for(this.clear();++c<v;){var C=u[c];this.set(C[0],C[1])}}function qw(){this.__data__=[],this.size=0}function Vw(u){var c=this.__data__,v=Cl(c,u);if(v<0)return!1;var C=c.length-1;return v==C?c.pop():vt.call(c,v,1),--this.size,!0}function Kw(u){var c=this.__data__,v=Cl(c,u);return v<0?e:c[v][1]}function Gw(u){return Cl(this.__data__,u)>-1}function zw(u,c){var v=this.__data__,C=Cl(v,u);return C<0?(++this.size,v.push([u,c])):v[C][1]=c,this}ts.prototype.clear=qw,ts.prototype.delete=Vw,ts.prototype.get=Kw,ts.prototype.has=Gw,ts.prototype.set=zw;function rs(u){var c=-1,v=u==null?0:u.length;for(this.clear();++c<v;){var C=u[c];this.set(C[0],C[1])}}function Yw(){this.size=0,this.__data__={hash:new Da,map:new(sc||ts),string:new Da}}function Ww(u){var c=Nl(this,u).delete(u);return this.size-=c?1:0,c}function Xw(u){return Nl(this,u).get(u)}function Jw(u){return Nl(this,u).has(u)}function Zw(u,c){var v=Nl(this,u),C=v.size;return v.set(u,c),this.size+=v.size==C?0:1,this}rs.prototype.clear=Yw,rs.prototype.delete=Ww,rs.prototype.get=Xw,rs.prototype.has=Jw,rs.prototype.set=Zw;function Ba(u){var c=-1,v=u==null?0:u.length;for(this.__data__=new rs;++c<v;)this.add(u[c])}function Qw(u){return this.__data__.set(u,s),this}function ey(u){return this.__data__.has(u)}Ba.prototype.add=Ba.prototype.push=Qw,Ba.prototype.has=ey;function ii(u){var c=this.__data__=new ts(u);this.size=c.size}function ty(){this.__data__=new ts,this.size=0}function ry(u){var c=this.__data__,v=c.delete(u);return this.size=c.size,v}function ny(u){return this.__data__.get(u)}function iy(u){return this.__data__.has(u)}function sy(u,c){var v=this.__data__;if(v instanceof ts){var C=v.__data__;if(!sc||C.length<r-1)return C.push([u,c]),this.size=++v.size,this;v=this.__data__=new rs(C)}return v.set(u,c),this.size=v.size,this}ii.prototype.clear=ty,ii.prototype.delete=ry,ii.prototype.get=ny,ii.prototype.has=iy,ii.prototype.set=sy;function t1(u,c){var v=We(u),C=!v&&xa(u),T=!v&&!C&&Gs(u),U=!v&&!C&&!T&&Mu(u),Y=v||C||T||U,Z=Y?tc(u.length,Lh):[],ne=Z.length;for(var ge in u)(c||ht.call(u,ge))&&!(Y&&(ge=="length"||T&&(ge=="offset"||ge=="parent")||U&&(ge=="buffer"||ge=="byteLength"||ge=="byteOffset")||as(ge,ne)))&&Z.push(ge);return Z}function r1(u){var c=u.length;return c?u[tp(0,c-1)]:e}function ay(u,c){return kl(an(u),$a(c,0,u.length))}function uy(u){return kl(an(u))}function Kh(u,c,v){(v!==e&&!si(u[c],v)||v===e&&!(c in u))&&ns(u,c,v)}function cc(u,c,v){var C=u[c];(!(ht.call(u,c)&&si(C,v))||v===e&&!(c in u))&&ns(u,c,v)}function Cl(u,c){for(var v=u.length;v--;)if(si(u[v][0],c))return v;return-1}function oy(u,c,v,C){return Ms(u,function(T,U,Y){c(C,T,v(T),Y)}),C}function n1(u,c){return u&&Si(c,dr(c),u)}function cy(u,c){return u&&Si(c,on(c),u)}function ns(u,c,v){c=="__proto__"&&Ou?Ou(u,c,{configurable:!0,enumerable:!0,value:v,writable:!0}):u[c]=v}function Gh(u,c){for(var v=-1,C=c.length,T=ue(C),U=u==null;++v<C;)T[v]=U?e:_p(u,c[v]);return T}function $a(u,c,v){return u===u&&(v!==e&&(u=u<=v?u:v),c!==e&&(u=u>=c?u:c)),u}function Vn(u,c,v,C,T,U){var Y,Z=c&h,ne=c&d,ge=c&E;if(v&&(Y=T?v(u,C,T,U):v(u)),Y!==e)return Y;if(!Nt(u))return u;var me=We(u);if(me){if(Y=Jy(u),!Z)return an(u,Y)}else{var Ee=xr(u),Ie=Ee==nt||Ee==It;if(Gs(u))return I1(u,Z);if(Ee==Je||Ee==_e||Ie&&!T){if(Y=ne||Ie?{}:G1(u),!Z)return ne?Hy(u,cy(Y,u)):Uy(u,n1(Y,u))}else{if(!Ft[Ee])return T?u:{};Y=Zy(u,Ee,Z)}}U||(U=new ii);var Oe=U.get(u);if(Oe)return Oe;U.set(u,Y),yg(u)?u.forEach(function(Ke){Y.add(Vn(Ke,c,v,Ke,u,U))}):Ag(u)&&u.forEach(function(Ke,ut){Y.set(ut,Vn(Ke,c,v,ut,u,U))});var Ve=ge?ne?hp:fp:ne?on:dr,rt=me?e:Ve(u);return rn(rt||u,function(Ke,ut){rt&&(ut=Ke,Ke=u[ut]),cc(Y,ut,Vn(Ke,c,v,ut,u,U))}),Y}function ly(u){var c=dr(u);return function(v){return i1(v,u,c)}}function i1(u,c,v){var C=v.length;if(u==null)return!C;for(u=bt(u);C--;){var T=v[C],U=c[T],Y=u[T];if(Y===e&&!(T in u)||!U(Y))return!1}return!0}function s1(u,c,v){if(typeof u!="function")throw new sn(i);return mc(function(){u.apply(e,v)},c)}function lc(u,c,v,C){var T=-1,U=Gr,Y=!0,Z=u.length,ne=[],ge=c.length;if(!Z)return ne;v&&(c=te(c,Rr(v))),C?(U=Fa,Y=!1):c.length>=r&&(U=Ia,Y=!1,c=new Ba(c));e:for(;++T<Z;){var me=u[T],Ee=v==null?me:v(me);if(me=C||me!==0?me:0,Y&&Ee===Ee){for(var Ie=ge;Ie--;)if(c[Ie]===Ee)continue e;ne.push(me)}else U(c,Ee,C)||ne.push(me)}return ne}var Ms=R1(yi),a1=R1(Yh,!0);function fy(u,c){var v=!0;return Ms(u,function(C,T,U){return v=!!c(C,T,U),v}),v}function Fl(u,c,v){for(var C=-1,T=u.length;++C<T;){var U=u[C],Y=c(U);if(Y!=null&&(Z===e?Y===Y&&!Fn(Y):v(Y,Z)))var Z=Y,ne=U}return ne}function hy(u,c,v,C){var T=u.length;for(v=et(v),v<0&&(v=-v>T?0:T+v),C=C===e||C>T?T:et(C),C<0&&(C+=T),C=v>C?0:bg(C);v<C;)u[v++]=c;return u}function u1(u,c){var v=[];return Ms(u,function(C,T,U){c(C,T,U)&&v.push(C)}),v}function Fr(u,c,v,C,T){var U=-1,Y=u.length;for(v||(v=e4),T||(T=[]);++U<Y;){var Z=u[U];c>0&&v(Z)?c>1?Fr(Z,c-1,v,C,T):yn(T,Z):C||(T[T.length]=Z)}return T}var zh=T1(),o1=T1(!0);function yi(u,c){return u&&zh(u,c,dr)}function Yh(u,c){return u&&o1(u,c,dr)}function _l(u,c){return wn(c,function(v){return us(u[v])})}function Pa(u,c){c=Vs(c,u);for(var v=0,C=c.length;u!=null&&v<C;)u=u[bi(c[v++])];return v&&v==C?u:e}function c1(u,c,v){var C=c(u);return We(u)?C:yn(C,v(u))}function zr(u){return u==null?u===e?la:Yt:es&&es in bt(u)?Yy(u):u4(u)}function Wh(u,c){return u>c}function py(u,c){return u!=null&&ht.call(u,c)}function dy(u,c){return u!=null&&c in bt(u)}function gy(u,c,v){return u>=Tr(c,v)&&u<ir(c,v)}function Xh(u,c,v){for(var C=v?Fa:Gr,T=u[0].length,U=u.length,Y=U,Z=ue(U),ne=1/0,ge=[];Y--;){var me=u[Y];Y&&c&&(me=te(me,Rr(c))),ne=Tr(me.length,ne),Z[Y]=!v&&(c||T>=120&&me.length>=120)?new Ba(Y&&me):e}me=u[0];var Ee=-1,Ie=Z[0];e:for(;++Ee<T&&ge.length<ne;){var Oe=me[Ee],Ve=c?c(Oe):Oe;if(Oe=v||Oe!==0?Oe:0,!(Ie?Ia(Ie,Ve):C(ge,Ve,v))){for(Y=U;--Y;){var rt=Z[Y];if(!(rt?Ia(rt,Ve):C(u[Y],Ve,v)))continue e}Ie&&Ie.push(Ve),ge.push(Oe)}}return ge}function my(u,c,v,C){return yi(u,function(T,U,Y){c(C,v(T),U,Y)}),C}function fc(u,c,v){c=Vs(c,u),u=X1(u,c);var C=u==null?u:u[bi(Gn(c))];return C==null?e:Kr(C,u,v)}function l1(u){return qt(u)&&zr(u)==_e}function vy(u){return qt(u)&&zr(u)==Qt}function Ey(u){return qt(u)&&zr(u)==pt}function hc(u,c,v,C,T){return u===c?!0:u==null||c==null||!qt(u)&&!qt(c)?u!==u&&c!==c:Ay(u,c,v,C,hc,T)}function Ay(u,c,v,C,T,U){var Y=We(u),Z=We(c),ne=Y?Le:xr(u),ge=Z?Le:xr(c);ne=ne==_e?Je:ne,ge=ge==_e?Je:ge;var me=ne==Je,Ee=ge==Je,Ie=ne==ge;if(Ie&&Gs(u)){if(!Gs(c))return!1;Y=!0,me=!1}if(Ie&&!me)return U||(U=new ii),Y||Mu(u)?q1(u,c,v,C,T,U):Gy(u,c,ne,v,C,T,U);if(!(v&p)){var Oe=me&&ht.call(u,"__wrapped__"),Ve=Ee&&ht.call(c,"__wrapped__");if(Oe||Ve){var rt=Oe?u.value():u,Ke=Ve?c.value():c;return U||(U=new ii),T(rt,Ke,v,C,U)}}return Ie?(U||(U=new ii),zy(u,c,v,C,T,U)):!1}function wy(u){return qt(u)&&xr(u)==tt}function Jh(u,c,v,C){var T=v.length,U=T,Y=!C;if(u==null)return!U;for(u=bt(u);T--;){var Z=v[T];if(Y&&Z[2]?Z[1]!==u[Z[0]]:!(Z[0]in u))return!1}for(;++T<U;){Z=v[T];var ne=Z[0],ge=u[ne],me=Z[1];if(Y&&Z[2]){if(ge===e&&!(ne in u))return!1}else{var Ee=new ii;if(C)var Ie=C(ge,me,ne,u,c,Ee);if(!(Ie===e?hc(me,ge,p|f,C,Ee):Ie))return!1}}return!0}function f1(u){if(!Nt(u)||r4(u))return!1;var c=us(u)?Mh:Mo;return c.test(Ta(u))}function yy(u){return qt(u)&&zr(u)==fr}function Sy(u){return qt(u)&&xr(u)==wr}function by(u){return qt(u)&&ql(u.length)&&!!Dt[zr(u)]}function h1(u){return typeof u=="function"?u:u==null?cn:typeof u=="object"?We(u)?g1(u[0],u[1]):d1(u):xg(u)}function Zh(u){if(!gc(u))return _w(u);var c=[];for(var v in bt(u))ht.call(u,v)&&v!="constructor"&&c.push(v);return c}function Cy(u){if(!Nt(u))return a4(u);var c=gc(u),v=[];for(var C in u)C=="constructor"&&(c||!ht.call(u,C))||v.push(C);return v}function Qh(u,c){return u<c}function p1(u,c){var v=-1,C=un(u)?ue(u.length):[];return Ms(u,function(T,U,Y){C[++v]=c(T,U,Y)}),C}function d1(u){var c=dp(u);return c.length==1&&c[0][2]?Y1(c[0][0],c[0][1]):function(v){return v===u||Jh(v,u,c)}}function g1(u,c){return mp(u)&&z1(c)?Y1(bi(u),c):function(v){var C=_p(v,u);return C===e&&C===c?Ip(v,u):hc(c,C,p|f)}}function Il(u,c,v,C,T){u!==c&&zh(c,function(U,Y){if(T||(T=new ii),Nt(U))Fy(u,c,Y,v,Il,C,T);else{var Z=C?C(Ep(u,Y),U,Y+"",u,c,T):e;Z===e&&(Z=U),Kh(u,Y,Z)}},on)}function Fy(u,c,v,C,T,U,Y){var Z=Ep(u,v),ne=Ep(c,v),ge=Y.get(ne);if(ge){Kh(u,v,ge);return}var me=U?U(Z,ne,v+"",u,c,Y):e,Ee=me===e;if(Ee){var Ie=We(ne),Oe=!Ie&&Gs(ne),Ve=!Ie&&!Oe&&Mu(ne);me=ne,Ie||Oe||Ve?We(Z)?me=Z:Wt(Z)?me=an(Z):Oe?(Ee=!1,me=I1(ne,!0)):Ve?(Ee=!1,me=D1(ne,!0)):me=[]:vc(ne)||xa(ne)?(me=Z,xa(Z)?me=Cg(Z):(!Nt(Z)||us(Z))&&(me=G1(ne))):Ee=!1}Ee&&(Y.set(ne,me),T(me,ne,C,U,Y),Y.delete(ne)),Kh(u,v,me)}function m1(u,c){var v=u.length;if(v)return c+=c<0?v:0,as(c,v)?u[c]:e}function v1(u,c,v){c.length?c=te(c,function(U){return We(U)?function(Y){return Pa(Y,U.length===1?U[0]:U)}:U}):c=[cn];var C=-1;c=te(c,Rr(je()));var T=p1(u,function(U,Y,Z){var ne=te(c,function(ge){return ge(U)});return{criteria:ne,index:++C,value:U}});return cl(T,function(U,Y){return Ly(U,Y,v)})}function _y(u,c){return E1(u,c,function(v,C){return Ip(u,C)})}function E1(u,c,v){for(var C=-1,T=c.length,U={};++C<T;){var Y=c[C],Z=Pa(u,Y);v(Z,Y)&&pc(U,Vs(Y,u),Z)}return U}function Iy(u){return function(c){return Pa(c,u)}}function ep(u,c,v,C){var T=C?Dh:js,U=-1,Y=c.length,Z=u;for(u===c&&(c=an(c)),v&&(Z=te(u,Rr(v)));++U<Y;)for(var ne=0,ge=c[U],me=v?v(ge):ge;(ne=T(Z,me,ne,C))>-1;)Z!==u&&vt.call(Z,ne,1),vt.call(u,ne,1);return u}function A1(u,c){for(var v=u?c.length:0,C=v-1;v--;){var T=c[v];if(v==C||T!==U){var U=T;as(T)?vt.call(u,T,1):ip(u,T)}}return u}function tp(u,c){return u+se(Q0()*(c-u+1))}function Dy(u,c,v,C){for(var T=-1,U=ir(M((c-u)/(v||1)),0),Y=ue(U);U--;)Y[C?U:++T]=u,u+=v;return Y}function rp(u,c){var v="";if(!u||c<1||c>X)return v;do c%2&&(v+=u),c=se(c/2),c&&(u+=u);while(c);return v}function it(u,c){return Ap(W1(u,c,cn),u+"")}function By(u){return r1(qu(u))}function $y(u,c){var v=qu(u);return kl(v,$a(c,0,v.length))}function pc(u,c,v,C){if(!Nt(u))return u;c=Vs(c,u);for(var T=-1,U=c.length,Y=U-1,Z=u;Z!=null&&++T<U;){var ne=bi(c[T]),ge=v;if(ne==="__proto__"||ne==="constructor"||ne==="prototype")return u;if(T!=Y){var me=Z[ne];ge=C?C(me,ne,Z):e,ge===e&&(ge=Nt(me)?me:as(c[T+1])?[]:{})}cc(Z,ne,ge),Z=Z[ne]}return u}var w1=yl?function(u,c){return yl.set(u,c),u}:cn,Py=Ou?function(u,c){return Ou(u,"toString",{configurable:!0,enumerable:!1,value:Bp(c),writable:!0})}:cn;function Ry(u){return kl(qu(u))}function Kn(u,c,v){var C=-1,T=u.length;c<0&&(c=-c>T?0:T+c),v=v>T?T:v,v<0&&(v+=T),T=c>v?0:v-c>>>0,c>>>=0;for(var U=ue(T);++C<T;)U[C]=u[C+c];return U}function Ty(u,c){var v;return Ms(u,function(C,T,U){return v=c(C,T,U),!v}),!!v}function Dl(u,c,v){var C=0,T=u==null?C:u.length;if(typeof c=="number"&&c===c&&T<=qe){for(;C<T;){var U=C+T>>>1,Y=u[U];Y!==null&&!Fn(Y)&&(v?Y<=c:Y<c)?C=U+1:T=U}return T}return np(u,c,cn,v)}function np(u,c,v,C){var T=0,U=u==null?0:u.length;if(U===0)return 0;c=v(c);for(var Y=c!==c,Z=c===null,ne=Fn(c),ge=c===e;T<U;){var me=se((T+U)/2),Ee=v(u[me]),Ie=Ee!==e,Oe=Ee===null,Ve=Ee===Ee,rt=Fn(Ee);if(Y)var Ke=C||Ve;else ge?Ke=Ve&&(C||Ie):Z?Ke=Ve&&Ie&&(C||!Oe):ne?Ke=Ve&&Ie&&!Oe&&(C||!rt):Oe||rt?Ke=!1:Ke=C?Ee<=c:Ee<c;Ke?T=me+1:U=me}return Tr(U,$e)}function y1(u,c){for(var v=-1,C=u.length,T=0,U=[];++v<C;){var Y=u[v],Z=c?c(Y):Y;if(!v||!si(Z,ne)){var ne=Z;U[T++]=Y===0?0:Y}}return U}function S1(u){return typeof u=="number"?u:Fn(u)?be:+u}function Cn(u){if(typeof u=="string")return u;if(We(u))return te(u,Cn)+"";if(Fn(u))return e1?e1.call(u):"";var c=u+"";return c=="0"&&1/u==-K?"-0":c}function qs(u,c,v){var C=-1,T=Gr,U=u.length,Y=!0,Z=[],ne=Z;if(v)Y=!1,T=Fa;else if(U>=r){var ge=c?null:Vy(u);if(ge)return bn(ge);Y=!1,T=Ia,ne=new Ba}else ne=c?[]:Z;e:for(;++C<U;){var me=u[C],Ee=c?c(me):me;if(me=v||me!==0?me:0,Y&&Ee===Ee){for(var Ie=ne.length;Ie--;)if(ne[Ie]===Ee)continue e;c&&ne.push(Ee),Z.push(me)}else T(ne,Ee,v)||(ne!==Z&&ne.push(Ee),Z.push(me))}return Z}function ip(u,c){return c=Vs(c,u),u=X1(u,c),u==null||delete u[bi(Gn(c))]}function b1(u,c,v,C){return pc(u,c,v(Pa(u,c)),C)}function Bl(u,c,v,C){for(var T=u.length,U=C?T:-1;(C?U--:++U<T)&&c(u[U],U,u););return v?Kn(u,C?0:U,C?U+1:T):Kn(u,C?U+1:0,C?T:U)}function C1(u,c){var v=u;return v instanceof ot&&(v=v.value()),Zo(c,function(C,T){return T.func.apply(T.thisArg,yn([C],T.args))},v)}function sp(u,c,v){var C=u.length;if(C<2)return C?qs(u[0]):[];for(var T=-1,U=ue(C);++T<C;)for(var Y=u[T],Z=-1;++Z<C;)Z!=T&&(U[T]=lc(U[T]||Y,u[Z],c,v));return qs(Fr(U,1),c,v)}function F1(u,c,v){for(var C=-1,T=u.length,U=c.length,Y={};++C<T;){var Z=C<U?c[C]:e;v(Y,u[C],Z)}return Y}function ap(u){return Wt(u)?u:[]}function up(u){return typeof u=="function"?u:cn}function Vs(u,c){return We(u)?u:mp(u,c)?[u]:eg(wt(u))}var xy=it;function Ks(u,c,v){var C=u.length;return v=v===e?C:v,!c&&v>=C?u:Kn(u,c,v)}var _1=b||function(u){return er.clearTimeout(u)};function I1(u,c){if(c)return u.slice();var v=u.length,C=vl?vl(v):new u.constructor(v);return u.copy(C),C}function op(u){var c=new u.constructor(u.byteLength);return new Tu(c).set(new Tu(u)),c}function Oy(u,c){var v=c?op(u.buffer):u.buffer;return new u.constructor(v,u.byteOffset,u.byteLength)}function Ny(u){var c=new u.constructor(u.source,mi.exec(u));return c.lastIndex=u.lastIndex,c}function ky(u){return oc?bt(oc.call(u)):{}}function D1(u,c){var v=c?op(u.buffer):u.buffer;return new u.constructor(v,u.byteOffset,u.length)}function B1(u,c){if(u!==c){var v=u!==e,C=u===null,T=u===u,U=Fn(u),Y=c!==e,Z=c===null,ne=c===c,ge=Fn(c);if(!Z&&!ge&&!U&&u>c||U&&Y&&ne&&!Z&&!ge||C&&Y&&ne||!v&&ne||!T)return 1;if(!C&&!U&&!ge&&u<c||ge&&v&&T&&!C&&!U||Z&&v&&T||!Y&&T||!ne)return-1}return 0}function Ly(u,c,v){for(var C=-1,T=u.criteria,U=c.criteria,Y=T.length,Z=v.length;++C<Y;){var ne=B1(T[C],U[C]);if(ne){if(C>=Z)return ne;var ge=v[C];return ne*(ge=="desc"?-1:1)}}return u.index-c.index}function $1(u,c,v,C){for(var T=-1,U=u.length,Y=v.length,Z=-1,ne=c.length,ge=ir(U-Y,0),me=ue(ne+ge),Ee=!C;++Z<ne;)me[Z]=c[Z];for(;++T<Y;)(Ee||T<U)&&(me[v[T]]=u[T]);for(;ge--;)me[Z++]=u[T++];return me}function P1(u,c,v,C){for(var T=-1,U=u.length,Y=-1,Z=v.length,ne=-1,ge=c.length,me=ir(U-Z,0),Ee=ue(me+ge),Ie=!C;++T<me;)Ee[T]=u[T];for(var Oe=T;++ne<ge;)Ee[Oe+ne]=c[ne];for(;++Y<Z;)(Ie||T<U)&&(Ee[Oe+v[Y]]=u[T++]);return Ee}function an(u,c){var v=-1,C=u.length;for(c||(c=ue(C));++v<C;)c[v]=u[v];return c}function Si(u,c,v,C){var T=!v;v||(v={});for(var U=-1,Y=c.length;++U<Y;){var Z=c[U],ne=C?C(v[Z],u[Z],Z,v,u):e;ne===e&&(ne=u[Z]),T?ns(v,Z,ne):cc(v,Z,ne)}return v}function Uy(u,c){return Si(u,gp(u),c)}function Hy(u,c){return Si(u,V1(u),c)}function $l(u,c){return function(v,C){var T=We(v)?Ih:oy,U=c?c():{};return T(v,u,je(C,2),U)}}function Uu(u){return it(function(c,v){var C=-1,T=v.length,U=T>1?v[T-1]:e,Y=T>2?v[2]:e;for(U=u.length>3&&typeof U=="function"?(T--,U):e,Y&&Yr(v[0],v[1],Y)&&(U=T<3?e:U,T=1),c=bt(c);++C<T;){var Z=v[C];Z&&u(c,Z,C,U)}return c})}function R1(u,c){return function(v,C){if(v==null)return v;if(!un(v))return u(v,C);for(var T=v.length,U=c?T:-1,Y=bt(v);(c?U--:++U<T)&&C(Y[U],U,Y)!==!1;);return v}}function T1(u){return function(c,v,C){for(var T=-1,U=bt(c),Y=C(c),Z=Y.length;Z--;){var ne=Y[u?Z:++T];if(v(U[ne],ne,U)===!1)break}return c}}function jy(u,c,v){var C=c&w,T=dc(u);function U(){var Y=this&&this!==er&&this instanceof U?T:u;return Y.apply(C?v:this,arguments)}return U}function x1(u){return function(c){c=wt(c);var v=Xi(c)?nn(c):e,C=v?v[0]:c.charAt(0),T=v?Ks(v,1).join(""):c.slice(1);return C[u]()+T}}function Hu(u){return function(c){return Zo(Rg(Pg(c).replace(Us,"")),u,"")}}function dc(u){return function(){var c=arguments;switch(c.length){case 0:return new u;case 1:return new u(c[0]);case 2:return new u(c[0],c[1]);case 3:return new u(c[0],c[1],c[2]);case 4:return new u(c[0],c[1],c[2],c[3]);case 5:return new u(c[0],c[1],c[2],c[3],c[4]);case 6:return new u(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new u(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var v=Lu(u.prototype),C=u.apply(v,c);return Nt(C)?C:v}}function My(u,c,v){var C=dc(u);function T(){for(var U=arguments.length,Y=ue(U),Z=U,ne=ju(T);Z--;)Y[Z]=arguments[Z];var ge=U<3&&Y[0]!==ne&&Y[U-1]!==ne?[]:Sn(Y,ne);if(U-=ge.length,U<v)return U1(u,c,Pl,T.placeholder,e,Y,ge,e,e,v-U);var me=this&&this!==er&&this instanceof T?C:u;return Kr(me,this,Y)}return T}function O1(u){return function(c,v,C){var T=bt(c);if(!un(c)){var U=je(v,3);c=dr(c),v=function(Z){return U(T[Z],Z,T)}}var Y=u(c,v,C);return Y>-1?T[U?c[Y]:Y]:e}}function N1(u){return ss(function(c){var v=c.length,C=v,T=qn.prototype.thru;for(u&&c.reverse();C--;){var U=c[C];if(typeof U!="function")throw new sn(i);if(T&&!Y&&Ol(U)=="wrapper")var Y=new qn([],!0)}for(C=Y?C:v;++C<v;){U=c[C];var Z=Ol(U),ne=Z=="wrapper"?pp(U):e;ne&&vp(ne[0])&&ne[1]==(D|A|_|H)&&!ne[4].length&&ne[9]==1?Y=Y[Ol(ne[0])].apply(Y,ne[3]):Y=U.length==1&&vp(U)?Y[Z]():Y.thru(U)}return function(){var ge=arguments,me=ge[0];if(Y&&ge.length==1&&We(me))return Y.plant(me).value();for(var Ee=0,Ie=v?c[Ee].apply(this,ge):me;++Ee<v;)Ie=c[Ee].call(this,Ie);return Ie}})}function Pl(u,c,v,C,T,U,Y,Z,ne,ge){var me=c&D,Ee=c&w,Ie=c&g,Oe=c&(A|S),Ve=c&V,rt=Ie?e:dc(u);function Ke(){for(var ut=arguments.length,lt=ue(ut),_n=ut;_n--;)lt[_n]=arguments[_n];if(Oe)var Wr=ju(Ke),In=fl(lt,Wr);if(C&&(lt=$1(lt,C,T,Oe)),U&&(lt=P1(lt,U,Y,Oe)),ut-=In,Oe&&ut<ge){var Xt=Sn(lt,Wr);return U1(u,c,Pl,Ke.placeholder,v,lt,Xt,Z,ne,ge-ut)}var ai=Ee?v:this,cs=Ie?ai[u]:u;return ut=lt.length,Z?lt=o4(lt,Z):Ve&&ut>1&&lt.reverse(),me&&ne<ut&&(lt.length=ne),this&&this!==er&&this instanceof Ke&&(cs=rt||dc(cs)),cs.apply(ai,lt)}return Ke}function k1(u,c){return function(v,C){return my(v,u,c(C),{})}}function Rl(u,c){return function(v,C){var T;if(v===e&&C===e)return c;if(v!==e&&(T=v),C!==e){if(T===e)return C;typeof v=="string"||typeof C=="string"?(v=Cn(v),C=Cn(C)):(v=S1(v),C=S1(C)),T=u(v,C)}return T}}function cp(u){return ss(function(c){return c=te(c,Rr(je())),it(function(v){var C=this;return u(c,function(T){return Kr(T,C,v)})})})}function Tl(u,c){c=c===e?" ":Cn(c);var v=c.length;if(v<2)return v?rp(c,u):c;var C=rp(c,M(u/Ji(c)));return Xi(c)?Ks(nn(C),0,u).join(""):C.slice(0,u)}function qy(u,c,v,C){var T=c&w,U=dc(u);function Y(){for(var Z=-1,ne=arguments.length,ge=-1,me=C.length,Ee=ue(me+ne),Ie=this&&this!==er&&this instanceof Y?U:u;++ge<me;)Ee[ge]=C[ge];for(;ne--;)Ee[ge++]=arguments[++Z];return Kr(Ie,T?v:this,Ee)}return Y}function L1(u){return function(c,v,C){return C&&typeof C!="number"&&Yr(c,v,C)&&(v=C=e),c=os(c),v===e?(v=c,c=0):v=os(v),C=C===e?c<v?1:-1:os(C),Dy(c,v,C,u)}}function xl(u){return function(c,v){return typeof c=="string"&&typeof v=="string"||(c=zn(c),v=zn(v)),u(c,v)}}function U1(u,c,v,C,T,U,Y,Z,ne,ge){var me=c&A,Ee=me?Y:e,Ie=me?e:Y,Oe=me?U:e,Ve=me?e:U;c|=me?_:I,c&=~(me?I:_),c&y||(c&=~(w|g));var rt=[u,c,T,Oe,Ee,Ve,Ie,Z,ne,ge],Ke=v.apply(e,rt);return vp(u)&&J1(Ke,rt),Ke.placeholder=C,Z1(Ke,u,c)}function lp(u){var c=Ot[u];return function(v,C){if(v=zn(v),C=C==null?0:Tr(et(C),292),C&&Mt(v)){var T=(wt(v)+"e").split("e"),U=c(T[0]+"e"+(+T[1]+C));return T=(wt(U)+"e").split("e"),+(T[0]+"e"+(+T[1]-C))}return c(v)}}var Vy=Nu&&1/bn(new Nu([,-0]))[1]==K?function(u){return new Nu(u)}:Rp;function H1(u){return function(c){var v=xr(c);return v==tt?ic(c):v==wr?Fu(c):Bh(c,u(c))}}function is(u,c,v,C,T,U,Y,Z){var ne=c&g;if(!ne&&typeof u!="function")throw new sn(i);var ge=C?C.length:0;if(ge||(c&=~(_|I),C=T=e),Y=Y===e?Y:ir(et(Y),0),Z=Z===e?Z:et(Z),ge-=T?T.length:0,c&I){var me=C,Ee=T;C=T=e}var Ie=ne?e:pp(u),Oe=[u,c,v,C,T,me,Ee,U,Y,Z];if(Ie&&s4(Oe,Ie),u=Oe[0],c=Oe[1],v=Oe[2],C=Oe[3],T=Oe[4],Z=Oe[9]=Oe[9]===e?ne?0:u.length:ir(Oe[9]-ge,0),!Z&&c&(A|S)&&(c&=~(A|S)),!c||c==w)var Ve=jy(u,c,v);else c==A||c==S?Ve=My(u,c,Z):(c==_||c==(w|_))&&!T.length?Ve=qy(u,c,v,C):Ve=Pl.apply(e,Oe);var rt=Ie?w1:J1;return Z1(rt(Ve,Oe),u,c)}function j1(u,c,v,C){return u===e||si(u,Zi[v])&&!ht.call(C,v)?c:u}function M1(u,c,v,C,T,U){return Nt(u)&&Nt(c)&&(U.set(c,u),Il(u,c,e,M1,U),U.delete(c)),u}function Ky(u){return vc(u)?e:u}function q1(u,c,v,C,T,U){var Y=v&p,Z=u.length,ne=c.length;if(Z!=ne&&!(Y&&ne>Z))return!1;var ge=U.get(u),me=U.get(c);if(ge&&me)return ge==c&&me==u;var Ee=-1,Ie=!0,Oe=v&f?new Ba:e;for(U.set(u,c),U.set(c,u);++Ee<Z;){var Ve=u[Ee],rt=c[Ee];if(C)var Ke=Y?C(rt,Ve,Ee,c,u,U):C(Ve,rt,Ee,u,c,U);if(Ke!==e){if(Ke)continue;Ie=!1;break}if(Oe){if(!ul(c,function(ut,lt){if(!Ia(Oe,lt)&&(Ve===ut||T(Ve,ut,v,C,U)))return Oe.push(lt)})){Ie=!1;break}}else if(!(Ve===rt||T(Ve,rt,v,C,U))){Ie=!1;break}}return U.delete(u),U.delete(c),Ie}function Gy(u,c,v,C,T,U,Y){switch(v){case Ze:if(u.byteLength!=c.byteLength||u.byteOffset!=c.byteOffset)return!1;u=u.buffer,c=c.buffer;case Qt:return!(u.byteLength!=c.byteLength||!U(new Tu(u),new Tu(c)));case Bt:case pt:case gt:return si(+u,+c);case Tt:return u.name==c.name&&u.message==c.message;case fr:case Zt:return u==c+"";case tt:var Z=ic;case wr:var ne=C&p;if(Z||(Z=bn),u.size!=c.size&&!ne)return!1;var ge=Y.get(u);if(ge)return ge==c;C|=f,Y.set(u,c);var me=q1(Z(u),Z(c),C,T,U,Y);return Y.delete(u),me;case $r:if(oc)return oc.call(u)==oc.call(c)}return!1}function zy(u,c,v,C,T,U){var Y=v&p,Z=fp(u),ne=Z.length,ge=fp(c),me=ge.length;if(ne!=me&&!Y)return!1;for(var Ee=ne;Ee--;){var Ie=Z[Ee];if(!(Y?Ie in c:ht.call(c,Ie)))return!1}var Oe=U.get(u),Ve=U.get(c);if(Oe&&Ve)return Oe==c&&Ve==u;var rt=!0;U.set(u,c),U.set(c,u);for(var Ke=Y;++Ee<ne;){Ie=Z[Ee];var ut=u[Ie],lt=c[Ie];if(C)var _n=Y?C(lt,ut,Ie,c,u,U):C(ut,lt,Ie,u,c,U);if(!(_n===e?ut===lt||T(ut,lt,v,C,U):_n)){rt=!1;break}Ke||(Ke=Ie=="constructor")}if(rt&&!Ke){var Wr=u.constructor,In=c.constructor;Wr!=In&&"constructor"in u&&"constructor"in c&&!(typeof Wr=="function"&&Wr instanceof Wr&&typeof In=="function"&&In instanceof In)&&(rt=!1)}return U.delete(u),U.delete(c),rt}function ss(u){return Ap(W1(u,e,ig),u+"")}function fp(u){return c1(u,dr,gp)}function hp(u){return c1(u,on,V1)}var pp=yl?function(u){return yl.get(u)}:Rp;function Ol(u){for(var c=u.name+"",v=ku[c],C=ht.call(ku,c)?v.length:0;C--;){var T=v[C],U=T.func;if(U==null||U==u)return T.name}return c}function ju(u){var c=ht.call(N,"placeholder")?N:u;return c.placeholder}function je(){var u=N.iteratee||$p;return u=u===$p?h1:u,arguments.length?u(arguments[0],arguments[1]):u}function Nl(u,c){var v=u.__data__;return t4(c)?v[typeof c=="string"?"string":"hash"]:v.map}function dp(u){for(var c=dr(u),v=c.length;v--;){var C=c[v],T=u[C];c[v]=[C,T,z1(T)]}return c}function Ra(u,c){var v=Ph(u,c);return f1(v)?v:e}function Yy(u){var c=ht.call(u,es),v=u[es];try{u[es]=e;var C=!0}catch{}var T=Pu.call(u);return C&&(c?u[es]=v:delete u[es]),T}var gp=oe?function(u){return u==null?[]:(u=bt(u),wn(oe(u),function(c){return Al.call(u,c)}))}:Tp,V1=oe?function(u){for(var c=[];u;)yn(c,gp(u)),u=xu(u);return c}:Tp,xr=zr;(qh&&xr(new qh(new ArrayBuffer(1)))!=Ze||sc&&xr(new sc)!=tt||Vh&&xr(Vh.resolve())!=Ut||Nu&&xr(new Nu)!=wr||ac&&xr(new ac)!=Mr)&&(xr=function(u){var c=zr(u),v=c==Je?u.constructor:e,C=v?Ta(v):"";if(C)switch(C){case $w:return Ze;case Pw:return tt;case Rw:return Ut;case Tw:return wr;case xw:return Mr}return c});function Wy(u,c,v){for(var C=-1,T=v.length;++C<T;){var U=v[C],Y=U.size;switch(U.type){case"drop":u+=Y;break;case"dropRight":c-=Y;break;case"take":c=Tr(c,u+Y);break;case"takeRight":u=ir(u,c-Y);break}}return{start:u,end:c}}function Xy(u){var c=u.match(Oo);return c?c[1].split(No):[]}function K1(u,c,v){c=Vs(c,u);for(var C=-1,T=c.length,U=!1;++C<T;){var Y=bi(c[C]);if(!(U=u!=null&&v(u,Y)))break;u=u[Y]}return U||++C!=T?U:(T=u==null?0:u.length,!!T&&ql(T)&&as(Y,T)&&(We(u)||xa(u)))}function Jy(u){var c=u.length,v=new u.constructor(c);return c&&typeof u[0]=="string"&&ht.call(u,"index")&&(v.index=u.index,v.input=u.input),v}function G1(u){return typeof u.constructor=="function"&&!gc(u)?Lu(xu(u)):{}}function Zy(u,c,v){var C=u.constructor;switch(c){case Qt:return op(u);case Bt:case pt:return new C(+u);case Ze:return Oy(u,v);case Pr:case fa:case ha:case pa:case da:case Gi:case ga:case Os:case gi:return D1(u,v);case tt:return new C;case gt:case Zt:return new C(u);case fr:return Ny(u);case wr:return new C;case $r:return ky(u)}}function Qy(u,c){var v=c.length;if(!v)return u;var C=v-1;return c[C]=(v>1?"& ":"")+c[C],c=c.join(v>2?", ":" "),u.replace(xo,`{
/* [wrapped with `+c+`] */
`)}function e4(u){return We(u)||xa(u)||!!(wl&&u&&u[wl])}function as(u,c){var v=typeof u;return c=c??X,!!c&&(v=="number"||v!="symbol"&&mu.test(u))&&u>-1&&u%1==0&&u<c}function Yr(u,c,v){if(!Nt(v))return!1;var C=typeof c;return(C=="number"?un(v)&&as(c,v.length):C=="string"&&c in v)?si(v[c],u):!1}function mp(u,c){if(We(u))return!1;var v=typeof u;return v=="number"||v=="symbol"||v=="boolean"||u==null||Fn(u)?!0:$o.test(u)||!Bo.test(u)||c!=null&&u in bt(c)}function t4(u){var c=typeof u;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?u!=="__proto__":u===null}function vp(u){var c=Ol(u),v=N[c];if(typeof v!="function"||!(c in ot.prototype))return!1;if(u===v)return!0;var C=pp(v);return!!C&&u===C[0]}function r4(u){return!!$u&&$u in u}var n4=ni?us:xp;function gc(u){var c=u&&u.constructor,v=typeof c=="function"&&c.prototype||Zi;return u===v}function z1(u){return u===u&&!Nt(u)}function Y1(u,c){return function(v){return v==null?!1:v[u]===c&&(c!==e||u in bt(v))}}function i4(u){var c=jl(u,function(C){return v.size===o&&v.clear(),C}),v=c.cache;return c}function s4(u,c){var v=u[1],C=c[1],T=v|C,U=T<(w|g|D),Y=C==D&&v==A||C==D&&v==H&&u[7].length<=c[8]||C==(D|H)&&c[7].length<=c[8]&&v==A;if(!(U||Y))return u;C&w&&(u[2]=c[2],T|=v&w?0:y);var Z=c[3];if(Z){var ne=u[3];u[3]=ne?$1(ne,Z,c[4]):Z,u[4]=ne?Sn(u[3],l):c[4]}return Z=c[5],Z&&(ne=u[5],u[5]=ne?P1(ne,Z,c[6]):Z,u[6]=ne?Sn(u[5],l):c[6]),Z=c[7],Z&&(u[7]=Z),C&D&&(u[8]=u[8]==null?c[8]:Tr(u[8],c[8])),u[9]==null&&(u[9]=c[9]),u[0]=c[0],u[1]=T,u}function a4(u){var c=[];if(u!=null)for(var v in bt(u))c.push(v);return c}function u4(u){return Pu.call(u)}function W1(u,c,v){return c=ir(c===e?u.length-1:c,0),function(){for(var C=arguments,T=-1,U=ir(C.length-c,0),Y=ue(U);++T<U;)Y[T]=C[c+T];T=-1;for(var Z=ue(c+1);++T<c;)Z[T]=C[T];return Z[c]=v(Y),Kr(u,this,Z)}}function X1(u,c){return c.length<2?u:Pa(u,Kn(c,0,-1))}function o4(u,c){for(var v=u.length,C=Tr(c.length,v),T=an(u);C--;){var U=c[C];u[C]=as(U,v)?T[U]:e}return u}function Ep(u,c){if(!(c==="constructor"&&typeof u[c]=="function")&&c!="__proto__")return u[c]}var J1=Q1(w1),mc=W||function(u,c){return er.setTimeout(u,c)},Ap=Q1(Py);function Z1(u,c,v){var C=c+"";return Ap(u,Qy(C,c4(Xy(C),v)))}function Q1(u){var c=0,v=0;return function(){var C=Iw(),T=L-(C-v);if(v=C,T>0){if(++c>=k)return arguments[0]}else c=0;return u.apply(e,arguments)}}function kl(u,c){var v=-1,C=u.length,T=C-1;for(c=c===e?C:c;++v<c;){var U=tp(v,T),Y=u[U];u[U]=u[v],u[v]=Y}return u.length=c,u}var eg=i4(function(u){var c=[];return u.charCodeAt(0)===46&&c.push(""),u.replace(Po,function(v,C,T,U){c.push(T?U.replace(Uo,"$1"):C||v)}),c});function bi(u){if(typeof u=="string"||Fn(u))return u;var c=u+"";return c=="0"&&1/u==-K?"-0":c}function Ta(u){if(u!=null){try{return Bu.call(u)}catch{}try{return u+""}catch{}}return""}function c4(u,c){return rn(ce,function(v){var C="_."+v[0];c&v[1]&&!Gr(u,C)&&u.push(C)}),u.sort()}function tg(u){if(u instanceof ot)return u.clone();var c=new qn(u.__wrapped__,u.__chain__);return c.__actions__=an(u.__actions__),c.__index__=u.__index__,c.__values__=u.__values__,c}function l4(u,c,v){(v?Yr(u,c,v):c===e)?c=1:c=ir(et(c),0);var C=u==null?0:u.length;if(!C||c<1)return[];for(var T=0,U=0,Y=ue(M(C/c));T<C;)Y[U++]=Kn(u,T,T+=c);return Y}function f4(u){for(var c=-1,v=u==null?0:u.length,C=0,T=[];++c<v;){var U=u[c];U&&(T[C++]=U)}return T}function h4(){var u=arguments.length;if(!u)return[];for(var c=ue(u-1),v=arguments[0],C=u;C--;)c[C-1]=arguments[C];return yn(We(v)?an(v):[v],Fr(c,1))}var p4=it(function(u,c){return Wt(u)?lc(u,Fr(c,1,Wt,!0)):[]}),d4=it(function(u,c){var v=Gn(c);return Wt(v)&&(v=e),Wt(u)?lc(u,Fr(c,1,Wt,!0),je(v,2)):[]}),g4=it(function(u,c){var v=Gn(c);return Wt(v)&&(v=e),Wt(u)?lc(u,Fr(c,1,Wt,!0),e,v):[]});function m4(u,c,v){var C=u==null?0:u.length;return C?(c=v||c===e?1:et(c),Kn(u,c<0?0:c,C)):[]}function v4(u,c,v){var C=u==null?0:u.length;return C?(c=v||c===e?1:et(c),c=C-c,Kn(u,0,c<0?0:c)):[]}function E4(u,c){return u&&u.length?Bl(u,je(c,3),!0,!0):[]}function A4(u,c){return u&&u.length?Bl(u,je(c,3),!0):[]}function w4(u,c,v,C){var T=u==null?0:u.length;return T?(v&&typeof v!="number"&&Yr(u,c,v)&&(v=0,C=T),hy(u,c,v,C)):[]}function rg(u,c,v){var C=u==null?0:u.length;if(!C)return-1;var T=v==null?0:et(v);return T<0&&(T=ir(C+T,0)),tr(u,je(c,3),T)}function ng(u,c,v){var C=u==null?0:u.length;if(!C)return-1;var T=C-1;return v!==e&&(T=et(v),T=v<0?ir(C+T,0):Tr(T,C-1)),tr(u,je(c,3),T,!0)}function ig(u){var c=u==null?0:u.length;return c?Fr(u,1):[]}function y4(u){var c=u==null?0:u.length;return c?Fr(u,K):[]}function S4(u,c){var v=u==null?0:u.length;return v?(c=c===e?1:et(c),Fr(u,c)):[]}function b4(u){for(var c=-1,v=u==null?0:u.length,C={};++c<v;){var T=u[c];C[T[0]]=T[1]}return C}function sg(u){return u&&u.length?u[0]:e}function C4(u,c,v){var C=u==null?0:u.length;if(!C)return-1;var T=v==null?0:et(v);return T<0&&(T=ir(C+T,0)),js(u,c,T)}function F4(u){var c=u==null?0:u.length;return c?Kn(u,0,-1):[]}var _4=it(function(u){var c=te(u,ap);return c.length&&c[0]===u[0]?Xh(c):[]}),I4=it(function(u){var c=Gn(u),v=te(u,ap);return c===Gn(v)?c=e:v.pop(),v.length&&v[0]===u[0]?Xh(v,je(c,2)):[]}),D4=it(function(u){var c=Gn(u),v=te(u,ap);return c=typeof c=="function"?c:e,c&&v.pop(),v.length&&v[0]===u[0]?Xh(v,e,c):[]});function B4(u,c){return u==null?"":Fw.call(u,c)}function Gn(u){var c=u==null?0:u.length;return c?u[c-1]:e}function $4(u,c,v){var C=u==null?0:u.length;if(!C)return-1;var T=C;return v!==e&&(T=et(v),T=T<0?ir(C+T,0):Tr(T,C-1)),c===c?xh(u,c,T):tr(u,jn,T,!0)}function P4(u,c){return u&&u.length?m1(u,et(c)):e}var R4=it(ag);function ag(u,c){return u&&u.length&&c&&c.length?ep(u,c):u}function T4(u,c,v){return u&&u.length&&c&&c.length?ep(u,c,je(v,2)):u}function x4(u,c,v){return u&&u.length&&c&&c.length?ep(u,c,e,v):u}var O4=ss(function(u,c){var v=u==null?0:u.length,C=Gh(u,c);return A1(u,te(c,function(T){return as(T,v)?+T:T}).sort(B1)),C});function N4(u,c){var v=[];if(!(u&&u.length))return v;var C=-1,T=[],U=u.length;for(c=je(c,3);++C<U;){var Y=u[C];c(Y,C,u)&&(v.push(Y),T.push(C))}return A1(u,T),v}function wp(u){return u==null?u:Bw.call(u)}function k4(u,c,v){var C=u==null?0:u.length;return C?(v&&typeof v!="number"&&Yr(u,c,v)?(c=0,v=C):(c=c==null?0:et(c),v=v===e?C:et(v)),Kn(u,c,v)):[]}function L4(u,c){return Dl(u,c)}function U4(u,c,v){return np(u,c,je(v,2))}function H4(u,c){var v=u==null?0:u.length;if(v){var C=Dl(u,c);if(C<v&&si(u[C],c))return C}return-1}function j4(u,c){return Dl(u,c,!0)}function M4(u,c,v){return np(u,c,je(v,2),!0)}function q4(u,c){var v=u==null?0:u.length;if(v){var C=Dl(u,c,!0)-1;if(si(u[C],c))return C}return-1}function V4(u){return u&&u.length?y1(u):[]}function K4(u,c){return u&&u.length?y1(u,je(c,2)):[]}function G4(u){var c=u==null?0:u.length;return c?Kn(u,1,c):[]}function z4(u,c,v){return u&&u.length?(c=v||c===e?1:et(c),Kn(u,0,c<0?0:c)):[]}function Y4(u,c,v){var C=u==null?0:u.length;return C?(c=v||c===e?1:et(c),c=C-c,Kn(u,c<0?0:c,C)):[]}function W4(u,c){return u&&u.length?Bl(u,je(c,3),!1,!0):[]}function X4(u,c){return u&&u.length?Bl(u,je(c,3)):[]}var J4=it(function(u){return qs(Fr(u,1,Wt,!0))}),Z4=it(function(u){var c=Gn(u);return Wt(c)&&(c=e),qs(Fr(u,1,Wt,!0),je(c,2))}),Q4=it(function(u){var c=Gn(u);return c=typeof c=="function"?c:e,qs(Fr(u,1,Wt,!0),e,c)});function e6(u){return u&&u.length?qs(u):[]}function t6(u,c){return u&&u.length?qs(u,je(c,2)):[]}function r6(u,c){return c=typeof c=="function"?c:e,u&&u.length?qs(u,e,c):[]}function yp(u){if(!(u&&u.length))return[];var c=0;return u=wn(u,function(v){if(Wt(v))return c=ir(v.length,c),!0}),tc(c,function(v){return te(u,Wi(v))})}function ug(u,c){if(!(u&&u.length))return[];var v=yp(u);return c==null?v:te(v,function(C){return Kr(c,e,C)})}var n6=it(function(u,c){return Wt(u)?lc(u,c):[]}),i6=it(function(u){return sp(wn(u,Wt))}),s6=it(function(u){var c=Gn(u);return Wt(c)&&(c=e),sp(wn(u,Wt),je(c,2))}),a6=it(function(u){var c=Gn(u);return c=typeof c=="function"?c:e,sp(wn(u,Wt),e,c)}),u6=it(yp);function o6(u,c){return F1(u||[],c||[],cc)}function c6(u,c){return F1(u||[],c||[],pc)}var l6=it(function(u){var c=u.length,v=c>1?u[c-1]:e;return v=typeof v=="function"?(u.pop(),v):e,ug(u,v)});function og(u){var c=N(u);return c.__chain__=!0,c}function f6(u,c){return c(u),u}function Ll(u,c){return c(u)}var h6=ss(function(u){var c=u.length,v=c?u[0]:0,C=this.__wrapped__,T=function(U){return Gh(U,u)};return c>1||this.__actions__.length||!(C instanceof ot)||!as(v)?this.thru(T):(C=C.slice(v,+v+(c?1:0)),C.__actions__.push({func:Ll,args:[T],thisArg:e}),new qn(C,this.__chain__).thru(function(U){return c&&!U.length&&U.push(e),U}))});function p6(){return og(this)}function d6(){return new qn(this.value(),this.__chain__)}function g6(){this.__values__===e&&(this.__values__=Sg(this.value()));var u=this.__index__>=this.__values__.length,c=u?e:this.__values__[this.__index__++];return{done:u,value:c}}function m6(){return this}function v6(u){for(var c,v=this;v instanceof bl;){var C=tg(v);C.__index__=0,C.__values__=e,c?T.__wrapped__=C:c=C;var T=C;v=v.__wrapped__}return T.__wrapped__=u,c}function E6(){var u=this.__wrapped__;if(u instanceof ot){var c=u;return this.__actions__.length&&(c=new ot(this)),c=c.reverse(),c.__actions__.push({func:Ll,args:[wp],thisArg:e}),new qn(c,this.__chain__)}return this.thru(wp)}function A6(){return C1(this.__wrapped__,this.__actions__)}var w6=$l(function(u,c,v){ht.call(u,v)?++u[v]:ns(u,v,1)});function y6(u,c,v){var C=We(u)?Ye:fy;return v&&Yr(u,c,v)&&(c=e),C(u,je(c,3))}function S6(u,c){var v=We(u)?wn:u1;return v(u,je(c,3))}var b6=O1(rg),C6=O1(ng);function F6(u,c){return Fr(Ul(u,c),1)}function _6(u,c){return Fr(Ul(u,c),K)}function I6(u,c,v){return v=v===e?1:et(v),Fr(Ul(u,c),v)}function cg(u,c){var v=We(u)?rn:Ms;return v(u,je(c,3))}function lg(u,c){var v=We(u)?B:a1;return v(u,je(c,3))}var D6=$l(function(u,c,v){ht.call(u,v)?u[v].push(c):ns(u,v,[c])});function B6(u,c,v,C){u=un(u)?u:qu(u),v=v&&!C?et(v):0;var T=u.length;return v<0&&(v=ir(T+v,0)),Vl(u)?v<=T&&u.indexOf(c,v)>-1:!!T&&js(u,c,v)>-1}var $6=it(function(u,c,v){var C=-1,T=typeof c=="function",U=un(u)?ue(u.length):[];return Ms(u,function(Y){U[++C]=T?Kr(c,Y,v):fc(Y,c,v)}),U}),P6=$l(function(u,c,v){ns(u,v,c)});function Ul(u,c){var v=We(u)?te:p1;return v(u,je(c,3))}function R6(u,c,v,C){return u==null?[]:(We(c)||(c=c==null?[]:[c]),v=C?e:v,We(v)||(v=v==null?[]:[v]),v1(u,c,v))}var T6=$l(function(u,c,v){u[v?0:1].push(c)},function(){return[[],[]]});function x6(u,c,v){var C=We(u)?Zo:ol,T=arguments.length<3;return C(u,je(c,4),v,T,Ms)}function O6(u,c,v){var C=We(u)?J0:ol,T=arguments.length<3;return C(u,je(c,4),v,T,a1)}function N6(u,c){var v=We(u)?wn:u1;return v(u,Ml(je(c,3)))}function k6(u){var c=We(u)?r1:By;return c(u)}function L6(u,c,v){(v?Yr(u,c,v):c===e)?c=1:c=et(c);var C=We(u)?ay:$y;return C(u,c)}function U6(u){var c=We(u)?uy:Ry;return c(u)}function H6(u){if(u==null)return 0;if(un(u))return Vl(u)?Ji(u):u.length;var c=xr(u);return c==tt||c==wr?u.size:Zh(u).length}function j6(u,c,v){var C=We(u)?ul:Ty;return v&&Yr(u,c,v)&&(c=e),C(u,je(c,3))}var M6=it(function(u,c){if(u==null)return[];var v=c.length;return v>1&&Yr(u,c[0],c[1])?c=[]:v>2&&Yr(c[0],c[1],c[2])&&(c=[c[0]]),v1(u,Fr(c,1),[])}),Hl=O||function(){return er.Date.now()};function q6(u,c){if(typeof c!="function")throw new sn(i);return u=et(u),function(){if(--u<1)return c.apply(this,arguments)}}function fg(u,c,v){return c=v?e:c,c=u&&c==null?u.length:c,is(u,D,e,e,e,e,c)}function hg(u,c){var v;if(typeof c!="function")throw new sn(i);return u=et(u),function(){return--u>0&&(v=c.apply(this,arguments)),u<=1&&(c=e),v}}var Sp=it(function(u,c,v){var C=w;if(v.length){var T=Sn(v,ju(Sp));C|=_}return is(u,C,c,v,T)}),pg=it(function(u,c,v){var C=w|g;if(v.length){var T=Sn(v,ju(pg));C|=_}return is(c,C,u,v,T)});function dg(u,c,v){c=v?e:c;var C=is(u,A,e,e,e,e,e,c);return C.placeholder=dg.placeholder,C}function gg(u,c,v){c=v?e:c;var C=is(u,S,e,e,e,e,e,c);return C.placeholder=gg.placeholder,C}function mg(u,c,v){var C,T,U,Y,Z,ne,ge=0,me=!1,Ee=!1,Ie=!0;if(typeof u!="function")throw new sn(i);c=zn(c)||0,Nt(v)&&(me=!!v.leading,Ee="maxWait"in v,U=Ee?ir(zn(v.maxWait)||0,c):U,Ie="trailing"in v?!!v.trailing:Ie);function Oe(Xt){var ai=C,cs=T;return C=T=e,ge=Xt,Y=u.apply(cs,ai),Y}function Ve(Xt){return ge=Xt,Z=mc(ut,c),me?Oe(Xt):Y}function rt(Xt){var ai=Xt-ne,cs=Xt-ge,Og=c-ai;return Ee?Tr(Og,U-cs):Og}function Ke(Xt){var ai=Xt-ne,cs=Xt-ge;return ne===e||ai>=c||ai<0||Ee&&cs>=U}function ut(){var Xt=Hl();if(Ke(Xt))return lt(Xt);Z=mc(ut,rt(Xt))}function lt(Xt){return Z=e,Ie&&C?Oe(Xt):(C=T=e,Y)}function _n(){Z!==e&&_1(Z),ge=0,C=ne=T=Z=e}function Wr(){return Z===e?Y:lt(Hl())}function In(){var Xt=Hl(),ai=Ke(Xt);if(C=arguments,T=this,ne=Xt,ai){if(Z===e)return Ve(ne);if(Ee)return _1(Z),Z=mc(ut,c),Oe(ne)}return Z===e&&(Z=mc(ut,c)),Y}return In.cancel=_n,In.flush=Wr,In}var V6=it(function(u,c){return s1(u,1,c)}),K6=it(function(u,c,v){return s1(u,zn(c)||0,v)});function G6(u){return is(u,V)}function jl(u,c){if(typeof u!="function"||c!=null&&typeof c!="function")throw new sn(i);var v=function(){var C=arguments,T=c?c.apply(this,C):C[0],U=v.cache;if(U.has(T))return U.get(T);var Y=u.apply(this,C);return v.cache=U.set(T,Y)||U,Y};return v.cache=new(jl.Cache||rs),v}jl.Cache=rs;function Ml(u){if(typeof u!="function")throw new sn(i);return function(){var c=arguments;switch(c.length){case 0:return!u.call(this);case 1:return!u.call(this,c[0]);case 2:return!u.call(this,c[0],c[1]);case 3:return!u.call(this,c[0],c[1],c[2])}return!u.apply(this,c)}}function z6(u){return hg(2,u)}var Y6=xy(function(u,c){c=c.length==1&&We(c[0])?te(c[0],Rr(je())):te(Fr(c,1),Rr(je()));var v=c.length;return it(function(C){for(var T=-1,U=Tr(C.length,v);++T<U;)C[T]=c[T].call(this,C[T]);return Kr(u,this,C)})}),bp=it(function(u,c){var v=Sn(c,ju(bp));return is(u,_,e,c,v)}),vg=it(function(u,c){var v=Sn(c,ju(vg));return is(u,I,e,c,v)}),W6=ss(function(u,c){return is(u,H,e,e,e,c)});function X6(u,c){if(typeof u!="function")throw new sn(i);return c=c===e?c:et(c),it(u,c)}function J6(u,c){if(typeof u!="function")throw new sn(i);return c=c==null?0:ir(et(c),0),it(function(v){var C=v[c],T=Ks(v,0,c);return C&&yn(T,C),Kr(u,this,T)})}function Z6(u,c,v){var C=!0,T=!0;if(typeof u!="function")throw new sn(i);return Nt(v)&&(C="leading"in v?!!v.leading:C,T="trailing"in v?!!v.trailing:T),mg(u,c,{leading:C,maxWait:c,trailing:T})}function Q6(u){return fg(u,1)}function eS(u,c){return bp(up(c),u)}function tS(){if(!arguments.length)return[];var u=arguments[0];return We(u)?u:[u]}function rS(u){return Vn(u,E)}function nS(u,c){return c=typeof c=="function"?c:e,Vn(u,E,c)}function iS(u){return Vn(u,h|E)}function sS(u,c){return c=typeof c=="function"?c:e,Vn(u,h|E,c)}function aS(u,c){return c==null||i1(u,c,dr(c))}function si(u,c){return u===c||u!==u&&c!==c}var uS=xl(Wh),oS=xl(function(u,c){return u>=c}),xa=l1(function(){return arguments}())?l1:function(u){return qt(u)&&ht.call(u,"callee")&&!Al.call(u,"callee")},We=ue.isArray,cS=tl?Rr(tl):vy;function un(u){return u!=null&&ql(u.length)&&!us(u)}function Wt(u){return qt(u)&&un(u)}function lS(u){return u===!0||u===!1||qt(u)&&zr(u)==Bt}var Gs=Ct||xp,fS=rl?Rr(rl):Ey;function hS(u){return qt(u)&&u.nodeType===1&&!vc(u)}function pS(u){if(u==null)return!0;if(un(u)&&(We(u)||typeof u=="string"||typeof u.splice=="function"||Gs(u)||Mu(u)||xa(u)))return!u.length;var c=xr(u);if(c==tt||c==wr)return!u.size;if(gc(u))return!Zh(u).length;for(var v in u)if(ht.call(u,v))return!1;return!0}function dS(u,c){return hc(u,c)}function gS(u,c,v){v=typeof v=="function"?v:e;var C=v?v(u,c):e;return C===e?hc(u,c,e,v):!!C}function Cp(u){if(!qt(u))return!1;var c=zr(u);return c==Tt||c==zt||typeof u.message=="string"&&typeof u.name=="string"&&!vc(u)}function mS(u){return typeof u=="number"&&Mt(u)}function us(u){if(!Nt(u))return!1;var c=zr(u);return c==nt||c==It||c==lr||c==Un}function Eg(u){return typeof u=="number"&&u==et(u)}function ql(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=X}function Nt(u){var c=typeof u;return u!=null&&(c=="object"||c=="function")}function qt(u){return u!=null&&typeof u=="object"}var Ag=nl?Rr(nl):wy;function vS(u,c){return u===c||Jh(u,c,dp(c))}function ES(u,c,v){return v=typeof v=="function"?v:e,Jh(u,c,dp(c),v)}function AS(u){return wg(u)&&u!=+u}function wS(u){if(n4(u))throw new Ge(n);return f1(u)}function yS(u){return u===null}function SS(u){return u==null}function wg(u){return typeof u=="number"||qt(u)&&zr(u)==gt}function vc(u){if(!qt(u)||zr(u)!=Je)return!1;var c=xu(u);if(c===null)return!0;var v=ht.call(c,"constructor")&&c.constructor;return typeof v=="function"&&v instanceof v&&Bu.call(v)==Hh}var Fp=il?Rr(il):yy;function bS(u){return Eg(u)&&u>=-X&&u<=X}var yg=sl?Rr(sl):Sy;function Vl(u){return typeof u=="string"||!We(u)&&qt(u)&&zr(u)==Zt}function Fn(u){return typeof u=="symbol"||qt(u)&&zr(u)==$r}var Mu=al?Rr(al):by;function CS(u){return u===e}function FS(u){return qt(u)&&xr(u)==Mr}function _S(u){return qt(u)&&zr(u)==mt}var IS=xl(Qh),DS=xl(function(u,c){return u<=c});function Sg(u){if(!u)return[];if(un(u))return Vl(u)?nn(u):an(u);if(Qi&&u[Qi])return Th(u[Qi]());var c=xr(u),v=c==tt?ic:c==wr?bn:qu;return v(u)}function os(u){if(!u)return u===0?u:0;if(u=zn(u),u===K||u===-K){var c=u<0?-1:1;return c*ie}return u===u?u:0}function et(u){var c=os(u),v=c%1;return c===c?v?c-v:c:0}function bg(u){return u?$a(et(u),0,ye):0}function zn(u){if(typeof u=="number")return u;if(Fn(u))return be;if(Nt(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=Nt(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=rc(u);var v=jo.test(u);return v||qo.test(u)?Fh(u.slice(2),v?2:8):gu.test(u)?be:+u}function Cg(u){return Si(u,on(u))}function BS(u){return u?$a(et(u),-X,X):u===0?u:0}function wt(u){return u==null?"":Cn(u)}var $S=Uu(function(u,c){if(gc(c)||un(c)){Si(c,dr(c),u);return}for(var v in c)ht.call(c,v)&&cc(u,v,c[v])}),Fg=Uu(function(u,c){Si(c,on(c),u)}),Kl=Uu(function(u,c,v,C){Si(c,on(c),u,C)}),PS=Uu(function(u,c,v,C){Si(c,dr(c),u,C)}),RS=ss(Gh);function TS(u,c){var v=Lu(u);return c==null?v:n1(v,c)}var xS=it(function(u,c){u=bt(u);var v=-1,C=c.length,T=C>2?c[2]:e;for(T&&Yr(c[0],c[1],T)&&(C=1);++v<C;)for(var U=c[v],Y=on(U),Z=-1,ne=Y.length;++Z<ne;){var ge=Y[Z],me=u[ge];(me===e||si(me,Zi[ge])&&!ht.call(u,ge))&&(u[ge]=U[ge])}return u}),OS=it(function(u){return u.push(e,M1),Kr(_g,e,u)});function NS(u,c){return Ue(u,je(c,3),yi)}function kS(u,c){return Ue(u,je(c,3),Yh)}function LS(u,c){return u==null?u:zh(u,je(c,3),on)}function US(u,c){return u==null?u:o1(u,je(c,3),on)}function HS(u,c){return u&&yi(u,je(c,3))}function jS(u,c){return u&&Yh(u,je(c,3))}function MS(u){return u==null?[]:_l(u,dr(u))}function qS(u){return u==null?[]:_l(u,on(u))}function _p(u,c,v){var C=u==null?e:Pa(u,c);return C===e?v:C}function VS(u,c){return u!=null&&K1(u,c,py)}function Ip(u,c){return u!=null&&K1(u,c,dy)}var KS=k1(function(u,c,v){c!=null&&typeof c.toString!="function"&&(c=Pu.call(c)),u[c]=v},Bp(cn)),GS=k1(function(u,c,v){c!=null&&typeof c.toString!="function"&&(c=Pu.call(c)),ht.call(u,c)?u[c].push(v):u[c]=[v]},je),zS=it(fc);function dr(u){return un(u)?t1(u):Zh(u)}function on(u){return un(u)?t1(u,!0):Cy(u)}function YS(u,c){var v={};return c=je(c,3),yi(u,function(C,T,U){ns(v,c(C,T,U),C)}),v}function WS(u,c){var v={};return c=je(c,3),yi(u,function(C,T,U){ns(v,T,c(C,T,U))}),v}var XS=Uu(function(u,c,v){Il(u,c,v)}),_g=Uu(function(u,c,v,C){Il(u,c,v,C)}),JS=ss(function(u,c){var v={};if(u==null)return v;var C=!1;c=te(c,function(U){return U=Vs(U,u),C||(C=U.length>1),U}),Si(u,hp(u),v),C&&(v=Vn(v,h|d|E,Ky));for(var T=c.length;T--;)ip(v,c[T]);return v});function ZS(u,c){return Ig(u,Ml(je(c)))}var QS=ss(function(u,c){return u==null?{}:_y(u,c)});function Ig(u,c){if(u==null)return{};var v=te(hp(u),function(C){return[C]});return c=je(c),E1(u,v,function(C,T){return c(C,T[0])})}function e5(u,c,v){c=Vs(c,u);var C=-1,T=c.length;for(T||(T=1,u=e);++C<T;){var U=u==null?e:u[bi(c[C])];U===e&&(C=T,U=v),u=us(U)?U.call(u):U}return u}function t5(u,c,v){return u==null?u:pc(u,c,v)}function r5(u,c,v,C){return C=typeof C=="function"?C:e,u==null?u:pc(u,c,v,C)}var Dg=H1(dr),Bg=H1(on);function n5(u,c,v){var C=We(u),T=C||Gs(u)||Mu(u);if(c=je(c,4),v==null){var U=u&&u.constructor;T?v=C?new U:[]:Nt(u)?v=us(U)?Lu(xu(u)):{}:v={}}return(T?rn:yi)(u,function(Y,Z,ne){return c(v,Y,Z,ne)}),v}function i5(u,c){return u==null?!0:ip(u,c)}function s5(u,c,v){return u==null?u:b1(u,c,up(v))}function a5(u,c,v,C){return C=typeof C=="function"?C:e,u==null?u:b1(u,c,up(v),C)}function qu(u){return u==null?[]:_a(u,dr(u))}function u5(u){return u==null?[]:_a(u,on(u))}function o5(u,c,v){return v===e&&(v=c,c=e),v!==e&&(v=zn(v),v=v===v?v:0),c!==e&&(c=zn(c),c=c===c?c:0),$a(zn(u),c,v)}function c5(u,c,v){return c=os(c),v===e?(v=c,c=0):v=os(v),u=zn(u),gy(u,c,v)}function l5(u,c,v){if(v&&typeof v!="boolean"&&Yr(u,c,v)&&(c=v=e),v===e&&(typeof c=="boolean"?(v=c,c=e):typeof u=="boolean"&&(v=u,u=e)),u===e&&c===e?(u=0,c=1):(u=os(u),c===e?(c=u,u=0):c=os(c)),u>c){var C=u;u=c,c=C}if(v||u%1||c%1){var T=Q0();return Tr(u+T*(c-u+Ch("1e-"+((T+"").length-1))),c)}return tp(u,c)}var f5=Hu(function(u,c,v){return c=c.toLowerCase(),u+(v?$g(c):c)});function $g(u){return Dp(wt(u).toLowerCase())}function Pg(u){return u=wt(u),u&&u.replace(vi,nc).replace(Vr,"")}function h5(u,c,v){u=wt(u),c=Cn(c);var C=u.length;v=v===e?C:$a(et(v),0,C);var T=v;return v-=c.length,v>=0&&u.slice(v,T)==c}function p5(u){return u=wt(u),u&&hu.test(u)?u.replace(lu,$h):u}function d5(u){return u=wt(u),u&&Ro.test(u)?u.replace(Ns,"\\$&"):u}var g5=Hu(function(u,c,v){return u+(v?"-":"")+c.toLowerCase()}),m5=Hu(function(u,c,v){return u+(v?" ":"")+c.toLowerCase()}),v5=x1("toLowerCase");function E5(u,c,v){u=wt(u),c=et(c);var C=c?Ji(u):0;if(!c||C>=c)return u;var T=(c-C)/2;return Tl(se(T),v)+u+Tl(M(T),v)}function A5(u,c,v){u=wt(u),c=et(c);var C=c?Ji(u):0;return c&&C<c?u+Tl(c-C,v):u}function w5(u,c,v){u=wt(u),c=et(c);var C=c?Ji(u):0;return c&&C<c?Tl(c-C,v)+u:u}function y5(u,c,v){return v||c==null?c=0:c&&(c=+c),Dw(wt(u).replace(ma,""),c||0)}function S5(u,c,v){return(v?Yr(u,c,v):c===e)?c=1:c=et(c),rp(wt(u),c)}function b5(){var u=arguments,c=wt(u[0]);return u.length<3?c:c.replace(u[1],u[2])}var C5=Hu(function(u,c,v){return u+(v?"_":"")+c.toLowerCase()});function F5(u,c,v){return v&&typeof v!="number"&&Yr(u,c,v)&&(c=v=e),v=v===e?ye:v>>>0,v?(u=wt(u),u&&(typeof c=="string"||c!=null&&!Fp(c))&&(c=Cn(c),!c&&Xi(u))?Ks(nn(u),0,v):u.split(c,v)):[]}var _5=Hu(function(u,c,v){return u+(v?" ":"")+Dp(c)});function I5(u,c,v){return u=wt(u),v=v==null?0:$a(et(v),0,u.length),c=Cn(c),u.slice(v,v+c.length)==c}function D5(u,c,v){var C=N.templateSettings;v&&Yr(u,c,v)&&(c=e),u=wt(u),c=Kl({},c,C,j1);var T=Kl({},c.imports,C.imports,j1),U=dr(T),Y=_a(T,U),Z,ne,ge=0,me=c.interpolate||en,Ee="__p += '",Ie=Iu((c.escape||en).source+"|"+me.source+"|"+(me===du?Ho:en).source+"|"+(c.evaluate||en).source+"|$","g"),Oe="//# sourceURL="+(ht.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ah+"]")+`
`;u.replace(Ie,function(Ke,ut,lt,_n,Wr,In){return lt||(lt=_n),Ee+=u.slice(ge,In).replace(Vo,hl),ut&&(Z=!0,Ee+=`' +
__e(`+ut+`) +
'`),Wr&&(ne=!0,Ee+=`';
`+Wr+`;
__p += '`),lt&&(Ee+=`' +
((__t = (`+lt+`)) == null ? '' : __t) +
'`),ge=In+Ke.length,Ke}),Ee+=`';
`;var Ve=ht.call(c,"variable")&&c.variable;if(!Ve)Ee=`with (obj) {
`+Ee+`
}
`;else if(Lo.test(Ve))throw new Ge(a);Ee=(ne?Ee.replace(zi,""):Ee).replace(uu,"$1").replace(ou,"$1;"),Ee="function("+(Ve||"obj")+`) {
`+(Ve?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(ne?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Ee+`return __p
}`;var rt=Tg(function(){return ct(U,Oe+"return "+Ee).apply(e,Y)});if(rt.source=Ee,Cp(rt))throw rt;return rt}function B5(u){return wt(u).toLowerCase()}function $5(u){return wt(u).toUpperCase()}function P5(u,c,v){if(u=wt(u),u&&(v||c===e))return rc(u);if(!u||!(c=Cn(c)))return u;var C=nn(u),T=nn(c),U=Cu(C,T),Y=ll(C,T)+1;return Ks(C,U,Y).join("")}function R5(u,c,v){if(u=wt(u),u&&(v||c===e))return u.slice(0,_u(u)+1);if(!u||!(c=Cn(c)))return u;var C=nn(u),T=ll(C,nn(c))+1;return Ks(C,0,T).join("")}function T5(u,c,v){if(u=wt(u),u&&(v||c===e))return u.replace(ma,"");if(!u||!(c=Cn(c)))return u;var C=nn(u),T=Cu(C,nn(c));return Ks(C,T).join("")}function x5(u,c){var v=F,C=P;if(Nt(c)){var T="separator"in c?c.separator:T;v="length"in c?et(c.length):v,C="omission"in c?Cn(c.omission):C}u=wt(u);var U=u.length;if(Xi(u)){var Y=nn(u);U=Y.length}if(v>=U)return u;var Z=v-Ji(C);if(Z<1)return C;var ne=Y?Ks(Y,0,Z).join(""):u.slice(0,Z);if(T===e)return ne+C;if(Y&&(Z+=ne.length-Z),Fp(T)){if(u.slice(Z).search(T)){var ge,me=ne;for(T.global||(T=Iu(T.source,wt(mi.exec(T))+"g")),T.lastIndex=0;ge=T.exec(me);)var Ee=ge.index;ne=ne.slice(0,Ee===e?Z:Ee)}}else if(u.indexOf(Cn(T),Z)!=Z){var Ie=ne.lastIndexOf(T);Ie>-1&&(ne=ne.slice(0,Ie))}return ne+C}function O5(u){return u=wt(u),u&&fu.test(u)?u.replace(cu,dl):u}var N5=Hu(function(u,c,v){return u+(v?" ":"")+c.toUpperCase()}),Dp=x1("toUpperCase");function Rg(u,c,v){return u=wt(u),c=v?e:c,c===e?Rh(u)?Nh(u):Qo(u):u.match(c)||[]}var Tg=it(function(u,c){try{return Kr(u,e,c)}catch(v){return Cp(v)?v:new Ge(v)}}),k5=ss(function(u,c){return rn(c,function(v){v=bi(v),ns(u,v,Sp(u[v],u))}),u});function L5(u){var c=u==null?0:u.length,v=je();return u=c?te(u,function(C){if(typeof C[1]!="function")throw new sn(i);return[v(C[0]),C[1]]}):[],it(function(C){for(var T=-1;++T<c;){var U=u[T];if(Kr(U[0],this,C))return Kr(U[1],this,C)}})}function U5(u){return ly(Vn(u,h))}function Bp(u){return function(){return u}}function H5(u,c){return u==null||u!==u?c:u}var j5=N1(),M5=N1(!0);function cn(u){return u}function $p(u){return h1(typeof u=="function"?u:Vn(u,h))}function q5(u){return d1(Vn(u,h))}function V5(u,c){return g1(u,Vn(c,h))}var K5=it(function(u,c){return function(v){return fc(v,u,c)}}),G5=it(function(u,c){return function(v){return fc(u,v,c)}});function Pp(u,c,v){var C=dr(c),T=_l(c,C);v==null&&!(Nt(c)&&(T.length||!C.length))&&(v=c,c=u,u=this,T=_l(c,dr(c)));var U=!(Nt(v)&&"chain"in v)||!!v.chain,Y=us(u);return rn(T,function(Z){var ne=c[Z];u[Z]=ne,Y&&(u.prototype[Z]=function(){var ge=this.__chain__;if(U||ge){var me=u(this.__wrapped__),Ee=me.__actions__=an(this.__actions__);return Ee.push({func:ne,args:arguments,thisArg:u}),me.__chain__=ge,me}return ne.apply(u,yn([this.value()],arguments))})}),u}function z5(){return er._===this&&(er._=jh),this}function Rp(){}function Y5(u){return u=et(u),it(function(c){return m1(c,u)})}var W5=cp(te),X5=cp(Ye),J5=cp(ul);function xg(u){return mp(u)?Wi(bi(u)):Iy(u)}function Z5(u){return function(c){return u==null?e:Pa(u,c)}}var Q5=L1(),e3=L1(!0);function Tp(){return[]}function xp(){return!1}function t3(){return{}}function r3(){return""}function n3(){return!0}function i3(u,c){if(u=et(u),u<1||u>X)return[];var v=ye,C=Tr(u,ye);c=je(c),u-=ye;for(var T=tc(C,c);++v<u;)c(v);return T}function s3(u){return We(u)?te(u,bi):Fn(u)?[u]:an(eg(wt(u)))}function a3(u){var c=++Uh;return wt(u)+c}var u3=Rl(function(u,c){return u+c},0),o3=lp("ceil"),c3=Rl(function(u,c){return u/c},1),l3=lp("floor");function f3(u){return u&&u.length?Fl(u,cn,Wh):e}function h3(u,c){return u&&u.length?Fl(u,je(c,2),Wh):e}function p3(u){return ec(u,cn)}function d3(u,c){return ec(u,je(c,2))}function g3(u){return u&&u.length?Fl(u,cn,Qh):e}function m3(u,c){return u&&u.length?Fl(u,je(c,2),Qh):e}var v3=Rl(function(u,c){return u*c},1),E3=lp("round"),A3=Rl(function(u,c){return u-c},0);function w3(u){return u&&u.length?bu(u,cn):0}function y3(u,c){return u&&u.length?bu(u,je(c,2)):0}return N.after=q6,N.ary=fg,N.assign=$S,N.assignIn=Fg,N.assignInWith=Kl,N.assignWith=PS,N.at=RS,N.before=hg,N.bind=Sp,N.bindAll=k5,N.bindKey=pg,N.castArray=tS,N.chain=og,N.chunk=l4,N.compact=f4,N.concat=h4,N.cond=L5,N.conforms=U5,N.constant=Bp,N.countBy=w6,N.create=TS,N.curry=dg,N.curryRight=gg,N.debounce=mg,N.defaults=xS,N.defaultsDeep=OS,N.defer=V6,N.delay=K6,N.difference=p4,N.differenceBy=d4,N.differenceWith=g4,N.drop=m4,N.dropRight=v4,N.dropRightWhile=E4,N.dropWhile=A4,N.fill=w4,N.filter=S6,N.flatMap=F6,N.flatMapDeep=_6,N.flatMapDepth=I6,N.flatten=ig,N.flattenDeep=y4,N.flattenDepth=S4,N.flip=G6,N.flow=j5,N.flowRight=M5,N.fromPairs=b4,N.functions=MS,N.functionsIn=qS,N.groupBy=D6,N.initial=F4,N.intersection=_4,N.intersectionBy=I4,N.intersectionWith=D4,N.invert=KS,N.invertBy=GS,N.invokeMap=$6,N.iteratee=$p,N.keyBy=P6,N.keys=dr,N.keysIn=on,N.map=Ul,N.mapKeys=YS,N.mapValues=WS,N.matches=q5,N.matchesProperty=V5,N.memoize=jl,N.merge=XS,N.mergeWith=_g,N.method=K5,N.methodOf=G5,N.mixin=Pp,N.negate=Ml,N.nthArg=Y5,N.omit=JS,N.omitBy=ZS,N.once=z6,N.orderBy=R6,N.over=W5,N.overArgs=Y6,N.overEvery=X5,N.overSome=J5,N.partial=bp,N.partialRight=vg,N.partition=T6,N.pick=QS,N.pickBy=Ig,N.property=xg,N.propertyOf=Z5,N.pull=R4,N.pullAll=ag,N.pullAllBy=T4,N.pullAllWith=x4,N.pullAt=O4,N.range=Q5,N.rangeRight=e3,N.rearg=W6,N.reject=N6,N.remove=N4,N.rest=X6,N.reverse=wp,N.sampleSize=L6,N.set=t5,N.setWith=r5,N.shuffle=U6,N.slice=k4,N.sortBy=M6,N.sortedUniq=V4,N.sortedUniqBy=K4,N.split=F5,N.spread=J6,N.tail=G4,N.take=z4,N.takeRight=Y4,N.takeRightWhile=W4,N.takeWhile=X4,N.tap=f6,N.throttle=Z6,N.thru=Ll,N.toArray=Sg,N.toPairs=Dg,N.toPairsIn=Bg,N.toPath=s3,N.toPlainObject=Cg,N.transform=n5,N.unary=Q6,N.union=J4,N.unionBy=Z4,N.unionWith=Q4,N.uniq=e6,N.uniqBy=t6,N.uniqWith=r6,N.unset=i5,N.unzip=yp,N.unzipWith=ug,N.update=s5,N.updateWith=a5,N.values=qu,N.valuesIn=u5,N.without=n6,N.words=Rg,N.wrap=eS,N.xor=i6,N.xorBy=s6,N.xorWith=a6,N.zip=u6,N.zipObject=o6,N.zipObjectDeep=c6,N.zipWith=l6,N.entries=Dg,N.entriesIn=Bg,N.extend=Fg,N.extendWith=Kl,Pp(N,N),N.add=u3,N.attempt=Tg,N.camelCase=f5,N.capitalize=$g,N.ceil=o3,N.clamp=o5,N.clone=rS,N.cloneDeep=iS,N.cloneDeepWith=sS,N.cloneWith=nS,N.conformsTo=aS,N.deburr=Pg,N.defaultTo=H5,N.divide=c3,N.endsWith=h5,N.eq=si,N.escape=p5,N.escapeRegExp=d5,N.every=y6,N.find=b6,N.findIndex=rg,N.findKey=NS,N.findLast=C6,N.findLastIndex=ng,N.findLastKey=kS,N.floor=l3,N.forEach=cg,N.forEachRight=lg,N.forIn=LS,N.forInRight=US,N.forOwn=HS,N.forOwnRight=jS,N.get=_p,N.gt=uS,N.gte=oS,N.has=VS,N.hasIn=Ip,N.head=sg,N.identity=cn,N.includes=B6,N.indexOf=C4,N.inRange=c5,N.invoke=zS,N.isArguments=xa,N.isArray=We,N.isArrayBuffer=cS,N.isArrayLike=un,N.isArrayLikeObject=Wt,N.isBoolean=lS,N.isBuffer=Gs,N.isDate=fS,N.isElement=hS,N.isEmpty=pS,N.isEqual=dS,N.isEqualWith=gS,N.isError=Cp,N.isFinite=mS,N.isFunction=us,N.isInteger=Eg,N.isLength=ql,N.isMap=Ag,N.isMatch=vS,N.isMatchWith=ES,N.isNaN=AS,N.isNative=wS,N.isNil=SS,N.isNull=yS,N.isNumber=wg,N.isObject=Nt,N.isObjectLike=qt,N.isPlainObject=vc,N.isRegExp=Fp,N.isSafeInteger=bS,N.isSet=yg,N.isString=Vl,N.isSymbol=Fn,N.isTypedArray=Mu,N.isUndefined=CS,N.isWeakMap=FS,N.isWeakSet=_S,N.join=B4,N.kebabCase=g5,N.last=Gn,N.lastIndexOf=$4,N.lowerCase=m5,N.lowerFirst=v5,N.lt=IS,N.lte=DS,N.max=f3,N.maxBy=h3,N.mean=p3,N.meanBy=d3,N.min=g3,N.minBy=m3,N.stubArray=Tp,N.stubFalse=xp,N.stubObject=t3,N.stubString=r3,N.stubTrue=n3,N.multiply=v3,N.nth=P4,N.noConflict=z5,N.noop=Rp,N.now=Hl,N.pad=E5,N.padEnd=A5,N.padStart=w5,N.parseInt=y5,N.random=l5,N.reduce=x6,N.reduceRight=O6,N.repeat=S5,N.replace=b5,N.result=e5,N.round=E3,N.runInContext=re,N.sample=k6,N.size=H6,N.snakeCase=C5,N.some=j6,N.sortedIndex=L4,N.sortedIndexBy=U4,N.sortedIndexOf=H4,N.sortedLastIndex=j4,N.sortedLastIndexBy=M4,N.sortedLastIndexOf=q4,N.startCase=_5,N.startsWith=I5,N.subtract=A3,N.sum=w3,N.sumBy=y3,N.template=D5,N.times=i3,N.toFinite=os,N.toInteger=et,N.toLength=bg,N.toLower=B5,N.toNumber=zn,N.toSafeInteger=BS,N.toString=wt,N.toUpper=$5,N.trim=P5,N.trimEnd=R5,N.trimStart=T5,N.truncate=x5,N.unescape=O5,N.uniqueId=a3,N.upperCase=N5,N.upperFirst=Dp,N.each=cg,N.eachRight=lg,N.first=sg,Pp(N,function(){var u={};return yi(N,function(c,v){ht.call(N.prototype,v)||(u[v]=c)}),u}(),{chain:!1}),N.VERSION=t,rn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){N[u].placeholder=N}),rn(["drop","take"],function(u,c){ot.prototype[u]=function(v){v=v===e?1:ir(et(v),0);var C=this.__filtered__&&!c?new ot(this):this.clone();return C.__filtered__?C.__takeCount__=Tr(v,C.__takeCount__):C.__views__.push({size:Tr(v,ye),type:u+(C.__dir__<0?"Right":"")}),C},ot.prototype[u+"Right"]=function(v){return this.reverse()[u](v).reverse()}}),rn(["filter","map","takeWhile"],function(u,c){var v=c+1,C=v==q||v==z;ot.prototype[u]=function(T){var U=this.clone();return U.__iteratees__.push({iteratee:je(T,3),type:v}),U.__filtered__=U.__filtered__||C,U}}),rn(["head","last"],function(u,c){var v="take"+(c?"Right":"");ot.prototype[u]=function(){return this[v](1).value()[0]}}),rn(["initial","tail"],function(u,c){var v="drop"+(c?"":"Right");ot.prototype[u]=function(){return this.__filtered__?new ot(this):this[v](1)}}),ot.prototype.compact=function(){return this.filter(cn)},ot.prototype.find=function(u){return this.filter(u).head()},ot.prototype.findLast=function(u){return this.reverse().find(u)},ot.prototype.invokeMap=it(function(u,c){return typeof u=="function"?new ot(this):this.map(function(v){return fc(v,u,c)})}),ot.prototype.reject=function(u){return this.filter(Ml(je(u)))},ot.prototype.slice=function(u,c){u=et(u);var v=this;return v.__filtered__&&(u>0||c<0)?new ot(v):(u<0?v=v.takeRight(-u):u&&(v=v.drop(u)),c!==e&&(c=et(c),v=c<0?v.dropRight(-c):v.take(c-u)),v)},ot.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},ot.prototype.toArray=function(){return this.take(ye)},yi(ot.prototype,function(u,c){var v=/^(?:filter|find|map|reject)|While$/.test(c),C=/^(?:head|last)$/.test(c),T=N[C?"take"+(c=="last"?"Right":""):c],U=C||/^find/.test(c);T&&(N.prototype[c]=function(){var Y=this.__wrapped__,Z=C?[1]:arguments,ne=Y instanceof ot,ge=Z[0],me=ne||We(Y),Ee=function(ut){var lt=T.apply(N,yn([ut],Z));return C&&Ie?lt[0]:lt};me&&v&&typeof ge=="function"&&ge.length!=1&&(ne=me=!1);var Ie=this.__chain__,Oe=!!this.__actions__.length,Ve=U&&!Ie,rt=ne&&!Oe;if(!U&&me){Y=rt?Y:new ot(this);var Ke=u.apply(Y,Z);return Ke.__actions__.push({func:Ll,args:[Ee],thisArg:e}),new qn(Ke,Ie)}return Ve&&rt?u.apply(this,Z):(Ke=this.thru(Ee),Ve?C?Ke.value()[0]:Ke.value():Ke)})}),rn(["pop","push","shift","sort","splice","unshift"],function(u){var c=Du[u],v=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",C=/^(?:pop|shift)$/.test(u);N.prototype[u]=function(){var T=arguments;if(C&&!this.__chain__){var U=this.value();return c.apply(We(U)?U:[],T)}return this[v](function(Y){return c.apply(We(Y)?Y:[],T)})}}),yi(ot.prototype,function(u,c){var v=N[c];if(v){var C=v.name+"";ht.call(ku,C)||(ku[C]=[]),ku[C].push({name:c,func:v})}}),ku[Pl(e,g).name]=[{name:"wrapper",func:e}],ot.prototype.clone=Ow,ot.prototype.reverse=Nw,ot.prototype.value=kw,N.prototype.at=h6,N.prototype.chain=p6,N.prototype.commit=d6,N.prototype.next=g6,N.prototype.plant=v6,N.prototype.reverse=E6,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=A6,N.prototype.first=N.prototype.head,Qi&&(N.prototype[Qi]=m6),N},Mn=kh();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(er._=Mn,define(function(){return Mn})):Yi?((Yi.exports=Mn)._=Mn,Xo._=Mn):er._=Mn}).call(yo)});var lh=we(($O,cA)=>{"use strict";var a$=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},S0=class e extends Error{constructor(t,r,n){super(t),a$(this,e.prototype),this.name="GrammarError",this.location=r,n===void 0&&(n=[]),this.diagnostics=n,this.stage=null,this.problems=[["error",t,r,n]]}toString(){let t=super.toString();this.location&&(t+=`
at `,this.location.source!==void 0&&this.location.source!==null&&(t+=`${this.location.source}:`),t+=`${this.location.start.line}:${this.location.start.column}`);for(let r of this.diagnostics)t+=`
from `,r.location.source!==void 0&&r.location.source!==null&&(t+=`${r.location.source}:`),t+=`${r.location.start.line}:${r.location.start.column}: ${r.message}`;return t}format(t){let r=t.map(({source:a,text:s})=>({source:a,text:s.split(/\r\n|\n|\r/g)}));function n(a,s,o=""){let l="",h=r.find(({source:E})=>E===a.source),d=a.start;if(h){let E=a.end,p=h.text[d.line-1],w=(d.line===E.line?E.column:p.length+1)-d.column||1;o&&(l+=`
note: ${o}`),l+=`
--> ${a.source}:${d.line}:${d.column}
${"".padEnd(s)} |
${d.line.toString().padStart(s)} | ${p}
${"".padEnd(s)} | ${"".padEnd(d.column-1)}${"".padEnd(w,"^")}`}else l+=`
at ${a.source}:${d.line}:${d.column}`,o&&(l+=`: ${o}`);return l}function i(a,s,o,l=[]){let h;o?h=l.reduce((E,{location:p})=>Math.max(E,p.start.line),o.start.line):h=Math.max.apply(null,l.map(E=>E.location.start.line)),h=h.toString().length;let d=`${a}: ${s}`;o&&(d+=n(o,h));for(let E of l)d+=n(E.location,h,E.message);return d}return this.problems.filter(a=>a[0]!=="info").map(a=>i(...a)).join(`
`)}};cA.exports=S0});var ti=we((PO,lA)=>{"use strict";var u$={build(e){function t(s,...o){return e[s.type](s,...o)}function r(){}function n(s,...o){return t(s.expression,...o)}function i(s){return function(o,...l){o[s].forEach(h=>t(h,...l))}}let a={grammar(s,...o){s.topLevelInitializer&&t(s.topLevelInitializer,...o),s.initializer&&t(s.initializer,...o),s.rules.forEach(l=>t(l,...o))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:i("alternatives"),action:n,sequence:i("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(a).forEach(s=>{Object.prototype.hasOwnProperty.call(e,s)||(e[s]=a[s])}),t}};lA.exports=u$});var sa=we((RO,hA)=>{"use strict";var o$=ti(),fA={findRule(e,t){for(let r=0;r<e.rules.length;r++)if(e.rules[r].name===t)return e.rules[r]},indexOfRule(e,t){for(let r=0;r<e.rules.length;r++)if(e.rules[r].name===t)return r;return-1},alwaysConsumesOnSuccess(e,t){function r(){return!0}function n(){return!1}let i=o$.build({choice(a){return a.alternatives.every(i)},sequence(a){return a.elements.some(i)},simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(a){let s=fA.findRule(e,a.name);return s?i(s):void 0},literal(a){return a.value!==""},class:r,any:r});return i(t)}};hA.exports=fA});var b0=we((TO,pA)=>{"use strict";var c$={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29};pA.exports=c$});var C0=we((xO,dA)=>{"use strict";var l$=ti(),f$=sa(),h$=lh(),Gc=1,au=0,zc=-1;function fh(e){function t(s){return s.match=au}function r(s){return a(s.expression),s.match=Gc}function n(s){return s.match=a(s.expression)}function i(s,o){let l=s.length,h=0,d=0;for(let E=0;E<l;++E){let p=a(s[E]);p===Gc&&++h,p===zc&&++d}return h===l?Gc:o?d===l?zc:au:d>0?zc:au}let a=l$.build({rule(s){let o,l=0;if(typeof s.match>"u"){s.match=au;do if(o=s.match,s.match=a(s.expression),++l>6)throw new h$("Infinity cycle detected when trying to evaluate node match result",s.location);while(o!==s.match)}return s.match},named:n,choice(s){return s.match=i(s.alternatives,!0)},action:n,sequence(s){return s.match=i(s.elements,!1)},labeled:n,text:n,simple_and:n,simple_not(s){return s.match=-a(s.expression)},optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:t,semantic_not:t,rule_ref(s){let o=f$.findRule(e,s.name);return s.match=a(o)},literal(s){let o=s.value.length===0?Gc:au;return s.match=o},class(s){let o=s.parts.length===0?zc:au;return s.match=o},any:t});a(e)}fh.ALWAYS_MATCH=Gc;fh.SOMETIMES_MATCH=au;fh.NEVER_MATCH=zc;dA.exports=fh});var mA=we((OO,gA)=>{"use strict";var p$=sa(),Be=b0(),d$=ti(),{ALWAYS_MATCH:Co,SOMETIMES_MATCH:F0,NEVER_MATCH:_0}=C0();function g$(e){let t=[],r=[],n=[],i=[];function a(S){let _=t.indexOf(S);return _===-1?t.push(S)-1:_}function s(S){let _={value:S.parts,inverted:S.inverted,ignoreCase:S.ignoreCase},I=JSON.stringify(_),D=r.findIndex(H=>JSON.stringify(H)===I);return D===-1?r.push(_)-1:D}function o(S){let _=JSON.stringify(S),I=n.findIndex(D=>JSON.stringify(D)===_);return I===-1?n.push(S)-1:I}function l(S,_,I){let D={predicate:S,params:_,body:I.code,location:I.codeLocation},H=JSON.stringify(D),V=i.findIndex(F=>JSON.stringify(F)===H);return V===-1?i.push(D)-1:V}function h(S){let _={};return Object.keys(S).forEach(I=>{_[I]=S[I]}),_}function d(S,..._){return S.concat(..._)}function E(S,_,I,D){return S===Co?I:S===_0?D:_.concat([I.length,D.length],I,D)}function p(S,_){return S.concat([_.length],_)}function f(S,_,I,D){let H=Object.keys(I).map(V=>D-I[V]);return[Be.CALL,S,_,H.length].concat(H)}function w(S,_,I){let D=S.match|0;return d([Be.PUSH_CURR_POS],[Be.SILENT_FAILS_ON],A(S,{sp:I.sp+1,env:h(I.env),action:null}),[Be.SILENT_FAILS_OFF],E(_?-D:D,[_?Be.IF_ERROR:Be.IF_NOT_ERROR],d([Be.POP],[_?Be.POP:Be.POP_CURR_POS],[Be.PUSH_UNDEFINED]),d([Be.POP],[_?Be.POP_CURR_POS:Be.POP],[Be.PUSH_FAILED])))}function g(S,_,I){let D=l(!0,Object.keys(I.env),S);return d([Be.UPDATE_SAVED_POS],f(D,0,I.env,I.sp),E(S.match|0,[Be.IF],d([Be.POP],_?[Be.PUSH_FAILED]:[Be.PUSH_UNDEFINED]),d([Be.POP],_?[Be.PUSH_UNDEFINED]:[Be.PUSH_FAILED])))}function y(S){return p([Be.WHILE_NOT_ERROR],d([Be.APPEND],S))}let A=d$.build({grammar(S){S.rules.forEach(A),S.literals=t,S.classes=r,S.expectations=n,S.functions=i},rule(S){S.bytecode=A(S.expression,{sp:-1,env:{},pluck:[],action:null})},named(S,_){let I=S.match|0,D=I===_0?null:o({type:"rule",value:S.name});return d([Be.SILENT_FAILS_ON],A(S.expression,_),[Be.SILENT_FAILS_OFF],E(I,[Be.IF_ERROR],[Be.FAIL,D],[]))},choice(S,_){function I(D,H){let V=D[0].match|0,F=A(D[0],{sp:H.sp,env:h(H.env),action:null});return V===Co?F:d(F,D.length>1?E(F0,[Be.IF_ERROR],d([Be.POP],I(D.slice(1),H)),[]):[])}return I(S.alternatives,_)},action(S,_){let I=h(_.env),D=S.expression.type!=="sequence"||S.expression.elements.length===0,H=A(S.expression,{sp:_.sp+(D?1:0),env:I,action:S}),V=S.expression.match|0,F=D&&V!==_0?l(!1,Object.keys(I),S):null;return D?d([Be.PUSH_CURR_POS],H,E(V,[Be.IF_NOT_ERROR],d([Be.LOAD_SAVED_POS,1],f(F,1,I,_.sp+2)),[]),[Be.NIP]):H},sequence(S,_){function I(D,H){if(D.length>0){let V=S.elements.length-D.length+1;return d(A(D[0],{sp:H.sp,env:H.env,pluck:H.pluck,action:null}),E(D[0].match|0,[Be.IF_NOT_ERROR],I(D.slice(1),{sp:H.sp+1,env:H.env,pluck:H.pluck,action:H.action}),d(V>1?[Be.POP_N,V]:[Be.POP],[Be.POP_CURR_POS],[Be.PUSH_FAILED])))}else{if(H.pluck.length>0)return d([Be.PLUCK,S.elements.length+1,H.pluck.length],H.pluck.map(V=>H.sp-V));if(H.action){let V=l(!1,Object.keys(H.env),H.action);return d([Be.LOAD_SAVED_POS,S.elements.length],f(V,S.elements.length+1,H.env,H.sp))}else return d([Be.WRAP,S.elements.length],[Be.NIP])}}return d([Be.PUSH_CURR_POS],I(S.elements,{sp:_.sp+1,env:_.env,pluck:[],action:_.action}))},labeled(S,_){let I=_.env,D=S.label,H=_.sp+1;return D&&(I=h(_.env),_.env[S.label]=H),S.pick&&_.pluck.push(H),A(S.expression,{sp:_.sp,env:I,action:null})},text(S,_){return d([Be.PUSH_CURR_POS],A(S.expression,{sp:_.sp+1,env:h(_.env),action:null}),E(S.match|0,[Be.IF_NOT_ERROR],d([Be.POP],[Be.TEXT]),[Be.NIP]))},simple_and(S,_){return w(S.expression,!1,_)},simple_not(S,_){return w(S.expression,!0,_)},optional(S,_){return d(A(S.expression,{sp:_.sp,env:h(_.env),action:null}),E(-(S.expression.match|0),[Be.IF_ERROR],d([Be.POP],[Be.PUSH_NULL]),[]))},zero_or_more(S,_){let I=A(S.expression,{sp:_.sp+1,env:h(_.env),action:null});return d([Be.PUSH_EMPTY_ARRAY],I,y(I),[Be.POP])},one_or_more(S,_){let I=A(S.expression,{sp:_.sp+1,env:h(_.env),action:null});return d([Be.PUSH_EMPTY_ARRAY],I,E(S.expression.match|0,[Be.IF_NOT_ERROR],d(y(I),[Be.POP]),d([Be.POP],[Be.POP],[Be.PUSH_FAILED])))},group(S,_){return A(S.expression,{sp:_.sp,env:h(_.env),action:null})},semantic_and(S,_){return g(S,!1,_)},semantic_not(S,_){return g(S,!0,_)},rule_ref(S){return[Be.RULE,p$.indexOfRule(e,S.name)]},literal(S){if(S.value.length>0){let _=S.match|0,D=_===F0||_===Co&&!S.ignoreCase?a(S.ignoreCase?S.value.toLowerCase():S.value):null,H=_!==Co?o({type:"literal",value:S.value,ignoreCase:S.ignoreCase}):null;return E(_,S.ignoreCase?[Be.MATCH_STRING_IC,D]:[Be.MATCH_STRING,D],S.ignoreCase?[Be.ACCEPT_N,S.value.length]:[Be.ACCEPT_STRING,D],[Be.FAIL,H])}return[Be.PUSH_EMPTY_STRING]},class(S){let _=S.match|0,I=_===F0?s(S):null,D=_!==Co?o({type:"class",value:S.parts,inverted:S.inverted,ignoreCase:S.ignoreCase}):null;return E(_,[Be.MATCH_CHAR_CLASS,I],[Be.ACCEPT_N,1],[Be.FAIL,D])},any(S){let _=S.match|0,I=_!==Co?o({type:"any"}):null;return E(_,[Be.MATCH_ANY],[Be.ACCEPT_N,1],[Be.FAIL,I])}});A(e)}gA.exports=g$});var EA=we((NO,vA)=>{"use strict";var I0=class{constructor(t,r,n){this.sp=-1,this.maxSp=-1,this.varName=r,this.ruleName=t,this.type=n}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}<x>' at an index ${t}`);return this.varName+t}push(t){let r=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),r}pop(t){return t!==void 0?(this.sp-=t,Array.from({length:t},(r,n)=>this.name(this.sp+1+n))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,r)=>this.name(r)).join(", ")+";"}checkedIf(t,r,n){let i=this.sp;if(r(),n){let a=this.sp;if(this.sp=i,n(),a!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+i+", after then: "+a+", after else: "+this.sp+").")}}checkedLoop(t,r){let n=this.sp;if(r(),n!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+n+", after: "+this.sp+").")}};vA.exports=I0});var D0=we((kO,AA)=>{"use strict";AA.exports="2.0.1"});var wA=we(hh=>{"use strict";function Ts(e){return e.charCodeAt(0).toString(16).toUpperCase()}hh.hex=Ts;function m$(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+Ts(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+Ts(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+Ts(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+Ts(t))}hh.stringEscape=m$;function v$(e){return e.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+Ts(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+Ts(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+Ts(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+Ts(t))}hh.regexpClassEscape=v$});var bA=we(SA=>{var yA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");SA.encode=function(e){if(0<=e&&e<yA.length)return yA[e];throw new TypeError("Must be between 0 and 63: "+e)}});var IA=we(_A=>{var E$=bA(),CA=5,FA=1<<CA,A$=FA-1,w$=FA;function y$(e){return e<0?(-e<<1)+1:(e<<1)+0}_A.encode=function(t){let r="",n,i=y$(t);do n=i&A$,i>>>=CA,i>0&&(n|=w$),r+=E$.encode(n);while(i>0);return r}});var dh=we(oa=>{function S$(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}oa.getArg=S$;var BA=function(){return!("__proto__"in Object.create(null))}();function $A(e){return e}function b$(e){return PA(e)?"$"+e:e}oa.toSetString=BA?$A:b$;function C$(e){return PA(e)?e.slice(1):e}oa.fromSetString=BA?$A:C$;function PA(e){if(!e)return!1;let t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(let r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function DA(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function F$(e,t){let r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=DA(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:DA(e.name,t.name)}oa.compareByGeneratedPositionsInflated=F$;var B0="http:",Yc=`${B0}//host`;function RA(e){return t=>{let r=Wc(t),n=$0(t),i=new URL(t,n);e(i);let a=i.toString();return r==="absolute"?a:r==="scheme-relative"?a.slice(B0.length):r==="path-absolute"?a.slice(Yc.length):P0(n,a)}}function aa(e,t){return new URL(e,t).toString()}function _$(e,t){let r=0;do{let n=e+r++;if(t.indexOf(n)===-1)return n}while(!0)}function $0(e){let t=e.split("..").length-1,r=_$("p",e),n=`${Yc}/`;for(let i=0;i<t;i++)n+=`${r}/`;return n}var I$=/^[A-Za-z0-9\+\-\.]+:/;function Wc(e){return e[0]==="/"?e[1]==="/"?"scheme-relative":"path-absolute":I$.test(e)?"absolute":"path-relative"}function P0(e,t){typeof e=="string"&&(e=new URL(e)),typeof t=="string"&&(t=new URL(t));let r=t.pathname.split("/"),n=e.pathname.split("/");for(n.length>0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+t.search+t.hash}var D$=RA(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),ph=RA(e=>{});oa.normalize=ph;function B$(e,t){let r=Wc(t),n=Wc(e);if(e=D$(e),r==="absolute")return aa(t,void 0);if(n==="absolute")return aa(t,e);if(r==="scheme-relative")return ph(t);if(n==="scheme-relative")return aa(t,aa(e,Yc)).slice(B0.length);if(r==="path-absolute")return ph(t);if(n==="path-absolute")return aa(t,aa(e,Yc)).slice(Yc.length);let i=$0(t+e),a=aa(t,aa(e,i));return P0(i,a)}oa.join=B$;function $$(e,t){let r=P$(e,t);return typeof r=="string"?r:ph(t)}oa.relative=$$;function P$(e,t){if(Wc(e)!==Wc(t))return null;let n=$0(e+t),i=new URL(e,n),a=new URL(t,n);try{new URL("",a.toString())}catch{return null}return a.protocol!==i.protocol||a.user!==i.user||a.password!==i.password||a.hostname!==i.hostname||a.port!==i.port?null:P0(i,a)}});var xA=we(TA=>{var R0=class e{constructor(){this._array=[],this._set=new Map}static fromArray(t,r){let n=new e;for(let i=0,a=t.length;i<a;i++)n.add(t[i],r);return n}size(){return this._set.size}add(t,r){let n=this.has(t),i=this._array.length;(!n||r)&&this._array.push(t),n||this._set.set(t,i)}has(t){return this._set.has(t)}indexOf(t){let r=this._set.get(t);if(r>=0)return r;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)}toArray(){return this._array.slice()}};TA.ArraySet=R0});var kA=we(NA=>{var OA=dh();function R$(e,t){let r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,a=t.generatedColumn;return n>r||n==r&&a>=i||OA.compareByGeneratedPositionsInflated(e,t)<=0}var T0=class{constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(t,r){this._array.forEach(t,r)}add(t){R$(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(OA.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}};NA.MappingList=T0});var x0=we(LA=>{var Xc=IA(),nr=dh(),gh=xA().ArraySet,T$=kA().MappingList,mh=class e{constructor(t){t||(t={}),this._file=nr.getArg(t,"file",null),this._sourceRoot=nr.getArg(t,"sourceRoot",null),this._skipValidation=nr.getArg(t,"skipValidation",!1),this._sources=new gh,this._names=new gh,this._mappings=new T$,this._sourcesContents=null}static fromSourceMap(t){let r=t.sourceRoot,n=new e({file:t.file,sourceRoot:r});return t.eachMapping(function(i){let a={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(a.source=i.source,r!=null&&(a.source=nr.relative(r,a.source)),a.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(a.name=i.name)),n.addMapping(a)}),t.sources.forEach(function(i){let a=i;r!=null&&(a=nr.relative(r,i)),n._sources.has(a)||n._sources.add(a);let s=t.sourceContentFor(i);s!=null&&n.setSourceContent(i,s)}),n}addMapping(t){let r=nr.getArg(t,"generated"),n=nr.getArg(t,"original",null),i=nr.getArg(t,"source",null),a=nr.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,i,a),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n&&n.line,originalColumn:n&&n.column,source:i,name:a})}setSourceContent(t,r){let n=t;this._sourceRoot!=null&&(n=nr.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[nr.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[nr.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}applySourceMap(t,r,n){let i=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=t.file}let a=this._sourceRoot;a!=null&&(i=nr.relative(a,i));let s=this._mappings.toArray().length>0?new gh:this._sources,o=new gh;this._mappings.unsortedForEach(function(l){if(l.source===i&&l.originalLine!=null){let E=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});E.source!=null&&(l.source=E.source,n!=null&&(l.source=nr.join(n,l.source)),a!=null&&(l.source=nr.relative(a,l.source)),l.originalLine=E.line,l.originalColumn=E.column,E.name!=null&&(l.name=E.name))}let h=l.source;h!=null&&!s.has(h)&&s.add(h);let d=l.name;d!=null&&!o.has(d)&&o.add(d)},this),this._sources=s,this._names=o,t.sources.forEach(function(l){let h=t.sourceContentFor(l);h!=null&&(n!=null&&(l=nr.join(n,l)),a!=null&&(l=nr.relative(a,l)),this.setSourceContent(l,h))},this)}_validateMapping(t,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!i)){if(!(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:i}))}}_serializeMappings(){let t=0,r=1,n=0,i=0,a=0,s=0,o="",l,h,d,E,p=this._mappings.toArray();for(let f=0,w=p.length;f<w;f++){if(h=p[f],l="",h.generatedLine!==r)for(t=0;h.generatedLine!==r;)l+=";",r++;else if(f>0){if(!nr.compareByGeneratedPositionsInflated(h,p[f-1]))continue;l+=","}l+=Xc.encode(h.generatedColumn-t),t=h.generatedColumn,h.source!=null&&(E=this._sources.indexOf(h.source),l+=Xc.encode(E-s),s=E,l+=Xc.encode(h.originalLine-1-i),i=h.originalLine-1,l+=Xc.encode(h.originalColumn-n),n=h.originalColumn,h.name!=null&&(d=this._names.indexOf(h.name),l+=Xc.encode(d-a),a=d)),o+=l}return o}_generateSourcesContent(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=nr.relative(r,n));let i=nr.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)}toJSON(){let t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}};mh.prototype._version=3;LA.SourceMapGenerator=mh});var HA=we(UA=>{var x$=x0().SourceMapGenerator,vh=dh(),O$=/(\r?\n)/,N$=10,Fo="$$$isSourceNode$$$",O0=class e{constructor(t,r,n,i,a){this.children=[],this.sourceContents={},this.line=t??null,this.column=r??null,this.source=n??null,this.name=a??null,this[Fo]=!0,i!=null&&this.add(i)}static fromStringWithSourceMap(t,r,n){let i=new e,a=t.split(O$),s=0,o=function(){let f=g(),w=g()||"";return f+w;function g(){return s<a.length?a[s++]:void 0}},l=1,h=0,d=null,E;return r.eachMapping(function(f){if(d!==null)if(l<f.generatedLine)p(d,o()),l++,h=0;else{E=a[s]||"";let w=E.substr(0,f.generatedColumn-h);a[s]=E.substr(f.generatedColumn-h),h=f.generatedColumn,p(d,w),d=f;return}for(;l<f.generatedLine;)i.add(o()),l++;h<f.generatedColumn&&(E=a[s]||"",i.add(E.substr(0,f.generatedColumn)),a[s]=E.substr(f.generatedColumn),h=f.generatedColumn),d=f},this),s<a.length&&(d&&p(d,o()),i.add(a.splice(s).join(""))),r.sources.forEach(function(f){let w=r.sourceContentFor(f);w!=null&&(n!=null&&(f=vh.join(n,f)),i.setSourceContent(f,w))}),i;function p(f,w){if(f===null||f.source===void 0)i.add(w);else{let g=n?vh.join(n,f.source):f.source;i.add(new e(f.originalLine,f.originalColumn,g,w,f.name))}}}add(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Fo]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}prepend(t){if(Array.isArray(t))for(let r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Fo]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}walk(t){let r;for(let n=0,i=this.children.length;n<i;n++)r=this.children[n],r[Fo]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})}join(t){let r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this}replaceRight(t,r){let n=this.children[this.children.length-1];return n[Fo]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this}setSourceContent(t,r){this.sourceContents[vh.toSetString(t)]=r}walkSourceContents(t){for(let n=0,i=this.children.length;n<i;n++)this.children[n][Fo]&&this.children[n].walkSourceContents(t);let r=Object.keys(this.sourceContents);for(let n=0,i=r.length;n<i;n++)t(vh.fromSetString(r[n]),this.sourceContents[r[n]])}toString(){let t="";return this.walk(function(r){t+=r}),t}toStringWithSourceMap(t){let r={code:"",line:1,column:0},n=new x$(t),i=!1,a=null,s=null,o=null,l=null;return this.walk(function(h,d){r.code+=h,d.source!==null&&d.line!==null&&d.column!==null?((a!==d.source||s!==d.line||o!==d.column||l!==d.name)&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name}),a=d.source,s=d.line,o=d.column,l=d.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),a=null,i=!1);for(let E=0,p=h.length;E<p;E++)h.charCodeAt(E)===N$?(r.line++,r.column=0,E+1===p?(a=null,i=!1):i&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name})):r.column++}),this.walkSourceContents(function(h,d){n.setSourceContent(h,d)}),{code:r.code,map:n}}};UA.SourceNode=O0});var jA=we(N0=>{N0.SourceMapGenerator=x0().SourceMapGenerator;N0.SourceNode=HA().SourceNode});var KA=we((zO,VA)=>{"use strict";var k$=sa(),At=b0(),L$=EA(),U$=D0(),{stringEscape:kn,regexpClassEscape:k0}=wA(),{SourceNode:ri}=jA();function qA(e,t,r){let n=t.start.line,i=t.start.column-1,a=e.split(`
`);return a.length===1?new ri(n,i,t.source,e,r):new ri(null,null,t.source,a.map((s,o)=>new ri(n+o,o===0?i:0,t.source,o===a.length-1?s:[s,`
`],r)))}function MA(e,t,r,n,i){return r?new ri(null,null,r.source,[e,qA(t,r,i),new ri(r.end.line,r.end.column-1,r.source,n)]):new ri(null,null,null,[e,t,n])}function H$(e,t){function r(g){return g instanceof ri?g:g.replace(/^(.+)$/gm," $1")}function n(g){return"peg$c"+g}function i(g){return"peg$r"+g}function a(g){return"peg$e"+g}function s(g){return"peg$f"+g}function o(g){return"peg$parse"+g}function l(){function g(_){return'"'+kn(_)+'"'}function y(_){return"/^["+(_.inverted?"^":"")+_.value.map(I=>Array.isArray(I)?k0(I[0])+"-"+k0(I[1]):k0(I)).join("")+"]/"+(_.ignoreCase?"i":"")}function A(_){switch(_.type){case"rule":return'peg$otherExpectation("'+kn(_.value)+'")';case"literal":return'peg$literalExpectation("'+kn(_.value)+'", '+_.ignoreCase+")";case"class":return"peg$classExpectation(["+_.value.map(D=>Array.isArray(D)?'["'+kn(D[0])+'", "'+kn(D[1])+'"]':'"'+kn(D)+'"').join(", ")+"], "+_.inverted+", "+_.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(_)+")")}}function S(_,I){return MA(`
var ${s(I)} = function(${_.params.join(", ")}) {`,_.body,_.location,"};")}return new ri(null,null,t.grammarSource,[e.literals.map((_,I)=>" var "+n(I)+" = "+g(_)+";").concat("",e.classes.map((_,I)=>" var "+i(I)+" = "+y(_)+";")).concat("",e.expectations.map((_,I)=>" var "+a(I)+" = "+A(_)+";")).concat("").join(`
`),e.functions.map(S)])}function h(g,y){let A=[];return A.push(""),t.trace&&A.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+g+","," location: peg$computeLocation(startPos, startPos)","});",""),t.cache&&(A.push("var key = peg$currPos * "+e.rules.length+" + "+y+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),t.trace&&A.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+g+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+g+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),A.push(" return cached.result;","}","")),A}function d(g,y){let A=[];return t.cache&&A.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+y+" };"),t.trace&&A.push("","if ("+y+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+g+","," result: "+y+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+g+","," location: peg$computeLocation(startPos, startPos)"," });","}"),A.push("","return "+y+";"),A}function E(g){let y=[],A=new L$(g.name,"s","var");function S(I){let D=0,H=I.length,V=[],F;function P(q,J){let z=J+3,K=I[D+z-2],X=I[D+z-1],ie,be;A.checkedIf(D,()=>{D+=z,ie=S(I.slice(D,D+K)),D+=K},X>0?()=>{be=S(I.slice(D,D+X)),D+=X}:null),V.push("if ("+q+") {"),V.push(...ie.map(r)),X>0&&(V.push("} else {"),V.push(...be.map(r))),V.push("}")}function k(q){let z=I[D+2-1],K;A.checkedLoop(D,()=>{D+=2,K=S(I.slice(D,D+z)),D+=z}),V.push("while ("+q+") {"),V.push(...K.map(r)),V.push("}")}function L(){let J=I[D+4-1],z=s(I[D+1])+"("+I.slice(D+4,D+4+J).map(K=>A.index(K)).join(", ")+")";A.pop(I[D+2]),V.push(A.push(z)),D+=4+J}for(;D<H;)switch(I[D]){case At.PUSH_EMPTY_STRING:V.push(A.push("''")),D++;break;case At.PUSH_CURR_POS:V.push(A.push("peg$currPos")),D++;break;case At.PUSH_UNDEFINED:V.push(A.push("undefined")),D++;break;case At.PUSH_NULL:V.push(A.push("null")),D++;break;case At.PUSH_FAILED:V.push(A.push("peg$FAILED")),D++;break;case At.PUSH_EMPTY_ARRAY:V.push(A.push("[]")),D++;break;case At.POP:A.pop(),D++;break;case At.POP_CURR_POS:V.push("peg$currPos = "+A.pop()+";"),D++;break;case At.POP_N:A.pop(I[D+1]),D+=2;break;case At.NIP:F=A.pop(),A.pop(),V.push(A.push(F)),D++;break;case At.APPEND:F=A.pop(),V.push(A.top()+".push("+F+");"),D++;break;case At.WRAP:V.push(A.push("["+A.pop(I[D+1]).join(", ")+"]")),D+=2;break;case At.TEXT:V.push(A.push("input.substring("+A.pop()+", peg$currPos)")),D++;break;case At.PLUCK:{let J=I[D+3-1],z=3+J;F=I.slice(D+3,D+z),F=J===1?A.index(F[0]):`[ ${F.map(K=>A.index(K)).join(", ")} ]`,A.pop(I[D+1]),V.push(A.push(F)),D+=z;break}case At.IF:P(A.top(),0);break;case At.IF_ERROR:P(A.top()+" === peg$FAILED",0);break;case At.IF_NOT_ERROR:P(A.top()+" !== peg$FAILED",0);break;case At.WHILE_NOT_ERROR:k(A.top()+" !== peg$FAILED");break;case At.MATCH_ANY:P("input.length > peg$currPos",0);break;case At.MATCH_STRING:P(e.literals[I[D+1]].length>1?"input.substr(peg$currPos, "+e.literals[I[D+1]].length+") === "+n(I[D+1]):"input.charCodeAt(peg$currPos) === "+e.literals[I[D+1]].charCodeAt(0),1);break;case At.MATCH_STRING_IC:P("input.substr(peg$currPos, "+e.literals[I[D+1]].length+").toLowerCase() === "+n(I[D+1]),1);break;case At.MATCH_CHAR_CLASS:P(i(I[D+1])+".test(input.charAt(peg$currPos))",1);break;case At.ACCEPT_N:V.push(A.push(I[D+1]>1?"input.substr(peg$currPos, "+I[D+1]+")":"input.charAt(peg$currPos)")),V.push(I[D+1]>1?"peg$currPos += "+I[D+1]+";":"peg$currPos++;"),D+=2;break;case At.ACCEPT_STRING:V.push(A.push(n(I[D+1]))),V.push(e.literals[I[D+1]].length>1?"peg$currPos += "+e.literals[I[D+1]].length+";":"peg$currPos++;"),D+=2;break;case At.FAIL:V.push(A.push("peg$FAILED")),V.push("if (peg$silentFails === 0) { peg$fail("+a(I[D+1])+"); }"),D+=2;break;case At.LOAD_SAVED_POS:V.push("peg$savedPos = "+A.index(I[D+1])+";"),D+=2;break;case At.UPDATE_SAVED_POS:V.push("peg$savedPos = peg$currPos;"),D++;break;case At.CALL:L();break;case At.RULE:V.push(A.push(o(e.rules[I[D+1]].name)+"()")),D+=2;break;case At.SILENT_FAILS_ON:V.push("peg$silentFails++;"),D++;break;case At.SILENT_FAILS_OFF:V.push("peg$silentFails--;"),D++;break;default:throw new Error("Invalid opcode: "+I[D]+".")}return V}let _=S(g.bytecode);return y.push(MA(" function ",o(g.name),g.nameLocation,`() {
`,g.name)),t.trace&&y.push(" var startPos = peg$currPos;"),y.push(r(A.defines())),y.push(...h('"'+kn(g.name)+'"',k$.indexOfRule(e,g.name)).map(r)),y.push(..._.map(r)),y.push(...d('"'+kn(g.name)+'"',A.result()).map(r)),y.push("}"),y}function p(g){return g.codeLocation?qA(g.code,g.codeLocation,"$"+g.type):g.code}function f(){let g=[];e.topLevelInitializer&&(g.push(p(e.topLevelInitializer)),g.push("")),g.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;",` var filler = peg$padEnd("", s.line.toString().length, ' ');`," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --> " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',` + filler + " | " + peg$padEnd("", s.column - 1, ' ')`,' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),t.trace&&g.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");let y="{ "+t.allowedStartRules.map(S=>S+": "+o(S)).join(", ")+" }",A=o(t.allowedStartRules[0]);return g.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+y+";"," var peg$startRuleFunction = "+A+";","",l(),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),t.cache&&g.push(" var peg$resultsCache = {};",""),t.trace&&g.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),g.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",` throw new Error("Can't start parsing from rule \\"" + options.startRule + "\\".");`," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),e.rules.forEach(S=>{g.push(...E(S).map(r)),g.push("")}),e.initializer&&(g.push(p(e.initializer)),g.push("")),g.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new ri(null,null,t.grammarSource,g.map(S=>S instanceof ri?S:S+`
`))}function w(g){function y(){return[`// Generated by Peggy ${U$}.`,"//","// https://peggyjs.org/"]}function A(){return t.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join(`
`):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join(`
`)}let _={bare(){return[...y(),"(function() {",' "use strict";',"",g,"",r("return "+A()+";"),"})()"]},commonjs(){let I=Object.keys(t.dependencies),D=y();return D.push("",'"use strict";',""),I.length>0&&(I.forEach(H=>{D.push("var "+H+' = require("'+kn(t.dependencies[H])+'");')}),D.push("")),D.push(g,"","module.exports = "+A()+";"),D},es(){let I=Object.keys(t.dependencies),D=y();return D.push(""),I.length>0&&(I.forEach(H=>{D.push("import "+H+' from "'+kn(t.dependencies[H])+'";')}),D.push("")),D.push(g,"","export {"," peg$SyntaxError as SyntaxError,",t.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),D},amd(){let I=Object.keys(t.dependencies),H="["+I.map(F=>t.dependencies[F]).map(F=>'"'+kn(F)+'"').join(", ")+"]",V=I.join(", ");return[...y(),"define("+H+", function("+V+") {",' "use strict";',"",g,"",r("return "+A()+";"),"});"]},globals(){return[...y(),"(function(root) {",' "use strict";',"",g,"",r("root."+t.exportVar+" = "+A()+";"),"})(this);"]},umd(){let I=Object.keys(t.dependencies),D=I.map(k=>t.dependencies[k]),H="["+D.map(k=>'"'+kn(k)+'"').join(", ")+"]",V=D.map(k=>'require("'+kn(k)+'")').join(", "),F=I.join(", "),P=y();return P.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+H+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+V+");"),t.exportVar!==null&&P.push(" } else {"," root."+t.exportVar+" = factory();"),P.push(" }","})(this, function("+F+") {",' "use strict";',"",g,"",r("return "+A()+";"),"});"),P}}[t.format]();return new ri(null,null,t.grammarSource,_.map(I=>I instanceof ri?I:I+`
`))}e.code=w(f())}VA.exports=H$});var zA=we((YO,GA)=>{"use strict";var j$=sa(),M$=ti();function q$(e,t,r){function n(s){return s.type==="rule"&&s.expression.type==="rule_ref"}function i(s,o,l){M$.build({rule_ref(d){d.name===o&&(d.name=l,r.info(`Proxy rule "${o}" replaced by the rule "${l}"`,d.location,[{message:"This rule will be used",location:j$.findRule(s,l).nameLocation}]))}})(s)}let a=[];e.rules.forEach((s,o)=>{n(s)&&(i(e,s.name,s.expression.name),t.allowedStartRules.indexOf(s.name)===-1&&a.push(o))}),a.reverse(),a.forEach(s=>{e.rules.splice(s,1)})}GA.exports=q$});var WA=we((WO,YA)=>{"use strict";var V$=ti();function K$(e,t,r){function n(s){let o={};return Object.keys(s).forEach(l=>{o[l]=s[l]}),o}function i(s,o){a(s.expression,n(o))}let a=V$.build({rule(s){a(s.expression,{})},choice(s,o){s.alternatives.forEach(l=>{a(l,n(o))})},action:i,labeled(s,o){let l=s.label;l&&Object.prototype.hasOwnProperty.call(o,l)&&r.error(`Label "${s.label}" is already defined`,s.labelLocation,[{message:"Original label location",location:o[l]}]),a(s.expression,o),o[s.label]=s.labelLocation},text:i,simple_and:i,simple_not:i,optional:i,zero_or_more:i,one_or_more:i,group:i});a(e)}YA.exports=K$});var JA=we((XO,XA)=>{"use strict";var G$=ti();function z$(e,t,r){let n={};G$.build({rule(a){if(Object.prototype.hasOwnProperty.call(n,a.name)){r.error(`Rule "${a.name}" is already defined`,a.nameLocation,[{message:"Original rule location",location:n[a.name]}]);return}n[a.name]=a.nameLocation}})(e)}XA.exports=z$});var ew=we((JO,QA)=>{"use strict";var ZA=sa(),Y$=ti();function W$(e,t,r){let n=[],i=[],a=Y$.build({rule(s){n.push(s.name),a(s.expression),n.pop()},sequence(s){s.elements.every(o=>(a(o),!ZA.alwaysConsumesOnSuccess(e,o)))},rule_ref(s){i.push(s);let o=ZA.findRule(e,s.name);if(n.indexOf(s.name)!==-1){n.push(s.name),r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",o.nameLocation,i.map((l,h,d)=>({message:h+1!==d.length?`Step ${h+1}: call of the rule "${l.name}" without input consumption`:`Step ${h+1}: call itself without input consumption - left recursion`,location:l.location})));return}o&&a(o),i.pop()}});a(e)}QA.exports=W$});var nw=we((ZO,rw)=>{"use strict";var tw=sa(),X$=ti();function J$(e,t,r){X$.build({zero_or_more(i){tw.alwaysConsumesOnSuccess(e,i.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",i.location)},one_or_more(i){tw.alwaysConsumesOnSuccess(e,i.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",i.location)}})(e)}rw.exports=J$});var sw=we((QO,iw)=>{"use strict";var Z$=sa(),Q$=ti();function e7(e,t,r){Q$.build({rule_ref(i){Z$.findRule(e,i.name)||r.error(`Rule "${i.name}" is not defined`,i.location)}})(e)}iw.exports=e7});var uw=we((eN,aw)=>{"use strict";var t7=ti();function r7(e,t,r){let n=t7.build({action(i){n(i.expression,i)},labeled(i,a){i.pick&&a&&r.error('"@" cannot be used with an action block',i.labelLocation,[{message:"Action block location",location:a.codeLocation}]),n(i.expression)}});n(e)}aw.exports=r7});var cw=we((tN,ow)=>{"use strict";var n7=lh(),L0=class{constructor(t){t=typeof t<"u"?t:{},typeof t.error=="function"&&(this.error=t.error),typeof t.warning=="function"&&(this.warning=t.warning),typeof t.info=="function"&&(this.info=t.info)}error(){}warning(){}info(){}},U0=class{constructor(t){this._callbacks=new L0(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,this._firstError===null&&(this._firstError=new n7(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(this.errors!==0)throw this._firstError}};ow.exports=U0});var lw=we((exports,module)=>{"use strict";var generateBytecode=mA(),generateJS=KA(),inferenceMatchResult=C0(),removeProxyRules=zA(),reportDuplicateLabels=WA(),reportDuplicateRules=JA(),reportInfiniteRecursion=ew(),reportInfiniteRepetition=nw(),reportUndefinedRules=sw(),reportIncorrectPlucking=uw(),Session=cw(),visitor=ti();function processOptions(e,t){let r={};return Object.keys(e).forEach(n=>{r[n]=e[n]}),Object.keys(t).forEach(n=>{Object.prototype.hasOwnProperty.call(r,n)||(r[n]=t[n])}),r}var compiler={visitor,passes:{check:[reportUndefinedRules,reportDuplicateRules,reportDuplicateLabels,reportInfiniteRecursion,reportInfiniteRepetition,reportIncorrectPlucking],transform:[removeProxyRules,inferenceMatchResult],generate:[generateBytecode,generateJS]},compile(ast,passes,options){if(options=options!==void 0?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(options.allowedStartRules.length===0)throw new Error("Must have at least one start rule");let allRules=ast.rules.map(e=>e.name);for(let e of options.allowedStartRules)if(allRules.indexOf(e)===-1)throw new Error(`Unknown start rule "${e}"`);let session=new Session(options);switch(Object.keys(passes).forEach(e=>{session.stage=e,session.info(`Process stage ${e}`),passes[e].forEach(t=>{session.info(`Process pass ${e}.${t.name}`),t(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};module.exports=compiler});var hw=we((rN,fw)=>{"use strict";var i7={$:"text","&":"simple_and","!":"simple_not"},s7={"?":"optional","*":"zero_or_more","+":"one_or_more"},a7={"&":"semantic_and","!":"semantic_not"};function u7(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function ca(e,t,r,n){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,ca.prototype),i.expected=t,i.found=r,i.location=n,i.name="SyntaxError",i}u7(ca,Error);function H0(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,r+=r.repeat(t),e+r.slice(0,t))}ca.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r=null,n;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){r=e[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,a=this.location.source+":"+i.line+":"+i.column;if(r){var s=this.location.end,o=H0("",i.line.toString().length," "),l=r[i.line-1],h=i.line===s.line?s.column:l.length+1,d=h-i.column||1;t+=`
--> `+a+`
`+o+` |
`+i.line+" | "+l+`
`+o+" | "+H0("",i.column-1," ")+H0("",d,"^")}else t+=`
at `+a}return t};ca.buildMessage=function(e,t){var r={literal:function(h){return'"'+i(h.text)+'"'},class:function(h){var d=h.parts.map(function(E){return Array.isArray(E)?a(E[0])+"-"+a(E[1]):a(E)});return"["+(h.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(h){return h.description}};function n(h){return h.charCodeAt(0).toString(16).toUpperCase()}function i(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+n(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+n(d)})}function a(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+n(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+n(d)})}function s(h){return r[h.type](h)}function o(h){var d=h.map(s),E,p;if(d.sort(),d.length>0){for(E=1,p=1;E<d.length;E++)d[E-1]!==d[E]&&(d[p]=d[E],p++);d.length=p}switch(d.length){case 1:return d[0];case 2:return d[0]+" or "+d[1];default:return d.slice(0,-1).join(", ")+", or "+d[d.length-1]}}function l(h){return h?'"'+i(h)+'"':"end of input"}return"Expected "+o(e)+" but "+l(t)+" found."};function o7(e,t){t=t!==void 0?t:{};var r={},n=t.grammarSource,i={Grammar:bu},a=bu,s="{",o="}",l="=",h="/",d="@",E=":",p="$",f="&",w="!",g="?",y="*",A="+",S="(",_=")",I=" ",D="\v",H="\f",V=" ",F="\xA0",P="\uFEFF",k=`
`,L=`\r
`,q="\r",J="\u2028",z="\u2029",K="/*",X="*/",ie="//",be="_",ye="\\",$e="\u200C",qe="\u200D",ce="i",_e='"',Le="'",lr="[",Bt="^",pt="]",zt="-",Tt="0",nt="b",It="f",tt="n",gt="r",Yt="t",Je="v",Ut="x",Un="u",fr=".",wr=";",Zt=/^[\n\r\u2028\u2029]/,$r=/^[0-9]/,la=/^[0-9a-f]/i,Mr=/^[{}]/,mt=/^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/,Qt=/^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C-\uA69D\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3-\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E-\uFF9F]/,Ze=/^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,Pr=/^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/,fa=/^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A]/,ha=/^[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0982-\u0983\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0B02-\u0B03\u0B3E\u0B40\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82-\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82-\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2-\u0DF3\u0F3E-\u0F3F\u0F7F\u102B-\u102C\u1031\u1038\u103B-\u103C\u1056-\u1057\u1062-\u1064\u1067-\u106D\u1083-\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7-\u17C8\u1923-\u1926\u1929-\u192B\u1930-\u1931\u1933-\u1938\u1A19-\u1A1A\u1A55\u1A57\u1A61\u1A63-\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B82\u1BA1\u1BA6-\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1C24-\u1C2B\u1C34-\u1C35\u1CE1\u1CF2-\u1CF3\u302E-\u302F\uA823-\uA824\uA827\uA880-\uA881\uA8B4-\uA8C3\uA952-\uA953\uA983\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uAA2F-\uAA30\uAA33-\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE-\uAAEF\uAAF5\uABE3-\uABE4\uABE6-\uABE7\uABE9-\uABEA\uABEC]/,pa=/^[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2-\u09E3\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62-\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC-\u0CCD\u0CE2-\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62-\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099-\u309A\uA66F\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/,da=/^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/,Gi=/^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/,ga=/^[_\u203F-\u2040\u2054\uFE33-\uFE34\uFE4D-\uFE4F\uFF3F]/,Os=/^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,gi=Ue("{",!1),zi=Ue("}",!1),uu=Ue("=",!1),ou=Ue("/",!1),cu=Ue("@",!1),lu=Ue(":",!1),fu=Ue("$",!1),hu=Ue("&",!1),pu=Ue("!",!1),Do=Ue("?",!1),du=Ue("*",!1),Bo=Ue("+",!1),$o=Ue("(",!1),Po=Ue(")",!1),Ns=js(),Ro=jn("whitespace"),ma=Ue(" ",!1),To=Ue("\v",!1),xo=Ue("\f",!1),Oo=Ue(" ",!1),No=Ue("\xA0",!1),ko=Ue("\uFEFF",!1),Lo=tr([`
`,"\r","\u2028","\u2029"],!1,!1),Uo=jn("end of line"),Ho=Ue(`
`,!1),mi=Ue(`\r
`,!1),gu=Ue("\r",!1),jo=Ue("\u2028",!1),Mo=Ue("\u2029",!1),qo=jn("comment"),mu=Ue("/*",!1),vi=Ue("*/",!1),en=Ue("//",!1),Vo=jn("identifier"),ks=Ue("_",!1),En=Ue("\\",!1),Ko=Ue("\u200C",!1),Go=Ue("\u200D",!1),vu=jn("literal"),va=Ue("i",!1),Eu=jn("string"),Ls=Ue('"',!1),Ht=Ue("'",!1),zo=jn("character class"),Yo=Ue("[",!1),Au=Ue("^",!1),Ei=Ue("]",!1),hr=Ue("-",!1),Rt=Ue("0",!1),Wo=Ue("b",!1),Ea=Ue("f",!1),pr=Ue("n",!1),Aa=Ue("r",!1),wu=Ue("t",!1),yu=Ue("v",!1),wa=Ue("x",!1),Ai=Ue("u",!1),ya=tr([["0","9"]],!1,!1),Su=tr([["0","9"],["a","f"]],!1,!0),Sa=Ue(".",!1),ba=jn("code block"),qr=tr(["{","}"],!1,!1),R=tr([["a","z"],"\xB5",["\xDF","\xF6"],["\xF8","\xFF"],"\u0101","\u0103","\u0105","\u0107","\u0109","\u010B","\u010D","\u010F","\u0111","\u0113","\u0115","\u0117","\u0119","\u011B","\u011D","\u011F","\u0121","\u0123","\u0125","\u0127","\u0129","\u012B","\u012D","\u012F","\u0131","\u0133","\u0135",["\u0137","\u0138"],"\u013A","\u013C","\u013E","\u0140","\u0142","\u0144","\u0146",["\u0148","\u0149"],"\u014B","\u014D","\u014F","\u0151","\u0153","\u0155","\u0157","\u0159","\u015B","\u015D","\u015F","\u0161","\u0163","\u0165","\u0167","\u0169","\u016B","\u016D","\u016F","\u0171","\u0173","\u0175","\u0177","\u017A","\u017C",["\u017E","\u0180"],"\u0183","\u0185","\u0188",["\u018C","\u018D"],"\u0192","\u0195",["\u0199","\u019B"],"\u019E","\u01A1","\u01A3","\u01A5","\u01A8",["\u01AA","\u01AB"],"\u01AD","\u01B0","\u01B4","\u01B6",["\u01B9","\u01BA"],["\u01BD","\u01BF"],"\u01C6","\u01C9","\u01CC","\u01CE","\u01D0","\u01D2","\u01D4","\u01D6","\u01D8","\u01DA",["\u01DC","\u01DD"],"\u01DF","\u01E1","\u01E3","\u01E5","\u01E7","\u01E9","\u01EB","\u01ED",["\u01EF","\u01F0"],"\u01F3","\u01F5","\u01F9","\u01FB","\u01FD","\u01FF","\u0201","\u0203","\u0205","\u0207","\u0209","\u020B","\u020D","\u020F","\u0211","\u0213","\u0215","\u0217","\u0219","\u021B","\u021D","\u021F","\u0221","\u0223","\u0225","\u0227","\u0229","\u022B","\u022D","\u022F","\u0231",["\u0233","\u0239"],"\u023C",["\u023F","\u0240"],"\u0242","\u0247","\u0249","\u024B","\u024D",["\u024F","\u0293"],["\u0295","\u02AF"],"\u0371","\u0373","\u0377",["\u037B","\u037D"],"\u0390",["\u03AC","\u03CE"],["\u03D0","\u03D1"],["\u03D5","\u03D7"],"\u03D9","\u03DB","\u03DD","\u03DF","\u03E1","\u03E3","\u03E5","\u03E7","\u03E9","\u03EB","\u03ED",["\u03EF","\u03F3"],"\u03F5","\u03F8",["\u03FB","\u03FC"],["\u0430","\u045F"],"\u0461","\u0463","\u0465","\u0467","\u0469","\u046B","\u046D","\u046F","\u0471","\u0473","\u0475","\u0477","\u0479","\u047B","\u047D","\u047F","\u0481","\u048B","\u048D","\u048F","\u0491","\u0493","\u0495","\u0497","\u0499","\u049B","\u049D","\u049F","\u04A1","\u04A3","\u04A5","\u04A7","\u04A9","\u04AB","\u04AD","\u04AF","\u04B1","\u04B3","\u04B5","\u04B7","\u04B9","\u04BB","\u04BD","\u04BF","\u04C2","\u04C4","\u04C6","\u04C8","\u04CA","\u04CC",["\u04CE","\u04CF"],"\u04D1","\u04D3","\u04D5","\u04D7","\u04D9","\u04DB","\u04DD","\u04DF","\u04E1","\u04E3","\u04E5","\u04E7","\u04E9","\u04EB","\u04ED","\u04EF","\u04F1","\u04F3","\u04F5","\u04F7","\u04F9","\u04FB","\u04FD","\u04FF","\u0501","\u0503","\u0505","\u0507","\u0509","\u050B","\u050D","\u050F","\u0511","\u0513","\u0515","\u0517","\u0519","\u051B","\u051D","\u051F","\u0521","\u0523","\u0525","\u0527","\u0529","\u052B","\u052D","\u052F",["\u0561","\u0587"],["\u13F8","\u13FD"],["\u1D00","\u1D2B"],["\u1D6B","\u1D77"],["\u1D79","\u1D9A"],"\u1E01","\u1E03","\u1E05","\u1E07","\u1E09","\u1E0B","\u1E0D","\u1E0F","\u1E11","\u1E13","\u1E15","\u1E17","\u1E19","\u1E1B","\u1E1D","\u1E1F","\u1E21","\u1E23","\u1E25","\u1E27","\u1E29","\u1E2B","\u1E2D","\u1E2F","\u1E31","\u1E33","\u1E35","\u1E37","\u1E39","\u1E3B","\u1E3D","\u1E3F","\u1E41","\u1E43","\u1E45","\u1E47","\u1E49","\u1E4B","\u1E4D","\u1E4F","\u1E51","\u1E53","\u1E55","\u1E57","\u1E59","\u1E5B","\u1E5D","\u1E5F","\u1E61","\u1E63","\u1E65","\u1E67","\u1E69","\u1E6B","\u1E6D","\u1E6F","\u1E71","\u1E73","\u1E75","\u1E77","\u1E79","\u1E7B","\u1E7D","\u1E7F","\u1E81","\u1E83","\u1E85","\u1E87","\u1E89","\u1E8B","\u1E8D","\u1E8F","\u1E91","\u1E93",["\u1E95","\u1E9D"],"\u1E9F","\u1EA1","\u1EA3","\u1EA5","\u1EA7","\u1EA9","\u1EAB","\u1EAD","\u1EAF","\u1EB1","\u1EB3","\u1EB5","\u1EB7","\u1EB9","\u1EBB","\u1EBD","\u1EBF","\u1EC1","\u1EC3","\u1EC5","\u1EC7","\u1EC9","\u1ECB","\u1ECD","\u1ECF","\u1ED1","\u1ED3","\u1ED5","\u1ED7","\u1ED9","\u1EDB","\u1EDD","\u1EDF","\u1EE1","\u1EE3","\u1EE5","\u1EE7","\u1EE9","\u1EEB","\u1EED","\u1EEF","\u1EF1","\u1EF3","\u1EF5","\u1EF7","\u1EF9","\u1EFB","\u1EFD",["\u1EFF","\u1F07"],["\u1F10","\u1F15"],["\u1F20","\u1F27"],["\u1F30","\u1F37"],["\u1F40","\u1F45"],["\u1F50","\u1F57"],["\u1F60","\u1F67"],["\u1F70","\u1F7D"],["\u1F80","\u1F87"],["\u1F90","\u1F97"],["\u1FA0","\u1FA7"],["\u1FB0","\u1FB4"],["\u1FB6","\u1FB7"],"\u1FBE",["\u1FC2","\u1FC4"],["\u1FC6","\u1FC7"],["\u1FD0","\u1FD3"],["\u1FD6","\u1FD7"],["\u1FE0","\u1FE7"],["\u1FF2","\u1FF4"],["\u1FF6","\u1FF7"],"\u210A",["\u210E","\u210F"],"\u2113","\u212F","\u2134","\u2139",["\u213C","\u213D"],["\u2146","\u2149"],"\u214E","\u2184",["\u2C30","\u2C5E"],"\u2C61",["\u2C65","\u2C66"],"\u2C68","\u2C6A","\u2C6C","\u2C71",["\u2C73","\u2C74"],["\u2C76","\u2C7B"],"\u2C81","\u2C83","\u2C85","\u2C87","\u2C89","\u2C8B","\u2C8D","\u2C8F","\u2C91","\u2C93","\u2C95","\u2C97","\u2C99","\u2C9B","\u2C9D","\u2C9F","\u2CA1","\u2CA3","\u2CA5","\u2CA7","\u2CA9","\u2CAB","\u2CAD","\u2CAF","\u2CB1","\u2CB3","\u2CB5","\u2CB7","\u2CB9","\u2CBB","\u2CBD","\u2CBF","\u2CC1","\u2CC3","\u2CC5","\u2CC7","\u2CC9","\u2CCB","\u2CCD","\u2CCF","\u2CD1","\u2CD3","\u2CD5","\u2CD7","\u2CD9","\u2CDB","\u2CDD","\u2CDF","\u2CE1",["\u2CE3","\u2CE4"],"\u2CEC","\u2CEE","\u2CF3",["\u2D00","\u2D25"],"\u2D27","\u2D2D","\uA641","\uA643","\uA645","\uA647","\uA649","\uA64B","\uA64D","\uA64F","\uA651","\uA653","\uA655","\uA657","\uA659","\uA65B","\uA65D","\uA65F","\uA661","\uA663","\uA665","\uA667","\uA669","\uA66B","\uA66D","\uA681","\uA683","\uA685","\uA687","\uA689","\uA68B","\uA68D","\uA68F","\uA691","\uA693","\uA695","\uA697","\uA699","\uA69B","\uA723","\uA725","\uA727","\uA729","\uA72B","\uA72D",["\uA72F","\uA731"],"\uA733","\uA735","\uA737","\uA739","\uA73B","\uA73D","\uA73F","\uA741","\uA743","\uA745","\uA747","\uA749","\uA74B","\uA74D","\uA74F","\uA751","\uA753","\uA755","\uA757","\uA759","\uA75B","\uA75D","\uA75F","\uA761","\uA763","\uA765","\uA767","\uA769","\uA76B","\uA76D","\uA76F",["\uA771","\uA778"],"\uA77A","\uA77C","\uA77F","\uA781","\uA783","\uA785","\uA787","\uA78C","\uA78E","\uA791",["\uA793","\uA795"],"\uA797","\uA799","\uA79B","\uA79D","\uA79F","\uA7A1","\uA7A3","\uA7A5","\uA7A7","\uA7A9","\uA7B5","\uA7B7","\uA7FA",["\uAB30","\uAB5A"],["\uAB60","\uAB65"],["\uAB70","\uABBF"],["\uFB00","\uFB06"],["\uFB13","\uFB17"],["\uFF41","\uFF5A"]],!1,!1),x=tr([["\u02B0","\u02C1"],["\u02C6","\u02D1"],["\u02E0","\u02E4"],"\u02EC","\u02EE","\u0374","\u037A","\u0559","\u0640",["\u06E5","\u06E6"],["\u07F4","\u07F5"],"\u07FA","\u081A","\u0824","\u0828","\u0971","\u0E46","\u0EC6","\u10FC","\u17D7","\u1843","\u1AA7",["\u1C78","\u1C7D"],["\u1D2C","\u1D6A"],"\u1D78",["\u1D9B","\u1DBF"],"\u2071","\u207F",["\u2090","\u209C"],["\u2C7C","\u2C7D"],"\u2D6F","\u2E2F","\u3005",["\u3031","\u3035"],"\u303B",["\u309D","\u309E"],["\u30FC","\u30FE"],"\uA015",["\uA4F8","\uA4FD"],"\uA60C","\uA67F",["\uA69C","\uA69D"],["\uA717","\uA71F"],"\uA770","\uA788",["\uA7F8","\uA7F9"],"\uA9CF","\uA9E6","\uAA70","\uAADD",["\uAAF3","\uAAF4"],["\uAB5C","\uAB5F"],"\uFF70",["\uFF9E","\uFF9F"]],!1,!1),j=tr(["\xAA","\xBA","\u01BB",["\u01C0","\u01C3"],"\u0294",["\u05D0","\u05EA"],["\u05F0","\u05F2"],["\u0620","\u063F"],["\u0641","\u064A"],["\u066E","\u066F"],["\u0671","\u06D3"],"\u06D5",["\u06EE","\u06EF"],["\u06FA","\u06FC"],"\u06FF","\u0710",["\u0712","\u072F"],["\u074D","\u07A5"],"\u07B1",["\u07CA","\u07EA"],["\u0800","\u0815"],["\u0840","\u0858"],["\u08A0","\u08B4"],["\u0904","\u0939"],"\u093D","\u0950",["\u0958","\u0961"],["\u0972","\u0980"],["\u0985","\u098C"],["\u098F","\u0990"],["\u0993","\u09A8"],["\u09AA","\u09B0"],"\u09B2",["\u09B6","\u09B9"],"\u09BD","\u09CE",["\u09DC","\u09DD"],["\u09DF","\u09E1"],["\u09F0","\u09F1"],["\u0A05","\u0A0A"],["\u0A0F","\u0A10"],["\u0A13","\u0A28"],["\u0A2A","\u0A30"],["\u0A32","\u0A33"],["\u0A35","\u0A36"],["\u0A38","\u0A39"],["\u0A59","\u0A5C"],"\u0A5E",["\u0A72","\u0A74"],["\u0A85","\u0A8D"],["\u0A8F","\u0A91"],["\u0A93","\u0AA8"],["\u0AAA","\u0AB0"],["\u0AB2","\u0AB3"],["\u0AB5","\u0AB9"],"\u0ABD","\u0AD0",["\u0AE0","\u0AE1"],"\u0AF9",["\u0B05","\u0B0C"],["\u0B0F","\u0B10"],["\u0B13","\u0B28"],["\u0B2A","\u0B30"],["\u0B32","\u0B33"],["\u0B35","\u0B39"],"\u0B3D",["\u0B5C","\u0B5D"],["\u0B5F","\u0B61"],"\u0B71","\u0B83",["\u0B85","\u0B8A"],["\u0B8E","\u0B90"],["\u0B92","\u0B95"],["\u0B99","\u0B9A"],"\u0B9C",["\u0B9E","\u0B9F"],["\u0BA3","\u0BA4"],["\u0BA8","\u0BAA"],["\u0BAE","\u0BB9"],"\u0BD0",["\u0C05","\u0C0C"],["\u0C0E","\u0C10"],["\u0C12","\u0C28"],["\u0C2A","\u0C39"],"\u0C3D",["\u0C58","\u0C5A"],["\u0C60","\u0C61"],["\u0C85","\u0C8C"],["\u0C8E","\u0C90"],["\u0C92","\u0CA8"],["\u0CAA","\u0CB3"],["\u0CB5","\u0CB9"],"\u0CBD","\u0CDE",["\u0CE0","\u0CE1"],["\u0CF1","\u0CF2"],["\u0D05","\u0D0C"],["\u0D0E","\u0D10"],["\u0D12","\u0D3A"],"\u0D3D","\u0D4E",["\u0D5F","\u0D61"],["\u0D7A","\u0D7F"],["\u0D85","\u0D96"],["\u0D9A","\u0DB1"],["\u0DB3","\u0DBB"],"\u0DBD",["\u0DC0","\u0DC6"],["\u0E01","\u0E30"],["\u0E32","\u0E33"],["\u0E40","\u0E45"],["\u0E81","\u0E82"],"\u0E84",["\u0E87","\u0E88"],"\u0E8A","\u0E8D",["\u0E94","\u0E97"],["\u0E99","\u0E9F"],["\u0EA1","\u0EA3"],"\u0EA5","\u0EA7",["\u0EAA","\u0EAB"],["\u0EAD","\u0EB0"],["\u0EB2","\u0EB3"],"\u0EBD",["\u0EC0","\u0EC4"],["\u0EDC","\u0EDF"],"\u0F00",["\u0F40","\u0F47"],["\u0F49","\u0F6C"],["\u0F88","\u0F8C"],["\u1000","\u102A"],"\u103F",["\u1050","\u1055"],["\u105A","\u105D"],"\u1061",["\u1065","\u1066"],["\u106E","\u1070"],["\u1075","\u1081"],"\u108E",["\u10D0","\u10FA"],["\u10FD","\u1248"],["\u124A","\u124D"],["\u1250","\u1256"],"\u1258",["\u125A","\u125D"],["\u1260","\u1288"],["\u128A","\u128D"],["\u1290","\u12B0"],["\u12B2","\u12B5"],["\u12B8","\u12BE"],"\u12C0",["\u12C2","\u12C5"],["\u12C8","\u12D6"],["\u12D8","\u1310"],["\u1312","\u1315"],["\u1318","\u135A"],["\u1380","\u138F"],["\u1401","\u166C"],["\u166F","\u167F"],["\u1681","\u169A"],["\u16A0","\u16EA"],["\u16F1","\u16F8"],["\u1700","\u170C"],["\u170E","\u1711"],["\u1720","\u1731"],["\u1740","\u1751"],["\u1760","\u176C"],["\u176E","\u1770"],["\u1780","\u17B3"],"\u17DC",["\u1820","\u1842"],["\u1844","\u1877"],["\u1880","\u18A8"],"\u18AA",["\u18B0","\u18F5"],["\u1900","\u191E"],["\u1950","\u196D"],["\u1970","\u1974"],["\u1980","\u19AB"],["\u19B0","\u19C9"],["\u1A00","\u1A16"],["\u1A20","\u1A54"],["\u1B05","\u1B33"],["\u1B45","\u1B4B"],["\u1B83","\u1BA0"],["\u1BAE","\u1BAF"],["\u1BBA","\u1BE5"],["\u1C00","\u1C23"],["\u1C4D","\u1C4F"],["\u1C5A","\u1C77"],["\u1CE9","\u1CEC"],["\u1CEE","\u1CF1"],["\u1CF5","\u1CF6"],["\u2135","\u2138"],["\u2D30","\u2D67"],["\u2D80","\u2D96"],["\u2DA0","\u2DA6"],["\u2DA8","\u2DAE"],["\u2DB0","\u2DB6"],["\u2DB8","\u2DBE"],["\u2DC0","\u2DC6"],["\u2DC8","\u2DCE"],["\u2DD0","\u2DD6"],["\u2DD8","\u2DDE"],"\u3006","\u303C",["\u3041","\u3096"],"\u309F",["\u30A1","\u30FA"],"\u30FF",["\u3105","\u312D"],["\u3131","\u318E"],["\u31A0","\u31BA"],["\u31F0","\u31FF"],["\u3400","\u4DB5"],["\u4E00","\u9FD5"],["\uA000","\uA014"],["\uA016","\uA48C"],["\uA4D0","\uA4F7"],["\uA500","\uA60B"],["\uA610","\uA61F"],["\uA62A","\uA62B"],"\uA66E",["\uA6A0","\uA6E5"],"\uA78F","\uA7F7",["\uA7FB","\uA801"],["\uA803","\uA805"],["\uA807","\uA80A"],["\uA80C","\uA822"],["\uA840","\uA873"],["\uA882","\uA8B3"],["\uA8F2","\uA8F7"],"\uA8FB","\uA8FD",["\uA90A","\uA925"],["\uA930","\uA946"],["\uA960","\uA97C"],["\uA984","\uA9B2"],["\uA9E0","\uA9E4"],["\uA9E7","\uA9EF"],["\uA9FA","\uA9FE"],["\uAA00","\uAA28"],["\uAA40","\uAA42"],["\uAA44","\uAA4B"],["\uAA60","\uAA6F"],["\uAA71","\uAA76"],"\uAA7A",["\uAA7E","\uAAAF"],"\uAAB1",["\uAAB5","\uAAB6"],["\uAAB9","\uAABD"],"\uAAC0","\uAAC2",["\uAADB","\uAADC"],["\uAAE0","\uAAEA"],"\uAAF2",["\uAB01","\uAB06"],["\uAB09","\uAB0E"],["\uAB11","\uAB16"],["\uAB20","\uAB26"],["\uAB28","\uAB2E"],["\uABC0","\uABE2"],["\uAC00","\uD7A3"],["\uD7B0","\uD7C6"],["\uD7CB","\uD7FB"],["\uF900","\uFA6D"],["\uFA70","\uFAD9"],"\uFB1D",["\uFB1F","\uFB28"],["\uFB2A","\uFB36"],["\uFB38","\uFB3C"],"\uFB3E",["\uFB40","\uFB41"],["\uFB43","\uFB44"],["\uFB46","\uFBB1"],["\uFBD3","\uFD3D"],["\uFD50","\uFD8F"],["\uFD92","\uFDC7"],["\uFDF0","\uFDFB"],["\uFE70","\uFE74"],["\uFE76","\uFEFC"],["\uFF66","\uFF6F"],["\uFF71","\uFF9D"],["\uFFA0","\uFFBE"],["\uFFC2","\uFFC7"],["\uFFCA","\uFFCF"],["\uFFD2","\uFFD7"],["\uFFDA","\uFFDC"]],!1,!1),Q=tr(["\u01C5","\u01C8","\u01CB","\u01F2",["\u1F88","\u1F8F"],["\u1F98","\u1F9F"],["\u1FA8","\u1FAF"],"\u1FBC","\u1FCC","\u1FFC"],!1,!1),de=tr([["A","Z"],["\xC0","\xD6"],["\xD8","\xDE"],"\u0100","\u0102","\u0104","\u0106","\u0108","\u010A","\u010C","\u010E","\u0110","\u0112","\u0114","\u0116","\u0118","\u011A","\u011C","\u011E","\u0120","\u0122","\u0124","\u0126","\u0128","\u012A","\u012C","\u012E","\u0130","\u0132","\u0134","\u0136","\u0139","\u013B","\u013D","\u013F","\u0141","\u0143","\u0145","\u0147","\u014A","\u014C","\u014E","\u0150","\u0152","\u0154","\u0156","\u0158","\u015A","\u015C","\u015E","\u0160","\u0162","\u0164","\u0166","\u0168","\u016A","\u016C","\u016E","\u0170","\u0172","\u0174","\u0176",["\u0178","\u0179"],"\u017B","\u017D",["\u0181","\u0182"],"\u0184",["\u0186","\u0187"],["\u0189","\u018B"],["\u018E","\u0191"],["\u0193","\u0194"],["\u0196","\u0198"],["\u019C","\u019D"],["\u019F","\u01A0"],"\u01A2","\u01A4",["\u01A6","\u01A7"],"\u01A9","\u01AC",["\u01AE","\u01AF"],["\u01B1","\u01B3"],"\u01B5",["\u01B7","\u01B8"],"\u01BC","\u01C4","\u01C7","\u01CA","\u01CD","\u01CF","\u01D1","\u01D3","\u01D5","\u01D7","\u01D9","\u01DB","\u01DE","\u01E0","\u01E2","\u01E4","\u01E6","\u01E8","\u01EA","\u01EC","\u01EE","\u01F1","\u01F4",["\u01F6","\u01F8"],"\u01FA","\u01FC","\u01FE","\u0200","\u0202","\u0204","\u0206","\u0208","\u020A","\u020C","\u020E","\u0210","\u0212","\u0214","\u0216","\u0218","\u021A","\u021C","\u021E","\u0220","\u0222","\u0224","\u0226","\u0228","\u022A","\u022C","\u022E","\u0230","\u0232",["\u023A","\u023B"],["\u023D","\u023E"],"\u0241",["\u0243","\u0246"],"\u0248","\u024A","\u024C","\u024E","\u0370","\u0372","\u0376","\u037F","\u0386",["\u0388","\u038A"],"\u038C",["\u038E","\u038F"],["\u0391","\u03A1"],["\u03A3","\u03AB"],"\u03CF",["\u03D2","\u03D4"],"\u03D8","\u03DA","\u03DC","\u03DE","\u03E0","\u03E2","\u03E4","\u03E6","\u03E8","\u03EA","\u03EC","\u03EE","\u03F4","\u03F7",["\u03F9","\u03FA"],["\u03FD","\u042F"],"\u0460","\u0462","\u0464","\u0466","\u0468","\u046A","\u046C","\u046E","\u0470","\u0472","\u0474","\u0476","\u0478","\u047A","\u047C","\u047E","\u0480","\u048A","\u048C","\u048E","\u0490","\u0492","\u0494","\u0496","\u0498","\u049A","\u049C","\u049E","\u04A0","\u04A2","\u04A4","\u04A6","\u04A8","\u04AA","\u04AC","\u04AE","\u04B0","\u04B2","\u04B4","\u04B6","\u04B8","\u04BA","\u04BC","\u04BE",["\u04C0","\u04C1"],"\u04C3","\u04C5","\u04C7","\u04C9","\u04CB","\u04CD","\u04D0","\u04D2","\u04D4","\u04D6","\u04D8","\u04DA","\u04DC","\u04DE","\u04E0","\u04E2","\u04E4","\u04E6","\u04E8","\u04EA","\u04EC","\u04EE","\u04F0","\u04F2","\u04F4","\u04F6","\u04F8","\u04FA","\u04FC","\u04FE","\u0500","\u0502","\u0504","\u0506","\u0508","\u050A","\u050C","\u050E","\u0510","\u0512","\u0514","\u0516","\u0518","\u051A","\u051C","\u051E","\u0520","\u0522","\u0524","\u0526","\u0528","\u052A","\u052C","\u052E",["\u0531","\u0556"],["\u10A0","\u10C5"],"\u10C7","\u10CD",["\u13A0","\u13F5"],"\u1E00","\u1E02","\u1E04","\u1E06","\u1E08","\u1E0A","\u1E0C","\u1E0E","\u1E10","\u1E12","\u1E14","\u1E16","\u1E18","\u1E1A","\u1E1C","\u1E1E","\u1E20","\u1E22","\u1E24","\u1E26","\u1E28","\u1E2A","\u1E2C","\u1E2E","\u1E30","\u1E32","\u1E34","\u1E36","\u1E38","\u1E3A","\u1E3C","\u1E3E","\u1E40","\u1E42","\u1E44","\u1E46","\u1E48","\u1E4A","\u1E4C","\u1E4E","\u1E50","\u1E52","\u1E54","\u1E56","\u1E58","\u1E5A","\u1E5C","\u1E5E","\u1E60","\u1E62","\u1E64","\u1E66","\u1E68","\u1E6A","\u1E6C","\u1E6E","\u1E70","\u1E72","\u1E74","\u1E76","\u1E78","\u1E7A","\u1E7C","\u1E7E","\u1E80","\u1E82","\u1E84","\u1E86","\u1E88","\u1E8A","\u1E8C","\u1E8E","\u1E90","\u1E92","\u1E94","\u1E9E","\u1EA0","\u1EA2","\u1EA4","\u1EA6","\u1EA8","\u1EAA","\u1EAC","\u1EAE","\u1EB0","\u1EB2","\u1EB4","\u1EB6","\u1EB8","\u1EBA","\u1EBC","\u1EBE","\u1EC0","\u1EC2","\u1EC4","\u1EC6","\u1EC8","\u1ECA","\u1ECC","\u1ECE","\u1ED0","\u1ED2","\u1ED4","\u1ED6","\u1ED8","\u1EDA","\u1EDC","\u1EDE","\u1EE0","\u1EE2","\u1EE4","\u1EE6","\u1EE8","\u1EEA","\u1EEC","\u1EEE","\u1EF0","\u1EF2","\u1EF4","\u1EF6","\u1EF8","\u1EFA","\u1EFC","\u1EFE",["\u1F08","\u1F0F"],["\u1F18","\u1F1D"],["\u1F28","\u1F2F"],["\u1F38","\u1F3F"],["\u1F48","\u1F4D"],"\u1F59","\u1F5B","\u1F5D","\u1F5F",["\u1F68","\u1F6F"],["\u1FB8","\u1FBB"],["\u1FC8","\u1FCB"],["\u1FD8","\u1FDB"],["\u1FE8","\u1FEC"],["\u1FF8","\u1FFB"],"\u2102","\u2107",["\u210B","\u210D"],["\u2110","\u2112"],"\u2115",["\u2119","\u211D"],"\u2124","\u2126","\u2128",["\u212A","\u212D"],["\u2130","\u2133"],["\u213E","\u213F"],"\u2145","\u2183",["\u2C00","\u2C2E"],"\u2C60",["\u2C62","\u2C64"],"\u2C67","\u2C69","\u2C6B",["\u2C6D","\u2C70"],"\u2C72","\u2C75",["\u2C7E","\u2C80"],"\u2C82","\u2C84","\u2C86","\u2C88","\u2C8A","\u2C8C","\u2C8E","\u2C90","\u2C92","\u2C94","\u2C96","\u2C98","\u2C9A","\u2C9C","\u2C9E","\u2CA0","\u2CA2","\u2CA4","\u2CA6","\u2CA8","\u2CAA","\u2CAC","\u2CAE","\u2CB0","\u2CB2","\u2CB4","\u2CB6","\u2CB8","\u2CBA","\u2CBC","\u2CBE","\u2CC0","\u2CC2","\u2CC4","\u2CC6","\u2CC8","\u2CCA","\u2CCC","\u2CCE","\u2CD0","\u2CD2","\u2CD4","\u2CD6","\u2CD8","\u2CDA","\u2CDC","\u2CDE","\u2CE0","\u2CE2","\u2CEB","\u2CED","\u2CF2","\uA640","\uA642","\uA644","\uA646","\uA648","\uA64A","\uA64C","\uA64E","\uA650","\uA652","\uA654","\uA656","\uA658","\uA65A","\uA65C","\uA65E","\uA660","\uA662","\uA664","\uA666","\uA668","\uA66A","\uA66C","\uA680","\uA682","\uA684","\uA686","\uA688","\uA68A","\uA68C","\uA68E","\uA690","\uA692","\uA694","\uA696","\uA698","\uA69A","\uA722","\uA724","\uA726","\uA728","\uA72A","\uA72C","\uA72E","\uA732","\uA734","\uA736","\uA738","\uA73A","\uA73C","\uA73E","\uA740","\uA742","\uA744","\uA746","\uA748","\uA74A","\uA74C","\uA74E","\uA750","\uA752","\uA754","\uA756","\uA758","\uA75A","\uA75C","\uA75E","\uA760","\uA762","\uA764","\uA766","\uA768","\uA76A","\uA76C","\uA76E","\uA779","\uA77B",["\uA77D","\uA77E"],"\uA780","\uA782","\uA784","\uA786","\uA78B","\uA78D","\uA790","\uA792","\uA796","\uA798","\uA79A","\uA79C","\uA79E","\uA7A0","\uA7A2","\uA7A4","\uA7A6","\uA7A8",["\uA7AA","\uA7AD"],["\uA7B0","\uA7B4"],"\uA7B6",["\uFF21","\uFF3A"]],!1,!1),ve=tr(["\u0903","\u093B",["\u093E","\u0940"],["\u0949","\u094C"],["\u094E","\u094F"],["\u0982","\u0983"],["\u09BE","\u09C0"],["\u09C7","\u09C8"],["\u09CB","\u09CC"],"\u09D7","\u0A03",["\u0A3E","\u0A40"],"\u0A83",["\u0ABE","\u0AC0"],"\u0AC9",["\u0ACB","\u0ACC"],["\u0B02","\u0B03"],"\u0B3E","\u0B40",["\u0B47","\u0B48"],["\u0B4B","\u0B4C"],"\u0B57",["\u0BBE","\u0BBF"],["\u0BC1","\u0BC2"],["\u0BC6","\u0BC8"],["\u0BCA","\u0BCC"],"\u0BD7",["\u0C01","\u0C03"],["\u0C41","\u0C44"],["\u0C82","\u0C83"],"\u0CBE",["\u0CC0","\u0CC4"],["\u0CC7","\u0CC8"],["\u0CCA","\u0CCB"],["\u0CD5","\u0CD6"],["\u0D02","\u0D03"],["\u0D3E","\u0D40"],["\u0D46","\u0D48"],["\u0D4A","\u0D4C"],"\u0D57",["\u0D82","\u0D83"],["\u0DCF","\u0DD1"],["\u0DD8","\u0DDF"],["\u0DF2","\u0DF3"],["\u0F3E","\u0F3F"],"\u0F7F",["\u102B","\u102C"],"\u1031","\u1038",["\u103B","\u103C"],["\u1056","\u1057"],["\u1062","\u1064"],["\u1067","\u106D"],["\u1083","\u1084"],["\u1087","\u108C"],"\u108F",["\u109A","\u109C"],"\u17B6",["\u17BE","\u17C5"],["\u17C7","\u17C8"],["\u1923","\u1926"],["\u1929","\u192B"],["\u1930","\u1931"],["\u1933","\u1938"],["\u1A19","\u1A1A"],"\u1A55","\u1A57","\u1A61",["\u1A63","\u1A64"],["\u1A6D","\u1A72"],"\u1B04","\u1B35","\u1B3B",["\u1B3D","\u1B41"],["\u1B43","\u1B44"],"\u1B82","\u1BA1",["\u1BA6","\u1BA7"],"\u1BAA","\u1BE7",["\u1BEA","\u1BEC"],"\u1BEE",["\u1BF2","\u1BF3"],["\u1C24","\u1C2B"],["\u1C34","\u1C35"],"\u1CE1",["\u1CF2","\u1CF3"],["\u302E","\u302F"],["\uA823","\uA824"],"\uA827",["\uA880","\uA881"],["\uA8B4","\uA8C3"],["\uA952","\uA953"],"\uA983",["\uA9B4","\uA9B5"],["\uA9BA","\uA9BB"],["\uA9BD","\uA9C0"],["\uAA2F","\uAA30"],["\uAA33","\uAA34"],"\uAA4D","\uAA7B","\uAA7D","\uAAEB",["\uAAEE","\uAAEF"],"\uAAF5",["\uABE3","\uABE4"],["\uABE6","\uABE7"],["\uABE9","\uABEA"],"\uABEC"],!1,!1),Fe=tr([["\u0300","\u036F"],["\u0483","\u0487"],["\u0591","\u05BD"],"\u05BF",["\u05C1","\u05C2"],["\u05C4","\u05C5"],"\u05C7",["\u0610","\u061A"],["\u064B","\u065F"],"\u0670",["\u06D6","\u06DC"],["\u06DF","\u06E4"],["\u06E7","\u06E8"],["\u06EA","\u06ED"],"\u0711",["\u0730","\u074A"],["\u07A6","\u07B0"],["\u07EB","\u07F3"],["\u0816","\u0819"],["\u081B","\u0823"],["\u0825","\u0827"],["\u0829","\u082D"],["\u0859","\u085B"],["\u08E3","\u0902"],"\u093A","\u093C",["\u0941","\u0948"],"\u094D",["\u0951","\u0957"],["\u0962","\u0963"],"\u0981","\u09BC",["\u09C1","\u09C4"],"\u09CD",["\u09E2","\u09E3"],["\u0A01","\u0A02"],"\u0A3C",["\u0A41","\u0A42"],["\u0A47","\u0A48"],["\u0A4B","\u0A4D"],"\u0A51",["\u0A70","\u0A71"],"\u0A75",["\u0A81","\u0A82"],"\u0ABC",["\u0AC1","\u0AC5"],["\u0AC7","\u0AC8"],"\u0ACD",["\u0AE2","\u0AE3"],"\u0B01","\u0B3C","\u0B3F",["\u0B41","\u0B44"],"\u0B4D","\u0B56",["\u0B62","\u0B63"],"\u0B82","\u0BC0","\u0BCD","\u0C00",["\u0C3E","\u0C40"],["\u0C46","\u0C48"],["\u0C4A","\u0C4D"],["\u0C55","\u0C56"],["\u0C62","\u0C63"],"\u0C81","\u0CBC","\u0CBF","\u0CC6",["\u0CCC","\u0CCD"],["\u0CE2","\u0CE3"],"\u0D01",["\u0D41","\u0D44"],"\u0D4D",["\u0D62","\u0D63"],"\u0DCA",["\u0DD2","\u0DD4"],"\u0DD6","\u0E31",["\u0E34","\u0E3A"],["\u0E47","\u0E4E"],"\u0EB1",["\u0EB4","\u0EB9"],["\u0EBB","\u0EBC"],["\u0EC8","\u0ECD"],["\u0F18","\u0F19"],"\u0F35","\u0F37","\u0F39",["\u0F71","\u0F7E"],["\u0F80","\u0F84"],["\u0F86","\u0F87"],["\u0F8D","\u0F97"],["\u0F99","\u0FBC"],"\u0FC6",["\u102D","\u1030"],["\u1032","\u1037"],["\u1039","\u103A"],["\u103D","\u103E"],["\u1058","\u1059"],["\u105E","\u1060"],["\u1071","\u1074"],"\u1082",["\u1085","\u1086"],"\u108D","\u109D",["\u135D","\u135F"],["\u1712","\u1714"],["\u1732","\u1734"],["\u1752","\u1753"],["\u1772","\u1773"],["\u17B4","\u17B5"],["\u17B7","\u17BD"],"\u17C6",["\u17C9","\u17D3"],"\u17DD",["\u180B","\u180D"],"\u18A9",["\u1920","\u1922"],["\u1927","\u1928"],"\u1932",["\u1939","\u193B"],["\u1A17","\u1A18"],"\u1A1B","\u1A56",["\u1A58","\u1A5E"],"\u1A60","\u1A62",["\u1A65","\u1A6C"],["\u1A73","\u1A7C"],"\u1A7F",["\u1AB0","\u1ABD"],["\u1B00","\u1B03"],"\u1B34",["\u1B36","\u1B3A"],"\u1B3C","\u1B42",["\u1B6B","\u1B73"],["\u1B80","\u1B81"],["\u1BA2","\u1BA5"],["\u1BA8","\u1BA9"],["\u1BAB","\u1BAD"],"\u1BE6",["\u1BE8","\u1BE9"],"\u1BED",["\u1BEF","\u1BF1"],["\u1C2C","\u1C33"],["\u1C36","\u1C37"],["\u1CD0","\u1CD2"],["\u1CD4","\u1CE0"],["\u1CE2","\u1CE8"],"\u1CED","\u1CF4",["\u1CF8","\u1CF9"],["\u1DC0","\u1DF5"],["\u1DFC","\u1DFF"],["\u20D0","\u20DC"],"\u20E1",["\u20E5","\u20F0"],["\u2CEF","\u2CF1"],"\u2D7F",["\u2DE0","\u2DFF"],["\u302A","\u302D"],["\u3099","\u309A"],"\uA66F",["\uA674","\uA67D"],["\uA69E","\uA69F"],["\uA6F0","\uA6F1"],"\uA802","\uA806","\uA80B",["\uA825","\uA826"],"\uA8C4",["\uA8E0","\uA8F1"],["\uA926","\uA92D"],["\uA947","\uA951"],["\uA980","\uA982"],"\uA9B3",["\uA9B6","\uA9B9"],"\uA9BC","\uA9E5",["\uAA29","\uAA2E"],["\uAA31","\uAA32"],["\uAA35","\uAA36"],"\uAA43","\uAA4C","\uAA7C","\uAAB0",["\uAAB2","\uAAB4"],["\uAAB7","\uAAB8"],["\uAABE","\uAABF"],"\uAAC1",["\uAAEC","\uAAED"],"\uAAF6","\uABE5","\uABE8","\uABED","\uFB1E",["\uFE00","\uFE0F"],["\uFE20","\uFE2F"]],!1,!1),Pe=tr([["0","9"],["\u0660","\u0669"],["\u06F0","\u06F9"],["\u07C0","\u07C9"],["\u0966","\u096F"],["\u09E6","\u09EF"],["\u0A66","\u0A6F"],["\u0AE6","\u0AEF"],["\u0B66","\u0B6F"],["\u0BE6","\u0BEF"],["\u0C66","\u0C6F"],["\u0CE6","\u0CEF"],["\u0D66","\u0D6F"],["\u0DE6","\u0DEF"],["\u0E50","\u0E59"],["\u0ED0","\u0ED9"],["\u0F20","\u0F29"],["\u1040","\u1049"],["\u1090","\u1099"],["\u17E0","\u17E9"],["\u1810","\u1819"],["\u1946","\u194F"],["\u19D0","\u19D9"],["\u1A80","\u1A89"],["\u1A90","\u1A99"],["\u1B50","\u1B59"],["\u1BB0","\u1BB9"],["\u1C40","\u1C49"],["\u1C50","\u1C59"],["\uA620","\uA629"],["\uA8D0","\uA8D9"],["\uA900","\uA909"],["\uA9D0","\uA9D9"],["\uA9F0","\uA9F9"],["\uAA50","\uAA59"],["\uABF0","\uABF9"],["\uFF10","\uFF19"]],!1,!1),St=tr([["\u16EE","\u16F0"],["\u2160","\u2182"],["\u2185","\u2188"],"\u3007",["\u3021","\u3029"],["\u3038","\u303A"],["\uA6E6","\uA6EF"]],!1,!1),jt=tr(["_",["\u203F","\u2040"],"\u2054",["\uFE33","\uFE34"],["\uFE4D","\uFE4F"],"\uFF3F"],!1,!1),yr=tr([" ","\xA0","\u1680",["\u2000","\u200A"],"\u202F","\u205F","\u3000"],!1,!1),Sr=Ue(";",!1),An=function(b,O,W){return{type:"grammar",topLevelInitializer:b,initializer:O,rules:W,location:xt()}},Us=function(b){return{type:"top_level_initializer",code:b[0],codeLocation:b[1],location:xt()}},Vr=function(b){return{type:"initializer",code:b[0],codeLocation:b[1],location:xt()}},br=function(b,O,W){return{type:"rule",name:b[0],nameLocation:b[1],expression:O!==null?{type:"named",name:O,expression:W,location:xt()}:W,location:xt()}},Hs=function(b,O){return O.length>0?{type:"choice",alternatives:[b].concat(O),location:xt()}:b},Hn=function(b,O){return O!==null?{type:"action",expression:b,code:O[0],codeLocation:O[1],location:xt()}:b},Ca=function(b,O){return O.length>0||b.type==="labeled"&&b.pick?{type:"sequence",elements:[b].concat(O),location:xt()}:b},Eh=function(b,O,W){return W.type.startsWith("semantic_")&&Qo('"@" cannot be used on a semantic predicate',b),{type:"labeled",label:O!==null?O[0]:null,labelLocation:O!==null?O[1]:b,pick:!0,expression:W,location:xt()}},Ah=function(b,O){return{type:"labeled",label:b[0],labelLocation:b[1],expression:O,location:xt()}},Dt=function(){return xt()},Ft=function(b){return Ou.indexOf(b[0])>=0&&Qo(`Label can't be a reserved word "${b[0]}"`,b[1]),b},wh=function(b,O){return{type:i7[b],expression:O,location:xt()}},yh=function(b,O){return{type:s7[O],expression:b,location:xt()}},Sh=function(b){return b.type==="labeled"||b.type==="sequence"?{type:"group",expression:b,location:xt()}:b},bh=function(b){return{type:"rule_ref",name:b[0],location:xt()}},Ch=function(b,O){return{type:a7[b],code:O[0],codeLocation:O[1],location:xt()}},Fh=function(b,O){return[b+O.join(""),xt()]},Qc=function(b,O){return{type:"literal",value:b,ignoreCase:O!==null,location:xt()}},_h=function(b){return b.join("")},er=function(b){return b.join("")},Xo=function(b,O,W){return{type:"class",parts:O.filter(M=>M!==""),inverted:b!==null,ignoreCase:W!==null,location:xt()}},Yi=function(b,O){return b.charCodeAt(0)>O.charCodeAt(0)&&Qo("Invalid character range: "+Zo()+"."),[b,O]},el=function(){return""},Jo=function(){return"\0"},tn=function(){return"\b"},tl=function(){return"\f"},rl=function(){return`
`},nl=function(){return"\r"},il=function(){return" "},sl=function(){return"\v"},al=function(b){return String.fromCharCode(parseInt(b,16))},Kr=function(b){return String.fromCharCode(parseInt(b,16))},Ih=function(){return{type:"any",location:xt()}},rn=function(b){return[b,xt()]},B=0,Ye=0,wn=[{line:1,column:1}],Gr=0,Fa=[],te=0,yn;if("startRule"in t){if(!(t.startRule in i))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=i[t.startRule]}function Zo(){return e.substring(Ye,B)}function J0(){return Ye}function ul(){return{source:n,start:Ye,end:B}}function xt(){return Wi(Ye,B)}function Z0(b,O){throw O=O!==void 0?O:Wi(Ye,B),cl([jn(b)],e.substring(Ye,B),O)}function Qo(b,O){throw O=O!==void 0?O:Wi(Ye,B),ol(b,O)}function Ue(b,O){return{type:"literal",text:b,ignoreCase:O}}function tr(b,O,W){return{type:"class",parts:b,inverted:O,ignoreCase:W}}function js(){return{type:"any"}}function Dh(){return{type:"end"}}function jn(b){return{type:"other",description:b}}function ec(b){var O=wn[b],W;if(O)return O;for(W=b-1;!wn[W];)W--;for(O=wn[W],O={line:O.line,column:O.column};W<b;)e.charCodeAt(W)===10?(O.line++,O.column=1):O.column++,W++;return wn[b]=O,O}function Wi(b,O){var W=ec(b),M=ec(O);return{source:n,start:{offset:b,line:W.line,column:W.column},end:{offset:O,line:M.line,column:M.column}}}function pe(b){B<Gr||(B>Gr&&(Gr=B,Fa=[]),Fa.push(b))}function ol(b,O){return new ca(b,null,null,O)}function cl(b,O,W){return new ca(ca.buildMessage(b,O),b,O,W)}function bu(){var b,O,W,M,se,oe,Ct,Mt;if(b=B,O=vt(),W=B,M=tc(),M!==r?(se=vt(),W=M):(B=W,W=r),W===r&&(W=null),M=B,se=Bh(),se!==r?(oe=vt(),M=se):(B=M,M=r),M===r&&(M=null),se=[],oe=B,Ct=rc(),Ct!==r?(Mt=vt(),oe=Ct):(B=oe,oe=r),oe!==r)for(;oe!==r;)se.push(oe),oe=B,Ct=rc(),Ct!==r?(Mt=vt(),oe=Ct):(B=oe,oe=r);else se=r;return se!==r?(Ye=b,b=An(W,M,se)):(B=b,b=r),b}function tc(){var b,O,W,M,se;return b=B,e.charCodeAt(B)===123?(O=s,B++):(O=r,te===0&&pe(gi)),O!==r?(W=ht(),W!==r?(e.charCodeAt(B)===125?(M=o,B++):(M=r,te===0&&pe(zi)),M!==r?(se=Qi(),se!==r?(Ye=b,b=Us(W)):(B=b,b=r)):(B=b,b=r)):(B=b,b=r)):(B=b,b=r),b}function Bh(){var b,O,W;return b=B,O=ht(),O!==r?(W=Qi(),W!==r?(Ye=b,b=Vr(O)):(B=b,b=r)):(B=b,b=r),b}function rc(){var b,O,W,M,se,oe,Ct,Mt;return b=B,O=_u(),O!==r?(W=vt(),M=B,se=Mn(),se!==r?(oe=vt(),M=se):(B=M,M=r),M===r&&(M=null),e.charCodeAt(B)===61?(se=l,B++):(se=r,te===0&&pe(uu)),se!==r?(oe=vt(),Ct=Rr(),Ct!==r?(Mt=Qi(),Mt!==r?(Ye=b,b=br(O,M,Ct)):(B=b,b=r)):(B=b,b=r)):(B=b,b=r)):(B=b,b=r),b}function Rr(){var b,O,W,M,se,oe,Ct,Mt;if(b=B,O=_a(),O!==r){for(W=[],M=B,se=vt(),e.charCodeAt(B)===47?(oe=h,B++):(oe=r,te===0&&pe(ou)),oe!==r?(Ct=vt(),Mt=_a(),Mt!==r?M=Mt:(B=M,M=r)):(B=M,M=r);M!==r;)W.push(M),M=B,se=vt(),e.charCodeAt(B)===47?(oe=h,B++):(oe=r,te===0&&pe(ou)),oe!==r?(Ct=vt(),Mt=_a(),Mt!==r?M=Mt:(B=M,M=r)):(B=M,M=r);Ye=b,b=Hs(O,W)}else B=b,b=r;return b}function _a(){var b,O,W,M,se;return b=B,O=Ia(),O!==r?(W=B,M=vt(),se=ht(),se!==r?W=se:(B=W,W=r),W===r&&(W=null),Ye=b,b=Hn(O,W)):(B=b,b=r),b}function Ia(){var b,O,W,M,se,oe;if(b=B,O=Cu(),O!==r){for(W=[],M=B,se=vt(),oe=Cu(),oe!==r?M=oe:(B=M,M=r);M!==r;)W.push(M),M=B,se=vt(),oe=Cu(),oe!==r?M=oe:(B=M,M=r);Ye=b,b=Ca(O,W)}else B=b,b=r;return b}function Cu(){var b,O,W,M;return b=B,O=ll(),O!==r?(W=fl(),W===r&&(W=null),M=nc(),M!==r?(Ye=b,b=Eh(O,W,M)):(B=b,b=r)):(B=b,b=r),b===r&&(b=B,O=fl(),O!==r?(W=vt(),M=nc(),M!==r?(Ye=b,b=Ah(O,M)):(B=b,b=r)):(B=b,b=r),b===r&&(b=nc())),b}function ll(){var b,O;return b=B,e.charCodeAt(B)===64?(O=d,B++):(O=r,te===0&&pe(cu)),O!==r&&(Ye=b,O=Dt()),b=O,b}function fl(){var b,O,W,M;return b=B,O=_u(),O!==r?(W=vt(),e.charCodeAt(B)===58?(M=E,B++):(M=r,te===0&&pe(lu)),M!==r?(Ye=b,b=Ft(O)):(B=b,b=r)):(B=b,b=r),b}function nc(){var b,O,W,M;return b=B,O=$h(),O!==r?(W=vt(),M=hl(),M!==r?(Ye=b,b=wh(O,M)):(B=b,b=r)):(B=b,b=r),b===r&&(b=hl()),b}function $h(){var b;return e.charCodeAt(B)===36?(b=p,B++):(b=r,te===0&&pe(fu)),b===r&&(e.charCodeAt(B)===38?(b=f,B++):(b=r,te===0&&pe(hu)),b===r&&(e.charCodeAt(B)===33?(b=w,B++):(b=r,te===0&&pe(pu)))),b}function hl(){var b,O,W,M;return b=B,O=Xi(),O!==r?(W=vt(),M=Ph(),M!==r?(Ye=b,b=yh(O,M)):(B=b,b=r)):(B=b,b=r),b===r&&(b=Xi()),b}function Ph(){var b;return e.charCodeAt(B)===63?(b=g,B++):(b=r,te===0&&pe(Do)),b===r&&(e.charCodeAt(B)===42?(b=y,B++):(b=r,te===0&&pe(du)),b===r&&(e.charCodeAt(B)===43?(b=A,B++):(b=r,te===0&&pe(Bo)))),b}function Xi(){var b,O,W,M,se,oe;return b=kh(),b===r&&(b=ue(),b===r&&(b=Bu(),b===r&&(b=Rh(),b===r&&(b=Th(),b===r&&(b=B,e.charCodeAt(B)===40?(O=S,B++):(O=r,te===0&&pe($o)),O!==r?(W=vt(),M=Rr(),M!==r?(se=vt(),e.charCodeAt(B)===41?(oe=_,B++):(oe=r,te===0&&pe(Po)),oe!==r?(Ye=b,b=Sh(M)):(B=b,b=r)):(B=b,b=r)):(B=b,b=r)))))),b}function Rh(){var b,O,W,M,se,oe,Ct,Mt;return b=B,O=_u(),O!==r?(W=B,te++,M=B,se=vt(),oe=B,Ct=Mn(),Ct!==r?(Mt=vt(),Ct=[Ct,Mt],oe=Ct):(B=oe,oe=r),oe===r&&(oe=null),e.charCodeAt(B)===61?(Ct=l,B++):(Ct=r,te===0&&pe(uu)),Ct!==r?(se=[se,oe,Ct],M=se):(B=M,M=r),te--,M===r?W=void 0:(B=W,W=r),W!==r?(Ye=b,b=bh(O)):(B=b,b=r)):(B=b,b=r),b}function Th(){var b,O,W,M;return b=B,O=ic(),O!==r?(W=vt(),M=ht(),M!==r?(Ye=b,b=Ch(O,M)):(B=b,b=r)):(B=b,b=r),b}function ic(){var b;return e.charCodeAt(B)===38?(b=f,B++):(b=r,te===0&&pe(hu)),b===r&&(e.charCodeAt(B)===33?(b=w,B++):(b=r,te===0&&pe(pu))),b}function Cr(){var b;return e.length>B?(b=e.charAt(B),B++):(b=r,te===0&&pe(Ns)),b}function Sn(){var b,O;return te++,e.charCodeAt(B)===9?(b=I,B++):(b=r,te===0&&pe(ma)),b===r&&(e.charCodeAt(B)===11?(b=D,B++):(b=r,te===0&&pe(To)),b===r&&(e.charCodeAt(B)===12?(b=H,B++):(b=r,te===0&&pe(xo)),b===r&&(e.charCodeAt(B)===32?(b=V,B++):(b=r,te===0&&pe(Oo)),b===r&&(e.charCodeAt(B)===160?(b=F,B++):(b=r,te===0&&pe(No)),b===r&&(e.charCodeAt(B)===65279?(b=P,B++):(b=r,te===0&&pe(ko)),b===r&&(b=Al())))))),te--,b===r&&(O=r,te===0&&pe(Ro)),b}function bn(){var b;return Zt.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(Lo)),b}function Fu(){var b,O;return te++,e.charCodeAt(B)===10?(b=k,B++):(b=r,te===0&&pe(Ho)),b===r&&(e.substr(B,2)===L?(b=L,B+=2):(b=r,te===0&&pe(mi)),b===r&&(e.charCodeAt(B)===13?(b=q,B++):(b=r,te===0&&pe(gu)),b===r&&(e.charCodeAt(B)===8232?(b=J,B++):(b=r,te===0&&pe(jo)),b===r&&(e.charCodeAt(B)===8233?(b=z,B++):(b=r,te===0&&pe(Mo)))))),te--,b===r&&(O=r,te===0&&pe(Uo)),b}function pl(){var b,O;return te++,b=xh(),b===r&&(b=nn()),te--,b===r&&(O=r,te===0&&pe(qo)),b}function xh(){var b,O,W,M,se,oe;if(b=B,e.substr(B,2)===K?(O=K,B+=2):(O=r,te===0&&pe(mu)),O!==r){for(W=[],M=B,se=B,te++,e.substr(B,2)===X?(oe=X,B+=2):(oe=r,te===0&&pe(vi)),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);M!==r;)W.push(M),M=B,se=B,te++,e.substr(B,2)===X?(oe=X,B+=2):(oe=r,te===0&&pe(vi)),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);e.substr(B,2)===X?(M=X,B+=2):(M=r,te===0&&pe(vi)),M!==r?(O=[O,W,M],b=O):(B=b,b=r)}else B=b,b=r;return b}function Ji(){var b,O,W,M,se,oe;if(b=B,e.substr(B,2)===K?(O=K,B+=2):(O=r,te===0&&pe(mu)),O!==r){for(W=[],M=B,se=B,te++,e.substr(B,2)===X?(oe=X,B+=2):(oe=r,te===0&&pe(vi)),oe===r&&(oe=bn()),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);M!==r;)W.push(M),M=B,se=B,te++,e.substr(B,2)===X?(oe=X,B+=2):(oe=r,te===0&&pe(vi)),oe===r&&(oe=bn()),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);e.substr(B,2)===X?(M=X,B+=2):(M=r,te===0&&pe(vi)),M!==r?(O=[O,W,M],b=O):(B=b,b=r)}else B=b,b=r;return b}function nn(){var b,O,W,M,se,oe;if(b=B,e.substr(B,2)===ie?(O=ie,B+=2):(O=r,te===0&&pe(en)),O!==r){for(W=[],M=B,se=B,te++,oe=bn(),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);M!==r;)W.push(M),M=B,se=B,te++,oe=bn(),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);O=[O,W],b=O}else B=b,b=r;return b}function _u(){var b,O,W,M;if(te++,b=B,O=dl(),O!==r){for(W=[],M=gl();M!==r;)W.push(M),M=gl();Ye=b,b=Fh(O,W)}else B=b,b=r;return te--,b===r&&(O=r,te===0&&pe(Vo)),b}function dl(){var b,O,W;return b=Oh(),b===r&&(e.charCodeAt(B)===36?(b=p,B++):(b=r,te===0&&pe(fu)),b===r&&(e.charCodeAt(B)===95?(b=be,B++):(b=r,te===0&&pe(ks)),b===r&&(b=B,e.charCodeAt(B)===92?(O=ye,B++):(O=r,te===0&&pe(En)),O!==r?(W=ml(),W!==r?b=W:(B=b,b=r)):(B=b,b=r)))),b}function gl(){var b;return b=dl(),b===r&&(b=Nh(),b===r&&(b=vl(),b===r&&(b=El(),b===r&&(e.charCodeAt(B)===8204?(b=$e,B++):(b=r,te===0&&pe(Ko)),b===r&&(e.charCodeAt(B)===8205?(b=qe,B++):(b=r,te===0&&pe(Go))))))),b}function Oh(){var b;return b=Ru(),b===r&&(b=Pu(),b===r&&(b=Mh(),b===r&&(b=Hh(),b===r&&(b=jh(),b===r&&(b=xu()))))),b}function Nh(){var b;return b=Tu(),b===r&&(b=wi()),b}function kh(){var b,O,W;return te++,b=B,O=Mn(),O!==r?(e.charCodeAt(B)===105?(W=ce,B++):(W=r,te===0&&pe(va)),W===r&&(W=null),Ye=b,b=Qc(O,W)):(B=b,b=r),te--,b===r&&(O=r,te===0&&pe(vu)),b}function Mn(){var b,O,W,M;if(te++,b=B,e.charCodeAt(B)===34?(O=_e,B++):(O=r,te===0&&pe(Ls)),O!==r){for(W=[],M=re();M!==r;)W.push(M),M=re();e.charCodeAt(B)===34?(M=_e,B++):(M=r,te===0&&pe(Ls)),M!==r?(Ye=b,b=_h(W)):(B=b,b=r)}else B=b,b=r;if(b===r)if(b=B,e.charCodeAt(B)===39?(O=Le,B++):(O=r,te===0&&pe(Ht)),O!==r){for(W=[],M=le();M!==r;)W.push(M),M=le();e.charCodeAt(B)===39?(M=Le,B++):(M=r,te===0&&pe(Ht)),M!==r?(Ye=b,b=er(W)):(B=b,b=r)}else B=b,b=r;return te--,b===r&&(O=r,te===0&&pe(Eu)),b}function re(){var b,O,W,M;return b=B,O=B,W=B,te++,e.charCodeAt(B)===34?(M=_e,B++):(M=r,te===0&&pe(Ls)),M===r&&(e.charCodeAt(B)===92?(M=ye,B++):(M=r,te===0&&pe(En)),M===r&&(M=bn())),te--,M===r?W=void 0:(B=W,W=r),W!==r?(M=Cr(),M!==r?(W=[W,M],O=W):(B=O,O=r)):(B=O,O=r),O!==r?b=e.substring(b,B):b=O,b===r&&(b=B,e.charCodeAt(B)===92?(O=ye,B++):(O=r,te===0&&pe(En)),O!==r?(W=Ot(),W!==r?b=W:(B=b,b=r)):(B=b,b=r),b===r&&(b=ct())),b}function le(){var b,O,W,M;return b=B,O=B,W=B,te++,e.charCodeAt(B)===39?(M=Le,B++):(M=r,te===0&&pe(Ht)),M===r&&(e.charCodeAt(B)===92?(M=ye,B++):(M=r,te===0&&pe(En)),M===r&&(M=bn())),te--,M===r?W=void 0:(B=W,W=r),W!==r?(M=Cr(),M!==r?(W=[W,M],O=W):(B=O,O=r)):(B=O,O=r),O!==r?b=e.substring(b,B):b=O,b===r&&(b=B,e.charCodeAt(B)===92?(O=ye,B++):(O=r,te===0&&pe(En)),O!==r?(W=Ot(),W!==r?b=W:(B=b,b=r)):(B=b,b=r),b===r&&(b=ct())),b}function ue(){var b,O,W,M,se,oe;if(te++,b=B,e.charCodeAt(B)===91?(O=lr,B++):(O=r,te===0&&pe(Yo)),O!==r){for(e.charCodeAt(B)===94?(W=Bt,B++):(W=r,te===0&&pe(Au)),W===r&&(W=null),M=[],se=Re(),se===r&&(se=Ge());se!==r;)M.push(se),se=Re(),se===r&&(se=Ge());e.charCodeAt(B)===93?(se=pt,B++):(se=r,te===0&&pe(Ei)),se!==r?(e.charCodeAt(B)===105?(oe=ce,B++):(oe=r,te===0&&pe(va)),oe===r&&(oe=null),Ye=b,b=Xo(W,M,oe)):(B=b,b=r)}else B=b,b=r;return te--,b===r&&(O=r,te===0&&pe(zo)),b}function Re(){var b,O,W,M;return b=B,O=Ge(),O!==r?(e.charCodeAt(B)===45?(W=zt,B++):(W=r,te===0&&pe(hr)),W!==r?(M=Ge(),M!==r?(Ye=b,b=Yi(O,M)):(B=b,b=r)):(B=b,b=r)):(B=b,b=r),b}function Ge(){var b,O,W,M;return b=B,O=B,W=B,te++,e.charCodeAt(B)===93?(M=pt,B++):(M=r,te===0&&pe(Ei)),M===r&&(e.charCodeAt(B)===92?(M=ye,B++):(M=r,te===0&&pe(En)),M===r&&(M=bn())),te--,M===r?W=void 0:(B=W,W=r),W!==r?(M=Cr(),M!==r?(W=[W,M],O=W):(B=O,O=r)):(B=O,O=r),O!==r?b=e.substring(b,B):b=O,b===r&&(b=B,e.charCodeAt(B)===92?(O=ye,B++):(O=r,te===0&&pe(En)),O!==r?(W=Ot(),W!==r?b=W:(B=b,b=r)):(B=b,b=r),b===r&&(b=ct())),b}function ct(){var b,O,W;return b=B,e.charCodeAt(B)===92?(O=ye,B++):(O=r,te===0&&pe(En)),O!==r?(W=Fu(),W!==r?(Ye=b,b=el()):(B=b,b=r)):(B=b,b=r),b}function Ot(){var b,O,W,M;return b=bt(),b===r&&(b=B,e.charCodeAt(B)===48?(O=Tt,B++):(O=r,te===0&&pe(Rt)),O!==r?(W=B,te++,M=Zi(),te--,M===r?W=void 0:(B=W,W=r),W!==r?(Ye=b,b=Jo()):(B=b,b=r)):(B=b,b=r),b===r&&(b=Du(),b===r&&(b=ml()))),b}function bt(){var b;return b=Iu(),b===r&&(b=Lh()),b}function Iu(){var b,O;return e.charCodeAt(B)===39?(b=Le,B++):(b=r,te===0&&pe(Ht)),b===r&&(e.charCodeAt(B)===34?(b=_e,B++):(b=r,te===0&&pe(Ls)),b===r&&(e.charCodeAt(B)===92?(b=ye,B++):(b=r,te===0&&pe(En)),b===r&&(b=B,e.charCodeAt(B)===98?(O=nt,B++):(O=r,te===0&&pe(Wo)),O!==r&&(Ye=b,O=tn()),b=O,b===r&&(b=B,e.charCodeAt(B)===102?(O=It,B++):(O=r,te===0&&pe(Ea)),O!==r&&(Ye=b,O=tl()),b=O,b===r&&(b=B,e.charCodeAt(B)===110?(O=tt,B++):(O=r,te===0&&pe(pr)),O!==r&&(Ye=b,O=rl()),b=O,b===r&&(b=B,e.charCodeAt(B)===114?(O=gt,B++):(O=r,te===0&&pe(Aa)),O!==r&&(Ye=b,O=nl()),b=O,b===r&&(b=B,e.charCodeAt(B)===116?(O=Yt,B++):(O=r,te===0&&pe(wu)),O!==r&&(Ye=b,O=il()),b=O,b===r&&(b=B,e.charCodeAt(B)===118?(O=Je,B++):(O=r,te===0&&pe(yu)),O!==r&&(Ye=b,O=sl()),b=O)))))))),b}function Lh(){var b,O,W,M;return b=B,O=B,W=B,te++,M=sn(),M===r&&(M=bn()),te--,M===r?W=void 0:(B=W,W=r),W!==r?(M=Cr(),M!==r?(W=[W,M],O=W):(B=O,O=r)):(B=O,O=r),O!==r?b=e.substring(b,B):b=O,b}function sn(){var b;return b=Iu(),b===r&&(b=Zi(),b===r&&(e.charCodeAt(B)===120?(b=Ut,B++):(b=r,te===0&&pe(wa)),b===r&&(e.charCodeAt(B)===117?(b=Un,B++):(b=r,te===0&&pe(Ai))))),b}function Du(){var b,O,W,M,se,oe;return b=B,e.charCodeAt(B)===120?(O=Ut,B++):(O=r,te===0&&pe(wa)),O!==r?(W=B,M=B,se=ni(),se!==r?(oe=ni(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r),M!==r?W=e.substring(W,B):W=M,W!==r?(Ye=b,b=al(W)):(B=b,b=r)):(B=b,b=r),b}function ml(){var b,O,W,M,se,oe,Ct,Mt;return b=B,e.charCodeAt(B)===117?(O=Un,B++):(O=r,te===0&&pe(Ai)),O!==r?(W=B,M=B,se=ni(),se!==r?(oe=ni(),oe!==r?(Ct=ni(),Ct!==r?(Mt=ni(),Mt!==r?(se=[se,oe,Ct,Mt],M=se):(B=M,M=r)):(B=M,M=r)):(B=M,M=r)):(B=M,M=r),M!==r?W=e.substring(W,B):W=M,W!==r?(Ye=b,b=Kr(W)):(B=b,b=r)):(B=b,b=r),b}function Zi(){var b;return $r.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(ya)),b}function ni(){var b;return la.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(Su)),b}function Bu(){var b,O;return b=B,e.charCodeAt(B)===46?(O=fr,B++):(O=r,te===0&&pe(Sa)),O!==r&&(Ye=b,O=Ih()),b=O,b}function ht(){var b,O,W,M;return te++,b=B,e.charCodeAt(B)===123?(O=s,B++):(O=r,te===0&&pe(gi)),O!==r?(W=Uh(),e.charCodeAt(B)===125?(M=o,B++):(M=r,te===0&&pe(zi)),M!==r?b=W:(B=b,b=r)):(B=b,b=r),te--,b===r&&(O=r,te===0&&pe(ba)),b}function Uh(){var b,O;return b=B,O=$u(),Ye=b,O=rn(O),b=O,b}function $u(){var b,O,W,M,se,oe;if(b=B,O=[],W=[],M=B,se=B,te++,Mr.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,te===0&&pe(qr)),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r),M!==r)for(;M!==r;)W.push(M),M=B,se=B,te++,Mr.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,te===0&&pe(qr)),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);else W=r;for(W===r&&(W=B,e.charCodeAt(B)===123?(M=s,B++):(M=r,te===0&&pe(gi)),M!==r?(se=$u(),e.charCodeAt(B)===125?(oe=o,B++):(oe=r,te===0&&pe(zi)),oe!==r?(M=[M,se,oe],W=M):(B=W,W=r)):(B=W,W=r));W!==r;){if(O.push(W),W=[],M=B,se=B,te++,Mr.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,te===0&&pe(qr)),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r),M!==r)for(;M!==r;)W.push(M),M=B,se=B,te++,Mr.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,te===0&&pe(qr)),te--,oe===r?se=void 0:(B=se,se=r),se!==r?(oe=Cr(),oe!==r?(se=[se,oe],M=se):(B=M,M=r)):(B=M,M=r);else W=r;W===r&&(W=B,e.charCodeAt(B)===123?(M=s,B++):(M=r,te===0&&pe(gi)),M!==r?(se=$u(),e.charCodeAt(B)===125?(oe=o,B++):(oe=r,te===0&&pe(zi)),oe!==r?(M=[M,se,oe],W=M):(B=W,W=r)):(B=W,W=r))}return b=e.substring(b,B),b}function Pu(){var b;return mt.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(R)),b}function Hh(){var b;return Qt.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(x)),b}function jh(){var b;return Ze.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(j)),b}function Mh(){var b;return Pr.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(Q)),b}function Ru(){var b;return fa.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(de)),b}function wi(){var b;return ha.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(ve)),b}function Tu(){var b;return pa.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(Fe)),b}function vl(){var b;return da.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(Pe)),b}function xu(){var b;return Gi.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(St)),b}function El(){var b;return ga.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(jt)),b}function Al(){var b;return Os.test(e.charAt(B))?(b=e.charAt(B),B++):(b=r,te===0&&pe(yr)),b}function vt(){var b,O;for(b=[],O=Sn(),O===r&&(O=Fu(),O===r&&(O=pl()));O!==r;)b.push(O),O=Sn(),O===r&&(O=Fu(),O===r&&(O=pl()));return b}function wl(){var b,O;for(b=[],O=Sn(),O===r&&(O=Ji());O!==r;)b.push(O),O=Sn(),O===r&&(O=Ji());return b}function Qi(){var b,O,W,M;return b=B,O=vt(),e.charCodeAt(B)===59?(W=wr,B++):(W=r,te===0&&pe(Sr)),W!==r?(O=[O,W],b=O):(B=b,b=r),b===r&&(b=B,O=wl(),W=nn(),W===r&&(W=null),M=Fu(),M!==r?(O=[O,W,M],b=O):(B=b,b=r),b===r&&(b=B,O=vt(),W=es(),W!==r?(O=[O,W],b=O):(B=b,b=r))),b}function es(){var b,O;return b=B,te++,e.length>B?(O=e.charAt(B),B++):(O=r,te===0&&pe(Ns)),te--,O===r?b=void 0:(B=b,b=r),b}let Ou=t.reservedWords||[];if(yn=a(),yn!==r&&B===e.length)return yn;throw yn!==r&&B<e.length&&pe(Dh()),cl(Fa,Gr<e.length?e.charAt(Gr):null,Gr<e.length?Wi(Gr,Gr+1):Wi(Gr,Gr))}fw.exports={SyntaxError:ca,parse:o7}});var Zc=we((nN,pw)=>{"use strict";var c7=lh(),l7=lw(),f7=hw(),h7=D0(),p7=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","null","true","false","enum","implements","interface","let","package","private","protected","public","static","yield","await"],Jc={VERSION:h7,RESERVED_WORDS:p7,GrammarError:c7,parser:f7,compiler:l7,generate(e,t){t=t!==void 0?t:{};function r(a){let s={};return Object.keys(a).forEach(o=>{s[o]=a[o].slice()}),s}let n="plugins"in t?t.plugins:[],i={parser:Jc.parser,passes:r(Jc.compiler.passes),reservedWords:Jc.RESERVED_WORDS.slice()};return n.forEach(a=>{a.use(i,t)}),Jc.compiler.compile(i.parser.parse(e,{grammarSource:t.grammarSource,reservedWords:i.reservedWords}),i.passes,t)}};pw.exports=Jc});var Gl="2.19.18";var Op="schemaVersion",Yn="settings",Wn="subs",zs="collections",Na="files",kg="modules",ui="artifacts",Ec="rules",Np="tokens";var Lg="Sub-Store Artifacts Repository",ka="#sub-store-cached-resource",La="#sub-store-cached-headers-resource",zl="#sub-store-chr-expiration-time";var Ua="#sub-store-cached-script-resource",Yl="#sub-store-csr-expiration-time";var Ys=typeof $task<"u",ls=typeof $loon<"u",Ws=typeof $httpClient<"u"&&!ls,Ci=eval('typeof process !== "undefined"'),Ug=typeof $environment<"u"&&$environment["stash-version"],Hg=typeof $rocket<"u",B3=typeof egern=="object",$3=typeof $native<"u",Xs=typeof $Plugins<"u",Wl=class{constructor(name="untitled",debug=!1){if(this.name=name,this.debug=debug,this.http=oi(),this.env=Dn(),Ci){let dotenv=eval('require("dotenv")');dotenv.config()}this.node=(()=>{if(Ci){let fs=eval("require('fs')");return{fs}}else return null})(),this.initCache();let delay=(e,t)=>new Promise(function(r){setTimeout(r.bind(null,t),e)});Promise.prototype.delay=async function(e){let t=await this;return await delay(e,t)}}initCache(){if(Ys&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}")),(ls||Ws)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),Xs&&(this.cache=JSON.parse($Plugins.SubStoreCache.get(this.name)||"{}")),Ci){let basePath=eval("process.env.SUB_STORE_DATA_BASE_PATH")||".",rootPath=`${basePath}/root.json`;this.log(`Root path: ${rootPath}`),this.node.fs.existsSync(rootPath)?this.root=JSON.parse(this.node.fs.readFileSync(`${rootPath}`)):(this.node.fs.writeFileSync(rootPath,JSON.stringify({}),{flag:"wx"}),this.root={});let fpath=`${basePath}/${this.name}.json`;this.log(`Data path: ${fpath}`),this.node.fs.existsSync(fpath)?this.cache=JSON.parse(this.node.fs.readFileSync(`${fpath}`)):(this.node.fs.writeFileSync(fpath,JSON.stringify({}),{flag:"wx"}),this.cache={})}}persistCache(){let data=JSON.stringify(this.cache,null,2);if(Ys&&$prefs.setValueForKey(data,this.name),(ls||Ws)&&$persistentStore.write(data,this.name),Xs&&$Plugins.SubStoreCache.set(this.name,data),Ci){let basePath=eval("process.env.SUB_STORE_DATA_BASE_PATH")||".";this.node.fs.writeFileSync(`${basePath}/${this.name}.json`,data,{flag:"w"},e=>console.log(e)),this.node.fs.writeFileSync(`${basePath}/root.json`,JSON.stringify(this.root,null,2),{flag:"w"},e=>console.log(e))}}write(e,t){if(this.log(`SET ${t}`),t.indexOf("#")!==-1){if(t=t.substr(1),Ws||ls)return $persistentStore.write(e,t);if(Ys)return $prefs.setValueForKey(e,t);if(Ci&&(this.root[t]=e),Xs)return $Plugins.SubStoreCache.set(t,e)}else this.cache[t]=e;this.persistCache()}read(e){if(this.log(`READ ${e}`),e.indexOf("#")!==-1){if(e=e.substr(1),Ws||ls)return $persistentStore.read(e);if(Ys)return $prefs.valueForKey(e);if(Ci)return this.root[e];if(Xs)return $Plugins.SubStoreCache.get(e)}else return this.cache[e]}delete(e){if(this.log(`DELETE ${e}`),e.indexOf("#")!==-1){if(e=e.substr(1),Ws||ls)return $persistentStore.write(null,e);if(Ys)return $prefs.removeValueForKey(e);if(Ci&&delete this.root[e],Xs)return $Plugins.SubStoreCache.remove(e)}else delete this.cache[e];this.persistCache()}notify(title,subtitle="",content="",options={}){let openURL=options["open-url"],mediaURL=options["media-url"];if(Ys&&$notify(title,subtitle,content,options),Ws&&$notification.post(title,subtitle,content+`${mediaURL?`
\u591A\u5A92\u4F53:`+mediaURL:""}`,{url:openURL}),ls){let e={};openURL&&(e.openUrl=openURL),mediaURL&&(e.mediaUrl=mediaURL),JSON.stringify(e)==="{}"?$notification.post(title,subtitle,content):$notification.post(title,subtitle,content,e)}if(Ci){let content_=content+(openURL?`
\u70B9\u51FB\u8DF3\u8F6C: ${openURL}`:"")+(mediaURL?`
\u591A\u5A92\u4F53: ${mediaURL}`:"");console.log(`${title}
${subtitle}
${content_}
`);let push=eval("process.env.SUB_STORE_PUSH_SERVICE");if(push){let e=push.replace("[\u63A8\u9001\u6807\u9898]",encodeURIComponent(title||"Sub-Store")).replace("[\u63A8\u9001\u5185\u5BB9]",encodeURIComponent([subtitle,content_].map(r=>r).join(`
`)));oi().get({url:e}).then(r=>{console.log(`[Push Service] URL: ${e}
RES: ${r.statusCode} ${r.body}`)}).catch(r=>{console.log(`[Push Service] URL: ${e}
ERROR: ${r}`)})}}Xs&&$Plugins.Notify(title,subtitle+`
`+content)}log(e){this.debug&&console.log(`[${this.name}] LOG: ${e}`)}info(e){console.log(`[${this.name}] INFO: ${e}`)}error(e){console.log(`[${this.name}] ERROR: ${e}`)}wait(e){return new Promise(t=>setTimeout(t,e))}done(e={}){Ys||ls||Ws||Xs?$done(e):Ci&&typeof $context<"u"&&($context.headers=e.headers,$context.statusCode=e.statusCode,$context.body=e.body)}};function Dn(){return{isQX:Ys,isLoon:ls,isSurge:Ws,isNode:Ci,isStash:Ug,isShadowRocket:Hg,isEgern:B3,isLanceX:$3,isGUIforCores:Xs}}function oi(defaultOptions={baseURL:""}){let{isQX,isLoon,isSurge,isNode,isGUIforCores}=Dn(),methods=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],URL_REGEX=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;function send(method,options){options=typeof options=="string"?{url:options}:options;let baseURL=defaultOptions.baseURL;baseURL&&!URL_REGEX.test(options.url||"")&&(options.url=baseURL?baseURL+options.url:options.url),options={...defaultOptions,...options};let timeout=options.timeout,events={onRequest:()=>{},onResponse:e=>e,onTimeout:()=>{},...options.events};if(events.onRequest(method,options),options.node&&isSurge){let e=$environment["surge-build"];e&&parseInt(e)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}let worker;isQX?worker=$task.fetch({method,url:options.url,headers:options.headers,body:options.body,opts:options.opts}):isLoon||isSurge||isNode?worker=new Promise(async(resolve,reject)=>{let body=options.body,opts=JSON.parse(JSON.stringify(options));if(opts.body=body,opts.timeout=opts.timeout||8e3,opts.timeout&&(opts.timeout++,isNaN(opts.timeout)&&(opts.timeout=8e3),!isNode)){let e="ms";(isSurge||Ug||Hg)&&(opts.timeout=Math.ceil(opts.timeout/1e3),e="s")}if(isNode){let undici=eval("require('undici')"),{ProxyAgent,EnvHttpProxyAgent,request,interceptors}=undici,agentOpts={connect:{rejectUnauthorized:!(opts.strictSSL===!1||opts.insecure===!0)},bodyTimeout:opts.timeout,headersTimeout:opts.timeout};try{let e=new URL(opts.url);(e.username||e.password)&&(opts.headers={...opts.headers||{},Authorization:`Basic ${Buffer.from(`${e.username||""}:${e.password||""}`).toString("base64")}`});let t=await request(opts.url,{...opts,method:method.toUpperCase(),dispatcher:(opts.proxy?new ProxyAgent({...agentOpts,uri:opts.proxy}):new EnvHttpProxyAgent(agentOpts)).compose(interceptors.redirect({maxRedirections:3,throwOnMaxRedirects:!0}))});resolve({statusCode:t.statusCode,headers:t.headers,body:opts.encoding===null?await t.body.arrayBuffer():await t.body.text()})}catch(e){reject(e)}}else $httpClient[method.toLowerCase()](opts,(e,t,r)=>{e?reject(e):resolve({statusCode:t.status||t.statusCode,headers:t.headers,body:r})})}):isGUIforCores&&(worker=new Promise(async(e,t)=>{try{let r=await $Plugins.Requests({method,url:options.url,headers:options.headers,body:options.body,options:{Proxy:options.proxy,Timeout:options.timeout?options.timeout/1e3:15}});e({statusCode:r.status,headers:r.headers,body:r.body})}catch(r){t(r)}}));let timeoutid,timer=timeout?new Promise((e,t)=>{timeoutid=setTimeout(()=>(events.onTimeout(),t(`${method} URL: ${options.url} exceeds the timeout ${timeout} ms`)),timeout)}):null;return(timer?Promise.race([timer,worker]).then(e=>(typeof clearTimeout<"u"&&clearTimeout(timeoutid),e)):worker).then(e=>events.onResponse(e))}let http={};return methods.forEach(e=>http[e.toLowerCase()]=t=>send(e,t)),http}var P3=new Wl("sub-store"),G=P3;function kp(){R3()}function R3(){let e=G.read(Op);e||T3(),e!=="2.0"&&G.write("2.0",Op)}function T3(){G.info("Start migrating...");let e=G.read(Wn)||{},t=Object.values(e).map(w=>(w.source=w.source||"remote",p(w),f(w),w));G.write(t,Wn);let r=G.read(zs)||{},n=Object.values(r).map(w=>(delete w.ua,p(w),f(w),w));G.write(n,zs);let i=G.read(ui)||{},a=Object.values(i);G.write(a,ui);let s=G.read(Ec)||{},o=Object.values(s);G.write(o,Ec);let l=G.read(Na)||{},h=Object.values(l);G.write(h,Na);let d=G.read(Np)||{},E=Object.values(d);G.write(E,Np),delete G.cache.builtin,G.info("Migration complete!");function p(w){let g=w["display-name"];g&&(w.displayName=g,delete w["display-name"])}function f(w){let g=w.process;if(!g||g.length===0)return;let y=[],A={type:"Quick Setting Operator",args:{udp:"DEFAULT",tfo:"DEFAULT",scert:"DEFAULT","vmess aead":"DEFAULT",useless:"DEFAULT"}};for(let S of g)if(S.type){if(S.type==="Useless Filter")A.args.useless="ENABLED";else if(S.type==="Set Property Operator"){let{key:_,value:I}=S.args;switch(_){case"udp":A.args.udp=I?"ENABLED":"DISABLED";break;case"tfo":A.args.tfo=I?"ENABLED":"DISABLED";break;case"skip-cert-verify":A.args.scert=I?"ENABLED":"DISABLED";break;case"aead":A.args["vmess aead"]=I?"ENABLED":"DISABLED";break}}else if(S.type.indexOf("Keyword")===-1)if(S.type==="Flag Operator"){let _=typeof S.args>"u"?!0:S.args;S.args={mode:_?"add":"remove"},y.push(S)}else y.push(S)}y.unshift(A),w.process=y}}function Lp({substore:$,port,host}){let{isNode}=Dn(),DEFAULT_HEADERS={"Content-Type":"text/plain;charset=UTF-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST,GET,OPTIONS,PATCH,PUT,DELETE","Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept","X-Powered-By":"Sub-Store"};if(isNode){let express_=eval('require("express")'),bodyParser=eval('require("body-parser")'),app=express_();return app.use(bodyParser.json({verify:rawBodySaver,limit:eval("process.env.SUB_STORE_BODY_JSON_LIMIT")||"1mb"})),app.use(bodyParser.urlencoded({verify:rawBodySaver,extended:!0})),app.use(bodyParser.raw({verify:rawBodySaver,type:"*/*"})),app.use((e,t,r)=>{t.set(DEFAULT_HEADERS),r()}),app.start=()=>{let e=app.listen(port,host,()=>{let{address:t,port:r}=e.address();$.info(`[BACKEND] ${t}:${r}`)})},app}let handlers=[],METHODS_NAMES=["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD'","ALL"],dispatch=(e,t=0)=>{let{method:r,url:n,headers:i,body:a}=e;i=x3(i),/json/i.test(i["content-type"])&&(a=JSON.parse(a)),r=r.toUpperCase();let{path:s,query:o}=N3(n),l=null,h,d=0;for(h=t;h<handlers.length;h++)if(handlers[h].method==="ALL"||r===handlers[h].method){let{pattern:E}=handlers[h];O3(E,s)&&E.split("/").length>d&&(l=handlers[h],d=E.split("/").length)}if(l){let E=()=>{dispatch(r,n,h)},p={method:r,url:n,path:s,query:o,params:jg(l.pattern,s),headers:i,body:a},f=Response(),w=l.callback,g=y=>{f.status(500).json({status:"failed",message:`Internal Server Error: ${y}`})};if(w.constructor.name==="AsyncFunction")w(p,f,E).catch(g);else try{w(p,f,E)}catch(y){g(y)}}else Response().status(404).json({status:"failed",message:"ERROR: 404 not found"})},app={};return METHODS_NAMES.forEach(e=>{app[e.toLowerCase()]=(t,r)=>{handlers.push({method:e,pattern:t,callback:r})}}),app.route=e=>{let t={};return METHODS_NAMES.forEach(r=>{t[r.toLowerCase()]=n=>(handlers.push({method:r,pattern:e,callback:n}),t)}),t},app.start=()=>{dispatch($request)},app;function rawBodySaver(e,t,r,n){r&&r.length&&(e.rawBody=r.toString(n||"utf8"))}function Response(){let e=200,{isQX:t,isLoon:r,isSurge:n,isGUIforCores:i}=Dn(),a=DEFAULT_HEADERS,s={200:"HTTP/1.1 200 OK",201:"HTTP/1.1 201 Created",302:"HTTP/1.1 302 Found",307:"HTTP/1.1 307 Temporary Redirect",308:"HTTP/1.1 308 Permanent Redirect",404:"HTTP/1.1 404 Not Found",500:"HTTP/1.1 500 Internal Server Error"};return new class{status(o){return e=o,this}send(o=""){let l={status:t?s[e]:e,body:o,headers:a};t||i?$done(l):(r||n)&&$done({response:l})}end(){this.send()}html(o){this.set("Content-Type","text/html;charset=UTF-8"),this.send(o)}json(o){this.set("Content-Type","application/json;charset=UTF-8"),this.send(JSON.stringify(o))}set(o,l){return a[o]=l,this}}}}function x3(e){let t={};for(let r of Object.keys(e))t[r.toLowerCase()]=e[r];return t}function O3(e,t){if(e instanceof RegExp&&e.test(t))return!0;if(e==="/")return!0;if(e.indexOf(":")===-1){let r=t.split("/"),n=e.split("/");for(let i=0;i<n.length;i++)if(r[i]!==n[i])return!1;return!0}else if(jg(e,t))return!0;return!1}function N3(e){let r=(e.match(/https?:\/\/[^/]+(\/[^?]*)/)||[])[1]||"/",n=e.indexOf("?"),i={};if(n!==-1){let a=e.slice(e.indexOf("?")+1).split("&");for(let s=0;s<a.length;s++){let o=a[s].split("=");i[o[0]]=o[1]}}return{path:r,query:i}}function jg(e,t){if(e.indexOf(":")===-1)return null;{let r={};for(let n=0,i=0;n<e.length;n++,i++)if(e[n]===":"){let a=[],s=[];for(;e[++n]!=="/"&&n<e.length;)a.push(e[n]);for(;t[i]!=="/"&&i<t.length;)s.push(t[i++]);r[a.join("")]=s.join("")}else if(e[n]!==t[i])return null;return r}}var tf=ln(sm()),fm=ln(lm());function cb(e){let t=Object.keys(e),r="",n="",i="";for(let a of t){let s=a.toLowerCase();s==="user-agent"?(r=e[a],n=r.toLowerCase()):s==="accept"&&(i=e[a])}return{UA:r,ua:n,accept:i}}function hm({ua:e,UA:t,accept:r}){return t.indexOf("Quantumult%20X")!==-1?"QX":e.indexOf("egern")!==-1?"Egern":t.indexOf("Surfboard")!==-1?"Surfboard":t.indexOf("Surge Mac")!==-1?"SurgeMac":t.indexOf("Surge")!==-1?"Surge":t.indexOf("Decar")!==-1||t.indexOf("Loon")!==-1?"Loon":t.indexOf("Shadowrocket")!==-1?"Shadowrocket":t.indexOf("Stash")!==-1?"Stash":e==="meta"||e.indexOf("clash")!==-1&&e.indexOf("meta")!==-1||e.indexOf("clash-verge")!==-1||e.indexOf("flclash")!==-1?"ClashMeta":e.indexOf("clash")!==-1?"Clash":e.indexOf("v2ray")!==-1?"V2Ray":e.indexOf("sing-box")!==-1||e.indexOf("singbox")!==-1?"sing-box":r.indexOf("application/json")===0?"JSON":"V2Ray"}function Kp(e){let{UA:t,ua:r,accept:n}=cb(e);return hm({ua:r,UA:t,accept:n})}function Gp(e,t){try{let r=hm({UA:t,ua:t.toLowerCase()});if(!["Stash","Egern","Loon"].includes(r))return!1;let n=(0,fm.default)(t);G.log(JSON.stringify(n,null,2));let{version:i}=n;if(e==="Stash"&&r==="Stash"&&(0,tf.default)(i,"3.1.0")||e==="Egern"&&r==="Egern"&&(0,tf.default)(i,"1.29.0")||e==="Loon"&&r==="Loon"&&(0,tf.default)(i,"842.0.0"))return!0}catch(r){G.error(`\u83B7\u53D6\u7248\u672C\u53F7\u5931\u8D25: ${r}`)}return!1}var G0=ln(af());var yd=ln(rv());function x8(e){let t=yd.default.pemtohex(e);return yd.default.KJUR.crypto.Util.hashHex(t,"sha256").match(/.{2}/g).join(":").toUpperCase()}var nv={generateFingerprint:x8};var Pc=ln(W2());function X2(e,t,...r){try{return e(t,...r)}catch{return e(J2(e(t.replace(/!<str>\s*/g,"__SubStoreJSYAMLString__"),...r)).replace(/__SubStoreJSYAMLString__/g,""),...r)}}function Pf(e,...t){return X2(Pc.default.safeLoad,JSON.parse(JSON.stringify(e)),...t)}function f9(e,...t){return X2(Pc.default.load,JSON.parse(JSON.stringify(e)),...t)}function h9(e,...t){return Pc.default.safeDump(JSON.parse(JSON.stringify(e)),...t)}function J2(e,...t){return Pc.default.dump(JSON.parse(JSON.stringify(e)),...t)}var Ja={safeLoad:Pf,load:f9,safeDump:h9,dump:J2};var xd=0;function li(e){return d9(p9(g9(e)))}function p9(e){return v9(E9(m9(e),e.length*8))}function d9(e){try{}catch{xd=0}for(var t=xd?"0123456789ABCDEF":"0123456789abcdef",r="",n,i=0;i<e.length;i++)n=e.charCodeAt(i),r+=t.charAt(n>>>4&15)+t.charAt(n&15);return r}function g9(e){for(var t="",r=-1,n,i;++r<e.length;)n=e.charCodeAt(r),i=r+1<e.length?e.charCodeAt(r+1):0,55296<=n&&n<=56319&&56320<=i&&i<=57343&&(n=65536+((n&1023)<<10)+(i&1023),r++),n<=127?t+=String.fromCharCode(n):n<=2047?t+=String.fromCharCode(192|n>>>6&31,128|n&63):n<=65535?t+=String.fromCharCode(224|n>>>12&15,128|n>>>6&63,128|n&63):n<=2097151&&(t+=String.fromCharCode(240|n>>>18&7,128|n>>>12&63,128|n>>>6&63,128|n&63));return t}function m9(e){for(var t=Array(e.length>>2),r=0;r<t.length;r++)t[r]=0;for(var r=0;r<e.length*8;r+=8)t[r>>5]|=(e.charCodeAt(r/8)&255)<<r%32;return t}function v9(e){for(var t="",r=0;r<e.length*32;r+=8)t+=String.fromCharCode(e[r>>5]>>>r%32&255);return t}function E9(e,t){e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;for(var r=1732584193,n=-271733879,i=-1732584194,a=271733878,s=0;s<e.length;s+=16){var o=r,l=n,h=i,d=a;r=kr(r,n,i,a,e[s+0],7,-680876936),a=kr(a,r,n,i,e[s+1],12,-389564586),i=kr(i,a,r,n,e[s+2],17,606105819),n=kr(n,i,a,r,e[s+3],22,-1044525330),r=kr(r,n,i,a,e[s+4],7,-176418897),a=kr(a,r,n,i,e[s+5],12,1200080426),i=kr(i,a,r,n,e[s+6],17,-1473231341),n=kr(n,i,a,r,e[s+7],22,-45705983),r=kr(r,n,i,a,e[s+8],7,1770035416),a=kr(a,r,n,i,e[s+9],12,-1958414417),i=kr(i,a,r,n,e[s+10],17,-42063),n=kr(n,i,a,r,e[s+11],22,-1990404162),r=kr(r,n,i,a,e[s+12],7,1804603682),a=kr(a,r,n,i,e[s+13],12,-40341101),i=kr(i,a,r,n,e[s+14],17,-1502002290),n=kr(n,i,a,r,e[s+15],22,1236535329),r=Lr(r,n,i,a,e[s+1],5,-165796510),a=Lr(a,r,n,i,e[s+6],9,-1069501632),i=Lr(i,a,r,n,e[s+11],14,643717713),n=Lr(n,i,a,r,e[s+0],20,-373897302),r=Lr(r,n,i,a,e[s+5],5,-701558691),a=Lr(a,r,n,i,e[s+10],9,38016083),i=Lr(i,a,r,n,e[s+15],14,-660478335),n=Lr(n,i,a,r,e[s+4],20,-405537848),r=Lr(r,n,i,a,e[s+9],5,568446438),a=Lr(a,r,n,i,e[s+14],9,-1019803690),i=Lr(i,a,r,n,e[s+3],14,-187363961),n=Lr(n,i,a,r,e[s+8],20,1163531501),r=Lr(r,n,i,a,e[s+13],5,-1444681467),a=Lr(a,r,n,i,e[s+2],9,-51403784),i=Lr(i,a,r,n,e[s+7],14,1735328473),n=Lr(n,i,a,r,e[s+12],20,-1926607734),r=Ur(r,n,i,a,e[s+5],4,-378558),a=Ur(a,r,n,i,e[s+8],11,-2022574463),i=Ur(i,a,r,n,e[s+11],16,1839030562),n=Ur(n,i,a,r,e[s+14],23,-35309556),r=Ur(r,n,i,a,e[s+1],4,-1530992060),a=Ur(a,r,n,i,e[s+4],11,1272893353),i=Ur(i,a,r,n,e[s+7],16,-155497632),n=Ur(n,i,a,r,e[s+10],23,-1094730640),r=Ur(r,n,i,a,e[s+13],4,681279174),a=Ur(a,r,n,i,e[s+0],11,-358537222),i=Ur(i,a,r,n,e[s+3],16,-722521979),n=Ur(n,i,a,r,e[s+6],23,76029189),r=Ur(r,n,i,a,e[s+9],4,-640364487),a=Ur(a,r,n,i,e[s+12],11,-421815835),i=Ur(i,a,r,n,e[s+15],16,530742520),n=Ur(n,i,a,r,e[s+2],23,-995338651),r=Hr(r,n,i,a,e[s+0],6,-198630844),a=Hr(a,r,n,i,e[s+7],10,1126891415),i=Hr(i,a,r,n,e[s+14],15,-1416354905),n=Hr(n,i,a,r,e[s+5],21,-57434055),r=Hr(r,n,i,a,e[s+12],6,1700485571),a=Hr(a,r,n,i,e[s+3],10,-1894986606),i=Hr(i,a,r,n,e[s+10],15,-1051523),n=Hr(n,i,a,r,e[s+1],21,-2054922799),r=Hr(r,n,i,a,e[s+8],6,1873313359),a=Hr(a,r,n,i,e[s+15],10,-30611744),i=Hr(i,a,r,n,e[s+6],15,-1560198380),n=Hr(n,i,a,r,e[s+13],21,1309151649),r=Hr(r,n,i,a,e[s+4],6,-145523070),a=Hr(a,r,n,i,e[s+11],10,-1120210379),i=Hr(i,a,r,n,e[s+2],15,718787259),n=Hr(n,i,a,r,e[s+9],21,-343485551),r=ra(r,o),n=ra(n,l),i=ra(i,h),a=ra(a,d)}return Array(r,n,i,a)}function Rf(e,t,r,n,i,a){return ra(A9(ra(ra(t,e),ra(n,a)),i),r)}function kr(e,t,r,n,i,a,s){return Rf(t&r|~t&n,e,t,i,a,s)}function Lr(e,t,r,n,i,a,s){return Rf(t&n|r&~n,e,t,i,a,s)}function Ur(e,t,r,n,i,a,s){return Rf(t^r^n,e,t,i,a,s)}function Hr(e,t,r,n,i,a,s){return Rf(r^(t|~n),e,t,i,a,s)}function ra(e,t){var r=(e&65535)+(t&65535),n=(e>>16)+(t>>16)+(r>>16);return n<<16|r&65535}function A9(e,t){return e<<t|e>>>32-t}var jf=ln(lE()),K9=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,G9=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function or(e){return K9.test(e)}function Jt(e){return G9.test(e)}function fE(e){return/^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$/.test(e)}function Ti(e){return typeof e=="string"&&e.trim().length>0}function Lt(e,t){return Ti(e)?e:t}function ho(e){return typeof e<"u"&&e!==null}function eu(e,t){return ho(e)?e:t}function As(e){return e?/^.+?\s*?=\s*?.+?\s*?,.+?/.test(e)?{"policy-descriptor":e}:{policy:e}:{}}function z9(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function xc(e){let t=e.split(/,|\//),r=t[Math.floor(Math.random()*t.length)];if(r.includes("-")){let[n,i]=r.split("-").map(Number);return z9(n,i)}else return Number(r)}function hE(e){return Number.isSafeInteger(e)?String(e):BigInt(e).toString()}function Mf(e){return typeof e=="string"&&/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)}var Gd=class{constructor(t){this.expires=t,G.read(ka)||G.write("{}",ka);try{this.resourceCache=JSON.parse(G.read(ka))}catch(r){G.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${ka} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${r?.message??r}`),this.resourceCache={},G.write("{}",ka)}this._cleanup()}_cleanup(){let t=!1;Object.entries(this.resourceCache).forEach(r=>{let[n,i]=r;i.time||(delete this.resourceCache[n],G.delete(`#${n}`),t=!0),new Date().getTime()-i.time>this.expires&&(delete this.resourceCache[n],t=!0)}),t&&this._persist()}revokeAll(){this.resourceCache={},this._persist()}_persist(){G.write(JSON.stringify(this.resourceCache),ka)}get(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].data:null}set(t,r){this.resourceCache[t]={time:new Date().getTime(),data:r},this._persist()}},Er=new Gd(36e5);var zd=class{constructor(){this.expires=W9(),G.read(La)||G.write("{}",La);try{this.resourceCache=JSON.parse(G.read(La))}catch(t){G.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${La} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${t?.message??t}`),this.resourceCache={},G.write("{}",La)}this._cleanup()}_cleanup(){let t=!1;Object.entries(this.resourceCache).forEach(r=>{let[n,i]=r;i.time||(delete this.resourceCache[n],G.delete(`#${n}`),t=!0),new Date().getTime()-i.time>this.expires&&(delete this.resourceCache[n],t=!0)}),t&&this._persist()}revokeAll(){this.resourceCache={},this._persist()}_persist(){G.write(JSON.stringify(this.resourceCache),La)}get(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].data:null}gettime(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].time:null}set(t,r){this.resourceCache[t]={time:new Date().getTime(),data:r},this._persist()}};function W9(){G.read(zl)||G.write("6e4",zl);let e=6e4;if(G.env.isLoon){let t={"1\u5206\u949F":6e4,"5\u5206\u949F":3e5,"10\u5206\u949F":6e5,"30\u5206\u949F":18e5,"1\u5C0F\u65F6":36e5,"2\u5C0F\u65F6":72e5,"3\u5C0F\u65F6":108e5,"6\u5C0F\u65F6":216e5,"12\u5C0F\u65F6":432e5,"24\u5C0F\u65F6":864e5,"48\u5C0F\u65F6":1728e5,"72\u5C0F\u65F6":2592e5,\u53C2\u6570\u4F20\u5165:"readcachets"},r=G.read("#\u54CD\u5E94\u5934\u7F13\u5B58\u6709\u6548\u671F");return r in t&&(e=t[r],e==="readcachets"&&(e=r)),e}else return e=G.read(zl),e}var Oc=new zd;function po(e){let t=Object.keys(e),r="",n="";for(let i of t){let a=i.toLowerCase();a==="subscription-userinfo"?r=e[i]:a==="profile-web-page-url"&&(n=e[i])}return`${r||""}${n?`; app_url=${encodeURIComponent(n)}`:""}`}async function xi(rawUrl,ua,timeout,customProxy,flowUrl){let url=flowUrl||rawUrl||"",$arguments={},rawArgs=url.split("#");if(url=url.split("#")[0],rawArgs.length>1)try{$arguments=JSON.parse(decodeURIComponent(rawArgs[1]))}catch{for(let t of rawArgs[1].split("&")){let r=t.split("=")[0],n=t.split("=")[1];$arguments[r]=n==null||n===""?!0:decodeURIComponent(n)}}if($arguments?.noFlow)return;let{isStash,isLoon,isShadowRocket,isQX}=Dn(),insecure=$arguments?.insecure?G.env.isNode?{strictSSL:!1}:{insecure:!0}:void 0,{defaultProxy,defaultFlowUserAgent,defaultTimeout}=G.read(Yn),proxy=customProxy||defaultProxy;G.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY"));let userAgent=ua||defaultFlowUserAgent||"clash",requestTimeout=timeout||defaultTimeout||8e3,id=li(userAgent+url),cached=Oc.get(id),flowInfo;if(!$arguments?.noCache&&cached)G.info(`\u4F7F\u7528\u7F13\u5B58\u7684\u6D41\u91CF\u4FE1\u606F: ${url}, ${userAgent}`),flowInfo=cached;else{let e=oi();if(flowUrl){G.info(`\u4F7F\u7528 GET \u65B9\u6CD5\u4ECE\u54CD\u5E94\u4F53\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F: ${flowUrl}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}`);let{body:t}=await e.get({url:flowUrl,headers:{"User-Agent":userAgent},timeout:requestTimeout,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?As(proxy):{},...insecure||{}});flowInfo=t}else{try{G.info(`\u4F7F\u7528 HEAD \u65B9\u6CD5\u4ECE\u54CD\u5E94\u5934\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F: ${url}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}`);let{headers:t}=await e.head({url:url.split(/[\r\n]+/).map(r=>r.trim()).filter(r=>r.length)[0],headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?As(proxy):{},...insecure||{}});flowInfo=po(t)}catch(t){G.error(`\u4F7F\u7528 HEAD \u65B9\u6CD5\u4ECE\u54CD\u5E94\u5934\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u5931\u8D25: ${url}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}: ${t.message??t}`)}if(!flowInfo){G.info(`\u4F7F\u7528 GET \u65B9\u6CD5\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F: ${url}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}`);let{headers:t}=await e.get({url:url.split(/[\r\n]+/).map(r=>r.trim()).filter(r=>r.length)[0],headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?As(proxy):{},...insecure||{}});flowInfo=po(t)}}flowInfo&&(flowInfo=flowInfo.trim()),flowInfo&&Oc.set(id,flowInfo)}return flowInfo}function qf(e){if(!e)return;let t=e.match(/upload=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),r=Number(t[1]+t[2]),n=e.match(/download=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),i=Number(n[1]+n[2]),a=e.match(/total=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),s=Number(a[1]+a[2]),o=e.match(/expire=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),l=o?Number(o[1]+o[2]):void 0,h=e.match(/reset_day=([0-9]+)/),d=h?Number(h[1]):void 0,E=e.match(/app_url=(.*?)\s*?(;|$)/),p=E?decodeURIComponent(E[1]):void 0,f=e.match(/plan_name=(.*?)\s*?(;|$)/),w=f?decodeURIComponent(f[1]):void 0;return{expires:l,total:s,usage:{upload:r,download:i},remainingDays:d,appUrl:p,planName:w}}function Nc(e,t="B"){let r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=r.indexOf(t);return e<1024||n===r.length-1?{value:e.toFixed(1),unit:t}:Nc(e/1024,r[++n])}function Vf(e){if(!e)throw new Error("\u6CA1\u6709\u6D41\u91CF\u4FE1\u606F");if(e?.expires&&e.expires*1e3<Date.now()){let t=new Date(e.expires*1e3).toLocaleDateString();throw new Error(`\u8BA2\u9605\u5DF2\u8FC7\u671F: ${t}`)}if(e?.total){let t=e.usage?.upload||0,r=e.usage?.download||0;if(e.total-t-r<0){let n=t+r,i=Nc(Math.abs(n));i.value=n<0?"-"+i.value:i.value;let a=Nc(e.total);throw new Error(`\u6D41\u91CF\u5DF2\u7528\u5B8C: ${i.value} ${i.unit} / ${a.value} ${a.unit}`)}}}function pE(e={}){try{let{resetDay:t,startDate:r,cycleDays:n}=e;if(["string","number"].includes(typeof e)&&(t=e),r&&n){if(n=parseInt(n),isNaN(n)||n<=0)throw new Error("\u91CD\u7F6E\u5468\u671F\u5E94\u4E3A\u6B63\u6574\u6570");if(!r||!Date.parse(r))throw new Error("\u5F00\u59CB\u65E5\u671F\u4E0D\u5408\u6CD5");let i=new Date(r),a=new Date;if(i.setHours(0,0,0,0),a.setHours(0,0,0,0),i.getTime()>a.getTime())throw new Error("\u5F00\u59CB\u65E5\u671F\u5E94\u65E9\u4E8E\u73B0\u5728");let s=new Date(r);for(s.setDate(s.getDate()+n);s<a;)s.setDate(s.getDate()+n);s.setHours(0,0,0,0);let o=s.getTime()-a.getTime();return Math.ceil(o/(1e3*3600*24))}else{if(!t)return;if(t=parseInt(t),isNaN(t)||t<=0||t>31)throw new Error("\u6708\u91CD\u7F6E\u65E5\u5E94\u4E3A 1-31 \u4E4B\u95F4\u7684\u6574\u6570");let i=new Date,a=i.getDate(),s=i.getMonth(),o=i.getFullYear(),l;return t>a?l=0:l=new Date(o,s+1,0).getDate(),l-a+t}}catch(t){G.error(`getRmainingDays failed: ${t.message??t}`)}}function go(e){try{let t=new Map;return e.split(";").map(r=>r.trim()).filter(Boolean).forEach(r=>{let n=r.indexOf("=");if(n===-1)return;let i=r.slice(0,n).trim(),a=r.slice(n+1).trim();if(!t.has(i))try{let s=decodeURIComponent(a);t.set(i,s)}catch{t.set(i,a)}}),Array.from(t.entries()).map(([r,n])=>`${r}=${encodeURIComponent(n)}`).join("; ")}catch(t){return G.error(`normalizeFlowHeader failed: ${t.message??t}`),e}}var AE="3.7.7",X9=AE,vo=typeof Buffer=="function",dE=typeof TextDecoder=="function"?new TextDecoder:void 0,gE=typeof TextEncoder=="function"?new TextEncoder:void 0,J9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",kc=Array.prototype.slice.call(J9),Kf=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(kc),Z9=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_r=String.fromCharCode.bind(String),mE=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),wE=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),yE=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),SE=e=>{let t,r,n,i,a="",s=e.length%3;for(let o=0;o<e.length;){if((r=e.charCodeAt(o++))>255||(n=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,a+=kc[t>>18&63]+kc[t>>12&63]+kc[t>>6&63]+kc[t&63]}return s?a.slice(0,s-3)+"===".substring(s):a},Xd=typeof btoa=="function"?e=>btoa(e):vo?e=>Buffer.from(e,"binary").toString("base64"):SE,Yd=vo?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,i=e.length;n<i;n+=4096)r.push(_r.apply(null,e.subarray(n,n+4096)));return Xd(r.join(""))},Gf=(e,t=!1)=>t?wE(Yd(e)):Yd(e),Q9=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?_r(192|t>>>6)+_r(128|t&63):_r(224|t>>>12&15)+_r(128|t>>>6&63)+_r(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return _r(240|t>>>18&7)+_r(128|t>>>12&63)+_r(128|t>>>6&63)+_r(128|t&63)}},eD=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,bE=e=>e.replace(eD,Q9),vE=vo?e=>Buffer.from(e,"utf8").toString("base64"):gE?e=>Yd(gE.encode(e)):e=>Xd(bE(e)),mo=(e,t=!1)=>t?wE(vE(e)):vE(e),EE=e=>mo(e,!0),tD=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,rD=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return _r((r>>>10)+55296)+_r((r&1023)+56320);case 3:return _r((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return _r((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},CE=e=>e.replace(tD,rD),FE=e=>{if(e=e.replace(/\s+/g,""),!Z9.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r="",n,i;for(let a=0;a<e.length;)t=Kf[e.charAt(a++)]<<18|Kf[e.charAt(a++)]<<12|(n=Kf[e.charAt(a++)])<<6|(i=Kf[e.charAt(a++)]),r+=n===64?_r(t>>16&255):i===64?_r(t>>16&255,t>>8&255):_r(t>>16&255,t>>8&255,t&255);return r},Jd=typeof atob=="function"?e=>atob(yE(e)):vo?e=>Buffer.from(e,"base64").toString("binary"):FE,_E=vo?e=>mE(Buffer.from(e,"base64")):e=>mE(Jd(e).split("").map(t=>t.charCodeAt(0))),IE=e=>_E(DE(e)),nD=vo?e=>Buffer.from(e,"base64").toString("utf8"):dE?e=>dE.decode(_E(e)):e=>CE(Jd(e)),DE=e=>yE(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Wd=e=>nD(DE(e)),iD=e=>{if(typeof e!="string")return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},BE=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),$E=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,BE(r));e("fromBase64",function(){return Wd(this)}),e("toBase64",function(t){return mo(this,t)}),e("toBase64URI",function(){return mo(this,!0)}),e("toBase64URL",function(){return mo(this,!0)}),e("toUint8Array",function(){return IE(this)})},PE=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,BE(r));e("toBase64",function(t){return Gf(this,t)}),e("toBase64URI",function(){return Gf(this,!0)}),e("toBase64URL",function(){return Gf(this,!0)})},sD=()=>{$E(),PE()},Et={version:AE,VERSION:X9,atob:Jd,atobPolyfill:FE,btoa:Xd,btoaPolyfill:SE,fromBase64:Wd,toBase64:mo,encode:mo,encodeURI:EE,encodeURL:EE,utob:bE,btou:CE,decode:Wd,isValid:iD,fromUint8Array:Gf,toUint8Array:IE,extendString:$E,extendUint8Array:PE,extendBuiltins:sD};function aD(){return{name:"HTML",test:n=>/^<!DOCTYPE html>/.test(n),parse:()=>""}}function uD(){let e="Base64 Pre-processor",t=["dm1lc3M","c3NyOi8v","c29ja3M6Ly","dHJvamFu","c3M6Ly","c3NkOi8v","c2hhZG93","aHR0c","dmxlc3M=","aHlzdGVyaWEy","aHkyOi8v","d2lyZWd1YXJkOi8v","d2c6Ly8=","dHVpYzovLw=="];return{name:e,test:function(i){return!/^\w+:\/\/\w+/im.test(i)&&t.some(a=>i.indexOf(a)!==-1)},parse:function(i){let a=Et.decode(i);return/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(a)?a:(G.error("Base64 Pre-processor error: decoded line does not start with protocol"),i)}}}function oD(){return{name:"Clash Pre-processor",test:function(n){if(!/proxies/.test(n))return!1;let i=Pf(n);return i.proxies&&Array.isArray(i.proxies)},parse:function(n,i){let a=n.replace(/short-id:([ \t]*[^#\n,}]*)/g,(l,h)=>{let d=h.trim();return!d||d===""?'short-id: ""':/^(['"]).*\1$/.test(d)?`short-id: ${d}`:["null"].includes(d)?`short-id: ${d}`:`short-id: "${d}"`}),{proxies:s,"global-client-fingerprint":o}=Pf(a);return(i?`proxies:
`:"")+s.map(l=>(o&&!l["client-fingerprint"]&&(l["client-fingerprint"]=o),`${i?" - ":""}${JSON.stringify(l)}
`)).join("")}}}function cD(){return{name:"SSD Pre-processor",test:function(n){return n.indexOf("ssd://")===0},parse:function(n){let i=[],a=JSON.parse(Et.decode(n.split("ssd://")[1])),s=a.port,o=a.encryption,l=a.password,h=a.servers;for(let d=0;d<h.length;d++){let E=h[d];o=E.encryption?E.encryption:o,l=E.password?E.password:l;let p=Et.encode(o+":"+l),f=E.server;s=E.port?E.port:s;let w=E.remarks?E.remarks:d,g=E.plugin_options?"/?plugin="+encodeURIComponent(E.plugin+";"+E.plugin_options):"";i[d]="ss://"+p+"@"+f+":"+s+g+"#"+w}return i.join(`
`)}}}function lD(){return{name:"Full Config Preprocessor",test:function(n){return/^(\[server_local\]|\[Proxy\])/gm.test(n)},parse:function(n){return n.match(/^\[server_local|Proxy\]([\s\S]+?)^\[.+?\](\r?\n|$)/im)?.[1]||n}}}var zf=[aD(),oD(),uD(),cD(),lD()];var RE=zf.find(e=>e.name==="Clash Pre-processor"),Zd=new Map;async function Ir(rawUrl="",ua,timeout,customProxy,skipCustomCache,awaitCustomCache,noCache,preprocess){let $arguments={},url=rawUrl.replace(/#noFlow$/,""),rawArgs=url.split("#");if(url=url.split("#")[0],rawArgs.length>1)try{$arguments=JSON.parse(decodeURIComponent(rawArgs[1]))}catch{for(let t of rawArgs[1].split("&")){let r=t.split("=")[0],n=t.split("=")[1];$arguments[r]=n==null||n===""?!0:decodeURIComponent(n)}}let{isNode,isStash,isLoon,isShadowRocket,isQX}=Dn(),{defaultProxy,defaultUserAgent,defaultTimeout,cacheThreshold:defaultCacheThreshold}=G.read(Yn),cacheThreshold=defaultCacheThreshold||1024,proxy=customProxy||defaultProxy;G.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY"));let userAgent=ua||defaultUserAgent||"clash.meta",requestTimeout=timeout||defaultTimeout||8e3,id=li(userAgent+url);$arguments?.cacheKey===!0&&(G.error("\u4F7F\u7528\u81EA\u5B9A\u4E49\u7F13\u5B58\u65F6 cacheKey \u7684\u503C\u4E0D\u80FD\u4E3A\u7A7A"),$arguments.cacheKey=void 0);let customCacheKey=$arguments?.cacheKey?`#sub-store-cached-custom-${$arguments?.cacheKey}`:void 0;if(customCacheKey&&!skipCustomCache){let e=G.read(customCacheKey),t=Er.get(id);if(!noCache&&!$arguments?.noCache&&t)return G.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
\u5B58\u5728\u6709\u6548\u7684\u5E38\u89C4\u7F13\u5B58
\u4F7F\u7528\u5E38\u89C4\u7F13\u5B58\u4EE5\u907F\u514D\u91CD\u590D\u8BF7\u6C42`),t;if(e){if(awaitCustomCache){G.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
\u672C\u6B21\u8FDB\u884C\u8BF7\u6C42 \u5C1D\u8BD5\u66F4\u65B0\u7F13\u5B58`);try{await Ir(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess)}catch(r){G.error(`\u4E50\u89C2\u7F13\u5B58: URL ${url} \u66F4\u65B0\u7F13\u5B58\u53D1\u751F\u9519\u8BEF ${r.message??r}`),G.info("\u4F7F\u7528\u4E50\u89C2\u7F13\u5B58\u7684\u6570\u636E\u5237\u65B0\u7F13\u5B58, \u9632\u6B62\u540E\u7EED\u8BF7\u6C42"),Er.set(id,e)}}else G.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
\u672C\u6B21\u8FD4\u56DE\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}
\u5E76\u8FDB\u884C\u8BF7\u6C42 \u5C1D\u8BD5\u5F02\u6B65\u66F4\u65B0\u7F13\u5B58`),Ir(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess).catch(r=>{G.error(`\u4E50\u89C2\u7F13\u5B58: URL ${url} \u5F02\u6B65\u66F4\u65B0\u7F13\u5B58\u53D1\u751F\u9519\u8BEF ${r.message??r}`)});return e}}if(!isNode&&Zd.has(id))return Zd.get(id);let http=oi({headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout}),result,cached=Er.get(id);if(!noCache&&!$arguments?.noCache&&cached)G.info(`\u4F7F\u7528\u7F13\u5B58: ${url}, ${userAgent}`),result=cached,customCacheKey&&(G.info(`URL ${url}
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),G.write(cached,customCacheKey));else{let e=$arguments?.insecure?isNode?{strictSSL:!1}:{insecure:!0}:void 0;G.info(`Downloading...
User-Agent: ${userAgent}
Timeout: ${requestTimeout}
Proxy: ${proxy}
Insecure: ${!!e}
Preprocess: ${preprocess}
URL: ${url}`);try{let{body:t,headers:r,statusCode:n}=await http.get({url,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?As(proxy):{},...e||{}});if(G.info(`statusCode: ${n}`),n<200||n>=400)throw new Error(`statusCode: ${n}`);if(r){let a=po(r);a&&Oc.set(id,a)}if(t.replace(/\s/g,"").length===0)throw new Error(new Error("\u8FDC\u7A0B\u8D44\u6E90\u5185\u5BB9\u4E3A\u7A7A"));if(preprocess)try{RE.test(t)&&(t=RE.parse(t,!0))}catch(a){G.error(`Clash Pre-processor error: ${a}`)}let i=!0;if(cacheThreshold){let a=t.length/1024;a>cacheThreshold&&(G.info(`\u8D44\u6E90\u5927\u5C0F ${a.toFixed(2)} KB \u8D85\u8FC7\u4E86 ${cacheThreshold} KB, \u4E0D\u7F13\u5B58`),i=!1)}i&&(Er.set(id,t),customCacheKey&&(G.info(`URL ${url}
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),G.write(t,customCacheKey))),result=t}catch(t){if(customCacheKey){let r=G.read(customCacheKey);if(r)return G.info(`\u65E0\u6CD5\u4E0B\u8F7D URL ${url}: ${t.message??t}
\u4F7F\u7528\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),r}throw new Error(`\u65E0\u6CD5\u4E0B\u8F7D URL ${url}: ${t.message??t}`)}}return $arguments?.validCheck&&await Vf(qf(await xi(url,$arguments.flowUserAgent,void 0,proxy,$arguments.flowUrl))),isNode||Zd.set(id,result),result}var Qd=class{constructor(){this.expires=fD(),G.read(Ua)||G.write("{}",Ua);try{this.resourceCache=JSON.parse(G.read(Ua))}catch(t){G.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${Ua} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${t?.message??t}`),this.resourceCache={},G.write("{}",Ua)}this._cleanup()}_cleanup(t,r){let n=!1;Object.entries(this.resourceCache).forEach(i=>{let[a,s]=i;s.time||(delete this.resourceCache[a],G.delete(`#${a}`),n=!0),(new Date().getTime()-s.time>(r??this.expires)||t&&a.startsWith(t))&&(delete this.resourceCache[a],n=!0)}),n&&this._persist()}revokeAll(){this.resourceCache={},this._persist()}_persist(){G.write(JSON.stringify(this.resourceCache),Ua)}get(t,r,n){let i=this.resourceCache[t]&&this.resourceCache[t].time;if(i){if(new Date().getTime()-i<=(r??this.expires))return this.resourceCache[t].data;n&&(delete this.resourceCache[t],this._persist())}return null}gettime(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].time:null}set(t,r){this.resourceCache[t]={time:new Date().getTime(),data:r},this._persist()}};function fD(){G.read(Yl)||G.write("1728e5",Yl);let e=1728e5;if(G.env.isLoon){let t={"1\u5206\u949F":6e4,"5\u5206\u949F":3e5,"10\u5206\u949F":6e5,"30\u5206\u949F":18e5,"1\u5C0F\u65F6":36e5,"2\u5C0F\u65F6":72e5,"3\u5C0F\u65F6":108e5,"6\u5C0F\u65F6":216e5,"12\u5C0F\u65F6":432e5,"24\u5C0F\u65F6":864e5,"48\u5C0F\u65F6":1728e5,"72\u5C0F\u65F6":2592e5,\u53C2\u6570\u4F20\u5165:"readcachets"},r=G.read("#\u8282\u70B9\u7F13\u5B58\u6709\u6548\u671F");return r in t&&(e=t[r],e==="readcachets"&&(e=r)),e}else return e=G.read(Yl),e}var e0=new Qd;function Yf(e,t){return[...Array(e).keys()].map(()=>t)}var t0={"\u{1F3F3}\uFE0F\u200D\u{1F308}":["EXP","BAND"],"\u{1F1F8}\u{1F1F1}":["TEST","SOS"],"\u{1F1E6}\u{1F1E9}":["AD","AND"],"\u{1F1E6}\u{1F1EA}":["AE","ARE"],"\u{1F1E6}\u{1F1EB}":["AF","AFG"],"\u{1F1E6}\u{1F1F1}":["AL","ALB"],"\u{1F1E6}\u{1F1F2}":["AM","ARM"],"\u{1F1E6}\u{1F1F7}":["AR","ARG"],"\u{1F1E6}\u{1F1F9}":["AT","AUT"],"\u{1F1E6}\u{1F1FA}":["AU","AUS"],"\u{1F1E6}\u{1F1FF}":["AZ","AZE"],"\u{1F1E7}\u{1F1E6}":["BA","BIH"],"\u{1F1E7}\u{1F1E9}":["BD","BGD"],"\u{1F1E7}\u{1F1EA}":["BE","BEL"],"\u{1F1E7}\u{1F1EC}":["BG","BGR"],"\u{1F1E7}\u{1F1ED}":["BH","BHR"],"\u{1F1E7}\u{1F1F4}":["BO","BOL"],"\u{1F1E7}\u{1F1F3}":["BN","BRN"],"\u{1F1E7}\u{1F1F7}":["BR","BRA"],"\u{1F1E7}\u{1F1F9}":["BT","BTN"],"\u{1F1E7}\u{1F1FE}":["BY","BLR"],"\u{1F1E8}\u{1F1E6}":["CA","CAN"],"\u{1F1E8}\u{1F1ED}":["CH","CHE"],"\u{1F1E8}\u{1F1F1}":["CL","CHL"],"\u{1F1E8}\u{1F1F4}":["CO","COL"],"\u{1F1E8}\u{1F1F7}":["CR","CRI"],"\u{1F1E8}\u{1F1FE}":["CY","CYP"],"\u{1F1E8}\u{1F1FF}":["CZ","CZE"],"\u{1F1E9}\u{1F1EA}":["DE","DEU"],"\u{1F1E9}\u{1F1F0}":["DK","DNK"],"\u{1F1EA}\u{1F1E8}":["EC","ECU"],"\u{1F1EA}\u{1F1EA}":["EE","EST"],"\u{1F1EA}\u{1F1EC}":["EG","EGY"],"\u{1F1EA}\u{1F1F8}":["ES","ESP"],"\u{1F1EA}\u{1F1FA}":["EU"],"\u{1F1EB}\u{1F1EE}":["FI","FIN"],"\u{1F1EB}\u{1F1F7}":["FR","FRA"],"\u{1F1EC}\u{1F1E7}":["GB","GBR","UK"],"\u{1F1EC}\u{1F1EA}":["GE","GEO"],"\u{1F1EC}\u{1F1F7}":["GR","GRC"],"\u{1F1EC}\u{1F1F9}":["GT","GTM"],"\u{1F1EC}\u{1F1FA}":["GU","GUM"],"\u{1F1ED}\u{1F1F0}":["HK","HKG","HKT","HKBN","HGC","WTT","CMI"],"\u{1F1ED}\u{1F1F7}":["HR","HRV"],"\u{1F1ED}\u{1F1FA}":["HU","HUN"],"\u{1F1EF}\u{1F1F4}":["JO","JOR"],"\u{1F1EF}\u{1F1F5}":["JP","JPN","TYO"],"\u{1F1F0}\u{1F1EA}":["KE","KEN"],"\u{1F1F0}\u{1F1EC}":["KG","KGZ"],"\u{1F1F0}\u{1F1ED}":["KH","KGZ"],"\u{1F1F0}\u{1F1F5}":["KP","PRK"],"\u{1F1F0}\u{1F1F7}":["KR","KOR","SEL"],"\u{1F1F0}\u{1F1FF}":["KZ","KAZ"],"\u{1F1EE}\u{1F1E9}":["ID","IDN"],"\u{1F1EE}\u{1F1EA}":["IE","IRL"],"\u{1F1EE}\u{1F1F1}":["IL","ISR"],"\u{1F1EE}\u{1F1F2}":["IM","IMN"],"\u{1F1EE}\u{1F1F3}":["IN","IND"],"\u{1F1EE}\u{1F1F7}":["IR","IRN"],"\u{1F1EE}\u{1F1F8}":["IS","ISL"],"\u{1F1EE}\u{1F1F9}":["IT","ITA"],"\u{1F1F1}\u{1F1E6}":["LA","LAO"],"\u{1F1F1}\u{1F1F0}":["LK","LKA"],"\u{1F1F1}\u{1F1F9}":["LT","LTU"],"\u{1F1F1}\u{1F1FA}":["LU","LUX"],"\u{1F1F1}\u{1F1FB}":["LV","LVA"],"\u{1F1F2}\u{1F1E6}":["MA","MAR"],"\u{1F1F2}\u{1F1E9}":["MD","MDA"],"\u{1F1F3}\u{1F1EC}":["NG","NGA"],"\u{1F1F2}\u{1F1F2}":["MM","MMR"],"\u{1F1F2}\u{1F1F0}":["MK","MKD"],"\u{1F1F2}\u{1F1F3}":["MN","MNG"],"\u{1F1F2}\u{1F1F4}":["MO","MAC","CTM"],"\u{1F1F2}\u{1F1F9}":["MT","MLT"],"\u{1F1F2}\u{1F1FD}":["MX","MEX"],"\u{1F1F2}\u{1F1FE}":["MY","MYS"],"\u{1F1F3}\u{1F1F1}":["NL","NLD","AMS"],"\u{1F1F3}\u{1F1F4}":["NO","NOR"],"\u{1F1F3}\u{1F1F5}":["NP","NPL"],"\u{1F1F3}\u{1F1FF}":["NZ","NZL"],"\u{1F1F5}\u{1F1E6}":["PA","PAN"],"\u{1F1F5}\u{1F1EA}":["PE","PER"],"\u{1F1F5}\u{1F1ED}":["PH","PHL"],"\u{1F1F5}\u{1F1F0}":["PK","PAK"],"\u{1F1F5}\u{1F1F1}":["PL","POL"],"\u{1F1F5}\u{1F1F7}":["PR","PRI"],"\u{1F1F5}\u{1F1F9}":["PT","PRT"],"\u{1F1F5}\u{1F1FE}":["PY","PRY"],"\u{1F1F5}\u{1F1EC}":["PG","PNG"],"\u{1F1F7}\u{1F1F4}":["RO","ROU"],"\u{1F1F7}\u{1F1F8}":["RS","SRB"],"\u{1F1F7}\u{1F1EA}":["RE","REU"],"\u{1F1F7}\u{1F1FA}":["RU","RUS"],"\u{1F1F8}\u{1F1E6}":["SA","SAU"],"\u{1F1F8}\u{1F1EA}":["SE","SWE"],"\u{1F1F8}\u{1F1EC}":["SG","SGP"],"\u{1F1F8}\u{1F1EE}":["SI","SVN"],"\u{1F1F8}\u{1F1F0}":["SK","SVK"],"\u{1F1F9}\u{1F1ED}":["TH","THA"],"\u{1F1F9}\u{1F1F3}":["TN","TUN"],"\u{1F1F9}\u{1F1F7}":["TR","TUR"],"\u{1F1F9}\u{1F1FC}":["TW","TWN","CHT","HINET","ROC"],"\u{1F1FA}\u{1F1E6}":["UA","UKR"],"\u{1F1FA}\u{1F1F8}":["US","USA","LAX","SFO","SJC"],"\u{1F1FA}\u{1F1FE}":["UY","URY"],"\u{1F1FB}\u{1F1EA}":["VE","VEN"],"\u{1F1FB}\u{1F1F3}":["VN","VNM"],"\u{1F1FF}\u{1F1E6}":["ZA","ZAF","JNB"],"\u{1F1E8}\u{1F1F3}":["CN","CHN","BACK"]};function Eo(e){let t={"\u{1F3F3}\uFE0F\u200D\u{1F308}":["\u6D41\u91CF","\u65F6\u95F4","\u8FC7\u671F","Bandwidth","Expire"],"\u{1F1F8}\u{1F1F1}":["\u5E94\u6025","\u6D4B\u8BD5\u8282\u70B9"],"\u{1F1E6}\u{1F1E9}":["Andorra","\u5B89\u9053\u5C14"],"\u{1F1E6}\u{1F1EA}":["United Arab Emirates","\u963F\u8054\u914B","\u8FEA\u62DC"],"\u{1F1E6}\u{1F1EB}":["Afghanistan","\u963F\u5BCC\u6C57"],"\u{1F1E6}\u{1F1F1}":["Albania","\u963F\u5C14\u5DF4\u5C3C\u4E9A","\u963F\u723E\u5DF4\u5C3C\u4E9E"],"\u{1F1E6}\u{1F1F2}":["Armenia","\u4E9A\u7F8E\u5C3C\u4E9A"],"\u{1F1E6}\u{1F1F7}":["Argentina","\u963F\u6839\u5EF7"],"\u{1F1E6}\u{1F1F9}":["Austria","\u5965\u5730\u5229","\u5967\u5730\u5229","\u7EF4\u4E5F\u7EB3"],"\u{1F1E6}\u{1F1FA}":["Australia","\u6FB3\u5927\u5229\u4E9A","\u6FB3\u6D32","\u58A8\u5C14\u672C","\u6089\u5C3C","\u571F\u6FB3","\u4EAC\u6FB3","\u5EE3\u6FB3","\u6EEC\u6FB3","\u6CAA\u6FB3","\u5E7F\u6FB3","Sydney"],"\u{1F1E6}\u{1F1FF}":["Azerbaijan","\u963F\u585E\u62DC\u7586"],"\u{1F1E7}\u{1F1E6}":["Bosnia and Herzegovina","\u6CE2\u9ED1\u5171\u548C\u56FD","\u6CE2\u9ED1"],"\u{1F1E7}\u{1F1E9}":["Bangladesh","\u5B5F\u52A0\u62C9\u56FD","\u5B5F\u52A0\u62C9"],"\u{1F1E7}\u{1F1EA}":["Belgium","\u6BD4\u5229\u65F6","\u6BD4\u5229\u6642"],"\u{1F1E7}\u{1F1EC}":["Bulgaria","\u4FDD\u52A0\u5229\u4E9A","\u4FDD\u52A0\u5229\u4E9E"],"\u{1F1E7}\u{1F1ED}":["Bahrain","\u5DF4\u6797"],"\u{1F1E7}\u{1F1F7}":["Brazil","\u5DF4\u897F","\u5723\u4FDD\u7F57"],"\u{1F1E7}\u{1F1F3}":["Brunei","\u6587\u83B1","\u6C76\u840A"],"\u{1F1E7}\u{1F1FE}":["Belarus","\u767D\u4FC4\u7F57\u65AF","\u767D\u4FC4"],"\u{1F1E7}\u{1F1F4}":["Bolivia","\u73BB\u5229\u7EF4\u4E9A"],"\u{1F1E7}\u{1F1F9}":["Bhutan","\u4E0D\u4E39","\u4E0D\u4E39\u738B\u56FD"],"\u{1F1E8}\u{1F1E6}":["Canada","\u52A0\u62FF\u5927","\u8499\u7279\u5229\u5C14","\u6E29\u54E5\u534E","\u6953\u8449","\u67AB\u53F6","\u6ED1\u94C1\u5362","\u591A\u4F26\u591A","Waterloo","Toronto"],"\u{1F1E8}\u{1F1ED}":["Switzerland","\u745E\u58EB","\u82CF\u9ECE\u4E16","Zurich"],"\u{1F1E8}\u{1F1F1}":["Chile","\u667A\u5229"],"\u{1F1E8}\u{1F1F4}":["Colombia","\u54E5\u4F26\u6BD4\u4E9A"],"\u{1F1E8}\u{1F1F7}":["Costa Rica","\u54E5\u65AF\u8FBE\u9ECE\u52A0"],"\u{1F1E8}\u{1F1FE}":["Cyprus","\u585E\u6D66\u8DEF\u65AF"],"\u{1F1E8}\u{1F1FF}":["Czechia","\u6377\u514B"],"\u{1F1E9}\u{1F1EA}":["German","\u5FB7\u56FD","\u5FB7\u570B","\u4EAC\u5FB7","\u6EEC\u5FB7","\u5EE3\u5FB7","\u6CAA\u5FB7","\u5E7F\u5FB7","\u6CD5\u5170\u514B\u798F","Frankfurt","\u5FB7\u610F\u5FD7"],"\u{1F1E9}\u{1F1F0}":["Denmark","\u4E39\u9EA6","\u4E39\u9EA5"],"\u{1F1EA}\u{1F1E8}":["Ecuador","\u5384\u74DC\u591A\u5C14"],"\u{1F1EA}\u{1F1EA}":["Estonia","\u7231\u6C99\u5C3C\u4E9A"],"\u{1F1EA}\u{1F1EC}":["Egypt","\u57C3\u53CA"],"\u{1F1EA}\u{1F1F8}":["Spain","\u897F\u73ED\u7259"],"\u{1F1EA}\u{1F1FA}":["European Union","\u6B27\u76DF","\u6B27\u7F57\u5DF4"],"\u{1F1EB}\u{1F1EE}":["Finland","\u82AC\u5170","\u82AC\u862D","\u8D6B\u5C14\u8F9B\u57FA"],"\u{1F1EB}\u{1F1F7}":["France","\u6CD5\u56FD","\u6CD5\u570B","\u5DF4\u9ECE"],"\u{1F1EC}\u{1F1E7}":["Great Britain","\u82F1\u56FD","England","United Kingdom","\u4F26\u6566","\u82F1","London"],"\u{1F1EC}\u{1F1EA}":["Georgia","\u683C\u9C81\u5409\u4E9A","\u683C\u9B6F\u5409\u4E9E"],"\u{1F1EC}\u{1F1F7}":["Greece","\u5E0C\u814A","\u5E0C\u81D8"],"\u{1F1EC}\u{1F1FA}":["Guam","\u5173\u5C9B","\u95DC\u5CF6"],"\u{1F1EC}\u{1F1F9}":["Guatemala","\u5371\u5730\u9A6C\u62C9"],"\u{1F1ED}\u{1F1F0}":["Hongkong","\u9999\u6E2F","Hong Kong","HongKong","HONG KONG","\u6DF1\u6E2F","\u6CAA\u6E2F","\u547C\u6E2F","\u7A57\u6E2F","\u4EAC\u6E2F","\u6E2F"],"\u{1F1ED}\u{1F1F7}":["Croatia","\u514B\u7F57\u5730\u4E9A","\u514B\u7F85\u5730\u4E9E"],"\u{1F1ED}\u{1F1FA}":["Hungary","\u5308\u7259\u5229"],"\u{1F1EF}\u{1F1F4}":["Jordan","\u7EA6\u65E6"],"\u{1F1EF}\u{1F1F5}":["Japan","\u65E5\u672C","\u4E1C\u4EAC","\u5927\u962A","\u57FC\u7389","\u6CAA\u65E5","\u7A57\u65E5","\u5DDD\u65E5","\u4E2D\u65E5","\u6CC9\u65E5","\u676D\u65E5","\u6DF1\u65E5","\u8FBD\u65E5","\u5E7F\u65E5","\u5927\u5742","Osaka","Tokyo"],"\u{1F1F0}\u{1F1EA}":["Kenya","\u80AF\u5C3C\u4E9A"],"\u{1F1F0}\u{1F1EC}":["Kyrgyzstan","\u5409\u5C14\u5409\u65AF\u65AF\u5766"],"\u{1F1F0}\u{1F1ED}":["Cambodia","\u67EC\u57D4\u5BE8"],"\u{1F1F0}\u{1F1F5}":["North Korea","\u671D\u9C9C"],"\u{1F1F0}\u{1F1F7}":["Korea","\u97E9\u56FD","\u97D3\u570B","\u97E9","\u97D3","\u9996\u5C14","\u6625\u5DDD","Chuncheon","Seoul"],"\u{1F1F0}\u{1F1FF}":["Kazakhstan","\u54C8\u8428\u514B\u65AF\u5766","\u54C8\u8428\u514B"],"\u{1F1EE}\u{1F1E9}":["Indonesia","\u5370\u5C3C","\u5370\u5EA6\u5C3C\u897F\u4E9A","\u96C5\u52A0\u8FBE"],"\u{1F1EE}\u{1F1EA}":["Ireland","\u7231\u5C14\u5170","\u611B\u723E\u862D","\u90FD\u67CF\u6797"],"\u{1F1EE}\u{1F1F1}":["Israel","\u4EE5\u8272\u5217"],"\u{1F1EE}\u{1F1F2}":["Isle of Man","\u9A6C\u6069\u5C9B","\u99AC\u6069\u5CF6"],"\u{1F1EE}\u{1F1F3}":["India","\u5370\u5EA6","\u5B5F\u4E70","MFumbai","Mumbai"],"\u{1F1EE}\u{1F1F7}":["Iran","\u4F0A\u6717"],"\u{1F1EE}\u{1F1F8}":["Iceland","\u51B0\u5C9B","\u51B0\u5CF6"],"\u{1F1EE}\u{1F1F9}":["Italy","\u610F\u5927\u5229","\u7FA9\u5927\u5229","\u7C73\u5170","Nachash"],"\u{1F1F1}\u{1F1F0}":["Sri Lanka","\u65AF\u91CC\u5170\u5361","\u65AF\u91CC\u862D\u5361"],"\u{1F1F1}\u{1F1E6}":["Laos","\u8001\u631D","\u8001\u64BE"],"\u{1F1F1}\u{1F1F9}":["Lithuania","\u7ACB\u9676\u5B9B"],"\u{1F1F1}\u{1F1FA}":["Luxembourg","\u5362\u68EE\u5821"],"\u{1F1F1}\u{1F1FB}":["Latvia","\u62C9\u8131\u7EF4\u4E9A","Latvija"],"\u{1F1F2}\u{1F1E6}":["Morocco","\u6469\u6D1B\u54E5"],"\u{1F1F2}\u{1F1E9}":["Moldova","\u6469\u5C14\u591A\u74E6","\u6469\u723E\u591A\u74E6"],"\u{1F1F2}\u{1F1F2}":["Myanmar","\u7F05\u7538","\u7DEC\u7538"],"\u{1F1F3}\u{1F1EC}":["Nigeria","\u5C3C\u65E5\u5229\u4E9A","\u5C3C\u65E5\u5229\u4E9E"],"\u{1F1F2}\u{1F1F0}":["Macedonia","\u9A6C\u5176\u987F","\u99AC\u5176\u9813"],"\u{1F1F2}\u{1F1F3}":["Mongolia","\u8499\u53E4"],"\u{1F1F2}\u{1F1F4}":["Macao","\u6FB3\u95E8","\u6FB3\u9580","CTM"],"\u{1F1F2}\u{1F1F9}":["Malta","\u9A6C\u8033\u4ED6"],"\u{1F1F2}\u{1F1FD}":["Mexico","\u58A8\u897F\u54E5"],"\u{1F1F2}\u{1F1FE}":["Malaysia","\u9A6C\u6765","\u99AC\u4F86","\u5409\u9686\u5761","\u5927\u99AC"],"\u{1F1F3}\u{1F1F1}":["Netherlands","\u8377\u5170","\u8377\u862D","\u5C3C\u5FB7\u862D","\u963F\u59C6\u65AF\u7279\u4E39","Amsterdam"],"\u{1F1F3}\u{1F1F4}":["Norway","\u632A\u5A01"],"\u{1F1F3}\u{1F1F5}":["Nepal","\u5C3C\u6CCA\u5C14"],"\u{1F1F3}\u{1F1FF}":["New Zealand","\u65B0\u897F\u5170","\u65B0\u897F\u862D"],"\u{1F1F5}\u{1F1E6}":["Panama","\u5DF4\u62FF\u9A6C"],"\u{1F1F5}\u{1F1EA}":["Peru","\u79D8\u9C81","\u7955\u9B6F"],"\u{1F1F5}\u{1F1ED}":["Philippines","\u83F2\u5F8B\u5BBE","\u83F2\u5F8B\u8CD3"],"\u{1F1F5}\u{1F1F0}":["Pakistan","\u5DF4\u57FA\u65AF\u5766"],"\u{1F1F5}\u{1F1F1}":["Poland","\u6CE2\u5170","\u6CE2\u862D","\u534E\u6C99","Warsaw"],"\u{1F1F5}\u{1F1F7}":["Puerto Rico","\u6CE2\u591A\u9ECE\u5404"],"\u{1F1F5}\u{1F1F9}":["Portugal","\u8461\u8404\u7259"],"\u{1F1F5}\u{1F1EC}":["Papua New Guinea","\u5DF4\u5E03\u4E9A\u65B0\u51E0\u5185\u4E9A"],"\u{1F1F5}\u{1F1FE}":["Paraguay","\u5DF4\u62C9\u572D"],"\u{1F1F7}\u{1F1F4}":["Romania","\u7F57\u9A6C\u5C3C\u4E9A"],"\u{1F1F7}\u{1F1F8}":["Serbia","\u585E\u5C14\u7EF4\u4E9A"],"\u{1F1F7}\u{1F1EA}":["R\xE9union","\u7559\u5C3C\u6C6A","\u6CD5\u5C5E\u7559\u5C3C\u6C6A"],"\u{1F1F7}\u{1F1FA}":["Russia","\u4FC4\u7F57\u65AF","\u4FC4\u56FD","\u4FC4\u7F85\u65AF","\u4F2F\u529B","\u83AB\u65AF\u79D1","\u5723\u5F7C\u5F97\u5821","\u897F\u4F2F\u5229\u4E9A","\u4EAC\u4FC4","\u676D\u4FC4","\u5EE3\u4FC4","\u6EEC\u4FC4","\u5E7F\u4FC4","\u6CAA\u4FC4","Moscow"],"\u{1F1F8}\u{1F1E6}":["Saudi","\u6C99\u7279\u963F\u62C9\u4F2F","\u6C99\u7279","Riyadh","\u5229\u96C5\u5F97"],"\u{1F1F8}\u{1F1EA}":["Sweden","\u745E\u5178","\u65AF\u5FB7\u54E5\u5C14\u6469","Stockholm"],"\u{1F1F8}\u{1F1EC}":["Singapore","\u65B0\u52A0\u5761","\u72EE\u57CE","\u6CAA\u65B0","\u4EAC\u65B0","\u4E2D\u65B0","\u6CC9\u65B0","\u7A57\u65B0","\u6DF1\u65B0","\u676D\u65B0","\u5E7F\u65B0","\u5EE3\u65B0","\u6EEC\u65B0"],"\u{1F1F8}\u{1F1EE}":["Slovenia","\u65AF\u6D1B\u6587\u5C3C\u4E9A"],"\u{1F1F8}\u{1F1F0}":["Slovakia","\u65AF\u6D1B\u4F10\u514B"],"\u{1F1F9}\u{1F1ED}":["Thailand","\u6CF0\u56FD","\u6CF0\u570B","\u66FC\u8C37"],"\u{1F1F9}\u{1F1F3}":["Tunisia","\u7A81\u5C3C\u65AF"],"\u{1F1F9}\u{1F1F7}":["Turkey","\u571F\u8033\u5176","\u4F0A\u65AF\u5766\u5E03\u5C14","Istanbul"],"\u{1F1F9}\u{1F1FC}":["Taiwan","\u53F0\u6E7E","\u81FA\u7063","\u53F0\u7063","\u4E2D\u83EF\u6C11\u570B","\u4E2D\u534E\u6C11\u56FD","\u53F0\u5317","\u53F0\u4E2D","\u65B0\u5317","\u5F70\u5316","\u53F0","\u81FA","Taipei","Tai Wan"],"\u{1F1FA}\u{1F1E6}":["Ukraine","\u4E4C\u514B\u5170","\u70CF\u514B\u862D"],"\u{1F1FA}\u{1F1F8}":["United States","\u7F8E\u56FD","America","\u7F8E","\u4EAC\u7F8E","\u6CE2\u7279\u5170","\u8FBE\u62C9\u65AF","\u4FC4\u52D2\u5188","Oregon","\u51E4\u51F0\u57CE","\u8D39\u5229\u8499","\u7845\u8C37","\u77FD\u8C37","\u62C9\u65AF\u7EF4\u52A0\u65AF","\u6D1B\u6749\u77F6","\u5723\u4F55\u585E","\u5723\u514B\u62C9\u62C9","\u897F\u96C5\u56FE","\u829D\u52A0\u54E5","\u6CAA\u7F8E","\u54E5\u4F26\u5E03","\u7EBD\u7EA6","New York","Los Angeles","San Jose","Sillicon Valley","Michigan","\u4FC4\u4EA5\u4FC4","Ohio","\u9A6C\u7EB3\u8428\u65AF","Manassas","\u5F17\u5409\u5C3C\u4E9A","Virginia"],"\u{1F1FA}\u{1F1FE}":["Uruguay","\u4E4C\u62C9\u572D"],"\u{1F1FB}\u{1F1EA}":["Venezuela","\u59D4\u5185\u745E\u62C9"],"\u{1F1FB}\u{1F1F3}":["Vietnam","\u8D8A\u5357","\u80E1\u5FD7\u660E"],"\u{1F1FF}\u{1F1E6}":["South Africa","\u5357\u975E"],"\u{1F1E8}\u{1F1F3}":["China","\u4E2D\u56FD","\u4E2D\u570B","\u56DE\u56FD","\u56DE\u570B","\u56FD\u5185","\u570B\u5167","\u534E\u4E1C","\u534E\u897F","\u534E\u5357","\u534E\u5317","\u534E\u4E2D","\u6C5F\u82CF","\u5317\u4EAC","\u4E0A\u6D77","\u5E7F\u5DDE","\u6DF1\u5733","\u676D\u5DDE","\u5F90\u5DDE","\u9752\u5C9B","\u5B81\u6CE2","\u9547\u6C5F"]},r=e.match(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]/)?.[0]||"\u{1F3F4}\u200D\u2620\uFE0F";for(let n of Object.keys(t))if(t[n].some(a=>RegExp(`${a}`,"i").test(e)))return/内蒙古/.test(e)&&["\u{1F1F2}\u{1F1F3}"].includes(n)?r="\u{1F1E8}\u{1F1F3}":r=n;for(let n of Object.keys(t0))if(t0[n].some(a=>RegExp(`(^|[^a-zA-Z])${a}([^a-zA-Z]|$)`).test(e))&&!(n=="\u{1F1E8}\u{1F1F3}"&&RegExp("(^|[^a-zA-Z])CN2([^a-zA-Z]|$)").test(e)))return r=n;return r}function Xf(e){return t0[Eo(e)]?.[0]}function Lc(e){return e.replace(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]|🏴‍☠️|🏳️‍🌈/g,"").trim()}var Wf=class{constructor({country,asn}={}){if(G.env.isNode){let Reader=eval('require("@maxmind/geoip2-node")').Reader,fs=eval("require('fs')"),countryFile=country||eval("process.env.SUB_STORE_MMDB_COUNTRY_PATH"),asnFile=asn||eval("process.env.SUB_STORE_MMDB_ASN_PATH");if(countryFile&&(this.countryReader=Reader.openBuffer(fs.readFileSync(countryFile))),asnFile){if(!fs.existsSync(asnFile))throw new Error("GeoLite2 ASN MMDB does not exist");this.asnReader=Reader.openBuffer(fs.readFileSync(asnFile))}}}geoip(e){return this.countryReader?.country(e)?.country?.isoCode}ipaso(e){return this.asnReader?.asn(e)?.autonomousSystemOrganization}ipasn(e){return this.asnReader?.asn(e)?.autonomousSystemNumber}};var Qf=ln(qE()),VE=ln(af());async function wo({url:e,domain:t,type:r="A",timeout:n,edns:i}){let a=Qf.default.encode({type:"query",id:0,flags:Qf.default.RECURSION_DESIRED,questions:[{type:r,name:t}],additionals:[{type:"OPT",name:".",udpPayloadSize:4096,flags:0,options:[{code:"CLIENT_SUBNET",ip:i,sourcePrefixLength:or(i)?24:56,scopePrefixLength:0}]}]}),s=await G.http.get({url:`${e}?dns=${a.toString("base64").toString("utf-8").replace(/=/g,"")}`,headers:{Accept:"application/dns-message"},"binary-mode":!0,encoding:null,timeout:n});return Qf.default.decode(VE.Buffer.from(G.env.isQX?s.bodyBytes:s.body))}var g0=ln(f0());function Mi(e,t,r){e.status(r||200).json({status:"success",data:t})}function Br(e,t,r){e.status(r||500).json({status:"failed",error:{code:t.code,type:t.type,message:t.message,details:t.details}})}var jc=class{constructor(t,r,n){this.code=t,this.message=r,this.details=n}},Tn=class extends jc{constructor(t,r,n){super(t,r,n),this.type="InternalServerError"}};var $s=class extends jc{constructor(t,r,n){super(t,r,n),this.type="ResourceNotFoundError"}},eh=class extends jc{constructor(t,r,n){super(t,r,n),this.type="NetworkError"}};function cr(e,t,r="name"){return e.find(n=>n[r]===t)}function AD(){return{name:"HTML",test:n=>/^<!DOCTYPE html>/.test(n),parse:()=>""}}function wD(){return{name:"Clash Provider",test:n=>/^payload:/gm.exec(n).index>=0,parse:n=>n.replace("payload:","").replace(/^\s*-\s*/gm,"")}}var KE=[AD(),wD()];function yD(){return{type:"SINGLE",func:r=>["URL-REGEX","DEST-PORT","SRC-IP","IN-PORT","PROTOCOL","GEOSITE","GEOIP"].indexOf(r.type)!==-1?null:`${{"DOMAIN-KEYWORD":"HOST-KEYWORD","DOMAIN-SUFFIX":"HOST-SUFFIX",DOMAIN:"HOST","IP-CIDR6":"IP6-CIDR"}[r.type]||r.type},${r.content},SUB-STORE`}}function GE(){return{type:"SINGLE",func:r=>{if(["GEOSITE","GEOIP"].indexOf(r.type)!==-1)return null;let i=`${r.type},${r.content}`;return["IP-CIDR","IP-CIDR6"].includes(r.type)&&(i+=r.options?.length>0?`,${r.options.join(",")}`:""),i}}}function SD(){return{type:"SINGLE",func:r=>["SRC-IP","GEOSITE","GEOIP"].indexOf(r.type)!==-1?null:(["IP-CIDR","IP-CIDR6"].includes(r.type)&&r.options&&(r.options=r.options.filter(i=>["no-resolve"].includes(i))),GE().func(r))}}function bD(){return{type:"ALL",func:r=>{let n={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},i={payload:r.map(a=>{let s=`${n[a.type]||a.type},${a.content}`;return["IP-CIDR","IP-CIDR6","GEOIP"].includes(a.type)&&(a.options&&(a.options=a.options.filter(o=>["no-resolve"].includes(o))),s+=a.options?.length>0?`,${a.options.join(",")}`:""),s})};return Ja.dump(i)}}}var zE={QX:yD(),Surge:GE(),Loon:SD(),Clash:bD()};var CD=[[/^(DOMAIN|host|HOST)$/,"DOMAIN"],[/^(DOMAIN-KEYWORD|host-keyword|HOST-KEYWORD)$/,"DOMAIN-KEYWORD"],[/^(DOMAIN-SUFFIX|host-suffix|HOST-SUFFIX)$/,"DOMAIN-SUFFIX"],[/^USER-AGENT$/i,"USER-AGENT"],[/^PROCESS-NAME$/,"PROCESS-NAME"],[/^(DEST-PORT|DST-PORT)$/,"DST-PORT"],[/^SRC-IP(-CIDR)?$/,"SRC-IP"],[/^(IN|SRC)-PORT$/,"IN-PORT"],[/^PROTOCOL$/,"PROTOCOL"],[/^IP-CIDR$/i,"IP-CIDR"],[/^(IP-CIDR6|ip6-cidr|IP6-CIDR)$/,"IP-CIDR6"],[/^GEOIP$/i,"GEOIP"],[/^GEOSITE$/i,"GEOSITE"]];function FD(){return{name:"Universal Rule Parser",test:()=>!0,parse:n=>{let i=n.split(`
`),a=[];for(let s of i)if(s=s.trim(),s.length!==0&&!/\s*#/.test(s))try{let o=s.split(",").map(d=>d.trim()),l=o[0],h=!1;for(let d of CD)if(d[0].test(l)){h=!0;let p={type:d[1],content:o[1]};["IP-CIDR","IP-CIDR6","GEOIP"].includes(p.type)&&(p.options=o.slice(2)),a.push(p)}if(!h)throw new Error("Invalid rule type: "+l)}catch(o){console.log(`Failed to parse line: ${s}
Reason: ${o}`)}return a}}}var YE=[FD()];var th=function(){function e(n){for(let i of KE)try{if(i.test(n))return G.info(`Pre-processor [${i.name}] activated`),i.parse(n)}catch(a){G.error(`Parser [${i.name}] failed
Reason: ${a}`)}return n}function t(n){n=e(n);for(let i of YE){let a;try{a=i.test(n)}catch{a=!1}if(a)return G.info(`Rule parser [${i.name}] is activated!`),i.parse(n)}}function r(n,i){let a=zE[i];if(!a)throw new Error(`Target platform: ${i} is not supported!`);if(typeof a.type>"u"||a.type==="SINGLE")return n.map(s=>{try{return a.func(s)}catch(o){return console.log(`ERROR: cannot produce rule: ${JSON.stringify(s)}
Reason: ${o}`),""}}).filter(s=>s.length>0).join(`
`);if(a.type==="ALL")return a.func(n)}return{parse:t,produce:r}}();var ru=class{constructor({token,key,syncPlatform}){let{isStash,isLoon,isShadowRocket,isQX}=Dn(),{defaultProxy,defaultTimeout:timeout}=G.read(Yn),proxy=defaultProxy;G.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY")),syncPlatform==="gitlab"?(this.headers={"PRIVATE-TOKEN":`${token}`,"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"},this.http=oi({baseURL:"https://gitlab.com/api/v4",headers:{...this.headers,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?As(proxy):{},timeout:timeout||8e3,events:{onResponse:e=>{if(/^[45]/.test(String(e.statusCode))){let t=JSON.parse(e.body);return Promise.reject(`ERROR: ${t.message?.error??t.message}`)}else return e}}})):(this.headers={Authorization:`token ${token}`,"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"},this.http=oi({baseURL:"https://api.github.com",headers:{...this.headers,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?As(proxy):{},timeout:timeout||8e3,events:{onResponse:e=>/^[45]/.test(String(e.statusCode))?Promise.reject(`ERROR: ${JSON.parse(e.body).message}`):e}})),this.key=key,this.syncPlatform=syncPlatform}async locate(){return this.syncPlatform==="gitlab"?this.http.get("/snippets").then(e=>{let t=JSON.parse(e.body);for(let r of t)if(r.title===this.key)return r}):this.http.get("/gists?per_page=100&page=1").then(e=>{let t=JSON.parse(e.body);G.info(`\u83B7\u53D6\u5230\u5F53\u524D GitHub \u7528\u6237\u7684 gist: ${t.length} \u4E2A`);for(let r of t)if(r.description===this.key)return r})}async upload(e){if(Object.keys(e).length===0)return Promise.reject("\u672A\u63D0\u4F9B\u9700\u4E0A\u4F20\u7684\u6587\u4EF6");let t=await this.locate(),r=e;if(t?.id){this.syncPlatform==="gitlab"&&(t.files=t.files.reduce((a,s)=>(a[s.path]=s,a),{}));let n=[],i={...t.files};return Object.keys(r).map(a=>{i[a]?r[a].content==null||r[a].content===""?(delete i[a],n.push({action:"delete",file_path:a})):(i[a]=r[a],n.push({action:"update",file_path:a,content:r[a].content})):r[a].content==null||r[a].content===""?(delete i[a],delete r[a]):(i[a]=r[a],n.push({action:"create",file_path:a,content:r[a].content}))}),this.syncPlatform==="gitlab"?Object.keys(i).length===0?Promise.reject("\u672C\u6B21\u64CD\u4F5C\u5C06\u5BFC\u81F4\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u66F4\u65B0 snippet"):Object.keys(i).length>10?Promise.reject("\u672C\u6B21\u64CD\u4F5C\u5C06\u5BFC\u81F4 snippet \u7684\u6587\u4EF6\u6570\u8D85\u8FC7 10, \u65E0\u6CD5\u66F4\u65B0 snippet"):(r=n,this.http.put({headers:{...this.headers,"Content-Type":"application/json"},url:`/snippets/${t.id}`,body:JSON.stringify({files:r})})):Object.keys(i).length===0?Promise.reject("\u672C\u6B21\u64CD\u4F5C\u5C06\u5BFC\u81F4\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u66F4\u65B0 gist"):this.http.patch({url:`/gists/${t.id}`,body:JSON.stringify({files:r})})}else return r=Object.entries(r).reduce((n,[i,a])=>(a.content!==null&&a.content!==""&&(n[i]=a),n),{}),this.syncPlatform==="gitlab"?Object.keys(r).length===0?Promise.reject("\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u521B\u5EFA snippet"):(r=Object.keys(r).map(n=>({file_path:n,content:r[n].content})),this.http.post({headers:{...this.headers,"Content-Type":"application/json"},url:"/snippets",body:JSON.stringify({title:this.key,visibility:"private",files:r})})):Object.keys(r).length===0?Promise.reject("\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u521B\u5EFA gist"):this.http.post({url:"/gists",body:JSON.stringify({description:this.key,public:!1,files:r})})}async download(e){let t=await this.locate();if(t?.id)try{let{files:r}=await this.http.get(`/gists/${t.id}`).then(i=>JSON.parse(i.body)),n=r[e].raw_url;return await this.http.get(n).then(i=>i.body)}catch(r){return Promise.reject(r)}else return Promise.reject(`\u627E\u4E0D\u5230 Sub-Store Gist (${this.key})`)}};async function h0(e){let{gistToken:t,syncPlatform:r}=G.read(Yn);if(!t)return Promise.reject("\u672A\u8BBE\u7F6E GitHub Token\uFF01");let i=await new ru({token:t,key:Lg,syncPlatform:r}).upload(e),a={};try{a=JSON.parse(i.body)}catch{}let s=a?.html_url??a?.web_url,o=G.read(Yn);return s?(G.log(`\u540C\u6B65 Gist \u540E, \u627E\u5230 Sub-Store Gist: ${s}`),o.artifactStore=s,o.artifactStoreStatus="VALID"):(G.error("\u540C\u6B65 Gist \u540E, \u627E\u4E0D\u5230 Sub-Store Gist"),o.artifactStoreStatus="NOT FOUND"),G.write(o,Yn),i}function p0(e){G.read(ui)||G.write({},ui),e.get("/api/sync/artifacts",ID),e.get("/api/sync/artifact/:name",DD)}async function Qn({type:e,name:t,platform:r,url:n,ua:i,content:a,mergeSources:s,ignoreFailedRemoteSub:o,ignoreFailedRemoteFile:l,produceType:h,produceOpts:d={},subscription:E,awaitCustomCache:p,$options:f,proxy:w,noCache:g}){if(r=r||"JSON",["subscription","sub"].includes(e)){let y;if(t){let I=G.read(Wn);if(y=cr(I,t),!y)throw new Error(`\u627E\u4E0D\u5230\u8BA2\u9605 ${t}`)}else if(E)y=E;else throw new Error("\u672A\u63D0\u4F9B\u8BA2\u9605\u540D\u79F0\u6216\u8BA2\u9605\u6570\u636E");let A;if(a&&!["localFirst","remoteFirst"].includes(s))A=a;else if(n){let I={};A=await Promise.all(n.split(/[\r\n]+/).map(H=>H.trim()).filter(H=>H.length).map(async H=>{try{return await Ir(H,i||y.ua,void 0,w||y.proxy,void 0,p,g||y.noCache,!0)}catch(V){return I[H]=V,G.error(`\u8BA2\u9605 ${y.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${H} \u53D1\u751F\u9519\u8BEF: ${V}`),""}}));let D=y.ignoreFailedRemoteSub;if(o!=null&&o!==""&&(D=o),!D&&Object.keys(I).length>0)throw new Error(`\u8BA2\u9605 ${y.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(I).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);s==="localFirst"?A.unshift(a):s==="remoteFirst"&&A.push(a)}else if(y.source==="local"&&!["localFirst","remoteFirst"].includes(y.mergeSources))A=y.content;else{let I={};A=await Promise.all(y.url.split(/[\r\n]+/).map(H=>H.trim()).filter(H=>H.length).map(async H=>{try{return await Ir(H,i||y.ua,void 0,w||y.proxy,void 0,p,g||y.noCache,!0)}catch(V){return I[H]=V,G.error(`\u8BA2\u9605 ${y.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${H} \u53D1\u751F\u9519\u8BEF: ${V}`),""}}));let D=y.ignoreFailedRemoteSub;if(o!=null&&o!==""&&(D=o),!D&&Object.keys(I).length>0)throw new Error(`\u8BA2\u9605 ${y.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(I).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);y.mergeSources==="localFirst"?A.unshift(y.content):y.mergeSources==="remoteFirst"&&A.push(y.content)}let S=(Array.isArray(A)?A:[A]).map(I=>Gt.parse(I)).flat();if(S.forEach(I=>{I._subName=y.name,I._subDisplayName=y.displayName}),S=await Gt.process(S,y.process||[],r,{[y.name]:y},f),S.length===0)throw new Error(`\u8BA2\u9605 ${t} \u4E2D\u4E0D\u542B\u6709\u6548\u8282\u70B9`);let _={};for(let I of S){if(_[I.name]){G.notify("\u{1F30D} Sub-Store",`\u26A0\uFE0F \u8BA2\u9605 ${t} \u5305\u542B\u91CD\u590D\u8282\u70B9 ${I.name}\uFF01`,"\u8BF7\u4ED4\u7EC6\u68C0\u6D4B\u914D\u7F6E\uFF01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"});break}_[I.name]=!0}return Gt.produce(S,r,h,d)}else if(["collection","col"].includes(e)){let y=G.read(Wn),A=G.read(zs),S=cr(A,t);if(!S)throw new Error(`\u627E\u4E0D\u5230\u7EC4\u5408\u8BA2\u9605 ${t}`);let _=[...S.subscriptions],I=S.subscriptionTags;Array.isArray(I)&&I.length>0&&y.forEach(L=>{Array.isArray(L.tag)&&L.tag.length>0&&!_.includes(L.name)&&L.tag.some(q=>I.includes(q))&&_.push(L.name)});let D={},H={},V=0;await Promise.all(_.map(async L=>{let q=cr(y,L),J=q.passThroughUA,z=q.ua;J&&(G.info(`\u8BA2\u9605\u5F00\u542F\u4E86\u900F\u4F20 User-Agent, \u4F7F\u7528\u8BF7\u6C42\u7684 User-Agent: ${i}`),z=i);try{G.info(`\u6B63\u5728\u5904\u7406\u5B50\u8BA2\u9605\uFF1A${q.name}...`);let K;if(q.source==="local"&&!["localFirst","remoteFirst"].includes(q.mergeSources))K=q.content;else{let ie={};if(K=await await Promise.all(q.url.split(/[\r\n]+/).map(be=>be.trim()).filter(be=>be.length).map(async be=>{try{return await Ir(be,z,void 0,w||q.proxy||S.proxy,void 0,void 0,g||q.noCache,!0)}catch(ye){return ie[be]=ye,G.error(`\u8BA2\u9605 ${q.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${be} \u53D1\u751F\u9519\u8BEF: ${ye}`),""}})),!q.ignoreFailedRemoteSub&&Object.keys(ie).length>0)throw new Error(`\u8BA2\u9605 ${q.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(ie).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);q.mergeSources==="localFirst"?K.unshift(q.content):q.mergeSources==="remoteFirst"&&K.push(q.content)}let X=(Array.isArray(K)?K:[K]).map(ie=>Gt.parse(ie)).flat();X.forEach(ie=>{ie._subName=q.name,ie._subDisplayName=q.displayName,ie._collectionName=S.name,ie._collectionDisplayName=S.displayName}),X=await Gt.process(X,q.process||[],r,{[q.name]:q,_collection:S,$options:f}),D[L]=X,V++,G.info(`\u2705 \u5B50\u8BA2\u9605\uFF1A${q.name}\u52A0\u8F7D\u6210\u529F\uFF0C\u8FDB\u5EA6--${100*(V/_.length).toFixed(1)}% `)}catch(K){V++,H[L]=K,G.error(`\u274C \u5904\u7406\u7EC4\u5408\u8BA2\u9605\u4E2D\u7684\u5B50\u8BA2\u9605: ${q.name}\u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${K}\uFF01\u8FDB\u5EA6--${100*(V/_.length).toFixed(1)}%`)}}));let F=S.ignoreFailedRemoteSub;if(o!=null&&o!==""&&(F=o),!F&&Object.keys(H).length>0)throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${t} \u4E2D\u7684\u5B50\u8BA2\u9605 ${Object.keys(H).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);let P=Array.prototype.concat.apply([],_.map(L=>D[L]||[]));if(P.forEach(L=>{L._collectionName=S.name,L._collectionDisplayName=S.displayName}),P=await Gt.process(P,S.process||[],r,{_collection:S},f),P.length===0)throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${t} \u4E2D\u4E0D\u542B\u6709\u6548\u8282\u70B9`);let k={};for(let L of P){if(k[L.name]){G.notify("\u{1F30D} Sub-Store",`\u26A0\uFE0F \u7EC4\u5408\u8BA2\u9605 ${t} \u5305\u542B\u91CD\u590D\u8282\u70B9 ${L.name}\uFF01`,"\u8BF7\u4ED4\u7EC6\u68C0\u6D4B\u914D\u7F6E\uFF01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"});break}k[L.name]=!0}return Gt.produce(P,r,h,d)}else if(e==="rule"){let y=G.read(Ec),A=cr(y,t);if(!A)throw new Error(`\u627E\u4E0D\u5230\u89C4\u5219 ${t}`);let S=[];for(let _=0;_<A.urls.length;_++){let I=A.urls[_];G.info(`\u6B63\u5728\u5904\u7406URL\uFF1A${I}\uFF0C\u8FDB\u5EA6--${100*((_+1)/A.urls.length).toFixed(1)}% `);try{let{body:D}=await Ir(I),H=th.parse(D);S=S.concat(H)}catch(D){G.error(`\u5904\u7406\u5206\u6D41\u8BA2\u9605\u4E2D\u7684URL: ${I}\u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${D}! \u8BE5\u8BA2\u9605\u5DF2\u88AB\u8DF3\u8FC7\u3002`)}}return S=await th.process(S,[{type:"Remove Duplicate Filter"}]),th.produce(S,r)}else if(e==="file"){let y=G.read(Na),A=cr(y,t);if(!A)throw new Error(`\u627E\u4E0D\u5230\u6587\u4EF6 ${t}`);let S="";if(A.type!=="mihomoProfile")if(a&&!["localFirst","remoteFirst"].includes(s))S=a;else if(n){let H={};S=await Promise.all(n.split(/[\r\n]+/).map(F=>F.trim()).filter(F=>F.length).map(async F=>{try{return await Ir(F,i||A.ua,void 0,A.proxy||w,void 0,void 0,g)}catch(P){return H[F]=P,G.error(`\u6587\u4EF6 ${A.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${F} \u53D1\u751F\u9519\u8BEF: ${P}`),""}}));let V=A.ignoreFailedRemoteFile;if(l!=null&&l!==""&&(V=l),!V&&Object.keys(H).length>0)throw new Error(`\u6587\u4EF6 ${A.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(H).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);s==="localFirst"?S.unshift(a):s==="remoteFirst"&&S.push(a)}else if(A.source==="local"&&!["localFirst","remoteFirst"].includes(A.mergeSources))S=A.content;else{let H={};S=await Promise.all(A.url.split(/[\r\n]+/).map(F=>F.trim()).filter(F=>F.length).map(async F=>{try{return await Ir(F,i||A.ua,void 0,A.proxy||w,void 0,void 0,g)}catch(P){return H[F]=P,G.error(`\u6587\u4EF6 ${A.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${F} \u53D1\u751F\u9519\u8BEF: ${P}`),""}}));let V=A.ignoreFailedRemoteFile;if(l!=null&&l!==""&&(V=l),!V&&Object.keys(H).length>0)throw new Error(`\u6587\u4EF6 ${A.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(H).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);A.mergeSources==="localFirst"?S.unshift(A.content):A.mergeSources==="remoteFirst"&&S.push(A.content)}let _=(Array.isArray(S)?S:[S]).flat(),I=_.filter(H=>H!=null&&H!=="").join(`
`);return(Array.isArray(A.process)&&A.process.length>0?await Gt.process({$files:_,$content:I,$options:f,$file:A},A.process):{$content:I,$files:_,$options:f})?.$content??""}}async function _D(){G.info("\u5F00\u59CB\u540C\u6B65\u6240\u6709\u8FDC\u7A0B\u914D\u7F6E...");let e=G.read(ui),t={};try{let r=[],n=[],i=G.read(Wn),a=G.read(zs),s=[],o=0;if(e.map(d=>{if(d.sync&&d.source){if(o++,d.type==="subscription"){let E=d.source,p=cr(i,E);p&&p.url&&!s.includes(E)&&s.push(E)}else if(d.type==="collection"){let E=cr(a,d.source);E&&Array.isArray(E.subscriptions)&&E.subscriptions.map(p=>{let f=cr(i,p);f&&f.url&&!s.includes(p)&&s.push(p)})}}}),o===0){G.info(`\u9700\u540C\u6B65\u7684\u914D\u7F6E: ${o}, \u603B\u6570: ${e.length}`);return}if(s.length>0&&await Promise.all(s.map(async d=>{try{await Qn({type:"subscription",name:d,awaitCustomCache:!0})}catch{}})),await Promise.all(e.map(async d=>{try{if(d.sync&&d.source){G.info(`\u6B63\u5728\u540C\u6B65\u4E91\u914D\u7F6E\uFF1A${d.name}...`);let E=d.platform==="SurgeMac";E&&G.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External");let p=await Qn({type:d.type,name:d.source,platform:d.platform,produceOpts:{"include-unsupported-proxy":d.includeUnsupportedProxy,useMihomoExternal:E}});t[encodeURIComponent(d.name)]={content:p},r.push(d.name)}}catch(E){G.error(`\u751F\u6210\u540C\u6B65\u914D\u7F6E ${d.name} \u53D1\u751F\u9519\u8BEF: ${E.message??E}`),n.push(d.name)}})),G.info(`${r.length} \u4E2A\u540C\u6B65\u914D\u7F6E\u751F\u6210\u6210\u529F: ${r.join(", ")}`),G.info(`${n.length} \u4E2A\u540C\u6B65\u914D\u7F6E\u751F\u6210\u5931\u8D25: ${n.join(", ")}`),r.length===0)throw new Error(`\u540C\u6B65\u914D\u7F6E ${n.join(", ")} \u751F\u6210\u5931\u8D25 \u8BE6\u60C5\u8BF7\u67E5\u770B\u65E5\u5FD7`);let l=await h0(t),h=JSON.parse(l.body);delete h.history,delete h.forks,delete h.owner,Object.values(h.files).forEach(d=>{delete d.content}),G.info("\u4E0A\u4F20\u914D\u7F6E\u54CD\u5E94:"),G.info(JSON.stringify(h,null,2));for(let d of e)if(d.sync&&d.source&&r.includes(d.name)){d.updated=new Date().getTime();let E=h.files,p;Array.isArray(E)&&(p=!0,E=Object.fromEntries(E.map(g=>[g.path,g])));let f=E[encodeURIComponent(d.name)]?.raw_url,w=p?f:f?.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1");G.info(`\u4E0A\u4F20\u914D\u7F6E\u5B8C\u6210
\u6587\u4EF6\u5217\u8868: ${Object.keys(E).join(", ")}
\u5F53\u524D\u6587\u4EF6: ${encodeURIComponent(d.name)}
\u54CD\u5E94\u8FD4\u56DE\u7684\u539F\u59CB\u94FE\u63A5: ${f}
\u5904\u7406\u5B8C\u7684\u65B0\u94FE\u63A5: ${w}`),d.url=w}if(G.write(e,ui),G.info("\u4E0A\u4F20\u914D\u7F6E\u6210\u529F"),n.length>0)throw new Error(`\u540C\u6B65\u914D\u7F6E\u6210\u529F ${r.length} \u4E2A, \u5931\u8D25 ${n.length} \u4E2A, \u8BE6\u60C5\u8BF7\u67E5\u770B\u65E5\u5FD7`);G.info(`\u540C\u6B65\u914D\u7F6E\u6210\u529F ${r.length} \u4E2A`)}catch(r){throw G.error(`\u540C\u6B65\u914D\u7F6E\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A${r.message??r}`),r}}async function ID(e,t){G.info("\u5F00\u59CB\u540C\u6B65\u6240\u6709\u8FDC\u7A0B\u914D\u7F6E...");try{await _D(),Mi(t)}catch(r){G.error(`\u540C\u6B65\u914D\u7F6E\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A${r.message??r}`),Br(t,new Tn("FAILED_TO_SYNC_ARTIFACTS","Failed to sync all artifacts",`Reason: ${r.message??r}`))}}async function DD(e,t){let{name:r}=e.params;r=decodeURIComponent(r),G.info(`\u5F00\u59CB\u540C\u6B65\u8FDC\u7A0B\u914D\u7F6E ${r}...`);let n=G.read(ui),i=cr(n,r);if(!i){G.error(`\u627E\u4E0D\u5230\u8FDC\u7A0B\u914D\u7F6E ${r}`),Br(t,new $s("RESOURCE_NOT_FOUND",`\u627E\u4E0D\u5230\u8FDC\u7A0B\u914D\u7F6E ${r}`),404);return}if(!i.source){G.error(`\u8FDC\u7A0B\u914D\u7F6E ${r} \u672A\u8BBE\u7F6E\u6765\u6E90`),Br(t,new $s("RESOURCE_HAS_NO_SOURCE",`\u8FDC\u7A0B\u914D\u7F6E ${r} \u672A\u8BBE\u7F6E\u6765\u6E90`),404);return}try{let a=i.platform==="SurgeMac";a&&G.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External");let s=await Qn({type:i.type,name:i.source,platform:i.platform,produceOpts:{"include-unsupported-proxy":i.includeUnsupportedProxy,useMihomoExternal:a}});G.info(`\u6B63\u5728\u4E0A\u4F20\u914D\u7F6E\uFF1A${i.name}
>>>${JSON.stringify(i,null,2)}`);let o=await h0({[encodeURIComponent(i.name)]:{content:s}});i.updated=new Date().getTime();let l=JSON.parse(o.body);delete l.history,delete l.forks,delete l.owner,Object.values(l.files).forEach(f=>{delete f.content}),G.info("\u4E0A\u4F20\u914D\u7F6E\u54CD\u5E94:"),G.info(JSON.stringify(l,null,2));let h=l.files,d;Array.isArray(h)&&(d=!0,h=Object.fromEntries(h.map(f=>[f.path,f])));let E=h[encodeURIComponent(i.name)]?.raw_url,p=d?E:E?.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1");G.info(`\u4E0A\u4F20\u914D\u7F6E\u5B8C\u6210
\u6587\u4EF6\u5217\u8868: ${Object.keys(h).join(", ")}
\u5F53\u524D\u6587\u4EF6: ${encodeURIComponent(i.name)}
\u54CD\u5E94\u8FD4\u56DE\u7684\u539F\u59CB\u94FE\u63A5: ${E}
\u5904\u7406\u5B8C\u7684\u65B0\u94FE\u63A5: ${p}`),i.url=p,G.write(n,ui),Mi(t,i)}catch(a){G.error(`\u8FDC\u7A0B\u914D\u7F6E ${i.name} \u53D1\u751F\u9519\u8BEF: ${a.message??a}`),Br(t,new Tn("FAILED_TO_SYNC_ARTIFACT",`Failed to sync artifact ${r}`,`Reason: ${a}`))}}var{isNode:WE,isQX:BD,isLoon:$D,isSurge:PD,isStash:RD,isShadowRocket:TD,isLanceX:xD,isEgern:OD,isGUIforCores:ND}=Dn(),qi="Node";WE&&(qi="Node");BD&&(qi="QX");$D&&(qi="Loon");PD&&(qi="Surge");RD&&(qi="Stash");TD&&(qi="ShadowRocket");OD&&(qi="Egern");xD&&(qi="LanceX");ND&&(qi="GUI.for.Cores");var nu={},kD={};try{if(typeof $environment<"u"&&(nu.env=$environment),typeof $loon<"u"&&(nu.loon=$loon),typeof $script<"u"&&(nu.script=$script),typeof $Plugin<"u"&&(nu.plugin=$Plugin),WE){nu.node={version:eval("process.version"),argv:eval("process.argv"),filename:eval("__filename"),dirname:eval("__dirname"),env:{}};let env=eval("process.env");for(let e in env)/^SUB_STORE_/.test(e)&&(nu.node.env[e]=env[e])}}catch(e){}var iu={backend:qi,version:Gl,feature:kD,meta:nu};function LD(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Mc(e){return e.startsWith("<")&&e.endsWith(">")?e.slice(1,-1):e}function JE(e,t){let r=typeof t=="string"?JSON.parse(t):t;for(let n in r)if(LD(r[n]))if(n.endsWith("!")){let i=Mc(n.slice(0,-1));e[i]=r[n]}else{let i=Mc(n);e[i]||Object.assign(e,{[i]:{}}),JE(e[i],r[i])}else if(Array.isArray(r[n]))if(n.startsWith("+")){let i=Mc(n.slice(1));e[i]||Object.assign(e,{[i]:[]}),e[i]=[...r[n],...e[i]]}else if(n.endsWith("+")){let i=Mc(n.slice(0,-1));e[i]||Object.assign(e,{[i]:[]}),e[i]=[...e[i],...r[n]]}else{let i=Mc(n);Object.assign(e,{[i]:r[n]})}else Object.assign(e,{[n]:r[n]});return e}function UD({rule:e}){return{name:"Conditional Filter",func:t=>t.map(r=>rh(e,r))}}function rh(e,t){if(!e.operator)switch(e.proposition){case"IN":return e.value.indexOf(t[e.attr])!==-1;case"CONTAINS":return typeof t[e.attr]!="string"?!1:t[e.attr].indexOf(e.value)!==-1;case"EQUALS":return t[e.attr]===e.value;case"EXISTS":return t[e.attr]!==null||typeof t[e.attr]<"u";default:throw new Error(`Unknown proposition: ${e.proposition}`)}switch(e.operator){case"AND":return e.child.every(r=>rh(r,t));case"OR":return e.child.some(r=>rh(r,t));case"NOT":return!rh(e.child,t);default:throw new Error(`Unknown operator: ${e.operator}`)}}function HD(e){return{name:"Quick Setting Operator",func:r=>{if(t(e.useless)){let i=tA().func(r);r=r.filter((a,s)=>i[s]&&a.port>0&&a.port<=65535)}return r.map(n=>(n.udp=t(e.udp,n.udp),n.tfo=t(e.tfo,n.tfo),n["fast-open"]=t(e.tfo,n["fast-open"]),n["skip-cert-verify"]=t(e.scert,n["skip-cert-verify"]),n.type==="vmess"&&(n.aead=t(e["vmess aead"],n.aead)),n))}};function t(r,n){switch(r){case"ENABLED":return!0;case"DISABLED":return!1;default:return n}}}function jD({mode:e,tw:t}){return{name:"Flag Operator",func:r=>r.map(n=>{if(e==="remove")n.name=Lc(n.name);else{let i=Eo(n.name);n.name=Lc(n.name),n.name=i+" "+n.name,t=="ws"?n.name=n.name.replace(/🇹🇼/g,"\u{1F1FC}\u{1F1F8}"):t=="tw"||(n.name=n.name.replace(/🇹🇼/g,"\u{1F1E8}\u{1F1F3}"))}return n})}}function MD(e){let{action:t,template:r,link:n,position:i}={action:"rename",template:"0 1 2 3 4 5 6 7 8 9",link:"-",position:"back",...e};return{name:"Handle Duplicate Operator",func:a=>{if(t==="delete"){let s={};return a.filter(o=>s[o.name]?!1:(s[o.name]=!0,!0))}else if(t==="rename"){let s=r.split(" "),o={},l=0;a.forEach(d=>{typeof o[d.name]>"u"?o[d.name]=1:o[d.name]++,l=Math.max(o[d.name].toString().length,l)});let h={};return a.map(d=>{if(o[d.name]>1){typeof h[d.name]>"u"&&(h[d.name]=1);let E="",p=h[d.name]++,f=0;for(;p>0;)E=s[p%10]+E,p=parseInt(p/10),f++;for(;f++<l;)E=s[0]+E;i==="front"?d.name=E+n+d.name:i==="back"&&(d.name=d.name+n+E)}return d})}}}}function qD(e="asc"){return{name:"Sort Operator",func:t=>{switch(e){case"asc":case"desc":return t.sort((r,n)=>{let i=r.name>n.name?1:-1;return i*=e==="desc"?-1:1,i});case"random":return eB(t);default:throw new Error("Unknown sort option: "+e)}}}}function VD(e){let t=e.order||"asc",r=e.expressions;return Array.isArray(e)&&(r=e),Array.isArray(r)||(r=[]),{name:"Regex Sort Operator",func:n=>(r=r.map(i=>m0(i)),n.sort((i,a)=>{let s=XE(r,i.name),o=XE(r,a.name);return s&&!o?-1:o&&!s?1:s&&o?s<o?-1:1:t==="original"?0:t==="desc"?i.name<a.name?1:-1:i.name<a.name?-1:1}))}}function XE(e,t){let r=null;for(let n=0;n<e.length;n++)if(e[n].test(t)){r=n+1;break}return r}function ZE(e){return{name:"Regex Rename Operator",func:t=>t.map(r=>{for(let{expr:n,now:i}of e)r.name=r.name.replace(m0(n,"g"),i).trim();return r})}}function KD(e){let t=e.map(r=>({expr:r,now:""}));return{name:"Regex Delete Operator",func:ZE(t).func}}function GD(e,t,r,n,i){return{name:"Script Operator",func:async a=>{let s=a;if(s?.$file?.type==="mihomoProfile")try{let o=Ja.safeLoad(e),l;if(s?.$content)try{l=Ja.safeLoad(s?.$content)}catch(h){G.error(h.message??h)}if(typeof o!="object")throw new Error("patch is not an object");return s.$content=Gt.yaml.safeDump(JE(l||(s?.$file?.sourceType==="none"?{}:{proxies:await Qn({type:s?.$file?.sourceType||"collection",name:s?.$file?.sourceName,platform:"mihomo",produceType:"internal",produceOpts:{"delete-underscore-fields":!0}})}),o)),s}catch{}return await async function(){s=nh("operator",e,r,i)(a,t,{source:n,...iu})}(),s},nodeFunc:async a=>{let s=a;return await async function(){s=nh("operator",`async function operator(input = []) {
if (input && (input.$files || input.$content)) {
let { $content, $files, $options, $file } = input
if($file.type === 'mihomoProfile') {
${e}
if(typeof main === 'function') {
let config;
if ($content) {
try {
config = ProxyUtils.yaml.safeLoad($content);
} catch (e) {
console.log(e.message ?? e);
}
}
$content = ProxyUtils.yaml.safeDump(await main(config || ($file.sourceType === 'none' ? {} : {
proxies: await produceArtifact({
type: $file.sourceType || 'collection',
name: $file.sourceName,
platform: 'mihomo',
produceType: 'internal',
produceOpts: {
'delete-underscore-fields': true
}
}),
})))
}
} else {
${e}
}
return { $content, $files, $options, $file }
} else {
let proxies = input
let list = []
for await (let $server of proxies) {
${e}
list.push($server)
}
return list
}
}`,r,i)(a,t,{source:n,...iu})}(),s}}}function zD(e){let t,r;try{let n=e.split(":");r=parseInt(n[2],16);let i=parseInt(n[3],16),a=parseInt(n[4],16),s=i>>8,o=i&255,l=a>>8,h=a&255;if(t=`${s}.${o}.${l}.${h}`,r<=0||r>65535)throw new Error(`Invalid port number: ${r}`);if(!or(t))throw new Error(`Invalid IP address: ${t}`)}catch(n){G.error(`IP4P \u89E3\u6790\u5931\u8D25: ${n}`)}return{server:t,port:r}}var QE={Custom:async function(e,t,r,n,i,a){let s=li(`CUSTOM:${a}:${e}:${t}`),o=Er.get(s);if(!r&&o)return o;let l=t==="IPv6"?"AAAA":"A",h=await wo({url:a,domain:e,type:l,timeout:n,edns:i}),{answers:d}=h;if(!Array.isArray(d)||d.length===0)throw new Error("No answers");let E=d.filter(p=>p?.type===l).map(p=>p?.data).filter(p=>p);if(E.length===0)throw new Error("No answers");return Er.set(s,E),E},Google:async function(e,t,r,n,i){let a=li(`GOOGLE:${e}:${t}`),s=Er.get(a);if(!r&&s)return s;let o=t==="IPv6"?"AAAA":"A",l=await wo({url:"https://8.8.4.4/dns-query",domain:e,type:o,timeout:n,edns:i}),{answers:h}=l;if(!Array.isArray(h)||h.length===0)throw new Error("No answers");let d=h.filter(E=>E?.type===o).map(E=>E?.data).filter(E=>E);if(d.length===0)throw new Error("No answers");return Er.set(a,d),d},"IP-API":async function(e,t,r,n){if(["IPv6"].includes(t))throw new Error(`\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9 IP-API \u4E0D\u652F\u6301 ${t}`);let i=li(`IP-API:${e}`),a=Er.get(i);if(!r&&a)return a;let s=await G.http.get({url:`http://ip-api.com/json/${encodeURIComponent(e)}?lang=zh-CN`,timeout:n}),o=JSON.parse(s.body);if(o.status!=="success")throw new Error(`Status is ${o.status}`);if(!o.query||o.query===0)throw new Error("No answers");let l=[o.query];if(l.length===0)throw new Error("No answers");return Er.set(i,l),l},Cloudflare:async function(e,t,r,n,i){let a=li(`CLOUDFLARE:${e}:${t}`),s=Er.get(a);if(!r&&s)return s;let o=t==="IPv6"?"AAAA":"A",l=await wo({url:"https://1.0.0.1/dns-query",domain:e,type:o,timeout:n,edns:i}),{answers:h}=l;if(!Array.isArray(h)||h.length===0)throw new Error("No answers");let d=h.filter(E=>E?.type===o).map(E=>E?.data).filter(E=>E);if(d.length===0)throw new Error("No answers");return Er.set(a,d),d},Ali:async function(e,t,r,n,i){let a=li(`ALI:${e}:${t}`),s=Er.get(a);if(!r&&s)return s;let o=await G.http.get({url:`http://223.6.6.6/resolve?edns_client_subnet=${i}/24&name=${encodeURIComponent(e)}&type=${t==="IPv6"?"AAAA":"A"}&short=1`,headers:{accept:"application/dns-json"},timeout:n}),l=JSON.parse(o.body);if(!Array.isArray(l)||l.length===0)throw new Error("No answers");let h=l;if(h.length===0)throw new Error("No answers");return Er.set(a,h),h},Tencent:async function(e,t,r,n,i){let a=li(`TENCENT:${e}:${t}`),s=Er.get(a);if(!r&&s)return s;let l=(await G.http.get({url:`http://119.28.28.28/d?ip=${i}&type=${t==="IPv6"?"AAAA":"A"}&dn=${encodeURIComponent(e)}`,headers:{accept:"application/dns-json"},timeout:n})).body.split(";").map(d=>d.split(",")[0]);if(l.length===0||String(l)==="0")throw new Error("No answers");let h=l;if(h.length===0)throw new Error("No answers");return Er.set(a,h),h}};function eA({provider:e,type:t,filter:r,cache:n,url:i,timeout:a,edns:s}){if(["IPv6","IP4P"].includes(t)&&["IP-API"].includes(e))throw new Error(`\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9 ${e} \u4E0D\u652F\u6301 ${t}`);let{defaultTimeout:o}=G.read(Yn),l=a||o||8e3,h=["IPv6","IP4P"].includes(t)?"IPv6":"IPv4",d=QE[e];if(!d)throw new Error(`\u627E\u4E0D\u5230\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9: ${e}`);let E=s||"223.6.6.6";if(!su(E))throw new Error("\u57DF\u540D\u89E3\u6790 EDNS \u5E94\u4E3A IP");return G.info(`Domain Resolver: [${t}] ${e} ${E||""} ${i||""}`),{name:"Resolve Domain Operator",func:async p=>{p.forEach((A,S)=>{!A["_no-resolve"]&&A["no-resolve"]&&(p[S]["_no-resolve"]=A["no-resolve"])});let f={},w=15,g=[...new Set(p.filter(A=>!su(A.server)&&!A["_no-resolve"]).map(A=>A.server))],y=Math.ceil(g.length/w);for(let A=0;A<y;A++){let S=[];for(let _ of g.splice(0,w))S.push(d(_,h,n==="disabled",l,E,i).then(I=>{f[_]=I,G.info(`Successfully resolved domain: ${_} \u279F ${I}`)}).catch(I=>{G.error(`Failed to resolve domain: ${_} with resolver [${e}]: ${I}`)}));await Promise.all(S)}return p.forEach(A=>{if(!A["_no-resolve"])if(f[A.server]){A._resolved_ips=f[A.server];let S=Array.isArray(f[A.server])?f[A.server][Math.floor(Math.random()*f[A.server].length)]:f[A.server];if(h==="IPv6"&&Jt(S)){try{S=new jf.Address6(S).correctForm()}catch(_){G.error(`Failed to parse IPv6 address: ${S}: ${_}`)}if(/^2001::[^:]+:[^:]+:[^:]+$/.test(S)){A._IP4P=S;let{server:_,port:I}=zD(S);_&&I?(A._domain=A.server,A.server=_,A.port=I,A.resolved=!0,A._IPv4=A.server,su(A._IP)||(A._IP=A.server)):A.resolved||(A.resolved=!1)}else A._domain=A.server,A.server=S,A.resolved=!0,A[`_${h}`]=A.server,su(A._IP)||(A._IP=A.server)}else A._domain=A.server,A.server=S,A.resolved=!0,A[`_${h}`]=A.server,su(A._IP)||(A._IP=A.server)}else A.resolved||(A.resolved=!1)}),p.filter(A=>r==="removeFailed"?su(A.server)||A["_no-resolve"]||A.resolved:r==="IPOnly"?su(A.server):r==="IPv4Only"?or(A.server):r==="IPv6Only"?Jt(A.server):!0)}}}function su(e){return or(e)||Jt(e)}eA.resolver=QE;function d0(e){var t=/^[\x00-\x7F]+$/;return t.test(e)}function tA(){return{name:"Useless Filter",func:e=>e.map(t=>{if(t.cipher&&!d0(t.cipher))return!1;if(t.password&&!d0(t.password))return!1;if(t.network){let r=t[`${t.network}-opts`]?.headers?.Host||t[`${t.network}-opts`]?.headers?.host;if(r=Array.isArray(r)?r:[r],r.some(n=>n&&!d0(n)))return!1}return!/网址|流量|时间|应急|过期|Bandwidth|expire/.test(t.name)})}}function YD(e){let t=e?.value||e;Array.isArray(t)||(t=[]);let r=e?.keep??!0,n={HK:"\u{1F1ED}\u{1F1F0}",TW:"\u{1F1F9}\u{1F1FC}",US:"\u{1F1FA}\u{1F1F8}",SG:"\u{1F1F8}\u{1F1EC}",JP:"\u{1F1EF}\u{1F1F5}",UK:"\u{1F1EC}\u{1F1E7}",DE:"\u{1F1E9}\u{1F1EA}",KR:"\u{1F1F0}\u{1F1F7}"};return{name:"Region Filter",func:i=>i.map(a=>{let s=Eo(a.name),o=t.some(l=>n[l]===s);return r?o:!o})}}function WD({regex:e=[],keep:t=!0}){return{name:"Regex Filter",func:r=>r.map(n=>{let i=e.some(a=>m0(a).test(n.name));return t?i:!i})}}function m0(e,...t){return t=t.join(""),e.startsWith("(?i)")?(e=e.substring(4),new RegExp(e,"i"+t)):new RegExp(e,t)}function XD(e){let t=e?.value||e;Array.isArray(t)||(t=[]);let r=e?.keep??!0;return{name:"Type Filter",func:n=>n.map(i=>{let a=t.some(s=>i.type===s);return r?a:!a})}}function JD(e,t,r,n,i){return{name:"Script Filter",func:async a=>{let s=Yf(a.length,!0);return await async function(){s=nh("filter",e,r,i)(a,t,{source:n,...iu})}(),s},nodeFunc:async a=>{let s=Yf(a.length,!0);return await async function(){s=nh("filter",`async function filter(input = []) {
let proxies = input
let list = []
const fn = async ($server) => {
${e}
}
for await (let $server of proxies) {
list.push(await fn($server))
}
return list
}`,r,i)(a,t,{source:n,...iu})}(),s}}}var ih={"Useless Filter":tA,"Region Filter":YD,"Regex Filter":WD,"Type Filter":XD,"Script Filter":JD,"Conditional Filter":UD,"Quick Setting Operator":HD,"Flag Operator":jD,"Sort Operator":qD,"Regex Sort Operator":VD,"Regex Rename Operator":ZE,"Regex Delete Operator":KD,"Script Operator":GD,"Handle Duplicate Operator":MD,"Resolve Domain Operator":eA};async function ZD(e,t){let r=Yf(t.length,!0);try{r=await e.func(t)}catch(n){let i="",a=`${n.message??n}`;a.includes("$server is not defined")?i="":(G.error(`Cannot apply filter ${e.name}(function filter)! Reason: ${n}`),i=`\u6267\u884C function filter \u5931\u8D25 ${a}; `);try{r=await e.nodeFunc(t)}catch(s){G.error(`Cannot apply filter ${e.name}(shortcut script)! Reason: ${s}`);let o="",l=`${s.message??s}`;throw i&&l===a?(o="",i=`\u6267\u884C\u5931\u8D25 ${a}`):o=`\u6267\u884C\u5FEB\u6377\u8FC7\u6EE4\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u8FC7\u6EE4 ${i}${o}`)}}return t.filter((n,i)=>r[i])}async function QD(e,t){let r=tB(t);try{let n=await e.func(r);n&&(r=n)}catch(n){let i="",a=`${n.message??n}`;a.includes("$server is not defined")||a.includes("$content is not defined")||a.includes("$files is not defined")||r?.$files||r?.$content?i="":(G.error(`Cannot apply operator ${e.name}(function operator)! Reason: ${n}`),i=`\u6267\u884C function operator \u5931\u8D25 ${a}; `);try{let s=await e.nodeFunc(r);s&&(r=s)}catch(s){G.error(`Cannot apply operator ${e.name}(shortcut script)! Reason: ${s}`);let o="",l=`${s.message??s}`;throw i&&l===a?(o="",i=`\u6267\u884C\u5931\u8D25 ${a}`):o=`\u6267\u884C\u5FEB\u6377\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u64CD\u4F5C ${i}${o}`)}}return r}async function rA(e,t){if(e.name.indexOf("Filter")!==-1)return ZD(e,t);if(e.name.indexOf("Operator")!==-1)return QD(e,t)}function eB(e){let t=e.length,r,n;for(;t!==0;)n=Math.floor(Math.random()*t),t-=1,r=e[t],e[t]=e[n],e[n]=r;return e}function tB(e){return JSON.parse(JSON.stringify(e))}function nh(name,script,$arguments,$options){let flowUtils={getFlowField:po,getFlowHeaders:xi,parseFlowHeaders:qf,flowTransfer:Nc,validCheck:Vf,getRmainingDays:pE,normalizeFlowHeader:go};return G.env.isLoon?new Function("$arguments","$options","$substore","lodash","$persistentStore","$httpClient","$notification","ProxyUtils","scriptResourceCache","flowUtils","produceArtifact","require",`${script}
return ${name}`)($arguments,$options,G,g0.default,$persistentStore,$httpClient,$notification,Gt,e0,flowUtils,Qn,eval('typeof require !== "undefined"')?Oa:void 0):new Function("$arguments","$options","$substore","lodash","ProxyUtils","scriptResourceCache","flowUtils","produceArtifact","require",`${script}
return ${name}`)($arguments,$options,G,g0.default,Gt,e0,flowUtils,Qn,eval('typeof require !== "undefined"')?Oa:void 0)}var nA=ln(f0()),Qe=class{constructor(t){this.proxy=t,this.output=[]}append(t){if(typeof t>"u")throw new Error("required field is missing");this.output.push(t)}appendIfPresent(t,r){ae(this.proxy,r)&&this.append(t)}toString(){return this.output.join("")}};function ae(e,t){let r=nA.default.get(e,t);return typeof r<"u"&&r!==null}var rB="Surge",ei={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function So(){return{produce:(t,r,n={})=>{switch(t.name=t.name.replace(/=|,/g,""),t.ports&&(t.ports=String(t.ports)),t.type){case"ss":return nB(t,n["include-unsupported-proxy"]);case"trojan":return iB(t);case"vmess":return sB(t,n["include-unsupported-proxy"]);case"http":return uB(t);case"direct":return oB(t);case"socks5":return cB(t);case"snell":return lB(t);case"tuic":return fB(t);case"wireguard-surge":return pB(t);case"hysteria2":return dB(t);case"ssh":return aB(t)}if(n["include-unsupported-proxy"]&&t.type==="wireguard")return hB(t);throw new Error(`Platform ${rB} does not support proxy type: ${t.type}`)}}}function nB(e){let t=new Qe(e);if(t.append(`${e.name}=${e.type},${e.server},${e.port}`),e.cipher||(e.cipher="none"),!["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","cast5-cfb","des-cfb","idea-cfb","rc2-cfb","seed-cfb","salsa20","chacha20","chacha20-ietf","none","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);t.append(`,encrypt-method=${e.cipher}`),t.appendIfPresent(`,password="${e.password}"`,"password");let r=ei[e["ip-version"]]||e["ip-version"];if(t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),ae(e,"plugin")){if(e.plugin==="obfs")t.append(`,obfs=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else if(!["shadow-tls"].includes(e.plugin))throw new Error(`plugin ${e.plugin} is not supported`)}if(t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,i=e["plugin-opts"].host,a=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),i&&t.append(`,shadow-tls-sni=${i}`),a){if(a<2)throw new Error(`shadow-tls version ${a} is not supported`);t.append(`,shadow-tls-version=${a}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}return t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function iB(e){let t=new Qe(e);t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password");let r=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),iA(t,e),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function sB(e,t){let r=new Qe(e);r.append(`${e.name}=${e.type},${e.server},${e.port}`),r.appendIfPresent(`,username=${e.uuid}`,"uuid");let n=ei[e["ip-version"]]||e["ip-version"];return r.appendIfPresent(`,ip-version=${n}`,"ip-version"),r.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),iA(r,e,t),ae(e,"aead")?r.append(`,vmess-aead=${e.aead}`):r.append(`,vmess-aead=${e.alterId===0}`),r.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),r.appendIfPresent(`,tls=${e.tls}`,"tls"),r.appendIfPresent(`,sni=${e.sni}`,"sni"),r.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),r.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),r.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),r.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),r.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),r.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),r.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),r.appendIfPresent(`,tos=${e.tos}`,"tos"),r.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),r.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(r.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),r.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),r.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),r.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),r.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),r.toString()}function aB(e){let t=new Qe(e);t.append(`${e.name}=ssh,${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password"),t.appendIfPresent(`,private-key=${e["keystore-private-key"]}`,"keystore-private-key"),t.appendIfPresent(`,idle-timeout=${e["idle-timeout"]}`,"idle-timeout"),t.appendIfPresent(`,server-fingerprint="${e["server-fingerprint"]}"`,"server-fingerprint");let r=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function uB(e){if(e.headers&&Object.keys(e.headers).length>0)throw new Error("headers is unsupported");let t=new Qe(e),r=e.tls?"https":"http";t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password");let n=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function oB(e){let t=new Qe(e);t.append(`${e.name}=direct`);let n=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function cB(e){let t=new Qe(e),r=e.tls?"socks5-tls":"socks5";t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password");let n=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),e.tfo&&G.info("Option tfo is not supported by Surge, thus omitted"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function lB(e){let t=new Qe(e);t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,version=${e.version}`,"version"),t.appendIfPresent(`,psk=${e.psk}`,"psk");let r=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,obfs=${e["obfs-opts"]?.mode}`,"obfs-opts.mode"),t.appendIfPresent(`,obfs-host=${e["obfs-opts"]?.host}`,"obfs-opts.host"),t.appendIfPresent(`,obfs-uri=${e["obfs-opts"]?.path}`,"obfs-opts.path"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.appendIfPresent(`,reuse=${e.reuse}`,"reuse"),t.toString()}function fB(e){let t=new Qe(e),r=e.type;(!e.token||e.token.length===0)&&(r="tuic-v5"),t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,uuid=${e.uuid}`,"uuid"),t.appendIfPresent(`,password="${e.password}"`,"password"),t.appendIfPresent(`,token=${e.token}`,"token"),t.appendIfPresent(`,alpn=${Array.isArray(e.alpn)?e.alpn[0]:e.alpn}`,"alpn"),ae(e,"ports")&&t.append(`,port-hopping="${e.ports.replace(/,/g,";")}"`),t.appendIfPresent(`,port-hopping-interval=${e["hop-interval"]}`,"hop-interval");let n=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.appendIfPresent(`,ecn=${e.ecn}`,"ecn"),t.toString()}function hB(e){Array.isArray(e.peers)&&e.peers.length>0&&(e.server=e.peers[0].server,e.port=e.peers[0].port,e.ip=e.peers[0].ip,e.ipv6=e.peers[0].ipv6,e["public-key"]=e.peers[0]["public-key"],e["preshared-key"]=e.peers[0]["pre-shared-key"],e["allowed-ips"]=e.peers[0]["allowed-ips"],e.reserved=e.peers[0].reserved);let t=new Qe(e);t.append(`# > WireGuard Proxy ${e.name}
# ${e.name}=wireguard`),e["section-name"]=Lt(e["section-name"],e.name),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert");let r=ei[e["ip-version"]]||e["ip-version"];t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.append(`
# > WireGuard Section ${e.name}
[WireGuard ${e["section-name"]}]
private-key = ${e["private-key"]}`),t.appendIfPresent(`
self-ip = ${e.ip}`,"ip"),t.appendIfPresent(`
self-ip-v6 = ${e.ipv6}`,"ipv6"),e.dns&&(Array.isArray(e.dns)&&(e.dns=e.dns.join(", ")),t.append(`
dns-server = ${e.dns}`)),t.appendIfPresent(`
mtu = ${e.mtu}`,"mtu"),r==="prefer-v6"&&t.append(`
prefer-ipv6 = true`);let n=Array.isArray(e["allowed-ips"])?e["allowed-ips"].join(","):e["allowed-ips"],i=Array.isArray(e.reserved)?e.reserved.join("/"):e.reserved,a=e["preshared-key"]??e["pre-shared-key"];a&&(a=`,preshared-key="${a}"`);let s={"public-key":e["public-key"],"allowed-ips":n?`"${n}"`:void 0,endpoint:`${e.server}:${e.port}`,keepalive:e["persistent-keepalive"]||e.keepalive,"client-id":i,"preshared-key":a};return t.append(`
peer = (${Object.keys(s).filter(o=>s[o]!=null).map(o=>`${o} = ${s[o]}`).join(", ")})`),t.toString()}function pB(e){let t=new Qe(e);t.append(`${e.name}=wireguard`),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert");let r=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function dB(e){if(e.obfs||e["obfs-password"])throw new Error("obfs is unsupported");let t=new Qe(e);t.append(`${e.name}=hysteria2,${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password"),ae(e,"ports")&&t.append(`,port-hopping="${e.ports.replace(/,/g,";")}"`),t.appendIfPresent(`,port-hopping-interval=${e["hop-interval"]}`,"hop-interval");let r=ei[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.appendIfPresent(`,download-bandwidth=${`${e.down}`.match(/\d+/)?.[0]||0}`,"down"),t.appendIfPresent(`,ecn=${e.ecn}`,"ecn"),t.toString()}function iA(e,t,r){if(ae(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),ae(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),ae(t,"ws-opts.headers"))){let n=t["ws-opts"].headers,i=Object.keys(n).map(a=>{let s=n[a];return["Host"].includes(a)&&(s=`"${s}"`),`${a}:${s}`}).join("|");Ti(i)&&e.append(`,ws-headers=${i}`)}}else if(r&&["http"].includes(t.network))G.info(`Include Unsupported Proxy: nework ${t.network} -> tcp`);else throw new Error(`network ${t.network} is unsupported`)}function xn(){return{type:"ALL",produce:(r,n,i={})=>{let a=r.filter(s=>i["include-unsupported-proxy"]?!0:s.type==="snell"&&String(s.version)==="4"||["juicity"].includes(s.type)?!1:!(["ss"].includes(s.type)&&!["aes-128-ctr","aes-192-ctr","aes-256-ctr","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-ccm","aes-192-ccm","aes-256-ccm","aes-128-gcm-siv","aes-256-gcm-siv","chacha20-ietf","chacha20","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","chacha8-ietf-poly1305","xchacha8-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm","2022-blake3-chacha20-poly1305","lea-128-gcm","lea-192-gcm","lea-256-gcm","rabbit128-poly1305","aegis-128l","aegis-256","aez-384","deoxys-ii-256-128","rc4-md5","none"].includes(s.cipher))).map(s=>{if(s.type==="vmess"?(ae(s,"aead")&&(s.aead&&(s.alterId=0),delete s.aead),ae(s,"sni")&&(s.servername=s.sni,delete s.sni),ae(s,"cipher")&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(s.cipher)&&(s.cipher="auto")):s.type==="tuic"?(ae(s,"alpn")?s.alpn=Array.isArray(s.alpn)?s.alpn:[s.alpn]:s.alpn=["h3"],ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo),(!s.token||s.token.length===0)&&!ae(s,"version")&&(s.version=5)):s.type==="hysteria"?(ae(s,"auth_str")&&!ae(s,"auth-str")&&(s["auth-str"]=s.auth_str),ae(s,"alpn")&&(s.alpn=Array.isArray(s.alpn)?s.alpn:[s.alpn]),ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo)):s.type==="wireguard"?(s.keepalive=s.keepalive??s["persistent-keepalive"],s["persistent-keepalive"]=s.keepalive,s["preshared-key"]=s["preshared-key"]??s["pre-shared-key"],s["pre-shared-key"]=s["preshared-key"]):s.type==="snell"&&s.version<3?delete s.udp:s.type==="vless"?ae(s,"sni")&&(s.servername=s.sni,delete s.sni):s.type==="ss"&&ae(s,"shadow-tls-password")&&!ae(s,"plugin")&&(s.plugin="shadow-tls",s["plugin-opts"]={host:s["shadow-tls-sni"],password:s["shadow-tls-password"],version:s["shadow-tls-version"]},delete s["shadow-tls-password"],delete s["shadow-tls-sni"],delete s["shadow-tls-version"]),["vmess","vless"].includes(s.type)&&s.network==="http"){let o=s["http-opts"]?.path;ae(s,"http-opts.path")&&!Array.isArray(o)&&(s["http-opts"].path=[o]);let l=s["http-opts"]?.headers?.Host;ae(s,"http-opts.headers.Host")&&!Array.isArray(l)&&(s["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(s.type)&&s.network==="h2"){let o=s["h2-opts"]?.path;ae(s,"h2-opts.path")&&Array.isArray(o)&&(s["h2-opts"].path=o[0]);let l=s["h2-opts"]?.headers?.host;ae(s,"h2-opts.headers.Host")&&!Array.isArray(l)&&(s["h2-opts"].headers.host=[l])}if(s["plugin-opts"]?.tls&&ae(s,"skip-cert-verify")&&(s["plugin-opts"]["skip-cert-verify"]=s["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(s.type)&&delete s.tls,s["tls-fingerprint"]&&(s.fingerprint=s["tls-fingerprint"]),delete s["tls-fingerprint"],s["underlying-proxy"]&&(s["dialer-proxy"]=s["underlying-proxy"]),delete s["underlying-proxy"],ae(s,"tls")&&typeof s.tls!="boolean"&&delete s.tls,delete s.subName,delete s.collectionName,delete s.id,delete s.resolved,delete s["no-resolve"],n!=="internal"||i["delete-underscore-fields"])for(let o in s)(s[o]==null||/^_/i.test(o))&&delete s[o];return["grpc"].includes(s.network)&&s[`${s.network}-opts`]&&(delete s[`${s.network}-opts`]["_grpc-type"],delete s[`${s.network}-opts`]["_grpc-authority"]),s});return n==="internal"?a:`proxies:
`+a.map(s=>" - "+JSON.stringify(s)+`
`).join("")}}}var sA="SurgeMac",gB=So();function v0(){return{produce:(t,r,n={})=>{switch(t.type){case"external":return aA(t);default:try{return gB.produce(t,r,n)}catch{if(n.useMihomoExternal)return G.log(`${t.name} is not supported on ${sA}, try to use Mihomo(SurgeMac - External Proxy Program) instead`),mB(t,r,n);throw new Error("Surge for macOS \u53EF\u624B\u52A8\u6307\u5B9A\u94FE\u63A5\u53C2\u6570 target=SurgeMac \u6216\u5728 \u540C\u6B65\u914D\u7F6E \u4E2D\u6307\u5B9A SurgeMac \u6765\u542F\u7528 mihomo \u652F\u63F4 Surge \u672C\u8EAB\u4E0D\u652F\u6301\u7684\u534F\u8BAE")}}}}}function aA(e){let t=new Qe(e);if(!e.exec||!e["local-port"])throw new Error(`${e.type}: exec and local-port are required`);return t.append(`${e.name}=external,exec="${e.exec}",local-port=${e["local-port"]}`),Array.isArray(e.args)&&e.args.map(r=>{t.append(`,args="${r}"`)}),Array.isArray(e.addresses)&&e.addresses.map(r=>{t.append(`,addresses=${r}`)}),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.toString()}function mB(e,t,r){let n=xn().produce([e],"internal")?.[0];if(n){let i=r?.localPort||e._localPort||65535,a=!["ipv4","v4-only"].includes(e["ip-version"]),s={name:e.name,type:"external",exec:e._exec||"/usr/local/bin/mihomo","local-port":i,args:["-config",Et.encode(JSON.stringify({"mixed-port":i,ipv6:a,mode:"global",dns:{enable:!0,ipv6:a,"default-nameserver":r?.defaultNameserver||e._defaultNameserver||["180.76.76.76","52.80.52.52","119.28.28.28","223.6.6.6"],nameserver:r?.nameserver||e._nameserver||["https://doh.pub/dns-query","https://dns.alidns.com/dns-query","https://doh-pure.onedns.net/dns-query"]},proxies:[{...n,name:"proxy"}],"proxy-groups":[{name:"GLOBAL",type:"select",proxies:["proxy"]}]}))],addresses:[]};return vB(e.server)?s.addresses.push(e.server):G.log(`Platform ${sA}, proxy type ${e.type}: addresses should be an IP address, but got ${e.server}`),r.localPort=i-1,aA(s)}}function vB(e){return or(e)||Jt(e)}function E0(){return{type:"ALL",produce:(r,n,i={})=>{let a=r.filter(s=>i["include-unsupported-proxy"]?!0:!(!["ss","ssr","vmess","vless","socks5","http","snell","trojan","wireguard"].includes(s.type)||s.type==="ss"&&!["aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","rc4-md5","chacha20-ietf","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305"].includes(s.cipher)||s.type==="snell"&&String(s.version)==="4"||s.type==="vless"&&(typeof s.flow<"u"||s["reality-opts"]))).map(s=>{if(s.type==="vmess"?(ae(s,"aead")&&(s.aead&&(s.alterId=0),delete s.aead),ae(s,"sni")&&(s.servername=s.sni,delete s.sni),ae(s,"cipher")&&!["auto","aes-128-gcm","chacha20-poly1305","none"].includes(s.cipher)&&(s.cipher="auto")):s.type==="wireguard"?(s.keepalive=s.keepalive??s["persistent-keepalive"],s["persistent-keepalive"]=s.keepalive,s["preshared-key"]=s["preshared-key"]??s["pre-shared-key"],s["pre-shared-key"]=s["preshared-key"]):s.type==="snell"&&s.version<3?delete s.udp:s.type==="vless"&&ae(s,"sni")&&(s.servername=s.sni,delete s.sni),["vmess","vless"].includes(s.type)&&s.network==="http"){let o=s["http-opts"]?.path;ae(s,"http-opts.path")&&!Array.isArray(o)&&(s["http-opts"].path=[o]);let l=s["http-opts"]?.headers?.Host;ae(s,"http-opts.headers.Host")&&!Array.isArray(l)&&(s["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(s.type)&&s.network==="h2"){let o=s["h2-opts"]?.path;ae(s,"h2-opts.path")&&Array.isArray(o)&&(s["h2-opts"].path=o[0]);let l=s["h2-opts"]?.headers?.host;ae(s,"h2-opts.headers.Host")&&!Array.isArray(l)&&(s["h2-opts"].headers.host=[l])}if(s["plugin-opts"]?.tls&&ae(s,"skip-cert-verify")&&(s["plugin-opts"]["skip-cert-verify"]=s["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(s.type)&&delete s.tls,s["tls-fingerprint"]&&(s.fingerprint=s["tls-fingerprint"]),delete s["tls-fingerprint"],s["underlying-proxy"]&&(s["dialer-proxy"]=s["underlying-proxy"]),delete s["underlying-proxy"],ae(s,"tls")&&typeof s.tls!="boolean"&&delete s.tls,delete s.subName,delete s.collectionName,delete s.id,delete s.resolved,delete s["no-resolve"],n!=="internal")for(let o in s)(s[o]==null||/^_/i.test(o))&&delete s[o];return["grpc"].includes(s.network)&&s[`${s.network}-opts`]&&(delete s[`${s.network}-opts`]["_grpc-type"],delete s[`${s.network}-opts`]["_grpc-authority"]),s});return n==="internal"?a:`proxies:
`+a.map(s=>" - "+JSON.stringify(s)+`
`).join("")}}}function sh(){return{type:"ALL",produce:(r,n,i={})=>{let a=r.filter(s=>!(!["ss","ssr","vmess","socks5","http","snell","trojan","tuic","vless","wireguard","hysteria","hysteria2","ssh","juicity"].includes(s.type)||s.type==="ss"&&!["aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","rc4-md5","chacha20-ietf","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(s.cipher)||s.type==="snell"&&String(s.version)==="4"||(i["include-unsupported-proxy"]?s.type==="vless"&&s["reality-opts"]&&!["xtls-rprx-vision"].includes(s.flow):s.type==="vless"&&s["reality-opts"]))).map(s=>{if(s.type==="vmess"?(ae(s,"aead")&&(s.aead&&(s.alterId=0),delete s.aead),ae(s,"sni")&&(s.servername=s.sni,delete s.sni),ae(s,"cipher")&&!["auto","aes-128-gcm","chacha20-poly1305","none"].includes(s.cipher)&&(s.cipher="auto")):s.type==="tuic"?(ae(s,"alpn")?s.alpn=Array.isArray(s.alpn)?s.alpn:[s.alpn]:s.alpn=["h3"],ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo,delete s.tfo),(!s.token||s.token.length===0)&&!ae(s,"version")&&(s.version=5)):s.type==="hysteria"?(ae(s,"auth_str")&&!ae(s,"auth-str")&&(s["auth-str"]=s.auth_str),ae(s,"alpn")&&(s.alpn=Array.isArray(s.alpn)?s.alpn:[s.alpn]),ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo,delete s.tfo),ae(s,"down")&&!ae(s,"down-speed")&&(s["down-speed"]=s.down,delete s.down),ae(s,"up")&&!ae(s,"up-speed")&&(s["up-speed"]=s.up,delete s.up),ae(s,"down-speed")&&(s["down-speed"]=`${s["down-speed"]}`.match(/\d+/)?.[0]||0),ae(s,"up-speed")&&(s["up-speed"]=`${s["up-speed"]}`.match(/\d+/)?.[0]||0)):s.type==="hysteria2"?(ae(s,"password")&&!ae(s,"auth")&&(s.auth=s.password,delete s.password),ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo,delete s.tfo),ae(s,"down")&&!ae(s,"down-speed")&&(s["down-speed"]=s.down,delete s.down),ae(s,"up")&&!ae(s,"up-speed")&&(s["up-speed"]=s.up,delete s.up),ae(s,"down-speed")&&(s["down-speed"]=`${s["down-speed"]}`.match(/\d+/)?.[0]||0),ae(s,"up-speed")&&(s["up-speed"]=`${s["up-speed"]}`.match(/\d+/)?.[0]||0)):s.type==="wireguard"?(s.keepalive=s.keepalive??s["persistent-keepalive"],s["persistent-keepalive"]=s.keepalive,s["preshared-key"]=s["preshared-key"]??s["pre-shared-key"],s["pre-shared-key"]=s["preshared-key"]):s.type==="snell"&&s.version<3?delete s.udp:s.type==="vless"&&ae(s,"sni")&&(s.servername=s.sni,delete s.sni),["vmess","vless"].includes(s.type)&&s.network==="http"){let o=s["http-opts"]?.path;ae(s,"http-opts.path")&&!Array.isArray(o)&&(s["http-opts"].path=[o]);let l=s["http-opts"]?.headers?.Host;ae(s,"http-opts.headers.Host")&&!Array.isArray(l)&&(s["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(s.type)&&s.network==="h2"){let o=s["h2-opts"]?.path;ae(s,"h2-opts.path")&&Array.isArray(o)&&(s["h2-opts"].path=o[0]);let l=s["h2-opts"]?.headers?.host;ae(s,"h2-opts.headers.Host")&&!Array.isArray(l)&&(s["h2-opts"].headers.host=[l])}if(s["plugin-opts"]?.tls&&ae(s,"skip-cert-verify")&&(s["plugin-opts"]["skip-cert-verify"]=s["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(s.type)&&delete s.tls,s["tls-fingerprint"]&&(s["server-cert-fingerprint"]=s["tls-fingerprint"]),delete s["tls-fingerprint"],s["underlying-proxy"]&&(s["dialer-proxy"]=s["underlying-proxy"]),delete s["underlying-proxy"],ae(s,"tls")&&typeof s.tls!="boolean"&&delete s.tls,s["test-url"]&&(s["benchmark-url"]=s["test-url"],delete s["test-url"]),s["test-timeout"]&&(s["benchmark-timeout"]=s["test-timeout"],delete s["test-timeout"]),delete s.subName,delete s.collectionName,delete s.id,delete s.resolved,delete s["no-resolve"],n!=="internal")for(let o in s)(s[o]==null||/^_/i.test(o))&&delete s[o];return["grpc"].includes(s.network)&&s[`${s.network}-opts`]&&(delete s[`${s.network}-opts`]["_grpc-type"],delete s[`${s.network}-opts`]["_grpc-authority"]),s});return n==="internal"?a:`proxies:
`+a.map(s=>" - "+JSON.stringify(s)+`
`).join("")}}}var EB="Loon",Ps={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function A0(){return{produce:(t,r,n={})=>{switch(t.type){case"ss":return AB(t);case"ssr":return wB(t);case"trojan":return yB(t);case"vmess":return SB(t,n["include-unsupported-proxy"]);case"vless":return bB(t,n["include-unsupported-proxy"]);case"http":return CB(t);case"socks5":return FB(t);case"wireguard":return _B(t);case"hysteria2":return IB(t)}throw new Error(`Platform ${EB} does not support proxy type: ${t.type}`)}}}function AB(e){let t=new Qe(e);if(!["rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","salsa20","chacha20","chacha20-ietf","aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(t.append(`${e.name}=shadowsocks,${e.server},${e.port},${e.cipher},"${e.password}"`),ae(e,"plugin")){if(e.plugin==="obfs")t.append(`,obfs-name=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else if(!["shadow-tls"].includes(e.plugin))throw new Error(`plugin ${e.plugin} is not supported`)}if(ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,i=e["plugin-opts"].host,a=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),i&&t.append(`,shadow-tls-sni=${i}`),a){if(a<2)throw new Error(`shadow-tls version ${a} is not supported`);t.append(`,shadow-tls-version=${a}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e.udp&&t.append(",udp=true");let r=Ps[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function wB(e,t){let r=new Qe(e);if(r.append(`${e.name}=shadowsocksr,${e.server},${e.port},${e.cipher},"${e.password}"`),r.append(`,protocol=${e.protocol}`),r.appendIfPresent(`,protocol-param=${e["protocol-param"]}`,"protocol-param"),r.appendIfPresent(`,obfs=${e.obfs}`,"obfs"),r.appendIfPresent(`,obfs-param=${e["obfs-param"]}`,"obfs-param"),ae(e,"shadow-tls-password"))r.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),r.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),r.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),r.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let i=e["plugin-opts"].password,a=e["plugin-opts"].host,s=e["plugin-opts"].version;if(i){if(r.append(`,shadow-tls-password=${i}`),a&&r.append(`,shadow-tls-sni=${a}`),s){if(s<2)throw new Error(`shadow-tls version ${s} is not supported`);r.append(`,shadow-tls-version=${s}`)}r.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}r.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e.udp&&r.append(",udp=true");let n=Ps[e["ip-version"]]||e["ip-version"];return r.appendIfPresent(`,ip-mode=${n}`,"ip-version"),r.toString()}function yB(e){let t=new Qe(e);if(t.append(`${e.name}=trojan,${e.server},${e.port},"${e.password}"`),e.network==="tcp"&&delete e.network,ae(e,"network"))if(e.network==="ws")t.append(",transport=ws"),t.appendIfPresent(`,path=${e["ws-opts"]?.path}`,"ws-opts.path"),t.appendIfPresent(`,host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else throw new Error(`network ${e.network} is unsupported`);t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tls-name=${e.sni}`,"sni"),t.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e.udp&&t.append(",udp=true");let r=Ps[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function SB(e,t){if(!t&&e["reality-opts"])throw new Error("VMess REALITY is not supported");let r=!1;t&&e["reality-opts"]&&(r=!0);let n=new Qe(e);if(n.append(`${e.name}=vmess,${e.server},${e.port},${e.cipher},"${e.uuid}"`),e.network==="tcp"&&delete e.network,ae(e,"network"))if(e.network==="ws")n.append(",transport=ws"),n.appendIfPresent(`,path=${e["ws-opts"]?.path}`,"ws-opts.path"),n.appendIfPresent(`,host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else if(e.network==="http"){n.append(",transport=http");let a=e["http-opts"]?.path,s=e["http-opts"]?.headers?.Host;n.appendIfPresent(`,path=${Array.isArray(a)?a[0]:a}`,"http-opts.path"),n.appendIfPresent(`,host=${Array.isArray(s)?s[0]:s}`,"http-opts.headers.Host")}else throw new Error(`network ${e.network} is unsupported`);else n.append(",transport=tcp");n.appendIfPresent(`,over-tls=${e.tls}`,"tls"),n.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),r?(n.appendIfPresent(`,sni=${e.sni}`,"sni"),n.appendIfPresent(`,public-key="${e["reality-opts"]["public-key"]}"`,"reality-opts.public-key"),n.appendIfPresent(`,short-id=${e["reality-opts"]["short-id"]}`,"reality-opts.short-id")):(n.appendIfPresent(`,tls-name=${e.sni}`,"sni"),n.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256")),ae(e,"aead")?n.append(",alterId=0"):n.append(`,alterId=${e.alterId}`),n.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e.udp&&n.append(",udp=true");let i=Ps[e["ip-version"]]||e["ip-version"];return n.appendIfPresent(`,ip-mode=${i}`,"ip-version"),n.toString()}function bB(e,t){if(!t&&(typeof e.flow<"u"||e["reality-opts"]))throw new Error("VLESS XTLS/REALITY is not supported");let r=!1,n=!1;if(t&&(e["reality-opts"]&&(n=!0),typeof e.flow<"u"))if(["xtls-rprx-vision"].includes(e.flow))r=!0;else throw new Error(`VLESS flow(${e.flow}) is not supported`);let i=new Qe(e);if(i.append(`${e.name}=vless,${e.server},${e.port},"${e.uuid}"`),e.network==="tcp"&&delete e.network,ae(e,"network"))if(e.network==="ws")i.append(",transport=ws"),i.appendIfPresent(`,path=${e["ws-opts"]?.path}`,"ws-opts.path"),i.appendIfPresent(`,host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else if(e.network==="http"){i.append(",transport=http");let s=e["http-opts"]?.path,o=e["http-opts"]?.headers?.Host;i.appendIfPresent(`,path=${Array.isArray(s)?s[0]:s}`,"http-opts.path"),i.appendIfPresent(`,host=${Array.isArray(o)?o[0]:o}`,"http-opts.headers.Host")}else throw new Error(`network ${e.network} is unsupported`);else i.append(",transport=tcp");i.appendIfPresent(`,over-tls=${e.tls}`,"tls"),i.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),r&&i.appendIfPresent(`,flow=${e.flow}`,"flow"),n?(i.appendIfPresent(`,sni=${e.sni}`,"sni"),i.appendIfPresent(`,public-key="${e["reality-opts"]["public-key"]}"`,"reality-opts.public-key"),i.appendIfPresent(`,short-id=${e["reality-opts"]["short-id"]}`,"reality-opts.short-id")):(i.appendIfPresent(`,tls-name=${e.sni}`,"sni"),i.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),i.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256")),i.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e.udp&&i.append(",udp=true");let a=Ps[e["ip-version"]]||e["ip-version"];return i.appendIfPresent(`,ip-mode=${a}`,"ip-version"),i.toString()}function CB(e){let t=new Qe(e),r=e.tls?"https":"http";t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo");let n=Ps[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${n}`,"ip-version"),t.toString()}function FB(e){let t=new Qe(e);t.append(`${e.name}=socks5,${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password"),t.appendIfPresent(`,over-tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),e.udp&&t.append(",udp=true");let r=Ps[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function _B(e){Array.isArray(e.peers)&&e.peers.length>0&&(e.server=e.peers[0].server,e.port=e.peers[0].port,e.ip=e.peers[0].ip,e.ipv6=e.peers[0].ipv6,e["public-key"]=e.peers[0]["public-key"],e["preshared-key"]=e.peers[0]["pre-shared-key"],e["allowed-ips"]=e.peers[0]["allowed-ips"],e.reserved=e.peers[0].reserved);let t=new Qe(e);if(t.append(`${e.name}=wireguard`),t.appendIfPresent(`,interface-ip=${e.ip}`,"ip"),t.appendIfPresent(`,interface-ipv6=${e.ipv6}`,"ipv6"),t.appendIfPresent(`,private-key="${e["private-key"]}"`,"private-key"),t.appendIfPresent(`,mtu=${e.mtu}`,"mtu"),e.dns&&Array.isArray(e.dns)){e.dnsv6=e.dns.find(o=>Jt(o));let s=e.dns.find(o=>or(o));s||(s=e.dns.find(o=>!or(o)&&!Jt(o))),e.dns=s}t.appendIfPresent(`,dns=${e.dns}`,"dns"),t.appendIfPresent(`,dnsv6=${e.dnsv6}`,"dnsv6"),t.appendIfPresent(`,keepalive=${e["persistent-keepalive"]}`,"persistent-keepalive"),t.appendIfPresent(`,keepalive=${e.keepalive}`,"keepalive");let r=Array.isArray(e["allowed-ips"])?e["allowed-ips"].join(","):e["allowed-ips"],n=Array.isArray(e.reserved)?e.reserved.join(","):e.reserved;n&&(n=`,reserved=[${n}]`);let i=e["preshared-key"]??e["pre-shared-key"];i&&(i=`,preshared-key="${i}"`),t.append(`,peers=[{public-key="${e["public-key"]}",allowed-ips="${r??"0.0.0.0/0,::/0"}",endpoint=${e.server}:${e.port}${n??""}${i??""}}]`);let a=Ps[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${a}`,"ip-version"),t.toString()}function IB(e){if(e["obfs-password"]&&e.obfs!="salamander")throw new Error("only salamander obfs is supported");let t=new Qe(e);t.append(`${e.name}=Hysteria2,${e.server},${e.port}`),t.appendIfPresent(`,"${e.password}"`,"password"),t.appendIfPresent(`,tls-name=${e.sni}`,"sni"),t.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),e["obfs-password"]&&e.obfs=="salamander"&&t.append(`,salamander-password=${e["obfs-password"]}`),t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e.udp&&t.append(",udp=true"),t.appendIfPresent(`,download-bandwidth=${`${e.down}`.match(/\d+/)?.[0]||0}`,"down"),t.appendIfPresent(`,ecn=${e.ecn}`,"ecn");let r=Ps[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function bo(){return{type:"SINGLE",produce:r=>{let n="";delete r.subName,delete r.collectionName,delete r.id,delete r.resolved,delete r["no-resolve"];for(let i in r)(r[i]==null||/^_/i.test(i))&&delete r[i];switch(["trojan","tuic","hysteria","hysteria2","juicity"].includes(r.type)&&delete r.tls,!["vmess"].includes(r.type)&&r.server&&Jt(r.server)&&(r.server=`[${r.server}]`),r.type){case"socks5":n=`socks://${encodeURIComponent(Et.encode(`${r.username}:${r.password}`))}@${r.server}:${r.port}#${r.name}`;break;case"ss":let i=`${r.cipher}:${r.password}`;if(n=`ss://${r.cipher?.startsWith("2022-blake3-")?`${encodeURIComponent(r.cipher)}:${encodeURIComponent(r.password)}`:Et.encode(i)}@${r.server}:${r.port}${r.plugin?"/":""}`,r.plugin){n+="?plugin=";let ce=r["plugin-opts"];switch(r.plugin){case"obfs":n+=encodeURIComponent(`simple-obfs;obfs=${ce.mode}${ce.host?";obfs-host="+ce.host:""}`);break;case"v2ray-plugin":n+=encodeURIComponent(`v2ray-plugin;obfs=${ce.mode}${ce.host?";obfs-host"+ce.host:""}${ce.tls?";tls":""}`);break;case"shadow-tls":n+=encodeURIComponent(`shadow-tls;host=${ce.host};password=${ce.password};version=${ce.version}`);break;default:throw new Error(`Unsupported plugin option: ${r.plugin}`)}}r["udp-over-tcp"]&&(n=`${n}${r.plugin?"&":"?"}uot=1`),r.tfo&&(n=`${n}${r.plugin||r["udp-over-tcp"]?"&":"?"}tfo=1`),n+=`#${encodeURIComponent(r.name)}`;break;case"ssr":n=`${r.server}:${r.port}:${r.protocol}:${r.cipher}:${r.obfs}:${Et.encode(r.password)}/`,n+=`?remarks=${Et.encode(r.name)}${r["obfs-param"]?"&obfsparam="+Et.encode(r["obfs-param"]):""}${r["protocol-param"]?"&protocolparam="+Et.encode(r["protocol-param"]):""}`,n="ssr://"+Et.encode(n);break;case"vmess":let a="",s=r.network||"tcp";if(r.network==="http"?(s="tcp",a="http"):r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(s="httpupgrade"),n={v:"2",ps:r.name,add:r.server,port:r.port,id:r.uuid,type:a,aid:r.alterId||0,net:s,tls:r.tls?"tls":""},r.tls&&r.sni&&(n.sni=r.sni),r.network){let ce=r[`${r.network}-opts`]?.path,_e=r[`${r.network}-opts`]?.headers?.Host;ce&&(n.path=Array.isArray(ce)?ce[0]:ce),_e&&(n.host=Array.isArray(_e)?_e[0]:_e),["grpc"].includes(r.network)&&(n.path=r[`${r.network}-opts`]?.["grpc-service-name"],n.type=r[`${r.network}-opts`]?.["_grpc-type"]||"gun",n.host=r[`${r.network}-opts`]?.["_grpc-authority"])}n="vmess://"+Et.encode(JSON.stringify(n));break;case"vless":let o="none",l=r["reality-opts"],h="",d="",E="";if(l){o="reality";let ce=r["reality-opts"]?.["public-key"];ce&&(d=`&pbk=${encodeURIComponent(ce)}`);let _e=r["reality-opts"]?.["short-id"];_e&&(h=`&sid=${encodeURIComponent(_e)}`);let Le=r["reality-opts"]?.["_spider-x"];Le&&(E=`&spx=${encodeURIComponent(Le)}`)}else r.tls&&(o="tls");let p="";r.alpn&&(p=`&alpn=${encodeURIComponent(Array.isArray(r.alpn)?r.alpn:r.alpn.join(","))}`);let f="";r["skip-cert-verify"]&&(f="&allowInsecure=1");let w="";r.sni&&(w=`&sni=${encodeURIComponent(r.sni)}`);let g="";r["client-fingerprint"]&&(g=`&fp=${encodeURIComponent(r["client-fingerprint"])}`);let y="";r.flow&&(y=`&flow=${encodeURIComponent(r.flow)}`);let A="";r._extra&&(A=`&extra=${encodeURIComponent(r._extra)}`);let S="";r._mode&&(S=`&mode=${encodeURIComponent(r._mode)}`);let _=r.network;r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(_="httpupgrade");let I=`&type=${encodeURIComponent(_)}`;if(["grpc"].includes(r.network)){I+=`&mode=${encodeURIComponent(r[`${r.network}-opts`]?.["_grpc-type"]||"gun")}`;let ce=r[`${r.network}-opts`]?.["_grpc-authority"];ce&&(I+=`&authority=${encodeURIComponent(ce)}`)}let D=r[`${r.network}-opts`]?.[`${r.network}-service-name`],H=r[`${r.network}-opts`]?.path,V=r[`${r.network}-opts`]?.headers?.Host;H&&(I+=`&path=${encodeURIComponent(Array.isArray(H)?H[0]:H)}`),V&&(I+=`&host=${encodeURIComponent(Array.isArray(V)?V[0]:V)}`),D&&(I+=`&serviceName=${encodeURIComponent(D)}`),r.network==="kcp"&&(r.seed&&(I+=`&seed=${encodeURIComponent(r.seed)}`),r.headerType&&(I+=`&headerType=${encodeURIComponent(r.headerType)}`)),n=`vless://${r.uuid}@${r.server}:${r.port}?security=${encodeURIComponent(o)}${I}${p}${f}${w}${g}${y}${h}${E}${d}${S}${A}#${encodeURIComponent(r.name)}`;break;case"trojan":let F="";if(r.network){let ce=r.network;if(r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(ce="httpupgrade"),F=`&type=${encodeURIComponent(ce)}`,["grpc"].includes(r.network)){let lr=r[`${r.network}-opts`]?.[`${r.network}-service-name`],Bt=r[`${r.network}-opts`]?.["_grpc-authority"];lr&&(F+=`&serviceName=${encodeURIComponent(lr)}`),Bt&&(F+=`&authority=${encodeURIComponent(Bt)}`),F+=`&mode=${encodeURIComponent(r[`${r.network}-opts`]?.["_grpc-type"]||"gun")}`}let _e=r[`${r.network}-opts`]?.path,Le=r[`${r.network}-opts`]?.headers?.Host;_e&&(F+=`&path=${encodeURIComponent(Array.isArray(_e)?_e[0]:_e)}`),Le&&(F+=`&host=${encodeURIComponent(Array.isArray(Le)?Le[0]:Le)}`)}let P="";r["client-fingerprint"]&&(P=`&fp=${encodeURIComponent(r["client-fingerprint"])}`);let k="";r.alpn&&(k=`&alpn=${encodeURIComponent(Array.isArray(r.alpn)?r.alpn:r.alpn.join(","))}`);let L=r["reality-opts"],q="",J="",z="",K="",X="",ie="";if(L){K="&security=reality";let ce=r["reality-opts"]?.["public-key"];ce&&(J=`&pbk=${encodeURIComponent(ce)}`);let _e=r["reality-opts"]?.["short-id"];_e&&(q=`&sid=${encodeURIComponent(_e)}`);let Le=r["reality-opts"]?.["_spider-x"];Le&&(z=`&spx=${encodeURIComponent(Le)}`),r._extra&&(ie=`&extra=${encodeURIComponent(r._extra)}`),r._mode&&(X=`&mode=${encodeURIComponent(r._mode)}`)}n=`trojan://${r.password}@${r.server}:${r.port}?sni=${encodeURIComponent(r.sni||r.server)}${r["skip-cert-verify"]?"&allowInsecure=1":""}${F}${k}${P}${K}${q}${J}${z}${X}${ie}#${encodeURIComponent(r.name)}`;break;case"hysteria2":let be=[];r["hop-interval"]&&be.push(`hop-interval=${r["hop-interval"]}`),r.keepalive&&be.push(`keepalive=${r.keepalive}`),r["skip-cert-verify"]&&be.push("insecure=1"),r.obfs&&(be.push(`obfs=${encodeURIComponent(r.obfs)}`),r["obfs-password"]&&be.push(`obfs-password=${encodeURIComponent(r["obfs-password"])}`)),r.sni&&be.push(`sni=${encodeURIComponent(r.sni)}`),r.ports&&be.push(`mport=${r.ports}`),r["tls-fingerprint"]&&be.push(`pinSHA256=${encodeURIComponent(r["tls-fingerprint"])}`),r.tfo&&be.push("fastopen=1"),n=`hysteria2://${encodeURIComponent(r.password)}@${r.server}:${r.port}?${be.join("&")}#${encodeURIComponent(r.name)}`;break;case"hysteria":let ye=[];Object.keys(r).forEach(ce=>{if(!["name","type","server","port"].includes(ce)){let _e=ce.replace(/-/,"_");["alpn"].includes(ce)?r[ce]&&ye.push(`${_e}=${encodeURIComponent(Array.isArray(r[ce])?r[ce][0]:r[ce])}`):["skip-cert-verify"].includes(ce)?r[ce]&&ye.push("insecure=1"):["tfo","fast-open"].includes(ce)?r[ce]&&!ye.includes("fastopen=1")&&ye.push("fastopen=1"):["ports"].includes(ce)?ye.push(`mport=${r[ce]}`):["auth-str"].includes(ce)?ye.push(`auth=${r[ce]}`):["up"].includes(ce)?ye.push(`upmbps=${r[ce]}`):["down"].includes(ce)?ye.push(`downmbps=${r[ce]}`):["_obfs"].includes(ce)?ye.push(`obfs=${r[ce]}`):["obfs"].includes(ce)?ye.push(`obfsParam=${r[ce]}`):["sni"].includes(ce)?ye.push(`peer=${r[ce]}`):r[ce]&&ye.push(`${_e}=${encodeURIComponent(r[ce])}`)}}),n=`hysteria://${r.server}:${r.port}?${ye.join("&")}#${encodeURIComponent(r.name)}`;break;case"tuic":if(!r.token||r.token.length===0){let ce=[];Object.keys(r).forEach(_e=>{if(!["name","type","uuid","password","server","port","tls"].includes(_e)){let Le=_e.replace(/-/,"_");["alpn"].includes(_e)?r[_e]&&ce.push(`${Le}=${encodeURIComponent(Array.isArray(r[_e])?r[_e][0]:r[_e])}`):["skip-cert-verify"].includes(_e)?r[_e]&&ce.push("allow_insecure=1"):["tfo","fast-open"].includes(_e)?r[_e]&&!ce.includes("fast_open=1")&&ce.push("fast_open=1"):["disable-sni","reduce-rtt"].includes(_e)&&r[_e]?ce.push(`${Le.replace(/-/g,"_")}=1`):r[_e]&&ce.push(`${Le.replace(/-/g,"_")}=${encodeURIComponent(r[_e])}`)}}),n=`tuic://${encodeURIComponent(r.uuid)}:${encodeURIComponent(r.password)}@${r.server}:${r.port}?${ce.join("&")}#${encodeURIComponent(r.name)}`}break;case"anytls":let $e=[];Object.keys(r).forEach(ce=>{if(!["name","type","password","server","port","tls"].includes(ce)){let _e=ce.replace(/-/,"_");["alpn"].includes(ce)?r[ce]&&$e.push(`${_e}=${encodeURIComponent(Array.isArray(r[ce])?r[ce][0]:r[ce])}`):["skip-cert-verify"].includes(ce)?r[ce]&&$e.push("insecure=1"):r[ce]&&$e.push(`${_e.replace(/-/g,"_")}=${encodeURIComponent(r[ce])}`)}}),n=`anytls://${encodeURIComponent(r.password)}@${r.server}:${r.port}/?${$e.join("&")}#${encodeURIComponent(r.name)}`;break;case"wireguard":let qe=[];Object.keys(r).forEach(ce=>{["name","type","server","port","ip","ipv6","private-key"].includes(ce)||(["public-key"].includes(ce)?qe.push(`publickey=${r[ce]}`):["udp"].includes(ce)?r[ce]&&qe.push(`${ce}=1`):r[ce]&&qe.push(`${ce}=${encodeURIComponent(r[ce])}`))}),r.ip&&r.ipv6?qe.push(`address=${r.ip}/32,${r.ipv6}/128`):r.ip?qe.push(`address=${r.ip}/32`):r.ipv6&&qe.push(`address=${r.ipv6}/128`),n=`wireguard://${encodeURIComponent(r["private-key"])}@${r.server}:${r.port}/?${qe.join("&")}#${encodeURIComponent(r.name)}`;break}return n}}}var DB=bo();function qc(){return{type:"ALL",produce:r=>{let n=[];return r.map(i=>{try{n.push(DB.produce(i))}catch(a){G.error(`Cannot produce proxy: ${JSON.stringify(i,null,2)}
Reason: ${a}`)}}),Et.encode(n.join(`
`))}}}var BB="QX";function Vc(){return{produce:(t,r,n={})=>{switch(t.type){case"ss":return $B(t,n["include-unsupported-proxy"]);case"ssr":return PB(t);case"trojan":return RB(t);case"vmess":return TB(t);case"http":return OB(t);case"socks5":return NB(t);case"vless":return xB(t)}throw new Error(`Platform ${BB} does not support proxy type: ${t.type}`)}}}function $B(e,t){let r=new Qe(e),n=r.append.bind(r),i=r.appendIfPresent.bind(r);if(e.cipher||(e.cipher="none"),!["none","rc4-md5","rc4-md5-6","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","cast5-cfb","des-cfb","rc2-cfb","salsa20","chacha20","chacha20-ietf","aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305",...t?["2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"]:[]].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(n(`shadowsocks=${e.server}:${e.port}`),n(`,method=${e.cipher}`),n(`,password=${e.password}`),On(e)&&(e.tls=!0),ae(e,"plugin")){if(e.plugin==="obfs"){let a=e["plugin-opts"];n(`,obfs=${a.mode}`)}else if(e.plugin==="v2ray-plugin"&&e["plugin-opts"].mode==="websocket")e["plugin-opts"].tls?n(",obfs=wss"):n(",obfs=ws");else throw new Error("plugin is not supported");i(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),i(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path")}return On(e)&&(i(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),i(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),i(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),i(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),i(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),i(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),i(`,tls-host=${e.sni}`,"sni")),i(`,fast-open=${e.tfo}`,"tfo"),i(`,udp-relay=${e.udp}`,"udp"),r.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),n(`,tag=${e.name}`),r.toString()}function PB(e){let t=new Qe(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);return r(`shadowsocks=${e.server}:${e.port}`),r(`,method=${e.cipher}`),r(`,password=${e.password}`),r(`,ssr-protocol=${e.protocol}`),n(`,ssr-protocol-param=${e["protocol-param"]}`,"protocol-param"),n(`,obfs=${e.obfs}`,"obfs"),n(`,obfs-host=${e["obfs-param"]}`,"obfs-param"),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function RB(e){let t=new Qe(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(r(`trojan=${e.server}:${e.port}`),r(`,password=${e.password}`),ae(e,"network"))if(e.network==="ws")On(e)?r(",obfs=wss"):r(",obfs=ws"),n(`,obfs-uri=${e["ws-opts"]?.path}`,"ws-opts.path"),n(`,obfs-host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else throw new Error(`network ${e.network} is unsupported`);return e.network!=="ws"&&On(e)&&r(",over-tls=true"),On(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function TB(e){let t=new Qe(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);r(`vmess=${e.server}:${e.port}`);let i;if(e.cipher==="auto"?i="chacha20-ietf-poly1305":i=e.cipher,r(`,method=${i}`),r(`,password=${e.uuid}`),On(e)&&(e.tls=!0),ae(e,"network")){if(e.network==="ws")e.tls?r(",obfs=wss"):r(",obfs=ws");else if(e.network==="http")r(",obfs=http");else throw new Error(`network ${e.network} is unsupported`);let a=e[`${e.network}-opts`]?.path,s=e[`${e.network}-opts`]?.headers?.Host;n(`,obfs-uri=${Array.isArray(a)?a[0]:a}`,`${e.network}-opts.path`),n(`,obfs-host=${Array.isArray(s)?s[0]:s}`,`${e.network}-opts.headers.Host`)}else e.tls&&r(",obfs=over-tls");return On(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),ae(e,"aead")?r(`,aead=${e.aead}`):r(`,aead=${e.alterId===0}`),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function xB(e){if(typeof e.flow<"u"||e["reality-opts"])throw new Error("VLESS XTLS/REALITY is not supported");let t=new Qe(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(r(`vless=${e.server}:${e.port}`),r(",method=none"),r(`,password=${e.uuid}`),On(e)&&(e.tls=!0),ae(e,"network")){if(e.network==="ws")e.tls?r(",obfs=wss"):r(",obfs=ws");else if(e.network==="http")r(",obfs=http");else if(!["tcp"].includes(e.network))throw new Error(`network ${e.network} is unsupported`);let a=e[`${e.network}-opts`]?.path,s=e[`${e.network}-opts`]?.headers?.Host;n(`,obfs-uri=${Array.isArray(a)?a[0]:a}`,`${e.network}-opts.path`),n(`,obfs-host=${Array.isArray(s)?s[0]:s}`,`${e.network}-opts.headers.Host`)}else e.tls&&r(",obfs=over-tls");return On(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function OB(e){let t=new Qe(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);return r(`http=${e.server}:${e.port}`),n(`,username=${e.username}`,"username"),n(`,password=${e.password}`,"password"),On(e)&&(e.tls=!0),n(`,over-tls=${e.tls}`,"tls"),On(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function NB(e){let t=new Qe(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);return r(`socks5=${e.server}:${e.port}`),n(`,username=${e.username}`,"username"),n(`,password=${e.password}`,"password"),On(e)&&(e.tls=!0),n(`,over-tls=${e.tls}`,"tls"),On(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function On(e){return e.tls}function Kc(){return{type:"ALL",produce:(r,n,i={})=>{let a=r.filter(s=>i["include-unsupported-proxy"]?!0:s.type==="snell"&&String(s.version)==="4"?!1:!["mieru","anytls"].includes(s.type)).map(s=>{if(s.type==="vmess"?(ae(s,"aead")&&(s.aead&&(s.alterId=0),delete s.aead),ae(s,"sni")&&(s.servername=s.sni,delete s.sni),ae(s,"cipher")&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(s.cipher)&&(s.cipher="auto")):s.type==="tuic"?(ae(s,"alpn")?s.alpn=Array.isArray(s.alpn)?s.alpn:[s.alpn]:s.alpn=["h3"],ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo),(!s.token||s.token.length===0)&&!ae(s,"version")&&(s.version=5)):s.type==="hysteria"?(ae(s,"auth_str")&&!ae(s,"auth-str")&&(s["auth-str"]=s.auth_str),ae(s,"alpn")&&(s.alpn=Array.isArray(s.alpn)?s.alpn:[s.alpn]),ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo)):s.type==="hysteria2"?(s["obfs-password"]&&s.obfs=="salamander"&&(s.obfs=s["obfs-password"],delete s["obfs-password"]),ae(s,"alpn")&&(s.alpn=Array.isArray(s.alpn)?s.alpn:[s.alpn]),ae(s,"tfo")&&!ae(s,"fast-open")&&(s["fast-open"]=s.tfo)):s.type==="wireguard"?(s.keepalive=s.keepalive??s["persistent-keepalive"],s["persistent-keepalive"]=s.keepalive,s["preshared-key"]=s["preshared-key"]??s["pre-shared-key"],s["pre-shared-key"]=s["preshared-key"]):s.type==="snell"&&s.version<3?delete s.udp:s.type==="vless"?ae(s,"sni")&&(s.servername=s.sni,delete s.sni):s.type==="ss"&&ae(s,"shadow-tls-password")&&!ae(s,"plugin")&&(s.plugin="shadow-tls",s["plugin-opts"]={host:s["shadow-tls-sni"],password:s["shadow-tls-password"],version:s["shadow-tls-version"]},delete s["shadow-tls-password"],delete s["shadow-tls-sni"],delete s["shadow-tls-version"]),["vmess","vless"].includes(s.type)&&s.network==="http"){let o=s["http-opts"]?.path;ae(s,"http-opts.path")&&!Array.isArray(o)&&(s["http-opts"].path=[o]);let l=s["http-opts"]?.headers?.Host;ae(s,"http-opts.headers.Host")&&!Array.isArray(l)&&(s["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(s.type)&&s.network==="h2"){let o=s["h2-opts"]?.path;ae(s,"h2-opts.path")&&Array.isArray(o)&&(s["h2-opts"].path=o[0]);let l=s["h2-opts"]?.headers?.host;ae(s,"h2-opts.headers.Host")&&!Array.isArray(l)&&(s["h2-opts"].headers.host=[l])}if(s["plugin-opts"]?.tls&&ae(s,"skip-cert-verify")&&(s["plugin-opts"]["skip-cert-verify"]=s["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(s.type)&&delete s.tls,s["tls-fingerprint"]&&(s.fingerprint=s["tls-fingerprint"]),delete s["tls-fingerprint"],s["underlying-proxy"]&&(s["dialer-proxy"]=s["underlying-proxy"]),delete s["underlying-proxy"],ae(s,"tls")&&typeof s.tls!="boolean"&&delete s.tls,delete s.subName,delete s.collectionName,delete s.id,delete s.resolved,delete s["no-resolve"],n!=="internal")for(let o in s)(s[o]==null||/^_/i.test(o))&&delete s[o];return["grpc"].includes(s.network)&&s[`${s.network}-opts`]&&(delete s[`${s.network}-opts`]["_grpc-type"],delete s[`${s.network}-opts`]["_grpc-authority"]),s});return n==="internal"?a:`proxies:
`+a.map(s=>" - "+JSON.stringify(s)+`
`).join("")}}}var kB="Surfboard";function ah(){return{produce:t=>{switch(t.name=t.name.replace(/=|,/g,""),t.type){case"ss":return LB(t);case"trojan":return UB(t);case"vmess":return HB(t);case"http":return jB(t);case"socks5":return MB(t);case"wireguard-surge":return qB(t)}throw new Error(`Platform ${kB} does not support proxy type: ${t.type}`)}}}function LB(e){let t=new Qe(e);if(t.append(`${e.name}=${e.type},${e.server},${e.port}`),!["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","salsa20","chacha20","chacha20-ietf"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(t.append(`,encrypt-method=${e.cipher}`),t.appendIfPresent(`,password=${e.password}`,"password"),ae(e,"plugin"))if(e.plugin==="obfs")t.append(`,obfs=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else throw new Error(`plugin ${e.plugin} is not supported`);return t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function UB(e){let t=new Qe(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password=${e.password}`,"password"),uA(t,e),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function HB(e){let t=new Qe(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,username=${e.uuid}`,"uuid"),uA(t,e),ae(e,"aead")?t.append(`,vmess-aead=${e.aead}`):t.append(`,vmess-aead=${e.alterId===0}`),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function jB(e){let t=new Qe(e),r=e.tls?"https":"http";return t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,${e.password}`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function MB(e){let t=new Qe(e),r=e.tls?"socks5-tls":"socks5";return t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,${e.password}`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function qB(e){let t=new Qe(e);return t.append(`${e.name}=wireguard`),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.toString()}function uA(e,t){if(ae(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),ae(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),ae(t,"ws-opts.headers"))){let r=t["ws-opts"].headers,n=Object.keys(r).map(i=>{let a=r[i];return["Host"].includes(i)&&(a=`"${a}"`),`${i}:${a}`}).join("|");Ti(n)&&e.append(`,ws-headers=${n}`)}}else throw new Error(`network ${t.network} is unsupported`)}var vn=(e,t)=>{t.detour=e["dialer-proxy"]||e.detour},Rs=(e,t)=>{["tcp","udp"].includes(e._network)&&(t.network=e._network)},Nn=(e,t)=>{t.tcp_fast_open=!1,e.tfo&&(t.tcp_fast_open=!0),e.tcp_fast_open&&(t.tcp_fast_open=!0),e["tcp-fast-open"]&&(t.tcp_fast_open=!0),t.tcp_fast_open||delete t.tcp_fast_open},Vi=(e,t)=>{!e||!e.enabled||(t.multiplex={enabled:!0},t.multiplex.protocol=e.protocol,e["max-connections"]&&(t.multiplex.max_connections=parseInt(`${e["max-connections"]}`,10)),e["max-streams"]&&(t.multiplex.max_streams=parseInt(`${e["max-streams"]}`,10)),e["min-streams"]&&(t.multiplex.min_streams=parseInt(`${e["min-streams"]}`,10)),e.padding&&(t.multiplex.padding=!0))},w0=(e,t)=>{let r={type:"ws",headers:{}};if(e["ws-opts"]){let{path:n="",headers:i={}}=e["ws-opts"];if(n!==""&&(r.path=`${n}`),Object.keys(i).length>0){let a={};for(let o of Object.keys(i)){let l=i[o];l!==""&&(Array.isArray(l)||(l=[`${l}`]),l.length>0&&(a[o]=l))}let{Host:s}=a;if(s.length===1)for(let o of`Host:${s[0]}`.split(`
`)){let[l,h]=o.split(":");h.trim()!==""&&(a[l.trim()]=h.trim().split(","))}r.headers=a}}if(e["ws-headers"]){let n={};for(let a of Object.keys(e["ws-headers"])){let s=e["ws-headers"][a];s!==""&&(Array.isArray(s)||(s=[`${s}`]),s.length>0&&(n[a]=s))}let{Host:i}=n;if(i.length===1)for(let a of`Host:${i[0]}`.split(`
`)){let[s,o]=a.split(":");o.trim()!==""&&(n[s.trim()]=o.trim().split(","))}for(let a of Object.keys(n))r.headers[a]=n[a]}if(e["ws-path"]&&e["ws-path"]!==""&&(r.path=`${e["ws-path"]}`),r.path){let n=/^(.*?)(?:\?ed=(\d+))?$/,[i,a="",s=""]=n.exec(r.path);r.path=a,s!==""&&(r.early_data_header_name="Sec-WebSocket-Protocol",r.max_early_data=parseInt(s,10))}t.tls.insecure&&(t.tls.server_name=r.headers.Host[0]),e["ws-opts"]&&e["ws-opts"]["v2ray-http-upgrade"]&&(r.type="httpupgrade",r.headers.Host&&(r.host=r.headers.Host[0],delete r.headers.Host),r.max_early_data&&delete r.max_early_data,r.early_data_header_name&&delete r.early_data_header_name);for(let n of Object.keys(r.headers)){let i=r.headers[n];i.length===1&&(r.headers[n]=i[0])}t.transport=r},VB=(e,t)=>{let r={type:"http",headers:{}};if(e["http-opts"]){let{method:n="",path:i="",headers:a={}}=e["http-opts"];n!==""&&(r.method=n),Array.isArray(i)?r.path=`${i[0]}`:i!==""&&(r.path=`${i}`);for(let s of Object.keys(a)){let o=a[s];if(o!==""){if(s.toLowerCase()==="host"){let l=o;Array.isArray(l)||(l=`${l}`.split(",").map(h=>h.trim())),l.length>0&&(r.host=l);continue}Array.isArray(o)||(o=`${o}`.split(",").map(l=>l.trim())),o.length>0&&(r.headers[s]=o)}}}if(e["http-host"]&&e["http-host"]!==""){let n=e["http-host"];Array.isArray(n)||(n=`${n}`.split(",").map(i=>i.trim())),n.length>0&&(r.host=n)}if(r.host){if(e["http-path"]&&e["http-path"]!==""){let n=e["http-path"];Array.isArray(n)?r.path=`${n[0]}`:n!==""&&(r.path=`${n}`)}t.tls.insecure&&(t.tls.server_name=r.host[0]),r.host.length===1&&(r.host=r.host[0]);for(let n of Object.keys(r.headers)){let i=r.headers[n];i.length===1&&(r.headers[n]=i[0])}t.transport=r}},KB=(e,t)=>{let r={type:"http"};if(e["h2-opts"]){let{host:n="",path:i=""}=e["h2-opts"];i!==""&&(r.path=`${i}`),n!==""&&(Array.isArray(n)||(n=`${n}`.split(",").map(a=>a.trim())),n.length>0&&(r.host=n))}if(e["h2-host"]&&e["h2-host"]!==""){let n=e["h2-host"];Array.isArray(n)||(n=`${n}`.split(",").map(i=>i.trim())),n.length>0&&(r.host=n)}e["h2-path"]&&e["h2-path"]!==""&&(r.path=`${e["h2-path"]}`),t.tls.enabled=!0,t.tls.insecure&&(t.tls.server_name=r.host[0]),r.host.length===1&&(r.host=r.host[0]),t.transport=r},y0=(e,t)=>{let r={type:"grpc"};if(e["grpc-opts"]){let n=e["grpc-opts"]["grpc-service-name"];n!=null&&n!==""&&(r.service_name=`${n}`)}t.transport=r},ia=(e,t)=>{e.tls&&(t.tls.enabled=!0),e.servername&&e.servername!==""&&(t.tls.server_name=e.servername),e.peer&&e.peer!==""&&(t.tls.server_name=e.peer),e.sni&&e.sni!==""&&(t.tls.server_name=e.sni),e["skip-cert-verify"]&&(t.tls.insecure=!0),e.insecure&&(t.tls.insecure=!0),e["disable-sni"]&&(t.tls.disable_sni=!0),typeof e.alpn=="string"?t.tls.alpn=[e.alpn]:Array.isArray(e.alpn)&&(t.tls.alpn=e.alpn),e.ca&&(t.tls.certificate_path=`${e.ca}`),e.ca_str&&(t.tls.certificate=[e.ca_str]),e["ca-str"]&&(t.tls.certificate=[e["ca-str"]]),e["reality-opts"]&&(t.tls.reality={enabled:!0},e["reality-opts"]["public-key"]&&(t.tls.reality.public_key=e["reality-opts"]["public-key"]),e["reality-opts"]["short-id"]&&(t.tls.reality.short_id=e["reality-opts"]["short-id"]),t.tls.utls={enabled:!0}),!["hysteria","hysteria2","tuic"].includes(e.type)&&e["client-fingerprint"]&&e["client-fingerprint"]!==""&&(t.tls.utls={enabled:!0,fingerprint:e["client-fingerprint"]}),t.tls.enabled||delete t.tls},GB=(e={})=>{let t={tag:e.name,type:"ssh",server:e.server,server_port:parseInt(`${e.port}`,10)};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e.username&&(t.user=e.username),e.password&&(t.password=e.password),e.privateKey&&(t.private_key_path=e.privateKey),e["private-key"]&&(t.private_key_path=e["private-key"]),e["private-key-passphrase"]&&(t.private_key_passphrase=e["private-key-passphrase"]),e["server-fingerprint"]&&(t.host_key=[e["server-fingerprint"]],t.host_key_algorithms=[e["server-fingerprint"].split(" ")[0]]),e["host-key"]&&(t.host_key=e["host-key"]),e["host-key-algorithms"]&&(t.host_key_algorithms=e["host-key-algorithms"]),e["fast-open"]&&(t.udp_fragment=!0),Nn(e,t),vn(e,t),t},zB=(e={})=>{let t={tag:e.name,type:"http",server:e.server,server_port:parseInt(`${e.port}`,10),tls:{enabled:!1,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";if(e.username&&(t.username=e.username),e.password&&(t.password=e.password),e.headers){t.headers={};for(let r of Object.keys(e.headers))t.headers[r]=`${e.headers[r]}`;Object.keys(t.headers).length===0&&delete t.headers}return e["fast-open"]&&(t.udp_fragment=!0),Nn(e,t),vn(e,t),ia(e,t),t},YB=(e={})=>{let t={tag:e.name,type:"socks",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,version:"5"};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e.username&&(t.username=e.username),e.password&&(t.password=e.password),e.uot&&(t.udp_over_tcp=!0),e["udp-over-tcp"]&&(t.udp_over_tcp=!0),e["fast-open"]&&(t.udp_fragment=!0),Rs(e,t),Nn(e,t),vn(e,t),t},WB=(e={})=>{let t={tag:e.name,type:"shadowsocks",method:e.cipher,password:e.password,detour:`${e.name}_shadowtls`},r={tag:`${e.name}_shadowtls`,type:"shadowtls",server:e.server,server_port:parseInt(`${e.port}`,10),version:e["plugin-opts"].version,password:e["plugin-opts"].password,tls:{enabled:!0,server_name:e["plugin-opts"].host,utls:{enabled:!0,fingerprint:e["client-fingerprint"]}}};if(r.server_port<0||r.server_port>65535)throw"\u7AEF\u53E3\u503C\u975E\u6CD5";return e["fast-open"]===!0&&(r.udp_fragment=!0),Nn(e,r),vn(e,r),Vi(e.smux,t),{type:"ss-with-st",ssPart:t,stPart:r}},XB=(e={})=>{let t={tag:e.name,type:"shadowsocks",server:e.server,server_port:parseInt(`${e.port}`,10),method:e.cipher,password:e.password};if(t.server_port<0||t.server_port>65535)throw"invalid port";if(e.uot&&(t.udp_over_tcp=!0),e["udp-over-tcp"]&&(t.udp_over_tcp=!0),e["fast-open"]&&(t.udp_fragment=!0),Rs(e,t),Nn(e,t),vn(e,t),Vi(e.smux,t),e.plugin){let r=[];e.plugin==="obfs"&&(t.plugin="obfs-local",t.plugin_opts="",e["obfs-host"]&&(e["plugin-opts"].host=e["obfs-host"]),Object.keys(e["plugin-opts"]).forEach(n=>{switch(n){case"mode":r.push(`obfs=${e["plugin-opts"].mode}`);break;case"host":r.push(`obfs-host=${e["plugin-opts"].host}`);break;default:r.push(`${n}=${e["plugin-opts"][n]}`);break}})),e.plugin==="v2ray-plugin"&&(t.plugin="v2ray-plugin",e["ws-host"]&&(e["plugin-opts"].host=e["ws-host"]),e["ws-path"]&&(e["plugin-opts"].path=e["ws-path"]),Object.keys(e["plugin-opts"]).forEach(n=>{switch(n){case"tls":e["plugin-opts"].tls&&r.push("tls");break;case"host":r.push(`host=${e["plugin-opts"].host}`);break;case"path":r.push(`path=${e["plugin-opts"].path}`);break;case"headers":r.push(`headers=${JSON.stringify(e["plugin-opts"].headers)}`);break;case"mux":e["plugin-opts"].mux&&(t.multiplex={enabled:!0});break;default:r.push(`${n}=${e["plugin-opts"][n]}`)}})),t.plugin_opts=r.join(";")}return t},JB=(e={})=>{let t={tag:e.name,type:"shadowsocksr",server:e.server,server_port:parseInt(`${e.port}`,10),method:e.cipher,password:e.password,obfs:e.obfs,protocol:e.protocol};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["obfs-param"]&&(t.obfs_param=e["obfs-param"]),e["protocol-param"]&&e["protocol-param"]!==""&&(t.protocol_param=e["protocol-param"]),e["fast-open"]&&(t.udp_fragment=!0),Nn(e,t),vn(e,t),Vi(e.smux,t),t},ZB=(e={})=>{let t={tag:e.name,type:"vmess",server:e.server,server_port:parseInt(`${e.port}`,10),uuid:e.uuid,security:e.cipher,alter_id:parseInt(`${e.alterId}`,10),tls:{enabled:!1,server_name:e.server,insecure:!1}};if(["auto","none","zero","aes-128-gcm","chacha20-poly1305","aes-128-ctr"].indexOf(t.security)===-1&&(t.security="auto"),t.server_port<0||t.server_port>65535)throw"invalid port";return e.xudp&&(t.packet_encoding="xudp"),e["fast-open"]&&(t.udp_fragment=!0),e.network==="ws"&&w0(e,t),e.network==="h2"&&KB(e,t),e.network==="http"&&VB(e,t),e.network==="grpc"&&y0(e,t),Rs(e,t),Nn(e,t),vn(e,t),ia(e,t),Vi(e.smux,t),t},QB=(e={})=>{let t={tag:e.name,type:"vless",server:e.server,server_port:parseInt(`${e.port}`,10),uuid:e.uuid,tls:{enabled:!1,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["fast-open"]&&(t.udp_fragment=!0),e.flow==="xtls-rprx-vision"&&(t.flow=e.flow),e.network==="ws"&&w0(e,t),e.network==="grpc"&&y0(e,t),Rs(e,t),Nn(e,t),vn(e,t),Vi(e.smux,t),ia(e,t),t},e$=(e={})=>{let t={tag:e.name,type:"trojan",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["fast-open"]&&(t.udp_fragment=!0),e.network==="grpc"&&y0(e,t),e.network==="ws"&&w0(e,t),Rs(e,t),Nn(e,t),vn(e,t),ia(e,t),Vi(e.smux,t),t},t$=(e={})=>{let t={tag:e.name,type:"hysteria",server:e.server,server_port:parseInt(`${e.port}`,10),disable_mtu_discovery:!1,tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";e.auth_str&&(t.auth_str=`${e.auth_str}`),e["auth-str"]&&(t.auth_str=`${e["auth-str"]}`),e["fast-open"]&&(t.udp_fragment=!0);let r=new RegExp("^[0-9]+[ ]*[KMGT]*[Bb]ps$");return r.test(`${e.up}`)?t.up=`${e.up}`:t.up_mbps=parseInt(`${e.up}`,10),r.test(`${e.down}`)?t.down=`${e.down}`:t.down_mbps=parseInt(`${e.down}`,10),e.obfs&&(t.obfs=e.obfs),e.recv_window_conn&&(t.recv_window_conn=e.recv_window_conn),e["recv-window-conn"]&&(t.recv_window_conn=e["recv-window-conn"]),e.recv_window&&(t.recv_window=e.recv_window),e["recv-window"]&&(t.recv_window=e["recv-window"]),e.disable_mtu_discovery&&(typeof e.disable_mtu_discovery=="boolean"?t.disable_mtu_discovery=e.disable_mtu_discovery:e.disable_mtu_discovery===1&&(t.disable_mtu_discovery=!0)),Rs(e,t),ia(e,t),vn(e,t),Nn(e,t),Vi(e.smux,t),t},r$=(e={})=>{let t={tag:e.name,type:"hysteria2",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,obfs:{},tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["hop-interval"]&&(t.hop_interval=/^\d+$/.test(e["hop-interval"])?`${e["hop-interval"]}s`:e["hop-interval"]),e.ports&&(t.server_ports=e.ports.split(/\s*,\s*/).map(r=>r.replace(/\s*-\s*/g,":"))),e.up&&(t.up_mbps=parseInt(`${e.up}`,10)),e.down&&(t.down_mbps=parseInt(`${e.down}`,10)),e.obfs==="salamander"&&(t.obfs.type="salamander"),e["obfs-password"]&&(t.obfs.password=e["obfs-password"]),t.obfs.type||delete t.obfs,Rs(e,t),ia(e,t),Nn(e,t),vn(e,t),Vi(e.smux,t),t},n$=(e={})=>{let t={tag:e.name,type:"tuic",server:e.server,server_port:parseInt(`${e.port}`,10),uuid:e.uuid,password:e.password,tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["fast-open"]&&(t.udp_fragment=!0),e["congestion-controller"]&&e["congestion-controller"]!=="cubic"&&(t.congestion_control=e["congestion-controller"]),e["udp-relay-mode"]&&e["udp-relay-mode"]!=="native"&&(t.udp_relay_mode=e["udp-relay-mode"]),e["reduce-rtt"]&&(t.zero_rtt_handshake=!0),e["udp-over-stream"]&&(t.udp_over_stream=!0),e["heartbeat-interval"]&&(t.heartbeat=`${e["heartbeat-interval"]}ms`),Rs(e,t),Nn(e,t),vn(e,t),ia(e,t),Vi(e.smux,t),t},i$=(e={})=>{let t={tag:e.name,type:"anytls",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,tls:{enabled:!0,server_name:e.server,insecure:!1}};return/^\d+$/.test(e["idle-session-check-interval"])&&(t.idle_session_check_interval=`${e["idle-session-check-interval"]}s`),/^\d+$/.test(e["idle-session-timeout"])&&(t.idle_session_timeout=`${e["idle-session-timeout"]}s`),vn(e,t),ia(e,t),t},s$=(e={})=>{let t=["ip","ipv6"].map(n=>e[n]).map(n=>{if(or(n))return`${n}/32`;if(Jt(n))return`${n}/128`}).filter(n=>n),r={tag:e.name,type:"wireguard",server:e.server,server_port:parseInt(`${e.port}`,10),local_address:t,private_key:e["private-key"],peer_public_key:e["public-key"],pre_shared_key:e["pre-shared-key"],reserved:[]};if(r.server_port<0||r.server_port>65535)throw"invalid port";if(e["fast-open"]&&(r.udp_fragment=!0),typeof e.reserved=="string")r.reserved=e.reserved;else if(Array.isArray(e.reserved))for(let n of e.reserved)r.reserved.push(n);else delete r.reserved;if(e.peers&&e.peers.length>0){r.peers=[];for(let n of e.peers){let i={server:n.server,server_port:parseInt(`${n.port}`,10),public_key:n["public-key"],allowed_ips:n["allowed-ips"]||n.allowed_ips,reserved:[]};if(typeof n.reserved=="string")i.reserved.push(n.reserved);else if(Array.isArray(n.reserved))for(let a of n.reserved)i.reserved.push(a);else delete i.reserved;n["pre-shared-key"]&&(i.pre_shared_key=n["pre-shared-key"]),r.peers.push(i)}}return Rs(e,r),Nn(e,r),vn(e,r),Vi(e.smux,r),r};function uh(){return{type:"ALL",produce:(r,n,i={})=>{let a=[];return xn().produce(r,"internal",{"include-unsupported-proxy":!0}).map(s=>{try{switch(s.type){case"ssh":a.push(GB(s));break;case"http":a.push(zB(s));break;case"socks5":if(s.tls)throw new Error(`Platform sing-box does not support proxy type: ${s.type} with tls`);a.push(YB(s));break;case"ss":if(s.plugin==="shadow-tls"){let{ssPart:o,stPart:l}=WB(s);a.push(o),a.push(l)}else a.push(XB(s));break;case"ssr":if(i["include-unsupported-proxy"])a.push(JB(s));else throw new Error(`Platform sing-box does not support proxy type: ${s.type}`);break;case"vmess":if(!s.network||["ws","grpc","h2","http"].includes(s.network))a.push(ZB(s));else throw new Error(`Platform sing-box does not support proxy type: ${s.type} with network ${s.network}`);break;case"vless":if(!s.flow||["xtls-rprx-vision"].includes(s.flow))a.push(QB(s));else throw new Error(`Platform sing-box does not support proxy type: ${s.type} with flow ${s.flow}`);break;case"trojan":if(!s.flow)a.push(e$(s));else throw new Error(`Platform sing-box does not support proxy type: ${s.type} with flow ${s.flow}`);break;case"hysteria":a.push(t$(s));break;case"hysteria2":a.push(r$(s,i["include-unsupported-proxy"]));break;case"tuic":if(!s.token||s.token.length===0)a.push(n$(s));else throw new Error("Platform sing-box does not support proxy type: TUIC v4");break;case"wireguard":a.push(s$(s));break;case"anytls":a.push(i$(s));break;default:throw new Error(`Platform sing-box does not support proxy type: ${s.type}`)}}catch(o){G.error(o.message??o)}}),n==="internal"?a:JSON.stringify({outbounds:a},null,2)}}}function oh(){return{type:"ALL",produce:(r,n)=>{let i=r.filter(a=>!(!["http","socks5","ss","trojan","hysteria2","vless","vmess","tuic"].includes(a.type)||a.type==="ss"&&(a.plugin==="obfs"&&!["http","tls"].includes(a["plugin-opts"]?.mode)||!["chacha20-ietf-poly1305","chacha20-poly1305","aes-256-gcm","aes-128-gcm","none","tbale","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","cast5-cfb","des-cfb","idea-cfb","rc2-cfb","seed-cfb","salsa20","chacha20","chacha20-ietf","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(a.cipher))||a.type==="vmess"&&!["http","ws","tcp"].includes(a.network)&&a.network||a.type==="trojan"&&!["http","ws","tcp"].includes(a.network)&&a.network||a.type==="vless"&&(typeof a.flow<"u"||a["reality-opts"]||!["http","ws","tcp"].includes(a.network)&&a.network)||a.type==="tuic"&&a.token&&a.token.length!==0)).map(a=>{let s={...a};a.tls&&!a.sni&&(a.sni=a.server);let o=a.prev_hop||a["underlying-proxy"]||a["dialer-proxy"]||a.detour;if(a.type==="http")a={type:"http",name:a.name,server:a.server,port:a.port,username:a.username,password:a.password,tfo:a.tfo||a["fast-open"],next_hop:a.next_hop};else if(a.type==="socks5")a={type:"socks5",name:a.name,server:a.server,port:a.port,username:a.username,password:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop};else if(a.type==="ss")a={type:"shadowsocks",name:a.name,method:a.cipher==="chacha20-ietf-poly1305"?"chacha20-poly1305":a.cipher,server:a.server,port:a.port,password:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop},s.plugin==="obfs"&&(a.obfs=s["plugin-opts"].mode,a.obfs_host=s["plugin-opts"].host,a.obfs_uri=s["plugin-opts"].path);else if(a.type==="hysteria2")a={type:"hysteria2",name:a.name,server:a.server,port:a.port,auth:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,sni:a.sni,skip_tls_verify:a["skip-cert-verify"],port_hopping:a.ports,port_hopping_interval:a["hop-interval"]},s["obfs-password"]&&s.obfs=="salamander"&&(a.obfs="salamander",a.obfs_password=s["obfs-password"]);else if(a.type==="tuic")a={type:"tuic",name:a.name,server:a.server,port:a.port,uuid:a.uuid,password:a.password,next_hop:a.next_hop,sni:a.sni,alpn:Array.isArray(a.alpn)?a.alpn:[a.alpn||"h3"],skip_tls_verify:a["skip-cert-verify"],port_hopping:a.ports,port_hopping_interval:a["hop-interval"]};else if(a.type==="trojan")a.network==="ws"&&(a.websocket={path:a["ws-opts"]?.path,host:a["ws-opts"]?.headers?.Host}),a={type:"trojan",name:a.name,server:a.server,port:a.port,password:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,sni:a.sni,skip_tls_verify:a["skip-cert-verify"],websocket:a.websocket};else if(a.type==="vmess"){let l=a.cipher;l&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(l)&&(l="auto"),a.network==="ws"?a.transport={[a.tls?"wss":"ws"]:{path:a["ws-opts"]?.path,headers:{Host:a["ws-opts"]?.headers?.Host},sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}:a.network==="http"?a.transport={http1:{method:a["http-opts"]?.method,path:Array.isArray(a["http-opts"]?.path)?a["http-opts"]?.path[0]:a["http-opts"]?.path,headers:{Host:Array.isArray(a["http-opts"]?.headers?.Host)?a["http-opts"]?.headers?.Host[0]:a["http-opts"]?.headers?.Host},skip_tls_verify:a["skip-cert-verify"]}}:a.network==="h2"?a.transport={http2:{method:a["h2-opts"]?.method,path:Array.isArray(a["h2-opts"]?.path)?a["h2-opts"]?.path[0]:a["h2-opts"]?.path,headers:{Host:Array.isArray(a["h2-opts"]?.headers?.Host)?a["h2-opts"]?.headers?.Host[0]:a["h2-opts"]?.headers?.Host},skip_tls_verify:a["skip-cert-verify"]}}:(a.network==="tcp"||!a.network)&&a.tls&&(a.transport={tls:{sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}),a={type:"vmess",name:a.name,server:a.server,port:a.port,user_id:a.uuid,security:l,tfo:a.tfo||a["fast-open"],legacy:a.legacy,udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,transport:a.transport}}else a.type==="vless"&&(a.network==="ws"?a.transport={[a.tls?"wss":"ws"]:{path:a["ws-opts"]?.path,headers:{Host:a["ws-opts"]?.headers?.Host},sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}:a.network==="http"?a.transport={http:{method:a["http-opts"]?.method,path:Array.isArray(a["http-opts"]?.path)?a["http-opts"]?.path[0]:a["http-opts"]?.path,headers:{Host:Array.isArray(a["http-opts"]?.headers?.Host)?a["http-opts"]?.headers?.Host[0]:a["http-opts"]?.headers?.Host},skip_tls_verify:a["skip-cert-verify"]}}:(a.network==="tcp"||!a.network)&&(a.transport={[a.tls?"tls":"tcp"]:{sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}),a={type:"vless",name:a.name,server:a.server,port:a.port,user_id:a.uuid,security:a.cipher,tfo:a.tfo||a["fast-open"],legacy:a.legacy,udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,transport:a.transport});if(["http","socks5","ss","trojan","vless","vmess"].includes(s.type)){if(ae(s,"shadow-tls-password")){if(s["shadow-tls-version"]!=3)throw new Error(`shadow-tls version ${s["shadow-tls-version"]} is not supported`);a.shadow_tls={password:s["shadow-tls-password"],sni:s["shadow-tls-sni"]}}else if(["shadow-tls"].includes(s.plugin)&&s["plugin-opts"]){if(s["plugin-opts"].version!=3)throw new Error(`shadow-tls version ${s["plugin-opts"].version} is not supported`);a.shadow_tls={password:s["plugin-opts"].password,sni:s["plugin-opts"].host}}}if(delete a.subName,delete a.collectionName,delete a.id,delete a.resolved,delete a["no-resolve"],n!=="internal")for(let l in a)(a[l]==null||/^_/i.test(l))&&delete a[l];return{[a.type]:{...a,type:void 0,prev_hop:o}}});return n==="internal"?i:`proxies:
`+i.map(a=>" - "+JSON.stringify(a)+`
`).join("")}}}function oA(){return{type:"ALL",produce:(r,n)=>n==="internal"?r:JSON.stringify(r,null,2)}}var ch={qx:Vc(),QX:Vc(),QuantumultX:Vc(),surge:So(),Surge:So(),SurgeMac:v0(),Loon:A0(),Clash:E0(),meta:xn(),clashmeta:xn(),"clash.meta":xn(),"Clash.Meta":xn(),ClashMeta:xn(),mihomo:xn(),Mihomo:xn(),uri:bo(),URI:bo(),v2:qc(),v2ray:qc(),V2Ray:qc(),json:oA(),JSON:oA(),stash:sh(),Stash:sh(),shadowrocket:Kc(),Shadowrocket:Kc(),ShadowRocket:Kc(),surfboard:ah(),Surfboard:ah(),singbox:uh(),"sing-box":uh(),egern:oh(),Egern:oh()};var dw=ln(Zc()),d7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
}}
// per-parser initializer
{
const proxy = {};
const obfs = {};
const $ = {};
function handleWebsocket() {
if (obfs.type === "ws") {
proxy.network = "ws";
$set(proxy, "ws-opts.path", obfs.path);
$set(proxy, "ws-opts.headers", obfs['ws-headers']);
if (proxy['ws-opts'] && proxy['ws-opts']['headers'] && proxy['ws-opts']['headers'].Host) {
proxy['ws-opts']['headers'].Host = proxy['ws-opts']['headers'].Host.replace(/^"(.*)"$/, '$1')
}
}
}
function handleShadowTLS() {
if (proxy['shadow-tls-password'] && !proxy['shadow-tls-version']) {
proxy['shadow-tls-version'] = 2;
}
}
}
start = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls/tuic/tuic_v5/wireguard/hysteria2/ssh/direct) {
return proxy;
}
shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/udp_port/others)* {
proxy.type = "ss";
// handle obfs
if (obfs.type == "http" || obfs.type === "tls") {
proxy.plugin = "obfs";
$set(proxy, "plugin-opts.mode", obfs.type);
$set(proxy, "plugin-opts.host", obfs.host);
$set(proxy, "plugin-opts.path", obfs.path);
}
handleShadowTLS();
}
vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls/sni/tls_fingerprint/tls_verification/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
if (proxy.aead) {
proxy.alterId = 0;
} else {
proxy.alterId = proxy.alterId || 0;
}
handleWebsocket();
handleShadowTLS();
}
trojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "trojan";
handleWebsocket();
handleShadowTLS();
}
https = tag equals "https" address (username password)? (usernamek passwordk)? (sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "http";
proxy.tls = true;
handleShadowTLS();
}
http = tag equals "http" address (username password)? (usernamek passwordk)? (ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "http";
handleShadowTLS();
}
ssh = tag equals "ssh" address (username password)? (usernamek passwordk)? (server_fingerprint/idle_timeout/private_key/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "ssh";
handleShadowTLS();
}
snell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/reuse/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "snell";
// handle obfs
if (obfs.type == "http" || obfs.type === "tls") {
$set(proxy, "obfs-opts.mode", obfs.type);
$set(proxy, "obfs-opts.host", obfs.host);
$set(proxy, "obfs-opts.path", obfs.path);
}
handleShadowTLS();
}
tuic = tag equals "tuic" address (alpn/token/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
proxy.type = "tuic";
handleShadowTLS();
}
tuic_v5 = tag equals "tuic-v5" address (alpn/passwordk/uuidk/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
proxy.type = "tuic";
proxy.version = 5;
handleShadowTLS();
}
wireguard = tag equals "wireguard" (section_name/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "wireguard-surge";
handleShadowTLS();
}
hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/fast_open/tfo/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
proxy.type = "hysteria2";
handleShadowTLS();
}
socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "socks5";
handleShadowTLS();
}
socks5_tls = tag equals "socks5-tls" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_fingerprint/tls_verification/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "socks5";
proxy.tls = true;
handleShadowTLS();
}
direct = tag equals "direct" (udp_relay/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/block_quic/others)* {
proxy.type = "direct";
}
address = comma server:server comma port:port {
proxy.server = server;
proxy.port = port;
}
server = ip/domain
ip = & {
const start = peg$currPos;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
j++;
}
peg$currPos = j;
$.ip = input.substring(start, j).trim();
return true;
} { return $.ip; }
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
}
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
}
}
port_hopping_interval = comma "port-hopping-interval" equals match:$[0-9]+ { proxy["hop-interval"] = parseInt(match.trim()); }
username = & {
let j = peg$currPos;
let start, end;
let first = true;
while (j < input.length) {
if (input[j] === ',') {
if (first) {
start = j + 1;
first = false;
} else {
end = j;
break;
}
}
j++;
}
const match = input.substring(start, end);
if (match.indexOf("=") === -1) {
$.username = match;
peg$currPos = end;
return true;
}
} { proxy.username = $.username; }
password = comma match:[^,]+ { proxy.password = match.join(""); }
tls = comma "tls" equals flag:bool { proxy.tls = flag; }
sni = comma "sni" equals sni:("off"/domain) {
if (sni === "off") {
proxy["disable-sni"] = true;
} else {
proxy.sni = sni;
}
}
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join(""); }
passwordk = comma "password" equals match:[^,]+ { proxy.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }
vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
method = comma "encrypt-method" equals cipher:cipher {
proxy.cipher = cipher;
}
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"idea-cfb"/"none"/"rc2-cfb"/"rc4-md5"/"rc4"/"salsa20"/"seed-cfb"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
ws = comma "ws" equals flag:bool { obfs.type = "ws"; }
ws_headers = comma "ws-headers" equals headers:$[^,]+ {
const pairs = headers.split("|");
const result = {};
pairs.forEach(pair => {
const [key, value] = pair.trim().split(":");
result[key.trim()] = value.trim();
})
obfs["ws-headers"] = result;
}
ws_path = comma "ws-path" equals path:uri { obfs.path = path; }
obfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };
obfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }
uri = $[^,]+
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
reuse = comma "reuse" equals flag:bool { proxy.reuse = flag; }
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
tfo = comma "tfo" equals flag:bool { proxy.tfo = flag; }
ip_version = comma "ip-version" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
section_name = comma "section-name" equals match:[^,]+ { proxy["section-name"] = match.join(""); }
no_error_alert = comma "no-error-alert" equals match:[^,]+ { proxy["no-error-alert"] = match.join(""); }
underlying_proxy = comma "underlying-proxy" equals match:[^,]+ { proxy["underlying-proxy"] = match.join(""); }
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
test_url = comma "test-url" equals match:[^,]+ { proxy["test-url"] = match.join(""); }
test_udp = comma "test-udp" equals match:[^,]+ { proxy["test-udp"] = match.join(""); }
test_timeout = comma "test-timeout" equals match:$[0-9]+ { proxy["test-timeout"] = parseInt(match.trim()); }
tos = comma "tos" equals match:$[0-9]+ { proxy.tos = parseInt(match.trim()); }
interface = comma "interface" equals match:[^,]+ { proxy.interface = match.join(""); }
allow_other_interface = comma "allow-other-interface" equals flag:bool { proxy["allow-other-interface"] = flag; }
hybrid = comma "hybrid" equals flag:bool { proxy.hybrid = flag; }
idle_timeout = comma "idle-timeout" equals match:$[0-9]+ { proxy["idle-timeout"] = parseInt(match.trim()); }
private_key = comma "private-key" equals match:[^,]+ { proxy["keystore-private-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
server_fingerprint = comma "server-fingerprint" equals match:[^,]+ { proxy["server-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
block_quic = comma "block-quic" equals match:[^,]+ { proxy["block-quic"] = match.join(""); }
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
token = comma "token" equals match:[^,]+ { proxy.token = match.join(""); }
alpn = comma "alpn" equals match:[^,]+ { proxy.alpn = match.join(""); }
uuidk = comma "uuid" equals match:[^,]+ { proxy.uuid = match.join(""); }
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
comma = _ "," _
equals = _ "=" _
_ = [ \r\t]*
bool = b:("true"/"false") { return b === "true" }
others = comma [^=,]+ equals [^=,]+
`,j0;function Ln(){return j0||(j0=dw.generate(d7)),j0}var gw=ln(Zc()),g7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
}}
// per-parser initializer
{
const proxy = {};
const obfs = {};
const transport = {};
const $ = {};
function handleTransport() {
if (transport.type === "tcp") { /* do nothing */ }
else if (transport.type === "ws") {
proxy.network = "ws";
$set(proxy, "ws-opts.path", transport.path);
$set(proxy, "ws-opts.headers.Host", transport.host);
} else if (transport.type === "http") {
proxy.network = "http";
$set(proxy, "http-opts.path", transport.path);
$set(proxy, "http-opts.headers.Host", transport.host);
}
}
}
start = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http/socks5/hysteria2) {
return proxy;
}
shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/others)*{
proxy.type = "ssr";
// handle ssr obfs
proxy.obfs = obfs.type;
}
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/others)* {
proxy.type = "ss";
// handle ss obfs
if (obfs.type == "http" || obfs.type === "tls") {
proxy.plugin = "obfs";
$set(proxy, "plugin-opts.mode", obfs.type);
$set(proxy, "plugin-opts.host", obfs.host);
$set(proxy, "plugin-opts.path", obfs.path);
}
}
vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/public_key/short_id/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
proxy.alterId = proxy.alterId || 0;
handleTransport();
}
vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/flow/public_key/short_id/others)* {
proxy.type = "vless";
handleTransport();
}
trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "trojan";
handleTransport();
}
hysteria2 = tag equals "hysteria2"i address password (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/others)* {
proxy.type = "hysteria2";
}
https = tag equals "https"i address (username password)? (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "http";
proxy.tls = true;
}
http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/others)* {
proxy.type = "http";
}
socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "socks5";
}
address = comma server:server comma port:port {
proxy.server = server;
proxy.port = port;
}
server = ip/domain
ip = & {
const start = peg$currPos;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
j++;
}
peg$currPos = j;
$.ip = input.substring(start, j).trim();
return true;
} { return $.ip; }
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
throw new Error("Invalid domain: " + domain);
}
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
}
throw new Error("Invalid port number: " + port);
}
method = comma cipher:cipher {
proxy.cipher = cipher;
}
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"auto"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"rc4-md5"/"rc4"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
username = & {
let j = peg$currPos;
let start, end;
let first = true;
while (j < input.length) {
if (input[j] === ',') {
if (first) {
start = j + 1;
first = false;
} else {
end = j;
break;
}
}
j++;
}
const match = input.substring(start, end);
if (match.indexOf("=") === -1) {
$.username = match;
peg$currPos = end;
return true;
}
} { proxy.username = $.username; }
password = comma '"' match:[^"]* '"' { proxy.password = match.join(""); }
uuid = comma '"' match:[^"]+ '"' { proxy.uuid = match.join(""); }
obfs_typev = comma type:("http"/"tls") { obfs.type = type; }
obfs_hostv = comma match:[^,]+ { obfs.host = match.join(""); }
obfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }
obfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }
obfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }
uri = $[^,]+
transport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }
transport_host = comma "host" equals host:domain { transport.host = host; }
transport_path = comma "path" equals path:uri { transport.path = path; }
ssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }
ssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }
vmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); }
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
tls_host = comma sni:("tls-name"/"sni") equals host:domain { proxy.sni = host; }
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
tls_cert_sha256 = comma "tls-cert-sha256" equals match:[^,]+ { proxy["tls-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals match:[^,]+ { proxy["tls-pubkey-sha256"] = match.join("").replace(/^"(.*)"$/, '$1'); }
flow = comma "flow" equals match:[^,]+ { proxy["flow"] = match.join("").replace(/^"(.*)"$/, '$1'); }
public_key = comma "public-key" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["public-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
short_id = comma "short-id" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["short-id"] = match.join("").replace(/^"(.*)"$/, '$1'); }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
ip_mode = comma "ip-mode" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
salamander_password = comma "salamander-password" equals match:[^,]+ { proxy['obfs-password'] = match.join(""); proxy.obfs = 'salamander'; }
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
comma = _ "," _
equals = _ "=" _
_ = [ \r\t]*
bool = b:("true"/"false") { return b === "true" }
others = comma [^=,]+ equals [^=,]+
`,M0;function Ki(){return M0||(M0=gw.generate(g7)),M0}var mw=ln(Zc()),m7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
}}
// per-parse initializer
{
const proxy = {};
const obfs = {};
const $ = {};
function handleObfs() {
if (obfs.type === "ws" || obfs.type === "wss") {
proxy.network = "ws";
if (obfs.type === 'wss') {
proxy.tls = true;
}
$set(proxy, "ws-opts.path", obfs.path);
$set(proxy, "ws-opts.headers.Host", obfs.host);
} else if (obfs.type === "over-tls") {
proxy.tls = true;
} else if (obfs.type === "http") {
proxy.network = "http";
$set(proxy, "http-opts.path", obfs.path);
$set(proxy, "http-opts.headers.Host", obfs.host);
}
}
}
start = (trojan/shadowsocks/vmess/vless/http/socks5) {
return proxy
}
trojan = "trojan" equals address
(password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/server_check_url/others)* {
proxy.type = "trojan";
handleObfs();
}
shadowsocks = "shadowsocks" equals address
(password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/server_check_url/others)* {
if (proxy.protocol || proxy.type === "ssr") {
proxy.type = "ssr";
if (!proxy.protocol) {
proxy.protocol = "origin";
}
// handle ssr obfs
if (obfs.host) proxy["obfs-param"] = obfs.host;
if (obfs.type) proxy.obfs = obfs.type;
} else {
proxy.type = "ss";
// handle ss obfs
if (obfs.type == "http" || obfs.type === "tls") {
proxy.plugin = "obfs";
$set(proxy, "plugin-opts", {
mode: obfs.type
});
} else if (obfs.type === "ws" || obfs.type === "wss") {
proxy.plugin = "v2ray-plugin";
$set(proxy, "plugin-opts.mode", "websocket");
if (obfs.type === "wss") {
$set(proxy, "plugin-opts.tls", true);
}
} else if (obfs.type === 'over-tls') {
throw new Error('ss over-tls is not supported');
}
if (obfs.type) {
$set(proxy, "plugin-opts.host", obfs.host);
$set(proxy, "plugin-opts.path", obfs.path);
}
}
}
vmess = "vmess" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
if (proxy.aead) {
proxy.alterId = 0;
} else {
proxy.alterId = proxy.alterId || 0;
}
handleObfs();
}
vless = "vless" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vless";
proxy.cipher = proxy.cipher || "none";
handleObfs();
}
http = "http" equals address
(username/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)*{
proxy.type = "http";
}
socks5 = "socks5" equals address
(username/password/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)* {
proxy.type = "socks5";
}
address = server:server ":" port:port {
proxy.server = server;
proxy.port = port;
}
server = ip/domain
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
}
ip = & {
const start = peg$currPos;
let end;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
if (input[j] === ":") end = j;
j++;
}
peg$currPos = end || j;
$.ip = input.substring(start, end).trim();
return true;
} { return $.ip; }
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
}
}
username = comma "username" equals username:[^,]+ { proxy.username = username.join("").trim(); }
password = comma "password" equals password:[^,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^,]+ { proxy.uuid = uuid.join("").trim(); }
method = comma "method" equals cipher:cipher {
proxy.cipher = cipher;
};
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
aead = comma "aead" equals flag:bool { proxy.aead = flag; }
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
udp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
tls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }
tls_verification = comma "tls-verification" equals flag:bool {
proxy["skip-cert-verify"] = !flag;
}
tls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals param:$[^=,]+ { proxy["tls-pubkey-sha256"] = param; }
tls_alpn = comma "tls-alpn" equals param:$[^=,]+ { proxy["tls-alpn"] = param; }
tls_no_session_ticket = comma "tls-no-session-ticket" equals flag:bool {
proxy["tls-no-session-ticket"] = flag;
}
tls_no_session_reuse = comma "tls-no-session-reuse" equals flag:bool {
proxy["tls-no-session-reuse"] = flag;
}
obfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { proxy.type = "ssr"; obfs.type = type; return type; }
obfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }
obfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }
ssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }
ssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }
server_check_url = comma "server_check_url" equals param:$[^=,]+ { proxy["test-url"] = param; }
uri = $[^,]+
tag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }
others = comma [^=,]+ equals [^=,]+
comma = _ "," _
equals = _ "=" _
_ = [ \r\t]*
bool = b:("true"/"false") { return b === "true" }
`,q0;function xs(){return q0||(q0=mw.generate(m7)),q0}var vw=ln(Zc()),v7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
function toBool(str) {
if (typeof str === 'undefined' || str === null) return undefined;
return /(TRUE)|1/i.test(str);
}
}}
{
const proxy = {};
const obfs = {};
const $ = {};
const params = {};
}
start = (trojan) {
return proxy
}
trojan = "trojan://" password:password "@" server:server ":" port:port "/"? params? name:name?{
proxy.type = "trojan";
proxy.password = password;
proxy.server = server;
proxy.port = port;
proxy.name = name;
// name may be empty
if (!proxy.name) {
proxy.name = server + ":" + port;
}
};
password = match:$[^@]+ {
return decodeURIComponent(match);
};
server = ip/domain;
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
}
ip = & {
const start = peg$currPos;
let end;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
if (input[j] === ":") end = j;
j++;
}
peg$currPos = end || j;
$.ip = input.substring(start, end).trim();
return true;
} { return $.ip; }
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
} else {
throw new Error("Invalid port: " + port);
}
}
params = "?" head:param tail:("&"@param)* {
for (const [key, value] of Object.entries(params)) {
params[key] = decodeURIComponent(value);
}
proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);
proxy.sni = params["sni"] || params["peer"];
proxy['client-fingerprint'] = params.fp;
proxy.alpn = params.alpn ? decodeURIComponent(params.alpn).split(',') : undefined;
if (toBool(params["ws"])) {
proxy.network = "ws";
$set(proxy, "ws-opts.path", params["wspath"]);
}
if (params["type"]) {
let httpupgrade
proxy.network = params["type"]
if(proxy.network === 'httpupgrade') {
proxy.network = 'ws'
httpupgrade = true
}
if (['grpc'].includes(proxy.network)) {
proxy[proxy.network + '-opts'] = {
'grpc-service-name': params["serviceName"],
'_grpc-type': params["mode"],
'_grpc-authority': params["authority"],
};
} else {
if (params["path"]) {
$set(proxy, proxy.network+"-opts.path", decodeURIComponent(params["path"]));
}
if (params["host"]) {
$set(proxy, proxy.network+"-opts.headers.Host", decodeURIComponent(params["host"]));
}
if (httpupgrade) {
$set(proxy, proxy.network+"-opts.v2ray-http-upgrade", true);
$set(proxy, proxy.network+"-opts.v2ray-http-upgrade-fast-open", true);
}
}
if (['reality'].includes(params.security)) {
const opts = {};
if (params.pbk) {
opts['public-key'] = params.pbk;
}
if (params.sid) {
opts['short-id'] = params.sid;
}
if (params.spx) {
opts['_spider-x'] = params.spx;
}
if (params.mode) {
proxy._mode = params.mode;
}
if (params.extra) {
proxy._extra = params.extra;
}
if (Object.keys(opts).length > 0) {
$set(proxy, params.security+"-opts", opts);
}
}
}
proxy.udp = toBool(params["udp"]);
proxy.tfo = toBool(params["tfo"]);
}
param = kv/single;
kv = key:$[a-z]i+ "=" value:$[^&#]i* {
params[key] = value;
}
single = key:$[a-z]i+ {
params[key] = true;
};
name = "#" + match:$.* {
return decodeURIComponent(match);
}
`,V0;function K0(){return V0||(V0=vw.generate(v7)),V0}function Ew(e){let[t,r]=e.match(/,\s*?port-hopping\s*?=\s*?["']?\s*?((\d+(-\d+)?)([,;]\d+(-\d+)?)*)\s*?["']?\s*?/)||[];return{port_hopping:r?r.replace(/;/g,","):void 0,line:t?e.replace(t,""):e}}function E7(){return{name:"URI PROXY Parser",test:n=>/^(socks5\+tls|socks5|http|https):\/\//.test(n),parse:n=>{let[i,a,s,o,l,h,d,E,p]=n.match(/^(socks5|http|http)(\+tls|s)?:\/\/(?:(.*?):(.*?)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(d)d=parseInt(d,10);else{if(s)d=443;else if(a==="http")d=80;else throw G.error(`port is not present in line: ${n}`),new Error(`port is not present in line: ${n}`);G.info(`port is not present in line: ${n}, set to ${d}`)}return{name:p!=null?decodeURIComponent(p):`${a} ${h}:${d}`,type:a,tls:!!s,server:h,port:d,username:o!=null?decodeURIComponent(o):void 0,password:l!=null?decodeURIComponent(l):void 0}}}}function A7(){return{name:"URI SOCKS Parser",test:n=>/^socks:\/\//.test(n),parse:n=>{let[i,a,s,o,l,h,d]=n.match(/^(socks)?:\/\/(?:(.*)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(l)l=parseInt(l,10);else throw G.error(`port is not present in line: ${n}`),new Error(`port is not present in line: ${n}`);let E,p;if(s){let w=Et.decode(decodeURIComponent(s)).split(":");E=w[0],p=w[1]}return{name:d!=null?decodeURIComponent(d):`${a} ${o}:${l}`,type:"socks5",server:o,port:l,username:E,password:p}}}}function w7(){return{name:"URI SS Parser",test:n=>/^ss:\/\//.test(n),parse:n=>{let i=n.split("ss://")[1],a={name:decodeURIComponent(n.split("#")[1]),type:"ss"};i=i.split("#")[0];let s=i.match(/@([^/]*)(\/|$)/),o=decodeURIComponent(i.split("@")[0]),l;o?.startsWith("2022-blake3-")?l=o:l=Et.decode(o);let h="";if(s)i.includes("?")&&(h=i.match(/(\?.*)$/)[1]);else{if(i.includes("?")){let g=i.match(/^(.*)(\?.*)$/);i=g[1],h=g[2]}if(i=Et.decode(i),h){if(/(&|\?)v2ray-plugin=/.test(h)){let y=h.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/)[2];y&&(a.plugin="v2ray-plugin",a["plugin-opts"]=JSON.parse(Et.decode(y)))}i=`${i}${h}`}l=i.match(/(^.*)@/)?.[1],s=i.match(/@([^/@]*)(\/|$)/)}let d=s[1],E=d.lastIndexOf(":");a.server=d.substring(0,E),a.port=`${d.substring(E+1)}`.match(/\d+/)?.[0];let p=l.match(/(^.*?):(.*$)/);a.cipher=p?.[1],a.password=p?.[2];let f=i.match(/[?&]plugin=([^&]+)/),w=i.match(/[?&]shadow-tls=([^&]+)/);if(f){let g=("plugin="+decodeURIComponent(f[1])).split(";"),y={};for(let A of g){let[S,_]=A.split("=");S&&(y[S]=_||!0)}switch(y.plugin){case"obfs-local":case"simple-obfs":a.plugin="obfs",a["plugin-opts"]={mode:y.obfs,host:Lt(y["obfs-host"])};break;case"v2ray-plugin":a.plugin="v2ray-plugin",a["plugin-opts"]={mode:"websocket",host:Lt(y["obfs-host"]),path:Lt(y.path),tls:eu(y.tls)};break;case"shadow-tls":{a.plugin="shadow-tls";let A=Lt(y.version);a["plugin-opts"]={host:Lt(y.host),password:Lt(y.password),version:A?parseInt(A,10):void 0};break}default:throw new Error(`Unsupported plugin option: ${y.plugin}`)}}if(w){let g=JSON.parse(Et.decode(w[1])),y=Lt(g.version),A=Lt(g.address),S=Lt(g.port);a.plugin="shadow-tls",a["plugin-opts"]={host:Lt(g.host),password:Lt(g.password),version:y?parseInt(y,10):void 0},A&&(a.server=A),S&&(a.port=parseInt(S,10))}return/(&|\?)uot=(1|true)/i.test(h)&&(a["udp-over-tcp"]=!0),/(&|\?)tfo=(1|true)/i.test(h)&&(a.tfo=!0),a}}}function y7(){return{name:"URI SSR Parser",test:n=>/^ssr:\/\//.test(n),parse:n=>{n=Et.decode(n.split("ssr://")[1]);let i=n.indexOf(":origin");i===-1&&(i=n.indexOf(":auth_"));let a=n.substring(0,i),s=a.substring(0,a.lastIndexOf(":")),o=a.substring(a.lastIndexOf(":")+1),l=n.substring(i+1).split("/?")[0].split(":"),h={type:"ssr",server:s,port:o,protocol:l[0],cipher:l[1],obfs:l[2],password:Et.decode(l[3])},d={};if(n=n.split("/?")[1].split("&"),n.length>1)for(let E of n){let[p,f]=E.split("=");f=f.trim(),f.length>0&&f!=="(null)"&&(d[p]=f)}return h={...h,name:d.remarks?Et.decode(d.remarks):h.server,"protocol-param":Lt(Et.decode(d.protoparam||"").replace(/\s/g,"")),"obfs-param":Lt(Et.decode(d.obfsparam||"").replace(/\s/g,""))},h}}}function S7(){return{name:"URI VMess Parser",test:n=>/^vmess:\/\//.test(n),parse:n=>{n=n.split("vmess://")[1];let i=Et.decode(n.replace(/\?.*?$/,""));if(/=\s*vmess/.test(i)){let a=i.split(",").map(l=>l.trim()),s={};for(let l of a)if(l.indexOf("=")!==-1){let[h,d]=l.split("=");s[h.trim()]=d.trim()}let o={name:a[0].split("=")[0].trim(),type:"vmess",server:a[1],port:a[2],cipher:Lt(a[3],"auto"),uuid:a[4].match(/^"(.*)"$/)[1],tls:s.obfs==="wss",udp:eu(s["udp-relay"]),tfo:eu(s["fast-open"]),"skip-cert-verify":ho(s["tls-verification"])?!s["tls-verification"]:void 0};if(ho(s.obfs))if(s.obfs==="ws"||s.obfs==="wss"){o.network="ws",o["ws-opts"].path=(Lt(s["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];let l=s["obfs-header"];l&&l.indexOf("Host")!==-1&&(l=l.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),Ti(l)&&(o["ws-opts"].headers={Host:l})}else throw new Error(`Unsupported obfs: ${s.obfs}`);return o}else{let a={};try{a=JSON.parse(i)}catch{let[E,p,f]=/(^[^?]+?)\/?\?(.*)$/.exec(n);i=Et.decode(p);for(let _ of f.split("&")){let[I,D]=_.split("="),H=D;H=decodeURIComponent(D),H.indexOf(",")===-1?a[I]=H:a[I]=H.split(",")}let[w,g,y,A,S]=/(^[^:]+?):([^:]+?)@(.*):(\d+)$/.exec(i);a.scy=g,a.id=y,a.port=S,a.add=A}let s=a.add,o=parseInt(eu(a.port),10),l={name:a.ps??a.remarks??a.remark??`VMess ${s}:${o}`,type:"vmess",server:s,port:o,cipher:eu(a.scy,"auto"),uuid:a.id,alterId:parseInt(eu(a.aid??a.alterId,0),10),tls:["tls",!0,1,"1"].includes(a.tls),"skip-cert-verify":ho(a.verify_cert)?!a.verify_cert:void 0};!l["skip-cert-verify"]&&ho(a.allowInsecure)&&(l["skip-cert-verify"]=/(TRUE)|1/i.test(a.allowInsecure)),l.tls&&a.sni&&a.sni!==""&&(l.sni=a.sni);let h=!1;if(a.net==="ws"||a.obfs==="websocket"?l.network="ws":["http"].includes(a.net)||["http"].includes(a.obfs)||["http"].includes(a.type)?l.network="http":["grpc"].includes(a.net)?l.network="grpc":a.net==="httpupgrade"||l.network==="httpupgrade"?(l.network="ws",h=!0):(a.net==="h2"||l.network==="h2")&&(l.network="h2"),l.network){let d=a.host??a.obfsParam;try{let f=JSON.parse(d)?.Host;f&&(d=f)}catch{}let E=a.path;if(["ws"].includes(l.network)&&(E=E||"/"),l.network==="http"&&(d&&(d=d.split(",").map(p=>p.trim()),d=Array.isArray(d)?d[0]:d),E?E=Array.isArray(E)?E[0]:E:E="/"),E||d)if(["grpc"].includes(l.network))l[`${l.network}-opts`]={"grpc-service-name":Lt(E),"_grpc-type":Lt(a.type),"_grpc-authority":Lt(a.authority)};else{let p={path:Lt(E),headers:{Host:Lt(d)}};h&&(p["v2ray-http-upgrade"]=!0,p["v2ray-http-upgrade-fast-open"]=!0),l[`${l.network}-opts`]=p}else delete l.network}return l}}}}function b7(){return{name:"URI VLESS Parser",test:n=>/^vless:\/\//.test(n),parse:n=>{n=n.split("vless://")[1];let i,a=/^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);if(!a){let[y,A,S]=/^(.*?)(\?.*?$)/.exec(n);n=`${Et.decode(A)}${S}`,a=/^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(n),i=!0}let[s,o,l,h,d,E="",p]=a;i&&(o=o.replace(/^.*?:/g,"")),h=parseInt(`${h}`,10),o=decodeURIComponent(o),p!=null&&(p=decodeURIComponent(p));let f={type:"vless",name:p,server:l,port:h,uuid:o},w={};for(let y of E.split("&")){let[A,S]=y.split("="),_=S;_=decodeURIComponent(S),w[A]=_}if(f.name=p??w.remarks??w.remark??`VLESS ${l}:${h}`,f.tls=w.security&&w.security!=="none",i&&/TRUE|1/i.test(w.tls)&&(f.tls=!0,w.security=w.security??"reality"),f.sni=w.sni||w.peer,f.flow=w.flow,!f.flow&&i&&w.xtls){let y=[void 0,"xtls-rprx-direct","xtls-rprx-vision"][w.xtls];y&&(f.flow=y)}if(f["client-fingerprint"]=w.fp,f.alpn=w.alpn?w.alpn.split(","):void 0,f["skip-cert-verify"]=/(TRUE)|1/i.test(w.allowInsecure),["reality"].includes(w.security)){let y={};w.pbk&&(y["public-key"]=w.pbk),w.sid&&(y["short-id"]=w.sid),w.spx&&(y["_spider-x"]=w.spx),Object.keys(y).length>0&&(f[`${w.security}-opts`]=y)}let g=!1;if(f.network=w.type,f.network==="tcp"&&w.headerType==="http"?f.network="http":f.network==="httpupgrade"&&(f.network="ws",g=!0),!f.network&&i&&w.obfs&&(f.network=w.obfs,["none"].includes(f.network)&&(f.network="tcp")),["websocket"].includes(f.network)&&(f.network="ws"),f.network&&!["tcp","none"].includes(f.network)){let y={},A=w.host??w.obfsParam;if(A)if(w.obfsParam)try{let S=JSON.parse(A);y.headers=S}catch{y.headers={Host:A}}else y.headers={Host:A};w.serviceName?(y[`${f.network}-service-name`]=w.serviceName,["grpc"].includes(f.network)&&w.authority&&(y["_grpc-authority"]=w.authority)):i&&w.path&&(["ws","http","h2"].includes(f.network)||(y[`${f.network}-service-name`]=w.path,delete w.path)),w.path&&(y.path=w.path),["grpc"].includes(f.network)&&(y["_grpc-type"]=w.mode||"gun"),g&&(y["v2ray-http-upgrade"]=!0,y["v2ray-http-upgrade-fast-open"]=!0),Object.keys(y).length>0&&(f[`${f.network}-opts`]=y),f.network==="kcp"&&(w.seed&&(f.seed=w.seed),f.headerType=w.headerType||"none"),w.mode&&(f._mode=w.mode),w.extra&&(f._extra=w.extra)}return f}}}function C7(){return{name:"URI AnyTLS Parser",test:n=>/^anytls:\/\//.test(n),parse:n=>{n=n.split(/anytls:\/\//)[1];let[i,a,s,o,l="",h]=/^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(n);a=decodeURIComponent(a),o=parseInt(`${o}`,10),isNaN(o)&&(o=443),a=decodeURIComponent(a),h!=null&&(h=decodeURIComponent(h)),h=h??`AnyTLS ${s}:${o}`;let d={type:"anytls",name:h,server:s,port:o,password:a};for(let E of l.split("&")){let[p,f]=E.split("=");p=p.replace(/_/g,"-"),f=decodeURIComponent(f),["alpn"].includes(p)?d[p]=f?f.split(","):void 0:["insecure"].includes(p)?d["skip-cert-verify"]=/(TRUE)|1/i.test(f):d[p]=f}return d}}}function F7(){return{name:"URI Hysteria2 Parser",test:n=>/^(hysteria2|hy2):\/\//.test(n),parse:n=>{n=n.split(/(hysteria2|hy2):\/\//)[2];let i,[a,s,o,l,h,d,E,p,f,w,g="",y]=/^(.*?)@(.*?)(:((\d+(-\d+)?)([,;]\d+(-\d+)?)*))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);/^\d+$/.test(h)?(h=parseInt(`${h}`,10),isNaN(h)&&(h=443)):h?(i=h,h=xc(i)):h=443,s=decodeURIComponent(s),y!=null&&(y=decodeURIComponent(y)),y=y??`Hysteria2 ${o}:${h}`;let A={type:"hysteria2",name:y,server:o,port:h,ports:i,password:s},S={};for(let D of g.split("&")){let[H,V]=D.split("="),F=V;F=decodeURIComponent(V),S[H]=F}A.sni=S.sni,!A.sni&&S.peer&&(A.sni=S.peer),S.obfs&&S.obfs!=="none"&&(A.obfs=S.obfs),S.mport&&(A.ports=S.mport),A["obfs-password"]=S["obfs-password"],A["skip-cert-verify"]=/(TRUE)|1/i.test(S.insecure),A.tfo=/(TRUE)|1/i.test(S.fastopen),A["tls-fingerprint"]=S.pinSHA256;let _=S["hop-interval"]||S.hop_interval;/^\d+$/.test(_)&&(A["hop-interval"]=parseInt(`${_}`,10));let I=S.keepalive;return/^\d+$/.test(I)&&(A.keepalive=parseInt(`${I}`,10)),A}}}function _7(){return{name:"URI Hysteria Parser",test:n=>/^(hysteria|hy):\/\//.test(n),parse:n=>{n=n.split(/(hysteria|hy):\/\//)[2];let[i,a,s,o,l,h="",d]=/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);o=parseInt(`${o}`,10),isNaN(o)&&(o=443),d!=null&&(d=decodeURIComponent(d)),d=d??`Hysteria ${a}:${o}`;let E={type:"hysteria",name:d,server:a,port:o},p={};for(let f of h.split("&")){let[w,g]=f.split("=");w=w.replace(/_/,"-"),g=decodeURIComponent(g),["alpn"].includes(w)?E[w]=g?g.split(","):void 0:["insecure"].includes(w)?E["skip-cert-verify"]=/(TRUE)|1/i.test(g):["auth"].includes(w)?E["auth-str"]=g:["mport"].includes(w)?E.ports=g:["obfsParam"].includes(w)?E.obfs=g:["upmbps"].includes(w)?E.up=g:["downmbps"].includes(w)?E.down=g:["obfs"].includes(w)?E._obfs=g||"":["fast-open","peer"].includes(w)?p[w]=g:E[w]=g}return!E.sni&&p.peer&&(E.sni=p.peer),!E["fast-open"]&&p.fastopen&&(E["fast-open"]=!0),E.protocol||(E.protocol="udp"),E}}}function I7(){return{name:"URI TUIC Parser",test:n=>/^tuic:\/\//.test(n),parse:n=>{n=n.split(/tuic:\/\//)[1];let[i,a,s,o,l="",h]=/^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(n);a=decodeURIComponent(a);let[d,...E]=a.split(":"),p=E.join(":");o=parseInt(`${o}`,10),isNaN(o)&&(o=443),p=decodeURIComponent(p),h!=null&&(h=decodeURIComponent(h)),h=h??`TUIC ${s}:${o}`;let f={type:"tuic",name:h,server:s,port:o,password:p,uuid:d};for(let w of l.split("&")){let[g,y]=w.split("=");g=g.replace(/_/g,"-"),y=decodeURIComponent(y),["alpn"].includes(g)?f[g]=y?y.split(","):void 0:["allow-insecure"].includes(g)?f["skip-cert-verify"]=/(TRUE)|1/i.test(y):["fast-open"].includes(g)?f.tfo=!0:["disable-sni","reduce-rtt"].includes(g)?f[g]=/(TRUE)|1/i.test(y):f[g]=y}return f}}}function D7(){return{name:"URI WireGuard Parser",test:n=>/^(wireguard|wg):\/\//.test(n),parse:n=>{n=n.split(/(wireguard|wg):\/\//)[2];let[i,a,s,o,l,h,d,E="",p]=/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);h=parseInt(`${h}`,10),isNaN(h)&&(h=51820),s=decodeURIComponent(s),p!=null&&(p=decodeURIComponent(p)),p=p??`WireGuard ${o}:${h}`;let f={type:"wireguard",name:p,server:o,port:h,"private-key":s,udp:!0};for(let w of E.split("&")){let[g,y]=w.split("=");if(g=g.replace(/_/,"-"),y=decodeURIComponent(y),["reserved"].includes(g)){let A=y.split(",").map(S=>parseInt(S.trim(),10)).filter(S=>Number.isInteger(S));A.length===3&&(f[g]=A)}else if(["address","ip"].includes(g))y.split(",").map(A=>{let S=A.trim().replace(/\/\d+$/,"").replace(/^\[/,"").replace(/\]$/,"");or(S)?f.ip=S:Jt(S)&&(f.ipv6=S)});else if(["mtu"].includes(g)){let A=parseInt(y.trim(),10);Number.isInteger(A)&&(f[g]=A)}else/publickey/i.test(g)?f["public-key"]=y:/privatekey/i.test(g)?f["private-key"]=y:["udp"].includes(g)?f[g]=/(TRUE)|1/i.test(y):["flag"].includes(g)||(f[g]=y)}return f}}}function B7(){return{name:"URI Trojan Parser",test:n=>/^trojan:\/\//.test(n),parse:n=>{let i=/^(trojan:\/\/.*?@.*?)(:(\d+))?\/?(\?.*?)?$/.exec(n);i?.[2]||(n=n.replace(i[1],`${i[1]}:443`));let[s,o]=n.split(/#(.+)/,2),h=K0().parse(s);if(Ti(o))try{h.name=decodeURIComponent(o)}catch(d){console.log(d)}return h}}}function $7(){return{name:"Clash Parser",test:n=>{try{JSON.parse(n)}catch{return!1}return!0},parse:n=>{let i=JSON.parse(n);if(!["anytls","mieru","juicity","ss","ssr","vmess","socks5","http","snell","trojan","tuic","vless","hysteria","hysteria2","wireguard","ssh","direct"].includes(i.type))throw new Error(`Clash does not support proxy with type: ${i.type}`);return["vmess","vless"].includes(i.type)&&(i.sni=i.servername,delete i.servername),i["server-cert-fingerprint"]&&(i["tls-fingerprint"]=i["server-cert-fingerprint"]),i.fingerprint&&(i["tls-fingerprint"]=i.fingerprint),i["dialer-proxy"]&&(i["underlying-proxy"]=i["dialer-proxy"]),i["benchmark-url"]&&(i["test-url"]=i["benchmark-url"]),i["benchmark-timeout"]&&(i["test-timeout"]=i["benchmark-timeout"]),i}}}function P7(){return{name:"QX SS Parser",test:n=>/^shadowsocks\s*=/.test(n.split(",")[0].trim())&&n.indexOf("ssr-protocol")===-1,parse:n=>xs().parse(n)}}function R7(){return{name:"QX SSR Parser",test:n=>/^shadowsocks\s*=/.test(n.split(",")[0].trim())&&n.indexOf("ssr-protocol")!==-1,parse:n=>xs().parse(n)}}function T7(){return{name:"QX VMess Parser",test:n=>/^vmess\s*=/.test(n.split(",")[0].trim()),parse:n=>xs().parse(n)}}function x7(){return{name:"QX VLESS Parser",test:n=>/^vless\s*=/.test(n.split(",")[0].trim()),parse:n=>xs().parse(n)}}function O7(){return{name:"QX Trojan Parser",test:n=>/^trojan\s*=/.test(n.split(",")[0].trim()),parse:n=>xs().parse(n)}}function N7(){return{name:"QX HTTP Parser",test:n=>/^http\s*=/.test(n.split(",")[0].trim()),parse:n=>xs().parse(n)}}function k7(){return{name:"QX Socks5 Parser",test:n=>/^socks5\s*=/.test(n.split(",")[0].trim()),parse:n=>xs().parse(n)}}function L7(){return{name:"Loon SS Parser",test:n=>n.split(",")[0].split("=")[1].trim().toLowerCase()==="shadowsocks",parse:n=>Ki().parse(n)}}function U7(){return{name:"Loon SSR Parser",test:n=>n.split(",")[0].split("=")[1].trim().toLowerCase()==="shadowsocksr",parse:n=>Ki().parse(n)}}function H7(){return{name:"Loon VMess Parser",test:n=>/^.*=\s*vmess/i.test(n.split(",")[0])&&n.indexOf("username")===-1,parse:n=>Ki().parse(n)}}function j7(){return{name:"Loon Vless Parser",test:n=>/^.*=\s*vless/i.test(n.split(",")[0]),parse:n=>Ki().parse(n)}}function M7(){return{name:"Loon Trojan Parser",test:n=>/^.*=\s*trojan/i.test(n.split(",")[0]),parse:n=>Ki().parse(n)}}function q7(){return{name:"Loon Hysteria2 Parser",test:n=>/^.*=\s*Hysteria2/i.test(n.split(",")[0]),parse:n=>Ki().parse(n)}}function V7(){return{name:"Loon HTTP Parser",test:n=>/^.*=\s*http/i.test(n.split(",")[0]),parse:n=>Ki().parse(n)}}function K7(){return{name:"Loon SOCKS5 Parser",test:n=>/^.*=\s*socks5/i.test(n.split(",")[0]),parse:n=>Ki().parse(n)}}function G7(){return{name:"Loon WireGuard Parser",test:n=>/^.*=\s*wireguard/i.test(n.split(",")[0]),parse:n=>{let i=n.match(/(^.*?)\s*?=\s*?wireguard\s*?,.+?\s*?=\s*?.+?/i)?.[1];n=n.replace(i,"").replace(/^\s*?=\s*?wireguard\s*/i,"");let a=n.match(/,\s*?peers\s*?=\s*?\[\s*?\{\s*?(.+?)\s*?\}\s*?\]/i)?.[1],s=a.match(/(,|^)\s*?endpoint\s*?=\s*?"?(.+?):(\d+)"?\s*?(,|$)/i),o=s?.[2],l=parseInt(s?.[3],10),h=n.match(/(,|^)\s*?mtu\s*?=\s*?"?(\d+?)"?\s*?(,|$)/i)?.[2];h&&(h=parseInt(h,10));let d=n.match(/(,|^)\s*?keepalive\s*?=\s*?"?(\d+?)"?\s*?(,|$)/i)?.[2];d&&(d=parseInt(d,10));let E=a.match(/(,|^)\s*?reserved\s*?=\s*?"?(\[\s*?.+?\s*?\])"?\s*?(,|$)/i)?.[2];E&&(E=JSON.parse(E));let p,f=n.match(/(,|^)\s*?dns\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],w=n.match(/(,|^)\s*?dnsv6\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2];(f||w)&&(p=[],f&&p.push(f),w&&p.push(w));let g=a.match(/(,|^)\s*?allowed-ips\s*?=\s*?"(.+?)"\s*?(,|$)/i)?.[2]?.split(",").map(D=>D.trim()),y=a.match(/(,|^)\s*?preshared-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],A=n.match(/(,|^)\s*?interface-ip\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],S=n.match(/(,|^)\s*?interface-ipv6\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],_=a.match(/(,|^)\s*?public-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],I={type:"wireguard",name:i,server:o,port:l,ip:A,ipv6:S,"private-key":n.match(/(,|^)\s*?private-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],"public-key":_,mtu:h,keepalive:d,reserved:E,"allowed-ips":g,"preshared-key":y,dns:p,udp:!0,peers:[{server:o,port:l,ip:A,ipv6:S,"public-key":_,"pre-shared-key":y,"allowed-ips":g,reserved:E}]};return Array.isArray(I.dns)&&I.dns.length>0&&(I["remote-dns-resolve"]=!0),I}}}function z7(){return{name:"Surge Direct Parser",test:n=>/^.*=\s*direct/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function Y7(){return{name:"Surge SSH Parser",test:n=>/^.*=\s*ssh/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function W7(){return{name:"Surge SS Parser",test:n=>/^.*=\s*ss/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function X7(){return{name:"Surge VMess Parser",test:n=>/^.*=\s*vmess/.test(n.split(",")[0])&&n.indexOf("username")!==-1,parse:n=>Ln().parse(n)}}function J7(){return{name:"Surge Trojan Parser",test:n=>/^.*=\s*trojan/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function Z7(){return{name:"Surge HTTP Parser",test:n=>/^.*=\s*https?/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function Q7(){return{name:"Surge Socks5 Parser",test:n=>/^.*=\s*socks5(-tls)?/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function eP(){return{name:"Surge External Parser",test:n=>/^.*=\s*external/.test(n.split(",")[0]),parse:n=>{let i=/^\s*(.*?)\s*?=\s*?external\s*?,\s*(.*?)\s*$/.exec(n),[a,s,o]=i;n=o;let l=/(,|^)\s*?exec\s*?=\s*"(.*?)"\s*?(,|$)/.exec(n)?.[2];l||(l=/(,|^)\s*?exec\s*?=\s*(.*?)\s*?(,|$)/.exec(n)?.[2]);let h=/(,|^)\s*?local-port\s*?=\s*"(.*?)"\s*?(,|$)/.exec(n)?.[2];h||(h=/(,|^)\s*?local-port\s*?=\s*(.*?)\s*?(,|$)/.exec(n)?.[2]);let d=/(,|^)\s*?args\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g,E,p=[];for(;(E=d.exec(n))!==null;)E[3]!=null?p.push(E[3]):E[4]!=null&&p.push(E[4]);let f=/(,|^)\s*?addresses\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g,w,g=[];for(;(w=f.exec(n))!==null;){let A;w[3]!=null?A=w[3]:w[4]!=null&&(A=w[4]),A!=null&&(A=`${A}`.trim().replace(/^\[/,"").replace(/\]$/,"")),sP(A)&&g.push(A)}return{type:"external",name:s,exec:l,"local-port":h,args:p,addresses:g}}}}function tP(){return{name:"Surge Snell Parser",test:n=>/^.*=\s*snell/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function rP(){return{name:"Surge Tuic Parser",test:n=>/^.*=\s*tuic(-v5)?/.test(n.split(",")[0]),parse:n=>{let{port_hopping:i,line:a}=Ew(n),s=Ln().parse(a);return s.ports=i,s}}}function nP(){return{name:"Surge WireGuard Parser",test:n=>/^.*=\s*wireguard/.test(n.split(",")[0]),parse:n=>Ln().parse(n)}}function iP(){return{name:"Surge Hysteria2 Parser",test:n=>/^.*=\s*hysteria2/.test(n.split(",")[0]),parse:n=>{let{port_hopping:i,line:a}=Ew(n),s=Ln().parse(a);return s.ports=i,s}}}function sP(e){return or(e)||Jt(e)}var Aw=[E7(),A7(),w7(),y7(),S7(),b7(),I7(),D7(),_7(),F7(),B7(),C7(),$7(),z7(),Y7(),W7(),X7(),J7(),Z7(),tP(),rP(),nP(),iP(),Q7(),eP(),L7(),U7(),H7(),j7(),q7(),M7(),V7(),K7(),G7(),P7(),R7(),T7(),x7(),O7(),N7(),k7()];function aP(e){for(let t of zf)try{if(t.test(e))return G.info(`Pre-processor [${t.name}] activated`),t.parse(e)}catch(r){G.error(`Parser [${t.name}] failed
Reason: ${r}`)}return e}function uP(e){e=aP(e);let t=e.split(`
`),r=[],n;for(let i of t){if(i=i.trim(),i.length===0)continue;let a=!1;if(n){let[s,o]=ww(n,i);o||(r.push(Sw(s)),a=!0)}if(!a)for(let s of Aw){let[o,l]=ww(s,i);if(!l){r.push(Sw(o)),n=s,a=!0,G.info(`${s.name} is activated`);break}}a||G.error(`Failed to parse line: ${i}`)}return r.filter(i=>(["vless","vmess"].includes(i.type)&&(Mf(i.uuid)||G.error(`UUID may be invalid: ${i.name} ${i.uuid}`)),!0))}async function oP(e,t=[],r,n,i){for(let a of t){if(a.disabled){G.log(`Skipping disabled operator: "${a.type}" with arguments:
>>> ${JSON.stringify(a.args,null,2)||"None"}`);continue}let s,o={};if(a.type.indexOf("Script")!==-1){let{mode:h,content:d}=a.args;if(h==="link"){let E=d||"",p=E.split("#");if(p.length>1)try{o=JSON.parse(decodeURIComponent(p[1]))}catch{for(let g of p[1].split("&")){let y=g.split("=")[0],A=g.split("=")[1];o[y]=A==null||A===""?!0:decodeURIComponent(A)}}E=`${E.split("#")[0]}${p[2]?`#${p[2]}`:o?.noCache!=null||o?.insecure!=null?`#${p[1]}`:""}`;let f=E.match(/^\/api\/(file|module)\/(.+)/);if(f){let w="";try{w=f?.[1];let g=f?.[2];if(g==null)throw new Error(`\u672C\u5730 ${w} URL \u65E0\u6548: ${E}`);g=decodeURIComponent(g);let y=w==="module"?kg:Na,A=cr(G.read(y),g);if(!A)throw new Error(`\u627E\u4E0D\u5230 ${w}: ${g}`);w==="module"?s=A.content:s=await Qn({type:"file",name:g})}catch(g){throw G.error(`Error when loading ${w}: ${a.args.content}.
Reason: ${g}`),new Error(`\u65E0\u6CD5\u52A0\u8F7D ${w}: ${E}`)}}else try{s=await Ir(E)}catch(w){throw G.error(`Error when downloading remote script: ${a.args.content}.
Reason: ${w}`),new Error(`\u65E0\u6CD5\u4E0B\u8F7D\u811A\u672C: ${E}`)}}else s=d,o=a.args.arguments||{}}if(!ih[a.type]){G.error(`Unknown operator: "${a.type}"`);continue}G.log(`Applying "${a.type}" with arguments:
>>> ${JSON.stringify(a.args,null,2)||"None"}`);let l;a.type.indexOf("Script")!==-1?l=ih[a.type](s,r,o,n,i):l=ih[a.type](a.args||{}),e=await rA(l,e)}return e}function cP(e,t,r,n={}){let i=ch[t];if(!i)throw new Error(`Target platform: ${t} is not supported!`);let a=/Surge|SurgeMac|Shadowrocket/i.test(t);if(e=e.filter(s=>s.supported&&s.supported[t]===!1?!1:(["vless","vmess"].includes(s.type)&&(Mf(s.uuid)||G.error(`UUID may be invalid: ${s.name} ${s.uuid}`)),!0)),e=e.map(s=>(s._resolved=s.resolved,Ti(s.name)||(s.name=`${s.type} ${s.server}:${s.port}`),s["disable-sni"]&&(a?s.sni="off":["tuic"].includes(s.type)||(G.error(`Target platform ${t} does not support sni off. Proxy's fields (sni, tls-fingerprint and skip-cert-verify) will be modified.`),s.sni="",s["skip-cert-verify"]=!0,delete s["tls-fingerprint"])),s.ports&&(s.ports=String(s.ports),["ClashMeta"].includes(t)||(s.ports=s.ports.replace(/\//g,",")),s.port||(s.port=xc(s.ports))),s)),G.log(`Producing proxies for target: ${t}`),typeof i.type>"u"||i.type==="SINGLE"){let s=e.map(o=>{try{return i.produce(o,r,n)}catch(l){return G.error(`Cannot produce proxy: ${JSON.stringify(o,null,2)}
Reason: ${l}`),""}}).filter(o=>o.length>0);return s=r==="internal"?s:s.join(`
`),t.startsWith("Surge")&&e.length>0&&e.every(o=>o.type==="wireguard")&&(s=`#!name=${e[0]?._subName}
#!desc=${e[0]?._desc??""}
#!category=${e[0]?._category??""}
${s}`),s}else if(i.type==="ALL")return i.produce(e,r,n)}var Gt={parse:uP,process:oP,produce:cP,ipAddress:jf,getRandomPort:xc,isIPv4:or,isIPv6:Jt,isIP:z0,yaml:Ja,getFlag:Eo,removeFlag:Lc,getISO:Xf,MMDB:Wf,Gist:ru,download:Ir,isValidUUID:Mf,doh:wo};function ww(e,t){if(!lP(e,t))return[null,new Error("Parser mismatch")];try{return[e.parse(t),null]}catch(r){return[null,r]}}function lP(e,t){try{return e.test(t)}catch{return!1}}function yw(e){if(typeof e=="string"||typeof e=="number"){if(e=String(e).trim(),e==="")return"/";if(!e.startsWith("/"))return"/"+e}return e}function Sw(e){typeof e.cipher=="string"&&(e.cipher=e.cipher.toLowerCase()),typeof e.password=="number"&&(e.password=hE(e.password)),["ss"].includes(e.type)&&e.cipher==="none"&&!e.password&&(e.password=""),e.interface&&(e["interface-name"]=e.interface,delete e.interface),fE(e.port)&&(e.port=parseInt(e.port,10)),e.server&&(e.server=`${e.server}`.trim().replace(/^\[/,"").replace(/\]$/,"")),e.network==="ws"&&(!e["ws-opts"]&&(e["ws-path"]||e["ws-headers"])&&(e["ws-opts"]={},e["ws-path"]&&(e["ws-opts"].path=e["ws-path"]),e["ws-headers"]&&(e["ws-opts"].headers=e["ws-headers"])),delete e["ws-path"],delete e["ws-headers"]);let t=e[`${e.network}-opts`]?.path;if(Array.isArray(t)?e[`${e.network}-opts`].path=t.map(n=>yw(n)):t!=null&&(e[`${e.network}-opts`].path=yw(t)),e.type==="trojan"&&e.network==="tcp"&&delete e.network,["vless"].includes(e.type)&&(e.network||(e.network="tcp")),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(e.type)&&(e.tls=!0),e.network){let n=e[`${e.network}-opts`]?.headers?.Host,i=e[`${e.network}-opts`]?.headers?.host;e.network==="h2"?!i&&n&&(e[`${e.network}-opts`].headers.host=n,delete e[`${e.network}-opts`].headers.Host):i&&!n&&(e[`${e.network}-opts`].headers.Host=i,delete e[`${e.network}-opts`].headers.host)}if(e.network==="h2"){let n=e["h2-opts"]?.headers?.host,i=e["h2-opts"]?.path;n&&!Array.isArray(n)&&(e["h2-opts"].headers.host=[n]),Array.isArray(i)&&(e["h2-opts"].path=i[0])}if(!e.tls&&["ws","http"].includes(e.network)&&!e[`${e.network}-opts`]?.headers?.Host&&!z0(e.server)&&(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].headers=e[`${e.network}-opts`].headers||{},e[`${e.network}-opts`].headers.Host=["vmess","vless"].includes(e.type)&&e.network==="http"?[e.server]:e.server),["vmess","vless"].includes(e.type)&&e.network==="http"){let n=e[`${e.network}-opts`]?.path,i=e[`${e.network}-opts`]?.headers?.Host;i&&!Array.isArray(i)&&(e[`${e.network}-opts`].headers.Host=[i]),n&&!Array.isArray(n)&&(e[`${e.network}-opts`].path=[n])}if(e.tls&&!e.sni&&(z0(e.server)||(e.sni=e.server),!e.sni&&e.network)){let n=e[`${e.network}-opts`]?.headers?.Host;n=Array.isArray(n)?n[0]:n,n&&(e.sni=n)}if(e.ports?e.ports=String(e.ports).replace(/\//g,","):delete e.ports,["hysteria2"].includes(e.type)&&e.obfs&&!["salamander"].includes(e.obfs)&&!e["obfs-password"]&&(e["obfs-password"]=e.obfs,e.obfs="salamander"),["hysteria2"].includes(e.type)&&!e["obfs-password"]&&e.obfs_password&&(e["obfs-password"]=e.obfs_password,delete e.obfs_password),["vless"].includes(e.type)&&(e["reality-opts"]&&Object.keys(e["reality-opts"]).length===0&&delete e["reality-opts"],e["grpc-opts"]&&Object.keys(e["grpc-opts"]).length===0&&delete e["grpc-opts"],!e["reality-opts"]&&!e.flow&&delete e.flow,["http"].includes(e.network)&&(e[`${e.network}-opts`]?.path||(e[`${e.network}-opts`]||(e[`${e.network}-opts`]={}),e[`${e.network}-opts`].path=["/"]))),typeof e.name!="string")if(/^\d+$/.test(e.name))e.name=`${e.name}`;else try{e.name?.data?e.name=G0.Buffer.from(e.name.data).toString("utf8"):e.name=G0.Buffer.from(e.name).toString("utf8")}catch(n){G.error(`proxy.name decode failed
Reason: ${n}`),e.name=`${e.type} ${e.server}:${e.port}`}["ws","http","h2"].includes(e.network)&&(["ws","h2"].includes(e.network)&&!e[`${e.network}-opts`]?.path?(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].path="/"):e.network==="http"&&(!Array.isArray(e[`${e.network}-opts`]?.path)||e[`${e.network}-opts`]?.path.every(n=>!n))&&(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].path=["/"])),["","off"].includes(e.sni)&&(e["disable-sni"]=!0);let r=e.ca_str;e["ca-str"]?r=e["ca-str"]:r&&(delete e.ca_str,e["ca-str"]=r);try{G.env.isNode&&!r&&e._ca&&(r=G.node.fs.readFileSync(e._ca,{encoding:"utf8"}))}catch(n){G.error(`Read ca file failed
Reason: ${n}`)}return!e["tls-fingerprint"]&&r&&(e["tls-fingerprint"]=nv.generateFingerprint(r)),["ss"].includes(e.type)&&ae(e,"shadow-tls-password")&&(e.plugin="shadow-tls",e["plugin-opts"]={host:e["shadow-tls-sni"],password:e["shadow-tls-password"],version:e["shadow-tls-version"]},delete e["shadow-tls-sni"],delete e["shadow-tls-password"],delete e["shadow-tls-version"]),e}function z0(e){return or(e)||Jt(e)}function Y0(e){e.get("/share/col/:name/:target",async(t,r)=>{let{target:n}=t.params;n&&(t.query.target=n,G.info(`\u4F7F\u7528\u8DEF\u7531\u6307\u5B9A\u76EE\u6807: ${n}`)),await Io(t,r)}),e.get("/share/col/:name",Io),e.get("/share/sub/:name/:target",async(t,r)=>{let{target:n}=t.params;n&&(t.query.target=n,G.info(`\u4F7F\u7528\u8DEF\u7531\u6307\u5B9A\u76EE\u6807: ${n}`)),await _o(t,r)}),e.get("/share/sub/:name",_o),e.get("/download/collection/:name/:target",async(t,r)=>{let{target:n}=t.params;n&&(t.query.target=n,G.info(`\u4F7F\u7528\u8DEF\u7531\u6307\u5B9A\u76EE\u6807: ${n}`)),await Io(t,r)}),e.get("/download/collection/:name",Io),e.get("/download/:name/:target",async(t,r)=>{let{target:n}=t.params;n&&(t.query.target=n,G.info(`\u4F7F\u7528\u8DEF\u7531\u6307\u5B9A\u76EE\u6807: ${n}`)),await _o(t,r)}),e.get("/download/:name",_o),e.get("/download/collection/:name/api/v1/server/details",async(t,r)=>{t.query.platform="JSON",t.query.produceType="internal",t.query.resultFormat="nezha",await Io(t,r)}),e.get("/download/:name/api/v1/server/details",async(t,r)=>{t.query.platform="JSON",t.query.produceType="internal",t.query.resultFormat="nezha",await _o(t,r)}),e.get("/download/collection/:name/api/v1/monitor/:nezhaIndex",async(t,r)=>{t.query.platform="JSON",t.query.produceType="internal",t.query.resultFormat="nezha-monitor",await Io(t,r)}),e.get("/download/:name/api/v1/monitor/:nezhaIndex",async(t,r)=>{t.query.platform="JSON",t.query.produceType="internal",t.query.resultFormat="nezha-monitor",await _o(t,r)})}async function _o(e,t){let{name:r,nezhaIndex:n}=e.params;r=decodeURIComponent(r),n=decodeURIComponent(n);let i=e.query.target==="SurgeMac",a=e.query.target||Kp(e.headers)||"JSON",s=e.headers["user-agent"]||e.headers["User-Agent"];G.info(`\u6B63\u5728\u4E0B\u8F7D\u8BA2\u9605\uFF1A${r}
\u8BF7\u6C42 User-Agent: ${s}
\u8BF7\u6C42 target: ${e.query.target}
\u5B9E\u9645\u8F93\u51FA: ${a}`);let{url:o,ua:l,content:h,mergeSources:d,ignoreFailedRemoteSub:E,produceType:p,includeUnsupportedProxy:f,resultFormat:w,proxy:g,noCache:y}=e.query,A={_req:{method:e.method,url:e.url,path:e.path,query:e.query,params:e.params,headers:e.headers,body:e.body}};if(e.query.$options){try{A=JSON.parse(decodeURIComponent(e.query.$options))}catch{for(let D of e.query.$options.split("&")){let H=D.split("=")[0],V=D.split("=")[1];A[H]=V==null||V===""?!0:decodeURIComponent(V)}}G.info(`\u4F20\u5165 $options: ${JSON.stringify(A)}`)}o&&(o=decodeURIComponent(o),G.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605 URL: ${o}`),/^https?:\/\//.test(o)||(h=o,G.info("URL \u4E0D\u662F\u94FE\u63A5\uFF0C\u89C6\u4E3A\u672C\u5730\u8BA2\u9605"))),h&&(h=decodeURIComponent(h),G.info(`\u6307\u5B9A\u672C\u5730\u8BA2\u9605: ${h}`)),g&&(g=decodeURIComponent(g),G.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605\u4F7F\u7528\u4EE3\u7406/\u7B56\u7565 proxy: ${g}`)),l&&(l=decodeURIComponent(l),G.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605 User-Agent: ${l}`)),d&&(d=decodeURIComponent(d),G.info(`\u6307\u5B9A\u5408\u5E76\u6765\u6E90: ${d}`)),E!=null&&E!==""&&(E=decodeURIComponent(E),G.info(`\u6307\u5B9A\u5FFD\u7565\u5931\u8D25\u7684\u8FDC\u7A0B\u8BA2\u9605: ${E}`)),p&&(p=decodeURIComponent(p),G.info(`\u6307\u5B9A\u751F\u4EA7\u7C7B\u578B: ${p}`)),f&&(f=decodeURIComponent(f),G.info(`\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${f}`)),!f&&Gp(a,s)&&(f=!0,G.info(`\u5F53\u524D\u5BA2\u6237\u7AEF\u53EF\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${f}`)),i&&G.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External"),y&&G.info(`\u6307\u5B9A\u4E0D\u4F7F\u7528\u7F13\u5B58: ${y}`);let S=G.read(Wn),_=cr(S,r);if(_)try{_.passThroughUA&&(G.info(`\u8BA2\u9605\u5F00\u542F\u4E86\u900F\u4F20 User-Agent, \u4F7F\u7528\u8BF7\u6C42\u7684 User-Agent: ${s}`),l=s);let D=await Qn({type:"subscription",name:r,platform:a,url:o,ua:l,content:h,mergeSources:d,ignoreFailedRemoteSub:E,produceType:p,produceOpts:{"include-unsupported-proxy":f,useMihomoExternal:i},$options:A,proxy:g,noCache:y}),H;if(_.source!=="local"||["localFirst","remoteFirst"].includes(_.mergeSources))try{o=`${o||_.url}`.split(/[\r\n]+/).map(P=>P.trim()).filter(P=>P.length)?.[0]||"";let V={},F=o.split("#");if(o=o.split("#")[0],F.length>1)try{V=JSON.parse(decodeURIComponent(F[1]))}catch{for(let k of F[1].split("&")){let L=k.split("=")[0],q=k.split("=")[1];V[L]=q==null||q===""?!0:decodeURIComponent(q)}}V.noFlow||(H=await xi(V?.insecure?`${o}#insecure`:o,V.flowUserAgent,void 0,g||_.proxy,V.flowUrl),H&&t.set("subscription-userinfo",go(H)))}catch(V){G.error(`\u8BA2\u9605 ${r} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(V)}`)}if(_.subUserinfo){let V;if(/^https?:\/\//.test(_.subUserinfo))try{V=await xi(void 0,void 0,void 0,g||_.proxy,_.subUserinfo)}catch(F){G.error(`\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${_.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(F)}`)}else V=_.subUserinfo;t.set("subscription-userinfo",go([V,H].filter(F=>F).join(";")))}a==="JSON"?(w==="nezha"?D=Cw(D):w==="nezha-monitor"&&(n=/^\d+$/.test(n)?parseInt(n,10):D.findIndex(V=>V.name===n),D=await bw(D[n],n,e.query)),t.set("Content-Type","application/json;charset=utf-8").send(D)):t.send(D)}catch(I){G.notify("\u{1F30D} Sub-Store \u4E0B\u8F7D\u8BA2\u9605\u5931\u8D25",`\u274C \u65E0\u6CD5\u4E0B\u8F7D\u8BA2\u9605\uFF1A${r}\uFF01`,`\u{1F914} \u539F\u56E0\uFF1A${I.message??I}`),G.error(I.message??I),Br(t,new Tn("INTERNAL_SERVER_ERROR",`Failed to download subscription: ${r}`,`Reason: ${I.message??I}`))}else G.error(`\u{1F30D} Sub-Store \u4E0B\u8F7D\u8BA2\u9605\u5931\u8D25
\u274C \u672A\u627E\u5230\u8BA2\u9605\uFF1A${r}\uFF01`),Br(t,new $s("RESOURCE_NOT_FOUND",`Subscription ${r} does not exist!`),404)}async function Io(e,t){let{name:r,nezhaIndex:n}=e.params;r=decodeURIComponent(r),n=decodeURIComponent(n);let i=e.query.target==="SurgeMac",a=e.query.target||Kp(e.headers)||"JSON",s=G.read(zs),o=cr(s,r),l=e.headers["user-agent"]||e.headers["User-Agent"];G.info(`\u6B63\u5728\u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\uFF1A${r}
\u8BF7\u6C42 User-Agent: ${l}
\u8BF7\u6C42 target: ${e.query.target}
\u5B9E\u9645\u8F93\u51FA: ${a}`);let{ignoreFailedRemoteSub:h,produceType:d,includeUnsupportedProxy:E,resultFormat:p,proxy:f,noCache:w}=e.query,g={_req:{method:e.method,url:e.url,path:e.path,query:e.query,params:e.params,headers:e.headers,body:e.body}};if(e.query.$options){try{g=JSON.parse(decodeURIComponent(e.query.$options))}catch{for(let A of e.query.$options.split("&")){let S=A.split("=")[0],_=A.split("=")[1];g[S]=_==null||_===""?!0:decodeURIComponent(_)}}G.info(`\u4F20\u5165 $options: ${JSON.stringify(g)}`)}if(f&&(f=decodeURIComponent(f),G.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605\u4F7F\u7528\u4EE3\u7406/\u7B56\u7565 proxy: ${f}`)),h!=null&&h!==""&&(h=decodeURIComponent(h),G.info(`\u6307\u5B9A\u5FFD\u7565\u5931\u8D25\u7684\u8FDC\u7A0B\u8BA2\u9605: ${h}`)),d&&(d=decodeURIComponent(d),G.info(`\u6307\u5B9A\u751F\u4EA7\u7C7B\u578B: ${d}`)),E&&(E=decodeURIComponent(E),G.info(`\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${E}`)),!E&&Gp(a,l)&&(E=!0,G.info(`\u5F53\u524D\u5BA2\u6237\u7AEF\u53EF\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${E}`)),i&&G.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External"),w&&G.info(`\u6307\u5B9A\u4E0D\u4F7F\u7528\u7F13\u5B58: ${w}`),o)try{let y=await Qn({type:"collection",name:r,platform:a,ignoreFailedRemoteSub:h,produceType:d,produceOpts:{"include-unsupported-proxy":E,useMihomoExternal:i},$options:g,proxy:f,noCache:w,ua:l}),A,S=G.read(Wn),_=o.subscriptions;if(_.length>0){let H=cr(S,_[0]);if(H.source!=="local"||["localFirst","remoteFirst"].includes(H.mergeSources))try{let V=`${H.url}`.split(/[\r\n]+/).map(k=>k.trim()).filter(k=>k.length)?.[0]||"",F={},P=V.split("#");if(V=V.split("#")[0],P.length>1)try{F=JSON.parse(decodeURIComponent(P[1]))}catch{for(let L of P[1].split("&")){let q=L.split("=")[0],J=L.split("=")[1];F[q]=J==null||J===""?!0:decodeURIComponent(J)}}F.noFlow||(A=await xi(F?.insecure?`${V}#insecure`:V,F.flowUserAgent,void 0,f||H.proxy||o.proxy,F.flowUrl))}catch(V){G.error(`\u7EC4\u5408\u8BA2\u9605 ${r} \u4E2D\u7684\u5B50\u8BA2\u9605 ${H.name} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${V.message??V}`)}if(H.subUserinfo){let V;if(/^https?:\/\//.test(H.subUserinfo))try{V=await xi(void 0,void 0,void 0,f||H.proxy,H.subUserinfo)}catch(F){G.error(`\u7EC4\u5408\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${H.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(F)}`)}else V=H.subUserinfo;A=[V,A].filter(F=>F).join("; ")}}G.info(`\u7EC4\u5408\u8BA2\u9605 ${r} \u900F\u4F20\u7684\u7684\u6D41\u91CF\u4FE1\u606F: ${A}`);let I;if(/^https?:\/\//.test(o.subUserinfo))try{I=await xi(void 0,void 0,void 0,f||o.proxy,o.subUserinfo)}catch(H){G.error(`\u7EC4\u5408\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${o.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(H)}`)}else I=o.subUserinfo;let D=[I,A].filter(H=>H).join("; ");D&&t.set("subscription-userinfo",go(D)),a==="JSON"?(p==="nezha"?y=Cw(y):p==="nezha-monitor"&&(n=/^\d+$/.test(n)?parseInt(n,10):y.findIndex(H=>H.name===n),y=await bw(y[n],n,e.query)),t.set("Content-Type","application/json;charset=utf-8").send(y)):t.send(y)}catch(y){G.notify("\u{1F30D} Sub-Store \u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\u5931\u8D25",`\u274C \u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\u9519\u8BEF\uFF1A${r}\uFF01`,`\u{1F914} \u539F\u56E0\uFF1A${y}`),Br(t,new Tn("INTERNAL_SERVER_ERROR",`Failed to download collection: ${r}`,`Reason: ${y.message??y}`))}else G.error("\u{1F30D} Sub-Store \u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\u5931\u8D25",`\u274C \u672A\u627E\u5230\u7EC4\u5408\u8BA2\u9605\uFF1A${r}\uFF01`),Br(t,new $s("RESOURCE_NOT_FOUND",`Collection ${r} does not exist!`),404)}async function bw(e,t,r){let n={code:0,message:"success",result:[]};try{let{isLoon:i,isSurge:a}=G.env;if(!i&&!a)throw new Error("\u4EC5\u652F\u6301 Loon \u548C Surge(ability=http-client-policy)");let s=Gt.produce([e],i?"Loon":"Surge");if(!s)throw new Error("\u5F53\u524D\u5BA2\u6237\u7AEF\u4E0D\u517C\u5BB9\u6B64\u8282\u70B9");let o=e._monitors||[{name:"Cloudflare",url:"http://cp.cloudflare.com/generate_204",method:"HEAD",number:3,timeout:2e3},{name:"Google",url:"http://www.google.com/generate_204",method:"HEAD",number:3,timeout:2e3}],l=r.number||Math.max(...o.map(h=>h.number))||3;for(let h of o){let E={monitor_id:o.indexOf(h),server_id:t,monitor_name:h.name,server_name:e.name,created_at:[],avg_delay:[]};for(let p=0;p<l;p++){let f=Date.now();try{await G.http[(h.method||"HEAD").toLowerCase()]({timeout:h.timeout||2e3,url:h.url,"policy-descriptor":s,node:s});let w=Date.now()-f;G.info(`${h.name} latency: ${w}`),E.avg_delay.push(w)}catch(w){G.error(w),E.avg_delay.push(0)}E.created_at.push(Date.now()-6e5*(h.number-p-1))}n.result.push(E)}}catch(i){G.error(i),n.result.push({monitor_id:0,server_id:0,monitor_name:`\u274C ${i.message??i}`,server_name:e.name,created_at:[Date.now()],avg_delay:[0]})}return JSON.stringify(n,null,2)}function Cw(e){let t={code:0,message:"success",result:[]};return e.map((r,n)=>{let i=r._geo?.countryCode||r._geo?.country;if(/^[a-z]{2}$/i.test(i)||(i=Xf(r.name)),/^[a-z]{2}$/i.test(i)){let a=Math.round(new Date().getTime()/1e3),s=r._unavailable?0:a,o=parseInt(r._uptime||0,10);t.result.push({id:n,name:r.name,tag:`${r._tag??""}`,last_active:s,valid_ip:r._IP||r.server,ipv4:r._IPv4||r.server,ipv6:r._IPv6||(Jt(r.server)?r.server:""),host:{Platform:"Sub-Store",PlatformVersion:iu.version,CPU:[],MemTotal:1024,DiskTotal:1024,SwapTotal:1024,Arch:"",Virtualization:"",BootTime:a-o,CountryCode:i,Version:"0.0.1"},status:{CPU:0,MemUsed:0,SwapUsed:0,DiskUsed:0,NetInTransfer:0,NetOutTransfer:0,NetInSpeed:0,NetOutSpeed:0,Uptime:o,Load1:0,Load5:0,Load15:0,TcpConnCount:0,UdpConnCount:0,ProcessCount:0}})}}),JSON.stringify(t,null,2)}function W0(e){e.post("/api/preview/sub",hP),e.post("/api/preview/collection",pP),e.post("/api/preview/file",fP)}async function fP(e,t){try{let r=e.body,n="";if(r.type!=="mihomoProfile")if(r.source==="local"&&!["localFirst","remoteFirst"].includes(r.mergeSources))n=r.content;else{let o={};if(n=await Promise.all(r.url.split(/[\r\n]+/).map(l=>l.trim()).filter(l=>l.length).map(async l=>{try{return await Ir(l,r.ua,void 0,r.proxy)}catch(h){return o[l]=h,G.error(`\u6587\u4EF6 ${r.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${l} \u53D1\u751F\u9519\u8BEF: ${h}`),""}})),!r.ignoreFailedRemoteFile&&Object.keys(o).length>0)throw new Error(`\u6587\u4EF6 ${r.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(o).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);r.mergeSources==="localFirst"?n.unshift(r.content):r.mergeSources==="remoteFirst"&&n.push(r.content)}let i=(Array.isArray(n)?n:[n]).flat(),a=i.filter(o=>o!=null&&o!=="").join(`
`),s=Array.isArray(r.process)&&r.process.length>0?await Gt.process({$files:i,$content:a,$file:r},r.process):{$content:a,$files:i};Mi(t,{original:a,processed:s?.$content??""})}catch(r){G.error(r.message??r),Br(t,new Tn("INTERNAL_SERVER_ERROR","Failed to preview file",`Reason: ${r.message??r}`))}}async function hP(e,t){try{let r=e.body,n=e.query.target||"JSON",i;if(r.source==="local"&&!["localFirst","remoteFirst"].includes(r.mergeSources))i=r.content;else{let o={};if(i=await Promise.all(r.url.split(/[\r\n]+/).map(l=>l.trim()).filter(l=>l.length).map(async l=>{try{return await Ir(l,r.ua,void 0,r.proxy,void 0,void 0,void 0,!0)}catch(h){return o[l]=h,G.error(`\u8BA2\u9605 ${r.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${l} \u53D1\u751F\u9519\u8BEF: ${h}`),""}})),!r.ignoreFailedRemoteSub&&Object.keys(o).length>0)throw new Error(`\u8BA2\u9605 ${r.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(o).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);r.mergeSources==="localFirst"?i.unshift(r.content):r.mergeSources==="remoteFirst"&&i.push(r.content)}let a=(Array.isArray(i)?i:[i]).map(o=>Gt.parse(o)).flat();a.forEach((o,l)=>{o.id=l,o._subName=r.name,o._subDisplayName=r.displayName});let s=await Gt.process(a,r.process||[],n,{[r.name]:r});Mi(t,{original:a,processed:s})}catch(r){G.error(r.message??r),Br(t,new Tn("INTERNAL_SERVER_ERROR","Failed to preview subscription",`Reason: ${r.message??r}`))}}async function pP(e,t){try{let r=G.read(Wn),n=e.body,i=[...n.subscriptions],a=n.subscriptionTags;Array.isArray(a)&&a.length>0&&r.forEach(d=>{Array.isArray(d.tag)&&d.tag.length>0&&!i.includes(d.name)&&d.tag.some(E=>a.includes(E))&&i.push(d.name)});let s={},o={};if(await Promise.all(i.map(async d=>{let E=cr(r,d);try{let p;if(E.source==="local"&&!["localFirst","remoteFirst"].includes(E.mergeSources))p=E.content;else{let w={};if(p=await Promise.all(E.url.split(/[\r\n]+/).map(g=>g.trim()).filter(g=>g.length).map(async g=>{try{return await Ir(g,E.ua,void 0,E.proxy,void 0,void 0,void 0,!0)}catch(y){return w[g]=y,G.error(`\u8BA2\u9605 ${E.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${g} \u53D1\u751F\u9519\u8BEF: ${y}`),""}})),!E.ignoreFailedRemoteSub&&Object.keys(w).length>0)throw new Error(`\u8BA2\u9605 ${E.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(w).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);E.mergeSources==="localFirst"?p.unshift(E.content):E.mergeSources==="remoteFirst"&&p.push(E.content)}let f=(Array.isArray(p)?p:[p]).map(w=>Gt.parse(w)).flat();f.forEach(w=>{w._subName=E.name,w._subDisplayName=E.displayName,w._collectionName=n.name,w._collectionDisplayName=n.displayName}),f=await Gt.process(f,E.process||[],"JSON",{[E.name]:E,_collection:n}),s[d]=f}catch(p){o[d]=p,G.error(`\u274C \u5904\u7406\u7EC4\u5408\u8BA2\u9605 ${n.name} \u4E2D\u7684\u5B50\u8BA2\u9605: ${E.name}\u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${p}\uFF01`)}})),!n.ignoreFailedRemoteSub&&Object.keys(o).length>0)throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${n.name} \u4E2D\u7684\u5B50\u8BA2\u9605 ${Object.keys(o).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);let l=Array.prototype.concat.apply([],i.map(d=>s[d]||[]));l.forEach((d,E)=>{d.id=E,d._collectionName=n.name,d._collectionDisplayName=n.displayName});let h=await Gt.process(l,n.process||[],"JSON",{_collection:n});Mi(t,{original:l,processed:h})}catch(r){G.error(r.message??r),Br(t,new Tn("INTERNAL_SERVER_ERROR","Failed to preview collection",`Reason: ${r.message??r}`))}}function X0(e){e.post("/api/utils/node-info",dP)}async function dP(e,t){let r=e.body,n=e.query.lang||"zh-CN",i;try{i=ch.URI.produce(r)}catch{}try{let s=await oi().get({url:`http://ip-api.com/json/${encodeURIComponent(`${r.server}`.trim().replace(/^\[/,"").replace(/\]$/,""))}?lang=${n}`,headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"}}).then(o=>{let l=JSON.parse(o.body);if(l.status!=="success")throw new Error(l.message);return delete l.status,l});Mi(t,{shareUrl:i,info:s})}catch(a){Br(t,new eh("FAILED_TO_GET_NODE_INFO","Failed to get node info",`Reason: ${a}`))}}console.log(`
\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505
Sub-Store -- v${Gl}
\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505
`);kp();gP();function gP(){let e=Lp({substore:G});Y0(e),W0(e),p0(e),X0(e),e.options("/",(t,r)=>{r.status(200).end()}),e.start()}})();
/*! Bundled license information:
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
jsrsasign/lib/jsrsasign.js:
(*! CryptoJS v3.1.2 core-fix.js
* code.google.com/p/crypto-js
* (c) 2009-2013 by Jeff Mott. All rights reserved.
* code.google.com/p/crypto-js/wiki/License
* THIS IS FIX of 'core.js' to fix Hmac issue.
* https://code.google.com/p/crypto-js/issues/detail?id=84
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
*)
(*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*)
(*! (c) Tom Wu, Kenji Urushima | http://www-cs-students.stanford.edu/~tjw/jsbn/
*)
(*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
*)
(*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
*)
lodash/lodash.js:
(**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*)
*/