@pelican-identity/vanilla 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +48 -55
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +48 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var Pelican=(function(exports){'use strict';var ci=Object.create;var Or=Object.defineProperty;var ui=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,di=Object.prototype.hasOwnProperty;var Yr=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var rt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var xi=(n,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of li(e))!di.call(n,u)&&u!==i&&Or(n,u,{get:()=>e[u],enumerable:!(a=ui(e,u))||a.enumerable});return n};var gi=(n,e,i)=>(i=n!=null?ci(hi(n)):{},xi(!n||!n.__esModule?Or(i,"default",{value:n,enumerable:true}):i,n));var Kr=rt(()=>{});var Fr=rt((vf,Ae)=>{(function(n){var e=function(r){var o,f=new Float64Array(16);if(r)for(o=0;o<r.length;o++)f[o]=r[o];return f},i=function(){throw new Error("no PRNG")},a=new Uint8Array(16),u=new Uint8Array(32);u[0]=9;var h=e(),p=e([1]),y=e([56129,1]),E=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),k=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),V=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),ut=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),it=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function wt(r,o,f,t){r[o]=f>>24&255,r[o+1]=f>>16&255,r[o+2]=f>>8&255,r[o+3]=f&255,r[o+4]=t>>24&255,r[o+5]=t>>16&255,r[o+6]=t>>8&255,r[o+7]=t&255;}function mt(r,o,f,t,s){var l,d=0;for(l=0;l<s;l++)d|=r[o+l]^f[t+l];return (1&d-1>>>8)-1}function vt(r,o,f,t){return mt(r,o,f,t,16)}function Rt(r,o,f,t){return mt(r,o,f,t,32)}function Dt(r,o,f,t){for(var s=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,l=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,d=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,w=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,A=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,L=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,B=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,X=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,M=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,N=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,j=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,Y=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,z=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,q=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,D=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,T=s,R=l,S=d,I=w,U=A,_=L,x=B,g=X,v=M,b=N,m=j,C=Y,P=O,K=z,H=q,F=D,c,J=0;J<20;J+=2)c=T+P|0,U^=c<<7|c>>>25,c=U+T|0,v^=c<<9|c>>>23,c=v+U|0,P^=c<<13|c>>>19,c=P+v|0,T^=c<<18|c>>>14,c=_+R|0,b^=c<<7|c>>>25,c=b+_|0,K^=c<<9|c>>>23,c=K+b|0,R^=c<<13|c>>>19,c=R+K|0,_^=c<<18|c>>>14,c=m+x|0,H^=c<<7|c>>>25,c=H+m|0,S^=c<<9|c>>>23,c=S+H|0,x^=c<<13|c>>>19,c=x+S|0,m^=c<<18|c>>>14,c=F+C|0,I^=c<<7|c>>>25,c=I+F|0,g^=c<<9|c>>>23,c=g+I|0,C^=c<<13|c>>>19,c=C+g|0,F^=c<<18|c>>>14,c=T+I|0,R^=c<<7|c>>>25,c=R+T|0,S^=c<<9|c>>>23,c=S+R|0,I^=c<<13|c>>>19,c=I+S|0,T^=c<<18|c>>>14,c=_+U|0,x^=c<<7|c>>>25,c=x+_|0,g^=c<<9|c>>>23,c=g+x|0,U^=c<<13|c>>>19,c=U+g|0,_^=c<<18|c>>>14,c=m+b|0,C^=c<<7|c>>>25,c=C+m|0,v^=c<<9|c>>>23,c=v+C|0,b^=c<<13|c>>>19,c=b+v|0,m^=c<<18|c>>>14,c=F+H|0,P^=c<<7|c>>>25,c=P+F|0,K^=c<<9|c>>>23,c=K+P|0,H^=c<<13|c>>>19,c=H+K|0,F^=c<<18|c>>>14;T=T+s|0,R=R+l|0,S=S+d|0,I=I+w|0,U=U+A|0,_=_+L|0,x=x+B|0,g=g+X|0,v=v+M|0,b=b+N|0,m=m+j|0,C=C+Y|0,P=P+O|0,K=K+z|0,H=H+q|0,F=F+D|0,r[0]=T>>>0&255,r[1]=T>>>8&255,r[2]=T>>>16&255,r[3]=T>>>24&255,r[4]=R>>>0&255,r[5]=R>>>8&255,r[6]=R>>>16&255,r[7]=R>>>24&255,r[8]=S>>>0&255,r[9]=S>>>8&255,r[10]=S>>>16&255,r[11]=S>>>24&255,r[12]=I>>>0&255,r[13]=I>>>8&255,r[14]=I>>>16&255,r[15]=I>>>24&255,r[16]=U>>>0&255,r[17]=U>>>8&255,r[18]=U>>>16&255,r[19]=U>>>24&255,r[20]=_>>>0&255,r[21]=_>>>8&255,r[22]=_>>>16&255,r[23]=_>>>24&255,r[24]=x>>>0&255,r[25]=x>>>8&255,r[26]=x>>>16&255,r[27]=x>>>24&255,r[28]=g>>>0&255,r[29]=g>>>8&255,r[30]=g>>>16&255,r[31]=g>>>24&255,r[32]=v>>>0&255,r[33]=v>>>8&255,r[34]=v>>>16&255,r[35]=v>>>24&255,r[36]=b>>>0&255,r[37]=b>>>8&255,r[38]=b>>>16&255,r[39]=b>>>24&255,r[40]=m>>>0&255,r[41]=m>>>8&255,r[42]=m>>>16&255,r[43]=m>>>24&255,r[44]=C>>>0&255,r[45]=C>>>8&255,r[46]=C>>>16&255,r[47]=C>>>24&255,r[48]=P>>>0&255,r[49]=P>>>8&255,r[50]=P>>>16&255,r[51]=P>>>24&255,r[52]=K>>>0&255,r[53]=K>>>8&255,r[54]=K>>>16&255,r[55]=K>>>24&255,r[56]=H>>>0&255,r[57]=H>>>8&255,r[58]=H>>>16&255,r[59]=H>>>24&255,r[60]=F>>>0&255,r[61]=F>>>8&255,r[62]=F>>>16&255,r[63]=F>>>24&255;}function re(r,o,f,t){for(var s=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,l=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,d=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,w=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,A=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,L=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,B=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,X=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,M=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,N=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,j=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,Y=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,z=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,q=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,D=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,T=s,R=l,S=d,I=w,U=A,_=L,x=B,g=X,v=M,b=N,m=j,C=Y,P=O,K=z,H=q,F=D,c,J=0;J<20;J+=2)c=T+P|0,U^=c<<7|c>>>25,c=U+T|0,v^=c<<9|c>>>23,c=v+U|0,P^=c<<13|c>>>19,c=P+v|0,T^=c<<18|c>>>14,c=_+R|0,b^=c<<7|c>>>25,c=b+_|0,K^=c<<9|c>>>23,c=K+b|0,R^=c<<13|c>>>19,c=R+K|0,_^=c<<18|c>>>14,c=m+x|0,H^=c<<7|c>>>25,c=H+m|0,S^=c<<9|c>>>23,c=S+H|0,x^=c<<13|c>>>19,c=x+S|0,m^=c<<18|c>>>14,c=F+C|0,I^=c<<7|c>>>25,c=I+F|0,g^=c<<9|c>>>23,c=g+I|0,C^=c<<13|c>>>19,c=C+g|0,F^=c<<18|c>>>14,c=T+I|0,R^=c<<7|c>>>25,c=R+T|0,S^=c<<9|c>>>23,c=S+R|0,I^=c<<13|c>>>19,c=I+S|0,T^=c<<18|c>>>14,c=_+U|0,x^=c<<7|c>>>25,c=x+_|0,g^=c<<9|c>>>23,c=g+x|0,U^=c<<13|c>>>19,c=U+g|0,_^=c<<18|c>>>14,c=m+b|0,C^=c<<7|c>>>25,c=C+m|0,v^=c<<9|c>>>23,c=v+C|0,b^=c<<13|c>>>19,c=b+v|0,m^=c<<18|c>>>14,c=F+H|0,P^=c<<7|c>>>25,c=P+F|0,K^=c<<9|c>>>23,c=K+P|0,H^=c<<13|c>>>19,c=H+K|0,F^=c<<18|c>>>14;r[0]=T>>>0&255,r[1]=T>>>8&255,r[2]=T>>>16&255,r[3]=T>>>24&255,r[4]=_>>>0&255,r[5]=_>>>8&255,r[6]=_>>>16&255,r[7]=_>>>24&255,r[8]=m>>>0&255,r[9]=m>>>8&255,r[10]=m>>>16&255,r[11]=m>>>24&255,r[12]=F>>>0&255,r[13]=F>>>8&255,r[14]=F>>>16&255,r[15]=F>>>24&255,r[16]=x>>>0&255,r[17]=x>>>8&255,r[18]=x>>>16&255,r[19]=x>>>24&255,r[20]=g>>>0&255,r[21]=g>>>8&255,r[22]=g>>>16&255,r[23]=g>>>24&255,r[24]=v>>>0&255,r[25]=v>>>8&255,r[26]=v>>>16&255,r[27]=v>>>24&255,r[28]=b>>>0&255,r[29]=b>>>8&255,r[30]=b>>>16&255,r[31]=b>>>24&255;}function St(r,o,f,t){Dt(r,o,f,t);}function Tt(r,o,f,t){re(r,o,f,t);}var dt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Z(r,o,f,t,s,l,d){var w=new Uint8Array(16),A=new Uint8Array(64),L,B;for(B=0;B<16;B++)w[B]=0;for(B=0;B<8;B++)w[B]=l[B];for(;s>=64;){for(St(A,w,d,dt),B=0;B<64;B++)r[o+B]=f[t+B]^A[B];for(L=1,B=8;B<16;B++)L=L+(w[B]&255)|0,w[B]=L&255,L>>>=8;s-=64,o+=64,t+=64;}if(s>0)for(St(A,w,d,dt),B=0;B<s;B++)r[o+B]=f[t+B]^A[B];return 0}function gt(r,o,f,t,s){var l=new Uint8Array(16),d=new Uint8Array(64),w,A;for(A=0;A<16;A++)l[A]=0;for(A=0;A<8;A++)l[A]=t[A];for(;f>=64;){for(St(d,l,s,dt),A=0;A<64;A++)r[o+A]=d[A];for(w=1,A=8;A<16;A++)w=w+(l[A]&255)|0,l[A]=w&255,w>>>=8;f-=64,o+=64;}if(f>0)for(St(d,l,s,dt),A=0;A<f;A++)r[o+A]=d[A];return 0}function $t(r,o,f,t,s){var l=new Uint8Array(32);Tt(l,t,s,dt);for(var d=new Uint8Array(8),w=0;w<8;w++)d[w]=t[w+16];return gt(r,o,f,d,l)}function Oe(r,o,f,t,s,l,d){var w=new Uint8Array(32);Tt(w,l,d,dt);for(var A=new Uint8Array(8),L=0;L<8;L++)A[L]=l[L+16];return Z(r,o,f,t,s,A,w)}var ge=function(r){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var o,f,t,s,l,d,w,A;o=r[0]&255|(r[1]&255)<<8,this.r[0]=o&8191,f=r[2]&255|(r[3]&255)<<8,this.r[1]=(o>>>13|f<<3)&8191,t=r[4]&255|(r[5]&255)<<8,this.r[2]=(f>>>10|t<<6)&7939,s=r[6]&255|(r[7]&255)<<8,this.r[3]=(t>>>7|s<<9)&8191,l=r[8]&255|(r[9]&255)<<8,this.r[4]=(s>>>4|l<<12)&255,this.r[5]=l>>>1&8190,d=r[10]&255|(r[11]&255)<<8,this.r[6]=(l>>>14|d<<2)&8191,w=r[12]&255|(r[13]&255)<<8,this.r[7]=(d>>>11|w<<5)&8065,A=r[14]&255|(r[15]&255)<<8,this.r[8]=(w>>>8|A<<8)&8191,this.r[9]=A>>>5&127,this.pad[0]=r[16]&255|(r[17]&255)<<8,this.pad[1]=r[18]&255|(r[19]&255)<<8,this.pad[2]=r[20]&255|(r[21]&255)<<8,this.pad[3]=r[22]&255|(r[23]&255)<<8,this.pad[4]=r[24]&255|(r[25]&255)<<8,this.pad[5]=r[26]&255|(r[27]&255)<<8,this.pad[6]=r[28]&255|(r[29]&255)<<8,this.pad[7]=r[30]&255|(r[31]&255)<<8;};ge.prototype.blocks=function(r,o,f){for(var t=this.fin?0:2048,s,l,d,w,A,L,B,X,M,N,j,Y,O,z,q,D,T,R,S,I=this.h[0],U=this.h[1],_=this.h[2],x=this.h[3],g=this.h[4],v=this.h[5],b=this.h[6],m=this.h[7],C=this.h[8],P=this.h[9],K=this.r[0],H=this.r[1],F=this.r[2],c=this.r[3],J=this.r[4],tt=this.r[5],et=this.r[6],$=this.r[7],G=this.r[8],W=this.r[9];f>=16;)s=r[o+0]&255|(r[o+1]&255)<<8,I+=s&8191,l=r[o+2]&255|(r[o+3]&255)<<8,U+=(s>>>13|l<<3)&8191,d=r[o+4]&255|(r[o+5]&255)<<8,_+=(l>>>10|d<<6)&8191,w=r[o+6]&255|(r[o+7]&255)<<8,x+=(d>>>7|w<<9)&8191,A=r[o+8]&255|(r[o+9]&255)<<8,g+=(w>>>4|A<<12)&8191,v+=A>>>1&8191,L=r[o+10]&255|(r[o+11]&255)<<8,b+=(A>>>14|L<<2)&8191,B=r[o+12]&255|(r[o+13]&255)<<8,m+=(L>>>11|B<<5)&8191,X=r[o+14]&255|(r[o+15]&255)<<8,C+=(B>>>8|X<<8)&8191,P+=X>>>5|t,M=0,N=M,N+=I*K,N+=U*(5*W),N+=_*(5*G),N+=x*(5*$),N+=g*(5*et),M=N>>>13,N&=8191,N+=v*(5*tt),N+=b*(5*J),N+=m*(5*c),N+=C*(5*F),N+=P*(5*H),M+=N>>>13,N&=8191,j=M,j+=I*H,j+=U*K,j+=_*(5*W),j+=x*(5*G),j+=g*(5*$),M=j>>>13,j&=8191,j+=v*(5*et),j+=b*(5*tt),j+=m*(5*J),j+=C*(5*c),j+=P*(5*F),M+=j>>>13,j&=8191,Y=M,Y+=I*F,Y+=U*H,Y+=_*K,Y+=x*(5*W),Y+=g*(5*G),M=Y>>>13,Y&=8191,Y+=v*(5*$),Y+=b*(5*et),Y+=m*(5*tt),Y+=C*(5*J),Y+=P*(5*c),M+=Y>>>13,Y&=8191,O=M,O+=I*c,O+=U*F,O+=_*H,O+=x*K,O+=g*(5*W),M=O>>>13,O&=8191,O+=v*(5*G),O+=b*(5*$),O+=m*(5*et),O+=C*(5*tt),O+=P*(5*J),M+=O>>>13,O&=8191,z=M,z+=I*J,z+=U*c,z+=_*F,z+=x*H,z+=g*K,M=z>>>13,z&=8191,z+=v*(5*W),z+=b*(5*G),z+=m*(5*$),z+=C*(5*et),z+=P*(5*tt),M+=z>>>13,z&=8191,q=M,q+=I*tt,q+=U*J,q+=_*c,q+=x*F,q+=g*H,M=q>>>13,q&=8191,q+=v*K,q+=b*(5*W),q+=m*(5*G),q+=C*(5*$),q+=P*(5*et),M+=q>>>13,q&=8191,D=M,D+=I*et,D+=U*tt,D+=_*J,D+=x*c,D+=g*F,M=D>>>13,D&=8191,D+=v*H,D+=b*K,D+=m*(5*W),D+=C*(5*G),D+=P*(5*$),M+=D>>>13,D&=8191,T=M,T+=I*$,T+=U*et,T+=_*tt,T+=x*J,T+=g*c,M=T>>>13,T&=8191,T+=v*F,T+=b*H,T+=m*K,T+=C*(5*W),T+=P*(5*G),M+=T>>>13,T&=8191,R=M,R+=I*G,R+=U*$,R+=_*et,R+=x*tt,R+=g*J,M=R>>>13,R&=8191,R+=v*c,R+=b*F,R+=m*H,R+=C*K,R+=P*(5*W),M+=R>>>13,R&=8191,S=M,S+=I*W,S+=U*G,S+=_*$,S+=x*et,S+=g*tt,M=S>>>13,S&=8191,S+=v*J,S+=b*c,S+=m*F,S+=C*H,S+=P*K,M+=S>>>13,S&=8191,M=(M<<2)+M|0,M=M+N|0,N=M&8191,M=M>>>13,j+=M,I=N,U=j,_=Y,x=O,g=z,v=q,b=D,m=T,C=R,P=S,o+=16,f-=16;this.h[0]=I,this.h[1]=U,this.h[2]=_,this.h[3]=x,this.h[4]=g,this.h[5]=v,this.h[6]=b,this.h[7]=m,this.h[8]=C,this.h[9]=P;},ge.prototype.finish=function(r,o){var f=new Uint16Array(10),t,s,l,d;if(this.leftover){for(d=this.leftover,this.buffer[d++]=1;d<16;d++)this.buffer[d]=0;this.fin=1,this.blocks(this.buffer,0,16);}for(t=this.h[1]>>>13,this.h[1]&=8191,d=2;d<10;d++)this.h[d]+=t,t=this.h[d]>>>13,this.h[d]&=8191;for(this.h[0]+=t*5,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,f[0]=this.h[0]+5,t=f[0]>>>13,f[0]&=8191,d=1;d<10;d++)f[d]=this.h[d]+t,t=f[d]>>>13,f[d]&=8191;for(f[9]-=8192,s=(t^1)-1,d=0;d<10;d++)f[d]&=s;for(s=~s,d=0;d<10;d++)this.h[d]=this.h[d]&s|f[d];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,l=this.h[0]+this.pad[0],this.h[0]=l&65535,d=1;d<8;d++)l=(this.h[d]+this.pad[d]|0)+(l>>>16)|0,this.h[d]=l&65535;r[o+0]=this.h[0]>>>0&255,r[o+1]=this.h[0]>>>8&255,r[o+2]=this.h[1]>>>0&255,r[o+3]=this.h[1]>>>8&255,r[o+4]=this.h[2]>>>0&255,r[o+5]=this.h[2]>>>8&255,r[o+6]=this.h[3]>>>0&255,r[o+7]=this.h[3]>>>8&255,r[o+8]=this.h[4]>>>0&255,r[o+9]=this.h[4]>>>8&255,r[o+10]=this.h[5]>>>0&255,r[o+11]=this.h[5]>>>8&255,r[o+12]=this.h[6]>>>0&255,r[o+13]=this.h[6]>>>8&255,r[o+14]=this.h[7]>>>0&255,r[o+15]=this.h[7]>>>8&255;},ge.prototype.update=function(r,o,f){var t,s;if(this.leftover){for(s=16-this.leftover,s>f&&(s=f),t=0;t<s;t++)this.buffer[this.leftover+t]=r[o+t];if(f-=s,o+=s,this.leftover+=s,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0;}if(f>=16&&(s=f-f%16,this.blocks(r,o,s),o+=s,f-=s),f){for(t=0;t<f;t++)this.buffer[this.leftover+t]=r[o+t];this.leftover+=f;}};function Ye(r,o,f,t,s,l){var d=new ge(l);return d.update(f,t,s),d.finish(r,o),0}function Br(r,o,f,t,s,l){var d=new Uint8Array(16);return Ye(d,0,f,t,s,l),vt(r,o,d,0)}function Ke(r,o,f,t,s){var l;if(f<32)return -1;for(Oe(r,0,o,0,f,t,s),Ye(r,16,r,32,f-32,r),l=0;l<16;l++)r[l]=0;return 0}function Fe(r,o,f,t,s){var l,d=new Uint8Array(32);if(f<32||($t(d,0,32,t,s),Br(o,16,o,32,f-32,d)!==0))return -1;for(Oe(r,0,o,0,f,t,s),l=0;l<32;l++)r[l]=0;return 0}function It(r,o){var f;for(f=0;f<16;f++)r[f]=o[f]|0;}function He(r){var o,f,t=1;for(o=0;o<16;o++)f=r[o]+t+65535,t=Math.floor(f/65536),r[o]=f-t*65536;r[0]+=t-1+37*(t-1);}function kt(r,o,f){for(var t,s=~(f-1),l=0;l<16;l++)t=s&(r[l]^o[l]),r[l]^=t,o[l]^=t;}function Jt(r,o){var f,t,s,l=e(),d=e();for(f=0;f<16;f++)d[f]=o[f];for(He(d),He(d),He(d),t=0;t<2;t++){for(l[0]=d[0]-65517,f=1;f<15;f++)l[f]=d[f]-65535-(l[f-1]>>16&1),l[f-1]&=65535;l[15]=d[15]-32767-(l[14]>>16&1),s=l[15]>>16&1,l[14]&=65535,kt(d,l,1-s);}for(f=0;f<16;f++)r[2*f]=d[f]&255,r[2*f+1]=d[f]>>8;}function Sr(r,o){var f=new Uint8Array(32),t=new Uint8Array(32);return Jt(f,r),Jt(t,o),Rt(f,0,t,0)}function Mr(r){var o=new Uint8Array(32);return Jt(o,r),o[0]&1}function Ve(r,o){var f;for(f=0;f<16;f++)r[f]=o[2*f]+(o[2*f+1]<<8);r[15]&=32767;}function _t(r,o,f){for(var t=0;t<16;t++)r[t]=o[t]+f[t];}function Bt(r,o,f){for(var t=0;t<16;t++)r[t]=o[t]-f[t];}function Q(r,o,f){var t,s,l=0,d=0,w=0,A=0,L=0,B=0,X=0,M=0,N=0,j=0,Y=0,O=0,z=0,q=0,D=0,T=0,R=0,S=0,I=0,U=0,_=0,x=0,g=0,v=0,b=0,m=0,C=0,P=0,K=0,H=0,F=0,c=f[0],J=f[1],tt=f[2],et=f[3],$=f[4],G=f[5],W=f[6],lt=f[7],ft=f[8],st=f[9],at=f[10],ct=f[11],xt=f[12],pt=f[13],yt=f[14],bt=f[15];t=o[0],l+=t*c,d+=t*J,w+=t*tt,A+=t*et,L+=t*$,B+=t*G,X+=t*W,M+=t*lt,N+=t*ft,j+=t*st,Y+=t*at,O+=t*ct,z+=t*xt,q+=t*pt,D+=t*yt,T+=t*bt,t=o[1],d+=t*c,w+=t*J,A+=t*tt,L+=t*et,B+=t*$,X+=t*G,M+=t*W,N+=t*lt,j+=t*ft,Y+=t*st,O+=t*at,z+=t*ct,q+=t*xt,D+=t*pt,T+=t*yt,R+=t*bt,t=o[2],w+=t*c,A+=t*J,L+=t*tt,B+=t*et,X+=t*$,M+=t*G,N+=t*W,j+=t*lt,Y+=t*ft,O+=t*st,z+=t*at,q+=t*ct,D+=t*xt,T+=t*pt,R+=t*yt,S+=t*bt,t=o[3],A+=t*c,L+=t*J,B+=t*tt,X+=t*et,M+=t*$,N+=t*G,j+=t*W,Y+=t*lt,O+=t*ft,z+=t*st,q+=t*at,D+=t*ct,T+=t*xt,R+=t*pt,S+=t*yt,I+=t*bt,t=o[4],L+=t*c,B+=t*J,X+=t*tt,M+=t*et,N+=t*$,j+=t*G,Y+=t*W,O+=t*lt,z+=t*ft,q+=t*st,D+=t*at,T+=t*ct,R+=t*xt,S+=t*pt,I+=t*yt,U+=t*bt,t=o[5],B+=t*c,X+=t*J,M+=t*tt,N+=t*et,j+=t*$,Y+=t*G,O+=t*W,z+=t*lt,q+=t*ft,D+=t*st,T+=t*at,R+=t*ct,S+=t*xt,I+=t*pt,U+=t*yt,_+=t*bt,t=o[6],X+=t*c,M+=t*J,N+=t*tt,j+=t*et,Y+=t*$,O+=t*G,z+=t*W,q+=t*lt,D+=t*ft,T+=t*st,R+=t*at,S+=t*ct,I+=t*xt,U+=t*pt,_+=t*yt,x+=t*bt,t=o[7],M+=t*c,N+=t*J,j+=t*tt,Y+=t*et,O+=t*$,z+=t*G,q+=t*W,D+=t*lt,T+=t*ft,R+=t*st,S+=t*at,I+=t*ct,U+=t*xt,_+=t*pt,x+=t*yt,g+=t*bt,t=o[8],N+=t*c,j+=t*J,Y+=t*tt,O+=t*et,z+=t*$,q+=t*G,D+=t*W,T+=t*lt,R+=t*ft,S+=t*st,I+=t*at,U+=t*ct,_+=t*xt,x+=t*pt,g+=t*yt,v+=t*bt,t=o[9],j+=t*c,Y+=t*J,O+=t*tt,z+=t*et,q+=t*$,D+=t*G,T+=t*W,R+=t*lt,S+=t*ft,I+=t*st,U+=t*at,_+=t*ct,x+=t*xt,g+=t*pt,v+=t*yt,b+=t*bt,t=o[10],Y+=t*c,O+=t*J,z+=t*tt,q+=t*et,D+=t*$,T+=t*G,R+=t*W,S+=t*lt,I+=t*ft,U+=t*st,_+=t*at,x+=t*ct,g+=t*xt,v+=t*pt,b+=t*yt,m+=t*bt,t=o[11],O+=t*c,z+=t*J,q+=t*tt,D+=t*et,T+=t*$,R+=t*G,S+=t*W,I+=t*lt,U+=t*ft,_+=t*st,x+=t*at,g+=t*ct,v+=t*xt,b+=t*pt,m+=t*yt,C+=t*bt,t=o[12],z+=t*c,q+=t*J,D+=t*tt,T+=t*et,R+=t*$,S+=t*G,I+=t*W,U+=t*lt,_+=t*ft,x+=t*st,g+=t*at,v+=t*ct,b+=t*xt,m+=t*pt,C+=t*yt,P+=t*bt,t=o[13],q+=t*c,D+=t*J,T+=t*tt,R+=t*et,S+=t*$,I+=t*G,U+=t*W,_+=t*lt,x+=t*ft,g+=t*st,v+=t*at,b+=t*ct,m+=t*xt,C+=t*pt,P+=t*yt,K+=t*bt,t=o[14],D+=t*c,T+=t*J,R+=t*tt,S+=t*et,I+=t*$,U+=t*G,_+=t*W,x+=t*lt,g+=t*ft,v+=t*st,b+=t*at,m+=t*ct,C+=t*xt,P+=t*pt,K+=t*yt,H+=t*bt,t=o[15],T+=t*c,R+=t*J,S+=t*tt,I+=t*et,U+=t*$,_+=t*G,x+=t*W,g+=t*lt,v+=t*ft,b+=t*st,m+=t*at,C+=t*ct,P+=t*xt,K+=t*pt,H+=t*yt,F+=t*bt,l+=38*R,d+=38*S,w+=38*I,A+=38*U,L+=38*_,B+=38*x,X+=38*g,M+=38*v,N+=38*b,j+=38*m,Y+=38*C,O+=38*P,z+=38*K,q+=38*H,D+=38*F,s=1,t=l+s+65535,s=Math.floor(t/65536),l=t-s*65536,t=d+s+65535,s=Math.floor(t/65536),d=t-s*65536,t=w+s+65535,s=Math.floor(t/65536),w=t-s*65536,t=A+s+65535,s=Math.floor(t/65536),A=t-s*65536,t=L+s+65535,s=Math.floor(t/65536),L=t-s*65536,t=B+s+65535,s=Math.floor(t/65536),B=t-s*65536,t=X+s+65535,s=Math.floor(t/65536),X=t-s*65536,t=M+s+65535,s=Math.floor(t/65536),M=t-s*65536,t=N+s+65535,s=Math.floor(t/65536),N=t-s*65536,t=j+s+65535,s=Math.floor(t/65536),j=t-s*65536,t=Y+s+65535,s=Math.floor(t/65536),Y=t-s*65536,t=O+s+65535,s=Math.floor(t/65536),O=t-s*65536,t=z+s+65535,s=Math.floor(t/65536),z=t-s*65536,t=q+s+65535,s=Math.floor(t/65536),q=t-s*65536,t=D+s+65535,s=Math.floor(t/65536),D=t-s*65536,t=T+s+65535,s=Math.floor(t/65536),T=t-s*65536,l+=s-1+37*(s-1),s=1,t=l+s+65535,s=Math.floor(t/65536),l=t-s*65536,t=d+s+65535,s=Math.floor(t/65536),d=t-s*65536,t=w+s+65535,s=Math.floor(t/65536),w=t-s*65536,t=A+s+65535,s=Math.floor(t/65536),A=t-s*65536,t=L+s+65535,s=Math.floor(t/65536),L=t-s*65536,t=B+s+65535,s=Math.floor(t/65536),B=t-s*65536,t=X+s+65535,s=Math.floor(t/65536),X=t-s*65536,t=M+s+65535,s=Math.floor(t/65536),M=t-s*65536,t=N+s+65535,s=Math.floor(t/65536),N=t-s*65536,t=j+s+65535,s=Math.floor(t/65536),j=t-s*65536,t=Y+s+65535,s=Math.floor(t/65536),Y=t-s*65536,t=O+s+65535,s=Math.floor(t/65536),O=t-s*65536,t=z+s+65535,s=Math.floor(t/65536),z=t-s*65536,t=q+s+65535,s=Math.floor(t/65536),q=t-s*65536,t=D+s+65535,s=Math.floor(t/65536),D=t-s*65536,t=T+s+65535,s=Math.floor(t/65536),T=t-s*65536,l+=s-1+37*(s-1),r[0]=l,r[1]=d,r[2]=w,r[3]=A,r[4]=L,r[5]=B,r[6]=X,r[7]=M,r[8]=N,r[9]=j,r[10]=Y,r[11]=O,r[12]=z,r[13]=q,r[14]=D,r[15]=T;}function Et(r,o){Q(r,o,o);}function Tr(r,o){var f=e(),t;for(t=0;t<16;t++)f[t]=o[t];for(t=253;t>=0;t--)Et(f,f),t!==2&&t!==4&&Q(f,f,o);for(t=0;t<16;t++)r[t]=f[t];}function Ir(r,o){var f=e(),t;for(t=0;t<16;t++)f[t]=o[t];for(t=250;t>=0;t--)Et(f,f),t!==1&&Q(f,f,o);for(t=0;t<16;t++)r[t]=f[t];}function pe(r,o,f){var t=new Uint8Array(32),s=new Float64Array(80),l,d,w=e(),A=e(),L=e(),B=e(),X=e(),M=e();for(d=0;d<31;d++)t[d]=o[d];for(t[31]=o[31]&127|64,t[0]&=248,Ve(s,f),d=0;d<16;d++)A[d]=s[d],B[d]=w[d]=L[d]=0;for(w[0]=B[0]=1,d=254;d>=0;--d)l=t[d>>>3]>>>(d&7)&1,kt(w,A,l),kt(L,B,l),_t(X,w,L),Bt(w,w,L),_t(L,A,B),Bt(A,A,B),Et(B,X),Et(M,w),Q(w,L,w),Q(L,A,X),_t(X,w,L),Bt(w,w,L),Et(A,w),Bt(L,B,M),Q(w,L,y),_t(w,w,B),Q(L,L,w),Q(w,B,M),Q(B,A,s),Et(A,X),kt(w,A,l),kt(L,B,l);for(d=0;d<16;d++)s[d+16]=w[d],s[d+32]=L[d],s[d+48]=A[d],s[d+64]=B[d];var N=s.subarray(32),j=s.subarray(16);return Tr(N,N),Q(j,j,N),Jt(r,j),0}function ye(r,o){return pe(r,o,u)}function Ur(r,o){return i(o,32),ye(r,o)}function be(r,o,f){var t=new Uint8Array(32);return pe(t,f,o),Tt(r,a,t,dt)}var Lr=Ke,ri=Fe;function ni(r,o,f,t,s,l){var d=new Uint8Array(32);return be(d,s,l),Lr(r,o,f,t,d)}function ii(r,o,f,t,s,l){var d=new Uint8Array(32);return be(d,s,l),ri(r,o,f,t,d)}var Rr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Pr(r,o,f,t){for(var s=new Int32Array(16),l=new Int32Array(16),d,w,A,L,B,X,M,N,j,Y,O,z,q,D,T,R,S,I,U,_,x,g,v,b,m,C,P=r[0],K=r[1],H=r[2],F=r[3],c=r[4],J=r[5],tt=r[6],et=r[7],$=o[0],G=o[1],W=o[2],lt=o[3],ft=o[4],st=o[5],at=o[6],ct=o[7],xt=0;t>=128;){for(U=0;U<16;U++)_=8*U+xt,s[U]=f[_+0]<<24|f[_+1]<<16|f[_+2]<<8|f[_+3],l[U]=f[_+4]<<24|f[_+5]<<16|f[_+6]<<8|f[_+7];for(U=0;U<80;U++)if(d=P,w=K,A=H,L=F,B=c,X=J,M=tt,N=et,j=$,Y=G,O=W,z=lt,q=ft,D=st,T=at,R=ct,x=et,g=ct,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=(c>>>14|ft<<18)^(c>>>18|ft<<14)^(ft>>>9|c<<23),g=(ft>>>14|c<<18)^(ft>>>18|c<<14)^(c>>>9|ft<<23),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=c&J^~c&tt,g=ft&st^~ft&at,v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=Rr[U*2],g=Rr[U*2+1],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=s[U%16],g=l[U%16],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,S=m&65535|C<<16,I=v&65535|b<<16,x=S,g=I,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=(P>>>28|$<<4)^($>>>2|P<<30)^($>>>7|P<<25),g=($>>>28|P<<4)^(P>>>2|$<<30)^(P>>>7|$<<25),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=P&K^P&H^K&H,g=$&G^$&W^G&W,v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,N=m&65535|C<<16,R=v&65535|b<<16,x=L,g=z,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=S,g=I,v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,L=m&65535|C<<16,z=v&65535|b<<16,K=d,H=w,F=A,c=L,J=B,tt=X,et=M,P=N,G=j,W=Y,lt=O,ft=z,st=q,at=D,ct=T,$=R,U%16===15)for(_=0;_<16;_++)x=s[_],g=l[_],v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=s[(_+9)%16],g=l[(_+9)%16],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,S=s[(_+1)%16],I=l[(_+1)%16],x=(S>>>1|I<<31)^(S>>>8|I<<24)^S>>>7,g=(I>>>1|S<<31)^(I>>>8|S<<24)^(I>>>7|S<<25),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,S=s[(_+14)%16],I=l[(_+14)%16],x=(S>>>19|I<<13)^(I>>>29|S<<3)^S>>>6,g=(I>>>19|S<<13)^(S>>>29|I<<3)^(I>>>6|S<<26),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,s[_]=m&65535|C<<16,l[_]=v&65535|b<<16;x=P,g=$,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[0],g=o[0],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[0]=P=m&65535|C<<16,o[0]=$=v&65535|b<<16,x=K,g=G,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[1],g=o[1],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[1]=K=m&65535|C<<16,o[1]=G=v&65535|b<<16,x=H,g=W,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[2],g=o[2],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[2]=H=m&65535|C<<16,o[2]=W=v&65535|b<<16,x=F,g=lt,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[3],g=o[3],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[3]=F=m&65535|C<<16,o[3]=lt=v&65535|b<<16,x=c,g=ft,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[4],g=o[4],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[4]=c=m&65535|C<<16,o[4]=ft=v&65535|b<<16,x=J,g=st,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[5],g=o[5],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[5]=J=m&65535|C<<16,o[5]=st=v&65535|b<<16,x=tt,g=at,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[6],g=o[6],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[6]=tt=m&65535|C<<16,o[6]=at=v&65535|b<<16,x=et,g=ct,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[7],g=o[7],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[7]=et=m&65535|C<<16,o[7]=ct=v&65535|b<<16,xt+=128,t-=128;}return t}function qt(r,o,f){var t=new Int32Array(8),s=new Int32Array(8),l=new Uint8Array(256),d,w=f;for(t[0]=1779033703,t[1]=3144134277,t[2]=1013904242,t[3]=2773480762,t[4]=1359893119,t[5]=2600822924,t[6]=528734635,t[7]=1541459225,s[0]=4089235720,s[1]=2227873595,s[2]=4271175723,s[3]=1595750129,s[4]=2917565137,s[5]=725511199,s[6]=4215389547,s[7]=327033209,Pr(t,s,o,f),f%=128,d=0;d<f;d++)l[d]=o[w-f+d];for(l[f]=128,f=256-128*(f<112?1:0),l[f-9]=0,wt(l,f-8,w/536870912|0,w<<3),Pr(t,s,l,f),d=0;d<8;d++)wt(r,8*d,t[d],s[d]);return 0}function we(r,o){var f=e(),t=e(),s=e(),l=e(),d=e(),w=e(),A=e(),L=e(),B=e();Bt(f,r[1],r[0]),Bt(B,o[1],o[0]),Q(f,f,B),_t(t,r[0],r[1]),_t(B,o[0],o[1]),Q(t,t,B),Q(s,r[3],o[3]),Q(s,s,k),Q(l,r[2],o[2]),_t(l,l,l),Bt(d,t,f),Bt(w,l,s),_t(A,l,s),_t(L,t,f),Q(r[0],d,w),Q(r[1],L,A),Q(r[2],A,w),Q(r[3],d,L);}function Nr(r,o,f){var t;for(t=0;t<4;t++)kt(r[t],o[t],f);}function $e(r,o){var f=e(),t=e(),s=e();Tr(s,o[2]),Q(f,o[0],s),Q(t,o[1],s),Jt(r,t),r[31]^=Mr(f)<<7;}function ke(r,o,f){var t,s;for(It(r[0],h),It(r[1],p),It(r[2],p),It(r[3],h),s=255;s>=0;--s)t=f[s/8|0]>>(s&7)&1,Nr(r,o,t),we(o,r),we(r,r),Nr(r,o,t);}function me(r,o){var f=[e(),e(),e(),e()];It(f[0],V),It(f[1],ut),It(f[2],p),Q(f[3],V,ut),ke(r,f,o);}function Je(r,o,f){var t=new Uint8Array(64),s=[e(),e(),e(),e()],l;for(f||i(o,32),qt(t,o,32),t[0]&=248,t[31]&=127,t[31]|=64,me(s,t),$e(r,s),l=0;l<32;l++)o[l+32]=r[l];return 0}var ve=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ze(r,o){var f,t,s,l;for(t=63;t>=32;--t){for(f=0,s=t-32,l=t-12;s<l;++s)o[s]+=f-16*o[t]*ve[s-(t-32)],f=Math.floor((o[s]+128)/256),o[s]-=f*256;o[s]+=f,o[t]=0;}for(f=0,s=0;s<32;s++)o[s]+=f-(o[31]>>4)*ve[s],f=o[s]>>8,o[s]&=255;for(s=0;s<32;s++)o[s]-=f*ve[s];for(t=0;t<32;t++)o[t+1]+=o[t]>>8,r[t]=o[t]&255;}function Qe(r){var o=new Float64Array(64),f;for(f=0;f<64;f++)o[f]=r[f];for(f=0;f<64;f++)r[f]=0;Ze(r,o);}function jr(r,o,f,t){var s=new Uint8Array(64),l=new Uint8Array(64),d=new Uint8Array(64),w,A,L=new Float64Array(64),B=[e(),e(),e(),e()];qt(s,t,32),s[0]&=248,s[31]&=127,s[31]|=64;var X=f+64;for(w=0;w<f;w++)r[64+w]=o[w];for(w=0;w<32;w++)r[32+w]=s[32+w];for(qt(d,r.subarray(32),f+32),Qe(d),me(B,d),$e(r,B),w=32;w<64;w++)r[w]=t[w];for(qt(l,r,f+64),Qe(l),w=0;w<64;w++)L[w]=0;for(w=0;w<32;w++)L[w]=d[w];for(w=0;w<32;w++)for(A=0;A<32;A++)L[w+A]+=l[w]*s[A];return Ze(r.subarray(32),L),X}function fi(r,o){var f=e(),t=e(),s=e(),l=e(),d=e(),w=e(),A=e();return It(r[2],p),Ve(r[1],o),Et(s,r[1]),Q(l,s,E),Bt(s,s,r[2]),_t(l,r[2],l),Et(d,l),Et(w,d),Q(A,w,d),Q(f,A,s),Q(f,f,l),Ir(f,f),Q(f,f,s),Q(f,f,l),Q(f,f,l),Q(r[0],f,l),Et(t,r[0]),Q(t,t,l),Sr(t,s)&&Q(r[0],r[0],it),Et(t,r[0]),Q(t,t,l),Sr(t,s)?-1:(Mr(r[0])===o[31]>>7&&Bt(r[0],h,r[0]),Q(r[3],r[0],r[1]),0)}function Ge(r,o,f,t){var s,l=new Uint8Array(32),d=new Uint8Array(64),w=[e(),e(),e(),e()],A=[e(),e(),e(),e()];if(f<64||fi(A,t))return -1;for(s=0;s<f;s++)r[s]=o[s];for(s=0;s<32;s++)r[s+32]=t[s];if(qt(d,r,f),Qe(d),ke(w,A,d),me(A,o.subarray(32)),we(w,A),$e(l,w),f-=64,Rt(o,0,l,0)){for(s=0;s<f;s++)r[s]=0;return -1}for(s=0;s<f;s++)r[s]=o[s+64];return f}var We=32,Ce=24,ne=32,Zt=16,ie=32,Ee=32,fe=32,oe=32,Xe=32,zr=Ce,oi=ne,si=Zt,Ut=64,Ot=32,Qt=64,tr=32,er=64;n.lowlevel={crypto_core_hsalsa20:Tt,crypto_stream_xor:Oe,crypto_stream:$t,crypto_stream_salsa20_xor:Z,crypto_stream_salsa20:gt,crypto_onetimeauth:Ye,crypto_onetimeauth_verify:Br,crypto_verify_16:vt,crypto_verify_32:Rt,crypto_secretbox:Ke,crypto_secretbox_open:Fe,crypto_scalarmult:pe,crypto_scalarmult_base:ye,crypto_box_beforenm:be,crypto_box_afternm:Lr,crypto_box:ni,crypto_box_open:ii,crypto_box_keypair:Ur,crypto_hash:qt,crypto_sign:jr,crypto_sign_keypair:Je,crypto_sign_open:Ge,crypto_secretbox_KEYBYTES:We,crypto_secretbox_NONCEBYTES:Ce,crypto_secretbox_ZEROBYTES:ne,crypto_secretbox_BOXZEROBYTES:Zt,crypto_scalarmult_BYTES:ie,crypto_scalarmult_SCALARBYTES:Ee,crypto_box_PUBLICKEYBYTES:fe,crypto_box_SECRETKEYBYTES:oe,crypto_box_BEFORENMBYTES:Xe,crypto_box_NONCEBYTES:zr,crypto_box_ZEROBYTES:oi,crypto_box_BOXZEROBYTES:si,crypto_sign_BYTES:Ut,crypto_sign_PUBLICKEYBYTES:Ot,crypto_sign_SECRETKEYBYTES:Qt,crypto_sign_SEEDBYTES:tr,crypto_hash_BYTES:er,gf:e,D:E,L:ve,pack25519:Jt,unpack25519:Ve,M:Q,A:_t,S:Et,Z:Bt,pow2523:Ir,add:we,set25519:It,modL:Ze,scalarmult:ke,scalarbase:me};function Dr(r,o){if(r.length!==We)throw new Error("bad key size");if(o.length!==Ce)throw new Error("bad nonce size")}function ai(r,o){if(r.length!==fe)throw new Error("bad public key size");if(o.length!==oe)throw new Error("bad secret key size")}function Ct(){for(var r=0;r<arguments.length;r++)if(!(arguments[r]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function qr(r){for(var o=0;o<r.length;o++)r[o]=0;}n.randomBytes=function(r){var o=new Uint8Array(r);return i(o,r),o},n.secretbox=function(r,o,f){Ct(r,o,f),Dr(f,o);for(var t=new Uint8Array(ne+r.length),s=new Uint8Array(t.length),l=0;l<r.length;l++)t[l+ne]=r[l];return Ke(s,t,t.length,o,f),s.subarray(Zt)},n.secretbox.open=function(r,o,f){Ct(r,o,f),Dr(f,o);for(var t=new Uint8Array(Zt+r.length),s=new Uint8Array(t.length),l=0;l<r.length;l++)t[l+Zt]=r[l];return t.length<32||Fe(s,t,t.length,o,f)!==0?null:s.subarray(ne)},n.secretbox.keyLength=We,n.secretbox.nonceLength=Ce,n.secretbox.overheadLength=Zt,n.scalarMult=function(r,o){if(Ct(r,o),r.length!==Ee)throw new Error("bad n size");if(o.length!==ie)throw new Error("bad p size");var f=new Uint8Array(ie);return pe(f,r,o),f},n.scalarMult.base=function(r){if(Ct(r),r.length!==Ee)throw new Error("bad n size");var o=new Uint8Array(ie);return ye(o,r),o},n.scalarMult.scalarLength=Ee,n.scalarMult.groupElementLength=ie,n.box=function(r,o,f,t){var s=n.box.before(f,t);return n.secretbox(r,o,s)},n.box.before=function(r,o){Ct(r,o),ai(r,o);var f=new Uint8Array(Xe);return be(f,r,o),f},n.box.after=n.secretbox,n.box.open=function(r,o,f,t){var s=n.box.before(f,t);return n.secretbox.open(r,o,s)},n.box.open.after=n.secretbox.open,n.box.keyPair=function(){var r=new Uint8Array(fe),o=new Uint8Array(oe);return Ur(r,o),{publicKey:r,secretKey:o}},n.box.keyPair.fromSecretKey=function(r){if(Ct(r),r.length!==oe)throw new Error("bad secret key size");var o=new Uint8Array(fe);return ye(o,r),{publicKey:o,secretKey:new Uint8Array(r)}},n.box.publicKeyLength=fe,n.box.secretKeyLength=oe,n.box.sharedKeyLength=Xe,n.box.nonceLength=zr,n.box.overheadLength=n.secretbox.overheadLength,n.sign=function(r,o){if(Ct(r,o),o.length!==Qt)throw new Error("bad secret key size");var f=new Uint8Array(Ut+r.length);return jr(f,r,r.length,o),f},n.sign.open=function(r,o){if(Ct(r,o),o.length!==Ot)throw new Error("bad public key size");var f=new Uint8Array(r.length),t=Ge(f,r,r.length,o);if(t<0)return null;for(var s=new Uint8Array(t),l=0;l<s.length;l++)s[l]=f[l];return s},n.sign.detached=function(r,o){for(var f=n.sign(r,o),t=new Uint8Array(Ut),s=0;s<t.length;s++)t[s]=f[s];return t},n.sign.detached.verify=function(r,o,f){if(Ct(r,o,f),o.length!==Ut)throw new Error("bad signature size");if(f.length!==Ot)throw new Error("bad public key size");var t=new Uint8Array(Ut+r.length),s=new Uint8Array(Ut+r.length),l;for(l=0;l<Ut;l++)t[l]=o[l];for(l=0;l<r.length;l++)t[l+Ut]=r[l];return Ge(s,t,t.length,f)>=0},n.sign.keyPair=function(){var r=new Uint8Array(Ot),o=new Uint8Array(Qt);return Je(r,o),{publicKey:r,secretKey:o}},n.sign.keyPair.fromSecretKey=function(r){if(Ct(r),r.length!==Qt)throw new Error("bad secret key size");for(var o=new Uint8Array(Ot),f=0;f<o.length;f++)o[f]=r[32+f];return {publicKey:o,secretKey:new Uint8Array(r)}},n.sign.keyPair.fromSeed=function(r){if(Ct(r),r.length!==tr)throw new Error("bad seed size");for(var o=new Uint8Array(Ot),f=new Uint8Array(Qt),t=0;t<32;t++)f[t]=r[t];return Je(o,f,true),{publicKey:o,secretKey:f}},n.sign.publicKeyLength=Ot,n.sign.secretKeyLength=Qt,n.sign.seedLength=tr,n.sign.signatureLength=Ut,n.hash=function(r){Ct(r);var o=new Uint8Array(er);return qt(o,r,r.length),o},n.hash.hashLength=er,n.verify=function(r,o){return Ct(r,o),r.length===0||o.length===0||r.length!==o.length?false:mt(r,0,o,0,r.length)===0},n.setPRNG=function(r){i=r;},(function(){var r=typeof self<"u"?self.crypto||self.msCrypto:null;if(r&&r.getRandomValues){var o=65536;n.setPRNG(function(f,t){var s,l=new Uint8Array(t);for(s=0;s<t;s+=o)r.getRandomValues(l.subarray(s,s+Math.min(t-s,o)));for(s=0;s<t;s++)f[s]=l[s];qr(l);});}else typeof Yr<"u"&&(r=Kr(),r&&r.randomBytes&&n.setPRNG(function(f,t){var s,l=r.randomBytes(t);for(s=0;s<t;s++)f[s]=l[s];qr(l);}));})();})(typeof Ae<"u"&&Ae.exports?Ae.exports:self.nacl=self.nacl||{});});var Vr=rt((Hr,_e)=>{(function(n,e){typeof _e<"u"&&_e.exports?_e.exports=e():(n.nacl||(n.nacl={}),n.nacl.util=e());})(Hr,function(){var n={};function e(i){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(i))throw new TypeError("invalid encoding")}return n.decodeUTF8=function(i){if(typeof i!="string")throw new TypeError("expected string");var a,u=unescape(encodeURIComponent(i)),h=new Uint8Array(u.length);for(a=0;a<u.length;a++)h[a]=u.charCodeAt(a);return h},n.encodeUTF8=function(i){var a,u=[];for(a=0;a<i.length;a++)u.push(String.fromCharCode(i[a]));return decodeURIComponent(escape(u.join("")))},typeof atob>"u"?typeof Buffer.from<"u"?(n.encodeBase64=function(i){return Buffer.from(i).toString("base64")},n.decodeBase64=function(i){return e(i),new Uint8Array(Array.prototype.slice.call(Buffer.from(i,"base64"),0))}):(n.encodeBase64=function(i){return new Buffer(i).toString("base64")},n.decodeBase64=function(i){return e(i),new Uint8Array(Array.prototype.slice.call(new Buffer(i,"base64"),0))}):(n.encodeBase64=function(i){var a,u=[],h=i.length;for(a=0;a<h;a++)u.push(String.fromCharCode(i[a]));return btoa(u.join(""))},n.decodeBase64=function(i){e(i);var a,u=atob(i),h=new Uint8Array(u.length);for(a=0;a<u.length;a++)h[a]=u.charCodeAt(a);return h}),n});});var kr=rt((Ef,$r)=>{$r.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then};});var Pt=rt(Yt=>{var rr,pi=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Yt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Yt.getSymbolTotalCodewords=function(e){return pi[e]};Yt.getBCHDigit=function(n){let e=0;for(;n!==0;)e++,n>>>=1;return e};Yt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');rr=e;};Yt.isKanjiModeEnabled=function(){return typeof rr<"u"};Yt.toSJIS=function(e){return rr(e)};});var Be=rt(At=>{At.L={bit:1};At.M={bit:0};At.Q={bit:3};At.H={bit:2};function yi(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case "l":case "low":return At.L;case "m":case "medium":return At.M;case "q":case "quartile":return At.Q;case "h":case "high":return At.H;default:throw new Error("Unknown EC Level: "+n)}}At.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};At.from=function(e,i){if(At.isValid(e))return e;try{return yi(e)}catch{return i}};});var Qr=rt((Bf,Zr)=>{function Jr(){this.buffer=[],this.length=0;}Jr.prototype={get:function(n){let e=Math.floor(n/8);return (this.buffer[e]>>>7-n%8&1)===1},put:function(n,e){for(let i=0;i<e;i++)this.putBit((n>>>e-i-1&1)===1);},getLengthInBits:function(){return this.length},putBit:function(n){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++;}};Zr.exports=Jr;});var Wr=rt((Sf,Gr)=>{function se(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n);}se.prototype.set=function(n,e,i,a){let u=n*this.size+e;this.data[u]=i,a&&(this.reservedBit[u]=true);};se.prototype.get=function(n,e){return this.data[n*this.size+e]};se.prototype.xor=function(n,e,i){this.data[n*this.size+e]^=i;};se.prototype.isReserved=function(n,e){return this.reservedBit[n*this.size+e]};Gr.exports=se;});var Xr=rt(Se=>{var bi=Pt().getSymbolSize;Se.getRowColCoords=function(e){if(e===1)return [];let i=Math.floor(e/7)+2,a=bi(e),u=a===145?26:Math.ceil((a-13)/(2*i-2))*2,h=[a-7];for(let p=1;p<i-1;p++)h[p]=h[p-1]-u;return h.push(6),h.reverse()};Se.getPositions=function(e){let i=[],a=Se.getRowColCoords(e),u=a.length;for(let h=0;h<u;h++)for(let p=0;p<u;p++)h===0&&p===0||h===0&&p===u-1||h===u-1&&p===0||i.push([a[h],a[p]]);return i};});var rn=rt(en=>{var wi=Pt().getSymbolSize,tn=7;en.getPositions=function(e){let i=wi(e);return [[0,0],[i-tn,0],[0,i-tn]]};});var nn=rt(ot=>{ot.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Kt={N1:3,N2:3,N3:40,N4:10};ot.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};ot.from=function(e){return ot.isValid(e)?parseInt(e,10):void 0};ot.getPenaltyN1=function(e){let i=e.size,a=0,u=0,h=0,p=null,y=null;for(let E=0;E<i;E++){u=h=0,p=y=null;for(let k=0;k<i;k++){let V=e.get(E,k);V===p?u++:(u>=5&&(a+=Kt.N1+(u-5)),p=V,u=1),V=e.get(k,E),V===y?h++:(h>=5&&(a+=Kt.N1+(h-5)),y=V,h=1);}u>=5&&(a+=Kt.N1+(u-5)),h>=5&&(a+=Kt.N1+(h-5));}return a};ot.getPenaltyN2=function(e){let i=e.size,a=0;for(let u=0;u<i-1;u++)for(let h=0;h<i-1;h++){let p=e.get(u,h)+e.get(u,h+1)+e.get(u+1,h)+e.get(u+1,h+1);(p===4||p===0)&&a++;}return a*Kt.N2};ot.getPenaltyN3=function(e){let i=e.size,a=0,u=0,h=0;for(let p=0;p<i;p++){u=h=0;for(let y=0;y<i;y++)u=u<<1&2047|e.get(p,y),y>=10&&(u===1488||u===93)&&a++,h=h<<1&2047|e.get(y,p),y>=10&&(h===1488||h===93)&&a++;}return a*Kt.N3};ot.getPenaltyN4=function(e){let i=0,a=e.data.length;for(let h=0;h<a;h++)i+=e.data[h];return Math.abs(Math.ceil(i*100/a/5)-10)*Kt.N4};function mi(n,e,i){switch(n){case ot.Patterns.PATTERN000:return (e+i)%2===0;case ot.Patterns.PATTERN001:return e%2===0;case ot.Patterns.PATTERN010:return i%3===0;case ot.Patterns.PATTERN011:return (e+i)%3===0;case ot.Patterns.PATTERN100:return (Math.floor(e/2)+Math.floor(i/3))%2===0;case ot.Patterns.PATTERN101:return e*i%2+e*i%3===0;case ot.Patterns.PATTERN110:return (e*i%2+e*i%3)%2===0;case ot.Patterns.PATTERN111:return (e*i%3+(e+i)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}ot.applyMask=function(e,i){let a=i.size;for(let u=0;u<a;u++)for(let h=0;h<a;h++)i.isReserved(h,u)||i.xor(h,u,mi(e,h,u));};ot.getBestMask=function(e,i){let a=Object.keys(ot.Patterns).length,u=0,h=1/0;for(let p=0;p<a;p++){i(p),ot.applyMask(p,e);let y=ot.getPenaltyN1(e)+ot.getPenaltyN2(e)+ot.getPenaltyN3(e)+ot.getPenaltyN4(e);ot.applyMask(p,e),y<h&&(h=y,u=p);}return u};});var ir=rt(nr=>{var Nt=Be(),Me=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Te=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];nr.getBlocksCount=function(e,i){switch(i){case Nt.L:return Me[(e-1)*4+0];case Nt.M:return Me[(e-1)*4+1];case Nt.Q:return Me[(e-1)*4+2];case Nt.H:return Me[(e-1)*4+3];default:return}};nr.getTotalCodewordsCount=function(e,i){switch(i){case Nt.L:return Te[(e-1)*4+0];case Nt.M:return Te[(e-1)*4+1];case Nt.Q:return Te[(e-1)*4+2];case Nt.H:return Te[(e-1)*4+3];default:return}};});var fn=rt(Ue=>{var ae=new Uint8Array(512),Ie=new Uint8Array(256);(function(){let e=1;for(let i=0;i<255;i++)ae[i]=e,Ie[e]=i,e<<=1,e&256&&(e^=285);for(let i=255;i<512;i++)ae[i]=ae[i-255];})();Ue.log=function(e){if(e<1)throw new Error("log("+e+")");return Ie[e]};Ue.exp=function(e){return ae[e]};Ue.mul=function(e,i){return e===0||i===0?0:ae[Ie[e]+Ie[i]]};});var on=rt(ce=>{var fr=fn();ce.mul=function(e,i){let a=new Uint8Array(e.length+i.length-1);for(let u=0;u<e.length;u++)for(let h=0;h<i.length;h++)a[u+h]^=fr.mul(e[u],i[h]);return a};ce.mod=function(e,i){let a=new Uint8Array(e);for(;a.length-i.length>=0;){let u=a[0];for(let p=0;p<i.length;p++)a[p]^=fr.mul(i[p],u);let h=0;for(;h<a.length&&a[h]===0;)h++;a=a.slice(h);}return a};ce.generateECPolynomial=function(e){let i=new Uint8Array([1]);for(let a=0;a<e;a++)i=ce.mul(i,new Uint8Array([1,fr.exp(a)]));return i};});var cn=rt((Pf,an)=>{var sn=on();function or(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree);}or.prototype.initialize=function(e){this.degree=e,this.genPoly=sn.generateECPolynomial(this.degree);};or.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let i=new Uint8Array(e.length+this.degree);i.set(e);let a=sn.mod(i,this.genPoly),u=this.degree-a.length;if(u>0){let h=new Uint8Array(this.degree);return h.set(a,u),h}return a};an.exports=or;});var sr=rt(un=>{un.isValid=function(e){return !isNaN(e)&&e>=1&&e<=40};});var ar=rt(Lt=>{var ln="[0-9]+",vi="[A-Z $%*+\\-./:]+",ue="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ue=ue.replace(/u/g,"\\u");var Ci="(?:(?![A-Z0-9 $%*+\\-./:]|"+ue+`)(?:.|[\r
|
|
2
|
-
]))+`;
|
|
3
|
-
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),n.put(i,13);}};
|
|
4
|
-
Suggested mode is: `+nt.toString(a));switch(i===nt.KANJI&&!
|
|
1
|
+
var Pelican=(function(exports){'use strict';var ci=Object.create;var Or=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,di=Object.prototype.hasOwnProperty;var qr=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var rt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var xi=(n,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of ui(e))!di.call(n,l)&&l!==i&&Or(n,l,{get:()=>e[l],enumerable:!(a=li(e,l))||a.enumerable});return n};var gi=(n,e,i)=>(i=n!=null?ci(hi(n)):{},xi(!n||!n.__esModule?Or(i,"default",{value:n,enumerable:true}):i,n));var Yr=rt(()=>{});var Fr=rt((vf,Ae)=>{(function(n){var e=function(r){var o,f=new Float64Array(16);if(r)for(o=0;o<r.length;o++)f[o]=r[o];return f},i=function(){throw new Error("no PRNG")},a=new Uint8Array(16),l=new Uint8Array(32);l[0]=9;var u=e(),p=e([1]),y=e([56129,1]),E=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),V=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),$=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),lt=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),it=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function wt(r,o,f,t){r[o]=f>>24&255,r[o+1]=f>>16&255,r[o+2]=f>>8&255,r[o+3]=f&255,r[o+4]=t>>24&255,r[o+5]=t>>16&255,r[o+6]=t>>8&255,r[o+7]=t&255;}function mt(r,o,f,t,s){var h,d=0;for(h=0;h<s;h++)d|=r[o+h]^f[t+h];return (1&d-1>>>8)-1}function vt(r,o,f,t){return mt(r,o,f,t,16)}function Lt(r,o,f,t){return mt(r,o,f,t,32)}function zt(r,o,f,t){for(var s=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,d=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,w=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,A=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,U=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,_=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,X=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,M=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,N=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,k=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,q=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,j=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,D=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,z=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,T=s,L=h,B=d,I=w,R=A,S=U,x=_,g=X,v=M,b=N,m=k,C=q,P=O,Y=j,K=D,F=z,c,J=0;J<20;J+=2)c=T+P|0,R^=c<<7|c>>>25,c=R+T|0,v^=c<<9|c>>>23,c=v+R|0,P^=c<<13|c>>>19,c=P+v|0,T^=c<<18|c>>>14,c=S+L|0,b^=c<<7|c>>>25,c=b+S|0,Y^=c<<9|c>>>23,c=Y+b|0,L^=c<<13|c>>>19,c=L+Y|0,S^=c<<18|c>>>14,c=m+x|0,K^=c<<7|c>>>25,c=K+m|0,B^=c<<9|c>>>23,c=B+K|0,x^=c<<13|c>>>19,c=x+B|0,m^=c<<18|c>>>14,c=F+C|0,I^=c<<7|c>>>25,c=I+F|0,g^=c<<9|c>>>23,c=g+I|0,C^=c<<13|c>>>19,c=C+g|0,F^=c<<18|c>>>14,c=T+I|0,L^=c<<7|c>>>25,c=L+T|0,B^=c<<9|c>>>23,c=B+L|0,I^=c<<13|c>>>19,c=I+B|0,T^=c<<18|c>>>14,c=S+R|0,x^=c<<7|c>>>25,c=x+S|0,g^=c<<9|c>>>23,c=g+x|0,R^=c<<13|c>>>19,c=R+g|0,S^=c<<18|c>>>14,c=m+b|0,C^=c<<7|c>>>25,c=C+m|0,v^=c<<9|c>>>23,c=v+C|0,b^=c<<13|c>>>19,c=b+v|0,m^=c<<18|c>>>14,c=F+K|0,P^=c<<7|c>>>25,c=P+F|0,Y^=c<<9|c>>>23,c=Y+P|0,K^=c<<13|c>>>19,c=K+Y|0,F^=c<<18|c>>>14;T=T+s|0,L=L+h|0,B=B+d|0,I=I+w|0,R=R+A|0,S=S+U|0,x=x+_|0,g=g+X|0,v=v+M|0,b=b+N|0,m=m+k|0,C=C+q|0,P=P+O|0,Y=Y+j|0,K=K+D|0,F=F+z|0,r[0]=T>>>0&255,r[1]=T>>>8&255,r[2]=T>>>16&255,r[3]=T>>>24&255,r[4]=L>>>0&255,r[5]=L>>>8&255,r[6]=L>>>16&255,r[7]=L>>>24&255,r[8]=B>>>0&255,r[9]=B>>>8&255,r[10]=B>>>16&255,r[11]=B>>>24&255,r[12]=I>>>0&255,r[13]=I>>>8&255,r[14]=I>>>16&255,r[15]=I>>>24&255,r[16]=R>>>0&255,r[17]=R>>>8&255,r[18]=R>>>16&255,r[19]=R>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=x>>>0&255,r[25]=x>>>8&255,r[26]=x>>>16&255,r[27]=x>>>24&255,r[28]=g>>>0&255,r[29]=g>>>8&255,r[30]=g>>>16&255,r[31]=g>>>24&255,r[32]=v>>>0&255,r[33]=v>>>8&255,r[34]=v>>>16&255,r[35]=v>>>24&255,r[36]=b>>>0&255,r[37]=b>>>8&255,r[38]=b>>>16&255,r[39]=b>>>24&255,r[40]=m>>>0&255,r[41]=m>>>8&255,r[42]=m>>>16&255,r[43]=m>>>24&255,r[44]=C>>>0&255,r[45]=C>>>8&255,r[46]=C>>>16&255,r[47]=C>>>24&255,r[48]=P>>>0&255,r[49]=P>>>8&255,r[50]=P>>>16&255,r[51]=P>>>24&255,r[52]=Y>>>0&255,r[53]=Y>>>8&255,r[54]=Y>>>16&255,r[55]=Y>>>24&255,r[56]=K>>>0&255,r[57]=K>>>8&255,r[58]=K>>>16&255,r[59]=K>>>24&255,r[60]=F>>>0&255,r[61]=F>>>8&255,r[62]=F>>>16&255,r[63]=F>>>24&255;}function re(r,o,f,t){for(var s=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,d=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,w=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,A=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,U=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,_=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,X=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,M=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,N=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,k=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,q=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,j=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,D=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,z=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,T=s,L=h,B=d,I=w,R=A,S=U,x=_,g=X,v=M,b=N,m=k,C=q,P=O,Y=j,K=D,F=z,c,J=0;J<20;J+=2)c=T+P|0,R^=c<<7|c>>>25,c=R+T|0,v^=c<<9|c>>>23,c=v+R|0,P^=c<<13|c>>>19,c=P+v|0,T^=c<<18|c>>>14,c=S+L|0,b^=c<<7|c>>>25,c=b+S|0,Y^=c<<9|c>>>23,c=Y+b|0,L^=c<<13|c>>>19,c=L+Y|0,S^=c<<18|c>>>14,c=m+x|0,K^=c<<7|c>>>25,c=K+m|0,B^=c<<9|c>>>23,c=B+K|0,x^=c<<13|c>>>19,c=x+B|0,m^=c<<18|c>>>14,c=F+C|0,I^=c<<7|c>>>25,c=I+F|0,g^=c<<9|c>>>23,c=g+I|0,C^=c<<13|c>>>19,c=C+g|0,F^=c<<18|c>>>14,c=T+I|0,L^=c<<7|c>>>25,c=L+T|0,B^=c<<9|c>>>23,c=B+L|0,I^=c<<13|c>>>19,c=I+B|0,T^=c<<18|c>>>14,c=S+R|0,x^=c<<7|c>>>25,c=x+S|0,g^=c<<9|c>>>23,c=g+x|0,R^=c<<13|c>>>19,c=R+g|0,S^=c<<18|c>>>14,c=m+b|0,C^=c<<7|c>>>25,c=C+m|0,v^=c<<9|c>>>23,c=v+C|0,b^=c<<13|c>>>19,c=b+v|0,m^=c<<18|c>>>14,c=F+K|0,P^=c<<7|c>>>25,c=P+F|0,Y^=c<<9|c>>>23,c=Y+P|0,K^=c<<13|c>>>19,c=K+Y|0,F^=c<<18|c>>>14;r[0]=T>>>0&255,r[1]=T>>>8&255,r[2]=T>>>16&255,r[3]=T>>>24&255,r[4]=S>>>0&255,r[5]=S>>>8&255,r[6]=S>>>16&255,r[7]=S>>>24&255,r[8]=m>>>0&255,r[9]=m>>>8&255,r[10]=m>>>16&255,r[11]=m>>>24&255,r[12]=F>>>0&255,r[13]=F>>>8&255,r[14]=F>>>16&255,r[15]=F>>>24&255,r[16]=x>>>0&255,r[17]=x>>>8&255,r[18]=x>>>16&255,r[19]=x>>>24&255,r[20]=g>>>0&255,r[21]=g>>>8&255,r[22]=g>>>16&255,r[23]=g>>>24&255,r[24]=v>>>0&255,r[25]=v>>>8&255,r[26]=v>>>16&255,r[27]=v>>>24&255,r[28]=b>>>0&255,r[29]=b>>>8&255,r[30]=b>>>16&255,r[31]=b>>>24&255;}function Bt(r,o,f,t){zt(r,o,f,t);}function Tt(r,o,f,t){re(r,o,f,t);}var dt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function W(r,o,f,t,s,h,d){var w=new Uint8Array(16),A=new Uint8Array(64),U,_;for(_=0;_<16;_++)w[_]=0;for(_=0;_<8;_++)w[_]=h[_];for(;s>=64;){for(Bt(A,w,d,dt),_=0;_<64;_++)r[o+_]=f[t+_]^A[_];for(U=1,_=8;_<16;_++)U=U+(w[_]&255)|0,w[_]=U&255,U>>>=8;s-=64,o+=64,t+=64;}if(s>0)for(Bt(A,w,d,dt),_=0;_<s;_++)r[o+_]=f[t+_]^A[_];return 0}function gt(r,o,f,t,s){var h=new Uint8Array(16),d=new Uint8Array(64),w,A;for(A=0;A<16;A++)h[A]=0;for(A=0;A<8;A++)h[A]=t[A];for(;f>=64;){for(Bt(d,h,s,dt),A=0;A<64;A++)r[o+A]=d[A];for(w=1,A=8;A<16;A++)w=w+(h[A]&255)|0,h[A]=w&255,w>>>=8;f-=64,o+=64;}if(f>0)for(Bt(d,h,s,dt),A=0;A<f;A++)r[o+A]=d[A];return 0}function Ht(r,o,f,t,s){var h=new Uint8Array(32);Tt(h,t,s,dt);for(var d=new Uint8Array(8),w=0;w<8;w++)d[w]=t[w+16];return gt(r,o,f,d,h)}function Oe(r,o,f,t,s,h,d){var w=new Uint8Array(32);Tt(w,h,d,dt);for(var A=new Uint8Array(8),U=0;U<8;U++)A[U]=h[U+16];return W(r,o,f,t,s,A,w)}var ge=function(r){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var o,f,t,s,h,d,w,A;o=r[0]&255|(r[1]&255)<<8,this.r[0]=o&8191,f=r[2]&255|(r[3]&255)<<8,this.r[1]=(o>>>13|f<<3)&8191,t=r[4]&255|(r[5]&255)<<8,this.r[2]=(f>>>10|t<<6)&7939,s=r[6]&255|(r[7]&255)<<8,this.r[3]=(t>>>7|s<<9)&8191,h=r[8]&255|(r[9]&255)<<8,this.r[4]=(s>>>4|h<<12)&255,this.r[5]=h>>>1&8190,d=r[10]&255|(r[11]&255)<<8,this.r[6]=(h>>>14|d<<2)&8191,w=r[12]&255|(r[13]&255)<<8,this.r[7]=(d>>>11|w<<5)&8065,A=r[14]&255|(r[15]&255)<<8,this.r[8]=(w>>>8|A<<8)&8191,this.r[9]=A>>>5&127,this.pad[0]=r[16]&255|(r[17]&255)<<8,this.pad[1]=r[18]&255|(r[19]&255)<<8,this.pad[2]=r[20]&255|(r[21]&255)<<8,this.pad[3]=r[22]&255|(r[23]&255)<<8,this.pad[4]=r[24]&255|(r[25]&255)<<8,this.pad[5]=r[26]&255|(r[27]&255)<<8,this.pad[6]=r[28]&255|(r[29]&255)<<8,this.pad[7]=r[30]&255|(r[31]&255)<<8;};ge.prototype.blocks=function(r,o,f){for(var t=this.fin?0:2048,s,h,d,w,A,U,_,X,M,N,k,q,O,j,D,z,T,L,B,I=this.h[0],R=this.h[1],S=this.h[2],x=this.h[3],g=this.h[4],v=this.h[5],b=this.h[6],m=this.h[7],C=this.h[8],P=this.h[9],Y=this.r[0],K=this.r[1],F=this.r[2],c=this.r[3],J=this.r[4],tt=this.r[5],et=this.r[6],H=this.r[7],Q=this.r[8],G=this.r[9];f>=16;)s=r[o+0]&255|(r[o+1]&255)<<8,I+=s&8191,h=r[o+2]&255|(r[o+3]&255)<<8,R+=(s>>>13|h<<3)&8191,d=r[o+4]&255|(r[o+5]&255)<<8,S+=(h>>>10|d<<6)&8191,w=r[o+6]&255|(r[o+7]&255)<<8,x+=(d>>>7|w<<9)&8191,A=r[o+8]&255|(r[o+9]&255)<<8,g+=(w>>>4|A<<12)&8191,v+=A>>>1&8191,U=r[o+10]&255|(r[o+11]&255)<<8,b+=(A>>>14|U<<2)&8191,_=r[o+12]&255|(r[o+13]&255)<<8,m+=(U>>>11|_<<5)&8191,X=r[o+14]&255|(r[o+15]&255)<<8,C+=(_>>>8|X<<8)&8191,P+=X>>>5|t,M=0,N=M,N+=I*Y,N+=R*(5*G),N+=S*(5*Q),N+=x*(5*H),N+=g*(5*et),M=N>>>13,N&=8191,N+=v*(5*tt),N+=b*(5*J),N+=m*(5*c),N+=C*(5*F),N+=P*(5*K),M+=N>>>13,N&=8191,k=M,k+=I*K,k+=R*Y,k+=S*(5*G),k+=x*(5*Q),k+=g*(5*H),M=k>>>13,k&=8191,k+=v*(5*et),k+=b*(5*tt),k+=m*(5*J),k+=C*(5*c),k+=P*(5*F),M+=k>>>13,k&=8191,q=M,q+=I*F,q+=R*K,q+=S*Y,q+=x*(5*G),q+=g*(5*Q),M=q>>>13,q&=8191,q+=v*(5*H),q+=b*(5*et),q+=m*(5*tt),q+=C*(5*J),q+=P*(5*c),M+=q>>>13,q&=8191,O=M,O+=I*c,O+=R*F,O+=S*K,O+=x*Y,O+=g*(5*G),M=O>>>13,O&=8191,O+=v*(5*Q),O+=b*(5*H),O+=m*(5*et),O+=C*(5*tt),O+=P*(5*J),M+=O>>>13,O&=8191,j=M,j+=I*J,j+=R*c,j+=S*F,j+=x*K,j+=g*Y,M=j>>>13,j&=8191,j+=v*(5*G),j+=b*(5*Q),j+=m*(5*H),j+=C*(5*et),j+=P*(5*tt),M+=j>>>13,j&=8191,D=M,D+=I*tt,D+=R*J,D+=S*c,D+=x*F,D+=g*K,M=D>>>13,D&=8191,D+=v*Y,D+=b*(5*G),D+=m*(5*Q),D+=C*(5*H),D+=P*(5*et),M+=D>>>13,D&=8191,z=M,z+=I*et,z+=R*tt,z+=S*J,z+=x*c,z+=g*F,M=z>>>13,z&=8191,z+=v*K,z+=b*Y,z+=m*(5*G),z+=C*(5*Q),z+=P*(5*H),M+=z>>>13,z&=8191,T=M,T+=I*H,T+=R*et,T+=S*tt,T+=x*J,T+=g*c,M=T>>>13,T&=8191,T+=v*F,T+=b*K,T+=m*Y,T+=C*(5*G),T+=P*(5*Q),M+=T>>>13,T&=8191,L=M,L+=I*Q,L+=R*H,L+=S*et,L+=x*tt,L+=g*J,M=L>>>13,L&=8191,L+=v*c,L+=b*F,L+=m*K,L+=C*Y,L+=P*(5*G),M+=L>>>13,L&=8191,B=M,B+=I*G,B+=R*Q,B+=S*H,B+=x*et,B+=g*tt,M=B>>>13,B&=8191,B+=v*J,B+=b*c,B+=m*F,B+=C*K,B+=P*Y,M+=B>>>13,B&=8191,M=(M<<2)+M|0,M=M+N|0,N=M&8191,M=M>>>13,k+=M,I=N,R=k,S=q,x=O,g=j,v=D,b=z,m=T,C=L,P=B,o+=16,f-=16;this.h[0]=I,this.h[1]=R,this.h[2]=S,this.h[3]=x,this.h[4]=g,this.h[5]=v,this.h[6]=b,this.h[7]=m,this.h[8]=C,this.h[9]=P;},ge.prototype.finish=function(r,o){var f=new Uint16Array(10),t,s,h,d;if(this.leftover){for(d=this.leftover,this.buffer[d++]=1;d<16;d++)this.buffer[d]=0;this.fin=1,this.blocks(this.buffer,0,16);}for(t=this.h[1]>>>13,this.h[1]&=8191,d=2;d<10;d++)this.h[d]+=t,t=this.h[d]>>>13,this.h[d]&=8191;for(this.h[0]+=t*5,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,f[0]=this.h[0]+5,t=f[0]>>>13,f[0]&=8191,d=1;d<10;d++)f[d]=this.h[d]+t,t=f[d]>>>13,f[d]&=8191;for(f[9]-=8192,s=(t^1)-1,d=0;d<10;d++)f[d]&=s;for(s=~s,d=0;d<10;d++)this.h[d]=this.h[d]&s|f[d];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,h=this.h[0]+this.pad[0],this.h[0]=h&65535,d=1;d<8;d++)h=(this.h[d]+this.pad[d]|0)+(h>>>16)|0,this.h[d]=h&65535;r[o+0]=this.h[0]>>>0&255,r[o+1]=this.h[0]>>>8&255,r[o+2]=this.h[1]>>>0&255,r[o+3]=this.h[1]>>>8&255,r[o+4]=this.h[2]>>>0&255,r[o+5]=this.h[2]>>>8&255,r[o+6]=this.h[3]>>>0&255,r[o+7]=this.h[3]>>>8&255,r[o+8]=this.h[4]>>>0&255,r[o+9]=this.h[4]>>>8&255,r[o+10]=this.h[5]>>>0&255,r[o+11]=this.h[5]>>>8&255,r[o+12]=this.h[6]>>>0&255,r[o+13]=this.h[6]>>>8&255,r[o+14]=this.h[7]>>>0&255,r[o+15]=this.h[7]>>>8&255;},ge.prototype.update=function(r,o,f){var t,s;if(this.leftover){for(s=16-this.leftover,s>f&&(s=f),t=0;t<s;t++)this.buffer[this.leftover+t]=r[o+t];if(f-=s,o+=s,this.leftover+=s,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0;}if(f>=16&&(s=f-f%16,this.blocks(r,o,s),o+=s,f-=s),f){for(t=0;t<f;t++)this.buffer[this.leftover+t]=r[o+t];this.leftover+=f;}};function qe(r,o,f,t,s,h){var d=new ge(h);return d.update(f,t,s),d.finish(r,o),0}function _r(r,o,f,t,s,h){var d=new Uint8Array(16);return qe(d,0,f,t,s,h),vt(r,o,d,0)}function Ye(r,o,f,t,s){var h;if(f<32)return -1;for(Oe(r,0,o,0,f,t,s),qe(r,16,r,32,f-32,r),h=0;h<16;h++)r[h]=0;return 0}function Fe(r,o,f,t,s){var h,d=new Uint8Array(32);if(f<32||(Ht(d,0,32,t,s),_r(o,16,o,32,f-32,d)!==0))return -1;for(Oe(r,0,o,0,f,t,s),h=0;h<32;h++)r[h]=0;return 0}function It(r,o){var f;for(f=0;f<16;f++)r[f]=o[f]|0;}function Ke(r){var o,f,t=1;for(o=0;o<16;o++)f=r[o]+t+65535,t=Math.floor(f/65536),r[o]=f-t*65536;r[0]+=t-1+37*(t-1);}function Vt(r,o,f){for(var t,s=~(f-1),h=0;h<16;h++)t=s&(r[h]^o[h]),r[h]^=t,o[h]^=t;}function Jt(r,o){var f,t,s,h=e(),d=e();for(f=0;f<16;f++)d[f]=o[f];for(Ke(d),Ke(d),Ke(d),t=0;t<2;t++){for(h[0]=d[0]-65517,f=1;f<15;f++)h[f]=d[f]-65535-(h[f-1]>>16&1),h[f-1]&=65535;h[15]=d[15]-32767-(h[14]>>16&1),s=h[15]>>16&1,h[14]&=65535,Vt(d,h,1-s);}for(f=0;f<16;f++)r[2*f]=d[f]&255,r[2*f+1]=d[f]>>8;}function Br(r,o){var f=new Uint8Array(32),t=new Uint8Array(32);return Jt(f,r),Jt(t,o),Lt(f,0,t,0)}function Mr(r){var o=new Uint8Array(32);return Jt(o,r),o[0]&1}function $e(r,o){var f;for(f=0;f<16;f++)r[f]=o[2*f]+(o[2*f+1]<<8);r[15]&=32767;}function St(r,o,f){for(var t=0;t<16;t++)r[t]=o[t]+f[t];}function _t(r,o,f){for(var t=0;t<16;t++)r[t]=o[t]-f[t];}function Z(r,o,f){var t,s,h=0,d=0,w=0,A=0,U=0,_=0,X=0,M=0,N=0,k=0,q=0,O=0,j=0,D=0,z=0,T=0,L=0,B=0,I=0,R=0,S=0,x=0,g=0,v=0,b=0,m=0,C=0,P=0,Y=0,K=0,F=0,c=f[0],J=f[1],tt=f[2],et=f[3],H=f[4],Q=f[5],G=f[6],ut=f[7],ft=f[8],st=f[9],at=f[10],ct=f[11],xt=f[12],pt=f[13],yt=f[14],bt=f[15];t=o[0],h+=t*c,d+=t*J,w+=t*tt,A+=t*et,U+=t*H,_+=t*Q,X+=t*G,M+=t*ut,N+=t*ft,k+=t*st,q+=t*at,O+=t*ct,j+=t*xt,D+=t*pt,z+=t*yt,T+=t*bt,t=o[1],d+=t*c,w+=t*J,A+=t*tt,U+=t*et,_+=t*H,X+=t*Q,M+=t*G,N+=t*ut,k+=t*ft,q+=t*st,O+=t*at,j+=t*ct,D+=t*xt,z+=t*pt,T+=t*yt,L+=t*bt,t=o[2],w+=t*c,A+=t*J,U+=t*tt,_+=t*et,X+=t*H,M+=t*Q,N+=t*G,k+=t*ut,q+=t*ft,O+=t*st,j+=t*at,D+=t*ct,z+=t*xt,T+=t*pt,L+=t*yt,B+=t*bt,t=o[3],A+=t*c,U+=t*J,_+=t*tt,X+=t*et,M+=t*H,N+=t*Q,k+=t*G,q+=t*ut,O+=t*ft,j+=t*st,D+=t*at,z+=t*ct,T+=t*xt,L+=t*pt,B+=t*yt,I+=t*bt,t=o[4],U+=t*c,_+=t*J,X+=t*tt,M+=t*et,N+=t*H,k+=t*Q,q+=t*G,O+=t*ut,j+=t*ft,D+=t*st,z+=t*at,T+=t*ct,L+=t*xt,B+=t*pt,I+=t*yt,R+=t*bt,t=o[5],_+=t*c,X+=t*J,M+=t*tt,N+=t*et,k+=t*H,q+=t*Q,O+=t*G,j+=t*ut,D+=t*ft,z+=t*st,T+=t*at,L+=t*ct,B+=t*xt,I+=t*pt,R+=t*yt,S+=t*bt,t=o[6],X+=t*c,M+=t*J,N+=t*tt,k+=t*et,q+=t*H,O+=t*Q,j+=t*G,D+=t*ut,z+=t*ft,T+=t*st,L+=t*at,B+=t*ct,I+=t*xt,R+=t*pt,S+=t*yt,x+=t*bt,t=o[7],M+=t*c,N+=t*J,k+=t*tt,q+=t*et,O+=t*H,j+=t*Q,D+=t*G,z+=t*ut,T+=t*ft,L+=t*st,B+=t*at,I+=t*ct,R+=t*xt,S+=t*pt,x+=t*yt,g+=t*bt,t=o[8],N+=t*c,k+=t*J,q+=t*tt,O+=t*et,j+=t*H,D+=t*Q,z+=t*G,T+=t*ut,L+=t*ft,B+=t*st,I+=t*at,R+=t*ct,S+=t*xt,x+=t*pt,g+=t*yt,v+=t*bt,t=o[9],k+=t*c,q+=t*J,O+=t*tt,j+=t*et,D+=t*H,z+=t*Q,T+=t*G,L+=t*ut,B+=t*ft,I+=t*st,R+=t*at,S+=t*ct,x+=t*xt,g+=t*pt,v+=t*yt,b+=t*bt,t=o[10],q+=t*c,O+=t*J,j+=t*tt,D+=t*et,z+=t*H,T+=t*Q,L+=t*G,B+=t*ut,I+=t*ft,R+=t*st,S+=t*at,x+=t*ct,g+=t*xt,v+=t*pt,b+=t*yt,m+=t*bt,t=o[11],O+=t*c,j+=t*J,D+=t*tt,z+=t*et,T+=t*H,L+=t*Q,B+=t*G,I+=t*ut,R+=t*ft,S+=t*st,x+=t*at,g+=t*ct,v+=t*xt,b+=t*pt,m+=t*yt,C+=t*bt,t=o[12],j+=t*c,D+=t*J,z+=t*tt,T+=t*et,L+=t*H,B+=t*Q,I+=t*G,R+=t*ut,S+=t*ft,x+=t*st,g+=t*at,v+=t*ct,b+=t*xt,m+=t*pt,C+=t*yt,P+=t*bt,t=o[13],D+=t*c,z+=t*J,T+=t*tt,L+=t*et,B+=t*H,I+=t*Q,R+=t*G,S+=t*ut,x+=t*ft,g+=t*st,v+=t*at,b+=t*ct,m+=t*xt,C+=t*pt,P+=t*yt,Y+=t*bt,t=o[14],z+=t*c,T+=t*J,L+=t*tt,B+=t*et,I+=t*H,R+=t*Q,S+=t*G,x+=t*ut,g+=t*ft,v+=t*st,b+=t*at,m+=t*ct,C+=t*xt,P+=t*pt,Y+=t*yt,K+=t*bt,t=o[15],T+=t*c,L+=t*J,B+=t*tt,I+=t*et,R+=t*H,S+=t*Q,x+=t*G,g+=t*ut,v+=t*ft,b+=t*st,m+=t*at,C+=t*ct,P+=t*xt,Y+=t*pt,K+=t*yt,F+=t*bt,h+=38*L,d+=38*B,w+=38*I,A+=38*R,U+=38*S,_+=38*x,X+=38*g,M+=38*v,N+=38*b,k+=38*m,q+=38*C,O+=38*P,j+=38*Y,D+=38*K,z+=38*F,s=1,t=h+s+65535,s=Math.floor(t/65536),h=t-s*65536,t=d+s+65535,s=Math.floor(t/65536),d=t-s*65536,t=w+s+65535,s=Math.floor(t/65536),w=t-s*65536,t=A+s+65535,s=Math.floor(t/65536),A=t-s*65536,t=U+s+65535,s=Math.floor(t/65536),U=t-s*65536,t=_+s+65535,s=Math.floor(t/65536),_=t-s*65536,t=X+s+65535,s=Math.floor(t/65536),X=t-s*65536,t=M+s+65535,s=Math.floor(t/65536),M=t-s*65536,t=N+s+65535,s=Math.floor(t/65536),N=t-s*65536,t=k+s+65535,s=Math.floor(t/65536),k=t-s*65536,t=q+s+65535,s=Math.floor(t/65536),q=t-s*65536,t=O+s+65535,s=Math.floor(t/65536),O=t-s*65536,t=j+s+65535,s=Math.floor(t/65536),j=t-s*65536,t=D+s+65535,s=Math.floor(t/65536),D=t-s*65536,t=z+s+65535,s=Math.floor(t/65536),z=t-s*65536,t=T+s+65535,s=Math.floor(t/65536),T=t-s*65536,h+=s-1+37*(s-1),s=1,t=h+s+65535,s=Math.floor(t/65536),h=t-s*65536,t=d+s+65535,s=Math.floor(t/65536),d=t-s*65536,t=w+s+65535,s=Math.floor(t/65536),w=t-s*65536,t=A+s+65535,s=Math.floor(t/65536),A=t-s*65536,t=U+s+65535,s=Math.floor(t/65536),U=t-s*65536,t=_+s+65535,s=Math.floor(t/65536),_=t-s*65536,t=X+s+65535,s=Math.floor(t/65536),X=t-s*65536,t=M+s+65535,s=Math.floor(t/65536),M=t-s*65536,t=N+s+65535,s=Math.floor(t/65536),N=t-s*65536,t=k+s+65535,s=Math.floor(t/65536),k=t-s*65536,t=q+s+65535,s=Math.floor(t/65536),q=t-s*65536,t=O+s+65535,s=Math.floor(t/65536),O=t-s*65536,t=j+s+65535,s=Math.floor(t/65536),j=t-s*65536,t=D+s+65535,s=Math.floor(t/65536),D=t-s*65536,t=z+s+65535,s=Math.floor(t/65536),z=t-s*65536,t=T+s+65535,s=Math.floor(t/65536),T=t-s*65536,h+=s-1+37*(s-1),r[0]=h,r[1]=d,r[2]=w,r[3]=A,r[4]=U,r[5]=_,r[6]=X,r[7]=M,r[8]=N,r[9]=k,r[10]=q,r[11]=O,r[12]=j,r[13]=D,r[14]=z,r[15]=T;}function Et(r,o){Z(r,o,o);}function Tr(r,o){var f=e(),t;for(t=0;t<16;t++)f[t]=o[t];for(t=253;t>=0;t--)Et(f,f),t!==2&&t!==4&&Z(f,f,o);for(t=0;t<16;t++)r[t]=f[t];}function Ir(r,o){var f=e(),t;for(t=0;t<16;t++)f[t]=o[t];for(t=250;t>=0;t--)Et(f,f),t!==1&&Z(f,f,o);for(t=0;t<16;t++)r[t]=f[t];}function pe(r,o,f){var t=new Uint8Array(32),s=new Float64Array(80),h,d,w=e(),A=e(),U=e(),_=e(),X=e(),M=e();for(d=0;d<31;d++)t[d]=o[d];for(t[31]=o[31]&127|64,t[0]&=248,$e(s,f),d=0;d<16;d++)A[d]=s[d],_[d]=w[d]=U[d]=0;for(w[0]=_[0]=1,d=254;d>=0;--d)h=t[d>>>3]>>>(d&7)&1,Vt(w,A,h),Vt(U,_,h),St(X,w,U),_t(w,w,U),St(U,A,_),_t(A,A,_),Et(_,X),Et(M,w),Z(w,U,w),Z(U,A,X),St(X,w,U),_t(w,w,U),Et(A,w),_t(U,_,M),Z(w,U,y),St(w,w,_),Z(U,U,w),Z(w,_,M),Z(_,A,s),Et(A,X),Vt(w,A,h),Vt(U,_,h);for(d=0;d<16;d++)s[d+16]=w[d],s[d+32]=U[d],s[d+48]=A[d],s[d+64]=_[d];var N=s.subarray(32),k=s.subarray(16);return Tr(N,N),Z(k,k,N),Jt(r,k),0}function ye(r,o){return pe(r,o,l)}function Rr(r,o){return i(o,32),ye(r,o)}function be(r,o,f){var t=new Uint8Array(32);return pe(t,f,o),Tt(r,a,t,dt)}var Ur=Ye,ri=Fe;function ni(r,o,f,t,s,h){var d=new Uint8Array(32);return be(d,s,h),Ur(r,o,f,t,d)}function ii(r,o,f,t,s,h){var d=new Uint8Array(32);return be(d,s,h),ri(r,o,f,t,d)}var Lr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Pr(r,o,f,t){for(var s=new Int32Array(16),h=new Int32Array(16),d,w,A,U,_,X,M,N,k,q,O,j,D,z,T,L,B,I,R,S,x,g,v,b,m,C,P=r[0],Y=r[1],K=r[2],F=r[3],c=r[4],J=r[5],tt=r[6],et=r[7],H=o[0],Q=o[1],G=o[2],ut=o[3],ft=o[4],st=o[5],at=o[6],ct=o[7],xt=0;t>=128;){for(R=0;R<16;R++)S=8*R+xt,s[R]=f[S+0]<<24|f[S+1]<<16|f[S+2]<<8|f[S+3],h[R]=f[S+4]<<24|f[S+5]<<16|f[S+6]<<8|f[S+7];for(R=0;R<80;R++)if(d=P,w=Y,A=K,U=F,_=c,X=J,M=tt,N=et,k=H,q=Q,O=G,j=ut,D=ft,z=st,T=at,L=ct,x=et,g=ct,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=(c>>>14|ft<<18)^(c>>>18|ft<<14)^(ft>>>9|c<<23),g=(ft>>>14|c<<18)^(ft>>>18|c<<14)^(c>>>9|ft<<23),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=c&J^~c&tt,g=ft&st^~ft&at,v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=Lr[R*2],g=Lr[R*2+1],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=s[R%16],g=h[R%16],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,B=m&65535|C<<16,I=v&65535|b<<16,x=B,g=I,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=(P>>>28|H<<4)^(H>>>2|P<<30)^(H>>>7|P<<25),g=(H>>>28|P<<4)^(P>>>2|H<<30)^(P>>>7|H<<25),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,x=P&Y^P&K^Y&K,g=H&Q^H&G^Q&G,v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,N=m&65535|C<<16,L=v&65535|b<<16,x=U,g=j,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=B,g=I,v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,U=m&65535|C<<16,j=v&65535|b<<16,Y=d,K=w,F=A,c=U,J=_,tt=X,et=M,P=N,Q=k,G=q,ut=O,ft=j,st=D,at=z,ct=T,H=L,R%16===15)for(S=0;S<16;S++)x=s[S],g=h[S],v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=s[(S+9)%16],g=h[(S+9)%16],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,B=s[(S+1)%16],I=h[(S+1)%16],x=(B>>>1|I<<31)^(B>>>8|I<<24)^B>>>7,g=(I>>>1|B<<31)^(I>>>8|B<<24)^(I>>>7|B<<25),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,B=s[(S+14)%16],I=h[(S+14)%16],x=(B>>>19|I<<13)^(I>>>29|B<<3)^B>>>6,g=(I>>>19|B<<13)^(B>>>29|I<<3)^(I>>>6|B<<26),v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,s[S]=m&65535|C<<16,h[S]=v&65535|b<<16;x=P,g=H,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[0],g=o[0],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[0]=P=m&65535|C<<16,o[0]=H=v&65535|b<<16,x=Y,g=Q,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[1],g=o[1],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[1]=Y=m&65535|C<<16,o[1]=Q=v&65535|b<<16,x=K,g=G,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[2],g=o[2],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[2]=K=m&65535|C<<16,o[2]=G=v&65535|b<<16,x=F,g=ut,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[3],g=o[3],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[3]=F=m&65535|C<<16,o[3]=ut=v&65535|b<<16,x=c,g=ft,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[4],g=o[4],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[4]=c=m&65535|C<<16,o[4]=ft=v&65535|b<<16,x=J,g=st,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[5],g=o[5],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[5]=J=m&65535|C<<16,o[5]=st=v&65535|b<<16,x=tt,g=at,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[6],g=o[6],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[6]=tt=m&65535|C<<16,o[6]=at=v&65535|b<<16,x=et,g=ct,v=g&65535,b=g>>>16,m=x&65535,C=x>>>16,x=r[7],g=o[7],v+=g&65535,b+=g>>>16,m+=x&65535,C+=x>>>16,b+=v>>>16,m+=b>>>16,C+=m>>>16,r[7]=et=m&65535|C<<16,o[7]=ct=v&65535|b<<16,xt+=128,t-=128;}return t}function Dt(r,o,f){var t=new Int32Array(8),s=new Int32Array(8),h=new Uint8Array(256),d,w=f;for(t[0]=1779033703,t[1]=3144134277,t[2]=1013904242,t[3]=2773480762,t[4]=1359893119,t[5]=2600822924,t[6]=528734635,t[7]=1541459225,s[0]=4089235720,s[1]=2227873595,s[2]=4271175723,s[3]=1595750129,s[4]=2917565137,s[5]=725511199,s[6]=4215389547,s[7]=327033209,Pr(t,s,o,f),f%=128,d=0;d<f;d++)h[d]=o[w-f+d];for(h[f]=128,f=256-128*(f<112?1:0),h[f-9]=0,wt(h,f-8,w/536870912|0,w<<3),Pr(t,s,h,f),d=0;d<8;d++)wt(r,8*d,t[d],s[d]);return 0}function we(r,o){var f=e(),t=e(),s=e(),h=e(),d=e(),w=e(),A=e(),U=e(),_=e();_t(f,r[1],r[0]),_t(_,o[1],o[0]),Z(f,f,_),St(t,r[0],r[1]),St(_,o[0],o[1]),Z(t,t,_),Z(s,r[3],o[3]),Z(s,s,V),Z(h,r[2],o[2]),St(h,h,h),_t(d,t,f),_t(w,h,s),St(A,h,s),St(U,t,f),Z(r[0],d,w),Z(r[1],U,A),Z(r[2],A,w),Z(r[3],d,U);}function Nr(r,o,f){var t;for(t=0;t<4;t++)Vt(r[t],o[t],f);}function He(r,o){var f=e(),t=e(),s=e();Tr(s,o[2]),Z(f,o[0],s),Z(t,o[1],s),Jt(r,t),r[31]^=Mr(f)<<7;}function Ve(r,o,f){var t,s;for(It(r[0],u),It(r[1],p),It(r[2],p),It(r[3],u),s=255;s>=0;--s)t=f[s/8|0]>>(s&7)&1,Nr(r,o,t),we(o,r),we(r,r),Nr(r,o,t);}function me(r,o){var f=[e(),e(),e(),e()];It(f[0],$),It(f[1],lt),It(f[2],p),Z(f[3],$,lt),Ve(r,f,o);}function Je(r,o,f){var t=new Uint8Array(64),s=[e(),e(),e(),e()],h;for(f||i(o,32),Dt(t,o,32),t[0]&=248,t[31]&=127,t[31]|=64,me(s,t),He(r,s),h=0;h<32;h++)o[h+32]=r[h];return 0}var ve=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function We(r,o){var f,t,s,h;for(t=63;t>=32;--t){for(f=0,s=t-32,h=t-12;s<h;++s)o[s]+=f-16*o[t]*ve[s-(t-32)],f=Math.floor((o[s]+128)/256),o[s]-=f*256;o[s]+=f,o[t]=0;}for(f=0,s=0;s<32;s++)o[s]+=f-(o[31]>>4)*ve[s],f=o[s]>>8,o[s]&=255;for(s=0;s<32;s++)o[s]-=f*ve[s];for(t=0;t<32;t++)o[t+1]+=o[t]>>8,r[t]=o[t]&255;}function Ze(r){var o=new Float64Array(64),f;for(f=0;f<64;f++)o[f]=r[f];for(f=0;f<64;f++)r[f]=0;We(r,o);}function kr(r,o,f,t){var s=new Uint8Array(64),h=new Uint8Array(64),d=new Uint8Array(64),w,A,U=new Float64Array(64),_=[e(),e(),e(),e()];Dt(s,t,32),s[0]&=248,s[31]&=127,s[31]|=64;var X=f+64;for(w=0;w<f;w++)r[64+w]=o[w];for(w=0;w<32;w++)r[32+w]=s[32+w];for(Dt(d,r.subarray(32),f+32),Ze(d),me(_,d),He(r,_),w=32;w<64;w++)r[w]=t[w];for(Dt(h,r,f+64),Ze(h),w=0;w<64;w++)U[w]=0;for(w=0;w<32;w++)U[w]=d[w];for(w=0;w<32;w++)for(A=0;A<32;A++)U[w+A]+=h[w]*s[A];return We(r.subarray(32),U),X}function fi(r,o){var f=e(),t=e(),s=e(),h=e(),d=e(),w=e(),A=e();return It(r[2],p),$e(r[1],o),Et(s,r[1]),Z(h,s,E),_t(s,s,r[2]),St(h,r[2],h),Et(d,h),Et(w,d),Z(A,w,d),Z(f,A,s),Z(f,f,h),Ir(f,f),Z(f,f,s),Z(f,f,h),Z(f,f,h),Z(r[0],f,h),Et(t,r[0]),Z(t,t,h),Br(t,s)&&Z(r[0],r[0],it),Et(t,r[0]),Z(t,t,h),Br(t,s)?-1:(Mr(r[0])===o[31]>>7&&_t(r[0],u,r[0]),Z(r[3],r[0],r[1]),0)}function Qe(r,o,f,t){var s,h=new Uint8Array(32),d=new Uint8Array(64),w=[e(),e(),e(),e()],A=[e(),e(),e(),e()];if(f<64||fi(A,t))return -1;for(s=0;s<f;s++)r[s]=o[s];for(s=0;s<32;s++)r[s+32]=t[s];if(Dt(d,r,f),Ze(d),Ve(w,A,d),me(A,o.subarray(32)),we(w,A),He(h,w),f-=64,Lt(o,0,h,0)){for(s=0;s<f;s++)r[s]=0;return -1}for(s=0;s<f;s++)r[s]=o[s+64];return f}var Ge=32,Ce=24,ne=32,Wt=16,ie=32,Ee=32,fe=32,oe=32,Xe=32,jr=Ce,oi=ne,si=Wt,Rt=64,Ot=32,Zt=64,tr=32,er=64;n.lowlevel={crypto_core_hsalsa20:Tt,crypto_stream_xor:Oe,crypto_stream:Ht,crypto_stream_salsa20_xor:W,crypto_stream_salsa20:gt,crypto_onetimeauth:qe,crypto_onetimeauth_verify:_r,crypto_verify_16:vt,crypto_verify_32:Lt,crypto_secretbox:Ye,crypto_secretbox_open:Fe,crypto_scalarmult:pe,crypto_scalarmult_base:ye,crypto_box_beforenm:be,crypto_box_afternm:Ur,crypto_box:ni,crypto_box_open:ii,crypto_box_keypair:Rr,crypto_hash:Dt,crypto_sign:kr,crypto_sign_keypair:Je,crypto_sign_open:Qe,crypto_secretbox_KEYBYTES:Ge,crypto_secretbox_NONCEBYTES:Ce,crypto_secretbox_ZEROBYTES:ne,crypto_secretbox_BOXZEROBYTES:Wt,crypto_scalarmult_BYTES:ie,crypto_scalarmult_SCALARBYTES:Ee,crypto_box_PUBLICKEYBYTES:fe,crypto_box_SECRETKEYBYTES:oe,crypto_box_BEFORENMBYTES:Xe,crypto_box_NONCEBYTES:jr,crypto_box_ZEROBYTES:oi,crypto_box_BOXZEROBYTES:si,crypto_sign_BYTES:Rt,crypto_sign_PUBLICKEYBYTES:Ot,crypto_sign_SECRETKEYBYTES:Zt,crypto_sign_SEEDBYTES:tr,crypto_hash_BYTES:er,gf:e,D:E,L:ve,pack25519:Jt,unpack25519:$e,M:Z,A:St,S:Et,Z:_t,pow2523:Ir,add:we,set25519:It,modL:We,scalarmult:Ve,scalarbase:me};function zr(r,o){if(r.length!==Ge)throw new Error("bad key size");if(o.length!==Ce)throw new Error("bad nonce size")}function ai(r,o){if(r.length!==fe)throw new Error("bad public key size");if(o.length!==oe)throw new Error("bad secret key size")}function Ct(){for(var r=0;r<arguments.length;r++)if(!(arguments[r]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Dr(r){for(var o=0;o<r.length;o++)r[o]=0;}n.randomBytes=function(r){var o=new Uint8Array(r);return i(o,r),o},n.secretbox=function(r,o,f){Ct(r,o,f),zr(f,o);for(var t=new Uint8Array(ne+r.length),s=new Uint8Array(t.length),h=0;h<r.length;h++)t[h+ne]=r[h];return Ye(s,t,t.length,o,f),s.subarray(Wt)},n.secretbox.open=function(r,o,f){Ct(r,o,f),zr(f,o);for(var t=new Uint8Array(Wt+r.length),s=new Uint8Array(t.length),h=0;h<r.length;h++)t[h+Wt]=r[h];return t.length<32||Fe(s,t,t.length,o,f)!==0?null:s.subarray(ne)},n.secretbox.keyLength=Ge,n.secretbox.nonceLength=Ce,n.secretbox.overheadLength=Wt,n.scalarMult=function(r,o){if(Ct(r,o),r.length!==Ee)throw new Error("bad n size");if(o.length!==ie)throw new Error("bad p size");var f=new Uint8Array(ie);return pe(f,r,o),f},n.scalarMult.base=function(r){if(Ct(r),r.length!==Ee)throw new Error("bad n size");var o=new Uint8Array(ie);return ye(o,r),o},n.scalarMult.scalarLength=Ee,n.scalarMult.groupElementLength=ie,n.box=function(r,o,f,t){var s=n.box.before(f,t);return n.secretbox(r,o,s)},n.box.before=function(r,o){Ct(r,o),ai(r,o);var f=new Uint8Array(Xe);return be(f,r,o),f},n.box.after=n.secretbox,n.box.open=function(r,o,f,t){var s=n.box.before(f,t);return n.secretbox.open(r,o,s)},n.box.open.after=n.secretbox.open,n.box.keyPair=function(){var r=new Uint8Array(fe),o=new Uint8Array(oe);return Rr(r,o),{publicKey:r,secretKey:o}},n.box.keyPair.fromSecretKey=function(r){if(Ct(r),r.length!==oe)throw new Error("bad secret key size");var o=new Uint8Array(fe);return ye(o,r),{publicKey:o,secretKey:new Uint8Array(r)}},n.box.publicKeyLength=fe,n.box.secretKeyLength=oe,n.box.sharedKeyLength=Xe,n.box.nonceLength=jr,n.box.overheadLength=n.secretbox.overheadLength,n.sign=function(r,o){if(Ct(r,o),o.length!==Zt)throw new Error("bad secret key size");var f=new Uint8Array(Rt+r.length);return kr(f,r,r.length,o),f},n.sign.open=function(r,o){if(Ct(r,o),o.length!==Ot)throw new Error("bad public key size");var f=new Uint8Array(r.length),t=Qe(f,r,r.length,o);if(t<0)return null;for(var s=new Uint8Array(t),h=0;h<s.length;h++)s[h]=f[h];return s},n.sign.detached=function(r,o){for(var f=n.sign(r,o),t=new Uint8Array(Rt),s=0;s<t.length;s++)t[s]=f[s];return t},n.sign.detached.verify=function(r,o,f){if(Ct(r,o,f),o.length!==Rt)throw new Error("bad signature size");if(f.length!==Ot)throw new Error("bad public key size");var t=new Uint8Array(Rt+r.length),s=new Uint8Array(Rt+r.length),h;for(h=0;h<Rt;h++)t[h]=o[h];for(h=0;h<r.length;h++)t[h+Rt]=r[h];return Qe(s,t,t.length,f)>=0},n.sign.keyPair=function(){var r=new Uint8Array(Ot),o=new Uint8Array(Zt);return Je(r,o),{publicKey:r,secretKey:o}},n.sign.keyPair.fromSecretKey=function(r){if(Ct(r),r.length!==Zt)throw new Error("bad secret key size");for(var o=new Uint8Array(Ot),f=0;f<o.length;f++)o[f]=r[32+f];return {publicKey:o,secretKey:new Uint8Array(r)}},n.sign.keyPair.fromSeed=function(r){if(Ct(r),r.length!==tr)throw new Error("bad seed size");for(var o=new Uint8Array(Ot),f=new Uint8Array(Zt),t=0;t<32;t++)f[t]=r[t];return Je(o,f,true),{publicKey:o,secretKey:f}},n.sign.publicKeyLength=Ot,n.sign.secretKeyLength=Zt,n.sign.seedLength=tr,n.sign.signatureLength=Rt,n.hash=function(r){Ct(r);var o=new Uint8Array(er);return Dt(o,r,r.length),o},n.hash.hashLength=er,n.verify=function(r,o){return Ct(r,o),r.length===0||o.length===0||r.length!==o.length?false:mt(r,0,o,0,r.length)===0},n.setPRNG=function(r){i=r;},(function(){var r=typeof self<"u"?self.crypto||self.msCrypto:null;if(r&&r.getRandomValues){var o=65536;n.setPRNG(function(f,t){var s,h=new Uint8Array(t);for(s=0;s<t;s+=o)r.getRandomValues(h.subarray(s,s+Math.min(t-s,o)));for(s=0;s<t;s++)f[s]=h[s];Dr(h);});}else typeof qr<"u"&&(r=Yr(),r&&r.randomBytes&&n.setPRNG(function(f,t){var s,h=r.randomBytes(t);for(s=0;s<t;s++)f[s]=h[s];Dr(h);}));})();})(typeof Ae<"u"&&Ae.exports?Ae.exports:self.nacl=self.nacl||{});});var $r=rt((Kr,Se)=>{(function(n,e){typeof Se<"u"&&Se.exports?Se.exports=e():(n.nacl||(n.nacl={}),n.nacl.util=e());})(Kr,function(){var n={};function e(i){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(i))throw new TypeError("invalid encoding")}return n.decodeUTF8=function(i){if(typeof i!="string")throw new TypeError("expected string");var a,l=unescape(encodeURIComponent(i)),u=new Uint8Array(l.length);for(a=0;a<l.length;a++)u[a]=l.charCodeAt(a);return u},n.encodeUTF8=function(i){var a,l=[];for(a=0;a<i.length;a++)l.push(String.fromCharCode(i[a]));return decodeURIComponent(escape(l.join("")))},typeof atob>"u"?typeof Buffer.from<"u"?(n.encodeBase64=function(i){return Buffer.from(i).toString("base64")},n.decodeBase64=function(i){return e(i),new Uint8Array(Array.prototype.slice.call(Buffer.from(i,"base64"),0))}):(n.encodeBase64=function(i){return new Buffer(i).toString("base64")},n.decodeBase64=function(i){return e(i),new Uint8Array(Array.prototype.slice.call(new Buffer(i,"base64"),0))}):(n.encodeBase64=function(i){var a,l=[],u=i.length;for(a=0;a<u;a++)l.push(String.fromCharCode(i[a]));return btoa(l.join(""))},n.decodeBase64=function(i){e(i);var a,l=atob(i),u=new Uint8Array(l.length);for(a=0;a<l.length;a++)u[a]=l.charCodeAt(a);return u}),n});});var Vr=rt((Ef,Hr)=>{Hr.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then};});var Pt=rt(qt=>{var rr,pi=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];qt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};qt.getSymbolTotalCodewords=function(e){return pi[e]};qt.getBCHDigit=function(n){let e=0;for(;n!==0;)e++,n>>>=1;return e};qt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');rr=e;};qt.isKanjiModeEnabled=function(){return typeof rr<"u"};qt.toSJIS=function(e){return rr(e)};});var _e=rt(At=>{At.L={bit:1};At.M={bit:0};At.Q={bit:3};At.H={bit:2};function yi(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case "l":case "low":return At.L;case "m":case "medium":return At.M;case "q":case "quartile":return At.Q;case "h":case "high":return At.H;default:throw new Error("Unknown EC Level: "+n)}}At.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};At.from=function(e,i){if(At.isValid(e))return e;try{return yi(e)}catch{return i}};});var Zr=rt((_f,Wr)=>{function Jr(){this.buffer=[],this.length=0;}Jr.prototype={get:function(n){let e=Math.floor(n/8);return (this.buffer[e]>>>7-n%8&1)===1},put:function(n,e){for(let i=0;i<e;i++)this.putBit((n>>>e-i-1&1)===1);},getLengthInBits:function(){return this.length},putBit:function(n){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++;}};Wr.exports=Jr;});var Gr=rt((Bf,Qr)=>{function se(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n);}se.prototype.set=function(n,e,i,a){let l=n*this.size+e;this.data[l]=i,a&&(this.reservedBit[l]=true);};se.prototype.get=function(n,e){return this.data[n*this.size+e]};se.prototype.xor=function(n,e,i){this.data[n*this.size+e]^=i;};se.prototype.isReserved=function(n,e){return this.reservedBit[n*this.size+e]};Qr.exports=se;});var Xr=rt(Be=>{var bi=Pt().getSymbolSize;Be.getRowColCoords=function(e){if(e===1)return [];let i=Math.floor(e/7)+2,a=bi(e),l=a===145?26:Math.ceil((a-13)/(2*i-2))*2,u=[a-7];for(let p=1;p<i-1;p++)u[p]=u[p-1]-l;return u.push(6),u.reverse()};Be.getPositions=function(e){let i=[],a=Be.getRowColCoords(e),l=a.length;for(let u=0;u<l;u++)for(let p=0;p<l;p++)u===0&&p===0||u===0&&p===l-1||u===l-1&&p===0||i.push([a[u],a[p]]);return i};});var rn=rt(en=>{var wi=Pt().getSymbolSize,tn=7;en.getPositions=function(e){let i=wi(e);return [[0,0],[i-tn,0],[0,i-tn]]};});var nn=rt(ot=>{ot.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Yt={N1:3,N2:3,N3:40,N4:10};ot.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};ot.from=function(e){return ot.isValid(e)?parseInt(e,10):void 0};ot.getPenaltyN1=function(e){let i=e.size,a=0,l=0,u=0,p=null,y=null;for(let E=0;E<i;E++){l=u=0,p=y=null;for(let V=0;V<i;V++){let $=e.get(E,V);$===p?l++:(l>=5&&(a+=Yt.N1+(l-5)),p=$,l=1),$=e.get(V,E),$===y?u++:(u>=5&&(a+=Yt.N1+(u-5)),y=$,u=1);}l>=5&&(a+=Yt.N1+(l-5)),u>=5&&(a+=Yt.N1+(u-5));}return a};ot.getPenaltyN2=function(e){let i=e.size,a=0;for(let l=0;l<i-1;l++)for(let u=0;u<i-1;u++){let p=e.get(l,u)+e.get(l,u+1)+e.get(l+1,u)+e.get(l+1,u+1);(p===4||p===0)&&a++;}return a*Yt.N2};ot.getPenaltyN3=function(e){let i=e.size,a=0,l=0,u=0;for(let p=0;p<i;p++){l=u=0;for(let y=0;y<i;y++)l=l<<1&2047|e.get(p,y),y>=10&&(l===1488||l===93)&&a++,u=u<<1&2047|e.get(y,p),y>=10&&(u===1488||u===93)&&a++;}return a*Yt.N3};ot.getPenaltyN4=function(e){let i=0,a=e.data.length;for(let u=0;u<a;u++)i+=e.data[u];return Math.abs(Math.ceil(i*100/a/5)-10)*Yt.N4};function mi(n,e,i){switch(n){case ot.Patterns.PATTERN000:return (e+i)%2===0;case ot.Patterns.PATTERN001:return e%2===0;case ot.Patterns.PATTERN010:return i%3===0;case ot.Patterns.PATTERN011:return (e+i)%3===0;case ot.Patterns.PATTERN100:return (Math.floor(e/2)+Math.floor(i/3))%2===0;case ot.Patterns.PATTERN101:return e*i%2+e*i%3===0;case ot.Patterns.PATTERN110:return (e*i%2+e*i%3)%2===0;case ot.Patterns.PATTERN111:return (e*i%3+(e+i)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}ot.applyMask=function(e,i){let a=i.size;for(let l=0;l<a;l++)for(let u=0;u<a;u++)i.isReserved(u,l)||i.xor(u,l,mi(e,u,l));};ot.getBestMask=function(e,i){let a=Object.keys(ot.Patterns).length,l=0,u=1/0;for(let p=0;p<a;p++){i(p),ot.applyMask(p,e);let y=ot.getPenaltyN1(e)+ot.getPenaltyN2(e)+ot.getPenaltyN3(e)+ot.getPenaltyN4(e);ot.applyMask(p,e),y<u&&(u=y,l=p);}return l};});var ir=rt(nr=>{var Nt=_e(),Me=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Te=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];nr.getBlocksCount=function(e,i){switch(i){case Nt.L:return Me[(e-1)*4+0];case Nt.M:return Me[(e-1)*4+1];case Nt.Q:return Me[(e-1)*4+2];case Nt.H:return Me[(e-1)*4+3];default:return}};nr.getTotalCodewordsCount=function(e,i){switch(i){case Nt.L:return Te[(e-1)*4+0];case Nt.M:return Te[(e-1)*4+1];case Nt.Q:return Te[(e-1)*4+2];case Nt.H:return Te[(e-1)*4+3];default:return}};});var fn=rt(Re=>{var ae=new Uint8Array(512),Ie=new Uint8Array(256);(function(){let e=1;for(let i=0;i<255;i++)ae[i]=e,Ie[e]=i,e<<=1,e&256&&(e^=285);for(let i=255;i<512;i++)ae[i]=ae[i-255];})();Re.log=function(e){if(e<1)throw new Error("log("+e+")");return Ie[e]};Re.exp=function(e){return ae[e]};Re.mul=function(e,i){return e===0||i===0?0:ae[Ie[e]+Ie[i]]};});var on=rt(ce=>{var fr=fn();ce.mul=function(e,i){let a=new Uint8Array(e.length+i.length-1);for(let l=0;l<e.length;l++)for(let u=0;u<i.length;u++)a[l+u]^=fr.mul(e[l],i[u]);return a};ce.mod=function(e,i){let a=new Uint8Array(e);for(;a.length-i.length>=0;){let l=a[0];for(let p=0;p<i.length;p++)a[p]^=fr.mul(i[p],l);let u=0;for(;u<a.length&&a[u]===0;)u++;a=a.slice(u);}return a};ce.generateECPolynomial=function(e){let i=new Uint8Array([1]);for(let a=0;a<e;a++)i=ce.mul(i,new Uint8Array([1,fr.exp(a)]));return i};});var cn=rt((Pf,an)=>{var sn=on();function or(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree);}or.prototype.initialize=function(e){this.degree=e,this.genPoly=sn.generateECPolynomial(this.degree);};or.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let i=new Uint8Array(e.length+this.degree);i.set(e);let a=sn.mod(i,this.genPoly),l=this.degree-a.length;if(l>0){let u=new Uint8Array(this.degree);return u.set(a,l),u}return a};an.exports=or;});var sr=rt(ln=>{ln.isValid=function(e){return !isNaN(e)&&e>=1&&e<=40};});var ar=rt(Ut=>{var un="[0-9]+",vi="[A-Z $%*+\\-./:]+",le="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";le=le.replace(/u/g,"\\u");var Ci="(?:(?![A-Z0-9 $%*+\\-./:]|"+le+`)(?:.|[\r
|
|
2
|
+
]))+`;Ut.KANJI=new RegExp(le,"g");Ut.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ut.BYTE=new RegExp(Ci,"g");Ut.NUMERIC=new RegExp(un,"g");Ut.ALPHANUMERIC=new RegExp(vi,"g");var Ei=new RegExp("^"+le+"$"),Ai=new RegExp("^"+un+"$"),Si=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ut.testKanji=function(e){return Ei.test(e)};Ut.testNumeric=function(e){return Ai.test(e)};Ut.testAlphanumeric=function(e){return Si.test(e)};});var kt=rt(ht=>{var _i=sr(),cr=ar();ht.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};ht.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};ht.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};ht.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};ht.MIXED={bit:-1};ht.getCharCountIndicator=function(e,i){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!_i.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?e.ccBits[0]:i<27?e.ccBits[1]:e.ccBits[2]};ht.getBestModeForData=function(e){return cr.testNumeric(e)?ht.NUMERIC:cr.testAlphanumeric(e)?ht.ALPHANUMERIC:cr.testKanji(e)?ht.KANJI:ht.BYTE};ht.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};ht.isValid=function(e){return e&&e.bit&&e.ccBits};function Bi(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case "numeric":return ht.NUMERIC;case "alphanumeric":return ht.ALPHANUMERIC;case "kanji":return ht.KANJI;case "byte":return ht.BYTE;default:throw new Error("Unknown mode: "+n)}}ht.from=function(e,i){if(ht.isValid(e))return e;try{return Bi(e)}catch{return i}};});var pn=rt(Ft=>{var Ue=Pt(),Mi=ir(),hn=_e(),jt=kt(),lr=sr(),xn=7973,dn=Ue.getBCHDigit(xn);function Ti(n,e,i){for(let a=1;a<=40;a++)if(e<=Ft.getCapacity(a,i,n))return a}function gn(n,e){return jt.getCharCountIndicator(n,e)+4}function Ii(n,e){let i=0;return n.forEach(function(a){let l=gn(a.mode,e);i+=l+a.getBitsLength();}),i}function Ri(n,e){for(let i=1;i<=40;i++)if(Ii(n,i)<=Ft.getCapacity(i,e,jt.MIXED))return i}Ft.from=function(e,i){return lr.isValid(e)?parseInt(e,10):i};Ft.getCapacity=function(e,i,a){if(!lr.isValid(e))throw new Error("Invalid QR Code version");typeof a>"u"&&(a=jt.BYTE);let l=Ue.getSymbolTotalCodewords(e),u=Mi.getTotalCodewordsCount(e,i),p=(l-u)*8;if(a===jt.MIXED)return p;let y=p-gn(a,e);switch(a){case jt.NUMERIC:return Math.floor(y/10*3);case jt.ALPHANUMERIC:return Math.floor(y/11*2);case jt.KANJI:return Math.floor(y/13);case jt.BYTE:default:return Math.floor(y/8)}};Ft.getBestVersionForData=function(e,i){let a,l=hn.from(i,hn.M);if(Array.isArray(e)){if(e.length>1)return Ri(e,l);if(e.length===0)return 1;a=e[0];}else a=e;return Ti(a.mode,a.getLength(),l)};Ft.getEncodedBits=function(e){if(!lr.isValid(e)||e<7)throw new Error("Invalid QR Code version");let i=e<<12;for(;Ue.getBCHDigit(i)-dn>=0;)i^=xn<<Ue.getBCHDigit(i)-dn;return e<<12|i};});var mn=rt(wn=>{var ur=Pt(),bn=1335,Ui=21522,yn=ur.getBCHDigit(bn);wn.getEncodedBits=function(e,i){let a=e.bit<<3|i,l=a<<10;for(;ur.getBCHDigit(l)-yn>=0;)l^=bn<<ur.getBCHDigit(l)-yn;return (a<<10|l)^Ui};});var Cn=rt((Of,vn)=>{var Li=kt();function Qt(n){this.mode=Li.NUMERIC,this.data=n.toString();}Qt.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Qt.prototype.getLength=function(){return this.data.length};Qt.prototype.getBitsLength=function(){return Qt.getBitsLength(this.data.length)};Qt.prototype.write=function(e){let i,a,l;for(i=0;i+3<=this.data.length;i+=3)a=this.data.substr(i,3),l=parseInt(a,10),e.put(l,10);let u=this.data.length-i;u>0&&(a=this.data.substr(i),l=parseInt(a,10),e.put(l,u*3+1));};vn.exports=Qt;});var An=rt((qf,En)=>{var Pi=kt(),hr=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Gt(n){this.mode=Pi.ALPHANUMERIC,this.data=n;}Gt.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Gt.prototype.getLength=function(){return this.data.length};Gt.prototype.getBitsLength=function(){return Gt.getBitsLength(this.data.length)};Gt.prototype.write=function(e){let i;for(i=0;i+2<=this.data.length;i+=2){let a=hr.indexOf(this.data[i])*45;a+=hr.indexOf(this.data[i+1]),e.put(a,11);}this.data.length%2&&e.put(hr.indexOf(this.data[i]),6);};En.exports=Gt;});var _n=rt((Yf,Sn)=>{var Ni=kt();function Xt(n){this.mode=Ni.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n);}Xt.getBitsLength=function(e){return e*8};Xt.prototype.getLength=function(){return this.data.length};Xt.prototype.getBitsLength=function(){return Xt.getBitsLength(this.data.length)};Xt.prototype.write=function(n){for(let e=0,i=this.data.length;e<i;e++)n.put(this.data[e],8);};Sn.exports=Xt;});var Mn=rt((Ff,Bn)=>{var ki=kt(),ji=Pt();function te(n){this.mode=ki.KANJI,this.data=n;}te.getBitsLength=function(e){return e*13};te.prototype.getLength=function(){return this.data.length};te.prototype.getBitsLength=function(){return te.getBitsLength(this.data.length)};te.prototype.write=function(n){let e;for(e=0;e<this.data.length;e++){let i=ji.toSJIS(this.data[e]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
3
|
+
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),n.put(i,13);}};Bn.exports=te;});var Tn=rt((Kf,dr)=>{var ue={single_source_shortest_paths:function(n,e,i){var a={},l={};l[e]=0;var u=ue.PriorityQueue.make();u.push(e,0);for(var p,y,E,V,$,lt,it,wt,mt;!u.empty();){p=u.pop(),y=p.value,V=p.cost,$=n[y]||{};for(E in $)$.hasOwnProperty(E)&&(lt=$[E],it=V+lt,wt=l[E],mt=typeof l[E]>"u",(mt||wt>it)&&(l[E]=it,u.push(E,it),a[E]=y));}if(typeof i<"u"&&typeof l[i]>"u"){var vt=["Could not find a path from ",e," to ",i,"."].join("");throw new Error(vt)}return a},extract_shortest_path_from_predecessor_list:function(n,e){for(var i=[],a=e,l;a;)i.push(a),l=n[a],a=n[a];return i.reverse(),i},find_path:function(n,e,i){var a=ue.single_source_shortest_paths(n,e,i);return ue.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(n){var e=ue.PriorityQueue,i={},a;n=n||{};for(a in e)e.hasOwnProperty(a)&&(i[a]=e[a]);return i.queue=[],i.sorter=n.sorter||e.default_sorter,i},default_sorter:function(n,e){return n.cost-e.cost},push:function(n,e){var i={value:n,cost:e};this.queue.push(i),this.queue.sort(this.sorter);},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof dr<"u"&&(dr.exports=ue);});var jn=rt(ee=>{var nt=kt(),Un=Cn(),Ln=An(),Pn=_n(),Nn=Mn(),he=ar(),Le=Pt(),zi=Tn();function In(n){return unescape(encodeURIComponent(n)).length}function de(n,e,i){let a=[],l;for(;(l=n.exec(i))!==null;)a.push({data:l[0],index:l.index,mode:e,length:l[0].length});return a}function kn(n){let e=de(he.NUMERIC,nt.NUMERIC,n),i=de(he.ALPHANUMERIC,nt.ALPHANUMERIC,n),a,l;return Le.isKanjiModeEnabled()?(a=de(he.BYTE,nt.BYTE,n),l=de(he.KANJI,nt.KANJI,n)):(a=de(he.BYTE_KANJI,nt.BYTE,n),l=[]),e.concat(i,a,l).sort(function(p,y){return p.index-y.index}).map(function(p){return {data:p.data,mode:p.mode,length:p.length}})}function xr(n,e){switch(e){case nt.NUMERIC:return Un.getBitsLength(n);case nt.ALPHANUMERIC:return Ln.getBitsLength(n);case nt.KANJI:return Nn.getBitsLength(n);case nt.BYTE:return Pn.getBitsLength(n)}}function Di(n){return n.reduce(function(e,i){let a=e.length-1>=0?e[e.length-1]:null;return a&&a.mode===i.mode?(e[e.length-1].data+=i.data,e):(e.push(i),e)},[])}function Oi(n){let e=[];for(let i=0;i<n.length;i++){let a=n[i];switch(a.mode){case nt.NUMERIC:e.push([a,{data:a.data,mode:nt.ALPHANUMERIC,length:a.length},{data:a.data,mode:nt.BYTE,length:a.length}]);break;case nt.ALPHANUMERIC:e.push([a,{data:a.data,mode:nt.BYTE,length:a.length}]);break;case nt.KANJI:e.push([a,{data:a.data,mode:nt.BYTE,length:In(a.data)}]);break;case nt.BYTE:e.push([{data:a.data,mode:nt.BYTE,length:In(a.data)}]);}}return e}function qi(n,e){let i={},a={start:{}},l=["start"];for(let u=0;u<n.length;u++){let p=n[u],y=[];for(let E=0;E<p.length;E++){let V=p[E],$=""+u+E;y.push($),i[$]={node:V,lastCount:0},a[$]={};for(let lt=0;lt<l.length;lt++){let it=l[lt];i[it]&&i[it].node.mode===V.mode?(a[it][$]=xr(i[it].lastCount+V.length,V.mode)-xr(i[it].lastCount,V.mode),i[it].lastCount+=V.length):(i[it]&&(i[it].lastCount=V.length),a[it][$]=xr(V.length,V.mode)+4+nt.getCharCountIndicator(V.mode,e));}}l=y;}for(let u=0;u<l.length;u++)a[l[u]].end=0;return {map:a,table:i}}function Rn(n,e){let i,a=nt.getBestModeForData(n);if(i=nt.from(e,a),i!==nt.BYTE&&i.bit<a.bit)throw new Error('"'+n+'" cannot be encoded with mode '+nt.toString(i)+`.
|
|
4
|
+
Suggested mode is: `+nt.toString(a));switch(i===nt.KANJI&&!Le.isKanjiModeEnabled()&&(i=nt.BYTE),i){case nt.NUMERIC:return new Un(n);case nt.ALPHANUMERIC:return new Ln(n);case nt.KANJI:return new Nn(n);case nt.BYTE:return new Pn(n)}}ee.fromArray=function(e){return e.reduce(function(i,a){return typeof a=="string"?i.push(Rn(a,null)):a.data&&i.push(Rn(a.data,a.mode)),i},[])};ee.fromString=function(e,i){let a=kn(e,Le.isKanjiModeEnabled()),l=Oi(a),u=qi(l,i),p=zi.find_path(u.map,"start","end"),y=[];for(let E=1;E<p.length-1;E++)y.push(u.table[p[E]].node);return ee.fromArray(Di(y))};ee.rawSplit=function(e){return ee.fromArray(kn(e,Le.isKanjiModeEnabled()))};});var Dn=rt(zn=>{var Ne=Pt(),gr=_e(),Yi=Zr(),Fi=Gr(),Ki=Xr(),$i=rn(),br=nn(),wr=ir(),Hi=cn(),Pe=pn(),Vi=mn(),Ji=kt(),pr=jn();function Wi(n,e){let i=n.size,a=$i.getPositions(e);for(let l=0;l<a.length;l++){let u=a[l][0],p=a[l][1];for(let y=-1;y<=7;y++)if(!(u+y<=-1||i<=u+y))for(let E=-1;E<=7;E++)p+E<=-1||i<=p+E||(y>=0&&y<=6&&(E===0||E===6)||E>=0&&E<=6&&(y===0||y===6)||y>=2&&y<=4&&E>=2&&E<=4?n.set(u+y,p+E,true,true):n.set(u+y,p+E,false,true));}}function Zi(n){let e=n.size;for(let i=8;i<e-8;i++){let a=i%2===0;n.set(i,6,a,true),n.set(6,i,a,true);}}function Qi(n,e){let i=Ki.getPositions(e);for(let a=0;a<i.length;a++){let l=i[a][0],u=i[a][1];for(let p=-2;p<=2;p++)for(let y=-2;y<=2;y++)p===-2||p===2||y===-2||y===2||p===0&&y===0?n.set(l+p,u+y,true,true):n.set(l+p,u+y,false,true);}}function Gi(n,e){let i=n.size,a=Pe.getEncodedBits(e),l,u,p;for(let y=0;y<18;y++)l=Math.floor(y/3),u=y%3+i-8-3,p=(a>>y&1)===1,n.set(l,u,p,true),n.set(u,l,p,true);}function yr(n,e,i){let a=n.size,l=Vi.getEncodedBits(e,i),u,p;for(u=0;u<15;u++)p=(l>>u&1)===1,u<6?n.set(u,8,p,true):u<8?n.set(u+1,8,p,true):n.set(a-15+u,8,p,true),u<8?n.set(8,a-u-1,p,true):u<9?n.set(8,15-u-1+1,p,true):n.set(8,15-u-1,p,true);n.set(a-8,8,1,true);}function Xi(n,e){let i=n.size,a=-1,l=i-1,u=7,p=0;for(let y=i-1;y>0;y-=2)for(y===6&&y--;;){for(let E=0;E<2;E++)if(!n.isReserved(l,y-E)){let V=false;p<e.length&&(V=(e[p]>>>u&1)===1),n.set(l,y-E,V),u--,u===-1&&(p++,u=7);}if(l+=a,l<0||i<=l){l-=a,a=-a;break}}}function tf(n,e,i){let a=new Yi;i.forEach(function(E){a.put(E.mode.bit,4),a.put(E.getLength(),Ji.getCharCountIndicator(E.mode,n)),E.write(a);});let l=Ne.getSymbolTotalCodewords(n),u=wr.getTotalCodewordsCount(n,e),p=(l-u)*8;for(a.getLengthInBits()+4<=p&&a.put(0,4);a.getLengthInBits()%8!==0;)a.putBit(0);let y=(p-a.getLengthInBits())/8;for(let E=0;E<y;E++)a.put(E%2?17:236,8);return ef(a,n,e)}function ef(n,e,i){let a=Ne.getSymbolTotalCodewords(e),l=wr.getTotalCodewordsCount(e,i),u=a-l,p=wr.getBlocksCount(e,i),y=a%p,E=p-y,V=Math.floor(a/p),$=Math.floor(u/p),lt=$+1,it=V-$,wt=new Hi(it),mt=0,vt=new Array(p),Lt=new Array(p),zt=0,re=new Uint8Array(n.buffer);for(let gt=0;gt<p;gt++){let Ht=gt<E?$:lt;vt[gt]=re.slice(mt,mt+Ht),Lt[gt]=wt.encode(vt[gt]),mt+=Ht,zt=Math.max(zt,Ht);}let Bt=new Uint8Array(a),Tt=0,dt,W;for(dt=0;dt<zt;dt++)for(W=0;W<p;W++)dt<vt[W].length&&(Bt[Tt++]=vt[W][dt]);for(dt=0;dt<it;dt++)for(W=0;W<p;W++)Bt[Tt++]=Lt[W][dt];return Bt}function rf(n,e,i,a){let l;if(Array.isArray(n))l=pr.fromArray(n);else if(typeof n=="string"){let V=e;if(!V){let $=pr.rawSplit(n);V=Pe.getBestVersionForData($,i);}l=pr.fromString(n,V||40);}else throw new Error("Invalid data");let u=Pe.getBestVersionForData(l,i);if(!u)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=u;else if(e<u)throw new Error(`
|
|
5
5
|
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
-
Minimum version required to store current data is: `+
|
|
7
|
-
`);let p=tf(e,i,
|
|
8
|
-
`;return typeof a=="function"&&a(null,it),it};});var $n=rt(xe=>{var af=kr(),Er=qn(),Vn=Yn(),cf=Hn();function Ar(n,e,i,a,u){let h=[].slice.call(arguments,1),p=h.length,y=typeof h[p-1]=="function";if(!y&&!af())throw new Error("Callback required as last argument");if(y){if(p<2)throw new Error("Too few arguments provided");p===2?(u=i,i=e,e=a=void 0):p===3&&(e.getContext&&typeof u>"u"?(u=a,a=void 0):(u=a,a=i,i=e,e=void 0));}else {if(p<1)throw new Error("Too few arguments provided");return p===1?(i=e,e=a=void 0):p===2&&!e.getContext&&(a=i,i=e,e=void 0),new Promise(function(E,k){try{let V=Er.create(i,a);E(n(V,e,a));}catch(V){k(V);}})}try{let E=Er.create(i,a);u(null,n(E,e,a));}catch(E){u(E);}}xe.create=Er.create;xe.toCanvas=Ar.bind(null,Vn.render);xe.toDataURL=Ar.bind(null,Vn.renderToDataURL);xe.toString=Ar.bind(null,function(n,e,i){return cf.render(n,i)});});var Xn=rt(Mt=>{var uf=Fr(),Vt=Vr(),lf=$n();function kn(n){return n&&n.__esModule?n:{default:n}}var ze=kn(uf),hf=kn(lf),Jn=class{generateSymmetricKey(){let n=ze.default.randomBytes(32);return Vt.encodeBase64(n)}encryptSymmetric({plaintext:n,keyString:e}){let i=Vt.decodeBase64(e),a=ze.default.randomBytes(24),u=new TextEncoder().encode(n),h=ze.default.secretbox(u,a,i);return {cipher:Vt.encodeBase64(h),nonce:Vt.encodeBase64(a)}}decryptSymmetric({encrypted:n,keyString:e}){try{let i=Vt.decodeBase64(e),a=Vt.decodeBase64(n.cipher),u=Vt.decodeBase64(n.nonce),h=ze.default.secretbox.open(a,u,i);if(!h)throw new Error("Decryption failed - invalid key or corrupted data");return new TextDecoder().decode(h)}catch(i){return console.error("Decryption failed",i),null}}},df=Jn,xf=class{constructor(){this.prefix="pelican_auth_",this.defaultTTL=300*1e3,this.memoryCache=new Map;}set(n,e,i={}){let{ttlMs:a=this.defaultTTL,useSessionStorage:u=true}=i,h=Date.now()+a,p={value:e,expiresAt:h};if(u)try{sessionStorage.setItem(`${this.prefix}${n}`,JSON.stringify(p));}catch(y){console.warn("SessionStorage unavailable, using memory:",y),this.setMemory(n,p);}else this.setMemory(n,p);}get(n){try{let e=sessionStorage.getItem(`${this.prefix}${n}`);if(e){let i=JSON.parse(e);return Date.now()>i.expiresAt?(this.remove(n),null):i.value}}catch{}return this.getMemory(n)}remove(n){try{sessionStorage.removeItem(`${this.prefix}${n}`);}catch{}this.memoryCache.delete(n);}clear(){try{Object.keys(sessionStorage).forEach(n=>{n.startsWith(this.prefix)&&sessionStorage.removeItem(n);});}catch{}this.memoryCache.clear();}setMemory(n,e){this.memoryCache.set(n,e);let i=e.expiresAt-Date.now();setTimeout(()=>{this.memoryCache.delete(n);},i);}getMemory(n){let e=this.memoryCache.get(n);return e?Date.now()>e.expiresAt?(this.memoryCache.delete(n),null):e.value:null}},qe=new xf,Zn=(n,e,i)=>{qe.set("session",{sessionId:n,sessionKey:e},{ttlMs:i});},Qn=()=>qe.get("session"),De=()=>{qe.remove("session");},gf=()=>{qe.clear();},Gn=class{constructor(){this.state="idle",this.listeners=new Set;}get current(){return this.state}transition(n){this.state=n,this.listeners.forEach(e=>e(n));}subscribe(n){return this.listeners.add(n),()=>this.listeners.delete(n)}},Wn=class{constructor(n){this.reconnectAttempts=0,this.maxReconnectAttempts=5,this.isExplicitlyClosed=false,this.handlers=n;}connect(n){this.url=n,this.isExplicitlyClosed=false,this.socket=new WebSocket(n),this.socket.onopen=()=>{this.reconnectAttempts=0,this.handlers.onOpen?.();},this.socket.onmessage=e=>{try{let i=JSON.parse(e.data);this.handlers.onMessage?.(i);}catch(i){console.error("Failed to parse message",i);}},this.socket.onerror=e=>{this.handlers.onError?.(e);},this.socket.onclose=e=>{this.handlers.onClose?.(e),this.isExplicitlyClosed||this.attemptReconnect();};}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.error("\u274C Max reconnect attempts reached");return}this.reconnectAttempts++;let n=Math.pow(2,this.reconnectAttempts)*500;setTimeout(()=>{this.url&&this.connect(this.url);},n);}send(n){this.socket?.readyState===WebSocket.OPEN&&this.socket.send(JSON.stringify(n));}close(){this.isExplicitlyClosed=true,this.socket?.close();}},_r="https://identityapi.pelicanidentity.com",pf=class{constructor(n){if(this.crypto=new df,this.stateMachine=new Gn,this.sessionId="",this.sessionKey=null,this.listeners={},!n.publicKey)throw new Error("Missing publicKey");if(!n.projectId)throw new Error("Missing projectId");if(!n.authType)throw new Error("Missing authType");this.config={continuousMode:false,forceQRCode:false,...n},this.stateMachine.subscribe(e=>this.emit("state",e)),this.attachVisibilityRecovery();}on(n,e){var i;return (i=this.listeners)[n]??(i[n]=new Set),this.listeners[n].add(e),()=>this.listeners[n].delete(e)}async start(){if(this.stateMachine.current==="idle"){this.resetSession(),De(),this.stateMachine.transition("initializing");try{let n=await this.fetchRelayUrl();this.sessionKey=this.crypto.generateSymmetricKey(),this.sessionId=crypto.randomUUID()+crypto.randomUUID(),this.transport=new Wn({onOpen:()=>{this.transport.send({type:"register",sessionID:this.sessionId,...this.config}),this.stateMachine.transition("awaiting-pair");},onMessage:e=>this.handleMessage(e),onError:()=>this.fail(new Error("WebSocket connection failed"))}),this.transport.connect(n),await this.emitEntryPoint();}catch(n){this.fail(n instanceof Error?n:new Error("Start failed"));}}}stop(){this.terminate(false);}async fetchRelayUrl(){let{publicKey:n,projectId:e,authType:i}=this.config,a=await fetch(`${_r}/relay?public_key=${n}&auth_type=${i}&project_id=${e}`);if(!a.ok){let h=await a.text();throw new Error(h)}return (await a.json()).relay_url}async emitEntryPoint(){let n={sessionID:this.sessionId,sessionKey:this.sessionKey,publicKey:this.config.publicKey,authType:this.config.authType,projectId:this.config.projectId,url:window.location.href};if(!(this.config.forceQRCode||!/Android|iPhone|iPad/i.test(navigator.userAgent))&&this.sessionKey)Zn(this.sessionId,this.sessionKey,5*6e4),this.emit("deeplink",`pelicanvault://auth/deep-link?sessionID=${encodeURIComponent(this.sessionId)}&sessionKey=${encodeURIComponent(this.sessionKey)}&publicKey=${encodeURIComponent(this.config.publicKey)}&authType=${this.config.authType}&projectId=${encodeURIComponent(this.config.projectId)}&url=${encodeURIComponent(window.location.href)}`);else {let i=await hf.default.toDataURL(JSON.stringify(n),{type:"image/png",scale:3,color:{light:"#ffffff",dark:"#424242ff"}});this.emit("qr",i);}}handleMessage(n){switch(n.type){case "paired":this.stateMachine.transition("paired"),this.transport.send({type:"authenticate",sessionID:this.sessionId,...this.config,url:window.location.href});return;case "phone-auth-success":this.handleAuthSuccess(n);return;case "phone-terminated":this.fail(new Error("Authenticating device terminated the connection")),this.restartIfContinuous();return;case "confirmed":this.terminate(true),this.restartIfContinuous();return}}handleAuthSuccess(n){if(!this.sessionKey||!n.cipher||!n.nonce){this.fail(new Error("Invalid authentication payload")),this.restartIfContinuous();return}try{let e=this.crypto.decryptSymmetric({encrypted:{cipher:n.cipher,nonce:n.nonce},keyString:this.sessionKey});if(!e){this.fail(new Error("Invalid authentication data")),this.restartIfContinuous();return}let i=JSON.parse(e);this.emit("success",i),this.stateMachine.transition("authenticated"),this.transport?.send({type:"confirm",sessionID:this.sessionId});}catch{this.fail(new Error("Failed to decrypt authentication data")),this.restartIfContinuous();}}async getCachedEntry(n){try{let e=await fetch(`${_r}/session?session_id=${n.sessionId}`);if(!e.ok)throw new Error("Invalid session");let i=await e.json(),a=this.crypto.decryptSymmetric({encrypted:{cipher:i.cipher,nonce:i.nonce},keyString:n.sessionKey});if(!a){this.fail(new Error("Invalid session data")),this.restartIfContinuous();return}let u=JSON.parse(a);this.emit("success",u),De();}catch{this.fail(new Error("Session recovery failed")),this.restartIfContinuous();}}attachVisibilityRecovery(){this.visibilityHandler=async()=>{if(document.visibilityState!=="visible")return;let n=Qn();n&&await this.getCachedEntry(n);},document.addEventListener("visibilitychange",this.visibilityHandler);}detachVisibilityRecovery(){this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=void 0);}terminate(n){n||this.transport?.send({type:"client-terminated",sessionID:this.sessionId,projectId:this.config.projectId,publicKey:this.config.publicKey,authType:this.config.authType}),this.transport?.close(),De(),this.resetSession(),this.config.continuousMode||this.detachVisibilityRecovery(),this.stateMachine.transition(n?"confirmed":"idle");}restartIfContinuous(){this.stateMachine.transition("idle"),this.transport?.close(),this.config.continuousMode&&setTimeout(()=>{this.start();},150);}resetSession(){this.sessionId="",this.sessionKey=null;}destroy(){this.detachVisibilityRecovery(),this.transport?.close(),this.listeners={};}emit(n,e){this.listeners[n]?.forEach(i=>i(e));}fail(n){this.emit("error",n),this.stateMachine.transition("error");}};Mt.BASEURL=_r;Mt.CryptoService=Jn;Mt.PelicanAuthentication=pf;Mt.StateMachine=Gn;Mt.Transport=Wn;Mt.clearAllAuthData=gf;Mt.clearAuthSession=De;Mt.getAuthSession=Qn;Mt.storeAuthSession=Zn;});var ti=gi(Xn());function yf(){if(document.getElementById("pelican-auth-styles"))return;let n=document.createElement("style");n.id="pelican-auth-styles",n.textContent=`@keyframes fadeUp {
|
|
6
|
+
Minimum version required to store current data is: `+u+`.
|
|
7
|
+
`);let p=tf(e,i,l),y=Ne.getSymbolSize(e),E=new Fi(y);return Wi(E,e),Zi(E),Qi(E,e),yr(E,i,0),e>=7&&Gi(E,e),Xi(E,p),isNaN(a)&&(a=br.getBestMask(E,yr.bind(null,E,i))),br.applyMask(a,E),yr(E,i,a),{modules:E,version:e,errorCorrectionLevel:i,maskPattern:a,segments:l}}zn.create=function(e,i){if(typeof e>"u"||e==="")throw new Error("No input text");let a=gr.M,l,u;return typeof i<"u"&&(a=gr.from(i.errorCorrectionLevel,gr.M),l=Pe.from(i.version),u=br.from(i.maskPattern),i.toSJISFunc&&Ne.setToSJISFunction(i.toSJISFunc)),rf(e,l,a,u)};});var mr=rt(Kt=>{function On(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let e=n.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+n);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(a){return [a,a]}))),e.length===6&&e.push("F","F");let i=parseInt(e.join(""),16);return {r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+e.slice(0,6).join("")}}Kt.getOptions=function(e){e||(e={}),e.color||(e.color={});let i=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,a=e.width&&e.width>=21?e.width:void 0,l=e.scale||4;return {width:a,scale:a?4:l,margin:i,color:{dark:On(e.color.dark||"#000000ff"),light:On(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}};Kt.getScale=function(e,i){return i.width&&i.width>=e+i.margin*2?i.width/(e+i.margin*2):i.scale};Kt.getImageWidth=function(e,i){let a=Kt.getScale(e,i);return Math.floor((e+i.margin*2)*a)};Kt.qrToImageData=function(e,i,a){let l=i.modules.size,u=i.modules.data,p=Kt.getScale(l,a),y=Math.floor((l+a.margin*2)*p),E=a.margin*p,V=[a.color.light,a.color.dark];for(let $=0;$<y;$++)for(let lt=0;lt<y;lt++){let it=($*y+lt)*4,wt=a.color.light;if($>=E&<>=E&&$<y-E&<<y-E){let mt=Math.floor(($-E)/p),vt=Math.floor((lt-E)/p);wt=V[u[mt*l+vt]?1:0];}e[it++]=wt.r,e[it++]=wt.g,e[it++]=wt.b,e[it]=wt.a;}};});var qn=rt(ke=>{var vr=mr();function nf(n,e,i){n.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=i,e.width=i,e.style.height=i+"px",e.style.width=i+"px";}function ff(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}ke.render=function(e,i,a){let l=a,u=i;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),i||(u=ff()),l=vr.getOptions(l);let p=vr.getImageWidth(e.modules.size,l),y=u.getContext("2d"),E=y.createImageData(p,p);return vr.qrToImageData(E.data,e,l),nf(y,u,p),y.putImageData(E,0,0),u};ke.renderToDataURL=function(e,i,a){let l=a;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),l||(l={});let u=ke.render(e,i,l),p=l.type||"image/png",y=l.rendererOpts||{};return u.toDataURL(p,y.quality)};});var Kn=rt(Fn=>{var of=mr();function Yn(n,e){let i=n.a/255,a=e+'="'+n.hex+'"';return i<1?a+" "+e+'-opacity="'+i.toFixed(2).slice(1)+'"':a}function Cr(n,e,i){let a=n+e;return typeof i<"u"&&(a+=" "+i),a}function sf(n,e,i){let a="",l=0,u=false,p=0;for(let y=0;y<n.length;y++){let E=Math.floor(y%e),V=Math.floor(y/e);!E&&!u&&(u=true),n[y]?(p++,y>0&&E>0&&n[y-1]||(a+=u?Cr("M",E+i,.5+V+i):Cr("m",l,0),l=0,u=false),E+1<e&&n[y+1]||(a+=Cr("h",p),p=0)):l++;}return a}Fn.render=function(e,i,a){let l=of.getOptions(i),u=e.modules.size,p=e.modules.data,y=u+l.margin*2,E=l.color.light.a?"<path "+Yn(l.color.light,"fill")+' d="M0 0h'+y+"v"+y+'H0z"/>':"",V="<path "+Yn(l.color.dark,"stroke")+' d="'+sf(p,u,l.margin)+'"/>',$='viewBox="0 0 '+y+" "+y+'"',it='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+$+' shape-rendering="crispEdges">'+E+V+`</svg>
|
|
8
|
+
`;return typeof a=="function"&&a(null,it),it};});var Hn=rt(xe=>{var af=Vr(),Er=Dn(),$n=qn(),cf=Kn();function Ar(n,e,i,a,l){let u=[].slice.call(arguments,1),p=u.length,y=typeof u[p-1]=="function";if(!y&&!af())throw new Error("Callback required as last argument");if(y){if(p<2)throw new Error("Too few arguments provided");p===2?(l=i,i=e,e=a=void 0):p===3&&(e.getContext&&typeof l>"u"?(l=a,a=void 0):(l=a,a=i,i=e,e=void 0));}else {if(p<1)throw new Error("Too few arguments provided");return p===1?(i=e,e=a=void 0):p===2&&!e.getContext&&(a=i,i=e,e=void 0),new Promise(function(E,V){try{let $=Er.create(i,a);E(n($,e,a));}catch($){V($);}})}try{let E=Er.create(i,a);l(null,n(E,e,a));}catch(E){l(E);}}xe.create=Er.create;xe.toCanvas=Ar.bind(null,$n.render);xe.toDataURL=Ar.bind(null,$n.renderToDataURL);xe.toString=Ar.bind(null,function(n,e,i){return cf.render(n,i)});});var Xn=rt(Mt=>{var lf=Fr(),$t=$r(),uf=Hn();function Vn(n){return n&&n.__esModule?n:{default:n}}var je=Vn(lf),hf=Vn(uf),Jn=class{generateSymmetricKey(){let n=je.default.randomBytes(32);return $t.encodeBase64(n)}encryptSymmetric({plaintext:n,keyString:e}){let i=$t.decodeBase64(e),a=je.default.randomBytes(24),l=new TextEncoder().encode(n),u=je.default.secretbox(l,a,i);return {cipher:$t.encodeBase64(u),nonce:$t.encodeBase64(a)}}decryptSymmetric({encrypted:n,keyString:e}){try{let i=$t.decodeBase64(e),a=$t.decodeBase64(n.cipher),l=$t.decodeBase64(n.nonce),u=je.default.secretbox.open(a,l,i);if(!u)throw new Error("Decryption failed - invalid key or corrupted data");return new TextDecoder().decode(u)}catch(i){return console.error("Decryption failed",i),null}}},df=Jn,xf=class{constructor(){this.prefix="pelican_auth_",this.defaultTTL=300*1e3,this.memoryCache=new Map;}set(n,e,i={}){let{ttlMs:a=this.defaultTTL,useSessionStorage:l=true}=i,u=Date.now()+a,p={value:e,expiresAt:u};if(l)try{sessionStorage.setItem(`${this.prefix}${n}`,JSON.stringify(p));}catch(y){console.warn("SessionStorage unavailable, using memory:",y),this.setMemory(n,p);}else this.setMemory(n,p);}get(n){try{let e=sessionStorage.getItem(`${this.prefix}${n}`);if(e){let i=JSON.parse(e);return Date.now()>i.expiresAt?(this.remove(n),null):i.value}}catch{}return this.getMemory(n)}remove(n){try{sessionStorage.removeItem(`${this.prefix}${n}`);}catch{}this.memoryCache.delete(n);}clear(){try{Object.keys(sessionStorage).forEach(n=>{n.startsWith(this.prefix)&&sessionStorage.removeItem(n);});}catch{}this.memoryCache.clear();}setMemory(n,e){this.memoryCache.set(n,e);let i=e.expiresAt-Date.now();setTimeout(()=>{this.memoryCache.delete(n);},i);}getMemory(n){let e=this.memoryCache.get(n);return e?Date.now()>e.expiresAt?(this.memoryCache.delete(n),null):e.value:null}},De=new xf,Wn=(n,e,i)=>{De.set("session",{sessionId:n,sessionKey:e},{ttlMs:i});},Zn=()=>De.get("session"),ze=()=>{De.remove("session");},gf=()=>{De.clear();},Qn=class{constructor(){this.state="idle",this.listeners=new Set;}get current(){return this.state}transition(n){this.state=n,this.listeners.forEach(e=>e(n));}subscribe(n){return this.listeners.add(n),()=>this.listeners.delete(n)}},Gn=class{constructor(n){this.reconnectAttempts=0,this.maxReconnectAttempts=3,this.isExplicitlyClosed=false,this.isReconnecting=false,this.handlers=n;}connect(n){this.url=n,this.isExplicitlyClosed=false,this.socket&&(this.socket.onclose=null,this.socket.onerror=null,this.socket.onmessage=null,this.socket.onopen=null,(this.socket.readyState===WebSocket.OPEN||this.socket.readyState===WebSocket.CONNECTING)&&this.socket.close()),this.socket=new WebSocket(n),this.socket.onopen=()=>{this.reconnectAttempts=0,this.isReconnecting=false,this.handlers.onOpen?.();},this.socket.onmessage=e=>{try{let i=JSON.parse(e.data);this.handlers.onMessage?.(i);}catch(i){console.error("Failed to parse WebSocket message",i);}},this.socket.onerror=e=>{!this.isReconnecting&&!this.isExplicitlyClosed&&this.handlers.onError?.(e);},this.socket.onclose=e=>{this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0),this.isReconnecting||this.handlers.onClose?.(e),!this.isExplicitlyClosed&&!this.isReconnecting&&this.reconnectAttempts<this.maxReconnectAttempts&&this.attemptReconnect();};}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.warn("Max WebSocket reconnect attempts reached");return}this.isReconnecting=true,this.reconnectAttempts++;let n=Math.min(Math.pow(2,this.reconnectAttempts-1)*500,2e3);console.log(`Reconnecting WebSocket (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts}) in ${n}ms...`),this.reconnectTimeout=window.setTimeout(()=>{this.url&&!this.isExplicitlyClosed&&this.connect(this.url);},n);}send(n){if(this.socket?.readyState===WebSocket.OPEN)try{this.socket.send(JSON.stringify(n));}catch(e){console.error("Failed to send WebSocket message:",e);}else console.warn("WebSocket not open, message not sent:",this.socket?.readyState);}close(){this.isExplicitlyClosed=true,this.isReconnecting=false,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0),this.socket&&(this.socket.onclose=null,this.socket.onerror=null,this.socket.onmessage=null,this.socket.onopen=null,(this.socket.readyState===WebSocket.OPEN||this.socket.readyState===WebSocket.CONNECTING)&&this.socket.close(),this.socket=void 0);}get readyState(){return this.socket?.readyState}get isOpen(){return this.socket?.readyState===WebSocket.OPEN}},Sr="https://identityapi.pelicanidentity.com",pf=class{constructor(n){if(this.crypto=new df,this.stateMachine=new Qn,this.sessionId="",this.sessionKey=null,this.useWebSocket=true,this.listeners={},!n.publicKey)throw new Error("Missing publicKey");if(!n.projectId)throw new Error("Missing projectId");if(!n.authType)throw new Error("Missing authType");this.config={continuousMode:false,forceQRCode:false,...n},this.stateMachine.subscribe(e=>this.emit("state",e)),this.attachVisibilityRecovery();}on(n,e){var i;return (i=this.listeners)[n]??(i[n]=new Set),this.listeners[n].add(e),()=>this.listeners[n].delete(e)}async start(){if(this.stateMachine.current==="idle"){this.resetSession(),ze(),this.stateMachine.transition("initializing");try{this.sessionKey=this.crypto.generateSymmetricKey(),this.sessionId=crypto.randomUUID()+crypto.randomUUID(),this.useWebSocket=this.shouldUseWebSocket(),this.useWebSocket?await this.startWebSocketFlow():await this.startDeepLinkFlow();}catch(n){this.fail(n instanceof Error?n:new Error("Start failed"));}}}stop(){this.terminate(false);}destroy(){this.detachVisibilityRecovery(),this.clearBackupCheck(),this.transport?.close(),this.transport=void 0,this.listeners={};}shouldUseWebSocket(){return this.config.forceQRCode||!/Android|iPhone|iPad/i.test(navigator.userAgent)}async startWebSocketFlow(){let n=await this.fetchRelayUrl(true);this.transport=new Gn({onOpen:()=>{this.transport.send({type:"register",sessionID:this.sessionId,...this.config}),this.stateMachine.transition("awaiting-pair");},onMessage:e=>this.handleWebSocketMessage(e),onError:e=>{console.error("WebSocket error:",e),this.fail(new Error("WebSocket connection failed"));}}),this.transport.connect(n),await this.emitQRCode();}handleWebSocketMessage(n){switch(n.type){case "paired":this.stateMachine.transition("paired"),this.transport.send({type:"authenticate",sessionID:this.sessionId,...this.config,url:window.location.href});return;case "phone-auth-success":this.handleAuthSuccess(n);return;case "phone-terminated":this.fail(new Error("Authentication cancelled on device")),this.restartIfContinuous();return;case "confirmed":this.terminate(true),this.restartIfContinuous();return}}handleAuthSuccess(n){if(!this.sessionKey||!n.cipher||!n.nonce){this.fail(new Error("Invalid authentication payload")),this.restartIfContinuous();return}try{let e=this.crypto.decryptSymmetric({encrypted:{cipher:n.cipher,nonce:n.nonce},keyString:this.sessionKey});if(!e){this.fail(new Error("Invalid authentication data")),this.restartIfContinuous();return}let i=JSON.parse(e);this.emit("success",i),this.stateMachine.transition("authenticated"),this.transport?.send({type:"confirm",sessionID:this.sessionId});}catch{this.fail(new Error("Failed to decrypt authentication data")),this.restartIfContinuous();}}async startDeepLinkFlow(){let n=await this.fetchRelayUrl(false);this.sessionKey&&Wn(this.sessionId,this.sessionKey,10*6e4),await this.emitDeepLink(n),this.stateMachine.transition("awaiting-pair");}clearBackupCheck(){this.backupCheckTimeout&&(clearTimeout(this.backupCheckTimeout),this.backupCheckTimeout=void 0);}async checkSession(){let n=Zn();if(n){this.stateMachine.transition("awaiting-auth");try{let e=await fetch(`${Sr}/session?session_id=${n.sessionId}`);if(!e.ok)return;let i=await e.json(),a=this.crypto.decryptSymmetric({encrypted:{cipher:i.cipher,nonce:i.nonce},keyString:n.sessionKey});if(!a){console.warn("Failed to decrypt session");return}let l=JSON.parse(a);this.clearBackupCheck(),ze(),this.emit("success",l),this.stateMachine.transition("authenticated"),this.config.continuousMode?setTimeout(()=>{this.stateMachine.transition("idle"),this.start();},1500):this.stateMachine.transition("idle");}catch(e){console.debug("Session check failed:",e);}}}async emitQRCode(){let n={sessionID:this.sessionId,sessionKey:this.sessionKey,publicKey:this.config.publicKey,authType:this.config.authType,projectId:this.config.projectId,url:window.location.href},e=await hf.default.toDataURL(JSON.stringify(n),{type:"image/png",scale:3,color:{light:"#ffffff",dark:"#424242ff"}});this.emit("qr",e);}async emitDeepLink(n){let e=`${n}?sessionID=${encodeURIComponent(this.sessionId)}&sessionKey=${encodeURIComponent(this.sessionKey)}&publicKey=${encodeURIComponent(this.config.publicKey)}&authType=${this.config.authType}&projectId=${encodeURIComponent(this.config.projectId)}&url=${encodeURIComponent(n)}`;this.emit("deeplink",e);}attachVisibilityRecovery(){this.visibilityHandler=async()=>{document.visibilityState==="visible"&&(this.useWebSocket||await this.checkSession());},document.addEventListener("visibilitychange",this.visibilityHandler);}detachVisibilityRecovery(){this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=void 0);}async fetchRelayUrl(n){let{publicKey:e,projectId:i,authType:a}=this.config,l=await fetch(`${Sr}/relay?public_key=${e}&auth_type=${a}&project_id=${i}`);if(!l.ok){let p=await l.text();throw new Error(p)}let u=await l.json();return n?u.relay_url:u.deeplink_url}terminate(n){this.clearBackupCheck(),this.transport&&(n||this.transport.send({type:"client-terminated",sessionID:this.sessionId,projectId:this.config.projectId,publicKey:this.config.publicKey,authType:this.config.authType}),this.transport.close(),this.transport=void 0),ze(),this.resetSession(),this.config.continuousMode||this.detachVisibilityRecovery(),this.stateMachine.transition(n?"confirmed":"idle");}restartIfContinuous(){this.stateMachine.transition("idle"),this.clearBackupCheck(),this.transport?.close(),this.transport=void 0,this.config.continuousMode&&setTimeout(()=>{this.start();},150);}resetSession(){this.sessionId="",this.sessionKey=null;}emit(n,e){this.listeners[n]?.forEach(i=>i(e));}fail(n){this.emit("error",n),this.stateMachine.transition("error");}};Mt.BASEURL=Sr;Mt.CryptoService=Jn;Mt.PelicanAuthentication=pf;Mt.StateMachine=Qn;Mt.Transport=Gn;Mt.clearAllAuthData=gf;Mt.clearAuthSession=ze;Mt.getAuthSession=Zn;Mt.storeAuthSession=Wn;});var ti=gi(Xn());function yf(){if(document.getElementById("pelican-auth-styles"))return;let n=document.createElement("style");n.id="pelican-auth-styles",n.textContent=`@keyframes fadeUp {
|
|
9
9
|
from {
|
|
10
10
|
opacity: 0;
|
|
11
11
|
transform: translateY(20px);
|
|
@@ -41,7 +41,7 @@ Minimum version required to store current data is: `+h+`.
|
|
|
41
41
|
margin-top: 0.3rem;
|
|
42
42
|
position: relative;
|
|
43
43
|
animation: fadeUp 0.5s ease-out;
|
|
44
|
-
background-color: #
|
|
44
|
+
background-color: #f9fafb;
|
|
45
45
|
border-radius: 2.5rem;
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-direction: column;
|
|
@@ -56,7 +56,7 @@ Minimum version required to store current data is: `+h+`.
|
|
|
56
56
|
padding: 1rem;
|
|
57
57
|
margin-top: 0.3rem;
|
|
58
58
|
position: relative;
|
|
59
|
-
background-color: #
|
|
59
|
+
background-color: #f9fafb;
|
|
60
60
|
border-radius: 2.5rem;
|
|
61
61
|
display: flex;
|
|
62
62
|
flex-direction: column;
|
|
@@ -66,27 +66,20 @@ Minimum version required to store current data is: `+h+`.
|
|
|
66
66
|
min-height: 320px;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.close-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
opacity: 0.6;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.close-icon {
|
|
87
|
-
width: 1.5rem;
|
|
88
|
-
height: 1.5rem;
|
|
89
|
-
fill: #000000;
|
|
69
|
+
.pelican-modal-close-btn {
|
|
70
|
+
all: unset; /* Reset all inherited styles */
|
|
71
|
+
background-color: #2b2b2b !important;
|
|
72
|
+
border: none !important;
|
|
73
|
+
padding: 0.3rem !important;
|
|
74
|
+
cursor: pointer !important;
|
|
75
|
+
transition: opacity 0.2s !important;
|
|
76
|
+
height: 1.5rem !important;
|
|
77
|
+
width: 1.5rem !important;
|
|
78
|
+
display: flex !important;
|
|
79
|
+
align-items: center !important;
|
|
80
|
+
justify-content: center !important;
|
|
81
|
+
border-radius: 50% !important;
|
|
82
|
+
box-sizing: border-box !important;
|
|
90
83
|
}
|
|
91
84
|
|
|
92
85
|
.retry-container {
|
|
@@ -337,26 +330,26 @@ Minimum version required to store current data is: `+h+`.
|
|
|
337
330
|
opacity: 0;
|
|
338
331
|
}
|
|
339
332
|
}
|
|
340
|
-
`,document.head.appendChild(n);}function ei(n,e){yf();let i=document.getElementById(n);if(!i)throw new Error(`Container with id "${n}" not found`);let a=new ti.PelicanAuthentication(e),
|
|
333
|
+
`,document.head.appendChild(n);}function ei(n,e){yf();let i=document.getElementById(n);if(!i)throw new Error(`Container with id "${n}" not found`);let a=new ti.PelicanAuthentication(e),l={isOpen:e.continuousMode||false,qr:null,deeplink:null,authState:"idle",successMessage:null,error:null},u={isProcessing:()=>["initializing","paired","awaiting-auth"].includes(l.authState),showMobileAuth:()=>!e.forceQRCode&&l.deeplink,showQRView:()=>e.forceQRCode&&l.qr&&l.authState==="awaiting-pair"||!e.forceQRCode&&l.qr&&l.authState==="awaiting-pair",successText:()=>`${e.authType==="login"?"login":e.authType==="signup"?"signup":e.authType==="id-verification"?"verification":"authentication"} complete!`},p=[a.on("qr",W=>{l.qr=W,y();}),a.on("deeplink",W=>{l.deeplink=W,y();}),a.on("state",W=>{l.authState=W,y();}),a.on("success",W=>{e.onSuccess(W),e.continuousMode?(l.successMessage=u.successText(),y(),setTimeout(()=>{l.successMessage=null,y();},2e3)):(l.isOpen=false,y());}),a.on("error",W=>{l.error=W,e.onError?.(W),y();})];function y(){if(!i)return;let W=E();i.innerHTML=W,Bt();}function E(){let W=V(),gt=l.isOpen?$():"";return `
|
|
341
334
|
<section style="max-width: 275px; width: 100%;">
|
|
342
|
-
${
|
|
335
|
+
${W}
|
|
343
336
|
${gt}
|
|
344
337
|
</section>
|
|
345
|
-
`}function
|
|
346
|
-
<div style="width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: ${
|
|
338
|
+
`}function V(){if(e.continuousMode)return "";let W=l.authState!=="idle";return `
|
|
339
|
+
<div style="width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: ${W?"0.4rem":"0"};">
|
|
347
340
|
<button
|
|
348
341
|
type="button"
|
|
349
342
|
id="pelican-start-btn"
|
|
350
343
|
style="border: none; background: transparent; cursor: pointer;"
|
|
351
|
-
${
|
|
344
|
+
${l.isOpen?"disabled":""}
|
|
352
345
|
>
|
|
353
|
-
${e.buttonComponent||
|
|
346
|
+
${e.buttonComponent||zt()}
|
|
354
347
|
</button>
|
|
355
348
|
|
|
356
|
-
${
|
|
349
|
+
${W?`
|
|
357
350
|
<button
|
|
358
351
|
id="pelican-stop-btn"
|
|
359
|
-
class="close-
|
|
352
|
+
class="pelican-modal-close-btn"
|
|
360
353
|
type="button"
|
|
361
354
|
aria-label="Close"
|
|
362
355
|
>
|
|
@@ -378,43 +371,43 @@ Minimum version required to store current data is: `+h+`.
|
|
|
378
371
|
</button>
|
|
379
372
|
`:""}
|
|
380
373
|
</div>
|
|
381
|
-
`}function
|
|
374
|
+
`}function $(){return `
|
|
382
375
|
<div class="js-auth-container">
|
|
383
|
-
${
|
|
376
|
+
${lt()}
|
|
384
377
|
${it()}
|
|
385
378
|
${wt()}
|
|
386
379
|
${re()}
|
|
387
380
|
</div>
|
|
388
|
-
`}function
|
|
381
|
+
`}function lt(){return l.successMessage?`
|
|
389
382
|
<div class="success-message" style="text-align: center;">
|
|
390
|
-
${
|
|
383
|
+
${l.successMessage}
|
|
391
384
|
${e.continuousMode?`
|
|
392
385
|
<p style="font-size: 0.8rem; margin-top: 0.5rem; color: #f3f3f3; text-align: center;">
|
|
393
386
|
Preparing next session...
|
|
394
387
|
</p>
|
|
395
388
|
`:""}
|
|
396
389
|
</div>
|
|
397
|
-
`:""}function it(){return !
|
|
390
|
+
`:""}function it(){return !l.error||l.authState!=="error"?"":`
|
|
398
391
|
<div class="error-wrapper">
|
|
399
|
-
<p class="error-message">${
|
|
392
|
+
<p class="error-message">${l.error.message}</p>
|
|
400
393
|
</div>
|
|
401
|
-
`}function wt(){return
|
|
394
|
+
`}function wt(){return u.isProcessing()?`
|
|
402
395
|
<div class="content-wrapper">
|
|
403
396
|
<h2 class="main-heading">one sec...</h2>
|
|
404
397
|
<span class="loader" style="margin: 1rem auto; width: 252px;"></span>
|
|
405
398
|
</div>
|
|
406
|
-
`:
|
|
399
|
+
`:l.authState==="awaiting-pair"&&!l.successMessage?`
|
|
407
400
|
<div class="content-wrapper">
|
|
408
401
|
<div class="unpaired-container">
|
|
409
|
-
${!
|
|
402
|
+
${!l.deeplink&&!e.forceQRCode?'<h2 class="main-heading">Open Pelican Vault</h2>':""}
|
|
410
403
|
${mt()}
|
|
411
404
|
</div>
|
|
412
405
|
</div>
|
|
413
|
-
`:'<div class="content-wrapper"></div>'}function mt(){return
|
|
406
|
+
`:'<div class="content-wrapper"></div>'}function mt(){return u.showMobileAuth()?vt():u.showQRView()?Lt():`
|
|
414
407
|
<div class="loader-container">
|
|
415
408
|
<span class="loader"></span>
|
|
416
409
|
</div>
|
|
417
|
-
`}function vt(){let
|
|
410
|
+
`}function vt(){let W=e.authType==="login"?"login":e.authType==="signup"?"signup":e.authType==="id-verification"?"verify identity":"authenticate";return `
|
|
418
411
|
<div class="mobile-auth-container">
|
|
419
412
|
<div class="logo-container">
|
|
420
413
|
<img
|
|
@@ -423,20 +416,20 @@ Minimum version required to store current data is: `+h+`.
|
|
|
423
416
|
style="width: 80px; height: 80px;"
|
|
424
417
|
/>
|
|
425
418
|
</div>
|
|
426
|
-
<a href="${
|
|
419
|
+
<a href="${l.deeplink}" class="open-app-link">
|
|
427
420
|
Open Pelican Vault
|
|
428
421
|
</a>
|
|
429
422
|
<p class="helper-text">
|
|
430
|
-
Open the app to ${
|
|
423
|
+
Open the app to ${W}
|
|
431
424
|
</p>
|
|
432
425
|
</div>
|
|
433
|
-
`}function
|
|
426
|
+
`}function Lt(){return `
|
|
434
427
|
<div class="qr-container">
|
|
435
428
|
<div class="qr-wrapper">
|
|
436
|
-
${
|
|
429
|
+
${l.qr?`<img src="${l.qr}" alt="QR Code" class="qr-image" />`:'<span class="loader"></span>'}
|
|
437
430
|
</div>
|
|
438
431
|
</div>
|
|
439
|
-
`}function
|
|
432
|
+
`}function zt(){return `
|
|
440
433
|
<div class="pelican-btn-wrapper" style="display: flex; flex-direction: row; background-color:#2b2b2bff; align-items: center; justify-content: center; gap: 0.35rem; padding: 0.35rem 0.7rem; border-radius: 20px; cursor: pointer; border: 1px solid #353535ff;">
|
|
441
434
|
<div>
|
|
442
435
|
<svg width="28" height="28" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Pelican logo">
|
|
@@ -474,5 +467,5 @@ Minimum version required to store current data is: `+h+`.
|
|
|
474
467
|
</div>
|
|
475
468
|
</div>
|
|
476
469
|
</div>
|
|
477
|
-
`}function
|
|
470
|
+
`}function Bt(){let W=document.getElementById("pelican-start-btn");W&&W.addEventListener("click",Tt);let gt=document.getElementById("pelican-stop-btn");gt&>.addEventListener("click",dt);}function Tt(){a.start(),l.isOpen=true,y();}function dt(){a.stop(),e.onClose?.(),l.isOpen=false,y();}return y(),e.continuousMode&&a.start(),function(){p.forEach(gt=>gt()),a.destroy(),i.innerHTML="";}}typeof window<"u"&&(window.Pelican={createPelicanAuth:ei});exports.createPelicanAuth=ei;return exports;})({});//# sourceMappingURL=index.min.js.map
|
|
478
471
|
//# sourceMappingURL=index.min.js.map
|