@crmackey/fernet
Version:
ypeScript implementation of Fernet symmetric encryption.
2 lines • 52.1 kB
JavaScript
"use strict";(()=>{var qr=Object.create;var qt=Object.defineProperty;var jr=Object.getOwnPropertyDescriptor;var Xr=Object.getOwnPropertyNames;var Vr=Object.getPrototypeOf,Gr=Object.prototype.hasOwnProperty;var L=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Yr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xr(t))!Gr.call(e,i)&&i!==r&&qt(e,i,{get:()=>t[i],enumerable:!(n=jr(t,i))||n.enumerable});return e};var Y=(e,t,r)=>(r=e!=null?qr(Vr(e)):{},Yr(t||!e||!e.__esModule?qt(r,"default",{value:e,enumerable:!0}):r,e));var Vt=L(ut=>{"use strict";ut.byteLength=Qr;ut.toByteArray=re;ut.fromByteArray=ie;var J=[],P=[],Zr=typeof Uint8Array<"u"?Uint8Array:Array,St="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Z=0,jt=St.length;Z<jt;++Z)J[Z]=St[Z],P[St.charCodeAt(Z)]=Z;var Z,jt;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function Xt(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 Qr(e){var t=Xt(e),r=t[0],n=t[1];return(r+n)*3/4-n}function te(e,t,r){return(t+r)*3/4-r}function re(e){var t,r=Xt(e),n=r[0],i=r[1],o=new Zr(te(e,n,i)),c=0,p=i>0?n-4:n,y;for(y=0;y<p;y+=4)t=P[e.charCodeAt(y)]<<18|P[e.charCodeAt(y+1)]<<12|P[e.charCodeAt(y+2)]<<6|P[e.charCodeAt(y+3)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return i===2&&(t=P[e.charCodeAt(y)]<<2|P[e.charCodeAt(y+1)]>>4,o[c++]=t&255),i===1&&(t=P[e.charCodeAt(y)]<<10|P[e.charCodeAt(y+1)]<<4|P[e.charCodeAt(y+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function ee(e){return J[e>>18&63]+J[e>>12&63]+J[e>>6&63]+J[e&63]}function ne(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(ee(n));return i.join("")}function ie(e){for(var t,r=e.length,n=r%3,i=[],o=16383,c=0,p=r-n;c<p;c+=o)i.push(ne(e,c,c+o>p?p:c+o));return n===1?(t=e[r-1],i.push(J[t>>2]+J[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(J[t>>10]+J[t>>4&63]+J[t<<2&63]+"=")),i.join("")}});var Gt=L(Ft=>{Ft.read=function(e,t,r,n,i){var o,c,p=i*8-n-1,y=(1<<p)-1,A=y>>1,d=-7,u=r?i-1:0,v=r?-1:1,s=e[t+u];for(u+=v,o=s&(1<<-d)-1,s>>=-d,d+=p;d>0;o=o*256+e[t+u],u+=v,d-=8);for(c=o&(1<<-d)-1,o>>=-d,d+=n;d>0;c=c*256+e[t+u],u+=v,d-=8);if(o===0)o=1-A;else{if(o===y)return c?NaN:(s?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-A}return(s?-1:1)*c*Math.pow(2,o-n)};Ft.write=function(e,t,r,n,i,o){var c,p,y,A=o*8-i-1,d=(1<<A)-1,u=d>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,s=n?0:o-1,f=n?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(p=isNaN(t)?1:0,c=d):(c=Math.floor(Math.log(t)/Math.LN2),t*(y=Math.pow(2,-c))<1&&(c--,y*=2),c+u>=1?t+=v/y:t+=v*Math.pow(2,1-u),t*y>=2&&(c++,y/=2),c+u>=d?(p=0,c=d):c+u>=1?(p=(t*y-1)*Math.pow(2,i),c=c+u):(p=t*Math.pow(2,u-1)*Math.pow(2,i),c=0));i>=8;e[r+s]=p&255,s+=f,p/=256,i-=8);for(c=c<<i|p,A+=i;A>0;e[r+s]=c&255,s+=f,c/=256,A-=8);e[r+s-f]|=w*128}});var Mt=L(ct=>{"use strict";var bt=Vt(),it=Gt(),Yt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ct.Buffer=a;ct.SlowBuffer=ae;ct.INSPECT_MAX_BYTES=50;var ft=2147483647;ct.kMaxLength=ft;a.TYPED_ARRAY_SUPPORT=oe();!a.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 oe(){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(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function j(e){if(e>ft)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(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 kt(e)}return rr(e,t,r)}a.poolSize=8192;function rr(e,t,r){if(typeof e=="string")return se(e,t);if(ArrayBuffer.isView(e))return ue(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($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return Ct(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 a.from(n,t,r);let i=fe(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.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)}a.from=function(e,t,r){return rr(e,t,r)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function er(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 ce(e,t,r){return er(e),e<=0?j(e):t!==void 0?typeof r=="string"?j(e).fill(t,r):j(e).fill(t):j(e)}a.alloc=function(e,t,r){return ce(e,t,r)};function kt(e){return er(e),j(e<0?0:Tt(e)|0)}a.allocUnsafe=function(e){return kt(e)};a.allocUnsafeSlow=function(e){return kt(e)};function se(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=nr(e,t)|0,n=j(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function vt(e){let t=e.length<0?0:Tt(e.length)|0,r=j(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function ue(e){if($(e,Uint8Array)){let t=new Uint8Array(e);return Ct(t.buffer,t.byteOffset,t.byteLength)}return vt(e)}function Ct(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,a.prototype),n}function fe(e){if(a.isBuffer(e)){let t=Tt(e.length)|0,r=j(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Ht(e.length)?j(0):vt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return vt(e.data)}function Tt(e){if(e>=ft)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ft.toString(16)+" bytes");return e|0}function ae(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==a.prototype};a.compare=function(t,r){if($(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),$(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(t)||!a.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 o=0,c=Math.min(n,i);o<c;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0};a.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}};a.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let i=a.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){let c=t[n];if($(c,Uint8Array))o+c.length>i.length?(a.isBuffer(c)||(c=a.from(c)),c.copy(i,o)):Uint8Array.prototype.set.call(i,c,o);else if(a.isBuffer(c))c.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=c.length}return i};function nr(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(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 Ut(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pr(e).length;default:if(i)return n?-1:Ut(e).length;t=(""+t).toLowerCase(),i=!0}}a.byteLength=nr;function he(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 Ee(this,t,r);case"utf8":case"utf-8":return or(this,t,r);case"ascii":return me(this,t,r);case"latin1":case"binary":return Be(this,t,r);case"base64":return xe(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function Q(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}a.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)Q(this,r,r+1);return this};a.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)Q(this,r,r+3),Q(this,r+1,r+2);return this};a.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)Q(this,r,r+7),Q(this,r+1,r+6),Q(this,r+2,r+5),Q(this,r+3,r+4);return this};a.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?or(this,0,t):he.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.inspect=function(){let t="",r=ct.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Yt&&(a.prototype[Yt]=a.prototype.inspect);a.prototype.compare=function(t,r,n,i,o){if($(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.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),o===void 0&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let c=o-i,p=n-r,y=Math.min(c,p),A=this.slice(i,o),d=t.slice(r,n);for(let u=0;u<y;++u)if(A[u]!==d[u]){c=A[u],p=d[u];break}return c<p?-1:p<c?1:0};function ir(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,Ht(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=a.from(t,n)),a.isBuffer(t))return t.length===0?-1:Zt(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):Zt(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Zt(e,t,r,n,i){let o=1,c=e.length,p=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;o=2,c/=2,p/=2,r/=2}function y(d,u){return o===1?d[u]:d.readUInt16BE(u*o)}let A;if(i){let d=-1;for(A=r;A<c;A++)if(y(e,A)===y(t,d===-1?0:A-d)){if(d===-1&&(d=A),A-d+1===p)return d*o}else d!==-1&&(A-=A-d),d=-1}else for(r+p>c&&(r=c-p),A=r;A>=0;A--){let d=!0;for(let u=0;u<p;u++)if(y(e,A+u)!==y(t,u)){d=!1;break}if(d)return A}return-1}a.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};a.prototype.indexOf=function(t,r,n){return ir(this,t,r,n,!0)};a.prototype.lastIndexOf=function(t,r,n){return ir(this,t,r,n,!1)};function pe(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let c;for(c=0;c<n;++c){let p=parseInt(t.substr(c*2,2),16);if(Ht(p))return c;e[r+c]=p}return c}function le(e,t,r,n){return at(Ut(t,e.length-r),e,r,n)}function ye(e,t,r,n){return at(Fe(t),e,r,n)}function de(e,t,r,n){return at(pr(t),e,r,n)}function ge(e,t,r,n){return at(be(t,e.length-r),e,r,n)}a.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 o=this.length-r;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let c=!1;for(;;)switch(i){case"hex":return pe(this,t,r,n);case"utf8":case"utf-8":return le(this,t,r,n);case"ascii":case"latin1":case"binary":return ye(this,t,r,n);case"base64":return de(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,t,r,n);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xe(e,t,r){return t===0&&r===e.length?bt.fromByteArray(e):bt.fromByteArray(e.slice(t,r))}function or(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let o=e[i],c=null,p=o>239?4:o>223?3:o>191?2:1;if(i+p<=r){let y,A,d,u;switch(p){case 1:o<128&&(c=o);break;case 2:y=e[i+1],(y&192)===128&&(u=(o&31)<<6|y&63,u>127&&(c=u));break;case 3:y=e[i+1],A=e[i+2],(y&192)===128&&(A&192)===128&&(u=(o&15)<<12|(y&63)<<6|A&63,u>2047&&(u<55296||u>57343)&&(c=u));break;case 4:y=e[i+1],A=e[i+2],d=e[i+3],(y&192)===128&&(A&192)===128&&(d&192)===128&&(u=(o&15)<<18|(y&63)<<12|(A&63)<<6|d&63,u>65535&&u<1114112&&(c=u))}}c===null?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c),i+=p}return we(n)}var Qt=4096;function we(e){let t=e.length;if(t<=Qt)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Qt));return r}function me(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 Be(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 Ee(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=t;o<r;++o)i+=ve[e[o]];return i}function _e(e,t,r){let n=e.slice(t,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.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,a.prototype),i};function D(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")}a.prototype.readUintLE=a.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||D(t,r,this.length);let i=this[t],o=1,c=0;for(;++c<r&&(o*=256);)i+=this[t+c]*o;return i};a.prototype.readUintBE=a.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||D(t,r,this.length);let i=this[t+--r],o=1;for(;r>0&&(o*=256);)i+=this[t+--r]*o;return i};a.prototype.readUint8=a.prototype.readUInt8=function(t,r){return t=t>>>0,r||D(t,1,this.length),this[t]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||D(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||D(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||D(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readBigUInt64LE=G(function(t){t=t>>>0,ot(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&st(t,this.length-8);let i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});a.prototype.readBigUInt64BE=G(function(t){t=t>>>0,ot(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&st(t,this.length-8);let i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});a.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||D(t,r,this.length);let i=this[t],o=1,c=0;for(;++c<r&&(o*=256);)i+=this[t+c]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};a.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||D(t,r,this.length);let i=r,o=1,c=this[t+--i];for(;i>0&&(o*=256);)c+=this[t+--i]*o;return o*=128,c>=o&&(c-=Math.pow(2,8*r)),c};a.prototype.readInt8=function(t,r){return t=t>>>0,r||D(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,r){t=t>>>0,r||D(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(t,r){t=t>>>0,r||D(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(t,r){return t=t>>>0,r||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,r){return t=t>>>0,r||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readBigInt64LE=G(function(t){t=t>>>0,ot(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&st(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)});a.prototype.readBigInt64BE=G(function(t){t=t>>>0,ot(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&st(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)});a.prototype.readFloatLE=function(t,r){return t=t>>>0,r||D(t,4,this.length),it.read(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,r){return t=t>>>0,r||D(t,4,this.length),it.read(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||D(t,8,this.length),it.read(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||D(t,8,this.length),it.read(this,t,!1,52,8)};function N(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let p=Math.pow(2,8*n)-1;N(this,t,r,n,p,0)}let o=1,c=0;for(this[r]=t&255;++c<n&&(o*=256);)this[r+c]=t/o&255;return r+n};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let p=Math.pow(2,8*n)-1;N(this,t,r,n,p,0)}let o=n-1,c=1;for(this[r+o]=t&255;--o>=0&&(c*=256);)this[r+o]=t/c&255;return r+n};a.prototype.writeUint8=a.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,1,255,0),this[r]=t&255,r+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||N(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};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||N(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 cr(e,t,r,n,i){hr(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let c=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=c,c=c>>8,e[r++]=c,c=c>>8,e[r++]=c,c=c>>8,e[r++]=c,r}function sr(e,t,r,n,i){hr(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let c=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=c,c=c>>8,e[r+2]=c,c=c>>8,e[r+1]=c,c=c>>8,e[r]=c,r+8}a.prototype.writeBigUInt64LE=G(function(t,r=0){return cr(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeBigUInt64BE=G(function(t,r=0){return sr(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let y=Math.pow(2,8*n-1);N(this,t,r,n,y-1,-y)}let o=0,c=1,p=0;for(this[r]=t&255;++o<n&&(c*=256);)t<0&&p===0&&this[r+o-1]!==0&&(p=1),this[r+o]=(t/c>>0)-p&255;return r+n};a.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let y=Math.pow(2,8*n-1);N(this,t,r,n,y-1,-y)}let o=n-1,c=1,p=0;for(this[r+o]=t&255;--o>=0&&(c*=256);)t<0&&p===0&&this[r+o+1]!==0&&(p=1),this[r+o]=(t/c>>0)-p&255;return r+n};a.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};a.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};a.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};a.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||N(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};a.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||N(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};a.prototype.writeBigInt64LE=G(function(t,r=0){return cr(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});a.prototype.writeBigInt64BE=G(function(t,r=0){return sr(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ur(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function fr(e,t,r,n,i){return t=+t,r=r>>>0,i||ur(e,t,r,4,34028234663852886e22,-34028234663852886e22),it.write(e,t,r,n,23,4),r+4}a.prototype.writeFloatLE=function(t,r,n){return fr(this,t,r,!0,n)};a.prototype.writeFloatBE=function(t,r,n){return fr(this,t,r,!1,n)};function ar(e,t,r,n,i){return t=+t,r=r>>>0,i||ur(e,t,r,8,17976931348623157e292,-17976931348623157e292),it.write(e,t,r,n,52,8),r+8}a.prototype.writeDoubleLE=function(t,r,n){return ar(this,t,r,!0,n)};a.prototype.writeDoubleBE=function(t,r,n){return ar(this,t,r,!1,n)};a.prototype.copy=function(t,r,n,i){if(!a.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 o=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),o};a.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"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let c=t.charCodeAt(0);(i==="utf8"&&c<128||i==="latin1")&&(t=c)}}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 o;if(typeof t=="number")for(o=r;o<n;++o)this[o]=t;else{let c=a.isBuffer(t)?t:a.from(t,i),p=c.length;if(p===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=c[o%p]}return this};var nt={};function Rt(e,t,r){nt[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}`}}}Rt("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Rt("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);Rt("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=tr(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=tr(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function tr(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 Ae(e,t,r){ot(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&st(t,e.length-(r+1))}function hr(e,t,r,n,i,o){if(e>r||e<t){let c=typeof t=="bigint"?"n":"",p;throw o>3?t===0||t===BigInt(0)?p=`>= 0${c} and < 2${c} ** ${(o+1)*8}${c}`:p=`>= -(2${c} ** ${(o+1)*8-1}${c}) and < 2 ** ${(o+1)*8-1}${c}`:p=`>= ${t}${c} and <= ${r}${c}`,new nt.ERR_OUT_OF_RANGE("value",p,e)}Ae(n,i,o)}function ot(e,t){if(typeof e!="number")throw new nt.ERR_INVALID_ARG_TYPE(t,"number",e)}function st(e,t,r){throw Math.floor(e)!==e?(ot(e,r),new nt.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new nt.ERR_BUFFER_OUT_OF_BOUNDS:new nt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Ie=/[^+/0-9A-Za-z-_]/g;function Se(e){if(e=e.split("=")[0],e=e.trim().replace(Ie,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Ut(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Fe(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function be(e,t){let r,n,i,o=[];for(let c=0;c<e.length&&!((t-=2)<0);++c)r=e.charCodeAt(c),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function pr(e){return bt.toByteArray(Se(e))}function at(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 $(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Ht(e){return e!==e}var ve=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 G(e){return typeof BigInt>"u"?Ce:e}function Ce(){throw new Error("BigInt not supported")}});var dr=L((Dt,yr)=>{var ht=Mt(),K=ht.Buffer;function lr(e,t){for(var r in e)t[r]=e[r]}K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow?yr.exports=ht:(lr(ht,Dt),Dt.Buffer=tt);function tt(e,t,r){return K(e,t,r)}tt.prototype=Object.create(K.prototype);lr(K,tt);tt.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return K(e,t,r)};tt.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=K(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};tt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return K(e)};tt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ht.SlowBuffer(e)}});var gr=L((je,Lt)=>{"use strict";var Ot=65536,Ue=4294967295;function ke(){throw new Error(`Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11`)}var Te=dr().Buffer,pt=global.crypto||global.msCrypto;pt&&pt.getRandomValues?Lt.exports=Re:Lt.exports=ke;function Re(e,t){if(e>Ue)throw new RangeError("requested too many random bytes");var r=Te.allocUnsafe(e);if(e>0)if(e>Ot)for(var n=0;n<e;n+=Ot)pt.getRandomValues(r.slice(n,n+Ot));else pt.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}});var z=L((lt,xr)=>{(function(e,t){typeof lt=="object"?xr.exports=lt=t():typeof define=="function"&&define.amd?define([],t):e.CryptoJS=t()})(lt,function(){var e=e||function(t,r){var n={},i=n.lib={},o=i.Base=function(){function s(){}return{extend:function(f){s.prototype=this;var w=new s;return f&&w.mixIn(f),w.hasOwnProperty("init")||(w.init=function(){w.$super.init.apply(this,arguments)}),w.init.prototype=w,w.$super=this,w},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var w in f)f.hasOwnProperty(w)&&(this[w]=f[w]);f.hasOwnProperty("toString")&&(this.toString=f.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=i.WordArray=o.extend({init:function(s,f){s=this.words=s||[],this.sigBytes=f!=r?f:4*s.length},toString:function(s){return(s||y).stringify(this)},concat:function(s){var f=this.words,w=s.words,I=this.sigBytes,x=s.sigBytes;if(this.clamp(),I%4)for(var l=0;x>l;l++){var F=255&w[l>>>2]>>>24-8*(l%4);f[I+l>>>2]|=F<<24-8*((I+l)%4)}else if(w.length>65535)for(var l=0;x>l;l+=4)f[I+l>>>2]=w[l>>>2];else f.push.apply(f,w);return this.sigBytes+=x,this},clamp:function(){var s=this.words,f=this.sigBytes;s[f>>>2]&=4294967295<<32-8*(f%4),s.length=t.ceil(f/4)},clone:function(){var s=o.clone.call(this);return s.words=this.words.slice(0),s},random:function(s){for(var f=[],w=0;s>w;w+=4)f.push(0|4294967296*t.random());return new c.init(f,s)}}),p=n.enc={},y=p.Hex={stringify:function(s){for(var f=s.words,w=s.sigBytes,I=[],x=0;w>x;x++){var l=255&f[x>>>2]>>>24-8*(x%4);I.push((l>>>4).toString(16)),I.push((15&l).toString(16))}return I.join("")},parse:function(s){for(var f=s.length,w=[],I=0;f>I;I+=2)w[I>>>3]|=parseInt(s.substr(I,2),16)<<24-4*(I%8);return new c.init(w,f/2)}},A=p.Latin1={stringify:function(s){for(var f=s.words,w=s.sigBytes,I=[],x=0;w>x;x++){var l=255&f[x>>>2]>>>24-8*(x%4);I.push(String.fromCharCode(l))}return I.join("")},parse:function(s){for(var f=s.length,w=[],I=0;f>I;I++)w[I>>>2]|=(255&s.charCodeAt(I))<<24-8*(I%4);return new c.init(w,f)}},d=p.Utf8={stringify:function(s){try{return decodeURIComponent(escape(A.stringify(s)))}catch{throw Error("Malformed UTF-8 data")}},parse:function(s){return A.parse(unescape(encodeURIComponent(s)))}},u=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(s){typeof s=="string"&&(s=d.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},_process:function(s){var f=this._data,w=f.words,I=f.sigBytes,x=this.blockSize,l=4*x,F=I/l;F=s?t.ceil(F):t.max((0|F)-this._minBufferSize,0);var C=F*x,T=t.min(4*C,I);if(C){for(var k=0;C>k;k+=x)this._doProcessBlock(w,k);var R=w.splice(0,C);f.sigBytes-=T}return new c.init(R,T)},clone:function(){var s=o.clone.call(this);return s._data=this._data.clone(),s},_minBufferSize:0});i.Hasher=u.extend({cfg:o.extend(),init:function(s){this.cfg=this.cfg.extend(s),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(s){return this._append(s),this._process(),this},finalize:function(s){s&&this._append(s);var f=this._doFinalize();return f},blockSize:16,_createHelper:function(s){return function(f,w){return new s.init(w).finalize(f)}},_createHmacHelper:function(s){return function(f,w){return new v.HMAC.init(s,w).finalize(f)}}});var v=n.algo={};return n}(Math);return e})});var Nt=L((yt,wr)=>{(function(e,t){typeof yt=="object"?wr.exports=yt=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(yt,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=t.enc;i.Base64={stringify:function(o){var c=o.words,p=o.sigBytes,y=this._map;o.clamp();for(var A=[],d=0;p>d;d+=3)for(var u=255&c[d>>>2]>>>24-8*(d%4),v=255&c[d+1>>>2]>>>24-8*((d+1)%4),s=255&c[d+2>>>2]>>>24-8*((d+2)%4),f=u<<16|v<<8|s,w=0;4>w&&p>d+.75*w;w++)A.push(y.charAt(63&f>>>6*(3-w)));var I=y.charAt(64);if(I)for(;A.length%4;)A.push(I);return A.join("")},parse:function(o){var c=o.length,p=this._map,y=p.charAt(64);if(y){var A=o.indexOf(y);A!=-1&&(c=A)}for(var d=[],u=0,v=0;c>v;v++)if(v%4){var s=p.indexOf(o.charAt(v-1))<<2*(v%4),f=p.indexOf(o.charAt(v))>>>6-2*(v%4);d[u>>>2]|=(s|f)<<24-8*(u%4),u++}return n.create(d,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64})});var Br=L((dt,mr)=>{(function(e,t){typeof dt=="object"?mr.exports=dt=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(dt,function(e){return function(t){function r(s,f,w,I,x,l,F){var C=s+(f&w|~f&I)+x+F;return(C<<l|C>>>32-l)+f}function n(s,f,w,I,x,l,F){var C=s+(f&I|w&~I)+x+F;return(C<<l|C>>>32-l)+f}function i(s,f,w,I,x,l,F){var C=s+(f^w^I)+x+F;return(C<<l|C>>>32-l)+f}function o(s,f,w,I,x,l,F){var C=s+(w^(f|~I))+x+F;return(C<<l|C>>>32-l)+f}var c=e,p=c.lib,y=p.WordArray,A=p.Hasher,d=c.algo,u=[];(function(){for(var s=0;64>s;s++)u[s]=0|4294967296*t.abs(t.sin(s+1))})();var v=d.MD5=A.extend({_doReset:function(){this._hash=new y.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(s,f){for(var w=0;16>w;w++){var I=f+w,x=s[I];s[I]=16711935&(x<<8|x>>>24)|4278255360&(x<<24|x>>>8)}var l=this._hash.words,F=s[f+0],C=s[f+1],T=s[f+2],k=s[f+3],R=s[f+4],h=s[f+5],g=s[f+6],b=s[f+7],S=s[f+8],U=s[f+9],H=s[f+10],M=s[f+11],O=s[f+12],W=s[f+13],X=s[f+14],V=s[f+15],m=l[0],B=l[1],E=l[2],_=l[3];m=r(m,B,E,_,F,7,u[0]),_=r(_,m,B,E,C,12,u[1]),E=r(E,_,m,B,T,17,u[2]),B=r(B,E,_,m,k,22,u[3]),m=r(m,B,E,_,R,7,u[4]),_=r(_,m,B,E,h,12,u[5]),E=r(E,_,m,B,g,17,u[6]),B=r(B,E,_,m,b,22,u[7]),m=r(m,B,E,_,S,7,u[8]),_=r(_,m,B,E,U,12,u[9]),E=r(E,_,m,B,H,17,u[10]),B=r(B,E,_,m,M,22,u[11]),m=r(m,B,E,_,O,7,u[12]),_=r(_,m,B,E,W,12,u[13]),E=r(E,_,m,B,X,17,u[14]),B=r(B,E,_,m,V,22,u[15]),m=n(m,B,E,_,C,5,u[16]),_=n(_,m,B,E,g,9,u[17]),E=n(E,_,m,B,M,14,u[18]),B=n(B,E,_,m,F,20,u[19]),m=n(m,B,E,_,h,5,u[20]),_=n(_,m,B,E,H,9,u[21]),E=n(E,_,m,B,V,14,u[22]),B=n(B,E,_,m,R,20,u[23]),m=n(m,B,E,_,U,5,u[24]),_=n(_,m,B,E,X,9,u[25]),E=n(E,_,m,B,k,14,u[26]),B=n(B,E,_,m,S,20,u[27]),m=n(m,B,E,_,W,5,u[28]),_=n(_,m,B,E,T,9,u[29]),E=n(E,_,m,B,b,14,u[30]),B=n(B,E,_,m,O,20,u[31]),m=i(m,B,E,_,h,4,u[32]),_=i(_,m,B,E,S,11,u[33]),E=i(E,_,m,B,M,16,u[34]),B=i(B,E,_,m,X,23,u[35]),m=i(m,B,E,_,C,4,u[36]),_=i(_,m,B,E,R,11,u[37]),E=i(E,_,m,B,b,16,u[38]),B=i(B,E,_,m,H,23,u[39]),m=i(m,B,E,_,W,4,u[40]),_=i(_,m,B,E,F,11,u[41]),E=i(E,_,m,B,k,16,u[42]),B=i(B,E,_,m,g,23,u[43]),m=i(m,B,E,_,U,4,u[44]),_=i(_,m,B,E,O,11,u[45]),E=i(E,_,m,B,V,16,u[46]),B=i(B,E,_,m,T,23,u[47]),m=o(m,B,E,_,F,6,u[48]),_=o(_,m,B,E,b,10,u[49]),E=o(E,_,m,B,X,15,u[50]),B=o(B,E,_,m,h,21,u[51]),m=o(m,B,E,_,O,6,u[52]),_=o(_,m,B,E,k,10,u[53]),E=o(E,_,m,B,H,15,u[54]),B=o(B,E,_,m,C,21,u[55]),m=o(m,B,E,_,S,6,u[56]),_=o(_,m,B,E,V,10,u[57]),E=o(E,_,m,B,g,15,u[58]),B=o(B,E,_,m,W,21,u[59]),m=o(m,B,E,_,R,6,u[60]),_=o(_,m,B,E,M,10,u[61]),E=o(E,_,m,B,T,15,u[62]),B=o(B,E,_,m,U,21,u[63]),l[0]=0|l[0]+m,l[1]=0|l[1]+B,l[2]=0|l[2]+E,l[3]=0|l[3]+_},_doFinalize:function(){var s=this._data,f=s.words,w=8*this._nDataBytes,I=8*s.sigBytes;f[I>>>5]|=128<<24-I%32;var x=t.floor(w/4294967296),l=w;f[(I+64>>>9<<4)+15]=16711935&(x<<8|x>>>24)|4278255360&(x<<24|x>>>8),f[(I+64>>>9<<4)+14]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),s.sigBytes=4*(f.length+1),this._process();for(var F=this._hash,C=F.words,T=0;4>T;T++){var k=C[T];C[T]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}return F},clone:function(){var s=A.clone.call(this);return s._hash=this._hash.clone(),s}});c.MD5=A._createHelper(v),c.HmacMD5=A._createHmacHelper(v)}(Math),e.MD5})});var _r=L((gt,Er)=>{(function(e,t){typeof gt=="object"?Er.exports=gt=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(gt,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,o=t.algo,c=[],p=o.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(y,A){for(var d=this._hash.words,u=d[0],v=d[1],s=d[2],f=d[3],w=d[4],I=0;80>I;I++){if(16>I)c[I]=0|y[A+I];else{var x=c[I-3]^c[I-8]^c[I-14]^c[I-16];c[I]=x<<1|x>>>31}var l=(u<<5|u>>>27)+w+c[I];l+=20>I?(v&s|~v&f)+1518500249:40>I?(v^s^f)+1859775393:60>I?(v&s|v&f|s&f)-1894007588:(v^s^f)-899497514,w=f,f=s,s=v<<30|v>>>2,v=u,u=l}d[0]=0|d[0]+u,d[1]=0|d[1]+v,d[2]=0|d[2]+s,d[3]=0|d[3]+f,d[4]=0|d[4]+w},_doFinalize:function(){var y=this._data,A=y.words,d=8*this._nDataBytes,u=8*y.sigBytes;return A[u>>>5]|=128<<24-u%32,A[(u+64>>>9<<4)+14]=Math.floor(d/4294967296),A[(u+64>>>9<<4)+15]=d,y.sigBytes=4*A.length,this._process(),this._hash},clone:function(){var y=i.clone.call(this);return y._hash=this._hash.clone(),y}});t.SHA1=i._createHelper(p),t.HmacSHA1=i._createHmacHelper(p)}(),e.SHA1})});var Pt=L((xt,Ar)=>{(function(e,t){typeof xt=="object"?Ar.exports=xt=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(xt,function(e){(function(){var t=e,r=t.lib,n=r.Base,i=t.enc,o=i.Utf8,c=t.algo;c.HMAC=n.extend({init:function(p,y){p=this._hasher=new p.init,typeof y=="string"&&(y=o.parse(y));var A=p.blockSize,d=4*A;y.sigBytes>d&&(y=p.finalize(y)),y.clamp();for(var u=this._oKey=y.clone(),v=this._iKey=y.clone(),s=u.words,f=v.words,w=0;A>w;w++)s[w]^=1549556828,f[w]^=909522486;u.sigBytes=v.sigBytes=d,this.reset()},reset:function(){var p=this._hasher;p.reset(),p.update(this._iKey)},update:function(p){return this._hasher.update(p),this},finalize:function(p){var y=this._hasher,A=y.finalize(p);y.reset();var d=y.finalize(this._oKey.clone().concat(A));return d}})})()})});var Sr=L((wt,Ir)=>{(function(e,t){typeof wt=="object"?Ir.exports=wt=t(z(),_r(),Pt()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],t):t(e.CryptoJS)})(wt,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,c=o.MD5,p=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,A){for(var d=this.cfg,u=d.hasher.create(),v=i.create(),s=v.words,f=d.keySize,w=d.iterations;f>s.length;){I&&u.update(I);var I=u.update(y).finalize(A);u.reset();for(var x=1;w>x;x++)I=u.finalize(I),u.reset();v.concat(I)}return v.sigBytes=4*f,v}});t.EvpKDF=function(y,A,d){return p.create(d).compute(y,A)}}(),e.EvpKDF})});var br=L((mt,Fr)=>{(function(e,t){typeof mt=="object"?Fr.exports=mt=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(mt,function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,o=n.WordArray,c=n.BufferedBlockAlgorithm,p=r.enc;p.Utf8;var y=p.Base64,A=r.algo,d=A.EvpKDF,u=n.Cipher=c.extend({cfg:i.extend(),createEncryptor:function(h,g){return this.create(this._ENC_XFORM_MODE,h,g)},createDecryptor:function(h,g){return this.create(this._DEC_XFORM_MODE,h,g)},init:function(h,g,b){this.cfg=this.cfg.extend(b),this._xformMode=h,this._key=g,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(h){return this._append(h),this._process()},finalize:function(h){h&&this._append(h);var g=this._doFinalize();return g},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function h(g){return typeof g=="string"?R:C}return function(g){return{encrypt:function(b,S,U){return h(S).encrypt(g,b,S,U)},decrypt:function(b,S,U){return h(S).decrypt(g,b,S,U)}}}}()});n.StreamCipher=u.extend({_doFinalize:function(){var h=this._process(!0);return h},blockSize:1});var v=r.mode={},s=n.BlockCipherMode=i.extend({createEncryptor:function(h,g){return this.Encryptor.create(h,g)},createDecryptor:function(h,g){return this.Decryptor.create(h,g)},init:function(h,g){this._cipher=h,this._iv=g}}),f=v.CBC=function(){function h(b,S,U){var H=this._iv;if(H){var M=H;this._iv=t}else var M=this._prevBlock;for(var O=0;U>O;O++)b[S+O]^=M[O]}var g=s.extend();return g.Encryptor=g.extend({processBlock:function(b,S){var U=this._cipher,H=U.blockSize;h.call(this,b,S,H),U.encryptBlock(b,S),this._prevBlock=b.slice(S,S+H)}}),g.Decryptor=g.extend({processBlock:function(b,S){var U=this._cipher,H=U.blockSize,M=b.slice(S,S+H);U.decryptBlock(b,S),h.call(this,b,S,H),this._prevBlock=M}}),g}(),w=r.pad={},I=w.Pkcs7={pad:function(h,g){for(var b=4*g,S=b-h.sigBytes%b,U=S<<24|S<<16|S<<8|S,H=[],M=0;S>M;M+=4)H.push(U);var O=o.create(H,S);h.concat(O)},unpad:function(h){var g=255&h.words[h.sigBytes-1>>>2];h.sigBytes-=g}};n.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:I}),reset:function(){u.reset.call(this);var h=this.cfg,g=h.iv,b=h.mode;if(this._xformMode==this._ENC_XFORM_MODE)var S=b.createEncryptor;else{var S=b.createDecryptor;this._minBufferSize=1}this._mode=S.call(b,this,g&&g.words)},_doProcessBlock:function(h,g){this._mode.processBlock(h,g)},_doFinalize:function(){var h=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){h.pad(this._data,this.blockSize);var g=this._process(!0)}else{var g=this._process(!0);h.unpad(g)}return g},blockSize:4});var x=n.CipherParams=i.extend({init:function(h){this.mixIn(h)},toString:function(h){return(h||this.formatter).stringify(this)}}),l=r.format={},F=l.OpenSSL={stringify:function(h){var g=h.ciphertext,b=h.salt;if(b)var S=o.create([1398893684,1701076831]).concat(b).concat(g);else var S=g;return S.toString(y)},parse:function(h){var g=y.parse(h),b=g.words;if(b[0]==1398893684&&b[1]==1701076831){var S=o.create(b.slice(2,4));b.splice(0,4),g.sigBytes-=16}return x.create({ciphertext:g,salt:S})}},C=n.SerializableCipher=i.extend({cfg:i.extend({format:F}),encrypt:function(h,g,b,S){S=this.cfg.extend(S);var U=h.createEncryptor(b,S),H=U.finalize(g),M=U.cfg;return x.create({ciphertext:H,key:b,iv:M.iv,algorithm:h,mode:M.mode,padding:M.padding,blockSize:h.blockSize,formatter:S.format})},decrypt:function(h,g,b,S){S=this.cfg.extend(S),g=this._parse(g,S.format);var U=h.createDecryptor(b,S).finalize(g.ciphertext);return U},_parse:function(h,g){return typeof h=="string"?g.parse(h,this):h}}),T=r.kdf={},k=T.OpenSSL={execute:function(h,g,b,S){S||(S=o.random(8));var U=d.create({keySize:g+b}).compute(h,S),H=o.create(U.words.slice(g),4*b);return U.sigBytes=4*g,x.create({key:U,iv:H,salt:S})}},R=n.PasswordBasedCipher=C.extend({cfg:C.cfg.extend({kdf:k}),encrypt:function(h,g,b,S){S=this.cfg.extend(S);var U=S.kdf.execute(b,h.keySize,h.ivSize);S.iv=U.iv;var H=C.encrypt.call(this,h,g,U.key,S);return H.mixIn(U),H},decrypt:function(h,g,b,S){S=this.cfg.extend(S),g=this._parse(g,S.format);var U=S.kdf.execute(b,h.keySize,h.ivSize,g.salt);S.iv=U.iv;var H=C.decrypt.call(this,h,g,U.key,S);return H}})}()})});var Cr=L((Bt,vr)=>{(function(e,t){typeof Bt=="object"?vr.exports=Bt=t(z(),Nt(),Br(),Sr(),br()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(Bt,function(e){return function(){var t=e,r=t.lib,n=r.BlockCipher,i=t.algo,o=[],c=[],p=[],y=[],A=[],d=[],u=[],v=[],s=[],f=[];(function(){for(var x=[],l=0;256>l;l++)x[l]=128>l?l<<1:283^l<<1;for(var F=0,C=0,l=0;256>l;l++){var T=C^C<<1^C<<2^C<<3^C<<4;T=99^(T>>>8^255&T),o[F]=T,c[T]=F;var k=x[F],R=x[k],h=x[R],g=257*x[T]^16843008*T;p[F]=g<<24|g>>>8,y[F]=g<<16|g>>>16,A[F]=g<<8|g>>>24,d[F]=g;var g=16843009*h^65537*R^257*k^16843008*F;u[T]=g<<24|g>>>8,v[T]=g<<16|g>>>16,s[T]=g<<8|g>>>24,f[T]=g,F?(F=k^x[x[x[h^k]]],C^=x[x[C]]):F=C=1}})();var w=[0,1,2,4,8,16,32,64,128,27,54],I=i.AES=n.extend({_doReset:function(){for(var x=this._key,l=x.words,F=x.sigBytes/4,C=this._nRounds=F+6,T=4*(C+1),k=this._keySchedule=[],R=0;T>R;R++)if(F>R)k[R]=l[R];else{var h=k[R-1];R%F?F>6&&R%F==4&&(h=o[h>>>24]<<24|o[255&h>>>16]<<16|o[255&h>>>8]<<8|o[255&h]):(h=h<<8|h>>>24,h=o[h>>>24]<<24|o[255&h>>>16]<<16|o[255&h>>>8]<<8|o[255&h],h^=w[0|R/F]<<24),k[R]=k[R-F]^h}for(var g=this._invKeySchedule=[],b=0;T>b;b++){var R=T-b;if(b%4)var h=k[R];else var h=k[R-4];g[b]=4>b||4>=R?h:u[o[h>>>24]]^v[o[255&h>>>16]]^s[o[255&h>>>8]]^f[o[255&h]]}},encryptBlock:function(x,l){this._doCryptBlock(x,l,this._keySchedule,p,y,A,d,o)},decryptBlock:function(x,l){var F=x[l+1];x[l+1]=x[l+3],x[l+3]=F,this._doCryptBlock(x,l,this._invKeySchedule,u,v,s,f,c);var F=x[l+1];x[l+1]=x[l+3],x[l+3]=F},_doCryptBlock:function(x,l,F,C,T,k,R,h){for(var g=this._nRounds,b=x[l]^F[0],S=x[l+1]^F[1],U=x[l+2]^F[2],H=x[l+3]^F[3],M=4,O=1;g>O;O++){var W=C[b>>>24]^T[255&S>>>16]^k[255&U>>>8]^R[255&H]^F[M++],X=C[S>>>24]^T[255&U>>>16]^k[255&H>>>8]^R[255&b]^F[M++],V=C[U>>>24]^T[255&H>>>16]^k[255&b>>>8]^R[255&S]^F[M++],m=C[H>>>24]^T[255&b>>>16]^k[255&S>>>8]^R[255&U]^F[M++];b=W,S=X,U=V,H=m}var W=(h[b>>>24]<<24|h[255&S>>>16]<<16|h[255&U>>>8]<<8|h[255&H])^F[M++],X=(h[S>>>24]<<24|h[255&U>>>16]<<16|h[255&H>>>8]<<8|h[255&b])^F[M++],V=(h[U>>>24]<<24|h[255&H>>>16]<<16|h[255&b>>>8]<<8|h[255&S])^F[M++],m=(h[H>>>24]<<24|h[255&b>>>16]<<16|h[255&S>>>8]<<8|h[255&U])^F[M++];x[l]=W,x[l+1]=X,x[l+2]=V,x[l+3]=m},keySize:8});t.AES=n._createHelper(I)}(),e.AES})});var kr=L((Et,Ur)=>{(function(e,t){typeof Et=="object"?Ur.exports=Et=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Et,function(e){return e.enc.Utf8})});var Rr=L((_t,Tr)=>{(function(e,t){typeof _t=="object"?Tr.exports=_t=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(_t,function(e){return e.enc.Hex})});var Mr=L((At,Hr)=>{(function(e,t){typeof At=="object"?Hr.exports=At=t(z()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(At,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,c=r.algo,p=[],y=[];(function(){function u(w){for(var I=t.sqrt(w),x=2;I>=x;x++)if(!(w%x))return!1;return!0}function v(w){return 0|4294967296*(w-(0|w))}for(var s=2,f=0;64>f;)u(s)&&(8>f&&(p[f]=v(t.pow(s,.5))),y[f]=v(t.pow(s,1/3)),f++),s++})();var A=[],d=c.SHA256=o.extend({_doReset:function(){this._hash=new i.init(p.slice(0))},_doProcessBlock:function(u,v){for(var s=this._hash.words,f=s[0],w=s[1],I=s[2],x=s[3],l=s[4],F=s[5],C=s[6],T=s[7],k=0;64>k;k++){if(16>k)A[k]=0|u[v+k];else{var R=A[k-15],h=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3,g=A[k-2],b=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;A[k]=h+A[k-7]+b+A[k-16]}var S=l&F^~l&C,U=f&w^f&I^w&I,H=(f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22),M=(l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25),O=T+M+S+y[k]+A[k],W=H+U;T=C,C=F,F=l,l=0|x+O,x=I,I=w,w=f,f=0|O+W}s[0]=0|s[0]+f,s[1]=0|s[1]+w,s[2]=0|s[2]+I,s[3]=0|s[3]+x,s[4]=0|s[4]+l,s[5]=0|s[5]+F,s[6]=0|s[6]+C,s[7]=0|s[7]+T},_doFinalize:function(){var u=this._data,v=u.words,s=8*this._nDataBytes,f=8*u.sigBytes;return v[f>>>5]|=128<<24-f%32,v[(f+64>>>9<<4)+14]=t.floor(s/4294967296),v[(f+64>>>9<<4)+15]=s,u.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u}});r.SHA256=o._createHelper(d),r.HmacSHA256=o._createHmacHelper(d)}(Math),e.SHA256})});var Or=L((It,Dr)=>{(function(e,t){typeof It=="object"?Dr.exports=It=t(z(),Mr(),Pt()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],t):t(e.CryptoJS)})(It,function(e){return e.HmacSHA256})});var $t=Y(Mt(),1),Nr=Y(gr(),1),Kt=Y(Cr(),1),Pr=Y(kr(),1),q=Y(Rr(),1),zr=Y(Nt(),1),Wr=Y(Or(),1);typeof window.global>"u"&&(window.global=window);var et={ttl:0,versionHex:"80",secret:void 0},He={encode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},decode(e){return e+=Array(5-e.length%4).join("="),e=e.replace(/\-/g,"+").replace(/\_/g,"/"),$t.Buffer.from(e,"base64")},validate(e){return/^[A-Za-z0-9\-_]+$/.test(e)}};function Jr(e,t,r){for(;e.length<r;)e=t+e;return e}function Me(e){return e.replace(/\+/g,"-").replace(/\//g,"_")}var zt=e=>parseInt("0x"+e);function rt(e){return e/8*2}function $r(e){let t=He.decode(e.replace(/=+$/,""));return $t.Buffer.from(t).toString("hex")}function De(e){let t="";for(let r in e)t+=Jr(Number(r).toString(16),"0",2);return t}function Oe(e){return(0,Nr.default)(128/8).toString("hex")}function Le(e){return Array.isArray(e)?De(e):Oe(128/8)}function Wt(e){e?e=e/1e3:e=Math.round(new Date/1e3);let t=Jr(e.toString(16),"0","16");return q.default.parse(t)}function Xe(e){return et.secret=new Jt(e),et.secret}function Ne(e,t,r){return Kt.default.encrypt(e,t,{iv:r}).ciphertext}function Pe(e,t,r){let n={ciphertext:e,key:t,iv:r};return Kt.default.decrypt(n,t,{iv:r}).toString(Pr.default)}function ze(e,t,r,n){let i=Kr(e,t,r,n),o=q.default.parse(et.versionHex);for(let c of[t,r,n,i])o=o.concat(c);return Me(o.toString(zr.default))}function Kr(e,t,r,n){let i=q.default.parse(et.versionHex);for(let o of[t,r,n])i=i.concat(o);return(0,Wr.default)(i,e)}var Jt=class{constructor(t){let r=$r(t);if(r.length!==rt(256))throw new Error("Secret must be 32 url-safe base64-encoded bytes.");this.signingKeyHex=r.slice(0,rt(128)),this.signingKey=q.default.parse(th