/*! For license information please see LICENSES */ (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{10:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(69);var o=n(71),c=n(70);function h(t,i){return Object(r.a)(t)||function(t,i){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],c=!0,h=!1;try{for(e=e.call(t);!(c=(n=e.next()).done)&&(o.push(n.value),!i||o.length!==i);c=!0);}catch(t){h=!0,r=t}finally{try{c||null==e.return||e.return()}finally{if(h)throw r}}return o}}(t,i)||Object(o.a)(t,i)||Object(c.a)()}},134:function(t,e,n){"use strict";e.a=function(t,e){return e=e||{},new Promise((function(n,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(t){return i[t.toLowerCase()]},has:function(t){return t.toLowerCase()in i}}}};for(var c in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){o.push(e=e.toLowerCase()),u.push([e,n]),i[e]=i[e]?i[e]+","+n:n})),n(a())},s.onerror=r,s.withCredentials="include"==e.credentials,e.headers)s.setRequestHeader(c,e.headers[c]);s.send(e.body||null)}))}},135:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},136:function(t,e,n){"use strict";function r(t,e){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3?arguments[3]:void 0;if(!o(e))return c(t,{},n,r);var h=Object.assign({},e);for(var f in t)if("__proto__"!==f&&"constructor"!==f){var l=t[f];null!=l&&(r&&r(h,f,l,n)||(Array.isArray(l)&&Array.isArray(h[f])?h[f]=h[f].concat(l):o(l)&&o(h[f])?h[f]=c(l,h[f],(n?"".concat(n,"."):"")+f.toString(),r):h[f]=l))}return h}function h(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r>24&255,t[i+1]=e>>16&255,t[i+2]=e>>8&255,t[i+3]=255&e,t[i+4]=n>>24&255,t[i+5]=n>>16&255,t[i+6]=n>>8&255,t[i+7]=255&n}function _(t,e,n,r,o){var i,c=0;for(i=0;i>>8)-1}function S(t,e,n,r){return _(t,e,n,r,16)}function E(t,e,n,r){return _(t,e,n,r,32)}function A(t,e,n,r){!function(t,p,e,n){for(var u,r=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,h=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,f=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,d=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,y=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,v=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,m=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,w=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,k=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,_=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,S=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,E=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,A=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,T=r,x=o,O=c,P=h,C=f,R=l,U=d,L=y,I=v,j=m,M=w,B=k,N=_,D=S,$=E,H=A,i=0;i<20;i+=2)T^=(u=(N^=(u=(I^=(u=(C^=(u=T+N|0)<<7|u>>>25)+T|0)<<9|u>>>23)+C|0)<<13|u>>>19)+I|0)<<18|u>>>14,R^=(u=(x^=(u=(D^=(u=(j^=(u=R+x|0)<<7|u>>>25)+R|0)<<9|u>>>23)+j|0)<<13|u>>>19)+D|0)<<18|u>>>14,M^=(u=(U^=(u=(O^=(u=($^=(u=M+U|0)<<7|u>>>25)+M|0)<<9|u>>>23)+$|0)<<13|u>>>19)+O|0)<<18|u>>>14,H^=(u=(B^=(u=(L^=(u=(P^=(u=H+B|0)<<7|u>>>25)+H|0)<<9|u>>>23)+P|0)<<13|u>>>19)+L|0)<<18|u>>>14,T^=(u=(P^=(u=(O^=(u=(x^=(u=T+P|0)<<7|u>>>25)+T|0)<<9|u>>>23)+x|0)<<13|u>>>19)+O|0)<<18|u>>>14,R^=(u=(C^=(u=(L^=(u=(U^=(u=R+C|0)<<7|u>>>25)+R|0)<<9|u>>>23)+U|0)<<13|u>>>19)+L|0)<<18|u>>>14,M^=(u=(j^=(u=(I^=(u=(B^=(u=M+j|0)<<7|u>>>25)+M|0)<<9|u>>>23)+B|0)<<13|u>>>19)+I|0)<<18|u>>>14,H^=(u=($^=(u=(D^=(u=(N^=(u=H+$|0)<<7|u>>>25)+H|0)<<9|u>>>23)+N|0)<<13|u>>>19)+D|0)<<18|u>>>14;T=T+r|0,x=x+o|0,O=O+c|0,P=P+h|0,C=C+f|0,R=R+l|0,U=U+d|0,L=L+y|0,I=I+v|0,j=j+m|0,M=M+w|0,B=B+k|0,N=N+_|0,D=D+S|0,$=$+E|0,H=H+A|0,t[0]=T>>>0&255,t[1]=T>>>8&255,t[2]=T>>>16&255,t[3]=T>>>24&255,t[4]=x>>>0&255,t[5]=x>>>8&255,t[6]=x>>>16&255,t[7]=x>>>24&255,t[8]=O>>>0&255,t[9]=O>>>8&255,t[10]=O>>>16&255,t[11]=O>>>24&255,t[12]=P>>>0&255,t[13]=P>>>8&255,t[14]=P>>>16&255,t[15]=P>>>24&255,t[16]=C>>>0&255,t[17]=C>>>8&255,t[18]=C>>>16&255,t[19]=C>>>24&255,t[20]=R>>>0&255,t[21]=R>>>8&255,t[22]=R>>>16&255,t[23]=R>>>24&255,t[24]=U>>>0&255,t[25]=U>>>8&255,t[26]=U>>>16&255,t[27]=U>>>24&255,t[28]=L>>>0&255,t[29]=L>>>8&255,t[30]=L>>>16&255,t[31]=L>>>24&255,t[32]=I>>>0&255,t[33]=I>>>8&255,t[34]=I>>>16&255,t[35]=I>>>24&255,t[36]=j>>>0&255,t[37]=j>>>8&255,t[38]=j>>>16&255,t[39]=j>>>24&255,t[40]=M>>>0&255,t[41]=M>>>8&255,t[42]=M>>>16&255,t[43]=M>>>24&255,t[44]=B>>>0&255,t[45]=B>>>8&255,t[46]=B>>>16&255,t[47]=B>>>24&255,t[48]=N>>>0&255,t[49]=N>>>8&255,t[50]=N>>>16&255,t[51]=N>>>24&255,t[52]=D>>>0&255,t[53]=D>>>8&255,t[54]=D>>>16&255,t[55]=D>>>24&255,t[56]=$>>>0&255,t[57]=$>>>8&255,t[58]=$>>>16&255,t[59]=$>>>24&255,t[60]=H>>>0&255,t[61]=H>>>8&255,t[62]=H>>>16&255,t[63]=H>>>24&255}(t,e,n,r)}function T(t,e,n,r){!function(t,p,e,n){for(var u,r=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,h=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,f=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,d=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,y=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,v=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,m=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,w=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,k=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,_=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,S=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,E=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,A=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,i=0;i<20;i+=2)r^=(u=(_^=(u=(v^=(u=(f^=(u=r+_|0)<<7|u>>>25)+r|0)<<9|u>>>23)+f|0)<<13|u>>>19)+v|0)<<18|u>>>14,l^=(u=(o^=(u=(S^=(u=(m^=(u=l+o|0)<<7|u>>>25)+l|0)<<9|u>>>23)+m|0)<<13|u>>>19)+S|0)<<18|u>>>14,w^=(u=(d^=(u=(c^=(u=(E^=(u=w+d|0)<<7|u>>>25)+w|0)<<9|u>>>23)+E|0)<<13|u>>>19)+c|0)<<18|u>>>14,A^=(u=(k^=(u=(y^=(u=(h^=(u=A+k|0)<<7|u>>>25)+A|0)<<9|u>>>23)+h|0)<<13|u>>>19)+y|0)<<18|u>>>14,r^=(u=(h^=(u=(c^=(u=(o^=(u=r+h|0)<<7|u>>>25)+r|0)<<9|u>>>23)+o|0)<<13|u>>>19)+c|0)<<18|u>>>14,l^=(u=(f^=(u=(y^=(u=(d^=(u=l+f|0)<<7|u>>>25)+l|0)<<9|u>>>23)+d|0)<<13|u>>>19)+y|0)<<18|u>>>14,w^=(u=(m^=(u=(v^=(u=(k^=(u=w+m|0)<<7|u>>>25)+w|0)<<9|u>>>23)+k|0)<<13|u>>>19)+v|0)<<18|u>>>14,A^=(u=(E^=(u=(S^=(u=(_^=(u=A+E|0)<<7|u>>>25)+A|0)<<9|u>>>23)+_|0)<<13|u>>>19)+S|0)<<18|u>>>14;t[0]=r>>>0&255,t[1]=r>>>8&255,t[2]=r>>>16&255,t[3]=r>>>24&255,t[4]=l>>>0&255,t[5]=l>>>8&255,t[6]=l>>>16&255,t[7]=l>>>24&255,t[8]=w>>>0&255,t[9]=w>>>8&255,t[10]=w>>>16&255,t[11]=w>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=d>>>0&255,t[17]=d>>>8&255,t[18]=d>>>16&255,t[19]=d>>>24&255,t[20]=y>>>0&255,t[21]=y>>>8&255,t[22]=y>>>16&255,t[23]=y>>>24&255,t[24]=v>>>0&255,t[25]=v>>>8&255,t[26]=v>>>16&255,t[27]=v>>>24&255,t[28]=m>>>0&255,t[29]=m>>>8&255,t[30]=m>>>16&255,t[31]=m>>>24&255}(t,e,n,r)}var x=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function O(t,e,n,r,b,o,c){var u,i,h=new Uint8Array(16),f=new Uint8Array(64);for(i=0;i<16;i++)h[i]=0;for(i=0;i<8;i++)h[i]=o[i];for(;b>=64;){for(A(f,h,c,x),i=0;i<64;i++)t[e+i]=n[r+i]^f[i];for(u=1,i=8;i<16;i++)u=u+(255&h[i])|0,h[i]=255&u,u>>>=8;b-=64,e+=64,r+=64}if(b>0)for(A(f,h,c,x),i=0;i=64;){for(A(c,o,r,x),i=0;i<64;i++)t[e+i]=c[i];for(u=1,i=8;i<16;i++)u=u+(255&o[i])|0,o[i]=255&u,u>>>=8;b-=64,e+=64}if(b>0)for(A(c,o,r,x),i=0;i>>13|n<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),c=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|c<<12),this.r[5]=c>>>1&8190,h=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(c>>>14|h<<2),f=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(h>>>11|f<<5),l=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(f>>>8|l<<8),this.r[9]=l>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function L(t,e,n,r,o,c){var s=new U(c);return s.update(n,r,o),s.finish(t,e),0}function I(t,e,n,r,o,c){var h=new Uint8Array(16);return L(h,0,n,r,o,c),S(t,e,h,0)}function j(t,e,n,r,o){var i;if(n<32)return-1;for(R(t,0,e,0,n,r,o),L(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function M(t,e,n,r,o){var i,c=new Uint8Array(32);if(n<32)return-1;if(C(c,0,32,r,o),0!==I(e,16,e,32,n-32,c))return-1;for(R(t,0,e,0,n,r,o),i=0;i<32;i++)t[i]=0;return 0}function B(t,a){var i;for(i=0;i<16;i++)t[i]=0|a[i]}function N(t){var i,e,n=1;for(i=0;i<16;i++)e=t[i]+n+65535,n=Math.floor(e/65536),t[i]=e-65536*n;t[0]+=n-1+37*(n-1)}function D(p,q,b){for(var t,e=~(b-1),i=0;i<16;i++)t=e&(p[i]^q[i]),p[i]^=t,q[i]^=t}function $(t,n){var i,r,b,o=e(),c=e();for(i=0;i<16;i++)c[i]=n[i];for(N(c),N(c),N(c),r=0;r<2;r++){for(o[0]=c[0]-65517,i=1;i<15;i++)o[i]=c[i]-65535-(o[i-1]>>16&1),o[i-1]&=65535;o[15]=c[15]-32767-(o[14]>>16&1),b=o[15]>>16&1,o[14]&=65535,D(c,o,1-b)}for(i=0;i<16;i++)t[2*i]=255&c[i],t[2*i+1]=c[i]>>8}function H(a,b){var t=new Uint8Array(32),e=new Uint8Array(32);return $(t,a),$(e,b),E(t,0,e,0)}function z(a){var t=new Uint8Array(32);return $(t,a),1&t[0]}function Y(t,e){var i;for(i=0;i<16;i++)t[i]=e[2*i]+(e[2*i+1]<<8);t[15]&=32767}function F(t,a,b){for(var i=0;i<16;i++)t[i]=a[i]+b[i]}function X(t,a,b){for(var i=0;i<16;i++)t[i]=a[i]-b[i]}function J(t,a,b){var e,n,r=0,o=0,c=0,h=0,f=0,l=0,d=0,y=0,v=0,m=0,w=0,k=0,_=0,S=0,E=0,A=0,T=0,x=0,O=0,P=0,C=0,R=0,U=0,L=0,I=0,j=0,M=0,B=0,N=0,D=0,$=0,H=b[0],z=b[1],Y=b[2],F=b[3],X=b[4],J=b[5],W=b[6],K=b[7],V=b[8],G=b[9],Z=b[10],Q=b[11],tt=b[12],et=b[13],nt=b[14],ot=b[15];r+=(e=a[0])*H,o+=e*z,c+=e*Y,h+=e*F,f+=e*X,l+=e*J,d+=e*W,y+=e*K,v+=e*V,m+=e*G,w+=e*Z,k+=e*Q,_+=e*tt,S+=e*et,E+=e*nt,A+=e*ot,o+=(e=a[1])*H,c+=e*z,h+=e*Y,f+=e*F,l+=e*X,d+=e*J,y+=e*W,v+=e*K,m+=e*V,w+=e*G,k+=e*Z,_+=e*Q,S+=e*tt,E+=e*et,A+=e*nt,T+=e*ot,c+=(e=a[2])*H,h+=e*z,f+=e*Y,l+=e*F,d+=e*X,y+=e*J,v+=e*W,m+=e*K,w+=e*V,k+=e*G,_+=e*Z,S+=e*Q,E+=e*tt,A+=e*et,T+=e*nt,x+=e*ot,h+=(e=a[3])*H,f+=e*z,l+=e*Y,d+=e*F,y+=e*X,v+=e*J,m+=e*W,w+=e*K,k+=e*V,_+=e*G,S+=e*Z,E+=e*Q,A+=e*tt,T+=e*et,x+=e*nt,O+=e*ot,f+=(e=a[4])*H,l+=e*z,d+=e*Y,y+=e*F,v+=e*X,m+=e*J,w+=e*W,k+=e*K,_+=e*V,S+=e*G,E+=e*Z,A+=e*Q,T+=e*tt,x+=e*et,O+=e*nt,P+=e*ot,l+=(e=a[5])*H,d+=e*z,y+=e*Y,v+=e*F,m+=e*X,w+=e*J,k+=e*W,_+=e*K,S+=e*V,E+=e*G,A+=e*Z,T+=e*Q,x+=e*tt,O+=e*et,P+=e*nt,C+=e*ot,d+=(e=a[6])*H,y+=e*z,v+=e*Y,m+=e*F,w+=e*X,k+=e*J,_+=e*W,S+=e*K,E+=e*V,A+=e*G,T+=e*Z,x+=e*Q,O+=e*tt,P+=e*et,C+=e*nt,R+=e*ot,y+=(e=a[7])*H,v+=e*z,m+=e*Y,w+=e*F,k+=e*X,_+=e*J,S+=e*W,E+=e*K,A+=e*V,T+=e*G,x+=e*Z,O+=e*Q,P+=e*tt,C+=e*et,R+=e*nt,U+=e*ot,v+=(e=a[8])*H,m+=e*z,w+=e*Y,k+=e*F,_+=e*X,S+=e*J,E+=e*W,A+=e*K,T+=e*V,x+=e*G,O+=e*Z,P+=e*Q,C+=e*tt,R+=e*et,U+=e*nt,L+=e*ot,m+=(e=a[9])*H,w+=e*z,k+=e*Y,_+=e*F,S+=e*X,E+=e*J,A+=e*W,T+=e*K,x+=e*V,O+=e*G,P+=e*Z,C+=e*Q,R+=e*tt,U+=e*et,L+=e*nt,I+=e*ot,w+=(e=a[10])*H,k+=e*z,_+=e*Y,S+=e*F,E+=e*X,A+=e*J,T+=e*W,x+=e*K,O+=e*V,P+=e*G,C+=e*Z,R+=e*Q,U+=e*tt,L+=e*et,I+=e*nt,j+=e*ot,k+=(e=a[11])*H,_+=e*z,S+=e*Y,E+=e*F,A+=e*X,T+=e*J,x+=e*W,O+=e*K,P+=e*V,C+=e*G,R+=e*Z,U+=e*Q,L+=e*tt,I+=e*et,j+=e*nt,M+=e*ot,_+=(e=a[12])*H,S+=e*z,E+=e*Y,A+=e*F,T+=e*X,x+=e*J,O+=e*W,P+=e*K,C+=e*V,R+=e*G,U+=e*Z,L+=e*Q,I+=e*tt,j+=e*et,M+=e*nt,B+=e*ot,S+=(e=a[13])*H,E+=e*z,A+=e*Y,T+=e*F,x+=e*X,O+=e*J,P+=e*W,C+=e*K,R+=e*V,U+=e*G,L+=e*Z,I+=e*Q,j+=e*tt,M+=e*et,B+=e*nt,N+=e*ot,E+=(e=a[14])*H,A+=e*z,T+=e*Y,x+=e*F,O+=e*X,P+=e*J,C+=e*W,R+=e*K,U+=e*V,L+=e*G,I+=e*Z,j+=e*Q,M+=e*tt,B+=e*et,N+=e*nt,D+=e*ot,A+=(e=a[15])*H,o+=38*(x+=e*Y),c+=38*(O+=e*F),h+=38*(P+=e*X),f+=38*(C+=e*J),l+=38*(R+=e*W),d+=38*(U+=e*K),y+=38*(L+=e*V),v+=38*(I+=e*G),m+=38*(j+=e*Z),w+=38*(M+=e*Q),k+=38*(B+=e*tt),_+=38*(N+=e*et),S+=38*(D+=e*nt),E+=38*($+=e*ot),r=(e=(r+=38*(T+=e*z))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),h=(e=h+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),y=(e=y+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),k=(e=k+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),S=(e=S+n+65535)-65536*(n=Math.floor(e/65536)),E=(e=E+n+65535)-65536*(n=Math.floor(e/65536)),A=(e=A+n+65535)-65536*(n=Math.floor(e/65536)),r=(e=(r+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),h=(e=h+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),y=(e=y+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),k=(e=k+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),S=(e=S+n+65535)-65536*(n=Math.floor(e/65536)),E=(e=E+n+65535)-65536*(n=Math.floor(e/65536)),A=(e=A+n+65535)-65536*(n=Math.floor(e/65536)),r+=n-1+37*(n-1),t[0]=r,t[1]=o,t[2]=c,t[3]=h,t[4]=f,t[5]=l,t[6]=d,t[7]=y,t[8]=v,t[9]=m,t[10]=w,t[11]=k,t[12]=_,t[13]=S,t[14]=E,t[15]=A}function W(t,a){J(t,a,a)}function K(t,i){var a,n=e();for(a=0;a<16;a++)n[a]=i[a];for(a=253;a>=0;a--)W(n,n),2!==a&&4!==a&&J(n,n,i);for(a=0;a<16;a++)t[a]=n[a]}function V(t,i){var a,n=e();for(a=0;a<16;a++)n[a]=i[a];for(a=250;a>=0;a--)W(n,n),1!==a&&J(n,n,i);for(a=0;a<16;a++)t[a]=n[a]}function G(q,t,p){var n,i,r=new Uint8Array(32),o=new Float64Array(80),a=e(),b=e(),c=e(),h=e(),f=e(),d=e();for(i=0;i<31;i++)r[i]=t[i];for(r[31]=127&t[31]|64,r[0]&=248,Y(o,p),i=0;i<16;i++)b[i]=o[i],h[i]=a[i]=c[i]=0;for(a[0]=h[0]=1,i=254;i>=0;--i)D(a,b,n=r[i>>>3]>>>(7&i)&1),D(c,h,n),F(f,a,c),X(a,a,c),F(c,b,h),X(b,b,h),W(h,f),W(d,a),J(a,c,a),J(c,b,f),F(f,a,c),X(a,a,c),W(b,a),X(c,h,d),J(a,c,l),F(a,a,h),J(c,c,a),J(a,h,d),J(h,b,o),W(b,f),D(a,b,n),D(c,h,n);for(i=0;i<16;i++)o[i+16]=a[i],o[i+32]=c[i],o[i+48]=b[i],o[i+64]=h[i];var y=o.subarray(32),v=o.subarray(16);return K(y,y),J(v,v,y),$(q,v),0}function Z(q,t){return G(q,t,c)}function Q(t,e){return r(e,32),Z(t,e)}function tt(t,e,n){var s=new Uint8Array(32);return G(s,n,e),T(t,o,s,x)}U.prototype.blocks=function(t,e,n){for(var r,o,c,h,f,l,d,y,v,m,w,k,_,S,E,A,T,x,O,P=this.fin?0:2048,C=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],R=this.h[7],U=this.h[8],L=this.h[9],I=this.r[0],j=this.r[1],M=this.r[2],B=this.r[3],N=this.r[4],D=this.r[5],$=this.r[6],H=this.r[7],z=this.r[8],Y=this.r[9];n>=16;)m=v=0,m+=(C+=8191&(r=255&t[e+0]|(255&t[e+1])<<8))*I,m+=(h1+=8191&(r>>>13|(o=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*Y),m+=(h2+=8191&(o>>>10|(c=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*z),m+=(h3+=8191&(c>>>7|(h=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*H),v=(m+=(h4+=8191&(h>>>4|(f=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*$))>>>13,m&=8191,m+=(h5+=f>>>1&8191)*(5*D),m+=(h6+=8191&(f>>>14|(l=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*N),m+=(R+=8191&(l>>>11|(d=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*B),m+=(U+=8191&(d>>>8|(y=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*M),w=v+=(m+=(L+=y>>>5|P)*(5*j))>>>13,w+=C*j,w+=h1*I,w+=h2*(5*Y),w+=h3*(5*z),v=(w+=h4*(5*H))>>>13,w&=8191,w+=h5*(5*$),w+=h6*(5*D),w+=R*(5*N),w+=U*(5*B),v+=(w+=L*(5*M))>>>13,w&=8191,k=v,k+=C*M,k+=h1*j,k+=h2*I,k+=h3*(5*Y),v=(k+=h4*(5*z))>>>13,k&=8191,k+=h5*(5*H),k+=h6*(5*$),k+=R*(5*D),k+=U*(5*N),_=v+=(k+=L*(5*B))>>>13,_+=C*B,_+=h1*M,_+=h2*j,_+=h3*I,v=(_+=h4*(5*Y))>>>13,_&=8191,_+=h5*(5*z),_+=h6*(5*H),_+=R*(5*$),_+=U*(5*D),S=v+=(_+=L*(5*N))>>>13,S+=C*N,S+=h1*B,S+=h2*M,S+=h3*j,v=(S+=h4*I)>>>13,S&=8191,S+=h5*(5*Y),S+=h6*(5*z),S+=R*(5*H),S+=U*(5*$),E=v+=(S+=L*(5*D))>>>13,E+=C*D,E+=h1*N,E+=h2*B,E+=h3*M,v=(E+=h4*j)>>>13,E&=8191,E+=h5*I,E+=h6*(5*Y),E+=R*(5*z),E+=U*(5*H),A=v+=(E+=L*(5*$))>>>13,A+=C*$,A+=h1*D,A+=h2*N,A+=h3*B,v=(A+=h4*M)>>>13,A&=8191,A+=h5*j,A+=h6*I,A+=R*(5*Y),A+=U*(5*z),T=v+=(A+=L*(5*H))>>>13,T+=C*H,T+=h1*$,T+=h2*D,T+=h3*N,v=(T+=h4*B)>>>13,T&=8191,T+=h5*M,T+=h6*j,T+=R*I,T+=U*(5*Y),x=v+=(T+=L*(5*z))>>>13,x+=C*z,x+=h1*H,x+=h2*$,x+=h3*D,v=(x+=h4*N)>>>13,x&=8191,x+=h5*B,x+=h6*M,x+=R*j,x+=U*I,O=v+=(x+=L*(5*Y))>>>13,O+=C*Y,O+=h1*z,O+=h2*H,O+=h3*$,v=(O+=h4*D)>>>13,O&=8191,O+=h5*N,O+=h6*B,O+=R*M,O+=U*j,C=m=8191&(v=(v=((v+=(O+=L*I)>>>13)<<2)+v|0)+(m&=8191)|0),h1=w+=v>>>=13,h2=k&=8191,h3=_&=8191,h4=S&=8191,h5=E&=8191,h6=A&=8191,R=T&=8191,U=x&=8191,L=O&=8191,e+=16,n-=16;this.h[0]=C,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=R,this.h[8]=U,this.h[9]=L},U.prototype.finish=function(t,e){var n,mask,r,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,g[0]=this.h[0]+5,n=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+n,n=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^n)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),r=this.h[0]+this.pad[0],this.h[0]=65535&r,i=1;i<8;i++)r=(this.h[i]+this.pad[i]|0)+(r>>>16)|0,this.h[i]=65535&r;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},U.prototype.update=function(t,e,n){var i,r;if(this.leftover){for((r=16-this.leftover)>n&&(r=n),i=0;i=16&&(r=n-n%16,this.blocks(t,e,r),e+=r,n-=r),n){for(i=0;i=128;){for(i=0;i<16;i++)O=8*i+Z,L[i]=n[O+0]<<24|n[O+1]<<16|n[O+2]<<8|n[O+3],I[i]=n[O+4]<<24|n[O+5]<<16|n[O+6]<<8|n[O+7];for(i=0;i<80;i++)if(o=j,c=M,h=B,f=N,l=D,d=$,y=H,m=Y,w=F,k=X,_=J,S=W,E=K,A=V,a=65535&(C=G),b=C>>>16,R=65535&(P=z),U=P>>>16,a+=65535&(C=(W>>>14|D<<18)^(W>>>18|D<<14)^(D>>>9|W<<23)),b+=C>>>16,R+=65535&(P=(D>>>14|W<<18)^(D>>>18|W<<14)^(W>>>9|D<<23)),U+=P>>>16,a+=65535&(C=W&K^~W&V),b+=C>>>16,R+=65535&(P=D&$^~D&H),U+=P>>>16,a+=65535&(C=ot[2*i+1]),b+=C>>>16,R+=65535&(P=ot[2*i]),U+=P>>>16,P=L[i%16],b+=(C=I[i%16])>>>16,R+=65535&P,U+=P>>>16,R+=(b+=(a+=65535&C)>>>16)>>>16,a=65535&(C=x=65535&a|b<<16),b=C>>>16,R=65535&(P=th=65535&R|(U+=R>>>16)<<16),U=P>>>16,a+=65535&(C=(Y>>>28|j<<4)^(j>>>2|Y<<30)^(j>>>7|Y<<25)),b+=C>>>16,R+=65535&(P=(j>>>28|Y<<4)^(Y>>>2|j<<30)^(Y>>>7|j<<25)),U+=P>>>16,b+=(C=Y&F^Y&X^F&X)>>>16,R+=65535&(P=j&M^j&B^M&B),U+=P>>>16,v=65535&(R+=(b+=(a+=65535&C)>>>16)>>>16)|(U+=R>>>16)<<16,T=65535&a|b<<16,a=65535&(C=_),b=C>>>16,R=65535&(P=f),U=P>>>16,b+=(C=x)>>>16,R+=65535&(P=th),U+=P>>>16,M=o,B=c,N=h,D=f=65535&(R+=(b+=(a+=65535&C)>>>16)>>>16)|(U+=R>>>16)<<16,$=l,H=d,z=y,j=v,F=m,X=w,J=k,W=_=65535&a|b<<16,K=S,V=E,G=A,Y=T,i%16==15)for(O=0;O<16;O++)P=L[O],a=65535&(C=I[O]),b=C>>>16,R=65535&P,U=P>>>16,P=L[(O+9)%16],a+=65535&(C=I[(O+9)%16]),b+=C>>>16,R+=65535&P,U+=P>>>16,th=L[(O+1)%16],a+=65535&(C=((x=I[(O+1)%16])>>>1|th<<31)^(x>>>8|th<<24)^(x>>>7|th<<25)),b+=C>>>16,R+=65535&(P=(th>>>1|x<<31)^(th>>>8|x<<24)^th>>>7),U+=P>>>16,th=L[(O+14)%16],b+=(C=((x=I[(O+14)%16])>>>19|th<<13)^(th>>>29|x<<3)^(x>>>6|th<<26))>>>16,R+=65535&(P=(th>>>19|x<<13)^(x>>>29|th<<3)^th>>>6),U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,L[O]=65535&R|U<<16,I[O]=65535&a|b<<16;a=65535&(C=Y),b=C>>>16,R=65535&(P=j),U=P>>>16,P=t[0],b+=(C=e[0])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[0]=j=65535&R|U<<16,e[0]=Y=65535&a|b<<16,a=65535&(C=F),b=C>>>16,R=65535&(P=M),U=P>>>16,P=t[1],b+=(C=e[1])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[1]=M=65535&R|U<<16,e[1]=F=65535&a|b<<16,a=65535&(C=X),b=C>>>16,R=65535&(P=B),U=P>>>16,P=t[2],b+=(C=e[2])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[2]=B=65535&R|U<<16,e[2]=X=65535&a|b<<16,a=65535&(C=J),b=C>>>16,R=65535&(P=N),U=P>>>16,P=t[3],b+=(C=e[3])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[3]=N=65535&R|U<<16,e[3]=J=65535&a|b<<16,a=65535&(C=W),b=C>>>16,R=65535&(P=D),U=P>>>16,P=t[4],b+=(C=e[4])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[4]=D=65535&R|U<<16,e[4]=W=65535&a|b<<16,a=65535&(C=K),b=C>>>16,R=65535&(P=$),U=P>>>16,P=t[5],b+=(C=e[5])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[5]=$=65535&R|U<<16,e[5]=K=65535&a|b<<16,a=65535&(C=V),b=C>>>16,R=65535&(P=H),U=P>>>16,P=t[6],b+=(C=e[6])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[6]=H=65535&R|U<<16,e[6]=V=65535&a|b<<16,a=65535&(C=G),b=C>>>16,R=65535&(P=z),U=P>>>16,P=t[7],b+=(C=e[7])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[7]=z=65535&R|U<<16,e[7]=G=65535&a|b<<16,Z+=128,r-=128}return r}function st(t,e,n){var i,r=new Int32Array(8),o=new Int32Array(8),c=new Uint8Array(256),b=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,it(r,o,e,n),n%=128,i=0;i=0;--i)ct(p,q,b=s[i/8|0]>>(7&i)&1),at(q,p),at(p,p),ct(p,q,b)}function ft(p,s){var q=[e(),e(),e(),e()];B(q[0],v),B(q[1],m),B(q[2],f),J(q[3],v,m),ht(p,q,s)}function lt(t,n,o){var i,c=new Uint8Array(64),p=[e(),e(),e(),e()];for(o||r(n,32),st(c,n,32),c[0]&=248,c[31]&=127,c[31]|=64,ft(p,c),ut(t,p),i=0;i<32;i++)n[i+32]=t[i];return 0}var pt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function yt(t,e){var n,i,r,o;for(i=63;i>=32;--i){for(n=0,r=i-32,o=i-12;r>8,e[r]-=256*n;e[r]+=n,e[i]=0}for(n=0,r=0;r<32;r++)e[r]+=n-(e[31]>>4)*pt[r],n=e[r]>>8,e[r]&=255;for(r=0;r<32;r++)e[r]-=n*pt[r];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function gt(t){var i,e=new Float64Array(64);for(i=0;i<64;i++)e[i]=t[i];for(i=0;i<64;i++)t[i]=0;yt(t,e)}function vt(t,n,r,o){var i,c,h=new Uint8Array(64),f=new Uint8Array(64),l=new Uint8Array(64),d=new Float64Array(64),p=[e(),e(),e(),e()];st(h,o,32),h[0]&=248,h[31]&=127,h[31]|=64;var y=r+64;for(i=0;i>7&&X(t[0],h,t[0]),J(t[3],t[0],t[1]),0)}(q,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(_t),e=new Uint8Array(St);return lt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(At(t),t.length!==St)throw new Error("bad secret key size");for(var e=new Uint8Array(_t),i=0;i0)r.loading[t].push(n);else{r.loading[t]=[n];var o=je.createScriptRequest(r.getPath(t,e)),c=r.receivers.create((function(e){if(r.receivers.remove(c),r.loading[t]){var n=r.loading[t];delete r.loading[t];for(var h=function(t){t||o.cleanup()},i=0;i>>6)+d(128|63&e):d(224|e>>>12&15)+d(128|e>>>6&63)+d(128|63&e)},S=function(u){return u.replace(/[^\x00-\x7F]/g,_)},E=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[y.charAt(n>>>18),y.charAt(n>>>12&63),e>=2?"=":y.charAt(n>>>6&63),e>=1?"=":y.charAt(63&n)].join("")},A=window.btoa||function(b){return b.replace(/[\s\S]{1,3}/g,E)},T=function(){function t(t,e,n,r){var o=this;this.clear=e,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),x=(k=function(t,b){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},k(t,b)},function(t,b){function e(){this.constructor=t}k(t,b),t.prototype=null===b?Object.create(b):(e.prototype=b.prototype,new e)});function O(t){window.clearTimeout(t)}function P(t){window.clearInterval(t)}var C=function(t){function e(e,n){return t.call(this,setTimeout,O,e,(function(t){return n(),null}))||this}return x(e,t),e}(T),R=function(t){function e(e,n){return t.call(this,setInterval,P,e,(function(t){return n(),t}))||this}return x(e,t),e}(T),U={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new C(0,t)},method:function(t){for(var e=[],n=1;n0)for(i=0;i=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},Ct=Pt,Rt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Ut=function(t){function e(e,n){var r=t.call(this)||this;return r.id=e,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return Rt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(data){return this.transport.send(data)},e.prototype.send_event=function(t,data,e){var n={event:t,data:data};return e&&(n.channel=e),J.debug("Event sent",n),this.send(Ct.encodeMessage(n))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=Ct.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(J.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",{type:"WebSocketError",error:e})},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){B(e,(function(e,n){t.transport.unbind(n,e)}))};B(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=Ct.getCloseAction(t),n=Ct.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(ut),Lt=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=Ct.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new Ut(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=Ct.getCloseAction(e)||"backoff",r=Ct.getCloseError(e);t.finish(n,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(I({transport:this.transport,action:t},e))},t}(),It=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===je.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=(e||{}).auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var i in this.authOptions.params)e+="&"+encodeURIComponent(i)+"="+encodeURIComponent(this.authOptions.params[i]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||je.getAuthorizers(),t.authorizers[this.type].call(this,je,e,n)},t}(),jt=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(je.TimelineTransport.getAgent(this,t),e)},t}(),Mt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Bt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Nt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Dt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),qt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),$t=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Ht=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),zt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Yt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Ft=function(t){function e(e,n){var r=t.call(this,(function(t,data){J.debug("No callbacks on "+e+" for "+t)}))||this;return r.name=e,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return Yt(e,t),e.prototype.authorize=function(t,e){return e(!1,{auth:""})},e.prototype.trigger=function(t,data){if(0!==t.indexOf("client-"))throw new Bt("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var e=K("triggeringClientEvents");J.warn("Client event triggered before channel 'subscription_succeeded' event . "+e)}return this.pusher.send_event(t,data,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,data=t.data;"pusher_internal:subscription_succeeded"===e?this.handleSubscriptionSucceededEvent(t):0!==e.indexOf("pusher_internal:")&&this.emit(e,data,{})},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,data){e?(J.error(data),t.emit("pusher:subscription_error",data)):(data=data,t.pusher.send_event("pusher:subscribe",{auth:data.auth,channel_data:data.channel_data,channel:t.name}))})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(ut),Xt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Jt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xt(e,t),e.prototype.authorize=function(t,e){return ae.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(Ft),Wt=Jt,Kt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;B(this.members,(function(n,r){t(e.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),Vt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Gt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.members=new Kt,r}return Vt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var o=K("authenticationEndpoint");return J.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void n("Invalid auth response")}var c=JSON.parse(e.channel_data);r.members.setMyID(c.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var data=t.data,n={};t.user_id&&(n.user_id=t.user_id),this.emit(e,data,n)}},e.prototype.handleInternalEvent=function(t){var e=t.event,data=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var n=this.members.addMember(data);this.emit("pusher:member_added",n);break;case"pusher_internal:member_removed":var r=this.members.removeMember(data);r&&this.emit("pusher:member_removed",r)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(Wt),Zt=n(0),Qt=n(1),te=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),ee=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.key=null,e}return te(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(!0,e);else{var o=e.shared_secret;if(o)r.key=Object(Qt.decodeBase64)(o),delete e.shared_secret,n(!1,e);else{var c="No shared_secret key in auth payload for encrypted channel: "+r.name;n(!0,c)}}}))},e.prototype.trigger=function(t,data){throw new $t("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,data=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,data):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,data){var e=this;if(this.key)if(data.ciphertext&&data.nonce){var n=Object(Qt.decodeBase64)(data.ciphertext);if(n.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new C(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new C(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new C(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new C(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return I({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return I({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,data){var e=this.state;if(this.state=t,e!==t){var n=t;"connected"===n&&(n+=" with new socket ID "+data.socket_id),J.debug("State changed",e+" -> "+n),this.timeline.info({state:t,params:data}),this.emit("state_change",{previous:e,current:t}),this.emit(t,data)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(ut),ie=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){return 0===t.indexOf("private-encrypted-")?ae.createEncryptedChannel(t,e):0===t.indexOf("private-")?ae.createPrivateChannel(t,e):0===t.indexOf("presence-")?ae.createPresenceChannel(t,e):ae.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(object){var t=[];return B(object,(function(e){t.push(e)})),t}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){B(this.channels,(function(t){t.disconnect()}))},t}(),se=ie,ae={createChannels:function(){return new se},createConnectionManager:function(t,e){return new oe(t,e)},createChannel:function(t,e){return new Ft(t,e)},createPrivateChannel:function(t,e){return new Wt(t,e)},createPresenceChannel:function(t,e){return new Gt(t,e)},createEncryptedChannel:function(t,e){return new ne(t,e)},createTimelineSender:function(t,e){return new jt(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new It(t,e)},createHandshake:function(t,e){return new Lt(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new Ot(t,e,n)}},ce=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return ae.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),ue=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return H(this.strategies,L.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,r=this.strategies,o=0,c=this.timeout,h=null,f=function(l,d){d?e(null,d):(o+=1,n.loop&&(o%=r.length),o0&&(o=new C(n.timeout,(function(){c.abort(),r(!0)}))),c=t.connect(e,(function(t,e){t&&o&&o.isRunning()&&!n.failFast||(o&&o.ensureAborted(),r(t,e))})),{abort:function(){o&&o.ensureAborted(),c.abort()},forceMinPriority:function(p){c.forceMinPriority(p)}}},t}(),he=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return H(this.strategies,L.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var r=map(t,(function(t,i,r,o){return t.connect(e,n(i,o))}));return{abort:function(){D(r,fe)},forceMinPriority:function(p){D(r,(function(t){t.forceMinPriority(p)}))}}}(this.strategies,t,(function(i,t){return function(n,r){t[i].error=n,n?function(t){return function(t,e){for(var i=0;i=L.now()){var c=this.transports[r.transport];c&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new ue([c],{timeout:2*r.latency+1e3,failFast:!0})))}var h=L.now(),f=o.pop().connect(t,(function r(c,l){c?(ye(n),o.length>0?(h=L.now(),f=o.pop().connect(t,r)):e(c)):(function(t,e,n){var r=je.getLocalStorage();if(r)try{r[de(t)]=F({timestamp:L.now(),transport:e,latency:n})}catch(t){}}(n,l.transport.name,L.now()-h),e(null,l))}));return{abort:function(){f.abort()},forceMinPriority:function(p){t=p,f&&f.forceMinPriority(p)}}},t}(),pe=le;function de(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function ye(t){var e=je.getLocalStorage();if(e)try{delete e[de(t)]}catch(t){}}var ge=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,r=this.strategy,o=new C(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){o.ensureAborted(),n&&n.abort()},forceMinPriority:function(p){t=p,n&&n.forceMinPriority(p)}}},t}(),ve=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),be=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n},t}();function me(t){return function(){return t.isSupported()}}var we,ke=function(t,e){var n={};function r(r,o,c,h,f){var l=e(t,r,o,c,h,f);return n[r]=l,l}var o,c={hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath},h=I({},c,{useTLS:!0}),f={hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath},l={loop:!0,timeout:15e3,timeoutLimit:6e4},d=new ce({lives:2,minPingDelay:1e4,maxPingDelay:t.activity_timeout}),y=new ce({lives:2,minPingDelay:1e4,maxPingDelay:t.activity_timeout}),v=r("ws","ws",3,c,d),m=r("wss","ws",3,h,d),w=r("sockjs","sockjs",1,f),k=r("xhr_streaming","xhr_streaming",1,f,y),_=r("xdr_streaming","xdr_streaming",1,f,y),S=r("xhr_polling","xhr_polling",1,f),E=r("xdr_polling","xdr_polling",1,f),A=new ue([v],l),T=new ue([m],l),x=new ue([w],l),O=new ue([new ve(me(k),k,_)],l),P=new ue([new ve(me(S),S,E)],l),C=new ue([new ve(me(O),new he([O,new ge(P,{delay:4e3})]),P)],l),R=new ve(me(C),C,x);return o=t.useTLS?new he([A,new ge(R,{delay:2e3})]):new he([A,new ge(T,{delay:2e3}),new ge(R,{delay:5e3})]),new pe(new be(new ve(me(v),o,R)),n,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},_e={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new Nt),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},Se=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Ee=function(t){function e(e,n,r){var o=t.call(this)||this;return o.hooks=e,o.method=n,o.url=r,o}return Se(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},je.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(je.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,data){for(;;){var e=this.advanceBuffer(data);if(!e)break;this.emit("chunk",{status:t,data:e})}this.isBufferTooLong(data)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(ut);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(we||(we={}));var Ae=we,Te=1;function xe(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+Te++}function Oe(t){return Math.floor(Math.random()*t)}var Pe,Ce=function(){function t(t,e){this.hooks=t,this.session=Oe(1e3)+"/"+function(t){for(var e=[],i=0;i0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},Ie={createStreamingSocket:function(t){return this.createSocket(Re,t)},createPollingSocket:function(t){return this.createSocket(Ue,t)},createSocket:function(t,e){return new Ce(t,e)},createXHR:function(t,e){return this.createRequest(Le,t,e)},createRequest:function(t,e,n){return new Ee(t,e,n)},createXDR:function(t,e){return this.createRequest(_e,t,e)}},je={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:o,DependenciesReceivers:f,getDefaultStrategy:ke,Transports:At,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),l.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:Ie,TimelineTransport:tt,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var e=this;window.Pusher=t;var n=function(){e.onDocumentBody(t.ready)};window.JSON?n():l.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:V,jsonp:G}},onDocumentBody:function(t){var e=this;document.body?t():setTimeout((function(){e.onDocumentBody(t)}),0)},createJSONPRequest:function(t,data){return new Q(t,data)},createScriptRequest:function(t){return new Z(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return xt},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(Pe||(Pe={}));var Me=Pe,Be=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(I({},e,{timestamp:L.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Me.ERROR,t)},t.prototype.info=function(t){this.log(Me.INFO,t)},t.prototype.debug=function(t){this.log(Me.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,data=I({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(data,(function(t,r){t||n.sent++,e&&e(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),Ne=function(){function t(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return De(new zt,e);if(this.priority=h())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h().toString(16)+" bytes");return 0|t}function k(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(r)return K(t).length;e=(""+e).toLowerCase(),r=!0}}function _(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return L(this,e,n);case"ascii":return j(this,e,n);case"latin1":case"binary":return M(this,e,n);case"base64":return U(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function S(b,t,e){var i=b[t];b[t]=b[e],b[e]=i}function E(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:A(t,e,n,r,o);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):A(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function A(t,e,n,r,o){var i,c=1,h=t.length,f=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;c=2,h/=2,f/=2,n/=2}function l(t,i){return 1===c?t[i]:t.readUInt16BE(i*c)}if(o){var d=-1;for(i=n;ih&&(n=h-f),i=n;i>=0;i--){for(var y=!0,v=0;vo&&(r=o):r=o;var c=e.length;if(c%2!=0)throw new TypeError("Invalid hex string");r>c/2&&(r=c/2);for(var i=0;i>8,o=n%256,c.push(o),c.push(r);return c}(e,t.length-n),t,n,r)}function U(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function L(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:l>223?3:l>191?2:1;if(i+y<=n)switch(y){case 1:l<128&&(d=l);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&l)<<6|63&o)>127&&(d=f);break;case 3:o=t[i+1],c=t[i+2],128==(192&o)&&128==(192&c)&&(f=(15&l)<<12|(63&o)<<6|63&c)>2047&&(f<55296||f>57343)&&(d=f);break;case 4:o=t[i+1],c=t[i+2],h=t[i+3],128==(192&o)&&128==(192&c)&&128==(192&h)&&(f=(15&l)<<18|(63&o)<<12|(63&c)<<6|63&h)>65535&&f<1114112&&(d=f)}null===d?(d=65533,y=1):d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d),i+=y}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);var n="",i=0;for(;i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,r,o){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var c=(o>>>=0)-(r>>>=0),h=(n>>>=0)-(e>>>=0),f=Math.min(c,h),d=this.slice(r,o),y=t.slice(e,n),i=0;io)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var c=!1;;)switch(r){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return O(this,t,e,n);case"latin1":case"binary":return P(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,n);default:if(c)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),c=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function j(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,n,r,o,c){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function H(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function z(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function Y(t,e,n,r,o,c){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,r,c){return c||Y(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function X(t,e,n,r,c){return c||Y(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(o*=256);)r+=this[t+--e]*o;return r},l.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||$(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):z(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);$(this,t,e,n,o-1,-o)}var i=0,c=1,sub=0;for(this[e]=255&t;++i>0)-sub&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);$(this,t,e,n,o-1,-o)}var i=n-1,c=1,sub=0;for(this[e+i]=255&t;--i>=0&&(c*=256);)t<0&&0===sub&&0!==this[e+i+1]&&(sub=1),this[e+i]=(t/c>>0)-sub&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):z(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return X(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return X(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=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),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&c.push(239,191,189);continue}if(i+1===r){(e-=3)>-1&&c.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&c.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&c.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;c.push(n)}else if(n<2048){if((e-=2)<0)break;c.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;c.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;c.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return c}function V(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(21))},208:function(t,e,n){"use strict";e.byteLength=function(t){var e=f(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,i,n=f(t),r=n[0],h=n[1],l=new c(function(t,e,n){return 3*(e+n)/4-n}(0,r,h)),d=0,y=h>0?r-4:r;for(i=0;i>16&255,l[d++]=e>>8&255,l[d++]=255&e;2===h&&(e=o[t.charCodeAt(i)]<<2|o[t.charCodeAt(i+1)]>>4,l[d++]=255&e);1===h&&(e=o[t.charCodeAt(i)]<<10|o[t.charCodeAt(i+1)]<<4|o[t.charCodeAt(i+2)]>>2,l[d++]=e>>8&255,l[d++]=255&e);return l},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,c=[],h=16383,i=0,f=n-o;if?f:i+h));1===o?(e=t[n-1],c.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],c.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return c.join("")};for(var r=[],o=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,h=code.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var o,c,output=[],i=e;i>18&63]+r[c>>12&63]+r[c>>6&63]+r[63&c]);return output.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},209:function(t,e){e.read=function(t,e,n,r,o){var c,h,f=8*o-r-1,l=(1<>1,y=-7,i=n?o-1:0,v=n?-1:1,s=t[e+i];for(i+=v,c=s&(1<<-y)-1,s>>=-y,y+=f;y>0;c=256*c+t[e+i],i+=v,y-=8);for(h=c&(1<<-y)-1,c>>=-y,y+=r;y>0;h=256*h+t[e+i],i+=v,y-=8);if(0===c)c=1-d;else{if(c===l)return h?NaN:1/0*(s?-1:1);h+=Math.pow(2,r),c-=d}return(s?-1:1)*h*Math.pow(2,c-r)},e.write=function(t,e,n,r,o,c){var h,f,l,d=8*c-o-1,y=(1<>1,rt=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,i=r?0:c-1,m=r?1:-1,s=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,h=y):(h=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-h))<1&&(h--,l*=2),(e+=h+v>=1?rt/l:rt*Math.pow(2,1-v))*l>=2&&(h++,l/=2),h+v>=y?(f=0,h=y):h+v>=1?(f=(e*l-1)*Math.pow(2,o),h+=v):(f=e*Math.pow(2,v-1)*Math.pow(2,o),h=0));o>=8;t[n+i]=255&f,i+=m,f/=256,o-=8);for(h=h<0;t[n+i]=255&h,i+=m,h/=256,d-=8);t[n+i-m]|=128*s}},210:function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},4:function(t,e,n){"use strict";function r(t,e,n,r,o,c,h){try{var f=t[c](h),l=f.value}catch(t){return void n(t)}f.done?e(l):Promise.resolve(l).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,c){var h=t.apply(e,n);function f(t){r(h,o,c,f,l,"next",t)}function l(t){r(h,o,c,f,l,"throw",t)}f(void 0)}))}}n.d(e,"a",(function(){return o}))},40:function(t,e,n){"use strict";n.d(e,"a",(function(){return T})),n.d(e,"b",(function(){return O})),n.d(e,"c",(function(){return M})),n.d(e,"d",(function(){return x}));var r=n(72),o=n(42),c=n(93),h=n(94),f=n(55);const l=t=>null==t,d=t=>!l(t),y=(t,a,b)=>w(a,t)===w(b,t);function v(u){return u&&u.length&&new RegExp(["^\\/([a-zA-Z0-9@\\-%_~.:]","[/a-zA-Z0-9@\\-%_~.:]*)?","([?][^#]*)?(#[^#]*)?$"].join("")).test(u)}function m(t,e,n){return t.matched.some((t=>Object.values(t.components).some((component=>component.options&&component.options[e]===n))))}function w(path="",t){let e=path.split("?")[0];return t&&t.base&&(e=e.replace(t.base,"/")),"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e=e.replace(/\/+/g,"/"),e}function k(t){return"string"==typeof t?t:JSON.stringify(t)}function _(t){if("string"==typeof t)try{return JSON.parse(t)}catch(t){}return t}function S(t,e){if(!e||!t||"object"!=typeof t)return t;if(e in t)return t[e];const n=Array.isArray(e)?e:(e+"").split(".");let r=t;for(;n.length&&r;)r=r[n.shift()];return r}function E(t,e){return t&&e&&"string"==typeof t&&!t.startsWith(e)?e+" "+t:t}class A{constructor(t,e){this.ctx=t,this.options=e,this._initState()}setUniversal(t,e){return l(e)?this.removeUniversal(t):(this.setCookie(t,e),this.setLocalStorage(t,e),this.setState(t,e),e)}getUniversal(t){let e;return l(e)&&(e=this.getCookie(t)),l(e)&&(e=this.getLocalStorage(t)),l(e)&&(e=this.getState(t)),e}syncUniversal(t,e){let n=this.getUniversal(t);return l(n)&&d(e)&&(n=e),d(n)&&this.setUniversal(t,n),n}removeUniversal(t){this.removeState(t),this.removeLocalStorage(t),this.removeCookie(t)}_initState(){if(o.set(this,"_state",{}),this._useVuex=this.options.vuex&&!!this.ctx.store,this._useVuex){const t={namespaced:!0,state:()=>this.options.initialState,mutations:{SET(t,e){o.set(t,e.key,e.value)}}};this.ctx.store.registerModule(this.options.vuex.namespace,t,{preserveState:Boolean(this.ctx.store.state[this.options.vuex.namespace])}),this.state=this.ctx.store.state[this.options.vuex.namespace]}else o.set(this,"state",{}),console.warn("[AUTH] The Vuex Store is not activated. This might cause issues in auth module behavior, like redirects not working properly.To activate it, see https://nuxtjs.org/docs/2.x/directory-structure/store")}setState(t,e){return"_"===t[0]?o.set(this._state,t,e):this._useVuex?this.ctx.store.commit(this.options.vuex.namespace+"/SET",{key:t,value:e}):o.set(this.state,t,e),e}getState(t){return"_"!==t[0]?this.state[t]:this._state[t]}watchState(t,e){if(this._useVuex)return this.ctx.store.watch((e=>S(e[this.options.vuex.namespace],t)),e)}removeState(t){this.setState(t,void 0)}setLocalStorage(t,e){if(l(e))return this.removeLocalStorage(t);if(!this.isLocalStorageEnabled())return;const n=this.getPrefix()+t;try{localStorage.setItem(n,k(e))}catch(t){if(!this.options.ignoreExceptions)throw t}return e}getLocalStorage(t){if(!this.isLocalStorageEnabled())return;const e=this.getPrefix()+t;return _(localStorage.getItem(e))}removeLocalStorage(t){if(!this.isLocalStorageEnabled())return;const e=this.getPrefix()+t;localStorage.removeItem(e)}getCookies(){if(!this.isCookiesEnabled())return;const t=document.cookie;return c.parse(t||"")||{}}setCookie(t,e,n={}){if(!this.options.cookie)return;if(!this.isCookiesEnabled())return;const r=(void 0!==n.prefix?n.prefix:this.options.cookie.prefix)+t,o=Object.assign({},this.options.cookie.options,n),h=k(e);l(e)&&(o.maxAge=-1),"number"==typeof o.expires&&(o.expires=new Date(Date.now()+864e5*o.expires));const f=c.serialize(r,h,o);return document.cookie=f,e}getCookie(t){if(!this.options.cookie)return;if(!this.isCookiesEnabled())return;const e=this.options.cookie.prefix+t,n=this.getCookies();return _(n[e]?decodeURIComponent(n[e]):void 0)}removeCookie(t,e){this.setCookie(t,void 0,e)}getPrefix(){if(!this.options.localStorage)throw new Error("Cannot get prefix; localStorage is off");return this.options.localStorage.prefix}isLocalStorageEnabled(){if(!this.options.localStorage)return!1;const t="test";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(t){return this.options.ignoreExceptions||console.warn("[AUTH] Local storage is enabled in config, but browser doesn't support it"),!1}}isCookiesEnabled(){return!!this.options.cookie&&(!!window.navigator.cookieEnabled||(console.warn("[AUTH] Cookies is enabled in config, but browser doesn't support it"),!1))}}class T{constructor(t,e){this.strategies={},this._errorListeners=[],this._redirectListeners=[],this.ctx=t,this.options=e;const n=new A(t,{...e,initialState:{user:null,loggedIn:!1}});this.$storage=n,this.$state=n.state}get state(){return this._stateWarnShown||(this._stateWarnShown=!0,console.warn("[AUTH] $auth.state is deprecated. Please use $auth.$state or top level props like $auth.loggedIn")),this.$state}get strategy(){return this.getStrategy()}getStrategy(t=!0){if(t){if(!this.$state.strategy)throw new Error("No strategy is set!");if(!this.strategies[this.$state.strategy])throw new Error("Strategy not supported: "+this.$state.strategy)}return this.strategies[this.$state.strategy]}get user(){return this.$state.user}get loggedIn(){return this.$state.loggedIn}get busy(){return this.$storage.getState("busy")}async init(){if(this.options.resetOnError&&this.onError(((...t)=>{("function"!=typeof this.options.resetOnError||this.options.resetOnError(...t))&&this.reset()})),this.$storage.syncUniversal("strategy",this.options.defaultStrategy),!this.getStrategy(!1)&&(this.$storage.setUniversal("strategy",this.options.defaultStrategy),!this.getStrategy(!1)))return Promise.resolve();try{await this.mounted()}catch(t){this.callOnError(t)}finally{this.options.watchLoggedIn&&this.$storage.watchState("loggedIn",(t=>{m(this.ctx.route,"auth",!1)||this.redirect(t?"home":"logout")}))}}getState(t){return this._getStateWarnShown||(this._getStateWarnShown=!0,console.warn("[AUTH] $auth.getState is deprecated. Please use $auth.$storage.getState() or top level props like $auth.loggedIn")),this.$storage.getState(t)}registerStrategy(t,e){this.strategies[t]=e}setStrategy(t){if(t===this.$storage.getUniversal("strategy"))return Promise.resolve();if(!this.strategies[t])throw new Error(`Strategy ${t} is not defined!`);return this.reset(),this.$storage.setUniversal("strategy",t),this.mounted()}mounted(...t){return this.getStrategy().mounted?Promise.resolve(this.getStrategy().mounted(...t)).catch((t=>(this.callOnError(t,{method:"mounted"}),Promise.reject(t)))):this.fetchUserOnce()}loginWith(t,...e){return this.setStrategy(t).then((()=>this.login(...e)))}login(...t){return this.getStrategy().login?this.wrapLogin(this.getStrategy().login(...t)).catch((t=>(this.callOnError(t,{method:"login"}),Promise.reject(t)))):Promise.resolve()}fetchUser(...t){return this.getStrategy().fetchUser?Promise.resolve(this.getStrategy().fetchUser(...t)).catch((t=>(this.callOnError(t,{method:"fetchUser"}),Promise.reject(t)))):Promise.resolve()}logout(...t){return this.getStrategy().logout?Promise.resolve(this.getStrategy().logout(...t)).catch((t=>(this.callOnError(t,{method:"logout"}),Promise.reject(t)))):(this.reset(),Promise.resolve())}setUserToken(t,e){return this.getStrategy().setUserToken?Promise.resolve(this.getStrategy().setUserToken(t,e)).catch((t=>(this.callOnError(t,{method:"setUserToken"}),Promise.reject(t)))):(this.getStrategy().token.set(t),Promise.resolve())}reset(...t){return this.getStrategy().reset||(this.setUser(!1),this.getStrategy().token.reset(),this.getStrategy().refreshToken.reset()),this.getStrategy().reset(...t)}refreshTokens(){return this.getStrategy().refreshController?Promise.resolve(this.getStrategy().refreshController.handleRefresh()).catch((t=>(this.callOnError(t,{method:"refreshTokens"}),Promise.reject(t)))):Promise.resolve()}check(...t){return this.getStrategy().check?this.getStrategy().check(...t):{valid:!0}}fetchUserOnce(...t){return this.$state.user?Promise.resolve():this.fetchUser(...t)}setUser(t){this.$storage.setState("user",t);let e={valid:Boolean(t)};e.valid&&(e=this.check()),this.$storage.setState("loggedIn",e.valid)}request(t,e={}){const n="object"==typeof e?Object.assign({},e,t):t;if(""===n.baseURL&&(n.baseURL=r(this.ctx.req)),this.ctx.app.$axios)return this.ctx.app.$axios.request(n).catch((t=>(this.callOnError(t,{method:"request"}),Promise.reject(t))));console.error("[AUTH] add the @nuxtjs/axios module to nuxt.config file")}requestWith(t,e,n){const r=this.getStrategy().token.get(),o=Object.assign({},n,e),c=this.strategies[t].options.token.name||"Authorization";return o.headers||(o.headers={}),!o.headers[c]&&d(r)&&r&&"string"==typeof r&&(o.headers[c]=r),this.request(o)}wrapLogin(t){return this.$storage.setState("busy",!0),this.error=null,Promise.resolve(t).then((t=>(this.$storage.setState("busy",!1),t))).catch((t=>(this.$storage.setState("busy",!1),Promise.reject(t))))}onError(t){this._errorListeners.push(t)}callOnError(t,e={}){this.error=t;for(const n of this._errorListeners)n(t,e)}redirect(t,e=!1){if(!this.options.redirect)return;const n=this.options.fullPathRedirect?this.ctx.route.fullPath:this.ctx.route.path;let r=this.options.redirect[t];if(r){if(this.options.rewriteRedirects&&("login"===t&&v(n)&&!y(this.ctx,r,n)&&this.$storage.setUniversal("redirect",n),"home"===t)){const t=this.$storage.getUniversal("redirect");this.$storage.setUniversal("redirect",null),v(t)&&(r=t)}r=this.callOnRedirect(r,n)||r,y(this.ctx,r,n)||(e?(v(r)&&!r.includes(this.ctx.base)&&(r=w("/"+this.ctx.base+"/"+r)),window.location.replace(r)):this.ctx.redirect(r,this.ctx.query))}}onRedirect(t){this._redirectListeners.push(t)}callOnRedirect(t,e){for(const n of this._redirectListeners)t=n(t,e)||t;return t}hasScope(t){const e=this.$state.user&&S(this.$state.user,this.options.scopeKey);return!!e&&(Array.isArray(e)?e.includes(t):Boolean(S(e,t)))}}const x=async t=>{if(m(t.route,"auth",!1))return;const e=function(t,e=[]){return[].concat(...t.matched.map((function(t,n){return Object.keys(t.components).map((function(r){return e.push(n),t.components[r]}))})))}(t.route,[]);if(!e.length)return;const{login:n,callback:r}=t.$auth.options.redirect,o=m(t.route,"auth","guest"),c=e=>w(t.route.path,t)===w(e,t);if(t.$auth.$state.loggedIn){const{tokenExpired:e,refreshTokenExpired:r,isRefreshable:h}=t.$auth.check(!0);if((!n||c(n)||o)&&t.$auth.redirect("home"),r)t.$auth.reset();else if(e)if(h)try{await t.$auth.refreshTokens()}catch(e){t.$auth.reset()}else t.$auth.reset()}else o||r&&c(r)||t.$auth.redirect("login")};Error;class O extends Error{constructor(){super("Both token and refresh token have expired. Your request was aborted."),this.name="ExpiredAuthSessionError"}}var P,C;(C=P||(P={})).UNKNOWN="UNKNOWN",C.VALID="VALID",C.EXPIRED="EXPIRED";class R{constructor(t,e){this._status=this._calculate(t,e)}unknown(){return P.UNKNOWN===this._status}valid(){return P.VALID===this._status}expired(){return P.EXPIRED===this._status}_calculate(t,e){const n=Date.now();try{if(!t||!e)return P.UNKNOWN}catch(t){return P.UNKNOWN}return n<(e-=500)?P.VALID:P.EXPIRED}}class U{constructor(t,e){this.scheme=t,this.axios=e,this.interceptor=null}setHeader(t){this.scheme.options.token.global&&this.axios.setHeader(this.scheme.options.token.name,t)}clearHeader(){this.scheme.options.token.global&&this.axios.setHeader(this.scheme.options.token.name,!1)}initializeRequestInterceptor(t){this.interceptor=this.axios.interceptors.request.use((async e=>{if(!this._needToken(e)||e.url===t)return e;const{valid:n,tokenExpired:r,refreshTokenExpired:o,isRefreshable:c}=this.scheme.check(!0);let h=n;if(o)throw this.scheme.reset(),new O;if(r){if(!c)throw this.scheme.reset(),new O;h=await this.scheme.refreshTokens().then((()=>!0)).catch((()=>{throw this.scheme.reset(),new O}))}const f=this.scheme.token.get();if(!h){if(!f&&this._requestHasAuthorizationHeader(e))throw new O;return e}return this._getUpdatedRequestConfig(e,f)}))}reset(){this.axios.interceptors.request.eject(this.interceptor),this.interceptor=null}_needToken(t){const e=this.scheme.options;return e.token.global||Object.values(e.endpoints).some((e=>"object"==typeof e?e.url===t.url:e===t.url))}_getUpdatedRequestConfig(t,e){return"string"==typeof e&&(t.headers[this.scheme.options.token.name]=e),t}_requestHasAuthorizationHeader(t){return!!t.headers.common[this.scheme.options.token.name]}}class L{constructor(t,e){this.scheme=t,this.$storage=e}get(){const t=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.getUniversal(t)}set(t){const e=E(t,this.scheme.options.token.type);return this._setToken(e),this._updateExpiration(e),"string"==typeof e&&this.scheme.requestHandler.setHeader(e),e}sync(){const t=this._syncToken();return this._syncExpiration(),"string"==typeof t&&this.scheme.requestHandler.setHeader(t),t}reset(){this.scheme.requestHandler.clearHeader(),this._setToken(!1),this._setExpiration(!1)}status(){return new R(this.get(),this._getExpiration())}_getExpiration(){const t=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.getUniversal(t)}_setExpiration(t){const e=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.setUniversal(e,t)}_syncExpiration(){const t=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.syncUniversal(t)}_updateExpiration(t){let e;const n=Date.now(),r=1e3*Number(this.scheme.options.token.maxAge),o=r?n+r:0;try{e=1e3*f(t+"").exp||o}catch(t){if(e=o,!t||"InvalidTokenError"!==t.name)throw t}return this._setExpiration(e||!1)}_setToken(t){const e=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.setUniversal(e,t)}_syncToken(){const t=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.syncUniversal(t)}}class I{constructor(t,...e){this.$auth=t,this.options=e.reduce(((p,t)=>h(p,t)),{})}get name(){return this.options.name}}const j={name:"local",endpoints:{login:{url:"/api/auth/login",method:"post"},logout:{url:"/api/auth/logout",method:"post"},user:{url:"/api/auth/user",method:"get"}},token:{property:"token",type:"Bearer",name:"Authorization",maxAge:1800,global:!0,required:!0,prefix:"_token.",expirationPrefix:"_token_expiration."},user:{property:"user",autoFetch:!0},clientId:!1,grantType:!1,scope:!1};class M extends I{constructor(t,e,...n){super(t,e,...n,j),this.token=new L(this,this.$auth.$storage),this.requestHandler=new U(this,this.$auth.ctx.$axios)}check(t=!1){const e={valid:!1,tokenExpired:!1};if(!this.token.sync())return e;if(!t)return e.valid=!0,e;return this.token.status().expired()?(e.tokenExpired=!0,e):(e.valid=!0,e)}mounted({tokenCallback:t=(()=>this.$auth.reset()),refreshTokenCallback:e}={}){const{tokenExpired:n,refreshTokenExpired:r}=this.check(!0);return r&&"function"==typeof e?e():n&&"function"==typeof t&&t(),this.initializeRequestInterceptor(),this.$auth.fetchUserOnce()}async login(t,{reset:e=!0}={}){if(!this.options.endpoints.login)return;e&&this.$auth.reset({resetInterceptor:!1}),this.options.clientId&&(t.data.client_id=this.options.clientId),this.options.grantType&&(t.data.grant_type=this.options.grantType),this.options.scope&&(t.data.scope=this.options.scope);const n=await this.$auth.request(t,this.options.endpoints.login);return this.updateTokens(n),this.requestHandler.interceptor||this.initializeRequestInterceptor(),this.options.user.autoFetch&&await this.fetchUser(),n}setUserToken(t){return this.token.set(t),this.fetchUser()}fetchUser(t){return this.check().valid?this.options.endpoints.user?this.$auth.requestWith(this.name,t,this.options.endpoints.user).then((t=>{const e=S(t.data,this.options.user.property);if(!e){const t=new Error(`User Data response does not contain field ${this.options.user.property}`);return Promise.reject(t)}return this.$auth.setUser(e),t})).catch((t=>(this.$auth.callOnError(t,{method:"fetchUser"}),Promise.reject(t)))):(this.$auth.setUser({}),Promise.resolve()):Promise.resolve()}async logout(t={}){return this.options.endpoints.logout&&await this.$auth.requestWith(this.name,t,this.options.endpoints.logout).catch((()=>{})),this.$auth.reset()}reset({resetInterceptor:t=!0}={}){this.$auth.setUser(!1),this.token.reset(),t&&this.requestHandler.reset()}updateTokens(t){const e=!this.options.token.required||S(t.data,this.options.token.property);this.token.set(e)}initializeRequestInterceptor(){this.requestHandler.initializeRequestInterceptor()}}},41:function(t,e,n){"use strict";var r={name:"NoSsr",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(t,e){var n=e.parent,r=e.slots,o=e.props,c=r(),h=c.default;void 0===h&&(h=[]);var f=c.placeholder;return n._isMounted?h:(n.$once("hook:mounted",(function(){n.$forceUpdate()})),o.placeholderTag&&(o.placeholder||f)?t(o.placeholderTag,{class:["no-ssr-placeholder"]},o.placeholder||f):h.length>0?h.map((function(){return t(!1)})):t(!1))}};t.exports=r},55:function(t,e,n){"use strict";function r(t){this.message=t}r.prototype=new Error,r.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=e.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function c(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(o(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(e)}catch(t){return o(e)}}function h(t){this.message=t}function f(t,e){if("string"!=typeof t)throw new h("Invalid token specified");var n=!0===(e=e||{}).header?0:1;try{return JSON.parse(c(t.split(".")[n]))}catch(t){throw new h("Invalid token specified: "+t.message)}}h.prototype=new Error,h.prototype.name="InvalidTokenError";const a=f;a.default=f,a.InvalidTokenError=h,t.exports=a},69:function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},70:function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(e,"a",(function(){return r}))},71:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);ie.parts.length&&(n.parts.length=e.parts.length)}else{var o=[];for(r=0;r0?h.map((function(){return t(!1)})):t(!1))}};t.exports=r},94:function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}function o(t,e,n=".",c){if(!r(e))return o(t,{},n,c);const h=Object.assign({},e);for(const e in t){if("__proto__"===e||"constructor"===e)continue;const f=t[e];null!=f&&(c&&c(h,e,f,n)||(Array.isArray(f)&&Array.isArray(h[e])?h[e]=h[e].concat(f):r(f)&&r(h[e])?h[e]=o(f,h[e],(n?`${n}.`:"")+e.toString(),c):h[e]=f))}return h}function c(t){return(...e)=>e.reduce(((p,e)=>o(p,e,"",t)),{})}const h=c();h.fn=c(((t,e,n,r)=>{if(void 0!==t[e]&&"function"==typeof n)return t[e]=n(t[e]),!0})),h.arrayFn=c(((t,e,n,r)=>{if(Array.isArray(t[e])&&"function"==typeof n)return t[e]=n(t[e]),!0})),h.extend=c,t.exports=h},95:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(69);var o=n(71),c=n(70);function h(t){return Object(r.a)(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Object(o.a)(t)||Object(c.a)()}}}]);