1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,227573,t=>{"use strict";let e;var i=t.i(376194),r=t.i(722409),n=t.i(902632),o=t.i(226537),s=t.i(759),a=t.i(756477);let c=()=>{let{ravelinDeviceId:t,setRavelinDeviceId:e}=(0,r.useStore)(({payment:t})=>({ravelinDeviceId:t.ravelinDeviceId,setRavelinDeviceId:t.setRavelinDeviceId}));return(0,s.useEffect)(()=>{let i="publishable_key_live_Vr7SqPJLcqaAkC8vRQBB98B7ELrM1ttDEN6Tqd";i&&!t&&new a.default({key:i}).core.id().then(t=>{e(t)})},[t,e]),null},h="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),f=new Uint8Array(16),u=[];for(let t=0;t<256;++t)u.push((t+256).toString(16).slice(1));let p=function(t,i,r){if(h&&!i&&!t)return h();let n=(t=t||{}).random??t.rng?.()??function(){if(!e){if("u"<typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(f)}();if(n.length<16)throw Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,i){if((r=r||0)<0||r+16>i.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)i[r+t]=n[t];return i}return function(t,e=0){return(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase()}(n)},l=()=>{let{riskifiedSessionId:t,setRiskifiedSessionId:e}=(0,r.useStore)(({payment:t})=>({riskifiedSessionId:t.riskifiedSessionId,setRiskifiedSessionId:t.setRiskifiedSessionId}));return(0,s.useEffect)(()=>{t||e(p())},[t,e]),null},d=(0,o.default)(()=>t.A(703978).then(t=>t.RiskifiedBeacon),{loadableGenerated:{modules:[606751]},ssr:!1});t.s(["CheckoutExternalScripts",0,()=>{let t=(0,r.useStore)(t=>t.order.cartId);if(!(0,n.useHydrated)())return null;let e=new URLSearchParams(window.location.search).get("cartId");return e&&t!==e?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l,{}),(0,i.jsx)(d,{}),(0,i.jsx)(c,{})]})}],227573)},756477,(t,e,i)=>{t.e,e.exports=function(){"use strict";function t(t){this.domain=t.domain}function i(t,e,i){return(i=Array.prototype.slice.call(arguments,2),Function.prototype.bind)?Function.prototype.bind.apply(t,[e].concat(i)):function(){return t.apply(e,i.concat(Array.prototype.slice.call(arguments)))}}function r(){var t,e,i,r;if("u">typeof window&&window.crypto&&window.crypto.getRandomValues&&"u">typeof Int32Array){var n=new Int32Array(4);window.crypto.getRandomValues(n),t=n[0],e=n[1],i=n[2],r=n[3]}else t=0xffffffff*Math.random()|0,e=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0;if(!o){o=[];for(var s=0;s<256;s++)o[s]=(s<16?"0":"")+s.toString(16)}return o[255&t]+o[t>>8&255]+o[t>>16&255]+o[t>>24&255]+"-"+o[255&e]+o[e>>8&255]+"-"+o[e>>16&15|64]+o[e>>24&255]+"-"+o[63&i|128]+o[i>>8&255]+"-"+o[i>>16&255]+o[i>>24&255]+o[255&r]+o[r>>8&255]+o[r>>16&255]+o[r>>24&255]}function n(e){var i,r;this.Promise=e.Promise,this.version=e.version||"1.8.1-ravelinjs",this.key=e.key,this.api=e.api||function(t){if(!t||"publishable_key_"!=t.substr(0,16))return u;var e=t.substr(16).split("_");if(e.length<2)return u;var i=e[e.length-2];return"test"==i||"live"==i?u:"https://"+encodeURIComponent(i)+".ravelin.click"}(this.key),this.api=this.api[0]+this.api.substr(1).replace(/^\/+|\/$/g,""),this.sendRetryMs=e.sendRetryMs||150,this.cookie=e.cookie||"ravelinDeviceId",this.sessionCookie=e.sessionCookie||"ravelinSessionId",this.cookieExpiryDays=e.cookieExpiryDays||365,this.cookies=new t({domain:e.cookieDomain}),this.prefix="string"==typeof e.prefix?e.prefix:"rjs-",this._id=(i=this.Promise,(r=e.id)&&"function"==typeof r.then?r:new i(function(t){t(r)})),this.sync(),!1!==e.init&&this.attach(e.syncMs||2e3)}t.prototype.get=function(t){for(var e=document.cookie.split("; "),i=e.length-1;i>=0;i--){var r=e[i].split("=");if(r[0]===t)return r[1]}},t.prototype.set=function(t){var e,i=t.name+"="+t.value+";path="+(t.path||"/")+(t.expires?";expires="+t.expires.toUTCString():"")+(this.domain?";domain="+this.domain:"");if(void 0===this.samesite){if((e=window.navigator.userAgent,/\(iP.+; CPU .*OS 12[_\d]*.*\) AppleWebKit\//.test(e)||/\(Macintosh;.*Mac OS X 10_14[_\d]*.*\) AppleWebKit\//.test(e)&&(/^Mozilla\/[\.\d]+ \(Macintosh;
1.*Mac OS X [_\d]+\) AppleWebKit\/[\.\d]+ \(KHTML, like Gecko\)$/.test(e)||/Version\/.* Safari\//.test(e)&&!/Chrom(e|ium)/.test(e))||0)?this.samesite="":"https:"==window.location.protocol?this.samesite=";SameSite=None;Secure":this.samesite=";SameSite=Lax",document.cookie=i+this.samesite,this.get(t.name)==t.value)return;this.samesite=""}document.cookie=i+this.samesite},n.prototype.id=function(){return this.ids().then(function(t){return t.device})},n.prototype.ids=function(){if(this._ids)return this._ids;var t=this;return this._ids=this.sniffError(this._id).then(void 0,function(){}).then(function(e){var i=e||t.cookies.get(t.cookie),n=t.cookies.get(t.sessionCookie);if(!e&&n){var o,s,a=n.indexOf(":");-1!=a&&(i=n.substr(0,a)),i&&(o=n,s=i+":",o.substr(0,s.length)===s)&&(n=n.substr(i.length+1))}return{device:i||t.prefix+r(),session:n||r()}}),this._ids},n.prototype.sync=function(){var t=this;return this.ids().then(function(e){var i;t.cookieExpiryDays>0&&t.cookies.set({name:t.cookie,value:e.device,expires:(i=t.cookieExpiryDays,new Date(new Date().getTime()+86400*i*1e3))}),t.cookies.set({name:t.sessionCookie,value:e.device+":"+e.session})})},n.prototype.attach=function(t){setInterval(i(this.sync,this),t)};var o,s,a,c,h,f,u="https://live.ravelin.click",p="u">typeof XDomainRequest&&XDomainRequest;function l(t){if(Array.prototype.toJSON){var e=Array.prototype.toJSON;delete Array.prototype.toJSON;var i=JSON.stringify(t);return Array.prototype.toJSON=e,i}return JSON.stringify(t)}n.prototype.reportError=function(t){var e=this;if(this._ids)return this._ids.then(void 0,function(){}).then(i);return i();function i(i){return e.send("POST","z/err",{deviceId:i&&i.device,libVer:e.version,type:t.name,msg:t.message||t,error:t.stack}).then(function(){})}},n.prototype.sniffError=function(t){var e=this;try{var i="function"==typeof t?t():t;return i&&i.then&&i.then(void 0,function(t){e.reportError(t)}),i}catch(t){throw e.reportError(t),t}},n.prototype.bind=function(){var t=this,e=i.apply(null,Array.prototype.slice.call(arguments));return function(){var i=Array.prototype.slice.call(arguments);return t.sniffError(function(){return e.apply(null,i)})}},n.prototype.send=function(t,e,i){if(!this.key)throw Error("ravelin/core: no key set for API requests");var r,n,o,s,a,c=this.api+"/"+e.replace(/^\/+/,"");c+=(-1==c.indexOf("?")?"?":"&")+"key="+encodeURIComponent(this.key),c=c.replace(/^\/+/,"/");var h=this;return(r=h.Promise,n=function(e,r){var n;return!(!(n=c.match("(https?)?://([^/]+)"))||n[2]==window.location.host&&(""==n[1]||n[1]==window.location.protocol.replace(/:/,""))&&1)&&p?h._sendXDR(t,c,l(i)):h._sendXHR(t,c,l(i)).then(function(t){return(t.attempt=r,1223==t.status&&(t.status=204),t.status>=200&&t.status<300)?t:(400==t.status&&""==t.text||t.status>=500?e(t):t.status||e(t),new h.Promise(function(e,i){i(t)}))})},o=2,s=this.sendRetryMs,!o&&(o=2),a=0,new r(function(t,e){return function i(c){return new r(function(t){c?setTimeout(t,c):t()}).then(function(){return n(function(t){throw{message:"promise-retry",err:t}},++a)}).then(t,function(t){if(t&&"promise-retry"===t.message)return a-1<o?i(c+(s||150)):void e(t.err);e(t)})}(0)})).then(void 0,function(e){if(e.attempt)throw Error("ravelin/core: "+t+" "+c+" attempt "+e.attempt+" returned status "+e.status+(e.text?" and body "+e.text:""));throw e})},n.prototype._sendXHR=function(t,e,i){return new this.Promise(function(r){var n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&r({status:n.status,text:n.responseText})},n.open(t,e),n.send(i)})},n.prototype._sendXDR=function(t,e,i){return new this.Promise(function(r,n){var o=new p;o.onload=function(){r({status:o.status||200,text:o.responseText})},o.onerror=function(){n({status:o.status,text:o.responseText})},o.onprogress=function(){},o.open(t,e),setTimeout(function(){o.send(i)},0)})};var d=function(){function t(){this.i=0,this.j=0,this.S=[]}function e(){var t;t=new Date().getTime(),s[a++]^=255&t,s[a++]^=t>>8&255,s[a++]^=t>>16&255,s[a++]^=t>>24&255,a>=256&&(a-=256)}if(t.prototype.init=function(t){var e,i,r;for(e=0;e<256;++e)this.S[e]=e;for(e=0,i=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},null==s){if(s=[],a=0,"u">typeof window&&window.crypto&&window.crypto.getRandomValues){var i,r,n,o,s,a,c,h=new Uint8Array(32);for(window.crypto.getRandomValues(h),c=0;c<32;++c)s[a++]=h[c]}if("u">typeof navigator&&"Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto&&window.crypto.random){var f=window.crypto.random(32);for(c=0;c<f.length;++c)s[a++]=255&f.charCodeAt(c)}for(;a<256;)c=Math.floor(65536*Math.random()),s[a++]=c>>>8,s[a++]=255&c;a=0,e()}function u(){}
1function p(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function l(){return new p(null)}u.prototype.nextBytes=function(i){var r;for(r=0;r<i.length;++r)i[r]=function(){if(null==o){for(e(),(o=new t).init(s),a=0;a<s.length;++a)s[a]=0;a=0}return o.next()}()},"u">typeof navigator&&"Microsoft Internet Explorer"==navigator.appName?(p.prototype.am=function(t,e,i,r,n,o){for(var s=32767&e,a=e>>15;--o>=0;){var c=32767&this[t],h=this[t++]>>15,f=a*c+h*s;n=((c=s*c+((32767&f)<<15)+i[r]+(0x3fffffff&n))>>>30)+(f>>>15)+a*h+(n>>>30),i[r++]=0x3fffffff&c}return n},i=30):"u">typeof navigator&&"Netscape"!=navigator.appName?(p.prototype.am=function(t,e,i,r,n,o){for(;--o>=0;){var s=e*this[t++]+i[r]+n;n=Math.floor(s/0x4000000),i[r++]=0x3ffffff&s}return n},i=26):(p.prototype.am=function(t,e,i,r,n,o){for(var s=16383&e,a=e>>14;--o>=0;){var c=16383&this[t],h=this[t++]>>14,f=a*c+h*s;n=((c=s*c+((16383&f)<<14)+i[r]+n)>>28)+(f>>14)+a*h,i[r++]=0xfffffff&c}return n},i=28),p.prototype.DB=i,p.prototype.DM=(1<<i)-1,p.prototype.DV=1<<i,p.prototype.FV=0x10000000000000,p.prototype.F1=52-i,p.prototype.F2=2*i-52;var d=[];for(n=0,r=48;n<=9;++n)d[r++]=n;for(n=10,r=97;n<36;++n)d[r++]=n;for(n=10,r=65;n<36;++n)d[r++]=n;function m(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function y(t){var e=l();return e.fromInt(t),e}function v(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function g(t){this.m=t}function b(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function w(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return g.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},g.prototype.revert=function(t){return t},g.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},g.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},g.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},b.prototype.convert=function(t){var e=l();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(p.ZERO)>0&&this.m.subTo(e,e),e},b.prototype.revert=function(t){var e=l();return t.copyTo(e),this.reduce(e),e},b.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},b.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},b.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},p.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},p.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},p.prototype.fromString=function(t,e){if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var i,r=t.length,n=!1,o=0;--r>=0;){var s=8==i?255&t[r]:function(t,e){var i=d[t.charCodeAt(e)];return null==i?-1:i}(t,r);if(s<0){"-"==t.charAt(r)&&(n=!0);continue}n=!1,0==o?this[this.t++]=s:o+i>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=i)>=this.DB&&(o-=this.DB)}8==i&&(128&t[0])!=0&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&p.ZERO.subTo(this,this)},p.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},p.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},p.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s},p.prototype.lShiftTo=function(t,e){var i,r=t%this.DB,n=this.DB-r,o=(1<<n)-1,s=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(i=this.t-1;i>=0;--i)e[i+s+1]=this[i]>>n|a,a=(this[i]&o)<<r;for(i=s-1;i>=0;--i)e[i]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},p.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t){e.t=0;return}var r=t%this.DB,n=this.DB-r,o=(1<<r)-1;e[0]=this[i]>>r;
vendor: 1,853 bytes, line 1
1for(var s=i+1;s<this.t;++s)e[s-i-1]|=(this[s]&o)<<n,e[s-i]=this[s]>>r;r>0&&(e[this.t-i-1]|=(this.s&o)<<n),e.t=this.t-i,e.clamp()},p.prototype.subTo=function(t,e){for(var i=0,r=0,n=Math.min(t.t,this.t);i<n;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r-=t[i],e[i++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:r>0&&(e[i++]=r),e.t=i,e.clamp()},p.prototype.multiplyTo=function(t,e){var i=this.abs(),r=t.abs(),n=i.t;for(e.t=n+r.t;--n>=0;)e[n]=0;for(n=0;n<r.t;++n)e[n+i.t]=i.am(0,r[n],e,n,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&p.ZERO.subTo(e,e)},p.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var r=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},p.prototype.divRemTo=function(t,e,i){var r=t.abs();if(!(r.t<=0)){var n=this.abs();if(n.t<r.t){null!=e&&e.fromInt(0),null!=i&&this.copyTo(i);return}null==i&&(i=l());var o=l(),s=this.s,a=t.s,c=this.DB-v(r[r.t-1]);c>0?(r.lShiftTo(c,o),n.lShiftTo(c,i)):(r.copyTo(o),n.copyTo(i));var h=o.t,f=o[h-1];if(0!=f){var u=f*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),d=this.FV/u,m=(1<<this.F1)/u,y=1<<this.F2,g=i.t,b=g-h,w=null==e?l():e;for(o.dlShiftTo(b,w),i.compareTo(w)>=0&&(i[i.t++]=1,i.subTo(w,i)),p.ONE.dlShiftTo(h,w),w.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--b>=0;){var x=i[--g]==f?this.DM:Math.floor(i[g]*d+(i[g-1]+y)*m);if((i[g]+=o.am(0,x,i,b,0,h))<x)for(o.dlShiftTo(b,w),i.subTo(w,i);i[g]<--x;)i.subTo(w,i)}null!=e&&(i.drShiftTo(h,e),s!=a&&p.ZERO.subTo(e,e)),i.t=h,i.clamp(),c>0&&i.rShiftTo(c,i),s<0&&p.ZERO.subTo(i,i)}}},p.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if((1&t)==0)return 0;var e=3&t;
1return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},p.prototype.isEven=function(){return(this.t>0?1&this[0]:this.s)==0},p.prototype.exp=function(t,e){if(t>0xffffffff||t<1)return p.ONE;var i=l(),r=l(),n=e.convert(this),o=v(t)-1;for(n.copyTo(i);--o>=0;)if(e.sqrTo(i,r),(t&1<<o)>0)e.mulTo(r,n,i);else{var s=i;i=r,r=s}return e.revert(i)},p.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var e,i,r=(1<<e)-1,n=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(i=this[s]>>a)>0&&(n=!0,o=m(i));s>=0;)a<e?i=(this[s]&(1<<a)-1)<<e-a|this[--s]>>(a+=this.DB-e):(i=this[s]>>(a-=e)&r,a<=0&&(a+=this.DB,--s)),i>0&&(n=!0),n&&(o+=m(i));return n?o:"0"},p.prototype.negate=function(){var t=l();return p.ZERO.subTo(this,t),t},p.prototype.abs=function(){return this.s<0?this.negate():this},p.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0},p.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+v(this[this.t-1]^this.s&this.DM)},p.prototype.mod=function(t){var e=l();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(p.ZERO)>0&&t.subTo(e,e),e},p.prototype.modPowInt=function(t,e){var i;return i=t<256||e.isEven()?new g(e):new b(e),this.exp(t,i)},p.ZERO=y(0),p.ONE=y(1),w.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},w.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=new p(t,16),this.e=parseInt(e,16))},w.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)return null;for(var i=[],r=t.length-1;r>=0&&e>0;){var n=t.charCodeAt(r--);n<128?i[--e]=n:n>127&&n<2048?(i[--e]=63&n|128,i[--e]=n>>6|192):(i[--e]=63&n|128,i[--e]=n>>6&63|128,i[--e]=n>>12|224)}i[--e]=0;for(var o=new u,s=[];e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);i[--e]=s[0]}return i[--e]=2,i[--e]=0,new p(i)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var i=this.doPublic(e);if(null==i)return null;var r=i.toString(16);return(1&r.length)==0?r:"0"+r},w}(),m={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};function y(t,e,i){if(4!==e.length)throw new m.exception.invalid("invalid aes block size");var r=t.b[i],n=e[0]^r[0],o=e[i?3:1]^r[1],s=e[2]^r[2];e=e[i?1:3]^r[3];var a,c,h,f,u=r.length/4-2,p=4,l=[0,0,0,0];t=(a=t.s[i])[0];var d=a[1],y=a[2],v=a[3],g=a[4];for(f=0;f<u;f++)a=t[n>>>24]^d[o>>16&255]^y[s>>8&255]^v[255&e]^r[p],c=t[o>>>24]^d[s>>16&255]^y[e>>8&255]^v[255&n]^r[p+1],h=t[s>>>24]^d[e>>16&255]^y[n>>8&255]^v[255&o]^r[p+2],e=t[e>>>24]^d[n>>16&255]^y[o>>8&255]^v[255&s]^r[p+3],p+=4,n=a,o=c,s=h;for(f=0;4>f;f++)l[i?3&-f:f]=g[n>>>24]<<24^g[o>>16&255]<<16^g[s>>8&255]<<8^g[255&e]^r[p++],a=n,n=o,o=s,s=e,e=a;return l}function v(t,e){var i,r,n,o=t.F,s=t.b,a=o[0],c=o[1],h=o[2],f=o[3],u=o[4],p=o[5],l=o[6],d=o[7];for(i=0;64>i;i++)16>i?r=e[i]:(r=e[i+1&15],n=e[i+14&15],r=e[15&i]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+e[15&i]+e[i+9&15]|0),r=r+d+(u>>>6^u>>>11^u>>>25^u<<26^u<<21^u<<7)+(l^u&(p^l))+s[i],d=l,l=p,p=u,u=f+r|0,f=h,h=c,a=r+((c=a)&h^f&(c^h))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;o[0]=o[0]+a|0,o[1]=o[1]+c|0,o[2]=o[2]+h|0,o[3]=o[3]+f|0,o[4]=o[4]+u|0,o[5]=o[5]+p|0,o[6]=o[6]+l|0,o[7]=o[7]+d|0}function g(t,e){var i,r=m.random.K[t],n=[];for(i in r)r.hasOwnProperty(i)&&n.push(r[i]);for(i=0;i<n.length;i++)n[i](e)}function b(t,e){"u">typeof window&&window.performance&&"function"==typeof window.performance.now?t.addEntropy(window.performance.now(),e,"loadtime"):t.addEntropy((new Date).valueOf(),e,"loadtime")}function w(t){t.b=x(t).concat(x(t)),t.L=new m.cipher.aes(t.b)}function x(t){for(var e=0;4>e&&(t.h[e]=t.h[e]+1|0,!t.h[e]);e++);
1return t.L.encrypt(t.h)}function S(t,e){return function(){e.apply(t,arguments)}}m.cipher.aes=function(t){this.s[0][0][0]||this.O();var e,i,r,n,o=this.s[0][4],s=this.s[1];e=t.length;var a=1;if(4!==e&&6!==e&&8!==e)throw new m.exception.invalid("invalid aes key size");for(this.b=[r=t.slice(0),n=[]],t=e;t<4*e+28;t++)i=r[t-1],(0==t%e||8===e&&4==t%e)&&(i=o[i>>>24]<<24^o[i>>16&255]<<16^o[i>>8&255]<<8^o[255&i],0==t%e&&(i=i<<8^i>>>24^a<<24,a=a<<1^283*(a>>7))),r[t]=r[t-e]^i;for(e=0;t;e++,t--)i=r[3&e?t:t-4],n[e]=4>=t||4>e?i:s[0][o[i>>>24]]^s[1][o[i>>16&255]]^s[2][o[i>>8&255]]^s[3][o[255&i]]},m.cipher.aes.prototype={encrypt:function(t){return y(this,t,0)},decrypt:function(t){return y(this,t,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var t,e,i,r,n,o,s,a=this.s[0],c=this.s[1],h=a[4],f=c[4],u=[],p=[];for(t=0;256>t;t++)p[(u[t]=t<<1^283*(t>>7))^t]=t;for(e=i=0;!h[e];e^=r||1,i=p[i]||1)for(o=(o=i^i<<1^i<<2^i<<3^i<<4)>>8^255&o^99,h[e]=o,f[o]=e,s=0x1010101*(n=u[t=u[r=u[e]]])^65537*t^257*r^0x1010100*e,n=257*u[o]^0x1010100*o,t=0;4>t;t++)a[t][e]=n=n<<24^n>>>8,c[t][o]=s=s<<24^s>>>8;for(t=0;5>t;t++)a[t]=a[t].slice(0),c[t]=c[t].slice(0)}},m.bitArray={bitSlice:function(t,e,i){return t=m.bitArray.$(t.slice(e/32),32-(31&e)).slice(1),void 0===i?t:m.bitArray.clamp(t,i-e)},extract:function(t,e,i){var r=Math.floor(-e-i&31);return((e+i-1^e)&-32?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r)&(1<<i)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var i=t[t.length-1],r=m.bitArray.getPartial(i);return 32===r?t.concat(e):m.bitArray.$(e,r,0|i,t.slice(0,t.length-1))},bitLength:function(t){var e=t.length;return 0===e?0:32*(e-1)+m.bitArray.getPartial(t[e-1])},clamp:function(t,e){if(32*t.length<e)return t;var i=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,0<i&&e&&(t[i-1]=m.bitArray.partial(e,t[i-1]&0x80000000>>e-1,1)),t},partial:function(t,e,i){return 32===t?e:(i?0|e:e<<32-t)+0x10000000000*t},getPartial:function(t){return Math.round(t/0x10000000000)||32},equal:function(t,e){if(m.bitArray.bitLength(t)!==m.bitArray.bitLength(e))return!1;var i,r=0;for(i=0;i<t.length;i++)r|=t[i]^e[i];return 0===r},$:function(t,e,i,r){var n;for(n=0,void 0===r&&(r=[]);32<=e;e-=32)r.push(i),i=0;if(0===e)return r.concat(t);for(n=0;n<t.length;n++)r.push(i|t[n]>>>e),i=t[n]<<32-e;return n=t.length?t[t.length-1]:0,t=m.bitArray.getPartial(n),r.push(m.bitArray.partial(e+t&31,32<e+t?i:r.pop(),1)),r},i:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,i;for(e=0;e<t.length;++e)i=t[e],t[e]=i>>>24|i>>>8&65280|(65280&i)<<8|i<<24;return t}},m.codec.utf8String={fromBits:function(t){var e,i,r="",n=m.bitArray.bitLength(t);for(e=0;e<n/8;e++)0==(3&e)&&(i=t[e/4]),r+=String.fromCharCode(i>>>8>>>8>>>8),i<<=8;return decodeURIComponent(escape(r))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,i=[],r=0;for(e=0;e<t.length;e++)r=r<<8|t.charCodeAt(e),3==(3&e)&&(i.push(r),r=0);return 3&e&&i.push(m.bitArray.partial(8*(3&e),r)),i}},m.codec.hex={fromBits:function(t){var e,i="";for(e=0;e<t.length;e++)i+=((0|t[e])+0xf00000000000).toString(16).substr(4);return i.substr(0,m.bitArray.bitLength(t)/4)},toBits:function(t){var e,i,r=[];for(i=(t=t.replace(/\s|0x/g,"")).length,t+="00000000",e=0;e<t.length;e+=8)r.push(0^parseInt(t.substr(e,8),16));return m.bitArray.clamp(r,4*i)}},m.codec.base32={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",X:"0123456789ABCDEFGHIJKLMNOPQRSTUV",BITS:32,BASE:5,REMAINING:27,fromBits:function(t,e,i){var r=m.codec.base32.BASE,n=m.codec.base32.REMAINING,o="",s=0,a=m.codec.base32.B,c=0,h=m.bitArray.bitLength(t);for(i&&(a=m.codec.base32.X),i=0;o.length*r<h;)o+=a.charAt((c^t[i]>>>s)>>>n),s<r?(c=t[i]<<r-s,s+=n,i++):(c<<=r,s-=r);for(;7&o.length&&!e;)o+="=";return o},toBits:function(t,e){t=t.replace(/\s|=/g,"").toUpperCase();var i,r,n=m.codec.base32.BITS,o=m.codec.base32.BASE,s=m.codec.base32.REMAINING,a=[],c=0,h=m.codec.base32.B,f=0,u="base32";for(e&&(h=m.codec.base32.X,u="base32hex"),i=0;i<t.length;i++){if(0>(r=h.indexOf(t.charAt(i)))){if(!e)try{return m.codec.base32hex.toBits(t)}catch(t){}throw new m.exception.invalid("this isn't "+u+"!")}c>s?(c-=s,a.push(f^r>>>c),f=r<<n-c):(c+=o,f^=r<<n-c)}return 56&c&&a.push(m.bitArray.partial(56&c,f,1)),a}},m.codec.base32hex={fromBits:function(t,e){return m.codec.base32.fromBits(t,e,1)},toBits:function(t){return m.codec.base32.toBits(t,1)}},m.codec.base64={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",fromBits:function(t,e,i){var r="",n=0,o=m.codec.base64.B,s=0,a=m.bitArray.bitLength(t);for(i&&(o=o.substr(0,62)+"-_"),i=0;6*r.length<a;)r+=o.charAt((s^t[i]>>>n)>>>26),6>n?(s=t[i]<<6-n,n+=26,i++):(s<<=6,n-=6);for(;3&r.length&&!e;)r+="=";return r},toBits:function(t,e){t=t.replace(/\s|=/g,"");var i,r,n=[],o=0,s=m.codec.base64.B,a=0;for(e&&(s=s.substr(0,62)+"-_"),i=0;i<t.length;i++){if(0>(r=s.indexOf(t.charAt(i))))throw new m.exception.invalid("this isn't base64!");26<o?(o-=26,n.push(a^r>>>o),a=r<<32-o):(o+=6,a^=r<<32-o)}return 56&o&&n.push(m.bitArray.partial(56&o,a,1)),n}},m.codec.base64url={fromBits:function(t){return m.codec.base64.fromBits(t,1,1)},toBits:function(t){return m.codec.base64.toBits(t,1)}},m.hash.sha256=function(t){this.b[0]||this.O(),t?(this.F=t.F.slice(0),this.A=t.A.slice(0),this.l=t.l):this.reset()},m.hash.sha256.hash=function(t){return(new m.hash.sha256).update(t).finalize()},m.hash.sha256.prototype={blockSize:512,reset:function(){return this.F=this.Y.slice(0),this.A=[],this.l=0,this},update:function(t){"string"==typeof t&&(t=m.codec.utf8String.toBits(t));var e,i=this.A=m.bitArray.concat(this.A,t);if(e=this.l,0x1fffffffffffff<(t=this.l=e+m.bitArray.bitLength(t)))throw new m.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("u">typeof Uint32Array){var r=new Uint32Array(i),n=0;for(e=512+e-(512+e&511);e<=t;e+=512)v(this,r.subarray(16*n,16*(n+1))),n+=1;i.splice(0,16*n)}else for(e=512+e-(512+e&511);e<=t;e+=512)v(this,i.splice(0,16));return this},finalize:function(){var t,e=this.A,i=this.F,e=m.bitArray.concat(e,[m.bitArray.partial(1,1)]);for(t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this.l/0x100000000)),e.push(0|this.l);e.length;)v(this,e.splice(0,16));return this.reset(),i},Y:[],b:[],O:function(){function t(t){return 0x100000000*(t-Math.floor(t))|0}for(var e,i,r=0,n=2;64>r;n++){for(e=2,i=!0;e*e<=n;e++)if(0==n%e){i=!1;break}i&&(8>r&&(this.Y[r]=t(Math.pow(n,.5))),this.b[r]=t(Math.pow(n,1/3)),r++)}}},m.mode.ccm={name:"ccm",G:[],listenProgress:function(t){m.mode.ccm.G.push(t)},unListenProgress:function(t){-1<(t=m.mode.ccm.G.indexOf(t))&&m.mode.ccm.G.splice(t,1)},fa:function(t){var e,i=m.mode.ccm.G.slice();for(e=0;e<i.length;e+=1)i[e](t)},encrypt:function(t,e,i,r,n){var o,s=e.slice(0),a=m.bitArray,c=a.bitLength(i)/8,h=a.bitLength(s)/8;if(n=n||64,r=r||[],7>c)throw new m.exception.invalid("ccm: iv must be at least 7 bytes");for(o=2;4>o&&h>>>8*o;o++);return o<15-c&&(o=15-c),i=a.clamp(i,8*(15-o)),e=m.mode.ccm.V(t,e,i,r,n,o),s=m.mode.ccm.C(t,s,i,e,n,o),a.concat(s.data,s.tag)},decrypt:function(t,e,i,r,n){n=n||64,r=r||[];var o=m.bitArray,s=o.bitLength(i)/8,a=o.bitLength(e),c=o.clamp(e,a-n),h=o.bitSlice(e,a-n),a=(a-n)/8;if(7>s)throw new m.exception.invalid("ccm: iv must be at least 7 bytes");for(e=2;4>e&&a>>>8*e;e++);if(e<15-s&&(e=15-s),i=o.clamp(i,8*(15-e)),c=m.mode.ccm.C(t,c,i,h,n,e),t=m.mode.ccm.V(t,c.data,i,r,n,e),!o.equal(c.tag,t))throw new m.exception.corrupt("ccm: tag doesn't match");return c.data},na:function(t,e,i,r,n,o){var s=[],a=m.bitArray,c=a.i;if(r=[a.partial(8,64*!!e.length|r-2<<2|o-1)],r=a.concat(r,i),r[3]|=n,r=t.encrypt(r),e.length)for(65279>=(i=a.bitLength(e)/8)?s=[a.partial(16,i)]:0xffffffff>=i&&(s=a.concat([a.partial(16,65534)],[i])),s=a.concat(s,e),e=0;e<s.length;e+=4)r=t.encrypt(c(r,s.slice(e,e+4).concat([0,0,0])));return r},V:function(t,e,i,r,n,o){var s=m.bitArray,a=s.i;if((n/=8)%2||4>n||16<n)throw new m.exception.invalid("ccm: invalid tag length");if(0xffffffff<r.length||0xffffffff<e.length)throw new m.exception.bug("ccm: can't deal with 4GiB or more data");for(i=m.mode.ccm.na(t,r,i,n,s.bitLength(e)/8,o),r=0;r<e.length;r+=4)i=t.encrypt(a(i,e.slice(r,r+4).concat([0,0,0])));return s.clamp(i,8*n)},C:function(t,e,i,r,n,o){var s,a=m.bitArray;s=a.i;var c=e.length,h=a.bitLength(e),f=c/50,u=f;if(i=a.concat([a.partial(8,o-1)],i).concat([0,0,0]).slice(0,4),r=a.bitSlice(s(r,t.encrypt(i)),0,n),!c)return{tag:r,data:[]};for(s=0;s<c;s+=4)s>f&&(m.mode.ccm.fa(s/c),f+=u),i[3]++,n=t.encrypt(i),e[s]^=n[0],e[s+1]^=n[1],e[s+2]^=n[2],e[s+3]^=n[3];return{tag:r,data:a.clamp(e,h)}}}
1,m.mode.ocb2={name:"ocb2",encrypt:function(t,e,i,r,n,o){if(128!==m.bitArray.bitLength(i))throw new m.exception.invalid("ocb iv must be 128 bits");var s,a=m.mode.ocb2.S,c=m.bitArray,h=c.i,f=[0,0,0,0];i=a(t.encrypt(i));var u,p=[];for(s=0,r=r||[],n=n||64;s+4<e.length;s+=4)f=h(f,u=e.slice(s,s+4)),p=p.concat(h(i,t.encrypt(h(i,u)))),i=a(i);return u=e.slice(s),e=c.bitLength(u),s=t.encrypt(h(i,[0,0,0,e])),u=c.clamp(h(u.concat([0,0,0]),s),e),f=h(f,h(u.concat([0,0,0]),s)),f=t.encrypt(h(f,h(i,a(i)))),r.length&&(f=h(f,o?r:m.mode.ocb2.pmac(t,r))),p.concat(c.concat(u,c.clamp(f,n)))},decrypt:function(t,e,i,r,n,o){if(128!==m.bitArray.bitLength(i))throw new m.exception.invalid("ocb iv must be 128 bits");n=n||64;var s,a,c=m.mode.ocb2.S,h=m.bitArray,f=h.i,u=[0,0,0,0],p=c(t.encrypt(i)),l=m.bitArray.bitLength(e)-n,d=[];for(i=0,r=r||[];i+4<l/32;i+=4)s=f(p,t.decrypt(f(p,e.slice(i,i+4)))),u=f(u,s),d=d.concat(s),p=c(p);if(a=l-32*i,s=t.encrypt(f(p,[0,0,0,a])),s=f(s,h.clamp(e.slice(i),a).concat([0,0,0])),u=f(u,s),u=t.encrypt(f(u,f(p,c(p)))),r.length&&(u=f(u,o?r:m.mode.ocb2.pmac(t,r))),!h.equal(h.clamp(u,n),h.bitSlice(e,l)))throw new m.exception.corrupt("ocb: tag doesn't match");return d.concat(h.clamp(s,a))},pmac:function(t,e){var i,r=m.mode.ocb2.S,n=m.bitArray,o=n.i,s=[0,0,0,0],a=t.encrypt([0,0,0,0]),a=o(a,r(r(a)));for(i=0;i+4<e.length;i+=4)a=r(a),s=o(s,t.encrypt(o(a,e.slice(i,i+4))));return i=e.slice(i),128>n.bitLength(i)&&(a=o(a,r(a)),i=n.concat(i,[-0x80000000,0,0,0])),s=o(s,i),t.encrypt(o(r(o(a,r(a))),s))},S:function(t){return[t[0]<<1^t[1]>>>31,t[1]<<1^t[2]>>>31,t[2]<<1^t[3]>>>31,t[3]<<1^135*(t[0]>>>31)]}},m.mode.gcm={name:"gcm",encrypt:function(t,e,i,r,n){var o=e.slice(0);return e=m.bitArray,r=r||[],t=m.mode.gcm.C(!0,t,o,r,i,n||128),e.concat(t.data,t.tag)},decrypt:function(t,e,i,r,n){var o=e.slice(0),s=m.bitArray,a=s.bitLength(o);if(r=r||[],(n=n||128)<=a?(e=s.bitSlice(o,a-n),o=s.bitSlice(o,0,a-n)):(e=o,o=[]),t=m.mode.gcm.C(!1,t,o,r,i,n),!s.equal(t.tag,e))throw new m.exception.corrupt("gcm: tag doesn't match");return t.data},ka:function(t,e){var i,r,n,o,s,a=m.bitArray.i;for(n=[0,0,0,0],o=e.slice(0),i=0;128>i;i++){for((r=0!=(t[Math.floor(i/32)]&1<<31-i%32))&&(n=a(n,o)),s=0!=(1&o[3]),r=3;0<r;r--)o[r]=o[r]>>>1|(1&o[r-1])<<31;o[0]>>>=1,s&&(o[0]^=-0x1f000000)}return n},j:function(t,e,i){var r,n=i.length;for(e=e.slice(0),r=0;r<n;r+=4)e[0]^=i[r],e[1]^=i[r+1],e[2]^=i[r+2],e[3]^=i[r+3],e=m.mode.gcm.ka(e,t);return e},C:function(t,e,i,r,n,o){var s,a,c,h,f,u,p,l,d=m.bitArray;for(u=i.length,p=d.bitLength(i),l=d.bitLength(r),a=d.bitLength(n),s=e.encrypt([0,0,0,0]),96===a?(n=n.slice(0),n=d.concat(n,[1])):(n=m.mode.gcm.j(s,[0,0,0,0],n),n=m.mode.gcm.j(s,n,[0,0,Math.floor(a/0x100000000),0|a])),a=m.mode.gcm.j(s,[0,0,0,0],r),f=n.slice(0),r=a.slice(0),t||(r=m.mode.gcm.j(s,a,i)),h=0;h<u;h+=4)f[3]++,c=e.encrypt(f),i[h]^=c[0],i[h+1]^=c[1],i[h+2]^=c[2],i[h+3]^=c[3];return i=d.clamp(i,p),t&&(r=m.mode.gcm.j(s,a,i)),t=[Math.floor(l/0x100000000),0|l,Math.floor(p/0x100000000),0|p],r=m.mode.gcm.j(s,r,t),c=e.encrypt(n),r[0]^=c[0],r[1]^=c[1],r[2]^=c[2],r[3]^=c[3],{tag:d.bitSlice(r,0,o),data:i}}},m.misc.hmac=function(t,e){this.W=e=e||m.hash.sha256;var i,r=[[],[]],n=e.prototype.blockSize/32;for(this.w=[new e,new e],t.length>n&&(t=e.hash(t)),i=0;i<n;i++)r[0][i]=0x36363636^t[i],r[1][i]=0x5c5c5c5c^t[i];this.w[0].update(r[0]),this.w[1].update(r[1]),this.R=new e(this.w[0])},m.misc.hmac.prototype.encrypt=m.misc.hmac.prototype.mac=function(t){if(this.aa)throw new m.exception.invalid("encrypt on already updated hmac called!");return this.update(t),this.digest(t)},m.misc.hmac.prototype.reset=function(){this.R=new this.W(this.w[0]),this.aa=!1},m.misc.hmac.prototype.update=function(t){this.aa=!0,this.R.update(t)},m.misc.hmac.prototype.digest=function(){var t=this.R.finalize(),t=new this.W(this.w[1]).update(t).finalize();return this.reset(),t},m.misc.pbkdf2=function(t,e,i,r,n){if(i=i||1e4,0>r||0>i)throw new m.exception.invalid("invalid params to pbkdf2");"string"==typeof t&&(t=m.codec.utf8String.toBits(t)),"string"==typeof e&&(e=m.codec.utf8String.toBits(e)),t=new(n=n||m.misc.hmac)(t);var o,s,a,c,h=[],f=m.bitArray;for(c=1;32*h.length<(r||1);c++){for(n=o=t.encrypt(f.concat(e,[c])),s=1;s<i;s++)for(o=t.encrypt(o),a=0;a<o.length;a++)n[a]^=o[a];h=h.concat(n)}return r&&(h=f.clamp(h,r)),h},m.prng=function(t){this.c=[new m.hash.sha256],this.m=[0],this.P=0,this.H={},this.N=0,this.U={},this.Z=this.f=this.o=this.ha=0,this.b=[0,0,0,0,0,0,0,0],this.h=[0,0,0,0],this.L=void 0,this.M=t,this.D=!1,this.K={progress:{},seeded:{}},this.u=this.ga=0,this.I=1,this.J=2,this.ca=65536,this.T=[0,48,64,96,128,192,256,384,512,768,1024],this.da=3e4,this.ba=80},m.prng.prototype={randomWords:function(t,e){var i,r=[];if((i=this.isReady(e))===this.u)throw new m.exception.notReady("generator isn't seeded");if(i&this.J){i=!(i&this.I);var n,o=[],s=0;for(this.Z=o[0]=(new Date).valueOf()+this.da,n=0;16>n;n++)o.push(0x100000000*Math.random()|0);for(n=0;
1n<this.c.length&&(o=o.concat(this.c[n].finalize()),s+=this.m[n],this.m[n]=0,i||!(this.P&1<<n));n++);for(this.P>=1<<this.c.length&&(this.c.push(new m.hash.sha256),this.m.push(0)),this.f-=s,s>this.o&&(this.o=s),this.P++,this.b=m.hash.sha256.hash(this.b.concat(o)),this.L=new m.cipher.aes(this.b),i=0;4>i&&(this.h[i]=this.h[i]+1|0,!this.h[i]);i++);}for(i=0;i<t;i+=4)0==(i+1)%this.ca&&w(this),r.push((o=x(this))[0],o[1],o[2],o[3]);return w(this),r.slice(0,t)},setDefaultParanoia:function(t,e){if(0===t&&"Setting paranoia=0 will ruin your security; use it only for testing"!==e)throw new m.exception.invalid("Setting paranoia=0 will ruin your security; use it only for testing");this.M=t},addEntropy:function(t,e,i){i=i||"user";var r,n,o=(new Date).valueOf(),s=this.H[i],a=this.isReady(),c=0;switch(void 0===(r=this.U[i])&&(r=this.U[i]=this.ha++),void 0===s&&(s=this.H[i]=0),this.H[i]=(this.H[i]+1)%this.c.length,typeof t){case"number":void 0===e&&(e=1),this.c[s].update([r,this.N++,1,e,o,1,0|t]);break;case"object":if("[object Uint32Array]"===(i=Object.prototype.toString.call(t))){for(i=0,n=[];i<t.length;i++)n.push(t[i]);t=n}else for("[object Array]"!==i&&(c=1),i=0;i<t.length&&!c;i++)"number"!=typeof t[i]&&(c=1);if(!c){if(void 0===e)for(i=e=0;i<t.length;i++)for(n=t[i];0<n;)e++,n>>>=1;this.c[s].update([r,this.N++,2,e,o,t.length].concat(t))}break;case"string":void 0===e&&(e=t.length),this.c[s].update([r,this.N++,3,e,o,t.length]),this.c[s].update(t);break;default:c=1}if(c)throw new m.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[s]+=e,this.f+=e,a===this.u&&(this.isReady()!==this.u&&g("seeded",Math.max(this.o,this.f)),g("progress",this.getProgress()))},isReady:function(t){return t=this.T[void 0!==t?t:this.M],this.o&&this.o>=t?this.m[0]>this.ba&&(new Date).valueOf()>this.Z?this.J|this.I:this.I:this.f>=t?this.J|this.u:this.u},getProgress:function(t){return t=this.T[t||this.M],this.o>=t||this.f>t?1:this.f/t},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:S(this,this.ma),mouseCollector:S(this,this.oa),keyboardCollector:S(this,this.la),accelerometerCollector:S(this,this.ea),touchCollector:S(this,this.qa)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector);else throw new m.exception.bug("can't attach event");this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(t,e){this.K[t][this.ga++]=e},removeEventListener:function(t,e){var i,r,n=this.K[t],o=[];for(r in n)n.hasOwnProperty(r)&&n[r]===e&&o.push(r);for(i=0;i<o.length;i++)r=o[i],delete n[r]},la:function(){b(this,1)},oa:function(t){var e,i;try{e=t.x||t.clientX||t.offsetX||0,i=t.y||t.clientY||t.offsetY||0}catch(t){i=e=0}0!=e&&0!=i&&this.addEntropy([e,i],2,"mouse"),b(this,0)},qa:function(t){t=t.touches[0]||t.changedTouches[0],this.addEntropy([t.pageX||t.clientX,t.pageY||t.clientY],1,"touch"),b(this,0)},ma:function(){b(this,2)},ea:function(t){if(t=t.accelerationIncludingGravity.x||t.accelerationIncludingGravity.y||t.accelerationIncludingGravity.z,window.orientation){var e=window.orientation;"number"==typeof e&&this.addEntropy(e,1,"accelerometer")}t&&this.addEntropy(t,2,"accelerometer"),b(this,0)}},m.random=new m.prng(6);
1t:try{if(h=e.exports){try{f=__non_webpack_require__("crypto")}catch(t){f=null}h=a=f}if(h&&a.randomBytes)s=a.randomBytes(128),s=new Uint32Array(new Uint8Array(s).buffer),m.random.addEntropy(s,1024,"crypto['randomBytes']");else if("u">typeof window&&"u">typeof Uint32Array){if(c=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(c);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(c);else break t;m.random.addEntropy(c,1024,"crypto['getRandomValues']")}}catch(t){"u">typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(t))}function k(t,e){this.core=t,this.card=t.bind(this.card,this),e.rsaKey&&(this.key=B(e.rsaKey)),m.random.startCollectors()}function B(t){var e,i,r,n=t.split("|");if(n.length<2||n.length>3)throw Error("ravelin/encrypt: invalid rsaKey");2===n.length?(e=0,i=n[1],r=n[0]):(e=+n[0],i=n[2],r=n[1]);var o=new d;return o.setPublic(i,r),{key:o,index:e,sig:m.codec.hex.fromBits(m.hash.sha256.hash(t))}}function A(t){t.Promise=t.Promise||A.Promise,this.core=new n(t),this.encrypt=new k(this.core,t)}return m.json={defaults:{v:1,iter:1e4,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(t,e,i,r){i=i||{},r=r||{};var n,o=m.json,s=o.g({iv:m.random.randomWords(4,0)},o.defaults);if(o.g(s,i),i=s.adata,"string"==typeof s.salt&&(s.salt=m.codec.base64.toBits(s.salt)),"string"==typeof s.iv&&(s.iv=m.codec.base64.toBits(s.iv)),!m.mode[s.mode]||!m.cipher[s.cipher]||"string"==typeof t&&100>=s.iter||64!==s.ts&&96!==s.ts&&128!==s.ts||128!==s.ks&&192!==s.ks&&256!==s.ks||2>s.iv.length||4<s.iv.length)throw new m.exception.invalid("json encrypt: invalid parameters");return"string"==typeof t?(t=(n=m.misc.cachedPbkdf2(t,s)).key.slice(0,s.ks/32),s.salt=n.salt):m.ecc&&t instanceof m.ecc.elGamal.publicKey&&(s.kemtag=(n=t.kem()).tag,t=n.key.slice(0,s.ks/32)),"string"==typeof e&&(e=m.codec.utf8String.toBits(e)),"string"==typeof i&&(s.adata=i=m.codec.utf8String.toBits(i)),n=new m.cipher[s.cipher](t),o.g(r,s),r.key=t,s.ct="ccm"===s.mode&&m.arrayBuffer&&m.arrayBuffer.ccm&&e instanceof ArrayBuffer?m.arrayBuffer.ccm.encrypt(n,e,s.iv,i,s.ts):m.mode[s.mode].encrypt(n,e,s.iv,i,s.ts),s},encrypt:function(t,e,i,r){var n=m.json,o=n.ja.apply(n,arguments);return n.encode(o)},ia:function(t,e,i,r){i=i||{},r=r||{};var n,o,s=m.json;if(n=(e=s.g(s.g(s.g({},s.defaults),e),i,!0)).adata,"string"==typeof e.salt&&(e.salt=m.codec.base64.toBits(e.salt)),"string"==typeof e.iv&&(e.iv=m.codec.base64.toBits(e.iv)),!m.mode[e.mode]||!m.cipher[e.cipher]||"string"==typeof t&&100>=e.iter||64!==e.ts&&96!==e.ts&&128!==e.ts||128!==e.ks&&192!==e.ks&&256!==e.ks||!e.iv||2>e.iv.length||4<e.iv.length)throw new m.exception.invalid("json decrypt: invalid parameters");return"string"==typeof t?(t=(o=m.misc.cachedPbkdf2(t,e)).key.slice(0,e.ks/32),e.salt=o.salt):m.ecc&&t instanceof m.ecc.elGamal.secretKey&&(t=t.unkem(m.codec.base64.toBits(e.kemtag)).slice(0,e.ks/32)),"string"==typeof n&&(n=m.codec.utf8String.toBits(n)),o=new m.cipher[e.cipher](t),n="ccm"===e.mode&&m.arrayBuffer&&m.arrayBuffer.ccm&&e.ct instanceof ArrayBuffer?m.arrayBuffer.ccm.decrypt(o,e.ct,e.iv,e.tag,n,e.ts):m.mode[e.mode].decrypt(o,e.ct,e.iv,n,e.ts),s.g(r,e),r.key=t,1===i.raw?n:m.codec.utf8String.fromBits(n)},decrypt:function(t,e,i,r){var n=m.json;return n.ia(t,n.decode(e),i,r)},encode:function(t){var e,i="{",r="";for(e in t)if(t.hasOwnProperty(e)){if(!e.match(/^[a-z0-9]+$/i))throw new m.exception.invalid("json encode: invalid property name");switch(i+=r+'"'+e+'":',r=",",typeof t[e]){case"number":case"boolean":i+=t[e];break;case"string":i+='"'+escape(t[e])+'"';break;case"object":i+='"'+m.codec.base64.fromBits(t[e],0)+'"';break;default:throw new m.exception.bug("json encode: unsupported type")}}return i+"}"},decode:function(t){if(!(t=t.replace(/\s/g,"")).match(/^\{.*\}$/))throw new m.exception.invalid("json decode: this isn't json!");t=t.replace(/^\{|\}$/g,"").split(/,/);var e,i,r={};for(e=0;e<t.length;e++){if(!(i=t[e].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i)))throw new m.exception.invalid("json decode: this isn't json!");
1null!=i[3]?r[i[2]]=parseInt(i[3],10):null!=i[4]?r[i[2]]=i[2].match(/^(ct|adata|salt|iv)$/)?m.codec.base64.toBits(i[4]):unescape(i[4]):null!=i[5]&&(r[i[2]]="true"===i[5])}return r},g:function(t,e,i){if(void 0===t&&(t={}),void 0===e)return t;for(var r in e)if(e.hasOwnProperty(r)){if(i&&void 0!==t[r]&&t[r]!==e[r])throw new m.exception.invalid("required parameter overridden");t[r]=e[r]}return t},sa:function(t,e){var i,r={};for(i in t)t.hasOwnProperty(i)&&t[i]!==e[i]&&(r[i]=t[i]);return r},ra:function(t,e){var i,r={};for(i=0;i<e.length;i++)void 0!==t[e[i]]&&(r[e[i]]=t[e[i]]);return r}},m.encrypt=m.json.encrypt,m.decrypt=m.json.decrypt,m.misc.pa={},m.misc.cachedPbkdf2=function(t,e){var i,r=m.misc.pa;return i=(e=e||{}).iter||1e3,i=(r=r[t]=r[t]||{})[i]=r[i]||{firstSalt:e.salt&&e.salt.length?e.salt.slice(0):m.random.randomWords(2,0)},r=void 0===e.salt?i.firstSalt:e.salt,i[r]=i[r]||m.misc.pbkdf2(t,r,e.iter),{key:i[r].slice(0),salt:r.slice(0)}},k.prototype.card=function(t){if(!t)throw Error("ravelin/encrypt: card is required");for(var e in t)if(t.hasOwnProperty(e))switch(e){case"rsaKey":case"pan":case"year":case"month":case"nameOnCard":continue;default:throw Error("ravelin/encrypt: unrecognised property "+e)}var i,r,n,o,s,a,c,h,f,u,p,l,d=this.key;if(t.rsaKey){if("string"!=typeof t.rsaKey)throw Error("ravelin/encrypt: card.rsaKey should be a string");d=B(t.rsaKey)}if(!d)throw Error("ravelin/encrypt: no rsaKey provided");if(t.pan&&(t.pan=t.pan.toString().replace(/[^0-9]/g,"")),!t.pan||t.pan.length<12)throw Error("ravelin/encrypt: card.pan should have at least 12 digits");if("string"==typeof t.month&&(t.month=parseInt(t.month,10)),!(t.month>0&&t.month<13))throw Error("ravelin/encrypt: card.month should be in the range 1-12");if("string"==typeof t.year&&(t.year=parseInt(t.year,10)),t.year>0&&t.year<100&&(t.year+=2e3),!t.year||t.year<=2e3)throw Error("ravelin/encrypt: card.year should be in the 21st century");try{i=JSON.stringify({pan:t.pan,year:t.year.toString(),month:t.month.toString(),nameOnCard:t.nameOnCard}),r=m.random.randomWords(8,4),n=m.random.randomWords(8,4),o=new m.cipher.aes(r),s=m.codec.utf8String.toBits(i),a=m.mode.gcm.encrypt(o,s,n,null,128),l={ciphertextB64:m.codec.base64.fromBits(a),aesKeyB64:m.codec.base64.fromBits(r),ivB64:m.codec.base64.fromBits(n)}}catch(t){if(-1!==t.toString().indexOf("generator"))throw Error("ravelin/encrypt: generator not ready")}var y=(c=d.key,h=l.aesKeyB64,f=l.ivB64,u=c.encrypt(h+"|"+f),p=m.codec.hex.toBits(u),m.codec.base64.fromBits(p));return{methodType:"paymentMethodCipher",cardCiphertext:l.ciphertextB64,aesKeyCiphertext:y,algorithm:"RSA_WITH_AES_256_GCM",ravelinSDKVersion:this.core.version,keyIndex:d.index,keySignature:d.sig}},A.Promise="u">typeof Promise&&Promise,A}()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.