UNPKG

@hysc/external

Version:

Boom external js sdk

4 lines 78.5 kB
"use strict";var Mn=Object.create;var be=Object.defineProperty,xn=Object.defineProperties,Rn=Object.getOwnPropertyDescriptor,kn=Object.getOwnPropertyDescriptors,Cn=Object.getOwnPropertyNames,Ct=Object.getOwnPropertySymbols,Fn=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty,On=Object.prototype.propertyIsEnumerable;var Ft=(n,e,r)=>e in n?be(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,qt=(n,e)=>{for(var r in e||(e={}))Ot.call(e,r)&&Ft(n,r,e[r]);if(Ct)for(var r of Ct(e))On.call(e,r)&&Ft(n,r,e[r]);return n},Lt=(n,e)=>xn(n,kn(e));var N=(n,e)=>()=>(n&&(e=n(n=0)),e);var nt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),st=(n,e)=>{for(var r in e)be(n,r,{get:e[r],enumerable:!0})},Ut=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Cn(e))!Ot.call(n,a)&&a!==r&&be(n,a,{get:()=>e[a],enumerable:!(t=Rn(e,a))||t.enumerable});return n};var me=(n,e,r)=>(r=n!=null?Mn(Fn(n)):{},Ut(e||!n||!n.__esModule?be(r,"default",{value:n,enumerable:!0}):r,n)),ot=n=>Ut(be({},"__esModule",{value:!0}),n);var Ce=(n,e,r)=>new Promise((t,a)=>{var l=y=>{try{f(r.next(y))}catch(g){a(g)}},c=y=>{try{f(r.throw(y))}catch(g){a(g)}},f=y=>y.done?t(y.value):Promise.resolve(y.value).then(l,c);f((r=r.apply(n,e)).next())});var zt=nt((Fs,Kt)=>{"use strict";var Un=require("buffer").Buffer;Kt.exports=function(n){if(n instanceof Uint8Array){if(n.byteOffset===0&&n.byteLength===n.buffer.byteLength)return n.buffer;if(typeof n.buffer.slice=="function")return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}if(Un.isBuffer(n)){for(var e=new Uint8Array(n.length),r=n.length,t=0;t<r;t++)e[t]=n[t];return e.buffer}else throw new Error("Argument must be a Buffer")}});var jt=nt((Fe,Vt)=>{"use strict";(function(){var n,e=0xdeadbeefcafe,r=(e&16777215)==15715070;function t(i,s,o){i!=null&&(typeof i=="number"?this.fromNumber(i,s,o):s==null&&typeof i!="string"?this.fromString(i,256):this.fromString(i,s))}function a(){return new t(null)}function l(i,s,o,u,m,h){for(;--h>=0;){var d=s*this[i++]+o[u]+m;m=Math.floor(d/67108864),o[u++]=d&67108863}return m}function c(i,s,o,u,m,h){for(var d=s&32767,v=s>>15;--h>=0;){var R=this[i]&32767,L=this[i++]>>15,W=v*R+L*d;R=d*R+((W&32767)<<15)+o[u]+(m&1073741823),m=(R>>>30)+(W>>>15)+v*L+(m>>>30),o[u++]=R&1073741823}return m}function f(i,s,o,u,m,h){for(var d=s&16383,v=s>>14;--h>=0;){var R=this[i]&16383,L=this[i++]>>14,W=v*R+L*d;R=d*R+((W&16383)<<14)+o[u]+m,m=(R>>28)+(W>>14)+v*L,o[u++]=R&268435455}return m}var y=typeof navigator!="undefined";y&&r&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=c,n=30):y&&r&&navigator.appName!="Netscape"?(t.prototype.am=l,n=26):(t.prototype.am=f,n=28),t.prototype.DB=n,t.prototype.DM=(1<<n)-1,t.prototype.DV=1<<n;var g=52;t.prototype.FV=Math.pow(2,g),t.prototype.F1=g-n,t.prototype.F2=2*n-g;var B="0123456789abcdefghijklmnopqrstuvwxyz",w=new Array,_,I;for(_="0".charCodeAt(0),I=0;I<=9;++I)w[_++]=I;for(_="a".charCodeAt(0),I=10;I<36;++I)w[_++]=I;for(_="A".charCodeAt(0),I=10;I<36;++I)w[_++]=I;function P(i){return B.charAt(i)}function x(i,s){var o=w[i.charCodeAt(s)];return o==null?-1:o}function k(i){for(var s=this.t-1;s>=0;--s)i[s]=this[s];i.t=this.t,i.s=this.s}function M(i){this.t=1,this.s=i<0?-1:0,i>0?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0}function F(i){var s=a();return s.fromInt(i),s}function V(i,s){var o;if(s==16)o=4;else if(s==8)o=3;else if(s==256)o=8;else if(s==2)o=1;else if(s==32)o=5;else if(s==4)o=2;else{this.fromRadix(i,s);return}this.t=0,this.s=0;for(var u=i.length,m=!1,h=0;--u>=0;){var d=o==8?i[u]&255:x(i,u);if(d<0){i.charAt(u)=="-"&&(m=!0);continue}m=!1,h==0?this[this.t++]=d:h+o>this.DB?(this[this.t-1]|=(d&(1<<this.DB-h)-1)<<h,this[this.t++]=d>>this.DB-h):this[this.t-1]|=d<<h,h+=o,h>=this.DB&&(h-=this.DB)}o==8&&i[0]&128&&(this.s=-1,h>0&&(this[this.t-1]|=(1<<this.DB-h)-1<<h)),this.clamp(),m&&t.ZERO.subTo(this,this)}function C(){for(var i=this.s&this.DM;this.t>0&&this[this.t-1]==i;)--this.t}function O(i){if(this.s<0)return"-"+this.negate().toString(i);var s;if(i==16)s=4;else if(i==8)s=3;else if(i==2)s=1;else if(i==32)s=5;else if(i==4)s=2;else return this.toRadix(i);var o=(1<<s)-1,u,m=!1,h="",d=this.t,v=this.DB-d*this.DB%s;if(d-- >0)for(v<this.DB&&(u=this[d]>>v)>0&&(m=!0,h=P(u));d>=0;)v<s?(u=(this[d]&(1<<v)-1)<<s-v,u|=this[--d]>>(v+=this.DB-s)):(u=this[d]>>(v-=s)&o,v<=0&&(v+=this.DB,--d)),u>0&&(m=!0),m&&(h+=P(u));return m?h:"0"}function A(){var i=a();return t.ZERO.subTo(this,i),i}function ce(){return this.s<0?this.negate():this}function ye(i){var s=this.s-i.s;if(s!=0)return s;var o=this.t;if(s=o-i.t,s!=0)return this.s<0?-s:s;for(;--o>=0;)if((s=this[o]-i[o])!=0)return s;return 0}function pe(i){var s=1,o;return(o=i>>>16)!=0&&(i=o,s+=16),(o=i>>8)!=0&&(i=o,s+=8),(o=i>>4)!=0&&(i=o,s+=4),(o=i>>2)!=0&&(i=o,s+=2),(o=i>>1)!=0&&(i=o,s+=1),s}function Ze(){return this.t<=0?0:this.DB*(this.t-1)+pe(this[this.t-1]^this.s&this.DM)}function Qe(i,s){var o;for(o=this.t-1;o>=0;--o)s[o+i]=this[o];for(o=i-1;o>=0;--o)s[o]=0;s.t=this.t+i,s.s=this.s}function $e(i,s){for(var o=i;o<this.t;++o)s[o-i]=this[o];s.t=Math.max(this.t-i,0),s.s=this.s}function Xe(i,s){var o=i%this.DB,u=this.DB-o,m=(1<<u)-1,h=Math.floor(i/this.DB),d=this.s<<o&this.DM,v;for(v=this.t-1;v>=0;--v)s[v+h+1]=this[v]>>u|d,d=(this[v]&m)<<o;for(v=h-1;v>=0;--v)s[v]=0;s[h]=d,s.t=this.t+h+1,s.s=this.s,s.clamp()}function $r(i,s){s.s=this.s;var o=Math.floor(i/this.DB);if(o>=this.t){s.t=0;return}var u=i%this.DB,m=this.DB-u,h=(1<<u)-1;s[0]=this[o]>>u;for(var d=o+1;d<this.t;++d)s[d-o-1]|=(this[d]&h)<<m,s[d-o]=this[d]>>u;u>0&&(s[this.t-o-1]|=(this.s&h)<<m),s.t=this.t-o,s.clamp()}function Xr(i,s){for(var o=0,u=0,m=Math.min(i.t,this.t);o<m;)u+=this[o]-i[o],s[o++]=u&this.DM,u>>=this.DB;if(i.t<this.t){for(u-=i.s;o<this.t;)u+=this[o],s[o++]=u&this.DM,u>>=this.DB;u+=this.s}else{for(u+=this.s;o<i.t;)u-=i[o],s[o++]=u&this.DM,u>>=this.DB;u-=i.s}s.s=u<0?-1:0,u<-1?s[o++]=this.DV+u:u>0&&(s[o++]=u),s.t=o,s.clamp()}function Yr(i,s){var o=this.abs(),u=i.abs(),m=o.t;for(s.t=m+u.t;--m>=0;)s[m]=0;for(m=0;m<u.t;++m)s[m+o.t]=o.am(0,u[m],s,m,0,o.t);s.s=0,s.clamp(),this.s!=i.s&&t.ZERO.subTo(s,s)}function ei(i){for(var s=this.abs(),o=i.t=2*s.t;--o>=0;)i[o]=0;for(o=0;o<s.t-1;++o){var u=s.am(o,s[o],i,2*o,0,1);(i[o+s.t]+=s.am(o+1,2*s[o],i,2*o+1,u,s.t-o-1))>=s.DV&&(i[o+s.t]-=s.DV,i[o+s.t+1]=1)}i.t>0&&(i[i.t-1]+=s.am(o,s[o],i,2*o,0,1)),i.s=0,i.clamp()}function ti(i,s,o){var u=i.abs();if(!(u.t<=0)){var m=this.abs();if(m.t<u.t){s!=null&&s.fromInt(0),o!=null&&this.copyTo(o);return}o==null&&(o=a());var h=a(),d=this.s,v=i.s,R=this.DB-pe(u[u.t-1]);R>0?(u.lShiftTo(R,h),m.lShiftTo(R,o)):(u.copyTo(h),m.copyTo(o));var L=h.t,W=h[L-1];if(W!=0){var G=W*(1<<this.F1)+(L>1?h[L-2]>>this.F2:0),ie=this.FV/G,Re=(1<<this.F1)/G,Q=1<<this.F2,$=o.t,ke=$-L,se=s==null?a():s;for(h.dlShiftTo(ke,se),o.compareTo(se)>=0&&(o[o.t++]=1,o.subTo(se,o)),t.ONE.dlShiftTo(L,se),se.subTo(h,h);h.t<L;)h[h.t++]=0;for(;--ke>=0;){var it=o[--$]==W?this.DM:Math.floor(o[$]*ie+(o[$-1]+Q)*Re);if((o[$]+=h.am(0,it,o,ke,0,L))<it)for(h.dlShiftTo(ke,se),o.subTo(se,o);o[$]<--it;)o.subTo(se,o)}s!=null&&(o.drShiftTo(L,s),d!=v&&t.ZERO.subTo(s,s)),o.t=L,o.clamp(),R>0&&o.rShiftTo(R,o),d<0&&t.ZERO.subTo(o,o)}}}function ri(i){var s=a();return this.abs().divRemTo(i,null,s),this.s<0&&s.compareTo(t.ZERO)>0&&i.subTo(s,s),s}function ue(i){this.m=i}function ii(i){return i.s<0||i.compareTo(this.m)>=0?i.mod(this.m):i}function ni(i){return i}function si(i){i.divRemTo(this.m,null,i)}function oi(i,s,o){i.multiplyTo(s,o),this.reduce(o)}function ai(i,s){i.squareTo(s),this.reduce(s)}ue.prototype.convert=ii,ue.prototype.revert=ni,ue.prototype.reduce=si,ue.prototype.mulTo=oi,ue.prototype.sqrTo=ai;function ci(){if(this.t<1)return 0;var i=this[0];if(!(i&1))return 0;var s=i&3;return s=s*(2-(i&15)*s)&15,s=s*(2-(i&255)*s)&255,s=s*(2-((i&65535)*s&65535))&65535,s=s*(2-i*s%this.DV)%this.DV,s>0?this.DV-s:-s}function le(i){this.m=i,this.mp=i.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<i.DB-15)-1,this.mt2=2*i.t}function ui(i){var s=a();return i.abs().dlShiftTo(this.m.t,s),s.divRemTo(this.m,null,s),i.s<0&&s.compareTo(t.ZERO)>0&&this.m.subTo(s,s),s}function li(i){var s=a();return i.copyTo(s),this.reduce(s),s}function fi(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(var s=0;s<this.m.t;++s){var o=i[s]&32767,u=o*this.mpl+((o*this.mph+(i[s]>>15)*this.mpl&this.um)<<15)&i.DM;for(o=s+this.m.t,i[o]+=this.m.am(0,u,i,s,0,this.m.t);i[o]>=i.DV;)i[o]-=i.DV,i[++o]++}i.clamp(),i.drShiftTo(this.m.t,i),i.compareTo(this.m)>=0&&i.subTo(this.m,i)}function mi(i,s){i.squareTo(s),this.reduce(s)}function hi(i,s,o){i.multiplyTo(s,o),this.reduce(o)}le.prototype.convert=ui,le.prototype.revert=li,le.prototype.reduce=fi,le.prototype.mulTo=hi,le.prototype.sqrTo=mi;function gi(){return(this.t>0?this[0]&1:this.s)==0}function pi(i,s){if(i>4294967295||i<1)return t.ONE;var o=a(),u=a(),m=s.convert(this),h=pe(i)-1;for(m.copyTo(o);--h>=0;)if(s.sqrTo(o,u),(i&1<<h)>0)s.mulTo(u,m,o);else{var d=o;o=u,u=d}return s.revert(o)}function di(i,s){var o;return i<256||s.isEven()?o=new ue(s):o=new le(s),this.exp(i,o)}t.prototype.copyTo=k,t.prototype.fromInt=M,t.prototype.fromString=V,t.prototype.clamp=C,t.prototype.dlShiftTo=Qe,t.prototype.drShiftTo=$e,t.prototype.lShiftTo=Xe,t.prototype.rShiftTo=$r,t.prototype.subTo=Xr,t.prototype.multiplyTo=Yr,t.prototype.squareTo=ei,t.prototype.divRemTo=ti,t.prototype.invDigit=ci,t.prototype.isEven=gi,t.prototype.exp=pi,t.prototype.toString=O,t.prototype.negate=A,t.prototype.abs=ce,t.prototype.compareTo=ye,t.prototype.bitLength=Ze,t.prototype.mod=ri,t.prototype.modPowInt=di,t.ZERO=F(0),t.ONE=F(1);function yi(){var i=a();return this.copyTo(i),i}function vi(){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 bi(){return this.t==0?this.s:this[0]<<24>>24}function Ii(){return this.t==0?this.s:this[0]<<16>>16}function wi(i){return Math.floor(Math.LN2*this.DB/Math.log(i))}function Ti(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Bi(i){if(i==null&&(i=10),this.signum()==0||i<2||i>36)return"0";var s=this.chunkSize(i),o=Math.pow(i,s),u=F(o),m=a(),h=a(),d="";for(this.divRemTo(u,m,h);m.signum()>0;)d=(o+h.intValue()).toString(i).substr(1)+d,m.divRemTo(u,m,h);return h.intValue().toString(i)+d}function _i(i,s){this.fromInt(0),s==null&&(s=10);for(var o=this.chunkSize(s),u=Math.pow(s,o),m=!1,h=0,d=0,v=0;v<i.length;++v){var R=x(i,v);if(R<0){i.charAt(v)=="-"&&this.signum()==0&&(m=!0);continue}d=s*d+R,++h>=o&&(this.dMultiply(u),this.dAddOffset(d,0),h=0,d=0)}h>0&&(this.dMultiply(Math.pow(s,h)),this.dAddOffset(d,0)),m&&t.ZERO.subTo(this,this)}function Si(i,s,o){if(typeof s=="number")if(i<2)this.fromInt(1);else for(this.fromNumber(i,o),this.testBit(i-1)||this.bitwiseTo(t.ONE.shiftLeft(i-1),Ye,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(s);)this.dAddOffset(2,0),this.bitLength()>i&&this.subTo(t.ONE.shiftLeft(i-1),this);else{var u=new Array,m=i&7;u.length=(i>>3)+1,s.nextBytes(u),m>0?u[0]&=(1<<m)-1:u[0]=0,this.fromString(u,256)}}function Pi(){var i=this.t,s=new Array;s[0]=this.s;var o=this.DB-i*this.DB%8,u,m=0;if(i-- >0)for(o<this.DB&&(u=this[i]>>o)!=(this.s&this.DM)>>o&&(s[m++]=u|this.s<<this.DB-o);i>=0;)o<8?(u=(this[i]&(1<<o)-1)<<8-o,u|=this[--i]>>(o+=this.DB-8)):(u=this[i]>>(o-=8)&255,o<=0&&(o+=this.DB,--i)),u&128&&(u|=-256),m==0&&(this.s&128)!=(u&128)&&++m,(m>0||u!=this.s)&&(s[m++]=u);return s}function Ei(i){return this.compareTo(i)==0}function Mi(i){return this.compareTo(i)<0?this:i}function xi(i){return this.compareTo(i)>0?this:i}function Ri(i,s,o){var u,m,h=Math.min(i.t,this.t);for(u=0;u<h;++u)o[u]=s(this[u],i[u]);if(i.t<this.t){for(m=i.s&this.DM,u=h;u<this.t;++u)o[u]=s(this[u],m);o.t=this.t}else{for(m=this.s&this.DM,u=h;u<i.t;++u)o[u]=s(m,i[u]);o.t=i.t}o.s=s(this.s,i.s),o.clamp()}function ki(i,s){return i&s}function Ci(i){var s=a();return this.bitwiseTo(i,ki,s),s}function Ye(i,s){return i|s}function Fi(i){var s=a();return this.bitwiseTo(i,Ye,s),s}function Pt(i,s){return i^s}function Oi(i){var s=a();return this.bitwiseTo(i,Pt,s),s}function Et(i,s){return i&~s}function qi(i){var s=a();return this.bitwiseTo(i,Et,s),s}function Li(){for(var i=a(),s=0;s<this.t;++s)i[s]=this.DM&~this[s];return i.t=this.t,i.s=~this.s,i}function Ui(i){var s=a();return i<0?this.rShiftTo(-i,s):this.lShiftTo(i,s),s}function Ni(i){var s=a();return i<0?this.lShiftTo(-i,s):this.rShiftTo(i,s),s}function Di(i){if(i==0)return-1;var s=0;return i&65535||(i>>=16,s+=16),i&255||(i>>=8,s+=8),i&15||(i>>=4,s+=4),i&3||(i>>=2,s+=2),i&1||++s,s}function Ai(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+Di(this[i]);return this.s<0?this.t*this.DB:-1}function Ji(i){for(var s=0;i!=0;)i&=i-1,++s;return s}function Ki(){for(var i=0,s=this.s&this.DM,o=0;o<this.t;++o)i+=Ji(this[o]^s);return i}function zi(i){var s=Math.floor(i/this.DB);return s>=this.t?this.s!=0:(this[s]&1<<i%this.DB)!=0}function Vi(i,s){var o=t.ONE.shiftLeft(i);return this.bitwiseTo(o,s,o),o}function ji(i){return this.changeBit(i,Ye)}function Hi(i){return this.changeBit(i,Et)}function Gi(i){return this.changeBit(i,Pt)}function Wi(i,s){for(var o=0,u=0,m=Math.min(i.t,this.t);o<m;)u+=this[o]+i[o],s[o++]=u&this.DM,u>>=this.DB;if(i.t<this.t){for(u+=i.s;o<this.t;)u+=this[o],s[o++]=u&this.DM,u>>=this.DB;u+=this.s}else{for(u+=this.s;o<i.t;)u+=i[o],s[o++]=u&this.DM,u>>=this.DB;u+=i.s}s.s=u<0?-1:0,u>0?s[o++]=u:u<-1&&(s[o++]=this.DV+u),s.t=o,s.clamp()}function Zi(i){var s=a();return this.addTo(i,s),s}function Qi(i){var s=a();return this.subTo(i,s),s}function $i(i){var s=a();return this.multiplyTo(i,s),s}function Xi(){var i=a();return this.squareTo(i),i}function Yi(i){var s=a();return this.divRemTo(i,s,null),s}function en(i){var s=a();return this.divRemTo(i,null,s),s}function tn(i){var s=a(),o=a();return this.divRemTo(i,s,o),new Array(s,o)}function rn(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp()}function nn(i,s){if(i!=0){for(;this.t<=s;)this[this.t++]=0;for(this[s]+=i;this[s]>=this.DV;)this[s]-=this.DV,++s>=this.t&&(this[this.t++]=0),++this[s]}}function ve(){}function Mt(i){return i}function sn(i,s,o){i.multiplyTo(s,o)}function on(i,s){i.squareTo(s)}ve.prototype.convert=Mt,ve.prototype.revert=Mt,ve.prototype.mulTo=sn,ve.prototype.sqrTo=on;function an(i){return this.exp(i,new ve)}function cn(i,s,o){var u=Math.min(this.t+i.t,s);for(o.s=0,o.t=u;u>0;)o[--u]=0;var m;for(m=o.t-this.t;u<m;++u)o[u+this.t]=this.am(0,i[u],o,u,0,this.t);for(m=Math.min(i.t,s);u<m;++u)this.am(0,i[u],o,u,0,s-u);o.clamp()}function un(i,s,o){--s;var u=o.t=this.t+i.t-s;for(o.s=0;--u>=0;)o[u]=0;for(u=Math.max(s-this.t,0);u<i.t;++u)o[this.t+u-s]=this.am(s-u,i[u],o,0,0,this.t+u-s);o.clamp(),o.drShiftTo(1,o)}function fe(i){this.r2=a(),this.q3=a(),t.ONE.dlShiftTo(2*i.t,this.r2),this.mu=this.r2.divide(i),this.m=i}function ln(i){if(i.s<0||i.t>2*this.m.t)return i.mod(this.m);if(i.compareTo(this.m)<0)return i;var s=a();return i.copyTo(s),this.reduce(s),s}function fn(i){return i}function mn(i){for(i.drShiftTo(this.m.t-1,this.r2),i.t>this.m.t+1&&(i.t=this.m.t+1,i.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);i.compareTo(this.r2)<0;)i.dAddOffset(1,this.m.t+1);for(i.subTo(this.r2,i);i.compareTo(this.m)>=0;)i.subTo(this.m,i)}function hn(i,s){i.squareTo(s),this.reduce(s)}function gn(i,s,o){i.multiplyTo(s,o),this.reduce(o)}fe.prototype.convert=ln,fe.prototype.revert=fn,fe.prototype.reduce=mn,fe.prototype.mulTo=gn,fe.prototype.sqrTo=hn;function pn(i,s){var o=i.bitLength(),u,m=F(1),h;if(o<=0)return m;o<18?u=1:o<48?u=3:o<144?u=4:o<768?u=5:u=6,o<8?h=new ue(s):s.isEven()?h=new fe(s):h=new le(s);var d=new Array,v=3,R=u-1,L=(1<<u)-1;if(d[1]=h.convert(this),u>1){var W=a();for(h.sqrTo(d[1],W);v<=L;)d[v]=a(),h.mulTo(W,d[v-2],d[v]),v+=2}var G=i.t-1,ie,Re=!0,Q=a(),$;for(o=pe(i[G])-1;G>=0;){for(o>=R?ie=i[G]>>o-R&L:(ie=(i[G]&(1<<o+1)-1)<<R-o,G>0&&(ie|=i[G-1]>>this.DB+o-R)),v=u;!(ie&1);)ie>>=1,--v;if((o-=v)<0&&(o+=this.DB,--G),Re)d[ie].copyTo(m),Re=!1;else{for(;v>1;)h.sqrTo(m,Q),h.sqrTo(Q,m),v-=2;v>0?h.sqrTo(m,Q):($=m,m=Q,Q=$),h.mulTo(Q,d[ie],m)}for(;G>=0&&!(i[G]&1<<o);)h.sqrTo(m,Q),$=m,m=Q,Q=$,--o<0&&(o=this.DB-1,--G)}return h.revert(m)}function dn(i){var s=this.s<0?this.negate():this.clone(),o=i.s<0?i.negate():i.clone();if(s.compareTo(o)<0){var u=s;s=o,o=u}var m=s.getLowestSetBit(),h=o.getLowestSetBit();if(h<0)return s;for(m<h&&(h=m),h>0&&(s.rShiftTo(h,s),o.rShiftTo(h,o));s.signum()>0;)(m=s.getLowestSetBit())>0&&s.rShiftTo(m,s),(m=o.getLowestSetBit())>0&&o.rShiftTo(m,o),s.compareTo(o)>=0?(s.subTo(o,s),s.rShiftTo(1,s)):(o.subTo(s,o),o.rShiftTo(1,o));return h>0&&o.lShiftTo(h,o),o}function yn(i){if(i<=0)return 0;var s=this.DV%i,o=this.s<0?i-1:0;if(this.t>0)if(s==0)o=this[0]%i;else for(var u=this.t-1;u>=0;--u)o=(s*o+this[u])%i;return o}function vn(i){var s=i.isEven();if(this.isEven()&&s||i.signum()==0)return t.ZERO;for(var o=i.clone(),u=this.clone(),m=F(1),h=F(0),d=F(0),v=F(1);o.signum()!=0;){for(;o.isEven();)o.rShiftTo(1,o),s?((!m.isEven()||!h.isEven())&&(m.addTo(this,m),h.subTo(i,h)),m.rShiftTo(1,m)):h.isEven()||h.subTo(i,h),h.rShiftTo(1,h);for(;u.isEven();)u.rShiftTo(1,u),s?((!d.isEven()||!v.isEven())&&(d.addTo(this,d),v.subTo(i,v)),d.rShiftTo(1,d)):v.isEven()||v.subTo(i,v),v.rShiftTo(1,v);o.compareTo(u)>=0?(o.subTo(u,o),s&&m.subTo(d,m),h.subTo(v,h)):(u.subTo(o,u),s&&d.subTo(m,d),v.subTo(h,v))}if(u.compareTo(t.ONE)!=0)return t.ZERO;if(v.compareTo(i)>=0)return v.subtract(i);if(v.signum()<0)v.addTo(i,v);else return v;return v.signum()<0?v.add(i):v}var J=[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],bn=(1<<26)/J[J.length-1];function In(i){var s,o=this.abs();if(o.t==1&&o[0]<=J[J.length-1]){for(s=0;s<J.length;++s)if(o[0]==J[s])return!0;return!1}if(o.isEven())return!1;for(s=1;s<J.length;){for(var u=J[s],m=s+1;m<J.length&&u<bn;)u*=J[m++];for(u=o.modInt(u);s<m;)if(u%J[s++]==0)return!1}return o.millerRabin(i)}function wn(i){var s=this.subtract(t.ONE),o=s.getLowestSetBit();if(o<=0)return!1;var u=s.shiftRight(o);i=i+1>>1,i>J.length&&(i=J.length);for(var m=a(),h=0;h<i;++h){m.fromInt(J[Math.floor(Math.random()*J.length)]);var d=m.modPow(u,this);if(d.compareTo(t.ONE)!=0&&d.compareTo(s)!=0){for(var v=1;v++<o&&d.compareTo(s)!=0;)if(d=d.modPowInt(2,this),d.compareTo(t.ONE)==0)return!1;if(d.compareTo(s)!=0)return!1}}return!0}t.prototype.chunkSize=wi,t.prototype.toRadix=Bi,t.prototype.fromRadix=_i,t.prototype.fromNumber=Si,t.prototype.bitwiseTo=Ri,t.prototype.changeBit=Vi,t.prototype.addTo=Wi,t.prototype.dMultiply=rn,t.prototype.dAddOffset=nn,t.prototype.multiplyLowerTo=cn,t.prototype.multiplyUpperTo=un,t.prototype.modInt=yn,t.prototype.millerRabin=wn,t.prototype.clone=yi,t.prototype.intValue=vi,t.prototype.byteValue=bi,t.prototype.shortValue=Ii,t.prototype.signum=Ti,t.prototype.toByteArray=Pi,t.prototype.equals=Ei,t.prototype.min=Mi,t.prototype.max=xi,t.prototype.and=Ci,t.prototype.or=Fi,t.prototype.xor=Oi,t.prototype.andNot=qi,t.prototype.not=Li,t.prototype.shiftLeft=Ui,t.prototype.shiftRight=Ni,t.prototype.getLowestSetBit=Ai,t.prototype.bitCount=Ki,t.prototype.testBit=zi,t.prototype.setBit=ji,t.prototype.clearBit=Hi,t.prototype.flipBit=Gi,t.prototype.add=Zi,t.prototype.subtract=Qi,t.prototype.multiply=$i,t.prototype.divide=Yi,t.prototype.remainder=en,t.prototype.divideAndRemainder=tn,t.prototype.modPow=pn,t.prototype.modInverse=vn,t.prototype.pow=an,t.prototype.gcd=dn,t.prototype.isProbablePrime=In,t.prototype.square=Xi,t.prototype.Barrett=fe;var xe,H,q;function Tn(i){H[q++]^=i&255,H[q++]^=i>>8&255,H[q++]^=i>>16&255,H[q++]^=i>>24&255,q>=rt&&(q-=rt)}function xt(){Tn(new Date().getTime())}if(H==null){H=new Array,q=0;var Z;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Rt=new Uint8Array(32);for(window.crypto.getRandomValues(Rt),Z=0;Z<32;++Z)H[q++]=Rt[Z]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var kt=window.crypto.random(32);for(Z=0;Z<kt.length;++Z)H[q++]=kt.charCodeAt(Z)&255}}for(;q<rt;)Z=Math.floor(65536*Math.random()),H[q++]=Z>>>8,H[q++]=Z&255;q=0,xt()}function Bn(){if(xe==null){for(xt(),xe=En(),xe.init(H),q=0;q<H.length;++q)H[q]=0;q=0}return xe.next()}function _n(i){var s;for(s=0;s<i.length;++s)i[s]=Bn()}function et(){}et.prototype.nextBytes=_n;function tt(){this.i=0,this.j=0,this.S=new Array}function Sn(i){var s,o,u;for(s=0;s<256;++s)this.S[s]=s;for(o=0,s=0;s<256;++s)o=o+this.S[s]+i[s%i.length]&255,u=this.S[s],this.S[s]=this.S[o],this.S[o]=u;this.i=0,this.j=0}function Pn(){var i;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,i=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=i,this.S[i+this.S[this.i]&255]}tt.prototype.init=Sn,tt.prototype.next=Pn;function En(){return new tt}var rt=256;typeof Fe!="undefined"?Fe=Vt.exports={default:t,BigInteger:t,SecureRandom:et}:this.jsbn={BigInteger:t,SecureRandom:et}}).call(Fe)});var tr={};st(tr,{SM2:()=>Vn,SM3:()=>zn,SM4:()=>Hn});function K(n,e){this.x=e,this.q=n}function j(n,e,r,t){this.curve=n,this.x=e,this.y=r,this.z=t==null?E.BigInteger.ONE:t,this.zinv=null}function te(n,e,r){this.q=n,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(r),this.infinity=new j(this,null,null),this.reducer=new Nn(this.q)}function Zt(n,e){for(var r=[],t=Math.ceil(e/32),a=e%32,l=1;l<=t;l++){var c=S.Buffer.allocUnsafe(4);c.writeUInt32BE(l);var f=Ae(S.Buffer.concat([n,c]));r.push(l===t&&a?S.Buffer.from(f).slice(0,a):S.Buffer.from(f))}return S.Buffer.concat(r,e)}var de,S,E,Nn,U,ee,Dn,An,Jn,Kn,Ae,zn,Ht,ct,Gt,Wt,Oe,Vn,qe,Le,jn,Ue,Xt,Yt,er,Qt,$t,Ne,De,Hn,rr=N(()=>{"use strict";de=me(zt()),S=require("buffer"),E=me(jt()),Nn=E.BigInteger.prototype.Barrett;K.prototype.equals=function(n){return n==this||this.q.equals(n.q)&&this.x.equals(n.x)},K.prototype.toBigInteger=function(){return this.x},K.prototype.negate=function(){return new K(this.q,this.x.negate().mod(this.q))},K.prototype.add=function(n){return new K(this.q,this.x.add(n.toBigInteger()).mod(this.q))},K.prototype.subtract=function(n){return new K(this.q,this.x.subtract(n.toBigInteger()).mod(this.q))},K.prototype.multiply=function(n){return new K(this.q,this.x.multiply(n.toBigInteger()).mod(this.q))},K.prototype.square=function(){return new K(this.q,this.x.square().mod(this.q))},K.prototype.divide=function(n){return new K(this.q,this.x.multiply(n.toBigInteger().modInverse(this.q)).mod(this.q))},j.prototype.getX=function(){this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q));var n=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(n),this.curve.fromBigInteger(n)},j.prototype.getY=function(){this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q));var n=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(n),this.curve.fromBigInteger(n)},j.prototype.equals=function(n){return n==this||(this.isInfinity()?n.isInfinity():n.isInfinity()?this.isInfinity():!!n.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(n.z)).mod(this.curve.q).equals(E.BigInteger.ZERO)&&n.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(n.z)).mod(this.curve.q).equals(E.BigInteger.ZERO))},j.prototype.isInfinity=function(){return this.x==null&&this.y==null||this.z.equals(E.BigInteger.ZERO)&&!this.y.toBigInteger().equals(E.BigInteger.ZERO)},j.prototype.negate=function(){return new j(this.curve,this.x,this.y.negate(),this.z)},j.prototype.add=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;var e=n.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(n.z)).mod(this.curve.q),r=n.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(n.z)).mod(this.curve.q);if(E.BigInteger.ZERO.equals(r))return E.BigInteger.ZERO.equals(e)?this.twice():this.curve.getInfinity();var t=new E.BigInteger("3"),a=this.x.toBigInteger(),l=this.y.toBigInteger(),c=(n.x.toBigInteger(),n.y.toBigInteger(),r.square()),f=c.multiply(r),y=a.multiply(c),g=e.square().multiply(this.z),B=g.subtract(y.shiftLeft(1)).multiply(n.z).subtract(f).multiply(r).mod(this.curve.q),w=y.multiply(t).multiply(e).subtract(l.multiply(f)).subtract(g.multiply(e)).multiply(n.z).add(e.multiply(f)).mod(this.curve.q),_=f.multiply(this.z).multiply(n.z).mod(this.curve.q);return new j(this.curve,this.curve.fromBigInteger(B),this.curve.fromBigInteger(w),_)},j.prototype.twice=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var n=new E.BigInteger("3"),e=this.x.toBigInteger(),r=this.y.toBigInteger(),t=r.multiply(this.z),a=t.multiply(r).mod(this.curve.q),l=this.curve.a.toBigInteger(),c=e.square().multiply(n);E.BigInteger.ZERO.equals(l)||(c=c.add(this.z.square().multiply(l)));var f=(c=c.mod(this.curve.q)).square().subtract(e.shiftLeft(3).multiply(a)).shiftLeft(1).multiply(t).mod(this.curve.q),y=c.multiply(n).multiply(e).subtract(a.shiftLeft(1)).shiftLeft(2).multiply(a).subtract(c.square().multiply(c)).mod(this.curve.q),g=t.square().multiply(t).shiftLeft(3).mod(this.curve.q);return new j(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(y),g)},j.prototype.multiply=function(n){if(this.isInfinity())return this;if(n.signum()==0)return this.curve.getInfinity();var e,r=n,t=r.multiply(new E.BigInteger("3")),a=this.negate(),l=this;for(e=t.bitLength()-2;e>0;--e){l=l.twice();var c=t.testBit(e);c!=r.testBit(e)&&(l=l.add(c?this:a))}return l},j.prototype.multiplyTwo=function(n,e,r){var t;t=n.bitLength()>r.bitLength()?n.bitLength()-1:r.bitLength()-1;for(var a=this.curve.getInfinity(),l=this.add(e);t>=0;)a=a.twice(),n.testBit(t)?a=r.testBit(t)?a.add(l):a.add(this):r.testBit(t)&&(a=a.add(e)),--t;return a},te.prototype.getQ=function(){return this.q},te.prototype.getA=function(){return this.a},te.prototype.getB=function(){return this.b},te.prototype.equals=function(n){return n==this||this.q.equals(n.q)&&this.a.equals(n.a)&&this.b.equals(n.b)},te.prototype.getInfinity=function(){return this.infinity},te.prototype.fromBigInteger=function(n){return new K(this.q,n)},te.prototype.reduce=function(n){this.reducer.reduce(n)},te.prototype.decodePointHex=function(n){switch(parseInt(n.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(n.length-2)/2,r=n.substr(2,e),t=n.substr(e+2,e);return new j(this,this.fromBigInteger(new E.BigInteger(r,16)),this.fromBigInteger(new E.BigInteger(t,16)));default:return null}},te.prototype.encodePointHex=function(n){if(n.isInfinity())return"00";var e=n.getX().toBigInteger().toString(16),r=n.getY().toBigInteger().toString(16),t=this.getQ().toString(16).length;for(t%2!=0&&t++;e.length<t;)e="0"+e;for(;r.length<t;)r="0"+r;return"04"+e+r};U=function(n,e){return n<<(e%=32)|n>>>32-e},ee=function(n,e){var r=e-n.length;return(r>0?"0".repeat(r):"")+n},Dn=function(n){return n<16?2043430169:2055708042},An=function(n,e,r,t){return t<16?n^e^r:n&e|n&r|e&r},Jn=function(n,e,r,t){return t<16?n^e^r:n&e|~n&r},Kn=function(n,e,r){for(var t,a,l,c,f,y=function(F){var V,C=new Array(132);F.forEach(function(ce,ye){C[ye]=ce});for(var O=16;O<68;O++)C[O]=(V=C[O-16]^C[O-9]^U(C[O-3],15))^U(V,15)^U(V,23)^U(C[O-13],7)^C[O-6];for(var A=0;A<64;A++)C[A+68]=C[A]^C[A+4];return C}(e),g=n[0],B=n[1],w=n[2],_=n[3],I=n[4],P=n[5],x=n[6],k=n[7],M=0;M<64;M++)a=(t=U(U(g,12)+I+U(Dn(M),M),7))^U(g,12),l=An(g,B,w,M)+_+a+y[M+68],c=Jn(I,P,x,M)+k+t+y[M],_=w,w=U(B,9),B=g,g=l,k=x,x=U(P,19),P=I,I=(f=c)^U(f,9)^U(f,17);return[g^n[0],B^n[1],w^n[2],_^n[3],I^n[4],P^n[5],x^n[6],k^n[7]]},Ae=function(n,e,r){if(typeof n=="string"?n=S.Buffer.from(n,e||"utf8"):n instanceof ArrayBuffer&&(n=S.Buffer.from(n)),!S.Buffer.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');var t,a,l,c,f,y;t=n,a=S.Buffer.alloc(1,128),c=S.Buffer.alloc(l=(l=t.length%64)>=56?64-l%56-1:56-l-1,0),f=S.Buffer.alloc(8),y=8*t.length,f.writeUInt32BE(Math.floor(y/Math.pow(2,32)),0),f.writeUInt32BE(y%Math.pow(2,32),4);for(var g=(n=S.Buffer.concat([t,a,c,f],t.length+1+l+8)).length/64,B=new Array(g),w=0;w<g;w++){B[w]=new Array(16);for(var _=0;_<16;_++)B[w][_]=n.readUInt32BE(64*w+4*_)}var I=new Array(g);I[0]=[1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214];for(var P=0;P<g;P++)I[P+1]=Kn(I[P],B[P]);var x=S.Buffer.alloc(32);return I[g].forEach(function(k,M){return x.writeInt32BE(k,4*M)}),r?x.toString(r):(0,de.default)(x)},zn={__proto__:null,digest:Ae},Ht=new E.SecureRandom,ct=function(){var n=new te(new E.BigInteger("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),new E.BigInteger("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),new E.BigInteger("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16)),e=n.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:n,G:e,n:new E.BigInteger("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}(),Gt=ct.curve,Wt=ct.G,Oe=ct.n;Vn={__proto__:null,constants:{C1C2C3:0,C1C3C2:1,PC:"04"},generateKeyPair:function(){var n=new E.BigInteger(Oe.bitLength(),Ht).mod(Oe.subtract(new E.BigInteger("2"))).add(E.BigInteger.ONE),e=ee(n.toString(16),64),r=Wt.multiply(n);return{privateKey:e,publicKey:"04"+ee(r.getX().toBigInteger().toString(16),64)+ee(r.getY().toBigInteger().toString(16),64)}},encrypt:function(n,e,r){var t=r||{},a=t.mode,l=a===void 0?1:a,c=t.outputEncoding,f=t.pc;if(typeof n=="string"?n=S.Buffer.from(n,t.inputEncoding||"utf8"):n instanceof ArrayBuffer&&(n=S.Buffer.from(n)),!S.Buffer.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');var y=new E.BigInteger(Oe.bitLength(),Ht).mod(Oe.subtract(E.BigInteger.ONE)).add(E.BigInteger.ONE),g=Wt.multiply(y),B=ee(g.getX().toBigInteger().toString(16),64)+ee(g.getY().toBigInteger().toString(16),64),w=Gt.decodePointHex(e).multiply(y),_=ee(w.getX().toBigInteger().toString(16),64),I=ee(w.getY().toBigInteger().toString(16),64),P=Zt(S.Buffer.from(_+I,"hex"),n.length),x=ee(new E.BigInteger(n.toString("hex"),16).xor(new E.BigInteger(P.toString("hex"),16)).toString(16),2*n.length),k=Ae(_+n.toString("hex")+I,"hex","hex"),M=S.Buffer.from((f?"04":"")+(l===0?B+x+k:B+k+x),"hex");return c?M.toString(c):(0,de.default)(M)},decrypt:function(n,e,r){var t=r||{},a=t.mode,l=a===void 0?1:a,c=t.outputEncoding,f=t.pc;if(typeof n=="string"?n=S.Buffer.from(n,t.inputEncoding):n instanceof ArrayBuffer&&(n=S.Buffer.from(n)),!S.Buffer.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');var y=(n=f?n.slice(1):n).slice(0,32).toString("hex"),g=n.slice(32,64).toString("hex"),B=Gt.decodePointHex("04"+y+g).multiply(new E.BigInteger(e,16)),w=ee(B.getX().toBigInteger().toString(16),64),_=ee(B.getY().toBigInteger().toString(16),64),I=n.slice(64,96),P=n.slice(96);l===0&&(I=n.slice(n.length-32),P=n.slice(64,n.length-32));var x=Zt(S.Buffer.from(w+_,"hex"),P.length),k=new E.BigInteger(P.toString("hex"),16).xor(new E.BigInteger(x.toString("hex"),16)).toString(16),M=Ae(w+k+_,"hex","hex")===I.toString("hex")?S.Buffer.from(k,"hex"):S.Buffer.alloc(0);return c?M.toString(c):(0,de.default)(M)}},qe=[[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5],[43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153],[156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98],[228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166],[71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168],[104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53],[30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135],[212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158],[234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161],[224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227],[29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111],[213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81],[141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216],[10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176],[137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132],[24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72]],Le=[2746333894,1453994832,1736282519,2993693404],jn=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257],Ue=/^[0-9a-f]{32}$/i,Xt=function(n){return qe[(4026531840&n)>>>28][(251658240&n)>>>24]<<24|qe[(15728640&n)>>>20][(983040&n)>>>16]<<16|qe[(61440&n)>>>12][(3840&n)>>>8]<<8|qe[(240&n)>>>4][(15&n)>>>0]<<0},Yt=function(n){return(e=Xt(n))^U(e,2)^U(e,10)^U(e,18)^U(e,24);var e},er=function(n){var e,r=new Array(36);r[0]=n[0]^Le[0],r[1]=n[1]^Le[1],r[2]=n[2]^Le[2],r[3]=n[3]^Le[3];for(var t=new Array(32),a=0;a<32;a++)r[a+4]=r[a]^(e=Xt(r[a+1]^r[a+2]^r[a+3]^jn[a]))^U(e,13)^U(e,23),t[a]=r[a+4];return t},Qt=function(n,e){for(var r=er(e),t=0;t<32;t++)n[t+4]=n[t]^Yt(n[t+1]^n[t+2]^n[t+3]^r[t]);return[n[35],n[34],n[33],n[32]]},$t=function(n,e){for(var r=er(e).reverse(),t=0;t<32;t++)n[t+4]=n[t]^Yt(n[t+1]^n[t+2]^n[t+3]^r[t]);return[n[35],n[34],n[33],n[32]]},Ne=function(n){return[n.readInt32BE(0),n.readInt32BE(4),n.readInt32BE(8),n.readInt32BE(12)]},De=function(n){for(var e=S.Buffer.alloc(16),r=0;r<4;r++)e.writeInt32BE(n[r],4*r);return e},Hn={__proto__:null,constants:{ECB:1,CBC:2},encrypt:function(n,e,r){var t=r||{},a=t.mode,l=t.iv,c=t.outputEncoding;if(typeof n=="string"?n=S.Buffer.from(n,t.inputEncoding||"utf8"):n instanceof ArrayBuffer&&(n=S.Buffer.from(n)),!S.Buffer.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');if(!Ue.test(e))throw new TypeError("Invalid value of cipher `key`");if(e=S.Buffer.from(e,"hex"),a===2&&!Ue.test(l))throw new TypeError("Invalid value of `iv` option");return function(f,y,g,B){g&&(g=Ne(g)),y=Ne(y);for(var w=[],_=(f=function(O){var A=16-O.length%16,ce=S.Buffer.alloc(A,A);return S.Buffer.concat([O,ce],O.length+A)}(f)).length/16,I=0;I<_;I++)if(g){var P=16*I,x=[g[0]^f.readInt32BE(P),g[1]^f.readInt32BE(P+4),g[2]^f.readInt32BE(P+8),g[3]^f.readInt32BE(P+12)],k=Qt(x,y);w.push(De(k)),g=k.slice(0)}else{var M=16*I,F=[f.readInt32BE(M),f.readInt32BE(M+4),f.readInt32BE(M+8),f.readInt32BE(M+12)],V=Qt(F,y);w.push(De(V))}var C=S.Buffer.concat(w,f.length);return B?C.toString(B):(0,de.default)(C)}(n,e,l=a===2?S.Buffer.from(l,"hex"):null,c)},decrypt:function(n,e,r){var t=r||{},a=t.mode,l=t.iv,c=t.outputEncoding;if(typeof n=="string"?n=S.Buffer.from(n,t.inputEncoding):n instanceof ArrayBuffer&&(n=S.Buffer.from(n)),!S.Buffer.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');if(!Ue.test(e))throw new TypeError("Invalid value of cipher `key`");if(e=S.Buffer.from(e,"hex"),a===2&&!Ue.test(l))throw new TypeError("Invalid value of `iv` option");return function(f,y,g,B){g&&(g=Ne(g)),y=Ne(y);var w=[],_=f.length/16;if(g)for(var I=_-1;I>=0;I--){var P,x=16*I;P=I>0?[f.readInt32BE(x-16),f.readInt32BE(x-16+4),f.readInt32BE(x-16+8),f.readInt32BE(x-16+12)]:g;var k=[f.readInt32BE(x),f.readInt32BE(x+4),f.readInt32BE(x+8),f.readInt32BE(x+12)],M=$t(k,y);w.unshift(De([M[0]^P[0],M[1]^P[1],M[2]^P[2],M[3]^P[3]]))}else for(var F=0;F<_;F++){var V=16*F,C=[f.readInt32BE(V),f.readInt32BE(V+4),f.readInt32BE(V+8),f.readInt32BE(V+12)],O=$t(C,y);w.push(De(O))}var A=S.Buffer.concat(w,f.length-w[w.length-1][15]);return B?A.toString(B):(0,de.default)(A)}(n,e,l=a===2?S.Buffer.from(l,"hex"):null,c)}}});function _e(){return Je>Ke.length-16&&(ir.default.randomFillSync(Ke),Je=0),Ke.slice(Je,Je+=16)}var ir,Ke,Je,ut=N(()=>{"use strict";ir=me(require("crypto")),Ke=new Uint8Array(256),Je=Ke.length});var nr,sr=N(()=>{"use strict";nr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function Gn(n){return typeof n=="string"&&nr.test(n)}var oe,Se=N(()=>{"use strict";sr();oe=Gn});function he(n,e=0){return D[n[e+0]]+D[n[e+1]]+D[n[e+2]]+D[n[e+3]]+"-"+D[n[e+4]]+D[n[e+5]]+"-"+D[n[e+6]]+D[n[e+7]]+"-"+D[n[e+8]]+D[n[e+9]]+"-"+D[n[e+10]]+D[n[e+11]]+D[n[e+12]]+D[n[e+13]]+D[n[e+14]]+D[n[e+15]]}function Wn(n,e=0){let r=he(n,e);if(!oe(r))throw TypeError("Stringified UUID is invalid");return r}var D,or,Pe=N(()=>{"use strict";Se();D=[];for(let n=0;n<256;++n)D.push((n+256).toString(16).slice(1));or=Wn});function Zn(n,e,r){let t=e&&r||0,a=e||new Array(16);n=n||{};let l=n.node||ar,c=n.clockseq!==void 0?n.clockseq:lt;if(l==null||c==null){let _=n.random||(n.rng||_e)();l==null&&(l=ar=[_[0]|1,_[1],_[2],_[3],_[4],_[5]]),c==null&&(c=lt=(_[6]<<8|_[7])&16383)}let f=n.msecs!==void 0?n.msecs:Date.now(),y=n.nsecs!==void 0?n.nsecs:mt+1,g=f-ft+(y-mt)/1e4;if(g<0&&n.clockseq===void 0&&(c=c+1&16383),(g<0||f>ft)&&n.nsecs===void 0&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ft=f,mt=y,lt=c,f+=122192928e5;let B=((f&268435455)*1e4+y)%4294967296;a[t++]=B>>>24&255,a[t++]=B>>>16&255,a[t++]=B>>>8&255,a[t++]=B&255;let w=f/4294967296*1e4&268435455;a[t++]=w>>>8&255,a[t++]=w&255,a[t++]=w>>>24&15|16,a[t++]=w>>>16&255,a[t++]=c>>>8|128,a[t++]=c&255;for(let _=0;_<6;++_)a[t+_]=l[_];return e||he(a)}var ar,lt,ft,mt,cr,ur=N(()=>{"use strict";ut();Pe();ft=0,mt=0;cr=Zn});function Qn(n){if(!oe(n))throw TypeError("Invalid UUID");let e,r=new Uint8Array(16);return r[0]=(e=parseInt(n.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(n.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(n.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(n.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}var ze,ht=N(()=>{"use strict";Se();ze=Qn});function $n(n){n=unescape(encodeURIComponent(n));let e=[];for(let r=0;r<n.length;++r)e.push(n.charCodeAt(r));return e}function Ee(n,e,r){function t(a,l,c,f){var y;if(typeof a=="string"&&(a=$n(a)),typeof l=="string"&&(l=ze(l)),((y=l)===null||y===void 0?void 0:y.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let g=new Uint8Array(16+a.length);if(g.set(l),g.set(a,l.length),g=r(g),g[6]=g[6]&15|e,g[8]=g[8]&63|128,c){f=f||0;for(let B=0;B<16;++B)c[f+B]=g[B];return c}return he(g)}try{t.name=n}catch(a){}return t.DNS=Xn,t.URL=Yn,t}var Xn,Yn,gt=N(()=>{"use strict";Pe();ht();Xn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Yn="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function es(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),lr.default.createHash("md5").update(n).digest()}var lr,fr,mr=N(()=>{"use strict";lr=me(require("crypto"));fr=es});var ts,hr,gr=N(()=>{"use strict";gt();mr();ts=Ee("v3",48,fr),hr=ts});var pr,pt,dr=N(()=>{"use strict";pr=me(require("crypto")),pt={randomUUID:pr.default.randomUUID}});function rs(n,e,r){if(pt.randomUUID&&!e&&!n)return pt.randomUUID();n=n||{};let t=n.random||(n.rng||_e)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,e){r=r||0;for(let a=0;a<16;++a)e[r+a]=t[a];return e}return he(t)}var yr,vr=N(()=>{"use strict";dr();ut();Pe();yr=rs});function is(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),br.default.createHash("sha1").update(n).digest()}var br,Ir,wr=N(()=>{"use strict";br=me(require("crypto"));Ir=is});var ns,Tr,Br=N(()=>{"use strict";gt();wr();ns=Ee("v5",80,Ir),Tr=ns});var _r,Sr=N(()=>{"use strict";_r="00000000-0000-0000-0000-000000000000"});function ss(n){if(!oe(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}var Pr,Er=N(()=>{"use strict";Se();Pr=ss});var Mr={};st(Mr,{NIL:()=>_r,parse:()=>ze,stringify:()=>or,v1:()=>cr,v3:()=>hr,v4:()=>yr,v5:()=>Tr,validate:()=>oe,version:()=>Pr});var xr=N(()=>{"use strict";ur();gr();vr();Br();Sr();Er();Se();Pe();ht()});var qr=nt((Io,Or)=>{"use strict";var vt=Object.defineProperty,os=Object.getOwnPropertyDescriptor,as=Object.getOwnPropertyNames,cs=Object.prototype.hasOwnProperty,us=(n,e)=>{for(var r in e)vt(n,r,{get:e[r],enumerable:!0})},ls=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of as(e))!cs.call(n,a)&&a!==r&&vt(n,a,{get:()=>e[a],enumerable:!(t=os(e,a))||t.enumerable});return n},fs=n=>ls(vt({},"__esModule",{value:!0}),n),Fr={};us(Fr,{default:()=>ys});Or.exports=fs(Fr);var ge=(rr(),ot(tr)),ms=(xr(),ot(Mr)),hs=require("buffer");function gs(n){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let t=0;t<n;t++){let a=Math.floor(Math.random()*e.length);r+=e.charAt(a)}return r}function Ve(n){return hs.Buffer.from(n).toString("hex")}var Rr="boom",kr="zdnb",Cr="20231023",ps=class{generateClientId(){return(0,ms.v4)()}setSm2KeyPair(n){this.sm2KeyPair=n}generateSm4KeyPairs(){let n=gs(16),e=ge.SM3.digest(n,"utf8","hex").slice(0,16);return console.log("clientRandom",n,e),{enKey:n,deKey:e}}encryptSm2(n){return ge.SM2.encrypt(n,this.sm2KeyPair,{inputEncoding:"utf8",mode:ge.SM2.constants.C1C2C3,outputEncoding:"base64"})}encryptSm4(n,e,r){return ge.SM4.encrypt(n,Ve(e),{mode:ge.SM4.constants.CBC,iv:Ve(r!=null?r:`${Rr}${kr}${Cr}`),inputEncoding:"utf8",outputEncoding:"hex"})}decryptSm4(n,e,r){return ge.SM4.decrypt(n,Ve(e),{mode:ge.SM4.constants.CBC,iv:Ve(r!=null?r:`${Rr}${kr}${Cr}`),inputEncoding:"hex",outputEncoding:"utf8"})}},dt="client-id",yt="pair-key",ds=class je{constructor(){if(je.instance)return je.instance;this.boomCrypto=new ps,je.instance=this}getClientId(e){let r=localStorage.getItem(dt);if(e||!r){let t=this.boomCrypto.generateClientId();localStorage.setItem(dt,t)}return localStorage.getItem(dt)}setSm2KeyPair(e){return this.boomCrypto.setSm2KeyPair(e)}getPairKey(e){let r=localStorage.getItem(yt);if(e||!r){let t=this.boomCrypto.generateSm4KeyPairs();localStorage.setItem(yt,JSON.stringify(t))}return JSON.parse(localStorage.getItem(yt))}encryptSm2(e){return this.boomCrypto.encryptSm2(e)}encryptSm4(e,r,t){return this.boomCrypto.encryptSm4(e,r,t)}decryptSm4(e,r,t){return this.boomCrypto.decryptSm4(e,r,t)}},ys=ds});var Ss={};st(Ss,{default:()=>_s});module.exports=ot(Ss);var qn={create:function(){return function(){this.init.apply(this,arguments)}}},Ln=function(n,e){for(var r in e)n[r]=e[r]},Nt="postMessage"in window,Dt=function(n,e){var r="";if(arguments.length<2?r="target error - target and name are both required":typeof n!="object"?r="target error - target itself must be window object":typeof e!="string"&&(r="target error - target name must be string type"),r)throw new Error(r);this.target=n,this.name=e};Dt.prototype.send=function(n){if(Nt)this.target.postMessage(n,"*");else{var e=window.navigator[this.name];if(typeof e=="function")e(n,window);else throw new Error("target callback function is not defined")}};var At=qn.create();At.prototype={init:function(n){this.setOption(n),this.name=this.options.name,this.targets=this.options.targets,this.listenFunc=this.options.listenFunc,this.initListen()},setOption:function(n){this.options={name:"message",targets:{},listenFunc:[]},Ln(this.options,n||{})},initListen:function(){var n=this,e=function(r){typeof r=="object"&&r.data&&(r=r.data);for(var t=0;t<n.listenFunc.length;t++)n.listenFunc[t](r)};Nt?window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent("onmessage",e):window.navigator[this.name]=e},addTarget:function(n,e){var r=new Dt(n,this.name);this.targets[e]=r},listen:function(n){this.listenFunc.push(n)},clear:function(){this.listenFunc=[]},send:function(n){for(var e in this.targets)this.targets.hasOwnProperty(e)&&this.targets[e].send(n)}};var Jt=At;var T=class{static error(e,r){return{code:e,message:r}}static succ(e="succ"){return{code:200,message:e}}static notInitIframe(){return{code:201,message:"iframe not init"}}};var X,Ie=new Map,we=1,Te,at,b=class{static createMeassage(e,r){Te=e,at=r,X||(X=new Jt,X.addTarget(e.contentWindow,"iframe"))}static addListener(){X.clear(),X.listen(e=>{if(typeof e=="string"){let r;try{r=JSON.parse(e),r&&r.type==="request"?this.getRequest(r):r&&r.type==="response"&&this.getResponse(r)}catch(t){console.log("addListener error",t)}}})}static request(e,r=null){let t={};t.id=we,t.type="request",t.name=e,r&&(t.data=r);let a=JSON.stringify(t);if(!X){console.log("request: message is destroy");return}X.targets.iframe&&X.targets.iframe.send(a),we++}static getRequest(e){this.assembleResponse(e)}static assembleResponse(e){let r={},t=e.id,a=e.type;if(a==="request"&&e.name){r.id=t,r.name=e.name,r.type="response";let l=new CustomEvent(e.name,{detail:e.data}),c=X.targets.iframe;if(!c){document.dispatchEvent(l);return}switch(e.name){case"participant-joined":c.send(JSON.stringify(r));break;case"room-events":c.send(JSON.stringify(r));break;case"participant-left":c.send(JSON.stringify(r));break;case"room-connected":c.send(JSON.stringify(r));break;case"user-status-change":c.send(JSON.stringify(r));break;case"room-error":c.send(JSON.stringify(r));break;case"change-room-config":c.send(JSON.stringify(r));break;case"change-video-config":c.send(JSON.stringify(r));break;case"room-end":c.send(JSON.stringify(r)),this.clear();break;case"full-screen":c.send(JSON.stringify(r));break;case"need-secret":c.send(JSON.stringify(r)),this.clear();break;case"change-master":c.send(JSON.stringify(r));break;case"snapshot":c.send(JSON.stringify(r));break;case"shareEvent":c.send(JSON.stringify(r));break;case"inviteEvent":c.send(JSON.stringify(r));break;case"callUserEvent":c.send(JSON.stringify(r));break;case"callNoJoin":c.send(JSON.stringify(r));break;case"fullScreen":c.send(JSON.stringify(r));break;case"exitFullScreen":c.send(JSON.stringify(r));break;case"minApp":c.send(JSON.stringify(r));break;case"doubleClick":c.send(JSON.stringify(r));break;case"changeClientSize":c.send(JSON.stringify(r));break;case"get-participants":c.send(JSON.stringify(r));break;case"maxWindow":c.send(JSON.stringify(r));break;case"exitMax":c.send(JSON.stringify(r));break;case"signalChanged":c.send(JSON.stringify(r));break;default:r.data="not support name",c.send(JSON.stringify(r)),l=new CustomEvent(a,{detail:"not support name"})}document.dispatchEvent(l)}}static getResponse(e){let r=e.id,t={};t.code="200",e.data&&(t.data=e.data);let a=Ie.get(r);a&&a.resolve(t),Ie.delete(r)}static clear(){X.clear(),X=void 0,console.log("clear _iframe"),Te&&Te.remove(),Te=void 0,typeof at=="function"&&at()}static refreshIframe(e){return new Promise((r,t)=>{Te?(Ie.set(we,{resolve:r,reject:t}),this.request("refreshIframe",{url:e})):t(T.notInitIframe())})}static setPromiseMap(e,r){Ie.set(we,{resolve:e,reject:r})}static getPromiseMap(){return Ie.get(we)}};var Be=class{static organizeUrl(e,r,t){let a=this.organizeParameters(r,t);return e+"#/out/joinRoom?"+a}static organizeParameters(e,r){let t=this.obtainBusinessParametersObject(e,r),a="";for(let l in t){let c="";typeof t[l]=="object"?c=JSON.stringify(t[l]):c=t[l]+"",c.length>0&&c!="undefined"&&(a+=`&${l}=${encodeURIComponent(c)}`)}return a?a.substring(1):""}static obtainBusinessParametersObject(e,r){let t={};if(t=e,r)for(let a in r)r[a]!==void 0&&r[a]!==null&&(t[a]=r[a]);return t}};var Ar=me(qr());var Lr,He,Ur,bt,Nr,Ge,Dr=30*1e3,vs={code:311,message:"\u7F51\u7EDC\u8BF7\u6C42\u8D85\u65F6"},p=class{static setBaseBusinessURL(e){Nr=e}static getBaseBusinessURL(){return Nr}static setBusinessToken(e){e&&e.indexOf("Bearer")==-1?Ge="Bearer "+e:Ge=e}static getBusinessToken(){return Ge}static getBusinessTokenNoBearer(){return Ge.replace("Bearer ","")}static setBaseURL(e){He=e}static getBaseURL(){return He}static setEncryptKey(e){this.encryptKey=e,this.encrypt.setSm2KeyPair(e)}static setServerAPI(e){Ur=e}static getServerAPI(){return Ur}static setToken(e){Lr=e}static getToken(){return Lr}static setCustomToken(e){bt=e}static getCustomToken(){return bt}static setupEncrypt(){this.encrypt=new Ar.default}static generateClientId(){return Ce(this,null,function*(){let e=this.encrypt.getClientId(!0);return this.clientId=e,yield this.trans()})}static trans(){return Ce(this,null,function*(){let e=this.encrypt.getPairKey(!0);this.pairKey=e,console.log("pairkey",e);let r=this.encrypt.encryptSm2(`${e.enKey}:${e.deKey}`);return console.log("trans sm2 encrypt data",r),fetch(He+"/api/store",{headers:{"Access-Control-Allow-Origin":"*",imei:this.clientId,"Content-Type":"application/json"},method:"POST",body:JSON.stringify({p:r})})})}static get(e,r,t){return this.request("GET",e,r,t)}static post(e,r,t,a=Dr){return this.request("POST",e,r,t,a)}static request(e="GET",r,t,a,l=Dr){let c=new Promise((y,g)=>{setTimeout(()=>{g(vs)},l)}),f=new Promise((y,g)=>Ce(this,null,function*(){r.startsWith("http")||(r=He+r);let B;a?B=a:B=bt;let w={"Content-Type":"application/json",Authorization:B};this.encryptKey&&(this.clientId||(yield this.generateClientId()),this.clientId&&(w.imei=this.clientId));let _=this.encryptKey?JSON.stringify({data:this.encrypt.encryptSm4(JSON.stringify(t),this.pairKey.enKey)}):JSON.stringify(t);fetch(r,{body:e==="GET"?null:_,headers:w,method:e}).then(I=>this.handleServerData(I,r,t)).then(I=>{console.log(` ############# data= `,I,r),I&&I.msg&&(I.message=I.msg),y(I)}).catch(I=>{console.log(` ############# json err`,I),g(I)})}));return Promise.race([f,c])}static handleServerData(e,r,t){return e