,
>>0?1:0))+Y+((J+=$)>>>0<$>>>0?1:0))+X+((J+=Z)>>>0>>0?1:0),z.high=W,z.low=J}G=L&U^~L&B,Z=D&M^~D&H,z=P&T^P&N^T&N;var ee=A&R^A&I^R&I,te=(Q=(P>>>28|A<<4)^(P<<30|A>>>2)^(P<<25|A>>>7),Y=(A>>>28|P<<4)^(A<<30|P>>>2)^(A<<25|P>>>7),($=a[K]).high),ne=$.low;X=V+((L>>>14|D<<18)^(L>>>18|D<<14)^(L<<23|D>>>9))+(($=q+((D>>>14|L<<18)^(D>>>18|L<<14)^(D<<23|L>>>9)))>>>0 >>0?1:0),V=B,q=H,B=U,H=M,U=L,M=D,L=O+(X=(X=(X=X+G+(($+=Z)>>>0>>0?1:0))+te+(($+=ne)>>>0 >>0?1:0))+W+(($+=J)>>>0 >>0?1:0))+((D=j+$|0)>>>0 >>0?1:0)|0,O=N,j=I,N=T,I=R,T=P,R=A,P=X+(z=Q+z+((J=Y+ee)>>>0 >>0?1:0))+((A=$+J|0)>>>0<$>>>0?1:0)|0}h=n.low=h+A,n.high=d+P+(h>>>0>>0?1:0),g=r.low=g+R,r.high=p+T+(g>>>0 >>0?1:0),y=i.low=y+I,i.high=v+N+(y>>>0>>0?1:0),b=o.low=b+j,o.high=m+O+(b>>>0 >>0?1:0),S=u.low=S+D,u.high=w+L+(S>>>0 >>0?1:0),E=l.low=E+M,l.high=_+U+(E>>>0 >>0?1:0),k=c.low=k+H,c.high=x+B+(k>>>0 >>0?1:0),C=f.low=C+q,f.high=F+V+(C>>>0 >>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(o),t.HmacSHA512=n._createHmacHelper(o)}(),function(){var e=y,t=(i=e.x64).Word,n=i.WordArray,r=(i=e.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(i),e.HmacSHA384=r._createHmacHelper(i)}();var m,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function w(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=b.charAt(n>>6)+b.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=b.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=b.charAt(n>>2)+b.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function S(e){var t,n,r,i="",o=0;for(t=0;t>2),n=3&r,o=1):1==o?(i+=P(n<<2|r>>4),n=15&r,o=2):2==o?(i+=P(n),i+=P(r>>2),n=3&r,o=3):(i+=P(n<<2|r>>4),i+=P(15&r),o=0));return 1==o&&(i+=P(n<<2)),i}function _(e){var t,n=S(e),r=new Array;for(t=0;2*t >15;--o>=0;){var u=32767&this[e],l=this[e++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+n[r]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),n[r++]=1073741823&u}return i},m=30):"Netscape"!=r.appName?(E.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},m=26):(E.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this[e],l=this[e++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+n[r]+i)>>28)+(c>>14)+s*l,n[r++]=268435455&u}return i},m=28),E.prototype.DB=m,E.prototype.DM=(1< >>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function N(e){this.m=e}function I(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1< >=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function M(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function B(){}function H(e){return e}function V(e){this.r2=x(),this.q3=x(),E.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}N.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},N.prototype.revert=function(e){return e},N.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},N.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},N.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},I.prototype.convert=function(e){var t=x();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(E.ZERO)>0&&this.m.subTo(t,t),t},I.prototype.revert=function(e){var t=x();return e.copyTo(t),this.reduce(t),t},I.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t >15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},I.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},E.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},E.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},E.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=8==n?255&e[r]:A(e,r);a<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1< >this.DB-o):this[this.t-1]|=a< =this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1< 0&&this[this.t-1]==e;)--this.t},E.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},E.prototype.drShiftTo=function(e,t){for(var n=e;n =0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)< =0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},E.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1< >r;for(var a=n+1;a >r;r>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB;if(e.t >=this.DB;r+=this.s}else{for(r+=this.s;n >=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},E.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i =0;)e[n]=0;for(n=0;n =t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},E.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t 0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var l=o.t,c=o[l-1];if(0!=c){var f=c*(1< 1?o[l-2]>>this.F2:0),d=this.FV/f,h=(1< =0&&(n[n.t++]=1,n.subTo(y,n)),E.ONE.dlShiftTo(l,y),y.subTo(o,o);o.t =0;){var m=n[--g]==c?this.DM:Math.floor(n[g]*d+(n[g-1]+p)*h);if((n[g]+=o.am(0,m,n,v,0,l)) 0&&n.rShiftTo(u,n),a<0&&E.ZERO.subTo(n,n)}}},E.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},E.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},E.prototype.exp=function(e,t){if(e>4294967295||e<1)return E.ONE;var n=x(),r=x(),i=t.convert(this),o=R(e)-1;for(i.copyTo(n);--o>=0;)if(t.sqrTo(n,r),(e&1< 0)t.mulTo(r,i,n);else{var a=n;n=r,r=a}return t.revert(n)},E.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1< 0)for(s >s)>0&&(i=!0,o=P(n));a>=0;)s >(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=P(n));return i?o:"0"},E.prototype.negate=function(){var e=x();return E.ZERO.subTo(this,e),e},E.prototype.abs=function(){return this.s<0?this.negate():this},E.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},E.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+R(this[this.t-1]^this.s&this.DM)},E.prototype.mod=function(e){var t=x();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(E.ZERO)>0&&e.subTo(t,t),t},E.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new N(t):new I(t),this.exp(e,n)},E.ZERO=T(0),E.ONE=T(1),B.prototype.convert=H,B.prototype.revert=H,B.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},B.prototype.sqrTo=function(e,t){e.squareTo(t)},V.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=x();return e.copyTo(t),this.reduce(t),t},V.prototype.revert=function(e){return e},V.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},V.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},V.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var q,K,z,W=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],J=(1<<26)/W[W.length-1];function Q(){this.i=0,this.j=0,this.S=new Array}function Y(){!function(e){K[z++]^=255&e,K[z++]^=e>>8&255,K[z++]^=e>>16&255,K[z++]^=e>>24&255,z>=256&&(z-=256)}((new Date).getTime())}if(E.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},E.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=T(n),i=x(),o=x(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substr(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},E.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,o=0,a=0,s=0;s =n&&(this.dMultiply(r),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&E.ZERO.subTo(this,this)},E.prototype.fromNumber=function(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(E.ONE.shiftLeft(e-1),j,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(E.ONE.shiftLeft(e-1),this);else{var r=new Array,i=7&e;r.length=1+(e>>3),t.nextBytes(r),i>0?r[0]&=(1<>=this.DB;if(e.t >=this.DB;r+=this.s}else{for(r+=this.s;n >=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},E.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},E.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},E.prototype.multiplyLowerTo=function(e,t,n){var r,i=Math.min(this.t+e.t,t);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i =0;)n[r]=0;for(r=Math.max(t-this.t,0);r 0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},E.prototype.millerRabin=function(e){var t=this.subtract(E.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>W.length&&(e=W.length);for(var i=x(),o=0;o >24},E.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},E.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},E.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r >r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s< =0;)r<8?(n=(this[e]&(1< >(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},E.prototype.equals=function(e){return 0==this.compareTo(e)},E.prototype.min=function(e){return this.compareTo(e)<0?this:e},E.prototype.max=function(e){return this.compareTo(e)>0?this:e},E.prototype.and=function(e){var t=x();return this.bitwiseTo(e,O,t),t},E.prototype.or=function(e){var t=x();return this.bitwiseTo(e,j,t),t},E.prototype.xor=function(e){var t=x();return this.bitwiseTo(e,L,t),t},E.prototype.andNot=function(e){var t=x();return this.bitwiseTo(e,D,t),t},E.prototype.not=function(){for(var e=x(),t=0;t =this.t?0!=this.s:0!=(this[t]&1< 1){var c=x();for(r.sqrTo(a[1],c);s<=l;)a[s]=x(),r.mulTo(c,a[s-2],a[s]),s+=2}var f,d,h=e.t-1,p=!0,g=x();for(i=R(e[h])-1;h>=0;){for(i>=u?f=e[h]>>i-u&l:(f=(e[h]&(1<0&&(f|=e[h-1]>>this.DB+i-u)),s=n;0==(1&f);)f>>=1,--s;if((i-=s)<0&&(i+=this.DB,--h),p)a[f].copyTo(o),p=!1;else{for(;s>1;)r.sqrTo(o,g),r.sqrTo(g,o),s-=2;s>0?r.sqrTo(o,g):(d=o,o=g,g=d),r.mulTo(g,a[f],o)}for(;h>=0&&0==(e[h]&1<=0?(n.subTo(r,n),t&&i.subTo(a,i),o.subTo(s,o)):(r.subTo(n,r),t&&a.subTo(i,a),s.subTo(o,s))}return 0!=r.compareTo(E.ONE)?E.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},E.prototype.pow=function(e){return this.exp(e,new B)},E.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i 0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},E.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=W[W.length-1]){for(t=0;t >>8,K[z++]=255&$;z=0,Y()}function ee(){if(null==q){for(Y(),(q=new Q).init(K),z=0;z >24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function ie(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function oe(e,t){this.x=t,this.q=e}function ae(e,t,n,r){this.curve=e,this.x=t,this.y=n,this.z=null==r?E.ONE:r,this.zinv=null}function se(e,t,n){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(n),this.infinity=new ae(this,null,null)}te.prototype.nextBytes=function(e){var t;for(t=0;t 0&&t.length>0))throw"Invalid RSA public key";this.n=ne(e,16),this.e=parseInt(t,16)}},ie.prototype.encrypt=function(e){var t=function(e,t){if(t =0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new te,a=new Array;t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new E(n)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r},ie.prototype.encryptOAEP=function(e,t,n){var r=function(e,t,n,r){var i=le.crypto.MessageDigest,o=le.crypto.Util,a=null;if(n||(n="sha1"),"string"==typeof n&&(a=i.getCanonicalAlgName(n),r=i.getHashLength(a),n=function(e){return Ee(o.hashHex(xe(e),a))}),e.length+2*r+2>t)throw"Message too long for RSA";var s,u="";for(s=0;s >3,t,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},ie.prototype.type="RSA",oe.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},oe.prototype.toBigInteger=function(){return this.x},oe.prototype.negate=function(){return new oe(this.q,this.x.negate().mod(this.q))},oe.prototype.add=function(e){return new oe(this.q,this.x.add(e.toBigInteger()).mod(this.q))},oe.prototype.subtract=function(e){return new oe(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},oe.prototype.multiply=function(e){return new oe(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},oe.prototype.square=function(){return new oe(this.q,this.x.square().mod(this.q))},oe.prototype.divide=function(e){return new oe(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},ae.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},ae.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},ae.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(E.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(E.ZERO))},ae.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(E.ZERO)&&!this.y.toBigInteger().equals(E.ZERO)},ae.prototype.negate=function(){return new ae(this.curve,this.x,this.y.negate(),this.z)},ae.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),n=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(E.ZERO.equals(n))return E.ZERO.equals(t)?this.twice():this.curve.getInfinity();var r=new E("3"),i=this.x.toBigInteger(),o=this.y.toBigInteger(),a=(e.x.toBigInteger(),e.y.toBigInteger(),n.square()),s=a.multiply(n),u=i.multiply(a),l=t.square().multiply(this.z),c=l.subtract(u.shiftLeft(1)).multiply(e.z).subtract(s).multiply(n).mod(this.curve.q),f=u.multiply(r).multiply(t).subtract(o.multiply(s)).subtract(l.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),d=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new ae(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(f),d)},ae.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new E("3"),t=this.x.toBigInteger(),n=this.y.toBigInteger(),r=n.multiply(this.z),i=r.multiply(n).mod(this.curve.q),o=this.curve.a.toBigInteger(),a=t.square().multiply(e);E.ZERO.equals(o)||(a=a.add(this.z.square().multiply(o)));var s=(a=a.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.q),u=a.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(a.square().multiply(a)).mod(this.curve.q),l=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new ae(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(u),l)},ae.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,n=e,r=n.multiply(new E("3")),i=this.negate(),o=this,a=this.curve.q.subtract(e),s=a.multiply(new E("3")),u=new ae(this.curve,this.x,this.y),l=u.negate();for(t=r.bitLength()-2;t>0;--t){o=o.twice();var c=r.testBit(t);c!=n.testBit(t)&&(o=o.add(c?this:i))}for(t=s.bitLength()-2;t>0;--t){u=u.twice();var f=s.testBit(t);f!=a.testBit(t)&&(u=u.add(f?u:l))}return o},ae.prototype.multiplyTwo=function(e,t,n){var r;r=e.bitLength()>n.bitLength()?e.bitLength()-1:n.bitLength()-1;for(var i=this.curve.getInfinity(),o=this.add(t);r>=0;)i=i.twice(),e.testBit(r)?i=n.testBit(r)?i.add(o):i.add(this):n.testBit(r)&&(i=i.add(t)),--r;return i},se.prototype.getQ=function(){return this.q},se.prototype.getA=function(){return this.a},se.prototype.getB=function(){return this.b},se.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},se.prototype.getInfinity=function(){return this.infinity},se.prototype.fromBigInteger=function(e){return new oe(this.q,e)},se.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var t=(e.length-2)/2,n=e.substr(2,t),r=e.substr(t+2,t);return new ae(this,this.fromBigInteger(new E(n,16)),this.fromBigInteger(new E(r,16)))}},oe.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ae.prototype.getEncoded=function(e){var t=function(e,t){var n=e.toByteArrayUnsigned();if(t n.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),r=this.getY().toBigInteger(),i=t(n,32);return e?r.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(r,32))),i},ae.decodeFrom=function(e,t){t[0];var n=t.length-1,r=t.slice(1,1+n/2),i=t.slice(1+n/2,1+n);r.unshift(0),i.unshift(0);var o=new E(r),a=new E(i);return new ae(e,e.fromBigInteger(o),e.fromBigInteger(a))},ae.decodeFromHex=function(e,t){t.substr(0,2);var n=t.length-2,r=t.substr(2,n/2),i=t.substr(2+n/2,n/2),o=new E(r,16),a=new E(i,16);return new ae(e,e.fromBigInteger(o),e.fromBigInteger(a))},ae.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),n=e.y.subtract(this.y).divide(t),r=n.square().subtract(this.x).subtract(e.x),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new ae(this.curve,r,i)},ae.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(E.valueOf(2)),t=this.curve.fromBigInteger(E.valueOf(3)),n=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),r=n.square().subtract(this.x.multiply(e)),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new ae(this.curve,r,i)},ae.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,n=e,r=n.multiply(new E("3")),i=this.negate(),o=this;for(t=r.bitLength()-2;t>0;--t){o=o.twice();var a=r.testBit(t);a!=n.testBit(t)&&(o=o.add2D(a?this:i))}return o},ae.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),r=this.curve.getB().toBigInteger(),i=this.curve.getQ(),o=t.multiply(t).mod(i),a=e.multiply(e).multiply(e).add(n.multiply(e)).add(r).mod(i);return o.equals(a)},ae.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ae.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(t.compareTo(E.ONE)<0||t.compareTo(e.subtract(E.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(E.ONE)<0||n.compareTo(e.subtract(E.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ue=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(e,t,n){return t?r[t]:String.fromCharCode(parseInt(n,16))}var o=new String(""),a=Object.hasOwnProperty;return function(r,s){var u,l,c=r.match(e),f=c[0],d=!1;"{"===f?u={}:"["===f?u=[]:(u=[],d=!0);for(var h=[u],p=1-d,g=c.length;p =0;)delete i[o[c]]}return s.call(t,r,i)}({"":u},"")),u}}();void 0!==le&&le||(t.KJUR=le={}),void 0!==le.asn1&&le.asn1||(le.asn1={}),le.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i 15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},le.asn1.DERAbstractString=function(e){le.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=Se(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},o.lang.extend(le.asn1.DERAbstractString,le.asn1.ASN1Object),le.asn1.DERAbstractTime=function(e){le.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var a=o+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var s=i.getMilliseconds();if(0!=s){var u=r(String(s),3);a=a+"."+(u=u.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ve(e)},this.setByDateValue=function(e,t,n,r,i,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},o.lang.extend(le.asn1.DERAbstractTime,le.asn1.ASN1Object),le.asn1.DERAbstractStructured=function(e){le.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},o.lang.extend(le.asn1.DERAbstractStructured,le.asn1.ASN1Object),le.asn1.DERBoolean=function(e){le.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},o.lang.extend(le.asn1.DERBoolean,le.asn1.ASN1Object),le.asn1.DERInteger=function(e){le.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=le.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new E(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},o.lang.extend(le.asn1.DERInteger,le.asn1.ASN1Object),le.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=le.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}le.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7 i.length&&(i=r[n]);return(e=e.replace(i,"::")).slice(1,-1)}function Le(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?je(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function De(e){for(var t=encodeURIComponent(e),n="",r=0;r "7"?"00"+e:e}de.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var n=parseInt(e.substr(t+3,1));return 0==n?-1:0 =r)break}return a},de.getNthChildIdx=function(e,t,n){return de.getChildIdx(e,t)[n]},de.getIdxbyList=function(e,t,n,r){var i,o,a=de;return 0==n.length?void 0!==r&&e.substr(t,2)!==r?-1:t:(i=n.shift())>=(o=a.getChildIdx(e,t)).length?-1:a.getIdxbyList(e,o[i],n,r)},de.getIdxbyListEx=function(e,t,n,r){var i,o,a=de;if(0==n.length)return void 0!==r&&e.substr(t,2)!==r?-1:t;i=n.shift(),o=a.getChildIdx(e,t);for(var s=0,u=0;u =e.length?null:i.getTLV(e,o)},de.getTLVbyListEx=function(e,t,n,r){var i=de,o=i.getIdxbyListEx(e,t,n,r);return-1==o?null:i.getTLV(e,o)},de.getVbyList=function(e,t,n,r,i){var o,a,s=de;return-1==(o=s.getIdxbyList(e,t,n,r))||o>=e.length?null:(a=s.getV(e,o),!0===i&&(a=a.substr(2)),a)},de.getVbyListEx=function(e,t,n,r,i){var o,a,s=de;return-1==(o=s.getIdxbyListEx(e,t,n,r))?null:(a=s.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(a=a.substr(2)),a)},de.getInt=function(e,t,n){null==n&&(n=-1);try{var r=e.substr(t,2);if("02"!=r&&"03"!=r)return n;var i=de.getV(e,t);return"02"==r?parseInt(i,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var n=parseInt(t,16),r=e.substr(2),i=parseInt(r,16).toString(2);return"0"==i&&(i="00000000"),i=i.slice(0,0-n),parseInt(i,2)}catch(e){return-1}}(i)}catch(e){return n}},de.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:function(e){if(!Ue(e))return null;try{var t=[],n=e.substr(0,2),r=parseInt(n,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=e.substr(2),o=[],a=0;a 0&&(l=l+"."+s.join(".")),l}catch(e){return null}}(de.getV(e,t))}catch(e){return n}},de.getOIDName=function(e,t,n){null==n&&(n=null);try{var r=de.getOID(e,t,n);if(r==n)return n;var i=le.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(e){return n}},de.getString=function(e,t,n){null==n&&(n=null);try{return Ee(de.getV(e,t))}catch(e){return n}},de.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},n=[],r=e.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var o=e.substr(2),a=[],s=0;s 0&&(c=c+"."+u.join(".")),c},de.dump=function(e,t,n,r){var i=de,o=i.getV,a=i.dump,s=i.getChildIdx,u=e;e instanceof le.asn1.ASN1Object&&(u=e.getEncodedHex());var l=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var c,f=t.ommit_long_octet;if("01"==(c=u.substr(n,2)))return"00"==(d=o(u,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==c)return r+"INTEGER "+l(d=o(u,n),f)+"\n";if("03"==c){var d=o(u,n);return i.isASN1HEX(d.substr(2))?(S=r+"BITSTRING, encapsulates\n")+a(d.substr(2),t,0,r+" "):r+"BITSTRING "+l(d,f)+"\n"}if("04"==c)return d=o(u,n),i.isASN1HEX(d)?(S=r+"OCTETSTRING, encapsulates\n")+a(d,t,0,r+" "):r+"OCTETSTRING "+l(d,f)+"\n";if("05"==c)return r+"NULL\n";if("06"==c){var h=o(u,n),p=le.asn1.ASN1Util.oidHexToInt(h),g=le.asn1.x509.OID.oid2name(p),v=p.replace(/\./g," ");return""!=g?r+"ObjectIdentifier "+g+" ("+v+")\n":r+"ObjectIdentifier ("+v+")\n"}if("0a"==c)return r+"ENUMERATED "+parseInt(o(u,n))+"\n";if("0c"==c)return r+"UTF8String '"+_e(o(u,n))+"'\n";if("13"==c)return r+"PrintableString '"+_e(o(u,n))+"'\n";if("14"==c)return r+"TeletexString '"+_e(o(u,n))+"'\n";if("16"==c)return r+"IA5String '"+_e(o(u,n))+"'\n";if("17"==c)return r+"UTCTime "+_e(o(u,n))+"\n";if("18"==c)return r+"GeneralizedTime "+_e(o(u,n))+"\n";if("1a"==c)return r+"VisualString '"+_e(o(u,n))+"'\n";if("1e"==c)return r+"BMPString '"+_e(o(u,n))+"'\n";if("30"==c){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";S=r+"SEQUENCE\n";var y=t;if((2==(w=s(u,n)).length||3==w.length)&&"06"==u.substr(w[0],2)&&"04"==u.substr(w[w.length-1],2)){g=i.oidname(o(u,w[0]));var m=JSON.parse(JSON.stringify(t));m.x509ExtName=g,y=m}for(var b=0;b 31)&&128==(192&n)&&(31&n)==r}catch(e){return!1}},de.isASN1HEX=function(e){var t=de;if(e.length%2==1)return!1;var n=t.getVblen(e,0),r=e.substr(0,2),i=t.getL(e,0);return e.length-r.length-i.length==2*n},de.checkStrictDER=function(e,t,n,r,i){var o=de;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!le.lang.String.isHex(e))throw new Error("not hex string");n=e.length,i=(r=e.length/2)<128?1:Math.ceil(r.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var a=o.getVblen(e,t);if(a>r)throw new Error("value of L too long than hex: idx="+t);var s=o.getTLV(e,t),u=s.length-2-o.getL(e,t).length;if(u!==2*a)throw new Error("V string length and L's value not the same:"+u+"/"+2*a);if(0===t&&e.length!=s.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+s.length);var l=e.substr(t,2);if("02"===l){var c=o.getVidx(e,t);if("00"==e.substr(c,2)&&e.charCodeAt(c+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(l,16)){for(var f=o.getVblen(e,t),d=0,h=o.getChildIdx(e,t),p=0;p =t?e:new Array(t-e.length+1).join(n)+e};void 0!==le&&le||(t.KJUR=le={}),void 0!==le.crypto&&le.crypto||(le.crypto={}),le.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:y.algo.MD5,sha1:y.algo.SHA1,sha224:y.algo.SHA224,sha256:y.algo.SHA256,sha384:y.algo.SHA384,sha512:y.algo.SHA512,ripemd160:y.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,n){var r=this.getDigestInfoHex(e,t),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+t;for(var o="0001",a="00"+r,s="",u=i-o.length-a.length,l=0;l=0)return!1;if(n.compareTo(r.ONE)<0||n.compareTo(o)>=0)return!1;var s=n.modInverse(o),u=e.multiply(s).mod(o),l=t.multiply(s).mod(o);return a.multiply(u).add(i.multiply(l)).getX().toBigInteger().mod(o).equals(t)},this.serializeSig=function(e,t){var n=e.toByteArraySigned(),r=t.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var n=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:r.fromByteArrayUnsigned(n),s:r.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:r.fromByteArrayUnsigned(e.slice(1,33)).mod(n),s:r.fromByteArrayUnsigned(e.slice(33,65)).mod(n),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===c(e))throw new Error("not ASN.1 hex string");var t,n,r;try{t=l(e,0,["[0]",0],"06"),n=l(e,0,[1],"04");try{r=l(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===c(e))throw new t("not ASN.1 hex string");var n,r,i;try{l(e,0,[1,0],"06"),n=l(e,0,[1,1],"06"),r=l(e,0,[2,0,1],"04");try{i=l(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(n),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===c(e))throw new t("not ASN.1 hex string");var n,r;try{l(e,0,[0,0],"06"),n=l(e,0,[0,1],"06"),r=l(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,n){if(!1===c(e))throw new t("not ASN.1 hex string");var r,i;try{r=l(e,0,[0,5,0,1],"06"),i=l(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=s(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},le.crypto.ECDSA.parseSigHex=function(e){var t=le.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new E(t.r,16),s:new E(t.s,16)}},le.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=de,n=t.getChildIdx,r=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var o=i[0],a=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(a,2))throw new Error("2nd item not ASN.1 integer");return{r:r(e,o),s:r(e,a)}},le.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=le.crypto.ECDSA.parseSigHexInHexRS(e),n=t.r,r=t.s;if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw"unknown ECDSA sig r length error";if(r.length%32!=0)throw"unknown ECDSA sig s length error";return n+r},le.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var t=e.substr(0,e.length/2),n=e.substr(e.length/2);return le.crypto.ECDSA.hexRSSigToASN1Sig(t,n)},le.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var n=new E(e,16),r=new E(t,16);return le.crypto.ECDSA.biRSSigToASN1Sig(n,r)},le.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var n=le.asn1,r=new n.DERInteger({bigint:e}),i=new n.DERInteger({bigint:t});return new n.DERSequence({array:[r,i]}).getEncodedHex()},le.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":null},void 0!==le&&le||(t.KJUR=le={}),void 0!==le.crypto&&le.crypto||(le.crypto={}),le.crypto.ECParameterDB=new function(){var e={},t={};function n(e){return new E(e,16)}this.getByName=function(n){var r=n;if(void 0!==t[r]&&(r=t[n]),void 0!==e[r])return e[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,o,a,s,u,l,c,f,d,h,p){e[r]={};var g=n(o),v=n(a),y=n(s),m=n(u),b=n(l),w=new se(g,v,y),S=w.decodePointHex("04"+c+f);e[r].name=r,e[r].keylen=i,e[r].curve=w,e[r].G=S,e[r].n=m,e[r].h=b,e[r].oid=h,e[r].info=p;for(var _=0;_ =2*s)break}var f={};return f.keyhex=u.substr(0,2*i[e].keylen),f.ivhex=u.substr(2*i[e].keylen,2*i[e].ivlen),f},s=function(e,t,n,r){var o=y.enc.Base64.parse(e),a=y.enc.Hex.stringify(o);return(0,i[t].proc)(a,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return a(e,t,n)},decryptKeyB64:function(e,t,n,r){return s(e,t,n,r)},getDecryptedKeyHex:function(e,t){var n=o(e),r=(n.type,n.cipher),i=n.ivsalt,u=n.data,l=a(r,t,i).keyhex;return s(u,r,l,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,r,o){var s="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw"KEYUTIL unsupported algorithm: "+r;void 0!==o&&null!=o||(o=function(e){var t=y.lib.WordArray.random(e);return y.enc.Hex.stringify(t)}(i[r].ivlen).toUpperCase());var u=function(e,t,n,r){return(0,i[t].eproc)(e,n,r)}(t,r,a(r,n,o).keyhex,o);return s="-----BEGIN "+e+" PRIVATE KEY-----\r\n",s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+r+","+o+"\r\n",s+="\r\n",(s+=u.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var n=de,r=n.getChildIdx,i=n.getV,o={},a=r(t,0);if(2!=a.length)throw"malformed format: SEQUENCE(0).items != 2: "+a.length;o.ciphertext=i(t,a[1]);var s=r(t,a[0]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+s.length;if("2a864886f70d01050d"!=i(t,s[0]))throw"this only supports pkcs5PBES2";var u=r(t,s[1]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+u.length;var l=r(t,u[1]);if(2!=l.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+l.length;if("2a864886f70d0307"!=i(t,l[0]))throw"this only supports TripleDES";o.encryptionSchemeAlg="TripleDES",o.encryptionSchemeIV=i(t,l[1]);var c=r(t,u[0]);if(2!=c.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length;if("2a864886f70d01050c"!=i(t,c[0]))throw"this only supports pkcs5PBKDF2";var f=r(t,c[1]);if(f.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+f.length;o.pbkdf2Salt=i(t,f[0]);var d=i(t,f[1]);try{o.pbkdf2Iter=parseInt(d,16)}catch(e){throw"malformed format pbkdf2Iter: "+d}return o},getPBKDF2KeyHexFromParam:function(e,t){var n=y.enc.Hex.parse(e.pbkdf2Salt),r=e.pbkdf2Iter,i=y.PBKDF2(t,n,{keySize:6,iterations:r});return y.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var n=Ae(e,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=He.getPBKDF2KeyHexFromParam(r,t),o={};o.ciphertext=y.enc.Hex.parse(r.ciphertext);var a=y.enc.Hex.parse(i),s=y.enc.Hex.parse(r.encryptionSchemeIV),u=y.TripleDES.decrypt(o,a,{iv:s});return y.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var o=n(e,0);if(3!=o.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=e.substr(o[1],2))throw"malformed PKCS8 private key(code:003)";var a=n(e,o[1]);if(2!=a.length)throw"malformed PKCS8 private key(code:004)";if("06"!=e.substr(a[0],2))throw"malformed PKCS8 private key(code:005)";if(i.algoid=r(e,a[0]),"06"==e.substr(a[1],2)&&(i.algparam=r(e,a[1])),"04"!=e.substr(o[2],2))throw"malformed PKCS8 private key(code:006)";return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Ae(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,n=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==n.algoid)t=new ie;else if("2a8648ce380401"==n.algoid)t=new le.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw"unsupported private key algorithm";t=new le.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=de.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new ie;else if("2a8648ce380401"===n)t=new le.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw"unsupported PKCS#8 public key hex";t=new le.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={};if("30"!=e.substr(0,2))throw"malformed RSA key(code:001)";var o=n(e,0);if(2!=o.length)throw"malformed RSA key(code:002)";if("02"!=e.substr(o[0],2))throw"malformed RSA key(code:003)";if(i.n=r(e,o[0]),"02"!=e.substr(o[1],2))throw"malformed RSA key(code:004)";return i.e=r(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={algparam:null},o=n(e,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var a=o[0];if("30"!=e.substr(a,2))throw"malformed PKCS8 public key(code:001)";var s=n(e,a);if(2!=s.length)throw"malformed PKCS8 public key(code:002)";if("06"!=e.substr(s[0],2))throw"malformed PKCS8 public key(code:003)";if(i.algoid=r(e,s[0]),"06"==e.substr(s[1],2)?i.algparam=r(e,s[1]):"30"==e.substr(s[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,s[1],[0],"02"),i.algparam.q=t.getVbyList(e,s[1],[1],"02"),i.algparam.g=t.getVbyList(e,s[1],[2],"02")),"03"!=e.substr(o[1],2))throw"malformed PKCS8 public key(code:004)";return i.key=r(e,o[1]).substr(2),i}}}();He.getKey=function(e,t,n){var r,i=(y=de).getChildIdx,o=(y.getV,y.getVbyList),a=le.crypto,s=a.ECDSA,u=a.DSA,l=ie,c=Ae,f=He;if(void 0!==l&&e instanceof l)return e;if(void 0!==s&&e instanceof s)return e;if(void 0!==u&&e instanceof u)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new s({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new s({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(A=new l).setPublic(e.n,e.e),A;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(A=new l).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),A;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(A=new l).setPrivate(e.n,e.e,e.d),A;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(A=new u).setPublic(e.p,e.q,e.g,e.y),A;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(A=new u).setPrivate(e.p,e.q,e.g,e.y,e.x),A;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(A=new l).setPublic(we(e.n),we(e.e)),A;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(A=new l).setPrivateEx(we(e.n),we(e.e),we(e.d),we(e.p),we(e.q),we(e.dp),we(e.dq),we(e.qi)),A;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(A=new l).setPrivate(we(e.n),we(e.e),we(e.d)),A;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var d=(P=new s({curve:e.crv})).ecparams.keylen/4,h="04"+("0000000000"+we(e.x)).slice(-d)+("0000000000"+we(e.y)).slice(-d);return P.setPublicKeyHex(h),P}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){d=(P=new s({curve:e.crv})).ecparams.keylen/4,h="04"+("0000000000"+we(e.x)).slice(-d)+("0000000000"+we(e.y)).slice(-d);var p=("0000000000"+we(e.d)).slice(-d);return P.setPublicKeyHex(h),P.setPrivateKeyHex(p),P}if("pkcs5prv"===n){var g,v=e,y=de;if(9===(g=i(v,0)).length)(A=new l).readPKCS5PrvKeyHex(v);else if(6===g.length)(A=new u).readPKCS5PrvKeyHex(v);else{if(!(g.length>2&&"04"===v.substr(g[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(A=new s).readPKCS5PrvKeyHex(v)}return A}if("pkcs8prv"===n)return f.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===n)return f._getKeyFromPublicPKCS8Hex(e);if("x509pub"===n)return We.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return We.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var m=Ae(e,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(m)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=c(e,"RSA PRIVATE KEY");return f.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=o(r=c(e,"DSA PRIVATE KEY"),0,[1],"02"),S=o(r,0,[2],"02"),_=o(r,0,[3],"02"),x=o(r,0,[4],"02"),k=o(r,0,[5],"02");return(A=new u).setPrivate(new E(w,16),new E(S,16),new E(_,16),new E(x,16),new E(k,16)),A}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED"))return b=c(e,"EC PRIVATE KEY"),f.getKey(b,null,"pkcs5prv");if(-1!=e.indexOf("-END PRIVATE KEY-"))return f.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var F=f.getDecryptedKeyHex(e,t),C=new ie;return C.readPKCS5PrvKeyHex(F),C}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var P,A=o(r=f.getDecryptedKeyHex(e,t),0,[1],"04"),T=o(r,0,[2,0],"06"),R=o(r,0,[3,0],"03").substr(2);if(void 0===le.crypto.OID.oidhex2name[T])throw"undefined OID(hex) in KJUR.crypto.OID: "+T;return(P=new s({curve:le.crypto.OID.oidhex2name[T]})).setPublicKeyHex(R),P.setPrivateKeyHex(A),P.isPublic=!1,P}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED"))return w=o(r=f.getDecryptedKeyHex(e,t),0,[1],"02"),S=o(r,0,[2],"02"),_=o(r,0,[3],"02"),x=o(r,0,[4],"02"),k=o(r,0,[5],"02"),(A=new u).setPrivate(new E(w,16),new E(S,16),new E(_,16),new E(x,16),new E(k,16)),A;if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return f.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},He.generateKeypair=function(e,t){if("RSA"==e){var n=t;(a=new ie).generate(n,"10001"),a.isPrivate=!0,a.isPublic=!0;var r=new ie,i=a.n.toString(16),o=a.e.toString(16);return r.setPublic(i,o),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}if("EC"==e){var a,s,u=t,l=new le.crypto.ECDSA({curve:u}).generateKeyPairHex();return(a=new le.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),a.setPrivateKeyHex(l.ecprvhex),a.isPrivate=!0,a.isPublic=!1,(r=new le.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}throw"unknown algorithm: "+e},He.getPEM=function(e,t,n,r,i,o){var a=le,s=a.asn1,u=s.DERObjectIdentifier,l=s.DERInteger,c=s.ASN1Util.newObject,f=s.x509.SubjectPublicKeyInfo,d=a.crypto,h=d.DSA,p=d.ECDSA,g=ie;function v(e){return c({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function m(e){return c({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function b(e){return c({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==g&&e instanceof g||void 0!==h&&e instanceof h||void 0!==p&&e instanceof p)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Pe(E=new f(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===n||null==n)&&1==e.isPrivate)return Pe(E=v(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===n||null==n)&&1==e.isPrivate){var w=new u({name:e.curveName}).getEncodedHex(),S=m(e).getEncodedHex(),_="";return(_+=Pe(w,"EC PARAMETERS"))+Pe(S,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==h&&e instanceof h&&(void 0===n||null==n)&&1==e.isPrivate)return Pe(E=b(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==n&&null!=n&&1==e.isPrivate){var E=v(e).getEncodedHex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,n,r,o)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==n&&null!=n&&1==e.isPrivate)return E=m(e).getEncodedHex(),void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,n,r,o);if("PKCS5PRV"==t&&void 0!==h&&e instanceof h&&void 0!==n&&null!=n&&1==e.isPrivate)return E=b(e).getEncodedHex(),void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,n,r,o);var x=function(e,t){var n=k(e,t);return new c({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).getEncodedHex()},k=function(e,t){var n=y.lib.WordArray.random(8),r=y.lib.WordArray.random(8),i=y.PBKDF2(t,n,{keySize:6,iterations:100}),o=y.enc.Hex.parse(e),a=y.TripleDES.encrypt(o,i,{iv:r})+"",s={};return s.ciphertext=a,s.pbkdf2Salt=y.enc.Hex.stringify(n),s.pbkdf2Iter=100,s.encryptionSchemeAlg="DES-EDE3-CBC",s.encryptionSchemeIV=y.enc.Hex.stringify(r),s};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var F=v(e).getEncodedHex();return E=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:F}}]}).getEncodedHex(),void 0===n||null==n?Pe(E,"PRIVATE KEY"):Pe(S=x(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate)return F=new c({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),E=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:F}}]}).getEncodedHex(),void 0===n||null==n?Pe(E,"PRIVATE KEY"):Pe(S=x(E,n),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==t&&void 0!==h&&e instanceof h&&1==e.isPrivate)return F=new l({bigint:e.x}).getEncodedHex(),E=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:F}}]}).getEncodedHex(),void 0===n||null==n?Pe(E,"PRIVATE KEY"):Pe(S=x(E,n),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},He.getKeyFromCSRPEM=function(e){var t=Ae(e,"CERTIFICATE REQUEST");return He.getKeyFromCSRHex(t)},He.getKeyFromCSRHex=function(e){var t=He.parseCSRHex(e);return He.getKey(t.p8pubkeyhex,null,"pkcs8pub")},He.parseCSRHex=function(e){var t=de,n=t.getChildIdx,r=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw"malformed CSR(code:001)";var a=n(o,0);if(a.length<1)throw"malformed CSR(code:002)";if("30"!=o.substr(a[0],2))throw"malformed CSR(code:003)";var s=n(o,a[0]);if(s.length<3)throw"malformed CSR(code:004)";return i.p8pubkeyhex=r(o,s[2]),i},He.getKeyID=function(e){var t=He,n=de;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var r=Ae(t.getPEM(e)),i=n.getIdxbyList(r,0,[1]),o=n.getV(r,i).substring(2);return le.crypto.Util.hashHex(o,"sha1")},He.getJWKFromKey=function(e){var t={};if(e instanceof ie&&e.isPrivate)return t.kty="RSA",t.n=be(e.n.toString(16)),t.e=be(e.e.toString(16)),t.d=be(e.d.toString(16)),t.p=be(e.p.toString(16)),t.q=be(e.q.toString(16)),t.dp=be(e.dmp1.toString(16)),t.dq=be(e.dmq1.toString(16)),t.qi=be(e.coeff.toString(16)),t;if(e instanceof ie&&e.isPublic)return t.kty="RSA",t.n=be(e.n.toString(16)),t.e=be(e.e.toString(16)),t;if(e instanceof le.crypto.ECDSA&&e.isPrivate){if("P-256"!==(r=e.getShortNISTPCurveName())&&"P-384"!==r)throw"unsupported curve name for JWT: "+r;var n=e.getPublicKeyXYHex();return t.kty="EC",t.crv=r,t.x=be(n.x),t.y=be(n.y),t.d=be(e.prvKeyHex),t}if(e instanceof le.crypto.ECDSA&&e.isPublic){var r;if("P-256"!==(r=e.getShortNISTPCurveName())&&"P-384"!==r)throw"unsupported curve name for JWT: "+r;return n=e.getPublicKeyXYHex(),t.kty="EC",t.crv=r,t.x=be(n.x),t.y=be(n.y),t}throw"not supported key object"},ie.getPosArrayOfChildrenFromHex=function(e){return de.getChildIdx(e,0)},ie.getHexValueArrayOfChildrenFromHex=function(e){var t,n=de.getV,r=n(e,(t=ie.getPosArrayOfChildrenFromHex(e))[0]),i=n(e,t[1]),o=n(e,t[2]),a=n(e,t[3]),s=n(e,t[4]),u=n(e,t[5]),l=n(e,t[6]),c=n(e,t[7]),f=n(e,t[8]);return(t=new Array).push(r,i,o,a,s,u,l,c,f),t},ie.prototype.readPrivateKeyFromPEMString=function(e){var t=Ae(e),n=ie.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},ie.prototype.readPKCS5PrvKeyHex=function(e){var t=ie.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ie.prototype.readPKCS8PrvKeyHex=function(e){var t,n,r,i,o,a,s,u,l=de,c=l.getVbyListEx;if(!1===l.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=c(e,0,[2,0,1],"02"),n=c(e,0,[2,0,2],"02"),r=c(e,0,[2,0,3],"02"),i=c(e,0,[2,0,4],"02"),o=c(e,0,[2,0,5],"02"),a=c(e,0,[2,0,6],"02"),s=c(e,0,[2,0,7],"02"),u=c(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,n,r,i,o,a,s,u)},ie.prototype.readPKCS5PubKeyHex=function(e){var t=de,n=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(e,0);if(2!==r.length||"02"!==e.substr(r[0],2)||"02"!==e.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(e,r[0]),o=n(e,r[1]);this.setPublic(i,o)},ie.prototype.readPKCS8PubKeyHex=function(e){var t=de;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(n)},ie.prototype.readCertPubKeyHex=function(e,t){var n,r;(n=new We).readCertHex(e),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};var Ve=new RegExp("[^0-9a-f]","gi");function qe(e,t){for(var n="",r=t/4-e.length,i=0;i >24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function ze(e){for(var t in le.crypto.Util.DIGESTINFOHEAD){var n=le.crypto.Util.DIGESTINFOHEAD[t],r=n.length;if(e.substring(0,r)==n)return[t,e.substring(r)]}return[]}function We(e){var t,n=de,r=n.getChildIdx,i=n.getV,o=n.getTLV,a=n.getVbyList,s=n.getVbyListEx,u=n.getTLVbyList,l=n.getTLVbyListEx,c=n.getIdxbyList,f=n.getIdxbyListEx,d=n.getVidx,h=n.oidname,p=n.hextooidstr,g=We,v=Ae;try{t=le.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){return null===this.hex||0!==this.version?this.version:"a003020102"!==u(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return s(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var n in t)if(e===t[n])return n;return h(s(e,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return g.hex2dn(this.getIssuerHex())},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return g.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var e=a(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getNotAfter=function(){var e=a(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getPublicKeyHex=function(){return n.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return c(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return He.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=u(this.hex,0,[0],"30"),i=new le.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.parseExt=function(e){var t,o,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=c(s,0,[0,7,0],"30"),o=r(s,t)}else{s=Ae(e);var u=c(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(s,u))return void(this.aExtInfo=new Array);t=c(s,0,[0,3,0,1,0],"30"),o=r(s,t),this.hex=s}this.aExtInfo=new Array;for(var l=0;l 1){var s=o(e,a[1]),u=this.getGeneralName(s);null!=u.uri&&(i.uri=u.uri)}if(a.length>2){var l=o(e,a[2]);"0101ff"==l&&(i.reqauth=!0),"010100"==l&&(i.reqauth=!1)}return i},this.getX500NameRule=function(e){for(var t=null,n=[],r=0;r 0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&-1!=f(this.hex,0,[0,"[3]"])&&(e=l(this.hex,0,[0,"[3]",0],"30"));for(var t=[],n=r(e,0),i=0;i 0&&(l=new Array(n),(new te).nextBytes(l),l=String.fromCharCode.apply(String,l));var c=Ee(u(xe("\0\0\0\0\0\0\0\0"+i+l))),f=[];for(r=0;r >8*s-a&255;for(p[0]&=~g,r=0;r this.n.bitLength())return 0;var r=ze(this.doPublic(n).toString(16).replace(/^1f+00/,""));if(0==r.length)return!1;var i=r[0];return r[1]==function(e){return le.crypto.Util.hashString(e,i)}(e)},ie.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=ne(t,16);if(n.bitLength()>this.n.bitLength())return 0;var r=ze(this.doPublic(n).toString(16).replace(/^1f+00/,""));return 0!=r.length&&(r[0],r[1]==e)},ie.prototype.verifyPSS=function(e,t,n,r){var i=function(e){return le.crypto.Util.hashHex(e,n)}(xe(e));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(i,t,n,r)},ie.prototype.verifyWithMessageHashPSS=function(e,t,n,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new E(t,16),a=function(e){return le.crypto.Util.hashHex(e,n)},s=Ee(e),u=s.length,l=this.n.bitLength()-1,c=Math.ceil(l/8);if(-1===r||void 0===r)r=u;else if(-2===r)r=c-u-2;else if(r<-2)throw new Error("invalid salt length");if(c>8*c-l&255;if(0!=(d.charCodeAt(0)&p))throw new Error("bits beyond keysize not zero");var g=Ke(h,d.length,a),v=[];for(i=0;i 0&&-1==(":"+r.join(":")+":").indexOf(":"+y+":"))throw"algorithm '"+y+"' not accepted in the list";if("none"!=y&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=He.getKey(t)),!("RS"!=h&&"PS"!=h||t instanceof i))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==h&&!(t instanceof l))throw"key shall be a ECDSA obj for ES* algs";var m=null;if(void 0===a.jwsalg2sigalg[v.alg])throw"unsupported alg name: "+y;if("none"==(m=a.jwsalg2sigalg[y]))throw"not supported";if("Hmac"==m.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var b=new c({alg:m,pass:t});return b.updateString(p),g==b.doFinal()}if(-1!=m.indexOf("withECDSA")){var w,S=null;try{S=l.concatSigToASN1Sig(g)}catch(e){return!1}return(w=new f({alg:m})).init(t),w.updateString(p),w.verify(S)}return(w=new f({alg:m})).init(t),w.updateString(p),w.verify(g)},le.jws.JWS.parse=function(e){var t,n,r,i=e.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],n=i[1],3==i.length&&(r=i[2]),o.headerObj=le.jws.JWS.readSafeJSONString(fe(t)),o.payloadObj=le.jws.JWS.readSafeJSONString(fe(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=fe(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=we(r)),o},le.jws.JWS.verifyJWT=function(e,t,r){var i=le.jws,o=i.JWS,a=o.readSafeJSONString,s=o.inArray,u=o.includedArray,l=e.split("."),c=l[0],f=l[1],d=(we(l[2]),a(fe(c))),h=a(fe(f));if(void 0===d.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!s(d.alg,r.alg))return!1;if(void 0!==h.iss&&"object"===n(r.iss)&&!s(h.iss,r.iss))return!1;if(void 0!==h.sub&&"object"===n(r.sub)&&!s(h.sub,r.sub))return!1;if(void 0!==h.aud&&"object"===n(r.aud))if("string"==typeof h.aud){if(!s(h.aud,r.aud))return!1}else if("object"==n(h.aud)&&!u(h.aud,r.aud))return!1;var p=i.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(p=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==h.exp&&"number"==typeof h.exp&&h.exp+r.gracePeriod t.length&&(n=t.length);for(var r=0;r
=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return F(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o s&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;di&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function F(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i 239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;r 0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... "))," "},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;f i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function P(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;o n)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t e.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i >>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i >>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,o){return o||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,o){return o||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t 0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=this[e],i=1,o=0;++o =(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||I(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o =0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o >0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r =this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t =0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i >>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o 55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var i=0;i =t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(29))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=l(e),a=r[0],s=r[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),c=0,f=s>0?a-4:a;for(n=0;n >16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;su?u:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o,a=[],s=t;s >18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1< >1,c=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,l-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.jws,n=e.KeyUtil,i=e.X509,o=e.crypto,a=e.hextob64u,s=e.b64tohex,u=e.AllowedSigningAlgs;return function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.parseJwt=function e(n){r.Log.debug("JoseUtil.parseJwt");try{var i=t.JWS.parse(n);return{header:i.headerObj,payload:i.payloadObj}}catch(e){r.Log.error(e)}},e.validateJwt=function(t,o,a,u,l,c,f){r.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=n.getKey(o);else{if(!o.x5c||!o.x5c.length)return r.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var d=s(o.x5c[0]);o=i.getPublicKeyFromCertHex(d)}else{if("EC"!==o.kty)return r.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return r.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=n.getKey(o)}return e._validateJwt(t,o,a,u,l,c,f)}catch(e){return r.Log.error(e&&e.message||e),Promise.reject("JWT validation failed")}},e.validateJwtAttributes=function(t,n,i,o,a,s){o||(o=0),a||(a=parseInt(Date.now()/1e3));var u=e.parseJwt(t).payload;if(!u.iss)return r.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==n)return r.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return r.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===i||Array.isArray(u.aud)&&u.aud.indexOf(i)>=0))return r.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==i)return r.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!s){var l=a+o,c=a-o;if(!u.iat)return r.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(l 1&&void 0!==arguments[1]?arguments[1]:"#";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=i.UrlUtility.parseUrlFragment(t,n);this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.code=r.code,this.state=r.state,this.id_token=r.id_token,this.session_state=r.session_state,this.access_token=r.access_token,this.token_type=r.token_type,this.scope=r.scope,this.profile=void 0,this.expires_in=r.expires_in}return r(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutRequest=void 0;var r=n(0),i=n(3),o=n(9);t.SignoutRequest=function e(t){var n=t.url,a=t.id_token_hint,s=t.post_logout_redirect_uri,u=t.data,l=t.extraQueryParams,c=t.request_type;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!n)throw r.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var f in a&&(n=i.UrlUtility.addQueryParam(n,"id_token_hint",a)),s&&(n=i.UrlUtility.addQueryParam(n,"post_logout_redirect_uri",s),u&&(this.state=new o.State({data:u,request_type:c}),n=i.UrlUtility.addQueryParam(n,"state",this.state.id))),l)n=i.UrlUtility.addQueryParam(n,f,l[f]);this.url=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutResponse=void 0;var r=n(3);t.SignoutResponse=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=r.UrlUtility.parseUrlFragment(t,"?");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryWebStorage=void 0;var r=function(){function e(e,t){for(var n=0;n 0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.SessionMonitor,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.TokenRevocationClient,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:h.TokenClient,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.JoseUtil;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),n instanceof a.UserManagerSettings||(n=new a.UserManagerSettings(n));var v=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return v._events=new u.UserManagerEvents(n),v._silentRenewService=new r(v),v.settings.automaticSilentRenew&&(i.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),v.startSilentRenew()),v.settings.monitorSession&&(i.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),v._sessionMonitor=new o(v)),v._tokenRevocationClient=new s(v._settings),v._tokenClient=new f(v._settings),v._joseUtil=g,v}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getUser=function(){var e=this;return this._loadUser().then((function(t){return t?(i.Log.info("UserManager.getUser: user loaded"),e._events.load(t,!1),t):(i.Log.info("UserManager.getUser: user not found in storage"),null)}))},t.prototype.removeUser=function(){var e=this;return this.storeUser(null).then((function(){i.Log.info("UserManager.removeUser: user removed from storage"),e._events.unload()}))},t.prototype.signinRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:r";var t={useReplaceToNavigate:e.useReplaceToNavigate};return this._signinStart(e,this._redirectNavigator,t).then((function(){i.Log.info("UserManager.signinRedirect: successful")}))},t.prototype.signinRedirectCallback=function(e){return this._signinEnd(e||this._redirectNavigator.url).then((function(e){return e.profile&&e.profile.sub?i.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinRedirectCallback: no sub"),e}))},t.prototype.signinPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:p";var t=e.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.display="popup",this._signin(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopup: no sub")),e}))):(i.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},t.prototype.signinPopupCallback=function(e){return this._signinCallback(e,this._popupNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopupCallback: no sub")),e})).catch((function(e){i.Log.error(e.message)}))},t.prototype.signinSilent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),this._loadUser().then((function(n){return n&&n.refresh_token?(t.refresh_token=n.refresh_token,e._useRefreshToken(t)):(t.request_type="si:s",t.id_token_hint=t.id_token_hint||e.settings.includeIdTokenInSilentRenew&&n&&n.id_token,n&&e._settings.validateSubOnSilentRenew&&(i.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",n.profile.sub),t.current_sub=n.profile.sub),e._signinSilentIframe(t))}))},t.prototype._useRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(t).then((function(t){return t?t.access_token?e._loadUser().then((function(n){if(n){var r=Promise.resolve();return t.id_token&&(r=e._validateIdTokenFromTokenRefreshToken(n.profile,t.id_token)),r.then((function(){return i.Log.debug("UserManager._useRefreshToken: refresh token response success"),n.id_token=t.id_token||n.id_token,n.access_token=t.access_token,n.refresh_token=t.refresh_token||n.refresh_token,n.expires_in=t.expires_in,e.storeUser(n).then((function(){return e._events.load(n),n}))}))}return null})):(i.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(i.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},t.prototype._validateIdTokenFromTokenRefreshToken=function(e,t){var n=this;return this._metadataService.getIssuer().then((function(r){return n.settings.getEpochTime().then((function(o){return n._joseUtil.validateJwtAttributes(t,r,n._settings.client_id,n._settings.clockSkew,o).then((function(t){return t?t.sub!==e.sub?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==e.auth_time?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},t.prototype._signinSilentIframe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.prompt=e.prompt||"none",this._signin(e,this._iframeNavigator,{startUrl:t,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilent: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilent: no sub")),e}))):(i.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype.signinSilentCallback=function(e){return this._signinCallback(e,this._iframeNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilentCallback: no sub")),e}))},t.prototype.signinCallback=function(e){var t=this;return this.readSigninResponseState(e).then((function(n){var r=n.state;return n.response,"si:r"===r.request_type?t.signinRedirectCallback(e):"si:p"===r.request_type?t.signinPopupCallback(e):"si:s"===r.request_type?t.signinSilentCallback(e):Promise.reject(new Error("invalid response_type in state"))}))},t.prototype.signoutCallback=function(e,t){var n=this;return this.readSignoutResponseState(e).then((function(r){var i=r.state,o=r.response;return i?"so:r"===i.request_type?n.signoutRedirectCallback(e):"so:p"===i.request_type?n.signoutPopupCallback(e,t):Promise.reject(new Error("invalid response_type in state")):o}))},t.prototype.querySessionStatus=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:s";var n=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return n?(t.redirect_uri=n,t.prompt="none",t.response_type=t.response_type||this.settings.query_status_response_type,t.scope=t.scope||"openid",t.skipUserInfo=!0,this._signinStart(t,this._iframeNavigator,{startUrl:n,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return e.processSigninResponse(t.url).then((function(e){if(i.Log.debug("UserManager.querySessionStatus: got signin response"),e.session_state&&e.profile.sub)return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid};i.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(t){if(t.session_state&&e.settings.monitorAnonymousSession&&("login_required"==t.message||"consent_required"==t.message||"interaction_required"==t.message||"account_selection_required"==t.message))return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:t.session_state};throw t}))}))):(i.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype._signin=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(e,t,r).then((function(t){return n._signinEnd(t.url,e)}))},t.prototype._signinStart=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.prepare(r).then((function(t){return i.Log.debug("UserManager._signinStart: got navigator window handle"),n.createSigninRequest(e).then((function(e){return i.Log.debug("UserManager._signinStart: got signin request"),r.url=e.url,r.id=e.state.id,t.navigate(r)})).catch((function(e){throw t.close&&(i.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))},t.prototype._signinEnd=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(e).then((function(e){i.Log.debug("UserManager._signinEnd: got signin response");var r=new s.User(e);if(n.current_sub){if(n.current_sub!==r.profile.sub)return i.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",r.profile.sub),Promise.reject(new Error("login_required"));i.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return t.storeUser(r).then((function(){return i.Log.debug("UserManager._signinEnd: user stored"),t._events.load(r),r}))}))},t.prototype._signinCallback=function(e,t){i.Log.debug("UserManager._signinCallback");var n="query"===this._settings.response_mode||!this._settings.response_mode&&f.SigninRequest.isCode(this._settings.response_type)?"?":"#";return t.callback(e,void 0,n)},t.prototype.signoutRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:r";var t=e.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;t&&(e.post_logout_redirect_uri=t);var n={useReplaceToNavigate:e.useReplaceToNavigate};return this._signoutStart(e,this._redirectNavigator,n).then((function(){i.Log.info("UserManager.signoutRedirect: successful")}))},t.prototype.signoutRedirectCallback=function(e){return this._signoutEnd(e||this._redirectNavigator.url).then((function(e){return i.Log.info("UserManager.signoutRedirectCallback: successful"),e}))},t.prototype.signoutPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:p";var t=e.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e.post_logout_redirect_uri=t,e.display="popup",e.post_logout_redirect_uri&&(e.state=e.state||{}),this._signout(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){i.Log.info("UserManager.signoutPopup: successful")}))},t.prototype.signoutPopupCallback=function(e,t){return void 0===t&&"boolean"==typeof e&&(t=e,e=null),this._popupNavigator.callback(e,t,"?").then((function(){i.Log.info("UserManager.signoutPopupCallback: successful")}))},t.prototype._signout=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(e,t,r).then((function(e){return n._signoutEnd(e.url)}))},t.prototype._signoutStart=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return arguments[1].prepare(n).then((function(r){return i.Log.debug("UserManager._signoutStart: got navigator window handle"),t._loadUser().then((function(o){return i.Log.debug("UserManager._signoutStart: loaded current user from storage"),(t._settings.revokeAccessTokenOnSignout?t._revokeInternal(o):Promise.resolve()).then((function(){var a=e.id_token_hint||o&&o.id_token;return a&&(i.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),e.id_token_hint=a),t.removeUser().then((function(){return i.Log.debug("UserManager._signoutStart: user removed, creating signout request"),t.createSignoutRequest(e).then((function(e){return i.Log.debug("UserManager._signoutStart: got signout request"),n.url=e.url,e.state&&(n.id=e.state.id),r.navigate(n)}))}))}))})).catch((function(e){throw r.close&&(i.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),r.close()),e}))}))},t.prototype._signoutEnd=function(e){return this.processSignoutResponse(e).then((function(e){return i.Log.debug("UserManager._signoutEnd: got signout response"),e}))},t.prototype.revokeAccessToken=function(){var e=this;return this._loadUser().then((function(t){return e._revokeInternal(t,!0).then((function(n){if(n)return i.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,e.storeUser(t).then((function(){i.Log.debug("UserManager.revokeAccessToken: user stored"),e._events.load(t)}))}))})).then((function(){i.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},t.prototype._revokeInternal=function(e,t){var n=this;if(e){var r=e.access_token,o=e.refresh_token;return this._revokeAccessTokenInternal(r,t).then((function(e){return n._revokeRefreshTokenInternal(o,t).then((function(t){return e||t||i.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),e||t}))}))}return Promise.resolve(!1)},t.prototype._revokeAccessTokenInternal=function(e,t){return!e||e.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(e,t).then((function(){return!0}))},t.prototype._revokeRefreshTokenInternal=function(e,t){return e?this._tokenRevocationClient.revoke(e,t,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},t.prototype.startSilentRenew=function(){this._silentRenewService.start()},t.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},t.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(e){return e?(i.Log.debug("UserManager._loadUser: user storageString loaded"),s.User.fromStorageString(e)):(i.Log.debug("UserManager._loadUser: no user storageString"),null)}))},t.prototype.storeUser=function(e){if(e){i.Log.debug("UserManager.storeUser: storing user");var t=e.toStorageString();return this._userStore.set(this._userStoreKey,t)}return i.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},r(t,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),t}(o.OidcClient)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerSettings=void 0;var r=function(){function e(e,t){for(var n=0;n 0&&void 0!==arguments[0]?arguments[0]:{},r=n.popup_redirect_uri,i=n.popup_post_logout_redirect_uri,f=n.popupWindowFeatures,d=n.popupWindowTarget,h=n.silent_redirect_uri,p=n.silentRequestTimeout,g=n.automaticSilentRenew,v=void 0!==g&&g,y=n.validateSubOnSilentRenew,m=void 0!==y&&y,b=n.includeIdTokenInSilentRenew,w=void 0===b||b,S=n.monitorSession,_=void 0===S||S,E=n.monitorAnonymousSession,x=void 0!==E&&E,k=n.checkSessionInterval,F=void 0===k?2e3:k,C=n.stopCheckSessionOnError,P=void 0===C||C,A=n.query_status_response_type,T=n.revokeAccessTokenOnSignout,R=void 0!==T&&T,N=n.accessTokenExpiringNotificationTime,I=void 0===N?60:N,O=n.redirectNavigator,j=void 0===O?new o.RedirectNavigator:O,L=n.popupNavigator,D=void 0===L?new a.PopupNavigator:L,U=n.iframeNavigator,M=void 0===U?new s.IFrameNavigator:U,B=n.userStore,H=void 0===B?new u.WebStorageStateStore({store:l.Global.sessionStorage}):B;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var V=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,arguments[0]));return V._popup_redirect_uri=r,V._popup_post_logout_redirect_uri=i,V._popupWindowFeatures=f,V._popupWindowTarget=d,V._silent_redirect_uri=h,V._silentRequestTimeout=p,V._automaticSilentRenew=v,V._validateSubOnSilentRenew=m,V._includeIdTokenInSilentRenew=w,V._accessTokenExpiringNotificationTime=I,V._monitorSession=_,V._monitorAnonymousSession=x,V._checkSessionInterval=F,V._stopCheckSessionOnError=P,A?V._query_status_response_type=A:arguments[0]&&arguments[0].response_type?V._query_status_response_type=c.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":V._query_status_response_type="id_token",V._revokeAccessTokenOnSignout=R,V._redirectNavigator=j,V._popupNavigator=D,V._iframeNavigator=M,V._userStore=H,V}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),t}(i.OidcClientSettings)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectNavigator=void 0;var r=function(){function e(e,t){for(var n=0;n 1&&void 0!==arguments[1])||arguments[1];r.Log.debug("UserManagerEvents.load"),e.prototype.load.call(this,t),n&&this._userLoaded.raise(t)},t.prototype.unload=function(){r.Log.debug("UserManagerEvents.unload"),e.prototype.unload.call(this),this._userUnloaded.raise()},t.prototype.addUserLoaded=function(e){this._userLoaded.addHandler(e)},t.prototype.removeUserLoaded=function(e){this._userLoaded.removeHandler(e)},t.prototype.addUserUnloaded=function(e){this._userUnloaded.addHandler(e)},t.prototype.removeUserUnloaded=function(e){this._userUnloaded.removeHandler(e)},t.prototype.addSilentRenewError=function(e){this._silentRenewError.addHandler(e)},t.prototype.removeSilentRenewError=function(e){this._silentRenewError.removeHandler(e)},t.prototype._raiseSilentRenewError=function(e){r.Log.debug("UserManagerEvents._raiseSilentRenewError",e.message),this._silentRenewError.raise(e)},t.prototype.addUserSignedIn=function(e){this._userSignedIn.addHandler(e)},t.prototype.removeUserSignedIn=function(e){this._userSignedIn.removeHandler(e)},t.prototype._raiseUserSignedIn=function(){r.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},t.prototype.addUserSignedOut=function(e){this._userSignedOut.addHandler(e)},t.prototype.removeUserSignedOut=function(e){this._userSignedOut.removeHandler(e)},t.prototype._raiseUserSignedOut=function(){r.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},t.prototype.addUserSessionChanged=function(e){this._userSessionChanged.addHandler(e)},t.prototype.removeUserSessionChanged=function(e){this._userSessionChanged.removeHandler(e)},t.prototype._raiseUserSessionChanged=function(){r.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},t}(i.AccessTokenEvents)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var r=function(){function e(e,t){for(var n=0;n 1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return a._timer=r,a._nowFunc=i||function(){return Date.now()/1e3},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.init=function(e){e<=0&&(e=1),e=parseInt(e);var t=this.now+e;if(this.expiration===t&&this._timerHandle)i.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),i.Log.debug("Timer.init timer "+this._name+" for duration:",e),this._expiration=t;var n=5;e t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!f.call(p,e)||!f.call(h,e)&&(d.test(e)?p[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,m);v[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,m);v[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,m);v[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){v[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),v.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){v[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),C=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),N=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var I=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var O=Symbol.iterator;function j(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=O&&e[O]||e["@@iterator"])?e:null}var L,D=Object.assign;function U(e){if(void 0===L)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return"\n"+L+e}var M=!1;function B(e,t){if(!e||M)return"";M=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"===typeof l.stack){for(var i=l.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s]){var u="\n"+i[a].replace(" at new "," at ");return e.displayName&&u.includes(" ")&&(u=u.replace(" ",e.displayName)),u}}while(1<=a&&0<=s);break}}}finally{M=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?U(e):""}function H(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case E:return"Fragment";case _:return"Portal";case k:return"Profiler";case x:return"StrictMode";case A:return"Suspense";case T:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case F:return(e._context.displayName||"Context")+".Provider";case P:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case R:return null!==(t=e.displayName||null)?t:V(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return V(e(t))}catch(n){}}return null}function q(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(t);case 8:return t===x?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function K(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function W(e){e._valueTracker||(e._valueTracker=function(e){var t=z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function J(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=z(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Q(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Y(e,t){var n=t.checked;return D({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function $(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=K(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function G(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function X(e,t){G(e,t);var n=K(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,K(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&Q(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i "+t.valueOf().toString()+"",t=le.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ce(e,t)}))}:ce);function de(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function ge(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function ve(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=ge(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(he).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]}))}));var ye=D({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function me(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,Ee=null,xe=null;function ke(e){if(e=bi(e)){if("function"!==typeof _e)throw Error(o(280));var t=e.stateNode;t&&(t=Si(t),_e(e.stateNode,e.type,t))}}function Fe(e){Ee?xe?xe.push(e):xe=[e]:Ee=e}function Ce(){if(Ee){var e=Ee,t=xe;if(xe=Ee=null,ke(e),t)for(e=0;e >>=0,0===e?32:31-(st(e)/ut|0)|0},st=Math.log,ut=Math.LN2;var lt=64,ct=4194304;function ft(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~i;0!==s?r=ft(s):0!==(o&=a)&&(r=ft(o))}else 0!==(a=n&~i)?r=ft(a):0!==o&&(r=ft(o));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&0!==(4194240&o)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0 n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=n}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),i=1< =jn),Un=String.fromCharCode(32),Mn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==In.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Vn=!1;var qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function zn(e,t,n,r){Fe(r),0<(t=Wr(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Wn=null,Jn=null;function Qn(e){Ur(e,0)}function Yn(e){if(J(wi(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if(c){var Xn;if(c){var Zn="oninput"in document;if(!Zn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Zn="function"===typeof er.oninput}Xn=Zn}else Xn=!1;Gn=Xn&&(!document.documentMode||9 =t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dr(){for(var e=window,t=Q();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Q((e=t.contentWindow).document)}return t}function hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pr(e){var t=dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fr(n.ownerDocument.documentElement,n)){if(null!==r&&hr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=cr(n,o);var a=cr(n,r);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n =document.documentMode,vr=null,yr=null,mr=null,br=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==vr||vr!==Q(r)||("selectionStart"in(r=vr)&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},mr&&ur(mr,r)||(mr=r,0<(r=Wr(yr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}function Sr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:Sr("Animation","AnimationEnd"),animationiteration:Sr("Animation","AnimationIteration"),animationstart:Sr("Animation","AnimationStart"),transitionend:Sr("Transition","TransitionEnd")},Er={},xr={};function kr(e){if(Er[e])return Er[e];if(!_r[e])return e;var t,n=_r[e];for(t in n)if(n.hasOwnProperty(t)&&t in xr)return Er[e]=n[t];return e}c&&(xr=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);var Fr=kr("animationend"),Cr=kr("animationiteration"),Pr=kr("animationstart"),Ar=kr("transitionend"),Tr=new Map,Rr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Nr(e,t){Tr.set(e,t),u(t,[e])}for(var Ir=0;Ir Ei||(e.current=_i[Ei],_i[Ei]=null,Ei--)}function Fi(e,t){Ei++,_i[Ei]=e.current,e.current=t}var Ci={},Pi=xi(Ci),Ai=xi(!1),Ti=Ci;function Ri(e,t){var n=e.type.contextTypes;if(!n)return Ci;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ni(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ii(){ki(Ai),ki(Pi)}function Oi(e,t,n){if(Pi.current!==Ci)throw Error(o(168));Fi(Pi,t),Fi(Ai,n)}function ji(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(o(108,q(e)||"Unknown",i));return D({},n,r)}function Li(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ci,Ti=Pi.current,Fi(Pi,e),Fi(Ai,Ai.current),!0}function Di(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=ji(e,t,Ti),r.__reactInternalMemoizedMergedChildContext=e,ki(Ai),ki(Pi),Fi(Pi,e)):ki(Ai),Fi(Ai,n)}var Ui=null,Mi=!1,Bi=!1;function Hi(e){null===Ui?Ui=[e]:Ui.push(e)}function Vi(){if(!Bi&&null!==Ui){Bi=!0;var e=0,t=bt;try{var n=Ui;for(bt=1;e >=a,i-=a,$i=1<<32-at(t)+i|n<g?(v=f,f=null):v=f.sibling;var y=h(i,f,s[g],u);if(null===y){null===f&&(f=v);break}e&&f&&null===y.alternate&&t(i,f),o=a(y,o,g),null===c?l=y:c.sibling=y,c=y,f=v}if(g===s.length)return n(i,f),io&&Xi(i,g),l;if(null===f){for(;g v?(y=g,g=null):y=g.sibling;var b=h(i,g,m.value,l);if(null===b){null===g&&(g=y);break}e&&g&&null===b.alternate&&t(i,g),s=a(b,s,v),null===f?c=b:f.sibling=b,f=b,g=y}if(m.done)return n(i,g),io&&Xi(i,v),c;if(null===g){for(;!m.done;v++,m=u.next())null!==(m=d(i,m.value,l))&&(s=a(m,s,v),null===f?c=m:f.sibling=m,f=m);return io&&Xi(i,v),c}for(g=r(i,g);!m.done;v++,m=u.next())null!==(m=p(g,i,v,m.value,l))&&(e&&null!==m.alternate&&g.delete(null===m.key?v:m.key),s=a(m,s,v),null===f?c=m:f.sibling=m,f=m);return e&&g.forEach((function(e){return t(i,e)})),io&&Xi(i,v),c}return function e(r,o,a,u){if("object"===typeof a&&null!==a&&a.type===E&&null===a.key&&(a=a.props.children),"object"===typeof a&&null!==a){switch(a.$$typeof){case S:e:{for(var l=a.key,c=o;null!==c;){if(c.key===l){if((l=a.type)===E){if(7===c.tag){n(r,c.sibling),(o=i(c,a.props.children)).return=r,r=o;break e}}else if(c.elementType===l||"object"===typeof l&&null!==l&&l.$$typeof===N&&Yo(l)===c.type){n(r,c.sibling),(o=i(c,a.props)).ref=Jo(r,c,a),o.return=r,r=o;break e}n(r,c);break}t(r,c),c=c.sibling}a.type===E?((o=Ll(a.props.children,r.mode,u,a.key)).return=r,r=o):((u=jl(a.type,a.key,a.props,null,r.mode,u)).ref=Jo(r,o,a),u.return=r,r=u)}return s(r);case _:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){n(r,o.sibling),(o=i(o,a.children||[])).return=r,r=o;break e}n(r,o);break}t(r,o),o=o.sibling}(o=Ml(a,r.mode,u)).return=r,r=o}return s(r);case N:return e(r,o,(c=a._init)(a._payload),u)}if(te(a))return g(r,o,a,u);if(j(a))return v(r,o,a,u);Qo(r,a)}return"string"===typeof a&&""!==a||"number"===typeof a?(a=""+a,null!==o&&6===o.tag?(n(r,o.sibling),(o=i(o,a)).return=r,r=o):(n(r,o),(o=Ul(a,r.mode,u)).return=r,r=o),s(r)):n(r,o)}}var Go=$o(!0),Xo=$o(!1),Zo={},ea=xi(Zo),ta=xi(Zo),na=xi(Zo);function ra(e){if(e===Zo)throw Error(o(174));return e}function ia(e,t){switch(Fi(na,t),Fi(ta,e),Fi(ea,Zo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ue(null,"");break;default:t=ue(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ki(ea),Fi(ea,t)}function oa(){ki(ea),ki(ta),ki(na)}function aa(e){ra(na.current);var t=ra(ea.current),n=ue(t,e.type);t!==n&&(Fi(ta,e),Fi(ea,n))}function sa(e){ta.current===e&&(ki(ea),ki(ta))}var ua=xi(0);function la(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ca=[];function fa(){for(var e=0;e n?n:4,e(!0);var r=ha.transition;ha.transition={};try{e(!1),t()}finally{bt=n,ha.transition=r}}function es(){return Ca().memoizedState}function ts(e,t,n){var r=nl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rs(e))is(t,n);else if(null!==(n=Ao(e,t,n,r))){rl(n,e,r,tl()),os(n,t,r)}}function ns(e,t,n){var r=nl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rs(e))is(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,sr(s,a)){var u=t.interleaved;return null===u?(i.next=i,Po(t)):(i.next=u.next,u.next=i),void(t.interleaved=i)}}catch(l){}null!==(n=Ao(e,t,i,r))&&(rl(n,e,r,i=tl()),os(n,t,r))}}function rs(e){var t=e.alternate;return e===ga||null!==t&&t===ga}function is(e,t){ba=ma=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function os(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,mt(e,n)}}var as={readContext:Fo,useCallback:_a,useContext:_a,useEffect:_a,useImperativeHandle:_a,useInsertionEffect:_a,useLayoutEffect:_a,useMemo:_a,useReducer:_a,useRef:_a,useState:_a,useDebugValue:_a,useDeferredValue:_a,useTransition:_a,useMutableSource:_a,useSyncExternalStore:_a,useId:_a,unstable_isNewReconciler:!1},ss={readContext:Fo,useCallback:function(e,t){return Fa().memoizedState=[e,void 0===t?null:t],e},useContext:Fo,useEffect:qa,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ha(4194308,4,Ja.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ha(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ha(4,2,e,t)},useMemo:function(e,t){var n=Fa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ts.bind(null,ga,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Fa().memoizedState=e},useState:Ua,useDebugValue:Ya,useDeferredValue:function(e){return Fa().memoizedState=e},useTransition:function(){var e=Ua(!1),t=e[0];return e=Za.bind(null,e[1]),Fa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ga,i=Fa();if(io){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===Tu)throw Error(o(349));0!==(30&pa)||Ia(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,qa(ja.bind(null,r,a,e),[e]),r.flags|=2048,Ma(9,Oa.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Fa(),t=Tu.identifierPrefix;if(io){var n=Gi;t=":"+t+"R"+(n=($i&~(1<<32-at($i)-1)).toString(32)+n),0<(n=wa++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Sa++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},us={readContext:Fo,useCallback:$a,useContext:Fo,useEffect:Ka,useImperativeHandle:Qa,useInsertionEffect:za,useLayoutEffect:Wa,useMemo:Ga,useReducer:Aa,useRef:Ba,useState:function(){return Aa(Pa)},useDebugValue:Ya,useDeferredValue:function(e){return Xa(Ca(),va.memoizedState,e)},useTransition:function(){return[Aa(Pa)[0],Ca().memoizedState]},useMutableSource:Ra,useSyncExternalStore:Na,useId:es,unstable_isNewReconciler:!1},ls={readContext:Fo,useCallback:$a,useContext:Fo,useEffect:Ka,useImperativeHandle:Qa,useInsertionEffect:za,useLayoutEffect:Wa,useMemo:Ga,useReducer:Ta,useRef:Ba,useState:function(){return Ta(Pa)},useDebugValue:Ya,useDeferredValue:function(e){var t=Ca();return null===va?t.memoizedState=e:Xa(t,va.memoizedState,e)},useTransition:function(){return[Ta(Pa)[0],Ca().memoizedState]},useMutableSource:Ra,useSyncExternalStore:Na,useId:es,unstable_isNewReconciler:!1};function cs(e,t){try{var n="",r=t;do{n+=H(r),r=r.return}while(r);var i=n}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:i,digest:null}}function fs(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ds(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var hs="function"===typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=Oo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){zu||(zu=!0,Wu=r),ds(0,t)},n}function gs(e,t,n){(n=Oo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ds(0,t)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){ds(0,t),"function"!==typeof r&&(null===Ju?Ju=new Set([this]):Ju.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function vs(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hs;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Fl.bind(null,e,t,n),t.then(e,e))}function ys(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ms(e,t,n,r,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Oo(-1,1)).tag=2,jo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var bs=w.ReactCurrentOwner,ws=!1;function Ss(e,t,n,r){t.child=null===e?Xo(t,null,n,r):Go(t,e.child,n,r)}function _s(e,t,n,r,i){n=n.render;var o=t.ref;return ko(t,i),r=xa(e,t,n,r,o,i),n=ka(),null===e||ws?(io&&n&&eo(t),t.flags|=1,Ss(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zs(e,t,i))}function Es(e,t,n,r,i){if(null===e){var o=n.type;return"function"!==typeof o||Il(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=jl(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,xs(e,t,o,r,i))}if(o=e.child,0===(e.lanes&i)){var a=o.memoizedProps;if((n=null!==(n=n.compare)?n:ur)(a,r)&&e.ref===t.ref)return zs(e,t,i)}return t.flags|=1,(e=Ol(o,r)).ref=t.ref,e.return=t,t.child=e}function xs(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(ur(o,r)&&e.ref===t.ref){if(ws=!1,t.pendingProps=r=o,0===(e.lanes&i))return t.lanes=e.lanes,zs(e,t,i);0!==(131072&e.flags)&&(ws=!0)}}return Cs(e,t,n,r,i)}function ks(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Fi(Ou,Iu),Iu|=n;else{if(0===(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Fi(Ou,Iu),Iu|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Fi(Ou,Iu),Iu|=r}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Fi(Ou,Iu),Iu|=r;return Ss(e,t,i,n),t.child}function Fs(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Cs(e,t,n,r,i){var o=Ni(n)?Ti:Pi.current;return o=Ri(t,o),ko(t,i),n=xa(e,t,n,r,o,i),r=ka(),null===e||ws?(io&&r&&eo(t),t.flags|=1,Ss(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zs(e,t,i))}function Ps(e,t,n,r,i){if(Ni(n)){var o=!0;Li(t)}else o=!1;if(ko(t,i),null===t.stateNode)Ks(e,t),Ko(t,n,r),Wo(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,l=n.contextType;"object"===typeof l&&null!==l?l=Fo(l):l=Ri(t,l=Ni(n)?Ti:Pi.current);var c=n.getDerivedStateFromProps,f="function"===typeof c||"function"===typeof a.getSnapshotBeforeUpdate;f||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==l)&&zo(t,a,r,l),Ro=!1;var d=t.memoizedState;a.state=d,Uo(t,r,a,i),u=t.memoizedState,s!==r||d!==u||Ai.current||Ro?("function"===typeof c&&(Ho(t,n,c,r),u=t.memoizedState),(s=Ro||qo(t,n,s,r,d,u,l))?(f||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=l,r=s):("function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Io(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:yo(t.type,s),a.props=l,f=t.pendingProps,d=a.context,"object"===typeof(u=n.contextType)&&null!==u?u=Fo(u):u=Ri(t,u=Ni(n)?Ti:Pi.current);var h=n.getDerivedStateFromProps;(c="function"===typeof h||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==f||d!==u)&&zo(t,a,r,u),Ro=!1,d=t.memoizedState,a.state=d,Uo(t,r,a,i);var p=t.memoizedState;s!==f||d!==p||Ai.current||Ro?("function"===typeof h&&(Ho(t,n,h,r),p=t.memoizedState),(l=Ro||qo(t,n,l,r,d,p,u)||!1)?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,u),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,u)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=u,r=l):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return As(e,t,n,r,o,i)}function As(e,t,n,r,i,o){Fs(e,t);var a=0!==(128&t.flags);if(!r&&!a)return i&&Di(t,n,!1),zs(e,t,o);r=t.stateNode,bs.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Go(t,e.child,null,o),t.child=Go(t,null,s,o)):Ss(e,t,s,o),t.memoizedState=r.state,i&&Di(t,n,!0),t.child}function Ts(e){var t=e.stateNode;t.pendingContext?Oi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Oi(0,t.context,!1),ia(e,t.containerInfo)}function Rs(e,t,n,r,i){return po(),go(i),t.flags|=256,Ss(e,t,n,r),t.child}var Ns,Is,Os,js,Ls={dehydrated:null,treeContext:null,retryLane:0};function Ds(e){return{baseLanes:e,cachePool:null,transitions:null}}function Us(e,t,n){var r,i=t.pendingProps,a=ua.current,s=!1,u=0!==(128&t.flags);if((r=u)||(r=(null===e||null!==e.memoizedState)&&0!==(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Fi(ua,1&a),null===e)return lo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(u=i.children,e=i.fallback,s?(i=t.mode,s=t.child,u={mode:"hidden",children:u},0===(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=u):s=Dl(u,i,0,null),e=Ll(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ds(n),t.memoizedState=Ls,e):Ms(t,u));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,i,a,s){if(n)return 256&t.flags?(t.flags&=-257,Bs(e,t,s,r=fs(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Dl({mode:"visible",children:r.children},i,0,null),(a=Ll(a,i,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!==(1&t.mode)&&Go(t,e.child,null,s),t.child.memoizedState=Ds(s),t.memoizedState=Ls,a);if(0===(1&t.mode))return Bs(e,t,s,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var u=r.dgst;return r=u,Bs(e,t,s,r=fs(a=Error(o(419)),r,void 0))}if(u=0!==(s&e.childLanes),ws||u){if(null!==(r=Tu)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(r.suspendedLanes|s))?0:i)&&i!==a.retryLane&&(a.retryLane=i,To(e,i),rl(r,e,i,-1))}return vl(),Bs(e,t,s,r=fs(Error(o(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Pl.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,ro=li(i.nextSibling),no=t,io=!0,oo=null,null!==e&&(Ji[Qi++]=$i,Ji[Qi++]=Gi,Ji[Qi++]=Yi,$i=e.id,Gi=e.overflow,Yi=t),t=Ms(t,r.children),t.flags|=4096,t)}(e,t,u,i,r,a,n);if(s){s=i.fallback,u=t.mode,r=(a=e.child).sibling;var l={mode:"hidden",children:i.children};return 0===(1&u)&&t.child!==a?((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null):(i=Ol(a,l)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=Ol(r,s):(s=Ll(s,u,n,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,u=null===(u=e.child.memoizedState)?Ds(n):{baseLanes:u.baseLanes|n,cachePool:null,transitions:u.transitions},s.memoizedState=u,s.childLanes=e.childLanes&~n,t.memoizedState=Ls,i}return e=(s=e.child).sibling,i=Ol(s,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ms(e,t){return(t=Dl({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bs(e,t,n,r){return null!==r&&go(r),Go(t,e.child,null,n),(e=Ms(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Hs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),xo(e.return,t,n)}function Vs(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function qs(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Ss(e,t,r.children,n),0!==(2&(r=ua.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Hs(e,n,t);else if(19===e.tag)Hs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Fi(ua,r),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===la(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Vs(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===la(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Vs(t,!0,n,null,o);break;case"together":Vs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ks(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Du|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Ol(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Ol(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ws(e,t){if(!io)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Js(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Qs(e,t,n){var r=t.pendingProps;switch(to(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Js(t),null;case 1:case 17:return Ni(t.type)&&Ii(),Js(t),null;case 3:return r=t.stateNode,oa(),ki(Ai),ki(Pi),fa(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(fo(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==oo&&(sl(oo),oo=null))),Is(e,t),Js(t),null;case 5:sa(t);var i=ra(na.current);if(n=t.type,null!==e&&null!=t.stateNode)Os(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Js(t),null}if(e=ra(ea.current),fo(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[di]=t,r[hi]=a,e=0!==(1&t.mode),n){case"dialog":Mr("cancel",r),Mr("close",r);break;case"iframe":case"object":case"embed":Mr("load",r);break;case"video":case"audio":for(i=0;i <\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[di]=t,e[hi]=r,Ns(e,t,!1,!1),t.stateNode=e;e:{switch(u=be(n,r),n){case"dialog":Mr("cancel",e),Mr("close",e),i=r;break;case"iframe":case"object":case"embed":Mr("load",e),i=r;break;case"video":case"audio":for(i=0;i qu&&(t.flags|=128,r=!0,Ws(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=la(u))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Ws(a,!0),null===a.tail&&"hidden"===a.tailMode&&!u.alternate&&!io)return Js(t),null}else 2*Ge()-a.renderingStartTime>qu&&1073741824!==n&&(t.flags|=128,r=!0,Ws(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=a.last)?n.sibling=u:t.child=u,a.last=u)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ge(),t.sibling=null,n=ua.current,Fi(ua,r?1&n|2:1&n),t):(Js(t),null);case 22:case 23:return dl(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Iu)&&(Js(t),6&t.subtreeFlags&&(t.flags|=8192)):Js(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Ys(e,t){switch(to(t),t.tag){case 1:return Ni(t.type)&&Ii(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return oa(),ki(Ai),ki(Pi),fa(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return sa(t),null;case 13:if(ki(ua),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));po()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ki(ua),null;case 4:return oa(),null;case 10:return Eo(t.type._context),null;case 22:case 23:return dl(),null;default:return null}}Ns=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Is=function(){},Os=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ra(ea.current);var o,a=null;switch(n){case"input":i=Y(e,i),r=Y(e,r),a=[];break;case"select":i=D({},i,{value:void 0}),r=D({},r,{value:void 0}),a=[];break;case"textarea":i=re(e,i),r=re(e,r),a=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=Zr)}for(c in me(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var u=i[c];for(o in u)u.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(s.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in r){var l=r[c];if(u=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&l!==u&&(null!=l||null!=u))if("style"===c)if(u){for(o in u)!u.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&u[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(a||(a=[]),a.push(c,n)),n=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,u=u?u.__html:void 0,null!=l&&u!==l&&(a=a||[]).push(c,l)):"children"===c?"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(s.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&Mr("scroll",e),a||u===l||(a=[])):(a=a||[]).push(c,l))}n&&(a=a||[]).push("style",n);var c=a;(t.updateQueue=c)&&(t.flags|=4)}},js=function(e,t,n,r){n!==r&&(t.flags|=4)};var $s=!1,Gs=!1,Xs="function"===typeof WeakSet?WeakSet:Set,Zs=null;function eu(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){kl(e,t,r)}else n.current=null}function tu(e,t,n){try{n()}catch(r){kl(e,t,r)}}var nu=!1;function ru(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&tu(t,n,o)}i=i.next}while(i!==r)}}function iu(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ou(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function au(e){var t=e.alternate;null!==t&&(e.alternate=null,au(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[di],delete t[hi],delete t[gi],delete t[vi],delete t[yi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function su(e){return 5===e.tag||3===e.tag||4===e.tag}function uu(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||su(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function lu(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Zr));else if(4!==r&&null!==(e=e.child))for(lu(e,t,n),e=e.sibling;null!==e;)lu(e,t,n),e=e.sibling}function cu(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(cu(e,t,n),e=e.sibling;null!==e;)cu(e,t,n),e=e.sibling}var fu=null,du=!1;function hu(e,t,n){for(n=n.child;null!==n;)pu(e,t,n),n=n.sibling}function pu(e,t,n){if(ot&&"function"===typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(it,n)}catch(s){}switch(n.tag){case 5:Gs||eu(n,t);case 6:var r=fu,i=du;fu=null,hu(e,t,n),du=i,null!==(fu=r)&&(du?(e=fu,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):fu.removeChild(n.stateNode));break;case 18:null!==fu&&(du?(e=fu,n=n.stateNode,8===e.nodeType?ui(e.parentNode,n):1===e.nodeType&&ui(e,n),Vt(e)):ui(fu,n.stateNode));break;case 4:r=fu,i=du,fu=n.stateNode.containerInfo,du=!0,hu(e,t,n),fu=r,du=i;break;case 0:case 11:case 14:case 15:if(!Gs&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(0!==(2&o)||0!==(4&o))&&tu(n,t,a),i=i.next}while(i!==r)}hu(e,t,n);break;case 1:if(!Gs&&(eu(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){kl(n,t,s)}hu(e,t,n);break;case 21:hu(e,t,n);break;case 22:1&n.mode?(Gs=(r=Gs)||null!==n.memoizedState,hu(e,t,n),Gs=r):hu(e,t,n);break;default:hu(e,t,n)}}function gu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Xs),t.forEach((function(t){var r=Al.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function vu(e,t){var n=t.deletions;if(null!==n)for(var r=0;r i&&(i=s),r&=~a}if(r=i,10<(r=(120>(r=Ge()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ku(r/1960))-r)){e.timeoutHandle=ri(_l.bind(null,e,Hu,Ku),r);break}_l(e,Hu,Ku);break;default:throw Error(o(329))}}}return il(e,Ge()),e.callbackNode===n?ol.bind(null,e):null}function al(e,t){var n=Bu;return e.current.memoizedState.isDehydrated&&(hl(e,t).flags|=256),2!==(e=yl(e,t))&&(t=Hu,Hu=n,null!==t&&sl(t)),e}function sl(e){null===Hu?Hu=e:Hu.push.apply(Hu,e)}function ul(e,t){for(t&=~Mu,t&=~Uu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0 e?16:e,null===Yu)var r=!1;else{if(e=Yu,Yu=null,$u=0,0!==(6&Au))throw Error(o(331));var i=Au;for(Au|=4,Zs=e.current;null!==Zs;){var a=Zs,s=a.child;if(0!==(16&Zs.flags)){var u=a.deletions;if(null!==u){for(var l=0;l Ge()-Vu?hl(e,0):Mu|=n),il(e,t)}function Cl(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ct,0===(130023424&(ct<<=1))&&(ct=4194304)));var n=tl();null!==(e=To(e,t))&&(yt(e,t,n),il(e,n))}function Pl(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cl(e,n)}function Al(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(t),Cl(e,n)}function Tl(e,t){return Je(e,t)}function Rl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nl(e,t,n,r){return new Rl(e,t,n,r)}function Il(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ol(e,t){var n=e.alternate;return null===n?((n=Nl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function jl(e,t,n,r,i,a){var s=2;if(r=e,"function"===typeof e)Il(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case E:return Ll(n.children,i,a,t);case x:s=8,i|=8;break;case k:return(e=Nl(12,n,t,2|i)).elementType=k,e.lanes=a,e;case A:return(e=Nl(13,n,t,i)).elementType=A,e.lanes=a,e;case T:return(e=Nl(19,n,t,i)).elementType=T,e.lanes=a,e;case I:return Dl(n,i,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case F:s=10;break e;case C:s=9;break e;case P:s=11;break e;case R:s=14;break e;case N:s=16,r=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Nl(s,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function Ll(e,t,n,r){return(e=Nl(7,e,r,t)).lanes=n,e}function Dl(e,t,n,r){return(e=Nl(22,e,r,t)).elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function Ul(e,t,n){return(e=Nl(6,e,null,t)).lanes=n,e}function Ml(e,t,n){return(t=Nl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bl(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vt(0),this.expirationTimes=vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Hl(e,t,n,r,i,o,a,s,u){return e=new Bl(e,t,n,s,u),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Nl(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},No(o),e}function Vl(e){if(!e)return Ci;e:{if(Ve(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ni(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(Ni(n))return ji(e,n,t)}return t}function ql(e,t,n,r,i,o,a,s,u){return(e=Hl(n,r,!0,e,0,o,0,s,u)).context=Vl(null),n=e.current,(o=Oo(r=tl(),i=nl(n))).callback=void 0!==t&&null!==t?t:null,jo(n,o,i),e.current.lanes=i,yt(e,i,r),il(e,r),e}function Kl(e,t,n,r){var i=t.current,o=tl(),a=nl(i);return n=Vl(n),null===t.context?t.context=n:t.pendingContext=n,(t=Oo(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=jo(i,t,a))&&(rl(e,i,a,o),Lo(e,i,a)),a}function zl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Wl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n e.length)&&(t=e.length);for(var n=0,r=new Array(t);n >>1,i=e[r];if(!(0 >>1;ro(u,n))lo(c,u)?(e[r]=c,e[l]=n,r=l):(e[r]=u,e[s]=n,r=s);else{if(!(lo(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var l=[],c=[],f=1,d=null,h=3,p=!1,g=!1,v=!1,y="function"===typeof setTimeout?setTimeout:null,m="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(l,t)}t=r(c)}}function S(e){if(v=!1,w(e),!g)if(null!==r(l))g=!0,I(_);else{var t=r(c);null!==t&&O(S,t.startTime-e)}}function _(e,n){g=!1,v&&(v=!1,m(F),F=-1),p=!0;var o=h;try{for(w(n),d=r(l);null!==d&&(!(d.expirationTime>n)||e&&!A());){var a=d.callback;if("function"===typeof a){d.callback=null,h=d.priorityLevel;var s=a(d.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?d.callback=s:d===r(l)&&i(l),w(n)}else i(l);d=r(l)}if(null!==d)var u=!0;else{var f=r(c);null!==f&&O(S,f.startTime-n),u=!1}return u}finally{d=null,h=o,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,x=!1,k=null,F=-1,C=5,P=-1;function A(){return!(t.unstable_now()-P e||125 a?(e.sortIndex=o,n(c,e),null===r(l)&&e===r(c)&&(v?(m(F),F=-1):v=!0,O(S,o-a))):(e.sortIndex=s,n(l,e),g||p||(g=!0,I(_))),e},t.unstable_shouldYield=A,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},296:function(e,t,n){"use strict";e.exports=n(813)},792:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var i=r(n(426)),o=n(483);t.default=function(e,t){var n={};return e&&"string"===typeof e?((0,i.default)(e,(function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)})),n):n}},483:function(e,t){"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,i=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},u=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||i.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(a,u):e.replace(o,u)).replace(r,s))}},426:function(e,t,n){var r=n(65);function i(e,t){var n,i=null;if(!e||"string"!==typeof e)return i;for(var o,a,s=r(e),u="function"===typeof t,l=0,c=s.length;l e.length)&&(t=e.length);for(var n=0,r=new Array(t);n =e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function f(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function d(e){return function(e){if(Array.isArray(e))return a(e)}(e)||f(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function g(e){var t=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===p(t)?t:String(t)}function v(e,t){for(var n=0;n =0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function O(t,n,r,i){void 0===i&&(i={});var o=i,a=o.window,s=void 0===a?document.defaultView:a,u=o.v5Compat,l=void 0!==u&&u,c=s.history,f=e.Pop,d=null,h=p();function p(){return(c.state||{idx:null}).idx}function g(){f=e.Pop;var t=p(),n=null==t?null:t-h;h=t,d&&d({action:f,location:y.location,delta:n})}function v(e){var t="null"!==s.location.origin?s.location.origin:s.location.href,n="string"===typeof e?e:N(e);return A(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==h&&(h=0,c.replaceState(F({},c.state,{idx:h}),""));var y={get action(){return f},get location(){return t(s,c)},listen:function(e){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(P,g),d=e,function(){s.removeEventListener(P,g),d=null}},createHref:function(e){return n(s,e)},createURL:v,encodeLocation:function(e){var t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){f=e.Push;var i=R(y.location,t,n);r&&r(i,t);var o=T(i,h=p()+1),a=y.createHref(i);try{c.pushState(o,"",a)}catch(u){s.location.assign(a)}l&&d&&d({action:f,location:y.location,delta:1})},replace:function(t,n){f=e.Replace;var i=R(y.location,t,n);r&&r(i,t);var o=T(i,h=p()),a=y.createHref(i);c.replaceState(o,"",a),l&&d&&d({action:f,location:y.location,delta:0})},go:function(e){return c.go(e)}};return y}function j(e,t,n){void 0===n&&(n="/");var r=Y(("string"===typeof t?I(t):t).pathname||"/",n);if(null==r)return null;var i=L(e);!function(e){e.sort((function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var n=e.length===t.length&&e.slice(0,-1).every((function(e,n){return e===t[n]}));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((function(e){return e.childrenIndex})),t.routesMeta.map((function(e){return e.childrenIndex})))}))}(i);for(var o=null,a=0;null==o&&a 0&&(A(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),L(e.children,t,u,s)),(null!=e.path||e.index)&&t.push({path:s,score:z(s,e.index),routesMeta:u})};return e.forEach((function(e,t){var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?")){var r,o=c(D(e.path));try{for(o.s();!(r=o.n()).done;){var a=r.value;i(e,t,a)}}catch(s){o.e(s)}finally{o.f()}}else i(e,t)})),t}function D(e){var t=e.split("/");if(0===t.length)return[];var n,r=o(n=t)||f(n)||s(n)||u(),i=r[0],a=r.slice(1),l=i.endsWith("?"),c=i.replace(/\?$/,"");if(0===a.length)return l?[c,""]:[c];var h=D(a.join("/")),p=[];return p.push.apply(p,d(h.map((function(e){return""===e?c:[c,e].join("/")})))),l&&p.push.apply(p,d(h)),p.map((function(t){return e.startsWith("/")&&""===t?"/":t}))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(C||(C={}));var U=/^:\w+$/,M=3,B=2,H=1,V=10,q=-2,K=function(e){return"*"===e};function z(e,t){var n=e.split("/"),r=n.length;return n.some(K)&&(r+=q),t&&(r+=B),n.filter((function(e){return!K(e)})).reduce((function(e,t){return e+(U.test(t)?M:""===t?H:V)}),r)}function W(e,t){for(var n=e.routesMeta,r={},i="/",o=[],a=0;a and the router will parse it for you.'}function X(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function Z(e,t,n,r){var i;void 0===r&&(r=!1),"string"===typeof e?i=I(e):(A(!(i=F({},e)).pathname||!i.pathname.includes("?"),G("?","pathname","search",i)),A(!i.pathname||!i.pathname.includes("#"),G("#","pathname","hash",i)),A(!i.search||!i.search.includes("#"),G("#","search","hash",i)));var o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(r||null==s)o=n;else{var u=t.length-1;if(s.startsWith("..")){for(var l=s.split("/");".."===l[0];)l.shift(),u-=1;i.pathname=l.join("/")}o=u>=0?t[u]:"/"}var c=function(e,t){void 0===t&&(t="/");var n="string"===typeof e?I(e):e,r=n.pathname,i=n.search,o=void 0===i?"":i,a=n.hash,s=void 0===a?"":a,u=r?r.startsWith("/")?r:function(e,t){var n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(r,t):t;return{pathname:u,search:ne(o),hash:re(s)}}(i,o),f=s&&"/"!==s&&s.endsWith("/"),d=(a||"."===s)&&n.endsWith("/");return c.pathname.endsWith("/")||!f&&!d||(c.pathname+="/"),c}var ee=function(e){return e.join("/").replace(/\/\/+/g,"/")},te=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},ne=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},re=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},ie=function(e){b(n,e);var t=E(n);function n(){return h(this,n),t.apply(this,arguments)}return y(n)}(k(Error));function oe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var ae=["post","put","patch","delete"],se=(new Set(ae),["get"].concat(ae));new Set(se),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!==typeof window&&"undefined"!==typeof window.document&&window.document.createElement;Symbol("deferred");function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t =0||A(!1),i=i.slice(0,Math.min(i.length,a+1))}return i.reduceRight((function(e,a,s){var u=a.route.id?null==o?void 0:o[a.route.id]:null,l=r?a.route.errorElement||t.createElement(ke,null):null,c=n.concat(i.slice(0,s+1)),f=function(){return t.createElement(Ae,{match:a,routeContext:{outlet:e,matches:c}},u?l:void 0!==a.route.element?a.route.element:e)};return r&&(a.route.errorElement||0===s)?t.createElement(Pe,{location:r.location,component:l,error:u,children:f(),routeContext:{outlet:null,matches:c}}):f()}),null)}function Re(e){var n=t.useContext(ve);return n||A(!1),n}function Ne(e){var n=function(e){var n=t.useContext(we);return n||A(!1),n}(),r=n.matches[n.matches.length-1];return r.route.id||A(!1),r.route.id}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"}(Fe||(Fe={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(Ce||(Ce={}));var Ie;function Oe(e){A(!1)}function je(n){var r=n.basename,i=void 0===r?"/":r,o=n.children,a=void 0===o?null:o,s=n.location,u=n.navigationType,l=void 0===u?e.Pop:u,c=n.navigator,f=n.static,d=void 0!==f&&f;_e()&&A(!1);var h=i.replace(/^\/*/,"/"),p=t.useMemo((function(){return{basename:h,navigator:c,static:d}}),[h,c,d]);"string"===typeof s&&(s=I(s));var g=s,v=g.pathname,y=void 0===v?"/":v,m=g.search,b=void 0===m?"":m,w=g.hash,S=void 0===w?"":w,_=g.state,E=void 0===_?null:_,x=g.key,k=void 0===x?"default":x,F=t.useMemo((function(){var e=Y(y,h);return null==e?null:{pathname:e,search:b,hash:S,state:E,key:k}}),[h,y,b,S,E,k]);return null==F?null:t.createElement(me.Provider,{value:p},t.createElement(be.Provider,{children:a,value:{location:F,navigationType:l}}))}function Le(n){var r=n.children,i=n.location,o=t.useContext(ge);return function(n,r){_e()||A(!1);var i,o=t.useContext(me).navigator,a=t.useContext(ve),s=t.useContext(we).matches,u=s[s.length-1],l=u?u.params:{},c=(u&&u.pathname,u?u.pathnameBase:"/"),f=(u&&u.route,Ee());if(r){var d,h="string"===typeof r?I(r):r;"/"===c||(null==(d=h.pathname)?void 0:d.startsWith(c))||A(!1),i=h}else i=f;var p=i.pathname||"/",g=j(n,{pathname:"/"===c?p:p.slice(c.length)||"/"}),v=Te(g&&g.map((function(e){return Object.assign({},e,{params:Object.assign({},l,e.params),pathname:ee([c,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:ee([c,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})})),s,a||void 0);return r&&v?t.createElement(be.Provider,{value:{location:ue({pathname:"/",search:"",hash:"",state:null,key:"default"},i),navigationType:e.Pop}},v):v}(o&&!r?o.router.routes:Ue(r),i)}!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(Ie||(Ie={}));var De=new Promise((function(){}));t.Component;function Ue(e,n){void 0===n&&(n=[]);var r=[];return t.Children.forEach(e,(function(e,i){if(t.isValidElement(e))if(e.type!==t.Fragment){e.type!==Oe&&A(!1),e.props.index&&e.props.children&&A(!1);var o=[].concat(d(n),[i]),a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(a.children=Ue(e.props.children,o)),r.push(a)}else r.push.apply(r,Ue(e.props.children,n))})),r}function Me(e){return void 0===e&&(e=""),new URLSearchParams("string"===typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((function(t,n){var r=e[n];return t.concat(Array.isArray(r)?r.map((function(e){return[n,e]})):[[n,r]])}),[]))}function Be(e){var n,r=e.basename,i=e.children,o=e.window,a=t.useRef();null==a.current&&(a.current=(void 0===(n={window:o,v5Compat:!0})&&(n={}),O((function(e,t){var n=e.location;return R("",{pathname:n.pathname,search:n.search,hash:n.hash},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:N(t)}),null,n)));var s=a.current,u=l(t.useState({action:s.action,location:s.location}),2),c=u[0],f=u[1];return t.useLayoutEffect((function(){return s.listen(f)}),[s]),t.createElement(je,{basename:r,children:i,location:c.location,navigationType:c.action,navigator:s})}"undefined"!==typeof window&&"undefined"!==typeof window.document&&window.document.createElement;var He,Ve;function qe(e){var n=t.useRef(Me(e)),r=t.useRef(!1),i=Ee(),o=t.useMemo((function(){return function(e,t){var n=Me(e);if(t){var r,i=c(t.keys());try{var o=function(){var e=r.value;n.has(e)||t.getAll(e).forEach((function(t){n.append(e,t)}))};for(i.s();!(r=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}return n}(i.search,r.current?null:n.current)}),[i.search]),a=xe(),s=t.useCallback((function(e,t){var n=Me("function"===typeof e?e(o):e);r.current=!0,a("?"+n,t)}),[a,o]);return[o,s]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(He||(He={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ve||(Ve={}));function Ke(){Ke=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(A){u=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new F(i||[]);return r(a,"_invoke",{value:_(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=l;var f={};function d(){}function h(){}function g(){}var v={};u(v,o,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(C([])));m&&m!==t&&n.call(m,o)&&(v=m);var b=g.prototype=d.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function i(r,o,a,s){var u=c(e[r],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==p(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return i("throw",e,a,s)}))}s(u.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function ze(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Je(e){for(var t=1;t =0&&e!==1/0}function Ze(e,t){return Math.max(e+(t||0)-Date.now(),0)}function et(e,t,n){return ht(e)?"function"===typeof t?Je(Je({},n),{},{queryKey:e,queryFn:t}):Je(Je({},t),{},{queryKey:e}):e}function tt(e,t,n){return ht(e)?[Je(Je({},t),{},{queryKey:e}),n]:[e||{},t]}function nt(e,t){var n=e.type,r=void 0===n?"all":n,i=e.exact,o=e.fetchStatus,a=e.predicate,s=e.queryKey,u=e.stale;if(ht(s))if(i){if(t.queryHash!==it(s,t.options))return!1}else if(!at(t.queryKey,s))return!1;if("all"!==r){var l=t.isActive();if("active"===r&&!l)return!1;if("inactive"===r&&l)return!1}return("boolean"!==typeof u||t.isStale()===u)&&(("undefined"===typeof o||o===t.state.fetchStatus)&&!(a&&!a(t)))}function rt(e,t){var n=e.exact,r=e.fetching,i=e.predicate,o=e.mutationKey;if(ht(o)){if(!t.options.mutationKey)return!1;if(n){if(ot(t.options.mutationKey)!==ot(o))return!1}else if(!at(t.options.mutationKey,o))return!1}return("boolean"!==typeof r||"loading"===t.state.status===r)&&!(i&&!i(t))}function it(e,t){return((null==t?void 0:t.queryKeyHashFn)||ot)(e)}function ot(e){return JSON.stringify(e,(function(e,t){return ft(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}))}function at(e,t){return st(e,t)}function st(e,t){return e===t||typeof e===typeof t&&(!(!e||!t||"object"!==typeof e||"object"!==typeof t)&&!Object.keys(t).some((function(n){return!st(e[n],t[n])})))}function ut(e,t){if(e===t)return e;var n=ct(e)&&ct(t);if(n||ft(e)&&ft(t)){for(var r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{},s=0,u=0;u =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var mt=function(){var e=[],t=0,n=function(e){e()},r=function(e){e()},i=function(r){t?e.push(r):gt((function(){n(r)}))},o=function(){var t=e;e=[],t.length&>((function(){r((function(){t.forEach((function(e){n(e)}))}))}))};return{batch:function(e){var n;t++;try{n=e()}finally{--t||o()}return n},batchCalls:function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r 0}},{key:"onSubscribe",value:function(){}},{key:"onUnsubscribe",value:function(){}}]),e}(),wt=new(function(e){b(n,e);var t=E(n);function n(){var e;return h(this,n),(e=t.call(this)).setup=function(e){if(!$e&&window.addEventListener){var t=function(){return e()};return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),function(){window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}},e}return y(n,[{key:"onSubscribe",value:function(){this.cleanup||this.setEventListener(this.setup)}},{key:"onUnsubscribe",value:function(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}},{key:"setEventListener",value:function(e){var t,n=this;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((function(e){"boolean"===typeof e?n.setFocused(e):n.onFocus()}))}},{key:"setFocused",value:function(e){this.focused=e,e&&this.onFocus()}},{key:"onFocus",value:function(){this.listeners.forEach((function(e){e()}))}},{key:"isFocused",value:function(){return"boolean"===typeof this.focused?this.focused:"undefined"===typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}}]),n}(bt)),St=new(function(e){b(n,e);var t=E(n);function n(){var e;return h(this,n),(e=t.call(this)).setup=function(e){if(!$e&&window.addEventListener){var t=function(){return e()};return window.addEventListener("online",t,!1),window.addEventListener("offline",t,!1),function(){window.removeEventListener("online",t),window.removeEventListener("offline",t)}}},e}return y(n,[{key:"onSubscribe",value:function(){this.cleanup||this.setEventListener(this.setup)}},{key:"onUnsubscribe",value:function(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}},{key:"setEventListener",value:function(e){var t,n=this;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((function(e){"boolean"===typeof e?n.setOnline(e):n.onOnline()}))}},{key:"setOnline",value:function(e){this.online=e,e&&this.onOnline()}},{key:"onOnline",value:function(){this.listeners.forEach((function(e){e()}))}},{key:"isOnline",value:function(){return"boolean"===typeof this.online?this.online:"undefined"===typeof navigator||"undefined"===typeof navigator.onLine||navigator.onLine}}]),n}(bt));function _t(e){return Math.min(1e3*Math.pow(2,e),3e4)}function Et(e){return"online"!==(null!=e?e:"online")||St.isOnline()}var xt=y((function e(t){h(this,e),this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}));function kt(e){return e instanceof xt}function Ft(e){var t,n,r,i=!1,o=0,a=!1,s=new Promise((function(e,t){n=e,r=t})),u=function(){return!wt.isFocused()||"always"!==e.networkMode&&!St.isOnline()},l=function(r){a||(a=!0,null==e.onSuccess||e.onSuccess(r),null==t||t(),n(r))},c=function(n){a||(a=!0,null==e.onError||e.onError(n),null==t||t(),r(n))},f=function(){return new Promise((function(n){t=function(e){var t=a||!u();return t&&n(e),t},null==e.onPause||e.onPause()})).then((function(){t=void 0,a||null==e.onContinue||e.onContinue()}))},d=function t(){if(!a){var n;try{n=e.fn()}catch(r){n=Promise.reject(r)}Promise.resolve(n).then(l).catch((function(n){var r,s;if(!a){var l=null!=(r=e.retry)?r:3,d=null!=(s=e.retryDelay)?s:_t,h="function"===typeof d?d(o,n):d,p=!0===l||"number"===typeof l&&o 0&&void 0!==arguments[0]?arguments[0]:{},t=e.refetchPage,n=yt(e,Ct);return this.fetch(Je(Je({},n),{},{meta:{refetchPage:t}}))}},{key:"fetchOptimistic",value:function(e){var t=this,n=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then((function(){return t.createResult(r,n)}))}},{key:"fetch",value:function(e){var t,n=this;return this.executeFetch(Je(Je({},e),{},{cancelRefetch:null==(t=e.cancelRefetch)||t})).then((function(){return n.updateResult(),n.currentResult}))}},{key:"executeFetch",value:function(e){this.updateQuery();var t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(Ge)),t}},{key:"updateStaleTimeout",value:function(){var e=this;if(this.clearStaleTimeout(),!$e&&!this.currentResult.isStale&&Xe(this.options.staleTime)){var t=Ze(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout((function(){e.currentResult.isStale||e.updateResult()}),t)}}},{key:"computeRefetchInterval",value:function(){var e;return"function"===typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}},{key:"updateRefetchInterval",value:function(e){var t=this;this.clearRefetchInterval(),this.currentRefetchInterval=e,!$e&&!1!==this.options.enabled&&Xe(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval((function(){(t.options.refetchIntervalInBackground||wt.isFocused())&&t.executeFetch()}),this.currentRefetchInterval))}},{key:"updateTimers",value:function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}},{key:"clearStaleTimeout",value:function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}},{key:"clearRefetchInterval",value:function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}},{key:"createResult",value:function(e,t){var n,r=this.currentQuery,i=this.options,o=this.currentResult,a=this.currentResultState,s=this.currentResultOptions,u=e!==r,l=u?e.state:this.currentQueryInitialState,c=u?this.currentResult:this.previousQueryResult,f=e.state,d=f.dataUpdatedAt,h=f.error,p=f.errorUpdatedAt,g=f.fetchStatus,v=f.status,y=!1,m=!1;if(t._optimisticResults){var b=this.hasListeners(),w=!b&&At(e,t),S=b&&Rt(e,r,t,i);(w||S)&&(g=Et(e.options.networkMode)?"fetching":"paused",d||(v="loading")),"isRestoring"===t._optimisticResults&&(g="idle")}if(t.keepPreviousData&&!f.dataUpdatedAt&&null!=c&&c.isSuccess&&"error"!==v)n=c.data,d=c.dataUpdatedAt,v=c.status,y=!0;else if(t.select&&"undefined"!==typeof f.data)if(o&&f.data===(null==a?void 0:a.data)&&t.select===this.selectFn)n=this.selectResult;else try{this.selectFn=t.select,n=t.select(f.data),n=vt(null==o?void 0:o.data,n,t),this.selectResult=n,this.selectError=null}catch(F){0,this.selectError=F}else n=f.data;if("undefined"!==typeof t.placeholderData&&"undefined"===typeof n&&"loading"===v){var _;if(null!=o&&o.isPlaceholderData&&t.placeholderData===(null==s?void 0:s.placeholderData))_=o.data;else if(_="function"===typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&"undefined"!==typeof _)try{_=t.select(_),this.selectError=null}catch(F){0,this.selectError=F}"undefined"!==typeof _&&(v="success",n=vt(null==o?void 0:o.data,_,t),m=!0)}this.selectError&&(h=this.selectError,n=this.selectResult,p=Date.now(),v="error");var E="fetching"===g,x="loading"===v,k="error"===v;return{status:v,fetchStatus:g,isLoading:x,isSuccess:"success"===v,isError:k,isInitialLoading:x&&E,data:n,dataUpdatedAt:d,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:E,isRefetching:E&&!x,isLoadingError:k&&0===f.dataUpdatedAt,isPaused:"paused"===g,isPlaceholderData:m,isPreviousData:y,isRefetchError:k&&0!==f.dataUpdatedAt,isStale:Nt(e,t),refetch:this.refetch,remove:this.remove}}},{key:"updateResult",value:function(e){var t=this,n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!lt(r,n)){this.currentResult=r;var i={cache:!0};!1!==(null==e?void 0:e.listeners)&&function(){if(!n)return!0;var e=t.options.notifyOnChangeProps;if("all"===e||!e&&!t.trackedProps.size)return!0;var r=new Set(null!=e?e:t.trackedProps);return t.options.useErrorBoundary&&r.add("error"),Object.keys(t.currentResult).some((function(e){var i=e;return t.currentResult[i]!==n[i]&&r.has(i)}))}()&&(i.listeners=!0),this.notify(Je(Je({},i),e))}}},{key:"updateQuery",value:function(){var e=this.client.getQueryCache().build(this.client,this.options);if(e!==this.currentQuery){var t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}}},{key:"onQueryUpdate",value:function(e){var t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||kt(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}},{key:"notify",value:function(e){var t=this;mt.batch((function(){var n,r,i,o;if(e.onSuccess)null==(n=(r=t.options).onSuccess)||n.call(r,t.currentResult.data),null==(i=(o=t.options).onSettled)||i.call(o,t.currentResult.data,null);else if(e.onError){var a,s,u,l;null==(a=(s=t.options).onError)||a.call(s,t.currentResult.error),null==(u=(l=t.options).onSettled)||u.call(l,void 0,t.currentResult.error)}e.listeners&&t.listeners.forEach((function(e){e(t.currentResult)})),e.cache&&t.client.getQueryCache().notify({query:t.currentQuery,type:"observerResultsUpdated"})}))}}]),n}(bt);function At(e,t){return function(e,t){return!1!==t.enabled&&!e.state.dataUpdatedAt&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||e.state.dataUpdatedAt>0&&Tt(e,t,t.refetchOnMount)}function Tt(e,t,n){if(!1!==t.enabled){var r="function"===typeof n?n(e):n;return"always"===r||!1!==r&&Nt(e,t)}return!1}function Rt(e,t,n,r){return!1!==n.enabled&&(e!==t||!1===r.enabled)&&(!n.suspense||"error"!==e.state.status)&&Nt(e,n)}function Nt(e,t){return e.isStaleByTime(t.staleTime)}var It=n(248).useSyncExternalStore;function Ot(){var e=!1;return{clearReset:function(){e=!1},reset:function(){e=!0},isReset:function(){return e}}}var jt=t.createContext(Ot()),Lt=function(){return t.useContext(jt)},Dt=t.createContext(void 0),Ut=t.createContext(!1);function Mt(e,t){return e||(t&&"undefined"!==typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Dt),window.ReactQueryClientContext):Dt)}var Bt=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).context,n=t.useContext(Mt(e,t.useContext(Ut)));if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},Ht=function(e){var n=e.client,r=e.children,i=e.context,o=e.contextSharing,a=void 0!==o&&o;t.useEffect((function(){return n.mount(),function(){n.unmount()}}),[n]);var s=Mt(i,a);return t.createElement(Ut.Provider,{value:!i&&a},t.createElement(s.Provider,{value:n},r))},Vt=t.createContext(!1),qt=function(){return t.useContext(Vt)};Vt.Provider;function Kt(e,t){return"function"===typeof e?e.apply(void 0,d(t)):!!e}var zt,Wt,Jt,Qt,Yt,$t,Gt,Xt,Zt=function(e,t){(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},en=function(e){t.useEffect((function(){e.clearReset()}),[e])},tn=function(e){var t=e.result,n=e.errorResetBoundary,r=e.useErrorBoundary,i=e.query;return t.isError&&!n.isReset()&&!t.isFetching&&Kt(r,[t.error,i])},nn=function(e){e.suspense&&"number"!==typeof e.staleTime&&(e.staleTime=1e3)},rn=function(e,t,n){return(null==e?void 0:e.suspense)&&function(e,t){return e.isLoading&&e.isFetching&&!t}(t,n)},on=function(e,t,n){return t.fetchOptimistic(e).then((function(t){var n=t.data;null==e.onSuccess||e.onSuccess(n),null==e.onSettled||e.onSettled(n,null)})).catch((function(t){n.clearReset(),null==e.onError||e.onError(t),null==e.onSettled||e.onSettled(void 0,t)}))};function an(e,n,r){return function(e,n){var r=Bt({context:e.context}),i=qt(),o=Lt(),a=r.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",a.onError&&(a.onError=mt.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=mt.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=mt.batchCalls(a.onSettled)),nn(a),Zt(a,o),en(o);var s=l(t.useState((function(){return new n(r,a)})),1)[0],u=s.getOptimisticResult(a);if(It(t.useCallback((function(e){return i?function(){}:s.subscribe(mt.batchCalls(e))}),[s,i]),(function(){return s.getCurrentResult()}),(function(){return s.getCurrentResult()})),t.useEffect((function(){s.setOptions(a,{listeners:!1})}),[a,s]),rn(a,u,i))throw on(a,s,o);if(tn({result:u,errorResetBoundary:o,useErrorBoundary:a.useErrorBoundary,query:s.getCurrentQuery()}))throw u.error;return a.notifyOnChangeProps?u:s.trackResult(u)}(et(e,n,r),Pt)}function sn(e,t,n,r){return Ye(Ke().mark((function i(){var o,a,s;return Ke().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,fetch(e,Je(Je({method:"POST"},t),{},{body:JSON.stringify({query:n,variables:r})}));case 2:return o=i.sent,i.next=5,o.json();case 5:if(!(a=i.sent).errors){i.next=9;break}throw s=a.errors[0].message,new Error(s);case 9:return i.abrupt("return",a.data);case 10:case"end":return i.stop()}}),i)})))}!function(e){e.Day="DAY",e.Hour="HOUR",e.Minute="MINUTE"}(zt||(zt={})),function(e){e.Default="DEFAULT"}(Wt||(Wt={})),function(e){e.All="ALL",e.Neutral="NEUTRAL",e.En="en",e.Sv="sv"}(Jt||(Jt={})),function(e){e.Asc="ASC",e.Desc="DESC"}(Qt||(Qt={})),function(e){e.Count="COUNT",e.Value="VALUE"}(Yt||(Yt={})),function(e){e.BoostOnly="BOOST_ONLY",e.Doc="DOC",e.Relevance="RELEVANCE",e.Semantic="SEMANTIC"}($t||($t={})),function(e){e.One="ONE",e.Two="TWO"}(Gt||(Gt={})),function(e){e.All="ALL",e.Neutral="NEUTRAL"}(Xt||(Xt={}));var un="\n fragment ItemsInContentArea on IContent {\n __typename\n ... on ContentBlock {\n ...ContentBlock\n }\n ... on ImageFile {\n ...ImageFile\n }\n}\n ".concat("\n fragment ContentBlock on ContentBlock {\n Title\n Image\n ImageAlignment\n Content\n}\n ","\n").concat("\n fragment ImageFile on ImageFile {\n Thumbnail {\n Url\n }\n Content\n Url\n}\n "),ln="\n fragment LandingPage on LandingPage {\n Title\n Subtitle\n BuyTicketBlock {\n ...LandingPageBlockData\n }\n HeroImage\n ArtistsLink {\n Expanded {\n Name\n RelativePath\n }\n }\n MainContentArea {\n ContentLink {\n Expanded {\n ...ItemsInContentArea\n }\n }\n }\n FooterContentArea {\n ContentLink {\n Expanded {\n ...ItemsInContentArea\n }\n }\n }\n}\n ".concat("\n fragment LandingPageBlockData on LandingPageBlockData {\n Heading\n Message\n}\n ","\n").concat(un),cn=function(e,t,n){return an(["ArtistAutocomplete",t],sn(e.endpoint,e.fetchParams||{},"\n query ArtistAutocomplete($searchParam: String!) {\n ArtistDetailsPage {\n autocomplete {\n StageName(value: $searchParam)\n ArtistName(value: $searchParam, limit: 3)\n }\n }\n}\n ",t),n)},fn=function(e,t,n){return an(["ArtistSearch",t],sn(e.endpoint,e.fetchParams||{},"\n query ArtistSearch($searchParam: String!, $locales: Locales!, $order: OrderBy) {\n ArtistDetailsPage(\n locale: [$locales]\n orderBy: {_ranking: RELEVANCE, ArtistName: $order}\n where: {_or: [{Name: {contains: $searchParam, boost: 10}}, {Name: {startsWith: $searchParam, boost: 10}}, {StageName: {startsWith: $searchParam}}]}\n ) {\n items {\n PerformanceStartTime\n PerformanceEndTime\n StageName\n ArtistName\n ArtistPhoto\n ArtistGenre\n ArtistDescription\n ArtistIsHeadliner\n RelativePath\n ParentLink {\n Url\n }\n _fulltext\n }\n facets {\n ArtistName(orderBy: ASC, orderType: VALUE, limit: 100) {\n name\n count\n }\n StageName(orderBy: ASC, orderType: VALUE, limit: 100) {\n name\n count\n }\n }\n }\n}\n ",t),n)},dn=function(e,t,n){return an(["OtherContentSearch",t],sn(e.endpoint,e.fetchParams||{},'\n query OtherContentSearch($searchParam: String!, $locales: Locales!, $order: OrderBy) {\n Content(\n locale: [$locales]\n orderBy: {_ranking: RELEVANCE, Name: $order}\n where: {_or: [{Name: {contains: $searchParam, boost: 10}}, {Name: {startsWith: $searchParam, boost: 10}}], _and: {ContentType: {notEq: "ArtistDetailsPage"}}}\n ) {\n items {\n Name\n RelativePath\n ParentLink {\n Url\n }\n _fulltext\n ContentType\n }\n facets {\n Name(orderBy: ASC, orderType: VALUE, limit: 100) {\n name\n count\n }\n }\n }\n}\n ',t),n)},hn='\n query Start($relativePath: String, $locales: Locales!, $language: String, $stageName: String, $artistGenre: String, $contentId: Int, $workId: Int, $statusEqual: String, $isCommonDraft: Boolean) {\n Content(\n locale: [$locales]\n where: {ContentLink: {WorkId: {eq: $workId}, Id: {eq: $contentId}}, RelativePath: {eq: $relativePath}, Language: {Name: {eq: $language}}, Status: {eq: $statusEqual}, IsCommonDraft: {eq: $isCommonDraft}}\n orderBy: {Saved: DESC}\n limit: 1\n ) {\n items {\n Name\n ParentLink {\n Url\n }\n Url\n __typename\n RelativePath\n ... on LandingPage {\n ...LandingPage\n _children {\n ArtistContainerPage {\n items {\n Name\n RelativePath\n headlines: _children {\n ArtistDetailsPage(\n where: {ArtistIsHeadliner: {eq: true}}\n orderBy: {PerformanceStartTime: ASC, Name: ASC}\n ) {\n items {\n ...ArtistDetailsPage\n }\n }\n }\n }\n }\n }\n }\n ... on ArtistContainerPage {\n Name\n RelativePath\n artists: _children {\n ArtistDetailsPage(\n where: {StageName: {eq: $stageName}, ArtistGenre: {eq: $artistGenre}, Status: {eq: "Published"}}\n orderBy: {Name: ASC, ArtistIsHeadliner: ASC, PerformanceStartTime: ASC, StageName: ASC}\n limit: 100\n ) {\n items {\n ...ArtistDetailsPage\n }\n facets {\n ArtistGenre(orderType: VALUE, orderBy: ASC, limit: 10) {\n name\n count\n }\n StageName(orderType: VALUE, orderBy: ASC, limit: 10) {\n name\n count\n }\n }\n }\n }\n }\n ... on ArtistDetailsPage {\n ...ArtistDetailsPage\n }\n ... on ContentBlock {\n Title\n Image\n ImageAlignment\n Content\n }\n }\n }\n}\n '.concat(ln,"\n").concat("\n fragment ArtistDetailsPage on ArtistDetailsPage {\n PerformanceStartTime\n PerformanceEndTime\n StageName\n ArtistName\n ArtistPhoto\n ArtistGenre\n ArtistDescription\n ArtistIsHeadliner\n Name\n RelativePath\n ContentArea {\n ContentLink {\n GuidValue\n }\n }\n ParentLink {\n Url\n }\n}\n "),pn=n(685),gn=new(function(){function e(){h(this,e);var t={userStore:new pn.WebStorageStateStore({store:window.localStorage}),authority:"".concat("http://localhost:8082"),client_id:"".concat("frontend"),redirect_uri:"".concat(window.location.origin,"/login-callback"),automaticSilentRenew:!0,silent_redirect_uri:"".concat(window.location.origin,"/login-renewal"),response_type:"code",scope:"openid profile offline_access email roles",post_logout_redirect_uri:window.location.origin,filterProtocolClaims:!0,loadUserInfo:!0};this.userManager=new pn.UserManager(t)}return y(e,[{key:"getUser",value:function(){return this.userManager.getUser()}},{key:"login",value:function(){var e={state:window.location.href};return this.userManager.signinRedirect(e)}},{key:"logout",value:function(){return this.userManager.signoutRedirect()}},{key:"getAccessToken",value:function(){return this.userManager.getUser().then((function(e){return e?e.access_token:null}))}},{key:"refreshAccessToken",value:function(){return this.userManager.signinSilent().then((function(e){return e?e.access_token:null}))}}]),e}()),vn=n(184);var yn=function(){return(0,vn.jsx)("button",{className:"btn",onClick:function(){gn.login()},children:"Login"})};var mn=function(e){var t=e.username;return(0,vn.jsxs)("button",{className:"btn",onClick:function(){var e=window.sessionStorage;gn.logout(),e.removeItem("form_access_token")},children:[t,", Logout"]})};var bn=function(){var e=l((0,t.useState)(!1),2),n=e[0],r=e[1],i=l((0,t.useState)(""),2),o=i[0],a=i[1];return(0,t.useEffect)((function(){var e=window.sessionStorage;gn.getUser().then((function(t){t&&t.expired&&gn.refreshAccessToken().then((function(n){gn.getUser().then((function(n){t=n,e.form_access_token=null===n||void 0===n?void 0:n.access_token}))})),t&&!t.expired&&(r(!0),a(t.profile.name||""),e.form_access_token=t.access_token)}))}),[]),(0,vn.jsx)("nav",{className:"Page-container LoginBar",children:n?(0,vn.jsx)(mn,{username:o}):(0,vn.jsx)(yn,{})})},wn=n(778),Sn=function(){var e=window.location.search.split(/[&?]+/);return e.includes("epieditmode=true")||e.includes("epieditmode=false")},_n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?e.startsWith("http")?e:"http://localhost:8082"+e:""},En=function(e,t){var n={};if(e){var r=e.split(".")[1];n=JSON.parse(wn.lW.from(r,"base64").toString())}var i=t.length>1&&"/search"!=t?t:"/en",o="/EPiServer/CMS/Content/";i.startsWith(o)&&(i=i.substring(o.length-1)),i.endsWith("/")&&(i=i.slice(0,-1)),i.includes(",")&&(i=i.substring(0,i.indexOf(","))),i.endsWith("/")&&(i=i.slice(0,-1));var a=i.split("/"),s=a.length?a.find((function(e){return 2===e.length})):"en";return{relativePath:i,locales:s,language:s,contentId:n.c_id&&parseInt(n.c_id.toString()),workId:n.c_ver&&parseInt(n.c_ver.toString())}},xn=function(e){for(var t=0,n=Object.entries($t);t 4&&void 0!==arguments[4]?arguments[4]:$t.Relevance,o=En(e,t).locales,a={locales:o,searchParam:n,order:r,ranking:i};return Sn()&&e&&(a={locales:o,searchParam:n,sortOption:r,ranking:i}),a},Cn=function(e,t,n,r){if(void 0!==r.properties.find((function(e){return!Tn(e.value)})))e.invalidateQueries(["ArtistSearch",n]);else{var i=function(e,t){var n,r,i,o,a;if(null===(n=e.ArtistDetailsPage)||void 0===n||!n.items||null===(r=e.ArtistDetailsPage)||void 0===r||!r.items||0===(null===(i=e.ArtistDetailsPage)||void 0===i||null===(o=i.items)||void 0===o?void 0:o.length))return;var s=null===(a=e.ArtistDetailsPage)||void 0===a?void 0:a.items[0];return t.properties.forEach((function(e){return An(s,e.name,e.value)})),e}(Je({},t),r);e.setQueryData(["ArtistSearch",n],i)}};var Pn=function(e,t,n,r){if(void 0!==r.properties.find((function(e){return!Tn(e.value)})))e.invalidateQueries(["Start",n]);else{var i=function(e,t){var n,r,i;if(!e.Content||!e.Content.items||0===(null===(n=e.Content)||void 0===n||null===(r=n.items)||void 0===r?void 0:r.length))return;var o=null===(i=e.Content)||void 0===i?void 0:i.items[0];return t.properties.forEach((function(e){return An(o,e.name,e.value)})),e}(Je({},t),r);e.setQueryData(["Start",n],i)}};function An(e,t,n){t=t.toLowerCase();["icontent_","ichangetrackable_","iversionable_","iroutable_"].forEach((function(e){t=t.startsWith(e)?t.substring(e.length):t}));var r=Object.keys(e).find((function(e){return e.toLowerCase()===t}));r&&(e[r]=n)}function Tn(e){return!Array.isArray(e)&&"object"!==typeof e}var Rn=function(e){var n,r,i,o,a,s,u,c,f=e.filterValue,d=(0,t.useRef)(!0),h="Artist",p=l(qe(),1)[0],g=l((0,t.useState)(""),2),v=(g[0],g[1],l((0,t.useState)(!1),2)),y=v[0],m=v[1],b=l((0,t.useState)(null!==(n=null===(r=p.get("q"))||void 0===r?void 0:r.toString())&&void 0!==n?n:""),2),w=b[0],S=b[1],_=l((0,t.useState)(xn(p)),2),E=_[0],x=_[1],k=l((0,t.useState)("ASC"),1)[0],F=Sn(),C=kn(window.location.search),P=Fn(C,window.location.pathname,w,k,E),A=cn({endpoint:"https://dev.cg.optimizely.com/content/v2?auth=egRs3WaFcc11H0R10NfjO1L4nqiFgStRRtuPmgfEklERSe3T"},P,{staleTime:2e3,enabled:!F||!!C}).data,T=function(e){window.location.href="".concat(window.location.origin,"/search?q=").concat(w,"&f=").concat(null!==f&&void 0!==f?f:h,"&r=").concat(E)},R=function(e){S(e.target.textContent),window.location.href="".concat(window.location.origin,"/search?q=").concat(e.target.textContent,"&f=").concat(null!==f&&void 0!==f?f:h,"&r=").concat(E)};return(0,t.useEffect)((function(){d.current?d.current=!1:w&&(window.location.href="".concat(window.location.origin,"/search?q=").concat(w,"&f=").concat(null!==f&&void 0!==f?f:h,"&r=").concat(E))}),[E]),(0,vn.jsxs)("div",{className:"d-flex Grid--alignMiddle",children:[(0,vn.jsxs)("div",{className:"nav-table-cell autocomplete me-3",children:[(0,vn.jsx)("input",{className:"search-input",type:"text",id:"search-input",placeholder:"Search",onKeyUp:function(e){"Enter"!==e.key&&13!==e.keyCode||T()},value:w,onChange:function(e){S(e.target.value),void 0!==e.target.value?m(!0):m(!1)},onFocus:function(){return m(!0)},onBlur:function(){return setTimeout((function(){m(!1)}),150)}}),(0,vn.jsx)("a",{className:"search-icon",onClick:T,children:(0,vn.jsx)("i",{className:"fa fa-search"})}),(0,vn.jsxs)("div",{className:"autocomplete-block",style:y?{display:"inherit"}:{display:"none"},children:[null===A||void 0===A||null===(i=A.ArtistDetailsPage)||void 0===i||null===(o=i.autocomplete)||void 0===o||null===(a=o.ArtistName)||void 0===a?void 0:a.map((function(e,t){return(0,vn.jsx)("div",{onClick:R,children:e},t)})),null===A||void 0===A||null===(s=A.ArtistDetailsPage)||void 0===s||null===(u=s.autocomplete)||void 0===u||null===(c=u.StageName)||void 0===c?void 0:c.map((function(e,t){return(0,vn.jsx)("div",{onClick:R,children:e},t)}))]})]}),(0,vn.jsx)("div",{children:(0,vn.jsxs)("div",{className:"switch_box",children:[(0,vn.jsx)("input",{type:"checkbox",className:"switch_input",onChange:function(e){e.target.checked?x($t.Semantic):x($t.Relevance)},checked:E===$t.Semantic}),(0,vn.jsx)("label",{className:"fw-semibold mb-0 ms-2",children:"Semantic Search"})]})})]})};var Nn=function(e){var t=e.content;return(0,vn.jsxs)("div",{className:"buyTickets-container",children:[(0,vn.jsx)("h3",{children:t.Heading}),(0,vn.jsx)("div",{children:(0,vn.jsxs)("label",{htmlFor:"tickets-email",children:[t.Message,(0,vn.jsx)("input",{id:"tickets-email",type:"email"})]})})]})},In=n(854),On=(In.domToReact,In.htmlToDOM,In.attributesToProps,In.Comment,In.Element,In.ProcessingInstruction,In.Text,In);var jn=function(e){var t=e.content;return(0,vn.jsx)("div",{className:"Grid-cell",children:(0,vn.jsx)("div",{className:"Page-container ContentBlock",children:(0,vn.jsx)("div",{className:"Grid Grid--alignMiddle Grid--gutterA",children:function(){var e,n;return"Right"===(null===t||void 0===t?void 0:t.ImageAlignment)?(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsxs)("div",{className:"Grid-cell u-md-size1of2",children:[(0,vn.jsx)("h2",{"data-epi-edit":"Title",children:null===t||void 0===t?void 0:t.Title}),(0,vn.jsx)("div",{"data-epi-edit":"Content",children:On(null!==(n=null===t||void 0===t?void 0:t.Content)&&void 0!==n?n:"")})]}),(0,vn.jsx)("div",{className:"Grid-cell u-md-size1of2",children:(0,vn.jsx)("img",{className:"ConditionalImage","data-epi-edit":"Image",src:_n(null===t||void 0===t?void 0:t.Image),alt:null===t||void 0===t?void 0:t.Title})})]}):(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("div",{className:"Grid-cell u-md-size1of2",children:(0,vn.jsx)("img",{className:"ConditionalImage","data-epi-edit":"Image",src:_n(null===t||void 0===t?void 0:t.Image),alt:null===t||void 0===t?void 0:t.Title})}),(0,vn.jsxs)("div",{className:"Grid-cell u-md-size1of2",children:[(0,vn.jsx)("h2",{"data-epi-edit":"Title",children:null===t||void 0===t?void 0:t.Title}),(0,vn.jsx)("div",{"data-epi-edit":"Content",children:On(null!==(e=null===t||void 0===t?void 0:t.Content)&&void 0!==e?e:"")})]})]})}()})})})};var Ln=function(e){var t=e.content;return(0,vn.jsx)("div",{className:"Page-container GenericBlock",children:(0,vn.jsx)("div",{className:"Grid Grid--alignMiddle Grid--gutterA",children:(0,vn.jsx)("div",{className:"Grid-cell",children:(0,vn.jsxs)("p",{children:["Could not load ",t.Name," react component."]})})})})};function Dn(e){return"ContentBlock"==(null===e||void 0===e?void 0:e.__typename)?(0,vn.jsx)(jn,{content:e}):"GenericBlock"==(null===e||void 0===e?void 0:e.__typename)?(0,vn.jsx)(Ln,{content:e}):"BuyTicketBlock"==(null===e||void 0===e?void 0:e.__typename)?(0,vn.jsx)(Nn,{content:e}):(0,vn.jsx)(Ln,{content:e})}function Un(e){var t=e.content;return(0,vn.jsx)("div",{className:"preview-wrapper",children:(0,vn.jsxs)("section",{className:"Grid Preview","v-if":"modelLoaded",children:[(0,vn.jsx)("div",{className:"Grid-cell u-border",children:(0,vn.jsx)("h5",{children:"Full"})}),(0,vn.jsx)("div",{className:"Grid-cell u-md-sizeFull",children:Dn(t)}),(0,vn.jsx)("div",{className:"Grid-cell u-border",children:(0,vn.jsx)("h5",{children:"Wide"})}),(0,vn.jsx)("div",{className:"Grid-cell u-md-size2of3",children:Dn(t)}),(0,vn.jsx)("div",{className:"Grid-cell u-border",children:(0,vn.jsx)("h5",{children:"Half"})}),(0,vn.jsx)("div",{className:"Grid-cell u-md-size1of2",children:Dn(t)}),(0,vn.jsx)("div",{className:"Grid-cell u-border",children:(0,vn.jsx)("h5",{children:"Narrow"})}),(0,vn.jsx)("div",{className:"Grid-cell u-md-size1of3",children:Dn(t)})]})})}var Mn=function(e){var t,n,r,i,o,a,s=e.content;return(0,vn.jsxs)("div",{children:[(0,vn.jsx)("nav",{className:"Page-container PageHeader NavBar",children:(0,vn.jsx)("div",{className:"nav-table",children:(0,vn.jsxs)("div",{className:"nav-table-row",children:[(0,vn.jsx)("div",{className:"nav-table-cell",children:(0,vn.jsx)("button",{className:"Button buy-ticket-button",children:null===s||void 0===s||null===(t=s.BuyTicketBlock)||void 0===t?void 0:t.Heading})}),(0,vn.jsx)("div",{className:"nav-table-cell search-button-block",children:(0,vn.jsx)(Rn,{})})]})})}),(0,vn.jsxs)("section",{className:"Hero",children:[(0,vn.jsxs)("div",{className:"Hero-content Page-container",children:[(0,vn.jsx)("h1",{"data-epi-edit":"Title",children:null===s||void 0===s?void 0:s.Title}),(0,vn.jsx)("h5",{"data-epi-edit":"Subtitle",children:null===s||void 0===s?void 0:s.Subtitle})]}),(0,vn.jsx)("div",{className:"Hero-image",style:{backgroundImage:"url(".concat(_n(null===s||void 0===s?void 0:s.HeroImage),")")}})]}),(0,vn.jsx)("a",{href:null===(n=s.ArtistsLink)||void 0===n||null===(r=n.Expanded)||void 0===r?void 0:r.RelativePath,className:"EPiLink Button modal-default-button landing-page-button",children:null===(i=s.ArtistsLink)||void 0===i||null===(o=i.Expanded)||void 0===o?void 0:o.Name}),(0,vn.jsx)("main",{className:"Page-container",children:(0,vn.jsx)("div",{children:(0,vn.jsx)("section",{"data-epi-edit":"MainContentArea",className:"Grid Grid--alignMiddle Grid--gutterA ContentArea",children:null===s||void 0===s||null===(a=s.MainContentArea)||void 0===a?void 0:a.map((function(e,t){return function(){var n,r,i=null===e||void 0===e||null===(n=e.ContentLink)||void 0===n?void 0:n.Expanded;return"ImageFile"===(null===i||void 0===i?void 0:i.__typename)?(0,vn.jsx)("div",{className:"Grid-cell u-md-size1of2",children:(0,vn.jsx)("div",{className:"Page-container ImageFile",children:(0,vn.jsx)("div",{className:"Grid Grid--alignMiddle Grid--gutterA",children:(0,vn.jsx)("div",{className:"Grid-cell",children:(0,vn.jsx)("img",{className:"ConditionalImage",src:_n(null===i||void 0===i?void 0:i.Url),alt:null!==(r=null===i||void 0===i?void 0:i.Url)&&void 0!==r?r:""})})})})},t):(0,vn.jsx)("div",{children:Dn(i)},t)}()}))})})})]})};var Bn,Hn,Vn,qn,Kn,zn,Wn=function(e){var t,n,r,i,o=e.content;return(0,vn.jsxs)("div",{className:"ArtistContainerPage",children:[(0,vn.jsx)("nav",{className:"Page-container PageHeader NavBar",children:(0,vn.jsx)("div",{className:"backButton",children:(0,vn.jsx)("a",{href:null===(t=o.ParentLink)||void 0===t?void 0:t.Url,className:"EPiLink",children:(0,vn.jsx)("span",{})})})}),(0,vn.jsxs)("div",{className:"Page-container",children:[(0,vn.jsx)("div",{className:"top gutter",children:(0,vn.jsx)("h1",{"data-epi-edit":"Name",children:null===o||void 0===o?void 0:o.Name})}),(0,vn.jsxs)("div",{className:"list",children:[(0,vn.jsx)("h3",{children:"\xa0"}),null===(n=o.artists)||void 0===n||null===(r=n.ArtistDetailsPage)||void 0===r||null===(i=r.items)||void 0===i?void 0:i.map((function(e,t){var n,r;return(0,vn.jsx)("div",{children:(0,vn.jsx)("a",{href:null!==(n=null===e||void 0===e?void 0:e.RelativePath)&&void 0!==n?n:"",className:"EPiLink",children:(0,vn.jsxs)("div",{className:"card",children:[(0,vn.jsx)("div",{className:"round",children:(0,vn.jsx)("img",{className:"ConditionalImage",src:_n(null===e||void 0===e?void 0:e.ArtistPhoto),alt:null!==(r=null===e||void 0===e?void 0:e.ArtistName)&&void 0!==r?r:""})}),(0,vn.jsx)("div",{className:"info",children:(0,vn.jsx)("p",{children:null===e||void 0===e?void 0:e.ArtistName})})]})})},t)})),(0,vn.jsx)("h3",{children:"\xa0"})]})]}),(0,vn.jsx)("footer",{children:(0,vn.jsx)("div",{className:"FooterBottom",children:(0,vn.jsx)("h6",{children:"\xa9 Music Festival 2020"})})})]})};function Jn(e){return Qn(e)||""===e}function Qn(e){return null===e||void 0===e}function Yn(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.toLowerCase()===t.toLowerCase():e===t}function $n(e,t){var n=function(e){return e.substring(2+(~-e.lastIndexOf(".")>>>0))}(e);return!(n.length<1)&&(t.length<1||function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(e=e.toLowerCase(),t=t.map((function(e){return e.toLowerCase()}))),t.indexOf(e)>-1}(n,t,!0))}!function(e){e.RequiredValidator="RequiredValidator",e.EmailValidator="EmailValidator",e.RegularExpressionValidator="RegularExpressionValidator",e.DateDDMMYYYYValidator="DateDDMMYYYYValidator",e.DateMMDDYYYYValidator="DateMMDDYYYYValidator",e.DateYYYYMMDDValidator="DateYYYYMMDDValidator",e.UrlValidator="UrlValidator",e.IntegerValidator="IntegerValidator",e.PositiveIntegerValidator="PositiveIntegerValidator",e.AllowedExtensionsValidator="AllowedExtensionsValidator",e.MaxFileSizeValidator="MaxFileSizeValidator",e.NumericValidator="NumericValidator",e.CaptchaValidator="CaptchaValidator"}(Bn||(Bn={})),function(e){e.All="All",e.Any="Any"}(Hn||(Hn={})),function(e){e.Show="show",e.Hide="hide"}(Vn||(Vn={})),function(e){e.MatchRegularExpression="MatchRegularExpression",e.Contains="Contains",e.NotContains="NotContains",e.Equals="Equals",e.NotEquals="NotEquals"}(qn||(qn={})),function(e){e.PreviousStep="PreviousStep",e.NextStep="NextStep"}(Kn||(Kn={})),function(e){e.FormAccessToken="form_access_token",e.FormFieldPrefix="__field_",e.FormCurrentStep="form_current_step_",e.FormSubmissionId="form_submission_id_"}(zn||(zn={}));var Gn;!function(e){e.apiVersion="v1",e.apiEndpoint="_form/v1/form"}(Gn||(Gn={}));var Xn;function Zn(e,t){return e instanceof Array?e.join(t):e}ze(Xn={},qn.Contains,(function(e,t){var n=Qn(e)?"":Zn(e,",").toLocaleUpperCase();return t=t?t.toLocaleUpperCase():"",n.indexOf(t)>=0})),ze(Xn,qn.NotContains,(function(e,t){var n=e?Zn(e,",").toLocaleUpperCase():"",r=Jn(n),i=Jn(t);return!r&&i||r&&!i||!r&&!i&&n.indexOf(t.toLocaleUpperCase())<0})),ze(Xn,qn.Equals,(function(e,t){var n=e?Zn(e,",").toLocaleUpperCase():"";return t=t?t.toLocaleUpperCase():"",n===t})),ze(Xn,qn.NotEquals,(function(e,t){var n=e?Zn(e,",").toLocaleUpperCase():"";return t=t?t.toLocaleUpperCase():"",n!==t})),ze(Xn,qn.MatchRegularExpression,(function(e,t){var n=new RegExp(t,"igm"),r=e?Zn(e,","):"";return Jn(t)||!Jn(t)&&n.test(r)}));var er=function(){function e(t){h(this,e),this._element=t}return y(e,[{key:"validateRequired",value:function(e){return!(Qn(e)||"string"===typeof e&&Jn(e.trim())||e instanceof Array&&0===e.length)}},{key:"validateRegex",value:function(e,t){var n=t;return!(!Qn(null===n||void 0===n?void 0:n.jsPattern)&&!Jn(e))||!!function(e,t){try{var n=new RegExp(t).exec(e);return null!=n&&n.length>0}catch(r){return console.debug(r.message),!1}}(e,n.jsPattern)}},{key:"validateFileExtension",value:function(e,t){if(Jn(e)||e instanceof Array&&0===e.length)return!0;var n=e,r=t.accept,i=Jn(r)?[]:r.split(","),o=i.length,a=n.length;if(o>0)for(var s=0;s