UNPKG

@hysc/external

Version:

Boom external js sdk

4 lines 78.4 kB
var Sn=Object.create;var ve=Object.defineProperty,Pn=Object.defineProperties,En=Object.getOwnPropertyDescriptor,Mn=Object.getOwnPropertyDescriptors,xn=Object.getOwnPropertyNames,Rt=Object.getOwnPropertySymbols,Rn=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable;var kt=(n,e,r)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,Ft=(n,e)=>{for(var r in e||(e={}))Ct.call(e,r)&&kt(n,r,e[r]);if(Rt)for(var r of Rt(e))kn.call(e,r)&&kt(n,r,e[r]);return n},Ot=(n,e)=>Pn(n,Mn(e));var qt=(n=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(n,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):n)(function(n){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var N=(n,e)=>()=>(n&&(e=n(n=0)),e);var it=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Lt=(n,e)=>{for(var r in e)ve(n,r,{get:e[r],enumerable:!0})},Ut=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of xn(e))!Ct.call(n,a)&&a!==r&&ve(n,a,{get:()=>e[a],enumerable:!(t=En(e,a))||t.enumerable});return n};var nt=(n,e,r)=>(r=n!=null?Sn(Rn(n)):{},Ut(e||!n||!n.__esModule?ve(r,"default",{value:n,enumerable:!0}):r,n)),Nt=n=>Ut(ve({},"__esModule",{value:!0}),n);var ke=(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 Vt=it((Cs,zt)=>{"use strict";var On=qt("buffer").Buffer;zt.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(On.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 Ht=it((Ce,jt)=>{"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 de(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 ge(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 We(){return this.t<=0?0:this.DB*(this.t-1)+ge(this[this.t-1]^this.s&this.DM)}function Ze(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 Qe(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 $e(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 Wr(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 Zr(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 Qr(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 $r(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 Xr(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-ge(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,xe=(1<<this.F1)/G,Q=1<<this.F2,$=o.t,Re=$-L,se=s==null?a():s;for(h.dlShiftTo(Re,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(;--Re>=0;){var rt=o[--$]==W?this.DM:Math.floor(o[$]*ie+(o[$-1]+Q)*xe);if((o[$]+=h.am(0,rt,o,Re,0,L))<rt)for(h.dlShiftTo(Re,se),o.subTo(se,o);o[$]<--rt;)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 Yr(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 ei(i){return i.s<0||i.compareTo(this.m)>=0?i.mod(this.m):i}function ti(i){return i}function ri(i){i.divRemTo(this.m,null,i)}function ii(i,s,o){i.multiplyTo(s,o),this.reduce(o)}function ni(i,s){i.squareTo(s),this.reduce(s)}ue.prototype.convert=ei,ue.prototype.revert=ti,ue.prototype.reduce=ri,ue.prototype.mulTo=ii,ue.prototype.sqrTo=ni;function si(){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 oi(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 ai(i){var s=a();return i.copyTo(s),this.reduce(s),s}function ci(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 ui(i,s){i.squareTo(s),this.reduce(s)}function li(i,s,o){i.multiplyTo(s,o),this.reduce(o)}le.prototype.convert=oi,le.prototype.revert=ai,le.prototype.reduce=ci,le.prototype.mulTo=li,le.prototype.sqrTo=ui;function fi(){return(this.t>0?this[0]&1:this.s)==0}function mi(i,s){if(i>4294967295||i<1)return t.ONE;var o=a(),u=a(),m=s.convert(this),h=ge(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 hi(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=Ze,t.prototype.drShiftTo=Qe,t.prototype.lShiftTo=$e,t.prototype.rShiftTo=Wr,t.prototype.subTo=Zr,t.prototype.multiplyTo=Qr,t.prototype.squareTo=$r,t.prototype.divRemTo=Xr,t.prototype.invDigit=si,t.prototype.isEven=fi,t.prototype.exp=mi,t.prototype.toString=O,t.prototype.negate=A,t.prototype.abs=ce,t.prototype.compareTo=de,t.prototype.bitLength=We,t.prototype.mod=Yr,t.prototype.modPowInt=hi,t.ZERO=F(0),t.ONE=F(1);function gi(){var i=a();return this.copyTo(i),i}function pi(){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 di(){return this.t==0?this.s:this[0]<<24>>24}function yi(){return this.t==0?this.s:this[0]<<16>>16}function vi(i){return Math.floor(Math.LN2*this.DB/Math.log(i))}function bi(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Ii(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 wi(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 Ti(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),Xe,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 Bi(){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 _i(i){return this.compareTo(i)==0}function Si(i){return this.compareTo(i)<0?this:i}function Pi(i){return this.compareTo(i)>0?this:i}function Ei(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 Mi(i,s){return i&s}function xi(i){var s=a();return this.bitwiseTo(i,Mi,s),s}function Xe(i,s){return i|s}function Ri(i){var s=a();return this.bitwiseTo(i,Xe,s),s}function _t(i,s){return i^s}function ki(i){var s=a();return this.bitwiseTo(i,_t,s),s}function St(i,s){return i&~s}function Ci(i){var s=a();return this.bitwiseTo(i,St,s),s}function Fi(){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 Oi(i){var s=a();return i<0?this.rShiftTo(-i,s):this.lShiftTo(i,s),s}function qi(i){var s=a();return i<0?this.lShiftTo(-i,s):this.rShiftTo(i,s),s}function Li(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 Ui(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+Li(this[i]);return this.s<0?this.t*this.DB:-1}function Ni(i){for(var s=0;i!=0;)i&=i-1,++s;return s}function Di(){for(var i=0,s=this.s&this.DM,o=0;o<this.t;++o)i+=Ni(this[o]^s);return i}function Ai(i){var s=Math.floor(i/this.DB);return s>=this.t?this.s!=0:(this[s]&1<<i%this.DB)!=0}function Ji(i,s){var o=t.ONE.shiftLeft(i);return this.bitwiseTo(o,s,o),o}function Ki(i){return this.changeBit(i,Xe)}function zi(i){return this.changeBit(i,St)}function Vi(i){return this.changeBit(i,_t)}function ji(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 Hi(i){var s=a();return this.addTo(i,s),s}function Gi(i){var s=a();return this.subTo(i,s),s}function Wi(i){var s=a();return this.multiplyTo(i,s),s}function Zi(){var i=a();return this.squareTo(i),i}function Qi(i){var s=a();return this.divRemTo(i,s,null),s}function $i(i){var s=a();return this.divRemTo(i,null,s),s}function Xi(i){var s=a(),o=a();return this.divRemTo(i,s,o),new Array(s,o)}function Yi(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp()}function en(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 ye(){}function Pt(i){return i}function tn(i,s,o){i.multiplyTo(s,o)}function rn(i,s){i.squareTo(s)}ye.prototype.convert=Pt,ye.prototype.revert=Pt,ye.prototype.mulTo=tn,ye.prototype.sqrTo=rn;function nn(i){return this.exp(i,new ye)}function sn(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 on(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 an(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 cn(i){return i}function un(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 ln(i,s){i.squareTo(s),this.reduce(s)}function fn(i,s,o){i.multiplyTo(s,o),this.reduce(o)}fe.prototype.convert=an,fe.prototype.revert=cn,fe.prototype.reduce=un,fe.prototype.mulTo=fn,fe.prototype.sqrTo=ln;function mn(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,xe=!0,Q=a(),$;for(o=ge(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),xe)d[ie].copyTo(m),xe=!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 hn(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 gn(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 pn(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],dn=(1<<26)/J[J.length-1];function yn(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<dn;)u*=J[m++];for(u=o.modInt(u);s<m;)if(u%J[s++]==0)return!1}return o.millerRabin(i)}function vn(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=vi,t.prototype.toRadix=Ii,t.prototype.fromRadix=wi,t.prototype.fromNumber=Ti,t.prototype.bitwiseTo=Ei,t.prototype.changeBit=Ji,t.prototype.addTo=ji,t.prototype.dMultiply=Yi,t.prototype.dAddOffset=en,t.prototype.multiplyLowerTo=sn,t.prototype.multiplyUpperTo=on,t.prototype.modInt=gn,t.prototype.millerRabin=vn,t.prototype.clone=gi,t.prototype.intValue=pi,t.prototype.byteValue=di,t.prototype.shortValue=yi,t.prototype.signum=bi,t.prototype.toByteArray=Bi,t.prototype.equals=_i,t.prototype.min=Si,t.prototype.max=Pi,t.prototype.and=xi,t.prototype.or=Ri,t.prototype.xor=ki,t.prototype.andNot=Ci,t.prototype.not=Fi,t.prototype.shiftLeft=Oi,t.prototype.shiftRight=qi,t.prototype.getLowestSetBit=Ui,t.prototype.bitCount=Di,t.prototype.testBit=Ai,t.prototype.setBit=Ki,t.prototype.clearBit=zi,t.prototype.flipBit=Vi,t.prototype.add=Hi,t.prototype.subtract=Gi,t.prototype.multiply=Wi,t.prototype.divide=Qi,t.prototype.remainder=$i,t.prototype.divideAndRemainder=Xi,t.prototype.modPow=mn,t.prototype.modInverse=pn,t.prototype.pow=nn,t.prototype.gcd=hn,t.prototype.isProbablePrime=yn,t.prototype.square=Zi,t.prototype.Barrett=fe;var Me,H,q;function bn(i){H[q++]^=i&255,H[q++]^=i>>8&255,H[q++]^=i>>16&255,H[q++]^=i>>24&255,q>=tt&&(q-=tt)}function Et(){bn(new Date().getTime())}if(H==null){H=new Array,q=0;var Z;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Mt=new Uint8Array(32);for(window.crypto.getRandomValues(Mt),Z=0;Z<32;++Z)H[q++]=Mt[Z]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var xt=window.crypto.random(32);for(Z=0;Z<xt.length;++Z)H[q++]=xt.charCodeAt(Z)&255}}for(;q<tt;)Z=Math.floor(65536*Math.random()),H[q++]=Z>>>8,H[q++]=Z&255;q=0,Et()}function In(){if(Me==null){for(Et(),Me=_n(),Me.init(H),q=0;q<H.length;++q)H[q]=0;q=0}return Me.next()}function wn(i){var s;for(s=0;s<i.length;++s)i[s]=In()}function Ye(){}Ye.prototype.nextBytes=wn;function et(){this.i=0,this.j=0,this.S=new Array}function Tn(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 Bn(){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]}et.prototype.init=Tn,et.prototype.next=Bn;function _n(){return new et}var tt=256;typeof Ce!="undefined"?Ce=jt.exports={default:t,BigInteger:t,SecureRandom:Ye}:this.jsbn={BigInteger:t,SecureRandom:Ye}}).call(Ce)});var rr={};Lt(rr,{SM2:()=>Jn,SM3:()=>An,SM4:()=>zn});import{Buffer as S}from"buffer";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 qn(this.q)}function Qt(n,e){for(var r=[],t=Math.ceil(e/32),a=e%32,l=1;l<=t;l++){var c=S.allocUnsafe(4);c.writeUInt32BE(l);var f=De(S.concat([n,c]));r.push(l===t&&a?S.from(f).slice(0,a):S.from(f))}return S.concat(r,e)}var pe,E,qn,U,ee,Ln,Un,Nn,Dn,De,An,Gt,ot,Wt,Zt,Fe,Jn,Oe,qe,Kn,Le,Yt,er,tr,$t,Xt,Ue,Ne,zn,ir=N(()=>{"use strict";pe=nt(Vt()),E=nt(Ht()),qn=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},Ln=function(n){return n<16?2043430169:2055708042},Un=function(n,e,r,t){return t<16?n^e^r:n&e|n&r|e&r},Nn=function(n,e,r,t){return t<16?n^e^r:n&e|~n&r},Dn=function(n,e,r){for(var t,a,l,c,f,y=function(F){var V,C=new Array(132);F.forEach(function(ce,de){C[de]=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(Ln(M),M),7))^U(g,12),l=Un(g,B,w,M)+_+a+y[M+68],c=Nn(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]]},De=function(n,e,r){if(typeof n=="string"?n=S.from(n,e||"utf8"):n instanceof ArrayBuffer&&(n=S.from(n)),!S.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.alloc(1,128),c=S.alloc(l=(l=t.length%64)>=56?64-l%56-1:56-l-1,0),f=S.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.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]=Dn(I[P],B[P]);var x=S.alloc(32);return I[g].forEach(function(k,M){return x.writeInt32BE(k,4*M)}),r?x.toString(r):(0,pe.default)(x)},An={__proto__:null,digest:De},Gt=new E.SecureRandom,ot=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)}}(),Wt=ot.curve,Zt=ot.G,Fe=ot.n;Jn={__proto__:null,constants:{C1C2C3:0,C1C3C2:1,PC:"04"},generateKeyPair:function(){var n=new E.BigInteger(Fe.bitLength(),Gt).mod(Fe.subtract(new E.BigInteger("2"))).add(E.BigInteger.ONE),e=ee(n.toString(16),64),r=Zt.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.from(n,t.inputEncoding||"utf8"):n instanceof ArrayBuffer&&(n=S.from(n)),!S.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');var y=new E.BigInteger(Fe.bitLength(),Gt).mod(Fe.subtract(E.BigInteger.ONE)).add(E.BigInteger.ONE),g=Zt.multiply(y),B=ee(g.getX().toBigInteger().toString(16),64)+ee(g.getY().toBigInteger().toString(16),64),w=Wt.decodePointHex(e).multiply(y),_=ee(w.getX().toBigInteger().toString(16),64),I=ee(w.getY().toBigInteger().toString(16),64),P=Qt(S.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=De(_+n.toString("hex")+I,"hex","hex"),M=S.from((f?"04":"")+(l===0?B+x+k:B+k+x),"hex");return c?M.toString(c):(0,pe.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.from(n,t.inputEncoding):n instanceof ArrayBuffer&&(n=S.from(n)),!S.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=Wt.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=Qt(S.from(w+_,"hex"),P.length),k=new E.BigInteger(P.toString("hex"),16).xor(new E.BigInteger(x.toString("hex"),16)).toString(16),M=De(w+k+_,"hex","hex")===I.toString("hex")?S.from(k,"hex"):S.alloc(0);return c?M.toString(c):(0,pe.default)(M)}},Oe=[[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]],qe=[2746333894,1453994832,1736282519,2993693404],Kn=[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],Le=/^[0-9a-f]{32}$/i,Yt=function(n){return Oe[(4026531840&n)>>>28][(251658240&n)>>>24]<<24|Oe[(15728640&n)>>>20][(983040&n)>>>16]<<16|Oe[(61440&n)>>>12][(3840&n)>>>8]<<8|Oe[(240&n)>>>4][(15&n)>>>0]<<0},er=function(n){return(e=Yt(n))^U(e,2)^U(e,10)^U(e,18)^U(e,24);var e},tr=function(n){var e,r=new Array(36);r[0]=n[0]^qe[0],r[1]=n[1]^qe[1],r[2]=n[2]^qe[2],r[3]=n[3]^qe[3];for(var t=new Array(32),a=0;a<32;a++)r[a+4]=r[a]^(e=Yt(r[a+1]^r[a+2]^r[a+3]^Kn[a]))^U(e,13)^U(e,23),t[a]=r[a+4];return t},$t=function(n,e){for(var r=tr(e),t=0;t<32;t++)n[t+4]=n[t]^er(n[t+1]^n[t+2]^n[t+3]^r[t]);return[n[35],n[34],n[33],n[32]]},Xt=function(n,e){for(var r=tr(e).reverse(),t=0;t<32;t++)n[t+4]=n[t]^er(n[t+1]^n[t+2]^n[t+3]^r[t]);return[n[35],n[34],n[33],n[32]]},Ue=function(n){return[n.readInt32BE(0),n.readInt32BE(4),n.readInt32BE(8),n.readInt32BE(12)]},Ne=function(n){for(var e=S.alloc(16),r=0;r<4;r++)e.writeInt32BE(n[r],4*r);return e},zn={__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.from(n,t.inputEncoding||"utf8"):n instanceof ArrayBuffer&&(n=S.from(n)),!S.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');if(!Le.test(e))throw new TypeError("Invalid value of cipher `key`");if(e=S.from(e,"hex"),a===2&&!Le.test(l))throw new TypeError("Invalid value of `iv` option");return function(f,y,g,B){g&&(g=Ue(g)),y=Ue(y);for(var w=[],_=(f=function(O){var A=16-O.length%16,ce=S.alloc(A,A);return S.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=$t(x,y);w.push(Ne(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=$t(F,y);w.push(Ne(V))}var C=S.concat(w,f.length);return B?C.toString(B):(0,pe.default)(C)}(n,e,l=a===2?S.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.from(n,t.inputEncoding):n instanceof ArrayBuffer&&(n=S.from(n)),!S.isBuffer(n))throw new TypeError('Expected "string" | "Buffer" | "ArrayBuffer" but received "'+Object.prototype.toString.call(n)+'"');if(!Le.test(e))throw new TypeError("Invalid value of cipher `key`");if(e=S.from(e,"hex"),a===2&&!Le.test(l))throw new TypeError("Invalid value of `iv` option");return function(f,y,g,B){g&&(g=Ue(g)),y=Ue(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=Xt(k,y);w.unshift(Ne([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=Xt(C,y);w.push(Ne(O))}var A=S.concat(w,f.length-w[w.length-1][15]);return B?A.toString(B):(0,pe.default)(A)}(n,e,l=a===2?S.from(l,"hex"):null,c)}}});import Vn from"crypto";function Be(){return Ae>Je.length-16&&(Vn.randomFillSync(Je),Ae=0),Je.slice(Ae,Ae+=16)}var Je,Ae,at=N(()=>{"use strict";Je=new Uint8Array(256),Ae=Je.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 jn(n){return typeof n=="string"&&nr.test(n)}var oe,_e=N(()=>{"use strict";sr();oe=jn});function me(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 Hn(n,e=0){let r=me(n,e);if(!oe(r))throw TypeError("Stringified UUID is invalid");return r}var D,or,Se=N(()=>{"use strict";_e();D=[];for(let n=0;n<256;++n)D.push((n+256).toString(16).slice(1));or=Hn});function Gn(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:ct;if(l==null||c==null){let _=n.random||(n.rng||Be)();l==null&&(l=ar=[_[0]|1,_[1],_[2],_[3],_[4],_[5]]),c==null&&(c=ct=(_[6]<<8|_[7])&16383)}let f=n.msecs!==void 0?n.msecs:Date.now(),y=n.nsecs!==void 0?n.nsecs:lt+1,g=f-ut+(y-lt)/1e4;if(g<0&&n.clockseq===void 0&&(c=c+1&16383),(g<0||f>ut)&&n.nsecs===void 0&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ut=f,lt=y,ct=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||me(a)}var ar,ct,ut,lt,cr,ur=N(()=>{"use strict";at();Se();ut=0,lt=0;cr=Gn});function Wn(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 Ke,ft=N(()=>{"use strict";_e();Ke=Wn});function Zn(n){n=unescape(encodeURIComponent(n));let e=[];for(let r=0;r<n.length;++r)e.push(n.charCodeAt(r));return e}function Pe(n,e,r){function t(a,l,c,f){var y;if(typeof a=="string"&&(a=Zn(a)),typeof l=="string"&&(l=Ke(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 me(g)}try{t.name=n}catch(a){}return t.DNS=Qn,t.URL=$n,t}var Qn,$n,mt=N(()=>{"use strict";Se();ft();Qn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",$n="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});import Xn from"crypto";function Yn(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),Xn.createHash("md5").update(n).digest()}var lr,fr=N(()=>{"use strict";lr=Yn});var es,mr,hr=N(()=>{"use strict";mt();fr();es=Pe("v3",48,lr),mr=es});import ts from"crypto";var ht,gr=N(()=>{"use strict";ht={randomUUID:ts.randomUUID}});function rs(n,e,r){if(ht.randomUUID&&!e&&!n)return ht.randomUUID();n=n||{};let t=n.random||(n.rng||Be)();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 me(t)}var pr,dr=N(()=>{"use strict";gr();at();Se();pr=rs});import is from"crypto";function ns(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),is.createHash("sha1").update(n).digest()}var yr,vr=N(()=>{"use strict";yr=ns});var ss,br,Ir=N(()=>{"use strict";mt();vr();ss=Pe("v5",80,yr),br=ss});var wr,Tr=N(()=>{"use strict";wr="00000000-0000-0000-0000-000000000000"});function os(n){if(!oe(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}var Br,_r=N(()=>{"use strict";_e();Br=os});var Sr={};Lt(Sr,{NIL:()=>wr,parse:()=>Ke,stringify:()=>or,v1:()=>cr,v3:()=>mr,v4:()=>pr,v5:()=>br,validate:()=>oe,version:()=>Br});var Pr=N(()=>{"use strict";ur();hr();dr();Ir();Tr();_r();_e();Se();ft()});var Cr=it((_o,kr)=>{"use strict";var dt=Object.defineProperty,as=Object.getOwnPropertyDescriptor,cs=Object.getOwnPropertyNames,us=Object.prototype.hasOwnProperty,ls=(n,e)=>{for(var r in e)dt(n,r,{get:e[r],enumerable:!0})},fs=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of cs(e))!us.call(n,a)&&a!==r&&dt(n,a,{get:()=>e[a],enumerable:!(t=as(e,a))||t.enumerable});return n},ms=n=>fs(dt({},"__esModule",{value:!0}),n),Rr={};ls(Rr,{default:()=>vs});kr.exports=ms(Rr);var he=(ir(),Nt(rr)),hs=(Pr(),Nt(Sr)),gs=qt("buffer");function ps(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 ze(n){return gs.Buffer.from(n).toString("hex")}var Er="boom",Mr="zdnb",xr="20231023",ds=class{generateClientId(){return(0,hs.v4)()}setSm2KeyPair(n){this.sm2KeyPair=n}generateSm4KeyPairs(){let n=ps(16),e=he.SM3.digest(n,"utf8","hex").slice(0,16);return console.log("clientRandom",n,e),{enKey:n,deKey:e}}encryptSm2(n){return he.SM2.encrypt(n,this.sm2KeyPair,{inputEncoding:"utf8",mode:he.SM2.constants.C1C2C3,outputEncoding:"base64"})}encryptSm4(n,e,r){return he.SM4.encrypt(n,ze(e),{mode:he.SM4.constants.CBC,iv:ze(r!=null?r:`${Er}${Mr}${xr}`),inputEncoding:"utf8",outputEncoding:"hex"})}decryptSm4(n,e,r){return he.SM4.decrypt(n,ze(e),{mode:he.SM4.constants.CBC,iv:ze(r!=null?r:`${Er}${Mr}${xr}`),inputEncoding:"hex",outputEncoding:"utf8"})}},gt="client-id",pt="pair-key",ys=class Ve{constructor(){if(Ve.instance)return Ve.instance;this.boomCrypto=new ds,Ve.instance=this}getClientId(e){let r=localStorage.getItem(gt);if(e||!r){let t=this.boomCrypto.generateClientId();localStorage.setItem(gt,t)}return localStorage.getItem(gt)}setSm2KeyPair(e){return this.boomCrypto.setSm2KeyPair(e)}getPairKey(e){let r=localStorage.getItem(pt);if(e||!r){let t=this.boomCrypto.generateSm4KeyPairs();localStorage.setItem(pt,JSON.stringify(t))}return JSON.parse(localStorage.getItem(pt))}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)}},vs=ys});var Cn={create:function(){return function(){this.init.apply(this,arguments)}}},Fn=function(n,e){for(var r in e)n[r]=e[r]},Dt="postMessage"in window,At=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};At.prototype.send=function(n){if(Dt)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 Jt=Cn.create();Jt.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:[]},Fn(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)};Dt?window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent("onmessage",e):window.navigator[this.name]=e},addTarget:function(n,e){var r=new At(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 Kt=Jt;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,be=new Map,Ie=1,we,st,b=class{static createMeassage(e,r){we=e,st=r,X||(X=new Kt,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=Ie,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),Ie++}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=be.get(r);a&&a.resolve(t),be.delete(r)}static clear(){X.clear(),X=void 0,console.log("clear _iframe"),we&&we.remove(),we=void 0,typeof st=="function"&&st()}static refreshIframe(e){return new Promise((r,t)=>{we?(be.set(Ie,{resolve:r,reject:t}),this.request("refreshIframe",{url:e})):t(T.notInitIframe())})}static setPromiseMap(e,r){be.set(Ie,{resolve:e,reject:r})}static getPromiseMap(){return be.get(Ie)}};var Te=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 Ur=nt(Cr());var Fr,je,Or,yt,qr,He,Lr=30*1e3,bs={code:311,message:"\u7F51\u7EDC\u8BF7\u6C42\u8D85\u65F6"},p=class{static setBaseBusinessURL(e){qr=e}static getBaseBusinessURL(){return qr}static setBusinessToken(e){e&&e.indexOf("Bearer")==-1?He="Bearer "+e:He=e}static getBusinessToken(){return He}static getBusinessTokenNoBearer(){return He.replace("Bearer ","")}static setBaseURL(e){je=e}static getBaseURL(){return je}static setEncryptKey(e){this.encryptKey=e,this.encrypt.setSm2KeyPair(e)}static setServerAPI(e){Or=e}static getServerAPI(){return Or}static setToken(e){Fr=e}static getToken(){return Fr}static setCustomToken(e){yt=e}static getCustomToken(){return yt}static setupEncrypt(){this.encrypt=new Ur.default}static generateClientId(){return ke(this,null,function*(){let e=this.encrypt.getClientId(!0);return this.clientId=e,yield this.trans()})}static trans(){return ke(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(je+"/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=Lr){return this.request("POST",e,r,t,a)}static request(e="GET",r,t,a,l=Lr){let c=new Promise((y,g)=>{setTimeout(()=>{g(bs)},l)}),f=new Promise((y,g)=>ke(this,null,function*(){r.startsWith("http")||(r=je+r);let B;a?B=a:B=yt;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.ok?this.encryptKey?e.json().then(a=>{if(a.data.noCipher)return a;let l=this.encrypt.decryptSm4(a.data.ciphe