@paystack/checkout-js 1.30.0 → 1.31.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout.js +3 -3
- package/es/checkout.js +3 -3
- package/lib/checkout.js +3 -3
- package/package.json +2 -2
package/lib/checkout.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math==Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},i=function(t){try{return!!t()}catch(t){return!0}},a=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=o,c=Function.prototype.call,u=s?c.bind(c):function(){return c.apply(c,arguments)},h={},l={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,p=d&&!l.call({1:2},1);h.f=p?function(t){var e=d(this,t);return!!e&&e.enumerable}:l;var f,g,m=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y=o,v=Function.prototype,b=v.bind,T=v.call,S=y&&b.bind(T,T),w=y?function(t){return t&&S(t)}:function(t){return t&&function(){return T.apply(t,arguments)}},A=w,E=A({}.toString),C=A("".slice),k=function(t){return C(E(t),8,-1)},x=w,O=i,B=k,D=r.Object,P=x("".split),R=O((function(){return!D("z").propertyIsEnumerable(0)}))?function(t){return"String"==B(t)?P(t,""):D(t)}:D,I=r.TypeError,L=function(t){if(null==t)throw I("Can't call method on "+t);return t},N=R,M=L,V=function(t){return N(M(t))},_=function(t){return"function"==typeof t},j=_,U=function(t){return"object"==typeof t?null!==t:j(t)},F=r,q=_,z=function(t,e){return arguments.length<2?(r=F[t],q(r)?r:void 0):F[t]&&F[t][e];var r},H=w({}.isPrototypeOf),$=r,G=z("navigator","userAgent")||"",K=$.process,W=$.Deno,X=K&&K.versions||W&&W.version,Z=X&&X.v8;Z&&(g=(f=Z.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!g&&G&&(!(f=G.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=G.match(/Chrome\/(\d+)/))&&(g=+f[1]);var J=g,Y=i,Q=!!Object.getOwnPropertySymbols&&!Y((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41})),tt=Q&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,et=z,rt=_,nt=H,it=tt,at=r.Object,ot=it?function(t){return"symbol"==typeof t}:function(t){var e=et("Symbol");return rt(e)&&nt(e.prototype,at(t))},st=r.String,ct=_,ut=function(t){try{return st(t)}catch(t){return"Object"}},ht=r.TypeError,lt=function(t){if(ct(t))return t;throw ht(ut(t)+" is not a function")},dt=u,pt=_,ft=U,gt=r.TypeError,mt={exports:{}},yt=r,vt=Object.defineProperty,bt=function(t,e){try{vt(yt,t,{value:e,configurable:!0,writable:!0})}catch(r){yt[t]=e}return e},Tt=bt,St="__core-js_shared__",wt=r[St]||Tt(St,{}),At=wt;(mt.exports=function(t,e){return At[t]||(At[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Et=L,Ct=r.Object,kt=function(t){return Ct(Et(t))},xt=w({}.hasOwnProperty),Ot=Object.hasOwn||function(t,e){return xt(kt(t),e)},Bt=w,Dt=0,Pt=Math.random(),Rt=Bt(1..toString),It=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Rt(++Dt+Pt,36)},Lt=r,Nt=mt.exports,Mt=Ot,Vt=It,_t=Q,jt=tt,Ut=Nt("wks"),Ft=Lt.Symbol,qt=Ft&&Ft.for,zt=jt?Ft:Ft&&Ft.withoutSetter||Vt,Ht=function(t){if(!Mt(Ut,t)||!_t&&"string"!=typeof Ut[t]){var e="Symbol."+t;_t&&Mt(Ft,t)?Ut[t]=Ft[t]:Ut[t]=jt&&qt?qt(e):zt(e)}return Ut[t]},$t=u,Gt=U,Kt=ot,Wt=function(t,e){var r=t[e];return null==r?void 0:lt(r)},Xt=function(t,e){var r,n;if("string"===e&&pt(r=t.toString)&&!ft(n=dt(r,t)))return n;if(pt(r=t.valueOf)&&!ft(n=dt(r,t)))return n;if("string"!==e&&pt(r=t.toString)&&!ft(n=dt(r,t)))return n;throw gt("Can't convert object to primitive value")},Zt=Ht,Jt=r.TypeError,Yt=Zt("toPrimitive"),Qt=function(t,e){if(!Gt(t)||Kt(t))return t;var r,n=Wt(t,Yt);if(n){if(void 0===e&&(e="default"),r=$t(n,t,e),!Gt(r)||Kt(r))return r;throw Jt("Can't convert object to primitive value")}return void 0===e&&(e="number"),Xt(t,e)},te=ot,ee=function(t){var e=Qt(t,"string");return te(e)?e:e+""},re=U,ne=r.document,ie=re(ne)&&re(ne.createElement),ae=function(t){return ie?ne.createElement(t):{}},oe=!a&&!i((function(){return 7!=Object.defineProperty(ae("div"),"a",{get:function(){return 7}}).a})),se=a,ce=u,ue=h,he=m,le=V,de=ee,pe=Ot,fe=oe,ge=Object.getOwnPropertyDescriptor;n.f=se?ge:function(t,e){if(t=le(t),e=de(e),fe)try{return ge(t,e)}catch(t){}if(pe(t,e))return he(!ce(ue.f,t,e),t[e])};var me={},ye=a&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),ve=r,be=U,Te=ve.String,Se=ve.TypeError,we=function(t){if(be(t))return t;throw Se(Te(t)+" is not an object")},Ae=a,Ee=oe,Ce=ye,ke=we,xe=ee,Oe=r.TypeError,Be=Object.defineProperty,De=Object.getOwnPropertyDescriptor,Pe="enumerable",Re="configurable",Ie="writable";me.f=Ae?Ce?function(t,e,r){if(ke(t),e=xe(e),ke(r),"function"==typeof t&&"prototype"===e&&"value"in r&&Ie in r&&!r[Ie]){var n=De(t,e);n&&n[Ie]&&(t[e]=r.value,r={configurable:Re in r?r[Re]:n[Re],enumerable:Pe in r?r[Pe]:n[Pe],writable:!1})}return Be(t,e,r)}:Be:function(t,e,r){if(ke(t),e=xe(e),ke(r),Ee)try{return Be(t,e,r)}catch(t){}if("get"in r||"set"in r)throw Oe("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Le=me,Ne=m,Me=a?function(t,e,r){return Le.f(t,e,Ne(1,r))}:function(t,e,r){return t[e]=r,t},Ve={exports:{}},_e=_,je=wt,Ue=w(Function.toString);_e(je.inspectSource)||(je.inspectSource=function(t){return Ue(t)});var Fe,qe,ze,He=je.inspectSource,$e=_,Ge=He,Ke=r.WeakMap,We=$e(Ke)&&/native code/.test(Ge(Ke)),Xe=mt.exports,Ze=It,Je=Xe("keys"),Ye={},Qe=We,tr=r,er=w,rr=U,nr=Me,ir=Ot,ar=wt,or=function(t){return Je[t]||(Je[t]=Ze(t))},sr=Ye,cr="Object already initialized",ur=tr.TypeError,hr=tr.WeakMap;if(Qe||ar.state){var lr=ar.state||(ar.state=new hr),dr=er(lr.get),pr=er(lr.has),fr=er(lr.set);Fe=function(t,e){if(pr(lr,t))throw new ur(cr);return e.facade=t,fr(lr,t,e),e},qe=function(t){return dr(lr,t)||{}},ze=function(t){return pr(lr,t)}}else{var gr=or("state");sr[gr]=!0,Fe=function(t,e){if(ir(t,gr))throw new ur(cr);return e.facade=t,nr(t,gr,e),e},qe=function(t){return ir(t,gr)?t[gr]:{}},ze=function(t){return ir(t,gr)}}var mr={set:Fe,get:qe,has:ze,enforce:function(t){return ze(t)?qe(t):Fe(t,{})},getterFor:function(t){return function(e){var r;if(!rr(e)||(r=qe(e)).type!==t)throw ur("Incompatible receiver, "+t+" required");return r}}},yr=a,vr=Ot,br=Function.prototype,Tr=yr&&Object.getOwnPropertyDescriptor,Sr=vr(br,"name"),wr=Sr&&"something"===function(){}.name,Ar=Sr&&(!yr||yr&&Tr(br,"name").configurable),Er=r,Cr=_,kr=Ot,xr=Me,Or=bt,Br=He,Dr={EXISTS:Sr,PROPER:wr,CONFIGURABLE:Ar}.CONFIGURABLE,Pr=mr.get,Rr=mr.enforce,Ir=String(String).split("String");(Ve.exports=function(t,e,r,n){var i,a=!!n&&!!n.unsafe,o=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:e;Cr(r)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!kr(r,"name")||Dr&&r.name!==c)&&xr(r,"name",c),(i=Rr(r)).source||(i.source=Ir.join("string"==typeof c?c:""))),t!==Er?(a?!s&&t[e]&&(o=!0):delete t[e],o?t[e]=r:xr(t,e,r)):o?t[e]=r:Or(e,r)})(Function.prototype,"toString",(function(){return Cr(this)&&Pr(this).source||Br(this)}));var Lr={},Nr=Math.ceil,Mr=Math.floor,Vr=function(t){var e=+t;return e!=e||0===e?0:(e>0?Mr:Nr)(e)},_r=Vr,jr=Math.max,Ur=Math.min,Fr=Vr,qr=Math.min,zr=function(t){return t>0?qr(Fr(t),9007199254740991):0},Hr=V,$r=function(t,e){var r=_r(t);return r<0?jr(r+e,0):Ur(r,e)},Gr=function(t){return zr(t.length)},Kr=function(t){return function(e,r,n){var i,a=Hr(e),o=Gr(a),s=$r(n,o);if(t&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}},Wr={includes:Kr(!0),indexOf:Kr(!1)},Xr=Ot,Zr=V,Jr=Wr.indexOf,Yr=Ye,Qr=w([].push),tn=function(t,e){var r,n=Zr(t),i=0,a=[];for(r in n)!Xr(Yr,r)&&Xr(n,r)&&Qr(a,r);for(;e.length>i;)Xr(n,r=e[i++])&&(~Jr(a,r)||Qr(a,r));return a},en=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Lr.f=Object.getOwnPropertyNames||function(t){return tn(t,en)};var rn={};rn.f=Object.getOwnPropertySymbols;var nn=z,an=Lr,on=rn,sn=we,cn=w([].concat),un=nn("Reflect","ownKeys")||function(t){var e=an.f(sn(t)),r=on.f;return r?cn(e,r(t)):e},hn=Ot,ln=un,dn=n,pn=me,fn=function(t,e,r){for(var n=ln(e),i=pn.f,a=dn.f,o=0;o<n.length;o++){var s=n[o];hn(t,s)||r&&hn(r,s)||i(t,s,a(e,s))}},gn=i,mn=_,yn=/#|\.prototype\./,vn=function(t,e){var r=Tn[bn(t)];return r==wn||r!=Sn&&(mn(e)?gn(e):!!e)},bn=vn.normalize=function(t){return String(t).replace(yn,".").toLowerCase()},Tn=vn.data={},Sn=vn.NATIVE="N",wn=vn.POLYFILL="P",An=vn,En=r,Cn=n.f,kn=Me,xn=Ve.exports,On=bt,Bn=fn,Dn=An,Pn=o,Rn=Function.prototype,In=Rn.apply,Ln=Rn.call,Nn="object"==typeof Reflect&&Reflect.apply||(Pn?Ln.bind(In):function(){return Ln.apply(In,arguments)}),Mn=r,Vn=_,_n=Mn.String,jn=Mn.TypeError,Un=w,Fn=we,qn=function(t){if("object"==typeof t||Vn(t))return t;throw jn("Can't set "+_n(t)+" as a prototype")},zn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Un(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Fn(r),qn(n),e?t(r,n):r.__proto__=n,r}}():void 0),Hn=_,$n=U,Gn=zn,Kn={};Kn[Ht("toStringTag")]="z";var Wn=r,Xn="[object z]"===String(Kn),Zn=_,Jn=k,Yn=Ht("toStringTag"),Qn=Wn.Object,ti="Arguments"==Jn(function(){return arguments}()),ei=Xn?Jn:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Qn(t),Yn))?r:ti?Jn(e):"Object"==(n=Jn(e))&&Zn(e.callee)?"Arguments":n},ri=r.String,ni=function(t){if("Symbol"===ei(t))throw TypeError("Cannot convert a Symbol value to a string");return ri(t)},ii=U,ai=Me,oi=w("".replace),si=String(Error("zxcasd").stack),ci=/\n\s*at [^:]*:[^\n]*/,ui=ci.test(si),hi=m,li=!i((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",hi(1,7)),7!==t.stack)})),di=z,pi=Ot,fi=Me,gi=H,mi=zn,yi=fn,vi=function(t,e,r){var n,i;return Gn&&Hn(n=e.constructor)&&n!==r&&$n(i=n.prototype)&&i!==r.prototype&&Gn(t,i),t},bi=function(t,e){return void 0===t?arguments.length<2?"":e:ni(t)},Ti=function(t,e){ii(e)&&"cause"in e&&ai(t,"cause",e.cause)},Si=function(t,e){if(ui&&"string"==typeof t)for(;e--;)t=oi(t,ci,"");return t},wi=li,Ai=function(t,e){var r,n,i,a,o,s=t.target,c=t.global,u=t.stat;if(r=c?En:u?En[s]||On(s,{}):(En[s]||{}).prototype)for(n in e){if(a=e[n],i=t.noTargetGet?(o=Cn(r,n))&&o.value:r[n],!Dn(c?n:s+(u?".":"#")+n,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;Bn(a,i)}(t.sham||i&&i.sham)&&kn(a,"sham",!0),xn(r,n,a,t)}},Ei=Nn,Ci=function(t,e,r,n){var i=n?2:1,a=t.split("."),o=a[a.length-1],s=di.apply(null,a);if(s){var c=s.prototype;if(pi(c,"cause")&&delete c.cause,!r)return s;var u=di("Error"),h=e((function(t,e){var r=bi(n?e:t,void 0),a=n?new s(t):new s;return void 0!==r&&fi(a,"message",r),wi&&fi(a,"stack",Si(a.stack,2)),this&&gi(c,this)&&vi(a,this,h),arguments.length>i&&Ti(a,arguments[i]),a}));h.prototype=c,"Error"!==o&&(mi?mi(h,u):yi(h,u,{name:!0})),yi(h,s);try{c.name!==o&&fi(c,"name",o),c.constructor=h}catch(t){}return h}},ki="WebAssembly",xi=r[ki],Oi=7!==Error("e",{cause:7}).cause,Bi=function(t,e){var r={};r[t]=Ci(t,e,Oi),Ai({global:!0,forced:Oi},r)},Di=function(t,e){if(xi&&xi[t]){var r={};r[t]=Ci(ki+"."+t,e,Oi),Ai({target:ki,stat:!0,forced:Oi},r)}};Bi("Error",(function(t){return function(e){return Ei(t,this,arguments)}})),Bi("EvalError",(function(t){return function(e){return Ei(t,this,arguments)}})),Bi("RangeError",(function(t){return function(e){return Ei(t,this,arguments)}})),Bi("ReferenceError",(function(t){return function(e){return Ei(t,this,arguments)}})),Bi("SyntaxError",(function(t){return function(e){return Ei(t,this,arguments)}})),Bi("TypeError",(function(t){return function(e){return Ei(t,this,arguments)}})),Bi("URIError",(function(t){return function(e){return Ei(t,this,arguments)}})),Di("CompileError",(function(t){return function(e){return Ei(t,this,arguments)}})),Di("LinkError",(function(t){return function(e){return Ei(t,this,arguments)}})),Di("RuntimeError",(function(t){return function(e){return Ei(t,this,arguments)}}));class Pi extends Error{constructor(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];super(...r),Error.captureStackTrace&&Error.captureStackTrace(this,Pi),this.errors=t}}function Ri(t){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)}function Ii(t){return parseInt(t,10)===Number(t)&&Number(t)>=0}function Li(t){return t&&"string"==typeof t}const Ni={ref:{required:!1,isValid:Li},key:{required:!0,isValid:function(t){return t&&"pk"===t.substring(0,2)}},email:{required:!0,fallback:"customer_code",isValid:Ri},customer_code:{required:!1,isValid:Li},amount:{required:!0,fallback:"plan",isValid:Ii},plan:{required:!1,isValid:Li},transaction_charge:{required:!1,isValid:Ii},bearer:{required:!1,isValid:Li},channels:{required:!1,isValid:function(t){return t instanceof Array}},currency:{required:!1,isValid:Li},firstname:{required:!1,isValid:Li},lastname:{required:!1,isValid:Li},phone:{required:!1,isValid:Li},remark:{required:!1,isValid:Li},payment_page:{required:!1,isValid:Ii},payment_request:{required:!1,isValid:Li},quantity:{required:!1,isValid:Li},coupon:{required:!1,isValid:Li},start_date:{required:!1,isValid:Li},interval:{required:!1,isValid:Li},invoice_limit:{required:!1,isValid:Ii},subaccount:{required:!1,isValid:Li},hash:{required:!1,isValid:Li},metadata:{required:!1,isValid:Li},transaction_type:{required:!1,isValid:Li},subscription:{required:!1,isValid:Ii}};var Mi,Vi,_i,ji={exports:{}};Vi=t,_i=function(){var t=function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]+e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]+e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]+e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]+e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},e=function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]*e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]*e[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=t[3]*e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]*e[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[2]*e[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[3]*e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]*e[3]+t[1]*e[2]+t[2]*e[1]+t[3]*e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},r=function(t,e){return 32==(e%=64)?[t[1],t[0]]:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e|t[0]>>>32-e]:(e-=32,[t[1]<<e|t[0]>>>32-e,t[0]<<e|t[1]>>>32-e])},n=function(t,e){return 0==(e%=64)?t:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e]:[t[1]<<e-32,0]},i=function(t,e){return[t[0]^e[0],t[1]^e[1]]},a=function(t){return t=i(t,[0,t[0]>>>1]),t=e(t,[4283543511,3981806797]),t=i(t,[0,t[0]>>>1]),t=e(t,[3301882366,444984403]),t=i(t,[0,t[0]>>>1])},o=function(o,s){s=s||0;for(var c=(o=o||"").length%16,u=o.length-c,h=[0,s],l=[0,s],d=[0,0],p=[0,0],f=[2277735313,289559509],g=[1291169091,658871167],m=0;m<u;m+=16)d=[255&o.charCodeAt(m+4)|(255&o.charCodeAt(m+5))<<8|(255&o.charCodeAt(m+6))<<16|(255&o.charCodeAt(m+7))<<24,255&o.charCodeAt(m)|(255&o.charCodeAt(m+1))<<8|(255&o.charCodeAt(m+2))<<16|(255&o.charCodeAt(m+3))<<24],p=[255&o.charCodeAt(m+12)|(255&o.charCodeAt(m+13))<<8|(255&o.charCodeAt(m+14))<<16|(255&o.charCodeAt(m+15))<<24,255&o.charCodeAt(m+8)|(255&o.charCodeAt(m+9))<<8|(255&o.charCodeAt(m+10))<<16|(255&o.charCodeAt(m+11))<<24],d=e(d,f),d=r(d,31),d=e(d,g),h=i(h,d),h=r(h,27),h=t(h,l),h=t(e(h,[0,5]),[0,1390208809]),p=e(p,g),p=r(p,33),p=e(p,f),l=i(l,p),l=r(l,31),l=t(l,h),l=t(e(l,[0,5]),[0,944331445]);switch(d=[0,0],p=[0,0],c){case 15:p=i(p,n([0,o.charCodeAt(m+14)],48));case 14:p=i(p,n([0,o.charCodeAt(m+13)],40));case 13:p=i(p,n([0,o.charCodeAt(m+12)],32));case 12:p=i(p,n([0,o.charCodeAt(m+11)],24));case 11:p=i(p,n([0,o.charCodeAt(m+10)],16));case 10:p=i(p,n([0,o.charCodeAt(m+9)],8));case 9:p=i(p,[0,o.charCodeAt(m+8)]),p=e(p,g),p=r(p,33),p=e(p,f),l=i(l,p);case 8:d=i(d,n([0,o.charCodeAt(m+7)],56));case 7:d=i(d,n([0,o.charCodeAt(m+6)],48));case 6:d=i(d,n([0,o.charCodeAt(m+5)],40));case 5:d=i(d,n([0,o.charCodeAt(m+4)],32));case 4:d=i(d,n([0,o.charCodeAt(m+3)],24));case 3:d=i(d,n([0,o.charCodeAt(m+2)],16));case 2:d=i(d,n([0,o.charCodeAt(m+1)],8));case 1:d=i(d,[0,o.charCodeAt(m)]),d=e(d,f),d=r(d,31),d=e(d,g),h=i(h,d)}return h=i(h,[0,o.length]),l=i(l,[0,o.length]),h=t(h,l),l=t(l,h),h=a(h),l=a(l),h=t(h,l),l=t(l,h),("00000000"+(h[0]>>>0).toString(16)).slice(-8)+("00000000"+(h[1]>>>0).toString(16)).slice(-8)+("00000000"+(l[0]>>>0).toString(16)).slice(-8)+("00000000"+(l[1]>>>0).toString(16)).slice(-8)},s={preprocessor:null,audio:{timeout:1e3,excludeIOS11:!0},fonts:{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",userDefinedFonts:[],extendedJsFonts:!1},screen:{detectScreenOrientation:!0},plugins:{sortPluginsFor:[/palemoon/i],excludeIE:!1},extraComponents:[],excludes:{enumerateDevices:!0,pixelRatio:!0,doNotTrack:!0,fontsFlash:!0},NOT_AVAILABLE:"not available",ERROR:"error",EXCLUDED:"excluded"},c=function(t,e){if(Array.prototype.forEach&&t.forEach===Array.prototype.forEach)t.forEach(e);else if(t.length===+t.length)for(var r=0,n=t.length;r<n;r++)e(t[r],r,t);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},u=function(t,e){var r=[];return null==t?r:Array.prototype.map&&t.map===Array.prototype.map?t.map(e):(c(t,(function(t,n,i){r.push(e(t,n,i))})),r)},h=function(){return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices},l=function(t){var e=[window.screen.width,window.screen.height];return t.screen.detectScreenOrientation&&e.sort().reverse(),e},d=function(t){if(window.screen.availWidth&&window.screen.availHeight){var e=[window.screen.availHeight,window.screen.availWidth];return t.screen.detectScreenOrientation&&e.sort().reverse(),e}return t.NOT_AVAILABLE},p=function(t){if(null==navigator.plugins)return t.NOT_AVAILABLE;for(var e=[],r=0,n=navigator.plugins.length;r<n;r++)navigator.plugins[r]&&e.push(navigator.plugins[r]);return g(t)&&(e=e.sort((function(t,e){return t.name>e.name?1:t.name<e.name?-1:0}))),u(e,(function(t){var e=u(t,(function(t){return[t.type,t.suffixes]}));return[t.name,t.description,e]}))},f=function(t){var e=[];return Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window?e=u(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],(function(e){try{return new window.ActiveXObject(e),e}catch(e){return t.ERROR}})):e.push(t.NOT_AVAILABLE),navigator.plugins&&(e=e.concat(p(t))),e},g=function(t){for(var e=!1,r=0,n=t.plugins.sortPluginsFor.length;r<n;r++){var i=t.plugins.sortPluginsFor[r];if(navigator.userAgent.match(i)){e=!0;break}}return e},m=function(t){try{return!!window.sessionStorage}catch(e){return t.ERROR}},y=function(t){try{return!!window.localStorage}catch(e){return t.ERROR}},v=function(t){try{return!!window.indexedDB}catch(e){return t.ERROR}},b=function(t){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:t.NOT_AVAILABLE},T=function(t){return navigator.cpuClass||t.NOT_AVAILABLE},S=function(t){return navigator.platform?navigator.platform:t.NOT_AVAILABLE},w=function(t){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:window.doNotTrack?window.doNotTrack:t.NOT_AVAILABLE},A=function(){var t,e=0;void 0!==navigator.maxTouchPoints?e=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(e=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){t=!1}return[e,t,"ontouchstart"in window]},E=function(t){var e=[],r=document.createElement("canvas");r.width=2e3,r.height=200,r.style.display="inline";var n=r.getContext("2d");return n.rect(0,0,10,10),n.rect(2,2,6,6),e.push("canvas winding:"+(!1===n.isPointInPath(5,5,"evenodd")?"yes":"no")),n.textBaseline="alphabetic",n.fillStyle="#f60",n.fillRect(125,1,62,20),n.fillStyle="#069",t.dontUseFakeFontInCanvas?n.font="11pt Arial":n.font="11pt no-real-font-123",n.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),n.fillStyle="rgba(102, 204, 0, 0.2)",n.font="18pt Arial",n.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),n.globalCompositeOperation="multiply",n.fillStyle="rgb(255,0,255)",n.beginPath(),n.arc(50,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(0,255,255)",n.beginPath(),n.arc(100,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,255,0)",n.beginPath(),n.arc(75,100,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,0,255)",n.arc(75,75,75,0,2*Math.PI,!0),n.arc(75,75,25,0,2*Math.PI,!0),n.fill("evenodd"),r.toDataURL&&e.push("canvas fp:"+r.toDataURL()),e},C=function(){var t,e=function(e){return t.clearColor(0,0,0,1),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),"["+e[0]+", "+e[1]+"]"};if(!(t=_()))return null;var r=[],n=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,n);var i=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW),n.itemSize=3,n.numItems=3;var a=t.createProgram(),o=t.createShader(t.VERTEX_SHADER);t.shaderSource(o,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),t.compileShader(o);var s=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(s,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),t.compileShader(s),t.attachShader(a,o),t.attachShader(a,s),t.linkProgram(a),t.useProgram(a),a.vertexPosAttrib=t.getAttribLocation(a,"attrVertex"),a.offsetUniform=t.getUniformLocation(a,"uniformOffset"),t.enableVertexAttribArray(a.vertexPosArray),t.vertexAttribPointer(a.vertexPosAttrib,n.itemSize,t.FLOAT,!1,0,0),t.uniform2f(a.offsetUniform,1,1),t.drawArrays(t.TRIANGLE_STRIP,0,n.numItems);try{r.push(t.canvas.toDataURL())}catch(t){}r.push("extensions:"+(t.getSupportedExtensions()||[]).join(";")),r.push("webgl aliased line width range:"+e(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE))),r.push("webgl aliased point size range:"+e(t.getParameter(t.ALIASED_POINT_SIZE_RANGE))),r.push("webgl alpha bits:"+t.getParameter(t.ALPHA_BITS)),r.push("webgl antialiasing:"+(t.getContextAttributes().antialias?"yes":"no")),r.push("webgl blue bits:"+t.getParameter(t.BLUE_BITS)),r.push("webgl depth bits:"+t.getParameter(t.DEPTH_BITS)),r.push("webgl green bits:"+t.getParameter(t.GREEN_BITS)),r.push("webgl max anisotropy:"+function(t){var e=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic");if(e){var r=t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT);return 0===r&&(r=2),r}return null}(t)),r.push("webgl max combined texture image units:"+t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),r.push("webgl max cube map texture size:"+t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)),r.push("webgl max fragment uniform vectors:"+t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS)),r.push("webgl max render buffer size:"+t.getParameter(t.MAX_RENDERBUFFER_SIZE)),r.push("webgl max texture image units:"+t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)),r.push("webgl max texture size:"+t.getParameter(t.MAX_TEXTURE_SIZE)),r.push("webgl max varying vectors:"+t.getParameter(t.MAX_VARYING_VECTORS)),r.push("webgl max vertex attribs:"+t.getParameter(t.MAX_VERTEX_ATTRIBS)),r.push("webgl max vertex texture image units:"+t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),r.push("webgl max vertex uniform vectors:"+t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS)),r.push("webgl max viewport dims:"+e(t.getParameter(t.MAX_VIEWPORT_DIMS))),r.push("webgl red bits:"+t.getParameter(t.RED_BITS)),r.push("webgl renderer:"+t.getParameter(t.RENDERER)),r.push("webgl shading language version:"+t.getParameter(t.SHADING_LANGUAGE_VERSION)),r.push("webgl stencil bits:"+t.getParameter(t.STENCIL_BITS)),r.push("webgl vendor:"+t.getParameter(t.VENDOR)),r.push("webgl version:"+t.getParameter(t.VERSION));try{var u=t.getExtension("WEBGL_debug_renderer_info");u&&(r.push("webgl unmasked vendor:"+t.getParameter(u.UNMASKED_VENDOR_WEBGL)),r.push("webgl unmasked renderer:"+t.getParameter(u.UNMASKED_RENDERER_WEBGL)))}catch(t){}return t.getShaderPrecisionFormat?(c(["FLOAT","INT"],(function(e){c(["VERTEX","FRAGMENT"],(function(n){c(["HIGH","MEDIUM","LOW"],(function(i){c(["precision","rangeMin","rangeMax"],(function(a){var o=t.getShaderPrecisionFormat(t[n+"_SHADER"],t[i+"_"+e])[a];"precision"!==a&&(a="precision "+a);var s=["webgl ",n.toLowerCase()," shader ",i.toLowerCase()," ",e.toLowerCase()," ",a,":",o].join("");r.push(s)}))}))}))})),r):r},k=function(){try{var t=_(),e=t.getExtension("WEBGL_debug_renderer_info");return t.getParameter(e.UNMASKED_VENDOR_WEBGL)+"~"+t.getParameter(e.UNMASKED_RENDERER_WEBGL)}catch(t){return null}},x=function(){var t=document.createElement("div");t.innerHTML=" ",t.className="adsbox";var e=!1;try{document.body.appendChild(t),e=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(t)}catch(t){e=!1}return e},O=function(){if(void 0!==navigator.languages)try{if(navigator.languages[0].substr(0,2)!==navigator.language.substr(0,2))return!0}catch(t){return!0}return!1},B=function(){return window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight},D=function(){var t,e=navigator.userAgent.toLowerCase(),r=navigator.oscpu,n=navigator.platform.toLowerCase();if(t=e.indexOf("windows phone")>=0?"Windows Phone":e.indexOf("win")>=0?"Windows":e.indexOf("android")>=0?"Android":e.indexOf("linux")>=0?"Linux":e.indexOf("iphone")>=0||e.indexOf("ipad")>=0?"iOS":e.indexOf("mac")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows Phone"!==t&&"Android"!==t&&"iOS"!==t&&"Other"!==t)return!0;if(void 0!==r){if((r=r.toLowerCase()).indexOf("win")>=0&&"Windows"!==t&&"Windows Phone"!==t)return!0;if(r.indexOf("linux")>=0&&"Linux"!==t&&"Android"!==t)return!0;if(r.indexOf("mac")>=0&&"Mac"!==t&&"iOS"!==t)return!0;if((-1===r.indexOf("win")&&-1===r.indexOf("linux")&&-1===r.indexOf("mac"))!=("Other"===t))return!0}return n.indexOf("win")>=0&&"Windows"!==t&&"Windows Phone"!==t||(n.indexOf("linux")>=0||n.indexOf("android")>=0||n.indexOf("pike")>=0)&&"Linux"!==t&&"Android"!==t||(n.indexOf("mac")>=0||n.indexOf("ipad")>=0||n.indexOf("ipod")>=0||n.indexOf("iphone")>=0)&&"Mac"!==t&&"iOS"!==t||(-1===n.indexOf("win")&&-1===n.indexOf("linux")&&-1===n.indexOf("mac"))!=("Other"===t)||void 0===navigator.plugins&&"Windows"!==t&&"Windows Phone"!==t},P=function(){var t,e=navigator.userAgent.toLowerCase(),r=navigator.productSub;if(("Chrome"==(t=e.indexOf("firefox")>=0?"Firefox":e.indexOf("opera")>=0||e.indexOf("opr")>=0?"Opera":e.indexOf("chrome")>=0?"Chrome":e.indexOf("safari")>=0?"Safari":e.indexOf("trident")>=0?"Internet Explorer":"Other")||"Safari"===t||"Opera"===t)&&"20030107"!==r)return!0;var n,i=eval.toString().length;if(37===i&&"Safari"!==t&&"Firefox"!==t&&"Other"!==t)return!0;if(39===i&&"Internet Explorer"!==t&&"Other"!==t)return!0;if(33===i&&"Chrome"!==t&&"Opera"!==t&&"Other"!==t)return!0;try{throw"a"}catch(t){try{t.toSource(),n=!0}catch(t){n=!1}}return n&&"Firefox"!==t&&"Other"!==t},R=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},I=function(){if(!R())return!1;var t=_();return!!window.WebGLRenderingContext&&!!t},L=function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},N=function(){return void 0!==window.swfobject},M=function(){return window.swfobject.hasFlashPlayerVersion("9.0.0")},V=function(t,e){var r="___fp_swf_loaded";window[r]=function(e){t(e)};var n=e.fonts.swfContainerId;!function(t){var e=document.createElement("div");e.setAttribute("id",t.fonts.swfContainerId),document.body.appendChild(e)}();var i={onReady:r};window.swfobject.embedSWF(e.fonts.swfPath,n,"1","1","9.0.0",!1,i,{allowScriptAccess:"always",menu:"false"},{})},_=function(){var t=document.createElement("canvas"),e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return e||(e=null),e},j=[{key:"userAgent",getData:function(t){t(navigator.userAgent)}},{key:"language",getData:function(t,e){t(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||e.NOT_AVAILABLE)}},{key:"colorDepth",getData:function(t,e){t(window.screen.colorDepth||e.NOT_AVAILABLE)}},{key:"deviceMemory",getData:function(t,e){t(navigator.deviceMemory||e.NOT_AVAILABLE)}},{key:"pixelRatio",getData:function(t,e){t(window.devicePixelRatio||e.NOT_AVAILABLE)}},{key:"hardwareConcurrency",getData:function(t,e){t(b(e))}},{key:"screenResolution",getData:function(t,e){t(l(e))}},{key:"availableScreenResolution",getData:function(t,e){t(d(e))}},{key:"timezoneOffset",getData:function(t){t((new Date).getTimezoneOffset())}},{key:"timezone",getData:function(t,e){window.Intl&&window.Intl.DateTimeFormat?t((new window.Intl.DateTimeFormat).resolvedOptions().timeZone):t(e.NOT_AVAILABLE)}},{key:"sessionStorage",getData:function(t,e){t(m(e))}},{key:"localStorage",getData:function(t,e){t(y(e))}},{key:"indexedDb",getData:function(t,e){t(v(e))}},{key:"addBehavior",getData:function(t){t(!(!document.body||!document.body.addBehavior))}},{key:"openDatabase",getData:function(t){t(!!window.openDatabase)}},{key:"cpuClass",getData:function(t,e){t(T(e))}},{key:"platform",getData:function(t,e){t(S(e))}},{key:"doNotTrack",getData:function(t,e){t(w(e))}},{key:"plugins",getData:function(t,e){L()?e.plugins.excludeIE?t(e.EXCLUDED):t(f(e)):t(p(e))}},{key:"canvas",getData:function(t,e){R()?t(E(e)):t(e.NOT_AVAILABLE)}},{key:"webgl",getData:function(t,e){I()?t(C()):t(e.NOT_AVAILABLE)}},{key:"webglVendorAndRenderer",getData:function(t){I()?t(k()):t()}},{key:"adBlock",getData:function(t){t(x())}},{key:"hasLiedLanguages",getData:function(t){t(O())}},{key:"hasLiedResolution",getData:function(t){t(B())}},{key:"hasLiedOs",getData:function(t){t(D())}},{key:"hasLiedBrowser",getData:function(t){t(P())}},{key:"touchSupport",getData:function(t){t(A())}},{key:"fonts",getData:function(t,e){var r=["monospace","sans-serif","serif"],n=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];e.fonts.extendedJsFonts&&(n=n.concat(["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"])),n=(n=n.concat(e.fonts.userDefinedFonts)).filter((function(t,e){return n.indexOf(t)===e}));var i=document.getElementsByTagName("body")[0],a=document.createElement("div"),o=document.createElement("div"),s={},c={},u=function(){var t=document.createElement("span");return t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="72px",t.style.fontStyle="normal",t.style.fontWeight="normal",t.style.letterSpacing="normal",t.style.lineBreak="auto",t.style.lineHeight="normal",t.style.textTransform="none",t.style.textAlign="left",t.style.textDecoration="none",t.style.textShadow="none",t.style.whiteSpace="normal",t.style.wordBreak="normal",t.style.wordSpacing="normal",t.innerHTML="mmmmmmmmmmlli",t},h=function(t,e){var r=u();return r.style.fontFamily="'"+t+"',"+e,r},l=function(t){for(var e=!1,n=0;n<r.length;n++)if(e=t[n].offsetWidth!==s[r[n]]||t[n].offsetHeight!==c[r[n]])return e;return e},d=function(){for(var t=[],e=0,n=r.length;e<n;e++){var i=u();i.style.fontFamily=r[e],a.appendChild(i),t.push(i)}return t}();i.appendChild(a);for(var p=0,f=r.length;p<f;p++)s[r[p]]=d[p].offsetWidth,c[r[p]]=d[p].offsetHeight;var g=function(){for(var t={},e=0,i=n.length;e<i;e++){for(var a=[],s=0,c=r.length;s<c;s++){var u=h(n[e],r[s]);o.appendChild(u),a.push(u)}t[n[e]]=a}return t}();i.appendChild(o);for(var m=[],y=0,v=n.length;y<v;y++)l(g[n[y]])&&m.push(n[y]);i.removeChild(o),i.removeChild(a),t(m)},pauseBefore:!0},{key:"fontsFlash",getData:function(t,e){return N()?M()?e.fonts.swfPath?void V((function(e){t(e)}),e):t("missing options.fonts.swfPath"):t("flash not installed"):t("swf object not loaded")},pauseBefore:!0},{key:"audio",getData:function(t,e){var r=e.audio;if(r.excludeIOS11&&navigator.userAgent.match(/OS 11.+Version\/11.+Safari/))return t(e.EXCLUDED);var n=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(null==n)return t(e.NOT_AVAILABLE);var i=new n(1,44100,44100),a=i.createOscillator();a.type="triangle",a.frequency.setValueAtTime(1e4,i.currentTime);var o=i.createDynamicsCompressor();c([["threshold",-50],["knee",40],["ratio",12],["reduction",-20],["attack",0],["release",.25]],(function(t){void 0!==o[t[0]]&&"function"==typeof o[t[0]].setValueAtTime&&o[t[0]].setValueAtTime(t[1],i.currentTime)})),a.connect(o),o.connect(i.destination),a.start(0),i.startRendering();var s=setTimeout((function(){return console.warn('Audio fingerprint timed out. Please report bug at https://github.com/Valve/fingerprintjs2 with your user agent: "'+navigator.userAgent+'".'),i.oncomplete=function(){},i=null,t("audioTimeout")}),r.timeout);i.oncomplete=function(e){var r;try{clearTimeout(s),r=e.renderedBuffer.getChannelData(0).slice(4500,5e3).reduce((function(t,e){return t+Math.abs(e)}),0).toString(),a.disconnect(),o.disconnect()}catch(e){return void t(e)}t(r)}}},{key:"enumerateDevices",getData:function(t,e){if(!h())return t(e.NOT_AVAILABLE);navigator.mediaDevices.enumerateDevices().then((function(e){t(e.map((function(t){return"id="+t.deviceId+";gid="+t.groupId+";"+t.kind+";"+t.label})))})).catch((function(e){t(e)}))}}],U=function(t){throw new Error("'new Fingerprint()' is deprecated, see https://github.com/Valve/fingerprintjs2#upgrade-guide-from-182-to-200")};return U.get=function(t,e){e?t||(t={}):(e=t,t={}),function(t,e){if(null==e)return t;var r,n;for(n in e)null==(r=e[n])||Object.prototype.hasOwnProperty.call(t,n)||(t[n]=r)}(t,s),t.components=t.extraComponents.concat(j);var r={data:[],addPreprocessedComponent:function(e,n){"function"==typeof t.preprocessor&&(n=t.preprocessor(e,n)),r.data.push({key:e,value:n})}},n=-1,i=function(a){if((n+=1)>=t.components.length)e(r.data);else{var o=t.components[n];if(t.excludes[o.key])i(!1);else{if(!a&&o.pauseBefore)return n-=1,void setTimeout((function(){i(!0)}),1);try{o.getData((function(t){r.addPreprocessedComponent(o.key,t),i(!1)}),t)}catch(t){r.addPreprocessedComponent(o.key,String(t)),i(!1)}}}};i(!1)},U.getPromise=function(t){return new Promise((function(e,r){U.get(t,e)}))},U.getV18=function(t,e){return null==e&&(e=t,t={}),U.get(t,(function(r){for(var n=[],i=0;i<r.length;i++){var a=r[i];if(a.value===(t.NOT_AVAILABLE||"not available"))n.push({key:a.key,value:"unknown"});else if("plugins"===a.key)n.push({key:"plugins",value:u(a.value,(function(t){var e=u(t[2],(function(t){return t.join?t.join("~"):t})).join(",");return[t[0],t[1],e].join("::")}))});else if(-1!==["canvas","webgl"].indexOf(a.key))n.push({key:a.key,value:a.value.join("~")});else if(-1!==["sessionStorage","localStorage","indexedDb","addBehavior","openDatabase"].indexOf(a.key)){if(!a.value)continue;n.push({key:a.key,value:1})}else a.value?n.push(a.value.join?{key:a.key,value:a.value.join(";")}:a):n.push({key:a.key,value:a.value})}var s=o(u(n,(function(t){return t.value})).join("~~~"),31);e(s,n)}))},U.x64hash128=o,U.VERSION="2.0.0",U},(Mi=ji).exports?Mi.exports=_i():Vi.exports?Vi.exports=_i():Vi.Fingerprint2=_i();var Ui=ji.exports;const Fi=t=>{(console?console.log:()=>{})(t)},qi=async()=>{let t;try{window&&(await function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;return new Promise((e=>{setTimeout(e,t)}))}(550),t=await(async()=>{try{const t=await Ui.getPromise();if(t&&Array.isArray(t)){const e=t.filter((t=>"not available"!==t.value)).sort(((t,e)=>t.key>e.key?1:t.key<e.key?-1:0)).map((t=>t.value)),r=e&&e.join(""),n=31;return Ui.x64hash128(r,n)}Fi("Device ID could not be calculated")}catch(t){Fi(t)}return null})())}catch(t){Fi("Device ID could not be calculated but we are moving on with the transaction")}return t},zi={cookieTestUrl:"https://legacy-staging.paystack.co/test-iframe/start.html",publishableKey:"uFmz/uE/SDT6GupOrSEXIZXGByjQ0zFkPyc9LqKHFqnTI0WPN3JS5kQPo/j9or0TOXlqMQj2lzHn/UGsQT4XeQ==",publicKey:"-----BEGIN PUBLIC KEY-----\r\nMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALhZs/7hP0g0+hrqTq0hFyGVxgco0NMx\r\nZD8nPS6ihxap0yNFjzdyUuZED6P4/aK9Ezl5ajEI9pcx5/1BrEE+F3kCAwEAAQ==\r\n-----END PUBLIC KEY-----"},Hi={...zi,checkoutUrl:"http://localhost:8080/",paymentBaseUrl:"https://legacy-staging.paystack.co/",paystackApiUrl:"https://studio-api.paystack.co/",pusherKey:"1c7b262ee18455815893",pusherUrl:"https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js"},$i={...zi,checkoutUrl:"https://checkout-studio.paystack.com/",paymentBaseUrl:"https://legacy-staging.paystack.co/",paystackApiUrl:"https://studio-api.paystack.co/",pusherKey:"1c7b262ee18455815893",pusherUrl:"https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js"},Gi={...zi,checkoutUrl:"https://checkout.paystack.com/",paymentBaseUrl:"https://standard.paystack.co/",paystackApiUrl:"https://api.paystack.co/",pusherKey:"8e4b9b7ca3418bd5cdc8",pusherUrl:"https://checkout.paystack.com/static/vendor/pusher.min.js"},Ki={dev:Hi,staging:$i,production:Gi}[(window||process.env).paystackEnvironment]||Gi,Wi=()=>{},Xi="authorized";var Zi={authorized(t){const{message:e,status:r,errors:n,...i}=t;return{status:Xi,message:e||"Payment authorized successfully",data:i}},success(t){const{message:e,status:r,errors:n,...i}=t;return{status:"success",message:e||"Successful",data:i}},pending(t){const{message:e,status:r,errors:n,...i}=t;return{status:"pending",message:e||"Payment in progress",data:i}},getCleanResponse(t,e){const{message:r,status:n,errors:i,...a}=t;return{status:n,message:r||e,data:a}},auth(t){const{status:e,message:r,otpmessage:n,...i}=t;return{status:"auth",message:n||r||"Authentication required",data:i}},requery(t){const{message:e}=t;return{status:"requery",message:e||"Requery"}},requestCustomField(t){const{message:e,type:r,format:n,field:i}=t;return{status:"custom_field",message:e,data:{type:r,format:n,field:i}}},error(t){const e={status:"failed",message:t.message||"Failed",errors:t.errors||[]};return t.bank&&(e.bank=t.bank),e},parse(t){const e="object"==typeof t?t:{};return e.data&&"object"==typeof e.data&&(Object.assign(e,e.data),delete e.data),["true",!0,"success"].includes(e.status)?this.success(e):e.status===Xi?this.authorized(e):"pending"===e.status?this.pending(e):"requery"===e.status?this.requery(e):"send"===e.status?this.requestCustomField(e):["transfer-credit-request-received","transfer-credit-request-pending","transfer-credit-request-rejected"].includes(e.status)?this.getCleanResponse(e,"Transfer credit request"):"incorrect-amount-sent"===e.status?this.getCleanResponse(e,"Incorrect amount sent"):"awaiting_registration_token"===e.status?this.getCleanResponse(e):e.auth&&"none"!==e.auth?this.auth(e):this.error(e)}};const Ji=()=>window?new Promise(((t,e)=>{const r=new XMLHttpRequest;r.open("GET",Ki.pusherUrl),r.onload=()=>{if(r.status>=200&&r.status<300){const e=document.createElement("script");e.appendChild(document.createTextNode(r.responseText)),document.head.appendChild(e),t()}else e(r.statusText)},r.onerror=()=>e(r.statusText),r.send(null)})):Promise.reject(new Error("Window object not available")),Yi=(t,e,r)=>{const{channel:n,paymentMethod:i}=t;let a;window&&window.Pusher&&(a=new window.Pusher(Ki.pusherKey,{cluster:"eu",disableStats:!0}));const o={status:"error",message:"We could not listen for charge response. Use transaction.requery() to check the status."},s=()=>{a.unsubscribe(n)};if(!a)return r({status:"error",message:"We could not listen for charge response."},Wi);const c=a.subscribe(n);c.bind("pusher:subscription_succeeded",(()=>{e.isListening=!0})),c.bind("pusher:subscription_error",(()=>{e.isListening=!1,r(o,Wi)})),c.bind("response",(t=>{const n=Zi.parse(t);e.logAPIResponse(n,i),r(n,s)}))};var Qi={exports:{}},ta=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},ea=ta,ra=Object.prototype.toString;function na(t){return"[object Array]"===ra.call(t)}function ia(t){return void 0===t}function aa(t){return null!==t&&"object"==typeof t}function oa(t){if("[object Object]"!==ra.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function sa(t){return"[object Function]"===ra.call(t)}function ca(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),na(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}var ua={isArray:na,isArrayBuffer:function(t){return"[object ArrayBuffer]"===ra.call(t)},isBuffer:function(t){return null!==t&&!ia(t)&&null!==t.constructor&&!ia(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:aa,isPlainObject:oa,isUndefined:ia,isDate:function(t){return"[object Date]"===ra.call(t)},isFile:function(t){return"[object File]"===ra.call(t)},isBlob:function(t){return"[object Blob]"===ra.call(t)},isFunction:sa,isStream:function(t){return aa(t)&&sa(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:ca,merge:function t(){var e={};function r(r,n){oa(e[n])&&oa(r)?e[n]=t(e[n],r):oa(r)?e[n]=t({},r):na(r)?e[n]=r.slice():e[n]=r}for(var n=0,i=arguments.length;n<i;n++)ca(arguments[n],r);return e},extend:function(t,e,r){return ca(e,(function(e,n){t[n]=r&&"function"==typeof e?ea(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},ha=ua;function la(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var da=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(ha.isURLSearchParams(e))n=e.toString();else{var i=[];ha.forEach(e,(function(t,e){null!=t&&(ha.isArray(t)?e+="[]":t=[t],ha.forEach(t,(function(t){ha.isDate(t)?t=t.toISOString():ha.isObject(t)&&(t=JSON.stringify(t)),i.push(la(e)+"="+la(t))})))})),n=i.join("&")}if(n){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},pa=ua;function fa(){this.handlers=[]}fa.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},fa.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},fa.prototype.forEach=function(t){pa.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var ga=fa,ma=ua,ya=function(t,e,r,n,i){return t.config=e,r&&(t.code=r),t.request=n,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t},va=ya,ba=function(t,e,r,n,i){var a=new Error(t);return va(a,e,r,n,i)},Ta=ba,Sa=ua,wa=Sa.isStandardBrowserEnv()?{write:function(t,e,r,n,i,a){var o=[];o.push(t+"="+encodeURIComponent(e)),Sa.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Sa.isString(n)&&o.push("path="+n),Sa.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Aa=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Ea=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Ca=ua,ka=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],xa=ua,Oa=xa.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=xa.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0},Ba=ua,Da=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Ta("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},Pa=wa,Ra=da,Ia=function(t,e){return t&&!Aa(e)?Ea(t,e):e},La=function(t){var e,r,n,i={};return t?(Ca.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Ca.trim(t.substr(0,n)).toLowerCase(),r=Ca.trim(t.substr(n+1)),e){if(i[e]&&ka.indexOf(e)>=0)return;i[e]="set-cookie"===e?(i[e]?i[e]:[]).concat([r]):i[e]?i[e]+", "+r:r}})),i):i},Na=Oa,Ma=ba,Va=function(t){return new Promise((function(e,r){var n=t.data,i=t.headers,a=t.responseType;Ba.isFormData(n)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(t.auth){var s=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(s+":"+c)}var u=Ia(t.baseURL,t.url);function h(){if(o){var n="getAllResponseHeaders"in o?La(o.getAllResponseHeaders()):null,i={data:a&&"text"!==a&&"json"!==a?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:n,config:t,request:o};Da(e,r,i),o=null}}if(o.open(t.method.toUpperCase(),Ra(u,t.params,t.paramsSerializer),!0),o.timeout=t.timeout,"onloadend"in o?o.onloadend=h:o.onreadystatechange=function(){o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))&&setTimeout(h)},o.onabort=function(){o&&(r(Ma("Request aborted",t,"ECONNABORTED",o)),o=null)},o.onerror=function(){r(Ma("Network Error",t,null,o)),o=null},o.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(Ma(e,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Ba.isStandardBrowserEnv()){var l=(t.withCredentials||Na(u))&&t.xsrfCookieName?Pa.read(t.xsrfCookieName):void 0;l&&(i[t.xsrfHeaderName]=l)}"setRequestHeader"in o&&Ba.forEach(i,(function(t,e){void 0===n&&"content-type"===e.toLowerCase()?delete i[e]:o.setRequestHeader(e,t)})),Ba.isUndefined(t.withCredentials)||(o.withCredentials=!!t.withCredentials),a&&"json"!==a&&(o.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&o.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){o&&(o.abort(),r(t),o=null)})),n||(n=null),o.send(n)}))},_a=ua,ja=function(t,e){ma.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},Ua=ya,Fa={"Content-Type":"application/x-www-form-urlencoded"};function qa(t,e){!_a.isUndefined(t)&&_a.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var za,Ha={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(za=Va),za),transformRequest:[function(t,e){return ja(e,"Accept"),ja(e,"Content-Type"),_a.isFormData(t)||_a.isArrayBuffer(t)||_a.isBuffer(t)||_a.isStream(t)||_a.isFile(t)||_a.isBlob(t)?t:_a.isArrayBufferView(t)?t.buffer:_a.isURLSearchParams(t)?(qa(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_a.isObject(t)||e&&"application/json"===e["Content-Type"]?(qa(e,"application/json"),function(t,e,r){if(_a.isString(t))try{return(e||JSON.parse)(t),_a.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,i=!r&&"json"===this.responseType;if(i||n&&_a.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw Ua(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};Ha.headers={common:{Accept:"application/json, text/plain, */*"}},_a.forEach(["delete","get","head"],(function(t){Ha.headers[t]={}})),_a.forEach(["post","put","patch"],(function(t){Ha.headers[t]=_a.merge(Fa)}));var $a=Ha,Ga=ua,Ka=$a,Wa=function(t){return!(!t||!t.__CANCEL__)},Xa=ua,Za=function(t,e,r){var n=this||Ka;return Ga.forEach(r,(function(r){t=r.call(n,t,e)})),t},Ja=Wa,Ya=$a;function Qa(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var to=ua,eo=function(t,e){e=e||{};var r={},n=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function s(t,e){return to.isPlainObject(t)&&to.isPlainObject(e)?to.merge(t,e):to.isPlainObject(e)?to.merge({},e):to.isArray(e)?e.slice():e}function c(n){to.isUndefined(e[n])?to.isUndefined(t[n])||(r[n]=s(void 0,t[n])):r[n]=s(t[n],e[n])}to.forEach(n,(function(t){to.isUndefined(e[t])||(r[t]=s(void 0,e[t]))})),to.forEach(i,c),to.forEach(a,(function(n){to.isUndefined(e[n])?to.isUndefined(t[n])||(r[n]=s(void 0,t[n])):r[n]=s(void 0,e[n])})),to.forEach(o,(function(n){n in e?r[n]=s(t[n],e[n]):n in t&&(r[n]=s(void 0,t[n]))}));var u=n.concat(i).concat(a).concat(o),h=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===u.indexOf(t)}));return to.forEach(h,c),r},ro={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}],_resolved:"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",_integrity:"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",_from:"axios@0.21.4"},no={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){no[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var io={},ao=ro.version.split(".");function oo(t,e){for(var r=e?e.split("."):ao,n=t.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}no.transitional=function(t,e,r){var n=e&&oo(e);function i(t,e){return"[Axios v"+ro.version+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,a,o){if(!1===t)throw new Error(i(a," has been removed in "+e));return n&&!io[a]&&(io[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,a,o)}};var so={isOlderVersion:oo,assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),i=n.length;i-- >0;){var a=n[i],o=e[a];if(o){var s=t[a],c=void 0===s||o(s,a,t);if(!0!==c)throw new TypeError("option "+a+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+a)}},validators:no},co=ua,uo=da,ho=ga,lo=function(t){return Qa(t),t.headers=t.headers||{},t.data=Za.call(t,t.data,t.headers,t.transformRequest),t.headers=Xa.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Xa.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||Ya.adapter)(t).then((function(e){return Qa(t),e.data=Za.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return Ja(e)||(Qa(t),e&&e.response&&(e.response.data=Za.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},po=eo,fo=so,go=fo.validators;function mo(t){this.defaults=t,this.interceptors={request:new ho,response:new ho}}mo.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=po(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&fo.assertOptions(e,{silentJSONParsing:go.transitional(go.boolean,"1.0.0"),forcedJSONParsing:go.transitional(go.boolean,"1.0.0"),clarifyTimeoutError:go.transitional(go.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var i,a=[];if(this.interceptors.response.forEach((function(t){a.push(t.fulfilled,t.rejected)})),!n){var o=[lo,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(a),i=Promise.resolve(t);o.length;)i=i.then(o.shift(),o.shift());return i}for(var s=t;r.length;){var c=r.shift(),u=r.shift();try{s=c(s)}catch(t){u(t);break}}try{i=lo(s)}catch(t){return Promise.reject(t)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},mo.prototype.getUri=function(t){return t=po(this.defaults,t),uo(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},co.forEach(["delete","get","head","options"],(function(t){mo.prototype[t]=function(e,r){return this.request(po(r||{},{method:t,url:e,data:(r||{}).data}))}})),co.forEach(["post","put","patch"],(function(t){mo.prototype[t]=function(e,r,n){return this.request(po(n||{},{method:t,url:e,data:r}))}}));var yo=mo;function vo(t){this.message=t}vo.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},vo.prototype.__CANCEL__=!0;var bo=vo,To=bo;function So(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new To(t),e(r.reason))}))}So.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},So.source=function(){var t;return{token:new So((function(e){t=e})),cancel:t}};var wo=So,Ao=ua,Eo=ta,Co=yo,ko=eo;function xo(t){var e=new Co(t),r=Eo(Co.prototype.request,e);return Ao.extend(r,Co.prototype,e),Ao.extend(r,e),r}var Oo=xo($a);Oo.Axios=Co,Oo.create=function(t){return xo(ko(Oo.defaults,t))},Oo.Cancel=bo,Oo.CancelToken=wo,Oo.isCancel=Wa,Oo.all=function(t){return Promise.all(t)},Oo.spread=function(t){return function(e){return t.apply(null,e)}},Oo.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},Qi.exports=Oo,Qi.exports.default=Oo;var Bo=Qi.exports,Do=Object.prototype.hasOwnProperty,Po=Array.isArray,Ro=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Io=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},Lo={arrayToObject:Io,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],a=i.obj[i.prop],o=Object.keys(a),s=0;s<o.length;++s){var c=o[s],u=a[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(e.push({obj:a,prop:c}),r.push(u))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(Po(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r){if(0===t.length)return t;var n="string"==typeof t?t:String(t);if("iso-8859-1"===r)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var i="",a=0;a<n.length;++a){var o=n.charCodeAt(a);45===o||46===o||95===o||126===o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?i+=n.charAt(a):o<128?i+=Ro[o]:o<2048?i+=Ro[192|o>>6]+Ro[128|63&o]:o<55296||o>=57344?i+=Ro[224|o>>12]+Ro[128|o>>6&63]+Ro[128|63&o]:(a+=1,o=65536+((1023&o)<<10|1023&n.charCodeAt(a)),i+=Ro[240|o>>18]+Ro[128|o>>12&63]+Ro[128|o>>6&63]+Ro[128|63&o])}return i},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(Po(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Do.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var i=e;return Po(e)&&!Po(r)&&(i=Io(e,n)),Po(e)&&Po(r)?(r.forEach((function(r,i){if(Do.call(e,i)){var a=e[i];a&&"object"==typeof a&&r&&"object"==typeof r?e[i]=t(a,r,n):e.push(r)}else e[i]=r})),e):Object.keys(r).reduce((function(e,i){var a=r[i];return Do.call(e,i)?e[i]=t(e[i],a,n):e[i]=a,e}),i)}},No=String.prototype.replace,Mo=/%20/g,Vo={RFC1738:"RFC1738",RFC3986:"RFC3986"},_o=Lo.assign({default:Vo.RFC3986,formatters:{RFC1738:function(t){return No.call(t,Mo,"+")},RFC3986:function(t){return String(t)}}},Vo),jo=Lo,Uo=_o,Fo=Object.prototype.hasOwnProperty,qo={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},zo=Array.isArray,Ho=String.prototype.split,$o=Array.prototype.push,Go=function(t,e){$o.apply(t,zo(e)?e:[e])},Ko=Date.prototype.toISOString,Wo=Uo.default,Xo={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:jo.encode,encodeValuesOnly:!1,format:Wo,formatter:Uo.formatters[Wo],indices:!1,serializeDate:function(t){return Ko.call(t)},skipNulls:!1,strictNullHandling:!1},Zo=function t(e,r,n,i,a,o,s,c,u,h,l,d,p){var f=e;if("function"==typeof s?f=s(r,f):f instanceof Date?f=h(f):"comma"===n&&zo(f)&&(f=f.join(",")),null===f){if(i)return o&&!d?o(r,Xo.encoder,p):r;f=""}if("string"==typeof f||"number"==typeof f||"boolean"==typeof f||jo.isBuffer(f)){if(o){var g=d?r:o(r,Xo.encoder,p);if("comma"===n&&d){for(var m=Ho.call(String(f),","),y="",v=0;v<m.length;++v)y+=(0===v?"":",")+l(o(m[v],Xo.encoder,p));return[l(g)+"="+y]}return[l(g)+"="+l(o(f,Xo.encoder,p))]}return[l(r)+"="+l(String(f))]}var b,T=[];if(void 0===f)return T;if(zo(s))b=s;else{var S=Object.keys(f);b=c?S.sort(c):S}for(var w=0;w<b.length;++w){var A=b[w],E="object"==typeof A&&void 0!==A.value?A.value:f[A];a&&null===f[A]||(zo(f)?Go(T,t(E,"function"==typeof n?n(r,A):r,n,i,a,o,s,c,u,h,l,d,p)):Go(T,t(E,r+(u?"."+A:"["+A+"]"),n,i,a,o,s,c,u,h,l,d,p)))}return T},Jo=Lo,Yo=Object.prototype.hasOwnProperty,Qo=Array.isArray,ts={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Jo.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},es=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},rs=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},ns=function(t,e){if(Qo(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},is=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,o=/(\[[^[\]]*])/.exec(i),s=o?i.slice(0,o.index):i,c=[];if(s){if(!r.plainObjects&&Yo.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var u=0;null!==(o=a.exec(i))&&u<r.depth;){if(u+=1,!r.plainObjects&&Yo.call(Object.prototype,o[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(o[1])}return o&&c.push("["+i.slice(o.index)+"]"),function(t,e,r,n){for(var i=n?e:rs(e,r),a=t.length-1;a>=0;--a){var o,s=t[a];if("[]"===s&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[])[u]=i:"__proto__"!==c&&(o[c]=i):o={0:i}}i=o}return i}(c,e,r,n)}},as=function(t,e){var r,n=t,i=function(t){if(!t)return Xo;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||Xo.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Uo.default;if(void 0!==t.format){if(!Fo.call(Uo.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=Uo.formatters[r],i=Xo.filter;return("function"==typeof t.filter||zo(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Xo.addQueryPrefix,allowDots:void 0===t.allowDots?Xo.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Xo.charsetSentinel,delimiter:void 0===t.delimiter?Xo.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Xo.encode,encoder:"function"==typeof t.encoder?t.encoder:Xo.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Xo.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Xo.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Xo.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Xo.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):zo(i.filter)&&(r=i.filter);var a,o=[];if("object"!=typeof n||null===n)return"";a=e&&e.arrayFormat in qo?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=qo[a];r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var c=0;c<r.length;++c){var u=r[c];i.skipNulls&&null===n[u]||Go(o,Zo(n[u],u,s,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.formatter,i.encodeValuesOnly,i.charset))}var h=o.join(i.delimiter),l=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?l+="utf8=%26%2310003%3B&":l+="utf8=%E2%9C%93&"),h.length>0?l+h:""},os=function(t,e){var r=function(t){if(!t)return ts;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?ts.charset:t.charset;return{allowDots:void 0===t.allowDots?ts.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:ts.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:ts.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:ts.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:ts.comma,decoder:"function"==typeof t.decoder?t.decoder:ts.decoder,delimiter:"string"==typeof t.delimiter||Jo.isRegExp(t.delimiter)?t.delimiter:ts.delimiter,depth:"number"==typeof t.depth?t.depth:ts.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:ts.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:ts.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:ts.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:ts.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,a=e.parameterLimit===1/0?void 0:e.parameterLimit,o=i.split(e.delimiter,a),s=-1,c=e.charset;if(e.charsetSentinel)for(r=0;r<o.length;++r)0===o[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===o[r]?c="utf-8":"utf8=%26%2310003%3B"===o[r]&&(c="iso-8859-1"),s=r,r=o.length);for(r=0;r<o.length;++r)if(r!==s){var u,h,l=o[r],d=l.indexOf("]="),p=-1===d?l.indexOf("="):d+1;-1===p?(u=e.decoder(l,ts.decoder,c),h=e.strictNullHandling?null:""):(u=e.decoder(l.slice(0,p),ts.decoder,c),h=ns(rs(l.slice(p+1),e),(function(t){return e.decoder(t,ts.decoder,c)}))),h&&e.interpretNumericEntities&&"iso-8859-1"===c&&(h=es(h)),l.indexOf("[]=")>-1&&(h=Qo(h)?[h]:h),Yo.call(n,u)?n[u]=Jo.combine(n[u],h):n[u]=h}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],c=is(s,n[s],r,"string"==typeof t);i=Jo.merge(i,c,r)}return Jo.compact(i)},ss={formats:_o,parse:os,stringify:as};const cs=Bo.create({paramsSerializer:t=>{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).filter((e=>![void 0,null].includes(t[e]))).reduce(((e,r)=>({...e,[r]:t[r]})),{})}(t);return ss.stringify(e,{arrayFormat:"brackets"})}}),us=()=>{try{return window?window.localStorage&&window.localStorage.getItem("i18nextLng")||navigator&&navigator.language:null}catch(t){return null}},hs={requestInline(t){const e=us(),{connect_account:r}=t,n={...e&&{"Accept-Language":e},...r&&{"x-connect-account":r}},i=new URL("/checkout/request_inline",Ki.paystackApiUrl).toString();return cs.post(i,t,{headers:n}).then((t=>t.data))},requestStandard(t){const e=us(),r={...e&&{"Accept-Language":e}},n=`${Ki.paystackApiUrl}transaction/verify_access_code/${t}`;return cs.get(n,{headers:r}).then((t=>t.data))},getByAccessCode(t,e){const r=us(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL(`/transaction/get_by_access_code/${t}`,Ki.paystackApiUrl).toString();return cs.get(i,{headers:n}).then((t=>t.data))},verify(t){const e=us(),r={...e&&{"Accept-Language":e}},n=`${Ki.paystackApiUrl}transaction/verify/${t}`;return cs.get(n,{headers:r}).then((t=>t.data))},requery(t){const e=us(),r={...e&&{"Accept-Language":e}},n=`${Ki.paymentBaseUrl}charge/requery/${t}`;return cs.get(n,{headers:r}).then((t=>Zi.parse(t.data)))},markAsAbandoned(t){let{publicKey:e,transactionId:r}=t;const n=`${Ki.paystackApiUrl}transaction/${r}/mark-as-abandoned`,i=us(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return cs.patch(n,{},{headers:a}).then((t=>t.data))},verifyStatus(t){let{reference:e,publicKey:r}=t;const n=new URL(`transaction/verify_status/${e}`,Ki.paystackApiUrl).toString(),i=us(),a={Authorization:`Bearer ${r}`,...i&&{"Accept-Language":i}};return cs.get(n,{headers:a}).then((t=>t.data))}},ls={generateManagedAccount(t,e){const r=us(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL("checkout/pay_with_transfer",Ki.paystackApiUrl).toString();return cs.post(i,t,{headers:n}).then((t=>Zi.parse(t.data)))}};var ds={getManagedAccount(t){let{fulfilLateNotification:e,preferredProvider:r}=t;const n={transaction_id:this.id,fulfil_late_notification:e,preferred_provider:r};return ls.generateManagedAccount(n,this.merchant.key).then((t=>("success"===t.status&&(this.bankTransfer=t),t)))},listenForPayWithTransferCharge(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{data:r}=this.bankTransfer,n={channel:r&&r.pusher_channel||e,paymentMethod:"bank_transfer"};return this.listenForCharge(n,t)}},ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fs=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Boolean(e.sorted),n=Boolean(e.skipIndex),i=Boolean(e.ignorenull),a=function(t){return String(t).replace(/(?:[\0-\x1F"-&\+-\}\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,encodeURIComponent).replace(/ /g,"+").replace(/[!'()~\*]/g,(function(t){return"%"+t.charCodeAt().toString(16).slice(-2).toUpperCase()}))},o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(t);return r?e.sort():e},s=function(t){return t.filter((function(t){return t})).join("&")},c=function(t,e){return s(o(e).map((function(r){return h(t+"["+r+"]",e[r])})))},u=function(t,e){return e.length?s(e.map((function(e,r){return h(n?t+"[]":t+"["+r+"]",e)}))):a(t+"[]")},h=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0===e?"undefined":ps(e),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return e===n?n=i?n:a(t)+"="+n:/string|number|boolean/.test(r)?n=a(t)+"="+a(e):Array.isArray(e)?n=u(t,e):"object"===r&&(n=c(t,e)),n};return t&&s(o(t).map((function(e){return h(e,t[e])})))};const gs={charge(t){let{transactionId:e,phoneNumber:r}=t;const n=`${Ki.paymentBaseUrl}payattitude/charge/${e}`,i=us(),a={"Content-Type":"application/x-www-form-urlencoded",...i&&{"Accept-Language":i}},o=fs({phone_number:r});return cs.post(n,o,{headers:a}).then((t=>{let{data:e}=t;return Zi.parse(e)}))}},ms="payattitude";var ys={chargePayattitude(t){let{phoneNumber:e}=t;const r={transactionId:this.id,phoneNumber:e};return gs.charge(r).then((t=>(this.logAPIResponse(t,ms),t)))},listenForPayattitudeCharge(t){const e={paymentMethod:ms,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}};const vs={getEFTUrl(t){let{eftGateway:e}=t;return new Promise(((t,r)=>{e||r(Error("Please pass the `eftGateway`"));const n=`${Ki.paymentBaseUrl}eft/${e}/${this.id}`;t(Zi.success({url:n}))}))},listenForEFTCharge(t){const e={channel:`EFT_${this.id}`,paymentMethod:"eft"};return this.listenForCharge(e,t)}},bs={validateApplePaySession(t){let{sessionUrl:e,displayName:r,transactionId:n,domainName:i}=t;const a=us(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s=`${Ki.paymentBaseUrl}applepay/validate-session`,c=fs({sessionUrl:e,displayName:r,domainName:i,transaction:n});return cs.post(s,c,{headers:o}).then((t=>Zi.parse(t.data)))},charge(t){let{transactionId:e,paymentObject:r}=t;const n=us(),i={"Content-Type":"application/x-www-form-urlencoded",...n&&{"Accept-Language":n}},a=`${Ki.paymentBaseUrl}applepay/charge`,o=fs({paymentObject:r,transaction:e});return cs.post(a,o,{headers:i}).then((t=>Zi.parse(t.data)))}},Ts="apple pay";var Ss={validateApplePaySession(t){let{sessionUrl:e,displayName:r,domainName:n}=t;return this.logAttempt(Ts),bs.validateApplePaySession({sessionUrl:e,displayName:r,domainName:n,transactionId:this.id}).then((t=>(this.logAPIResponseMessage(t.message),t)))},chargeApplePay(t){let{paymentObject:e}=t;return bs.charge({transactionId:this.id,device:this.deviceFingerprint,paymentObject:e}).then((t=>(this.logAPIResponse(t,Ts),t)))}};const ws={createOrder(t){const e=`${Ki.paymentBaseUrl}paypal/${t}/create`,r=us(),n={...r&&{"Accept-Language":r}};return cs.post(e,{headers:n}).then((t=>Zi.parse(t.data)))},captureOrder(t){const e=`${Ki.paymentBaseUrl}paypal/${t}/capture`,r=us(),n={...r&&{"Accept-Language":r}};return cs.post(e,{headers:n}).then((t=>Zi.parse(t.data)))},getConfig(t){let{publicKey:e,transactionId:r}=t;const n=`${Ki.paystackApiUrl}paypal/config?transaction=${r}`,i=us(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return cs.get(n,{headers:a}).then((t=>t.data))}},As="paypal";var Es={createPayPalOrder(){return this.logAttempt(As),ws.createOrder(this.id).then((t=>(this.logAPIResponseMessage(t.message),t)))},capturePayPalOrder(){return ws.captureOrder(this.id).then((t=>(this.logAPIResponse(t,As),t)))},getPayPalConfig(){return ws.getConfig({publicKey:this.merchant.key,transactionId:this.id})}},Cs={exports:{}};function ks(t){const e=new Cs.exports.JSEncrypt;return e.setPublicKey(Ki.publicKey),e.encrypt(t)}!function(t){var e="0123456789abcdefghijklmnopqrstuvwxyz";function r(t){return e.charAt(t)}function n(t,e){return t&e}function i(t,e){return t|e}function a(t,e){return t^e}function o(t,e){return t&~e}function s(t){if(0==t)return-1;var e=0;return 65535&t||(t>>=16,e+=16),255&t||(t>>=8,e+=8),15&t||(t>>=4,e+=4),3&t||(t>>=2,e+=2),1&t||++e,e}function c(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="=";function l(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=u.charAt(r>>6)+u.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=u.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=u.charAt(r>>2)+u.charAt((3&r)<<4));(3&n.length)>0;)n+=h;return n}function d(t){var e,n="",i=0,a=0;for(e=0;e<t.length&&t.charAt(e)!=h;++e){var o=u.indexOf(t.charAt(e));o<0||(0==i?(n+=r(o>>2),a=3&o,i=1):1==i?(n+=r(a<<2|o>>4),a=15&o,i=2):2==i?(n+=r(a),n+=r(o>>2),a=3&o,i=3):(n+=r(a<<2|o>>4),n+=r(15&o),i=0))}return 1==i&&(n+=r(a<<2)),n}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math==Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},i=function(t){try{return!!t()}catch(t){return!0}},a=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=o,c=Function.prototype.call,u=s?c.bind(c):function(){return c.apply(c,arguments)},h={},l={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,p=d&&!l.call({1:2},1);h.f=p?function(t){var e=d(this,t);return!!e&&e.enumerable}:l;var f,g,m=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y=o,v=Function.prototype,b=v.bind,T=v.call,S=y&&b.bind(T,T),w=y?function(t){return t&&S(t)}:function(t){return t&&function(){return T.apply(t,arguments)}},A=w,E=A({}.toString),C=A("".slice),O=function(t){return C(E(t),8,-1)},k=w,B=i,R=O,x=r.Object,D=k("".split),P=B((function(){return!x("z").propertyIsEnumerable(0)}))?function(t){return"String"==R(t)?D(t,""):x(t)}:x,L=r.TypeError,I=function(t){if(null==t)throw L("Can't call method on "+t);return t},N=P,_=I,M=function(t){return N(_(t))},V=function(t){return"function"==typeof t},j=V,U=function(t){return"object"==typeof t?null!==t:j(t)},F=r,z=V,q=function(t,e){return arguments.length<2?(r=F[t],z(r)?r:void 0):F[t]&&F[t][e];var r},H=w({}.isPrototypeOf),$=r,G=q("navigator","userAgent")||"",K=$.process,W=$.Deno,X=K&&K.versions||W&&W.version,Z=X&&X.v8;Z&&(g=(f=Z.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!g&&G&&(!(f=G.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=G.match(/Chrome\/(\d+)/))&&(g=+f[1]);var J=g,Y=i,Q=!!Object.getOwnPropertySymbols&&!Y((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41})),tt=Q&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,et=q,rt=V,nt=H,it=tt,at=r.Object,ot=it?function(t){return"symbol"==typeof t}:function(t){var e=et("Symbol");return rt(e)&&nt(e.prototype,at(t))},st=r.String,ct=V,ut=function(t){try{return st(t)}catch(t){return"Object"}},ht=r.TypeError,lt=function(t){if(ct(t))return t;throw ht(ut(t)+" is not a function")},dt=u,pt=V,ft=U,gt=r.TypeError,mt={exports:{}},yt=r,vt=Object.defineProperty,bt=function(t,e){try{vt(yt,t,{value:e,configurable:!0,writable:!0})}catch(r){yt[t]=e}return e},Tt=bt,St="__core-js_shared__",wt=r[St]||Tt(St,{}),At=wt;(mt.exports=function(t,e){return At[t]||(At[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Et=I,Ct=r.Object,Ot=function(t){return Ct(Et(t))},kt=w({}.hasOwnProperty),Bt=Object.hasOwn||function(t,e){return kt(Ot(t),e)},Rt=w,xt=0,Dt=Math.random(),Pt=Rt(1..toString),Lt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Pt(++xt+Dt,36)},It=r,Nt=mt.exports,_t=Bt,Mt=Lt,Vt=Q,jt=tt,Ut=Nt("wks"),Ft=It.Symbol,zt=Ft&&Ft.for,qt=jt?Ft:Ft&&Ft.withoutSetter||Mt,Ht=function(t){if(!_t(Ut,t)||!Vt&&"string"!=typeof Ut[t]){var e="Symbol."+t;Vt&&_t(Ft,t)?Ut[t]=Ft[t]:Ut[t]=jt&&zt?zt(e):qt(e)}return Ut[t]},$t=u,Gt=U,Kt=ot,Wt=function(t,e){var r=t[e];return null==r?void 0:lt(r)},Xt=function(t,e){var r,n;if("string"===e&&pt(r=t.toString)&&!ft(n=dt(r,t)))return n;if(pt(r=t.valueOf)&&!ft(n=dt(r,t)))return n;if("string"!==e&&pt(r=t.toString)&&!ft(n=dt(r,t)))return n;throw gt("Can't convert object to primitive value")},Zt=Ht,Jt=r.TypeError,Yt=Zt("toPrimitive"),Qt=function(t,e){if(!Gt(t)||Kt(t))return t;var r,n=Wt(t,Yt);if(n){if(void 0===e&&(e="default"),r=$t(n,t,e),!Gt(r)||Kt(r))return r;throw Jt("Can't convert object to primitive value")}return void 0===e&&(e="number"),Xt(t,e)},te=ot,ee=function(t){var e=Qt(t,"string");return te(e)?e:e+""},re=U,ne=r.document,ie=re(ne)&&re(ne.createElement),ae=function(t){return ie?ne.createElement(t):{}},oe=!a&&!i((function(){return 7!=Object.defineProperty(ae("div"),"a",{get:function(){return 7}}).a})),se=a,ce=u,ue=h,he=m,le=M,de=ee,pe=Bt,fe=oe,ge=Object.getOwnPropertyDescriptor;n.f=se?ge:function(t,e){if(t=le(t),e=de(e),fe)try{return ge(t,e)}catch(t){}if(pe(t,e))return he(!ce(ue.f,t,e),t[e])};var me={},ye=a&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),ve=r,be=U,Te=ve.String,Se=ve.TypeError,we=function(t){if(be(t))return t;throw Se(Te(t)+" is not an object")},Ae=a,Ee=oe,Ce=ye,Oe=we,ke=ee,Be=r.TypeError,Re=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,De="enumerable",Pe="configurable",Le="writable";me.f=Ae?Ce?function(t,e,r){if(Oe(t),e=ke(e),Oe(r),"function"==typeof t&&"prototype"===e&&"value"in r&&Le in r&&!r[Le]){var n=xe(t,e);n&&n[Le]&&(t[e]=r.value,r={configurable:Pe in r?r[Pe]:n[Pe],enumerable:De in r?r[De]:n[De],writable:!1})}return Re(t,e,r)}:Re:function(t,e,r){if(Oe(t),e=ke(e),Oe(r),Ee)try{return Re(t,e,r)}catch(t){}if("get"in r||"set"in r)throw Be("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Ie=me,Ne=m,_e=a?function(t,e,r){return Ie.f(t,e,Ne(1,r))}:function(t,e,r){return t[e]=r,t},Me={exports:{}},Ve=V,je=wt,Ue=w(Function.toString);Ve(je.inspectSource)||(je.inspectSource=function(t){return Ue(t)});var Fe,ze,qe,He=je.inspectSource,$e=V,Ge=He,Ke=r.WeakMap,We=$e(Ke)&&/native code/.test(Ge(Ke)),Xe=mt.exports,Ze=Lt,Je=Xe("keys"),Ye={},Qe=We,tr=r,er=w,rr=U,nr=_e,ir=Bt,ar=wt,or=function(t){return Je[t]||(Je[t]=Ze(t))},sr=Ye,cr="Object already initialized",ur=tr.TypeError,hr=tr.WeakMap;if(Qe||ar.state){var lr=ar.state||(ar.state=new hr),dr=er(lr.get),pr=er(lr.has),fr=er(lr.set);Fe=function(t,e){if(pr(lr,t))throw new ur(cr);return e.facade=t,fr(lr,t,e),e},ze=function(t){return dr(lr,t)||{}},qe=function(t){return pr(lr,t)}}else{var gr=or("state");sr[gr]=!0,Fe=function(t,e){if(ir(t,gr))throw new ur(cr);return e.facade=t,nr(t,gr,e),e},ze=function(t){return ir(t,gr)?t[gr]:{}},qe=function(t){return ir(t,gr)}}var mr={set:Fe,get:ze,has:qe,enforce:function(t){return qe(t)?ze(t):Fe(t,{})},getterFor:function(t){return function(e){var r;if(!rr(e)||(r=ze(e)).type!==t)throw ur("Incompatible receiver, "+t+" required");return r}}},yr=a,vr=Bt,br=Function.prototype,Tr=yr&&Object.getOwnPropertyDescriptor,Sr=vr(br,"name"),wr=Sr&&"something"===function(){}.name,Ar=Sr&&(!yr||yr&&Tr(br,"name").configurable),Er=r,Cr=V,Or=Bt,kr=_e,Br=bt,Rr=He,xr={EXISTS:Sr,PROPER:wr,CONFIGURABLE:Ar}.CONFIGURABLE,Dr=mr.get,Pr=mr.enforce,Lr=String(String).split("String");(Me.exports=function(t,e,r,n){var i,a=!!n&&!!n.unsafe,o=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:e;Cr(r)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Or(r,"name")||xr&&r.name!==c)&&kr(r,"name",c),(i=Pr(r)).source||(i.source=Lr.join("string"==typeof c?c:""))),t!==Er?(a?!s&&t[e]&&(o=!0):delete t[e],o?t[e]=r:kr(t,e,r)):o?t[e]=r:Br(e,r)})(Function.prototype,"toString",(function(){return Cr(this)&&Dr(this).source||Rr(this)}));var Ir={},Nr=Math.ceil,_r=Math.floor,Mr=function(t){var e=+t;return e!=e||0===e?0:(e>0?_r:Nr)(e)},Vr=Mr,jr=Math.max,Ur=Math.min,Fr=Mr,zr=Math.min,qr=function(t){return t>0?zr(Fr(t),9007199254740991):0},Hr=M,$r=function(t,e){var r=Vr(t);return r<0?jr(r+e,0):Ur(r,e)},Gr=function(t){return qr(t.length)},Kr=function(t){return function(e,r,n){var i,a=Hr(e),o=Gr(a),s=$r(n,o);if(t&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}},Wr={includes:Kr(!0),indexOf:Kr(!1)},Xr=Bt,Zr=M,Jr=Wr.indexOf,Yr=Ye,Qr=w([].push),tn=function(t,e){var r,n=Zr(t),i=0,a=[];for(r in n)!Xr(Yr,r)&&Xr(n,r)&&Qr(a,r);for(;e.length>i;)Xr(n,r=e[i++])&&(~Jr(a,r)||Qr(a,r));return a},en=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Ir.f=Object.getOwnPropertyNames||function(t){return tn(t,en)};var rn={};rn.f=Object.getOwnPropertySymbols;var nn=q,an=Ir,on=rn,sn=we,cn=w([].concat),un=nn("Reflect","ownKeys")||function(t){var e=an.f(sn(t)),r=on.f;return r?cn(e,r(t)):e},hn=Bt,ln=un,dn=n,pn=me,fn=function(t,e,r){for(var n=ln(e),i=pn.f,a=dn.f,o=0;o<n.length;o++){var s=n[o];hn(t,s)||r&&hn(r,s)||i(t,s,a(e,s))}},gn=i,mn=V,yn=/#|\.prototype\./,vn=function(t,e){var r=Tn[bn(t)];return r==wn||r!=Sn&&(mn(e)?gn(e):!!e)},bn=vn.normalize=function(t){return String(t).replace(yn,".").toLowerCase()},Tn=vn.data={},Sn=vn.NATIVE="N",wn=vn.POLYFILL="P",An=vn,En=r,Cn=n.f,On=_e,kn=Me.exports,Bn=bt,Rn=fn,xn=An,Dn=o,Pn=Function.prototype,Ln=Pn.apply,In=Pn.call,Nn="object"==typeof Reflect&&Reflect.apply||(Dn?In.bind(Ln):function(){return In.apply(Ln,arguments)}),_n=r,Mn=V,Vn=_n.String,jn=_n.TypeError,Un=w,Fn=we,zn=function(t){if("object"==typeof t||Mn(t))return t;throw jn("Can't set "+Vn(t)+" as a prototype")},qn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Un(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Fn(r),zn(n),e?t(r,n):r.__proto__=n,r}}():void 0),Hn=V,$n=U,Gn=qn,Kn={};Kn[Ht("toStringTag")]="z";var Wn=r,Xn="[object z]"===String(Kn),Zn=V,Jn=O,Yn=Ht("toStringTag"),Qn=Wn.Object,ti="Arguments"==Jn(function(){return arguments}()),ei=Xn?Jn:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Qn(t),Yn))?r:ti?Jn(e):"Object"==(n=Jn(e))&&Zn(e.callee)?"Arguments":n},ri=r.String,ni=function(t){if("Symbol"===ei(t))throw TypeError("Cannot convert a Symbol value to a string");return ri(t)},ii=U,ai=_e,oi=w("".replace),si=String(Error("zxcasd").stack),ci=/\n\s*at [^:]*:[^\n]*/,ui=ci.test(si),hi=m,li=!i((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",hi(1,7)),7!==t.stack)})),di=q,pi=Bt,fi=_e,gi=H,mi=qn,yi=fn,vi=function(t,e,r){var n,i;return Gn&&Hn(n=e.constructor)&&n!==r&&$n(i=n.prototype)&&i!==r.prototype&&Gn(t,i),t},bi=function(t,e){return void 0===t?arguments.length<2?"":e:ni(t)},Ti=function(t,e){ii(e)&&"cause"in e&&ai(t,"cause",e.cause)},Si=function(t,e){if(ui&&"string"==typeof t)for(;e--;)t=oi(t,ci,"");return t},wi=li,Ai=function(t,e){var r,n,i,a,o,s=t.target,c=t.global,u=t.stat;if(r=c?En:u?En[s]||Bn(s,{}):(En[s]||{}).prototype)for(n in e){if(a=e[n],i=t.noTargetGet?(o=Cn(r,n))&&o.value:r[n],!xn(c?n:s+(u?".":"#")+n,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;Rn(a,i)}(t.sham||i&&i.sham)&&On(a,"sham",!0),kn(r,n,a,t)}},Ei=Nn,Ci=function(t,e,r,n){var i=n?2:1,a=t.split("."),o=a[a.length-1],s=di.apply(null,a);if(s){var c=s.prototype;if(pi(c,"cause")&&delete c.cause,!r)return s;var u=di("Error"),h=e((function(t,e){var r=bi(n?e:t,void 0),a=n?new s(t):new s;return void 0!==r&&fi(a,"message",r),wi&&fi(a,"stack",Si(a.stack,2)),this&&gi(c,this)&&vi(a,this,h),arguments.length>i&&Ti(a,arguments[i]),a}));h.prototype=c,"Error"!==o&&(mi?mi(h,u):yi(h,u,{name:!0})),yi(h,s);try{c.name!==o&&fi(c,"name",o),c.constructor=h}catch(t){}return h}},Oi="WebAssembly",ki=r[Oi],Bi=7!==Error("e",{cause:7}).cause,Ri=function(t,e){var r={};r[t]=Ci(t,e,Bi),Ai({global:!0,forced:Bi},r)},xi=function(t,e){if(ki&&ki[t]){var r={};r[t]=Ci(Oi+"."+t,e,Bi),Ai({target:Oi,stat:!0,forced:Bi},r)}};Ri("Error",(function(t){return function(e){return Ei(t,this,arguments)}})),Ri("EvalError",(function(t){return function(e){return Ei(t,this,arguments)}})),Ri("RangeError",(function(t){return function(e){return Ei(t,this,arguments)}})),Ri("ReferenceError",(function(t){return function(e){return Ei(t,this,arguments)}})),Ri("SyntaxError",(function(t){return function(e){return Ei(t,this,arguments)}})),Ri("TypeError",(function(t){return function(e){return Ei(t,this,arguments)}})),Ri("URIError",(function(t){return function(e){return Ei(t,this,arguments)}})),xi("CompileError",(function(t){return function(e){return Ei(t,this,arguments)}})),xi("LinkError",(function(t){return function(e){return Ei(t,this,arguments)}})),xi("RuntimeError",(function(t){return function(e){return Ei(t,this,arguments)}}));class Di extends Error{constructor(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];super(...r),Error.captureStackTrace&&Error.captureStackTrace(this,Di),this.errors=t}}function Pi(t){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)}function Li(t){return parseInt(t,10)===Number(t)&&Number(t)>=0}function Ii(t){return t&&"string"==typeof t}const Ni={ref:{required:!1,isValid:Ii},key:{required:!0,isValid:function(t){return t&&"pk"===t.substring(0,2)}},email:{required:!0,fallback:"customer_code",isValid:Pi},customer_code:{required:!1,isValid:Ii},amount:{required:!0,fallback:"plan",isValid:Li},plan:{required:!1,isValid:Ii},transaction_charge:{required:!1,isValid:Li},bearer:{required:!1,isValid:Ii},channels:{required:!1,isValid:function(t){return t instanceof Array}},currency:{required:!1,isValid:Ii},firstname:{required:!1,isValid:Ii},lastname:{required:!1,isValid:Ii},phone:{required:!1,isValid:Ii},remark:{required:!1,isValid:Ii},payment_page:{required:!1,isValid:Li},payment_request:{required:!1,isValid:Ii},quantity:{required:!1,isValid:Ii},coupon:{required:!1,isValid:Ii},start_date:{required:!1,isValid:Ii},interval:{required:!1,isValid:Ii},invoice_limit:{required:!1,isValid:Li},subaccount:{required:!1,isValid:Ii},hash:{required:!1,isValid:Ii},metadata:{required:!1,isValid:Ii},transaction_type:{required:!1,isValid:Ii},subscription:{required:!1,isValid:Li}};var _i,Mi,Vi,ji={exports:{}};Mi=t,Vi=function(){var t=function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]+e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]+e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]+e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]+e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},e=function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]*e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]*e[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=t[3]*e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]*e[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[2]*e[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[3]*e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]*e[3]+t[1]*e[2]+t[2]*e[1]+t[3]*e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},r=function(t,e){return 32==(e%=64)?[t[1],t[0]]:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e|t[0]>>>32-e]:(e-=32,[t[1]<<e|t[0]>>>32-e,t[0]<<e|t[1]>>>32-e])},n=function(t,e){return 0==(e%=64)?t:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e]:[t[1]<<e-32,0]},i=function(t,e){return[t[0]^e[0],t[1]^e[1]]},a=function(t){return t=i(t,[0,t[0]>>>1]),t=e(t,[4283543511,3981806797]),t=i(t,[0,t[0]>>>1]),t=e(t,[3301882366,444984403]),t=i(t,[0,t[0]>>>1])},o=function(o,s){s=s||0;for(var c=(o=o||"").length%16,u=o.length-c,h=[0,s],l=[0,s],d=[0,0],p=[0,0],f=[2277735313,289559509],g=[1291169091,658871167],m=0;m<u;m+=16)d=[255&o.charCodeAt(m+4)|(255&o.charCodeAt(m+5))<<8|(255&o.charCodeAt(m+6))<<16|(255&o.charCodeAt(m+7))<<24,255&o.charCodeAt(m)|(255&o.charCodeAt(m+1))<<8|(255&o.charCodeAt(m+2))<<16|(255&o.charCodeAt(m+3))<<24],p=[255&o.charCodeAt(m+12)|(255&o.charCodeAt(m+13))<<8|(255&o.charCodeAt(m+14))<<16|(255&o.charCodeAt(m+15))<<24,255&o.charCodeAt(m+8)|(255&o.charCodeAt(m+9))<<8|(255&o.charCodeAt(m+10))<<16|(255&o.charCodeAt(m+11))<<24],d=e(d,f),d=r(d,31),d=e(d,g),h=i(h,d),h=r(h,27),h=t(h,l),h=t(e(h,[0,5]),[0,1390208809]),p=e(p,g),p=r(p,33),p=e(p,f),l=i(l,p),l=r(l,31),l=t(l,h),l=t(e(l,[0,5]),[0,944331445]);switch(d=[0,0],p=[0,0],c){case 15:p=i(p,n([0,o.charCodeAt(m+14)],48));case 14:p=i(p,n([0,o.charCodeAt(m+13)],40));case 13:p=i(p,n([0,o.charCodeAt(m+12)],32));case 12:p=i(p,n([0,o.charCodeAt(m+11)],24));case 11:p=i(p,n([0,o.charCodeAt(m+10)],16));case 10:p=i(p,n([0,o.charCodeAt(m+9)],8));case 9:p=i(p,[0,o.charCodeAt(m+8)]),p=e(p,g),p=r(p,33),p=e(p,f),l=i(l,p);case 8:d=i(d,n([0,o.charCodeAt(m+7)],56));case 7:d=i(d,n([0,o.charCodeAt(m+6)],48));case 6:d=i(d,n([0,o.charCodeAt(m+5)],40));case 5:d=i(d,n([0,o.charCodeAt(m+4)],32));case 4:d=i(d,n([0,o.charCodeAt(m+3)],24));case 3:d=i(d,n([0,o.charCodeAt(m+2)],16));case 2:d=i(d,n([0,o.charCodeAt(m+1)],8));case 1:d=i(d,[0,o.charCodeAt(m)]),d=e(d,f),d=r(d,31),d=e(d,g),h=i(h,d)}return h=i(h,[0,o.length]),l=i(l,[0,o.length]),h=t(h,l),l=t(l,h),h=a(h),l=a(l),h=t(h,l),l=t(l,h),("00000000"+(h[0]>>>0).toString(16)).slice(-8)+("00000000"+(h[1]>>>0).toString(16)).slice(-8)+("00000000"+(l[0]>>>0).toString(16)).slice(-8)+("00000000"+(l[1]>>>0).toString(16)).slice(-8)},s={preprocessor:null,audio:{timeout:1e3,excludeIOS11:!0},fonts:{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",userDefinedFonts:[],extendedJsFonts:!1},screen:{detectScreenOrientation:!0},plugins:{sortPluginsFor:[/palemoon/i],excludeIE:!1},extraComponents:[],excludes:{enumerateDevices:!0,pixelRatio:!0,doNotTrack:!0,fontsFlash:!0},NOT_AVAILABLE:"not available",ERROR:"error",EXCLUDED:"excluded"},c=function(t,e){if(Array.prototype.forEach&&t.forEach===Array.prototype.forEach)t.forEach(e);else if(t.length===+t.length)for(var r=0,n=t.length;r<n;r++)e(t[r],r,t);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},u=function(t,e){var r=[];return null==t?r:Array.prototype.map&&t.map===Array.prototype.map?t.map(e):(c(t,(function(t,n,i){r.push(e(t,n,i))})),r)},h=function(){return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices},l=function(t){var e=[window.screen.width,window.screen.height];return t.screen.detectScreenOrientation&&e.sort().reverse(),e},d=function(t){if(window.screen.availWidth&&window.screen.availHeight){var e=[window.screen.availHeight,window.screen.availWidth];return t.screen.detectScreenOrientation&&e.sort().reverse(),e}return t.NOT_AVAILABLE},p=function(t){if(null==navigator.plugins)return t.NOT_AVAILABLE;for(var e=[],r=0,n=navigator.plugins.length;r<n;r++)navigator.plugins[r]&&e.push(navigator.plugins[r]);return g(t)&&(e=e.sort((function(t,e){return t.name>e.name?1:t.name<e.name?-1:0}))),u(e,(function(t){var e=u(t,(function(t){return[t.type,t.suffixes]}));return[t.name,t.description,e]}))},f=function(t){var e=[];return Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window?e=u(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],(function(e){try{return new window.ActiveXObject(e),e}catch(e){return t.ERROR}})):e.push(t.NOT_AVAILABLE),navigator.plugins&&(e=e.concat(p(t))),e},g=function(t){for(var e=!1,r=0,n=t.plugins.sortPluginsFor.length;r<n;r++){var i=t.plugins.sortPluginsFor[r];if(navigator.userAgent.match(i)){e=!0;break}}return e},m=function(t){try{return!!window.sessionStorage}catch(e){return t.ERROR}},y=function(t){try{return!!window.localStorage}catch(e){return t.ERROR}},v=function(t){try{return!!window.indexedDB}catch(e){return t.ERROR}},b=function(t){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:t.NOT_AVAILABLE},T=function(t){return navigator.cpuClass||t.NOT_AVAILABLE},S=function(t){return navigator.platform?navigator.platform:t.NOT_AVAILABLE},w=function(t){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:window.doNotTrack?window.doNotTrack:t.NOT_AVAILABLE},A=function(){var t,e=0;void 0!==navigator.maxTouchPoints?e=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(e=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){t=!1}return[e,t,"ontouchstart"in window]},E=function(t){var e=[],r=document.createElement("canvas");r.width=2e3,r.height=200,r.style.display="inline";var n=r.getContext("2d");return n.rect(0,0,10,10),n.rect(2,2,6,6),e.push("canvas winding:"+(!1===n.isPointInPath(5,5,"evenodd")?"yes":"no")),n.textBaseline="alphabetic",n.fillStyle="#f60",n.fillRect(125,1,62,20),n.fillStyle="#069",t.dontUseFakeFontInCanvas?n.font="11pt Arial":n.font="11pt no-real-font-123",n.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),n.fillStyle="rgba(102, 204, 0, 0.2)",n.font="18pt Arial",n.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),n.globalCompositeOperation="multiply",n.fillStyle="rgb(255,0,255)",n.beginPath(),n.arc(50,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(0,255,255)",n.beginPath(),n.arc(100,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,255,0)",n.beginPath(),n.arc(75,100,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,0,255)",n.arc(75,75,75,0,2*Math.PI,!0),n.arc(75,75,25,0,2*Math.PI,!0),n.fill("evenodd"),r.toDataURL&&e.push("canvas fp:"+r.toDataURL()),e},C=function(){var t,e=function(e){return t.clearColor(0,0,0,1),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),"["+e[0]+", "+e[1]+"]"};if(!(t=V()))return null;var r=[],n=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,n);var i=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW),n.itemSize=3,n.numItems=3;var a=t.createProgram(),o=t.createShader(t.VERTEX_SHADER);t.shaderSource(o,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),t.compileShader(o);var s=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(s,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),t.compileShader(s),t.attachShader(a,o),t.attachShader(a,s),t.linkProgram(a),t.useProgram(a),a.vertexPosAttrib=t.getAttribLocation(a,"attrVertex"),a.offsetUniform=t.getUniformLocation(a,"uniformOffset"),t.enableVertexAttribArray(a.vertexPosArray),t.vertexAttribPointer(a.vertexPosAttrib,n.itemSize,t.FLOAT,!1,0,0),t.uniform2f(a.offsetUniform,1,1),t.drawArrays(t.TRIANGLE_STRIP,0,n.numItems);try{r.push(t.canvas.toDataURL())}catch(t){}r.push("extensions:"+(t.getSupportedExtensions()||[]).join(";")),r.push("webgl aliased line width range:"+e(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE))),r.push("webgl aliased point size range:"+e(t.getParameter(t.ALIASED_POINT_SIZE_RANGE))),r.push("webgl alpha bits:"+t.getParameter(t.ALPHA_BITS)),r.push("webgl antialiasing:"+(t.getContextAttributes().antialias?"yes":"no")),r.push("webgl blue bits:"+t.getParameter(t.BLUE_BITS)),r.push("webgl depth bits:"+t.getParameter(t.DEPTH_BITS)),r.push("webgl green bits:"+t.getParameter(t.GREEN_BITS)),r.push("webgl max anisotropy:"+function(t){var e=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic");if(e){var r=t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT);return 0===r&&(r=2),r}return null}(t)),r.push("webgl max combined texture image units:"+t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),r.push("webgl max cube map texture size:"+t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)),r.push("webgl max fragment uniform vectors:"+t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS)),r.push("webgl max render buffer size:"+t.getParameter(t.MAX_RENDERBUFFER_SIZE)),r.push("webgl max texture image units:"+t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)),r.push("webgl max texture size:"+t.getParameter(t.MAX_TEXTURE_SIZE)),r.push("webgl max varying vectors:"+t.getParameter(t.MAX_VARYING_VECTORS)),r.push("webgl max vertex attribs:"+t.getParameter(t.MAX_VERTEX_ATTRIBS)),r.push("webgl max vertex texture image units:"+t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),r.push("webgl max vertex uniform vectors:"+t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS)),r.push("webgl max viewport dims:"+e(t.getParameter(t.MAX_VIEWPORT_DIMS))),r.push("webgl red bits:"+t.getParameter(t.RED_BITS)),r.push("webgl renderer:"+t.getParameter(t.RENDERER)),r.push("webgl shading language version:"+t.getParameter(t.SHADING_LANGUAGE_VERSION)),r.push("webgl stencil bits:"+t.getParameter(t.STENCIL_BITS)),r.push("webgl vendor:"+t.getParameter(t.VENDOR)),r.push("webgl version:"+t.getParameter(t.VERSION));try{var u=t.getExtension("WEBGL_debug_renderer_info");u&&(r.push("webgl unmasked vendor:"+t.getParameter(u.UNMASKED_VENDOR_WEBGL)),r.push("webgl unmasked renderer:"+t.getParameter(u.UNMASKED_RENDERER_WEBGL)))}catch(t){}return t.getShaderPrecisionFormat?(c(["FLOAT","INT"],(function(e){c(["VERTEX","FRAGMENT"],(function(n){c(["HIGH","MEDIUM","LOW"],(function(i){c(["precision","rangeMin","rangeMax"],(function(a){var o=t.getShaderPrecisionFormat(t[n+"_SHADER"],t[i+"_"+e])[a];"precision"!==a&&(a="precision "+a);var s=["webgl ",n.toLowerCase()," shader ",i.toLowerCase()," ",e.toLowerCase()," ",a,":",o].join("");r.push(s)}))}))}))})),r):r},O=function(){try{var t=V(),e=t.getExtension("WEBGL_debug_renderer_info");return t.getParameter(e.UNMASKED_VENDOR_WEBGL)+"~"+t.getParameter(e.UNMASKED_RENDERER_WEBGL)}catch(t){return null}},k=function(){var t=document.createElement("div");t.innerHTML=" ",t.className="adsbox";var e=!1;try{document.body.appendChild(t),e=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(t)}catch(t){e=!1}return e},B=function(){if(void 0!==navigator.languages)try{if(navigator.languages[0].substr(0,2)!==navigator.language.substr(0,2))return!0}catch(t){return!0}return!1},R=function(){return window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight},x=function(){var t,e=navigator.userAgent.toLowerCase(),r=navigator.oscpu,n=navigator.platform.toLowerCase();if(t=e.indexOf("windows phone")>=0?"Windows Phone":e.indexOf("win")>=0?"Windows":e.indexOf("android")>=0?"Android":e.indexOf("linux")>=0?"Linux":e.indexOf("iphone")>=0||e.indexOf("ipad")>=0?"iOS":e.indexOf("mac")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows Phone"!==t&&"Android"!==t&&"iOS"!==t&&"Other"!==t)return!0;if(void 0!==r){if((r=r.toLowerCase()).indexOf("win")>=0&&"Windows"!==t&&"Windows Phone"!==t)return!0;if(r.indexOf("linux")>=0&&"Linux"!==t&&"Android"!==t)return!0;if(r.indexOf("mac")>=0&&"Mac"!==t&&"iOS"!==t)return!0;if((-1===r.indexOf("win")&&-1===r.indexOf("linux")&&-1===r.indexOf("mac"))!=("Other"===t))return!0}return n.indexOf("win")>=0&&"Windows"!==t&&"Windows Phone"!==t||(n.indexOf("linux")>=0||n.indexOf("android")>=0||n.indexOf("pike")>=0)&&"Linux"!==t&&"Android"!==t||(n.indexOf("mac")>=0||n.indexOf("ipad")>=0||n.indexOf("ipod")>=0||n.indexOf("iphone")>=0)&&"Mac"!==t&&"iOS"!==t||(-1===n.indexOf("win")&&-1===n.indexOf("linux")&&-1===n.indexOf("mac"))!=("Other"===t)||void 0===navigator.plugins&&"Windows"!==t&&"Windows Phone"!==t},D=function(){var t,e=navigator.userAgent.toLowerCase(),r=navigator.productSub;if(("Chrome"==(t=e.indexOf("firefox")>=0?"Firefox":e.indexOf("opera")>=0||e.indexOf("opr")>=0?"Opera":e.indexOf("chrome")>=0?"Chrome":e.indexOf("safari")>=0?"Safari":e.indexOf("trident")>=0?"Internet Explorer":"Other")||"Safari"===t||"Opera"===t)&&"20030107"!==r)return!0;var n,i=eval.toString().length;if(37===i&&"Safari"!==t&&"Firefox"!==t&&"Other"!==t)return!0;if(39===i&&"Internet Explorer"!==t&&"Other"!==t)return!0;if(33===i&&"Chrome"!==t&&"Opera"!==t&&"Other"!==t)return!0;try{throw"a"}catch(t){try{t.toSource(),n=!0}catch(t){n=!1}}return n&&"Firefox"!==t&&"Other"!==t},P=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},L=function(){if(!P())return!1;var t=V();return!!window.WebGLRenderingContext&&!!t},I=function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},N=function(){return void 0!==window.swfobject},_=function(){return window.swfobject.hasFlashPlayerVersion("9.0.0")},M=function(t,e){var r="___fp_swf_loaded";window[r]=function(e){t(e)};var n=e.fonts.swfContainerId;!function(t){var e=document.createElement("div");e.setAttribute("id",t.fonts.swfContainerId),document.body.appendChild(e)}();var i={onReady:r};window.swfobject.embedSWF(e.fonts.swfPath,n,"1","1","9.0.0",!1,i,{allowScriptAccess:"always",menu:"false"},{})},V=function(){var t=document.createElement("canvas"),e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return e||(e=null),e},j=[{key:"userAgent",getData:function(t){t(navigator.userAgent)}},{key:"language",getData:function(t,e){t(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||e.NOT_AVAILABLE)}},{key:"colorDepth",getData:function(t,e){t(window.screen.colorDepth||e.NOT_AVAILABLE)}},{key:"deviceMemory",getData:function(t,e){t(navigator.deviceMemory||e.NOT_AVAILABLE)}},{key:"pixelRatio",getData:function(t,e){t(window.devicePixelRatio||e.NOT_AVAILABLE)}},{key:"hardwareConcurrency",getData:function(t,e){t(b(e))}},{key:"screenResolution",getData:function(t,e){t(l(e))}},{key:"availableScreenResolution",getData:function(t,e){t(d(e))}},{key:"timezoneOffset",getData:function(t){t((new Date).getTimezoneOffset())}},{key:"timezone",getData:function(t,e){window.Intl&&window.Intl.DateTimeFormat?t((new window.Intl.DateTimeFormat).resolvedOptions().timeZone):t(e.NOT_AVAILABLE)}},{key:"sessionStorage",getData:function(t,e){t(m(e))}},{key:"localStorage",getData:function(t,e){t(y(e))}},{key:"indexedDb",getData:function(t,e){t(v(e))}},{key:"addBehavior",getData:function(t){t(!(!document.body||!document.body.addBehavior))}},{key:"openDatabase",getData:function(t){t(!!window.openDatabase)}},{key:"cpuClass",getData:function(t,e){t(T(e))}},{key:"platform",getData:function(t,e){t(S(e))}},{key:"doNotTrack",getData:function(t,e){t(w(e))}},{key:"plugins",getData:function(t,e){I()?e.plugins.excludeIE?t(e.EXCLUDED):t(f(e)):t(p(e))}},{key:"canvas",getData:function(t,e){P()?t(E(e)):t(e.NOT_AVAILABLE)}},{key:"webgl",getData:function(t,e){L()?t(C()):t(e.NOT_AVAILABLE)}},{key:"webglVendorAndRenderer",getData:function(t){L()?t(O()):t()}},{key:"adBlock",getData:function(t){t(k())}},{key:"hasLiedLanguages",getData:function(t){t(B())}},{key:"hasLiedResolution",getData:function(t){t(R())}},{key:"hasLiedOs",getData:function(t){t(x())}},{key:"hasLiedBrowser",getData:function(t){t(D())}},{key:"touchSupport",getData:function(t){t(A())}},{key:"fonts",getData:function(t,e){var r=["monospace","sans-serif","serif"],n=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];e.fonts.extendedJsFonts&&(n=n.concat(["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"])),n=(n=n.concat(e.fonts.userDefinedFonts)).filter((function(t,e){return n.indexOf(t)===e}));var i=document.getElementsByTagName("body")[0],a=document.createElement("div"),o=document.createElement("div"),s={},c={},u=function(){var t=document.createElement("span");return t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="72px",t.style.fontStyle="normal",t.style.fontWeight="normal",t.style.letterSpacing="normal",t.style.lineBreak="auto",t.style.lineHeight="normal",t.style.textTransform="none",t.style.textAlign="left",t.style.textDecoration="none",t.style.textShadow="none",t.style.whiteSpace="normal",t.style.wordBreak="normal",t.style.wordSpacing="normal",t.innerHTML="mmmmmmmmmmlli",t},h=function(t,e){var r=u();return r.style.fontFamily="'"+t+"',"+e,r},l=function(t){for(var e=!1,n=0;n<r.length;n++)if(e=t[n].offsetWidth!==s[r[n]]||t[n].offsetHeight!==c[r[n]])return e;return e},d=function(){for(var t=[],e=0,n=r.length;e<n;e++){var i=u();i.style.fontFamily=r[e],a.appendChild(i),t.push(i)}return t}();i.appendChild(a);for(var p=0,f=r.length;p<f;p++)s[r[p]]=d[p].offsetWidth,c[r[p]]=d[p].offsetHeight;var g=function(){for(var t={},e=0,i=n.length;e<i;e++){for(var a=[],s=0,c=r.length;s<c;s++){var u=h(n[e],r[s]);o.appendChild(u),a.push(u)}t[n[e]]=a}return t}();i.appendChild(o);for(var m=[],y=0,v=n.length;y<v;y++)l(g[n[y]])&&m.push(n[y]);i.removeChild(o),i.removeChild(a),t(m)},pauseBefore:!0},{key:"fontsFlash",getData:function(t,e){return N()?_()?e.fonts.swfPath?void M((function(e){t(e)}),e):t("missing options.fonts.swfPath"):t("flash not installed"):t("swf object not loaded")},pauseBefore:!0},{key:"audio",getData:function(t,e){var r=e.audio;if(r.excludeIOS11&&navigator.userAgent.match(/OS 11.+Version\/11.+Safari/))return t(e.EXCLUDED);var n=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(null==n)return t(e.NOT_AVAILABLE);var i=new n(1,44100,44100),a=i.createOscillator();a.type="triangle",a.frequency.setValueAtTime(1e4,i.currentTime);var o=i.createDynamicsCompressor();c([["threshold",-50],["knee",40],["ratio",12],["reduction",-20],["attack",0],["release",.25]],(function(t){void 0!==o[t[0]]&&"function"==typeof o[t[0]].setValueAtTime&&o[t[0]].setValueAtTime(t[1],i.currentTime)})),a.connect(o),o.connect(i.destination),a.start(0),i.startRendering();var s=setTimeout((function(){return console.warn('Audio fingerprint timed out. Please report bug at https://github.com/Valve/fingerprintjs2 with your user agent: "'+navigator.userAgent+'".'),i.oncomplete=function(){},i=null,t("audioTimeout")}),r.timeout);i.oncomplete=function(e){var r;try{clearTimeout(s),r=e.renderedBuffer.getChannelData(0).slice(4500,5e3).reduce((function(t,e){return t+Math.abs(e)}),0).toString(),a.disconnect(),o.disconnect()}catch(e){return void t(e)}t(r)}}},{key:"enumerateDevices",getData:function(t,e){if(!h())return t(e.NOT_AVAILABLE);navigator.mediaDevices.enumerateDevices().then((function(e){t(e.map((function(t){return"id="+t.deviceId+";gid="+t.groupId+";"+t.kind+";"+t.label})))})).catch((function(e){t(e)}))}}],U=function(t){throw new Error("'new Fingerprint()' is deprecated, see https://github.com/Valve/fingerprintjs2#upgrade-guide-from-182-to-200")};return U.get=function(t,e){e?t||(t={}):(e=t,t={}),function(t,e){if(null==e)return t;var r,n;for(n in e)null==(r=e[n])||Object.prototype.hasOwnProperty.call(t,n)||(t[n]=r)}(t,s),t.components=t.extraComponents.concat(j);var r={data:[],addPreprocessedComponent:function(e,n){"function"==typeof t.preprocessor&&(n=t.preprocessor(e,n)),r.data.push({key:e,value:n})}},n=-1,i=function(a){if((n+=1)>=t.components.length)e(r.data);else{var o=t.components[n];if(t.excludes[o.key])i(!1);else{if(!a&&o.pauseBefore)return n-=1,void setTimeout((function(){i(!0)}),1);try{o.getData((function(t){r.addPreprocessedComponent(o.key,t),i(!1)}),t)}catch(t){r.addPreprocessedComponent(o.key,String(t)),i(!1)}}}};i(!1)},U.getPromise=function(t){return new Promise((function(e,r){U.get(t,e)}))},U.getV18=function(t,e){return null==e&&(e=t,t={}),U.get(t,(function(r){for(var n=[],i=0;i<r.length;i++){var a=r[i];if(a.value===(t.NOT_AVAILABLE||"not available"))n.push({key:a.key,value:"unknown"});else if("plugins"===a.key)n.push({key:"plugins",value:u(a.value,(function(t){var e=u(t[2],(function(t){return t.join?t.join("~"):t})).join(",");return[t[0],t[1],e].join("::")}))});else if(-1!==["canvas","webgl"].indexOf(a.key))n.push({key:a.key,value:a.value.join("~")});else if(-1!==["sessionStorage","localStorage","indexedDb","addBehavior","openDatabase"].indexOf(a.key)){if(!a.value)continue;n.push({key:a.key,value:1})}else a.value?n.push(a.value.join?{key:a.key,value:a.value.join(";")}:a):n.push({key:a.key,value:a.value})}var s=o(u(n,(function(t){return t.value})).join("~~~"),31);e(s,n)}))},U.x64hash128=o,U.VERSION="2.0.0",U},(_i=ji).exports?_i.exports=Vi():Mi.exports?Mi.exports=Vi():Mi.Fingerprint2=Vi();var Ui=ji.exports;const Fi=t=>{(console?console.log:()=>{})(t)},zi=async()=>{let t;try{window&&(await function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;return new Promise((e=>{setTimeout(e,t)}))}(550),t=await(async()=>{try{const t=await Ui.getPromise();if(t&&Array.isArray(t)){const e=t.filter((t=>"not available"!==t.value)).sort(((t,e)=>t.key>e.key?1:t.key<e.key?-1:0)).map((t=>t.value)),r=e&&e.join(""),n=31;return Ui.x64hash128(r,n)}Fi("Device ID could not be calculated")}catch(t){Fi(t)}return null})())}catch(t){Fi("Device ID could not be calculated but we are moving on with the transaction")}return t},qi={cookieTestUrl:"https://legacy-staging.paystack.co/test-iframe/start.html",publishableKey:"uFmz/uE/SDT6GupOrSEXIZXGByjQ0zFkPyc9LqKHFqnTI0WPN3JS5kQPo/j9or0TOXlqMQj2lzHn/UGsQT4XeQ==",publicKey:"-----BEGIN PUBLIC KEY-----\r\nMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALhZs/7hP0g0+hrqTq0hFyGVxgco0NMx\r\nZD8nPS6ihxap0yNFjzdyUuZED6P4/aK9Ezl5ajEI9pcx5/1BrEE+F3kCAwEAAQ==\r\n-----END PUBLIC KEY-----"},Hi={...qi,checkoutUrl:"http://localhost:8080/",paymentBaseUrl:"https://legacy-staging.paystack.co/",paystackApiUrl:"https://studio-api.paystack.co/",pusherKey:"1c7b262ee18455815893",pusherUrl:"https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js"},$i={...qi,checkoutUrl:"https://checkout-studio.paystack.com/",paymentBaseUrl:"https://legacy-staging.paystack.co/",paystackApiUrl:"https://studio-api.paystack.co/",pusherKey:"1c7b262ee18455815893",pusherUrl:"https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js"},Gi={...qi,checkoutUrl:"https://checkout.paystack.com/",paymentBaseUrl:"https://standard.paystack.co/",paystackApiUrl:"https://api.paystack.co/",pusherKey:"8e4b9b7ca3418bd5cdc8",pusherUrl:"https://checkout.paystack.com/static/vendor/pusher.min.js"},Ki={dev:Hi,staging:$i,production:Gi}[(window||process.env).paystackEnvironment]||Gi,Wi=()=>{},Xi="authorized";var Zi={authorized(t){const{message:e,status:r,errors:n,...i}=t;return{status:Xi,message:e||"Payment authorized successfully",data:i}},success(t){const{message:e,status:r,errors:n,...i}=t;return{status:"success",message:e||"Successful",data:i}},pending(t){const{message:e,status:r,errors:n,...i}=t;return{status:"pending",message:e||"Payment in progress",data:i}},getCleanResponse(t,e){const{message:r,status:n,errors:i,...a}=t;return{status:n,message:r||e,data:a}},auth(t){const{status:e,message:r,otpmessage:n,...i}=t;return{status:"auth",message:n||r||"Authentication required",data:i}},requery(t){const{message:e}=t;return{status:"requery",message:e||"Requery"}},requestCustomField(t){const{message:e,type:r,format:n,field:i}=t;return{status:"custom_field",message:e,data:{type:r,format:n,field:i}}},error(t){const e={status:"failed",message:t.message||"Failed",errors:t.errors||[]};return t.bank&&(e.bank=t.bank),e},parse(t){const e="object"==typeof t?t:{};return e.data&&"object"==typeof e.data&&(Object.assign(e,e.data),delete e.data),["true",!0,"success"].includes(e.status)?this.success(e):e.status===Xi?this.authorized(e):"pending"===e.status?this.pending(e):"requery"===e.status?this.requery(e):"send"===e.status?this.requestCustomField(e):["transfer-credit-request-received","transfer-credit-request-pending","transfer-credit-request-rejected"].includes(e.status)?this.getCleanResponse(e,"Transfer credit request"):"incorrect-amount-sent"===e.status?this.getCleanResponse(e,"Incorrect amount sent"):"awaiting_registration_token"===e.status?this.getCleanResponse(e):e.auth&&"none"!==e.auth?this.auth(e):this.error(e)}};const Ji=()=>window?new Promise(((t,e)=>{const r=new XMLHttpRequest;r.open("GET",Ki.pusherUrl),r.onload=()=>{if(r.status>=200&&r.status<300){const e=document.createElement("script");e.appendChild(document.createTextNode(r.responseText)),document.head.appendChild(e),t()}else e(r.statusText)},r.onerror=()=>e(r.statusText),r.send(null)})):Promise.reject(new Error("Window object not available")),Yi=(t,e,r)=>{const{channel:n,paymentMethod:i}=t;let a;window&&window.Pusher&&(a=new window.Pusher(Ki.pusherKey,{cluster:"eu",disableStats:!0}));const o={status:"error",message:"We could not listen for charge response. Use transaction.requery() to check the status."},s=()=>{a.unsubscribe(n)};if(!a)return r({status:"error",message:"We could not listen for charge response."},Wi);const c=a.subscribe(n);c.bind("pusher:subscription_succeeded",(()=>{e.isListening=!0})),c.bind("pusher:subscription_error",(()=>{e.isListening=!1,r(o,Wi)})),c.bind("response",(t=>{const n=Zi.parse(t);e.logAPIResponse(n,i),r(n,s)}))};var Qi,ta={exports:{}},ea=function(t,e){return function(){return t.apply(e,arguments)}},ra=ea,na=Object.prototype.toString,ia=(Qi=Object.create(null),function(t){var e=na.call(t);return Qi[e]||(Qi[e]=e.slice(8,-1).toLowerCase())});function aa(t){return t=t.toLowerCase(),function(e){return ia(e)===t}}function oa(t){return Array.isArray(t)}function sa(t){return void 0===t}var ca=aa("ArrayBuffer");function ua(t){return"number"==typeof t}function ha(t){return null!==t&&"object"==typeof t}function la(t){if("object"!==ia(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var da=aa("Date"),pa=aa("File"),fa=aa("Blob"),ga=aa("FileList");function ma(t){return"[object Function]"===na.call(t)}var ya=aa("URLSearchParams");function va(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),oa(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}var ba,Ta=(ba="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return ba&&t instanceof ba});var Sa,wa=aa("HTMLFormElement"),Aa=(Sa=Object.prototype.hasOwnProperty,function(t,e){return Sa.call(t,e)}),Ea={isArray:oa,isArrayBuffer:ca,isBuffer:function(t){return null!==t&&!sa(t)&&null!==t.constructor&&!sa(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||na.call(t)===e||ma(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&ca(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:ua,isObject:ha,isPlainObject:la,isEmptyObject:function(t){return t&&0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype},isUndefined:sa,isDate:da,isFile:pa,isBlob:fa,isFunction:ma,isStream:function(t){return ha(t)&&ma(t.pipe)},isURLSearchParams:ya,isStandardBrowserEnv:function(){var t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:va,merge:function t(){var e={};function r(r,n){la(e[n])&&la(r)?e[n]=t(e[n],r):la(r)?e[n]=t({},r):oa(r)?e[n]=r.slice():e[n]=r}for(var n=0,i=arguments.length;n<i;n++)va(arguments[n],r);return e},extend:function(t,e,r){return va(e,(function(e,n){t[n]=r&&"function"==typeof e?ra(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,r,n){t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)},toFlatObject:function(t,e,r,n){var i,a,o,s={};if(e=e||{},null==t)return e;do{for(a=(i=Object.getOwnPropertyNames(t)).length;a-- >0;)o=i[a],n&&!n(o,t,e)||s[o]||(e[o]=t[o],s[o]=!0);t=!1!==r&&Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:ia,kindOfTest:aa,endsWith:function(t,e,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;var n=t.indexOf(e,r);return-1!==n&&n===r},toArray:function(t){if(!t)return null;if(oa(t))return t;var e=t.length;if(!ua(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r},isTypedArray:Ta,isFileList:ga,forEachEntry:function(t,e){for(var r,n=(t&&t[Symbol.iterator]).call(t);(r=n.next())&&!r.done;){var i=r.value;e.call(t,i[0],i[1])}},matchAll:function(t,e){for(var r,n=[];null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:wa,hasOwnProperty:Aa},Ca=Ea;function Oa(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Ca.inherits(Oa,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var ka=Oa.prototype,Ba={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(t){Ba[t]={value:t}})),Object.defineProperties(Oa,Ba),Object.defineProperty(ka,"isAxiosError",{value:!0}),Oa.from=function(t,e,r,n,i,a){var o=Object.create(ka);return Ca.toFlatObject(t,o,(function(t){return t!==Error.prototype})),Oa.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,a&&Object.assign(o,a),o};var Ra=Oa,xa="object"==typeof self?self.FormData:window.FormData,Da=Ea,Pa=Ra,La=xa;function Ia(t){return Da.isPlainObject(t)||Da.isArray(t)}function Na(t){return Da.endsWith(t,"[]")?t.slice(0,-2):t}function _a(t,e,r){return t?t.concat(e).map((function(t,e){return t=Na(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}var Ma=Da.toFlatObject(Da,{},null,(function(t){return/^is[A-Z]/.test(t)}));var Va=function(t,e,r){if(!Da.isObject(t))throw new TypeError("target must be an object");e=e||new(La||FormData);var n,i=(r=Da.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Da.isUndefined(e[t])}))).metaTokens,a=r.visitor||h,o=r.dots,s=r.indexes,c=(r.Blob||"undefined"!=typeof Blob&&Blob)&&((n=e)&&Da.isFunction(n.append)&&"FormData"===n[Symbol.toStringTag]&&n[Symbol.iterator]);if(!Da.isFunction(a))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(Da.isDate(t))return t.toISOString();if(!c&&Da.isBlob(t))throw new Pa("Blob is not supported. Use a Buffer instead.");return Da.isArrayBuffer(t)||Da.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function h(t,r,n){var a=t;if(t&&!n&&"object"==typeof t)if(Da.endsWith(r,"{}"))r=i?r:r.slice(0,-2),t=JSON.stringify(t);else if(Da.isArray(t)&&function(t){return Da.isArray(t)&&!t.some(Ia)}(t)||Da.isFileList(t)||Da.endsWith(r,"[]")&&(a=Da.toArray(t)))return r=Na(r),a.forEach((function(t,n){!Da.isUndefined(t)&&e.append(!0===s?_a([r],n,o):null===s?r:r+"[]",u(t))})),!1;return!!Ia(t)||(e.append(_a(n,r,o),u(t)),!1)}var l=[],d=Object.assign(Ma,{defaultVisitor:h,convertValue:u,isVisitable:Ia});if(!Da.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!Da.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Da.forEach(r,(function(r,i){!0===(!Da.isUndefined(r)&&a.call(e,r,Da.isString(i)?i.trim():i,n,d))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e},ja=Va;function Ua(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,(function(t){return e[t]}))}function Fa(t,e){this._pairs=[],t&&ja(t,this,e)}var za=Fa.prototype;za.append=function(t,e){this._pairs.push([t,e])},za.toString=function(t){var e=t?function(e){return t.call(this,e,Ua)}:Ua;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var qa=Fa,Ha=Ea,$a=qa;function Ga(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Ka=function(t,e,r){if(!e)return t;var n=t.indexOf("#");-1!==n&&(t=t.slice(0,n));var i=r&&r.encode||Ga,a=Ha.isURLSearchParams(e)?e.toString():new $a(e,r).toString(i);return a&&(t+=(-1===t.indexOf("?")?"?":"&")+a),t},Wa=Ea;function Xa(){this.handlers=[]}Xa.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},Xa.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},Xa.prototype.clear=function(){this.handlers&&(this.handlers=[])},Xa.prototype.forEach=function(t){Wa.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var Za=Xa,Ja=Ea,Ya=function(t,e){Ja.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},Qa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},to={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:qa,FormData:FormData,Blob:Blob},protocols:["http","https","file","blob","url","data"]},eo=Va,ro=to,no=Ea;var io=function(t){function e(t,r,n,i){var a=t[i++],o=Number.isFinite(+a),s=i>=t.length;return a=!a&&no.isArray(n)?n.length:a,s?(no.hasOwnProperty(n,a)?n[a]=[n[a],r]:n[a]=r,!o):(n[a]&&no.isObject(n[a])||(n[a]=[]),e(t,r,n[a],i)&&no.isArray(n[a])&&(n[a]=function(t){var e,r,n={},i=Object.keys(t),a=i.length;for(e=0;e<a;e++)n[r=i[e]]=t[r];return n}(n[a])),!o)}if(no.isFormData(t)&&no.isFunction(t.entries)){var r={};return no.forEachEntry(t,(function(t,n){e(function(t){return no.matchAll(/\w+|\[(\w*)]/g,t).map((function(t){return"[]"===t[0]?"":t[1]||t[0]}))}(t),n,r,0)})),r}return null},ao=Ra,oo=Ea,so=oo.isStandardBrowserEnv()?{write:function(t,e,r,n,i,a){var o=[];o.push(t+"="+encodeURIComponent(e)),oo.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),oo.isString(n)&&o.push("path="+n),oo.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},co=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)},uo=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},ho=function(t,e){return t&&!co(e)?uo(t,e):e},lo=Ea,po=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],fo=Ea,go=fo.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=fo.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0},mo=Ra;function yo(t,e,r){mo.call(this,null==t?"canceled":t,mo.ERR_CANCELED,e,r),this.name="CanceledError"}Ea.inherits(yo,mo,{__CANCEL__:!0});var vo=yo,bo=Ea,To=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new ao("Request failed with status code "+r.status,[ao.ERR_BAD_REQUEST,ao.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)},So=so,wo=Ka,Ao=ho,Eo=function(t){var e,r,n,i={};return t?(lo.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=lo.trim(t.slice(0,n)).toLowerCase(),r=lo.trim(t.slice(n+1)),e){if(i[e]&&po.indexOf(e)>=0)return;i[e]="set-cookie"===e?(i[e]?i[e]:[]).concat([r]):i[e]?i[e]+", "+r:r}})),i):i},Co=go,Oo=Qa,ko=Ra,Bo=vo,Ro=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""},xo=to,Do=function(t){return new Promise((function(e,r){var n,i=t.data,a=t.headers,o=t.responseType,s=t.withXSRFToken;function c(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}bo.isFormData(i)&&bo.isStandardBrowserEnv()&&delete a["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var h=t.auth.username||"",l=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(h+":"+l)}var d=Ao(t.baseURL,t.url);function p(){if(u){var n="getAllResponseHeaders"in u?Eo(u.getAllResponseHeaders()):null,i={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};To((function(t){e(t),c()}),(function(t){r(t),c()}),i),u=null}}if(u.open(t.method.toUpperCase(),wo(d,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(p)},u.onabort=function(){u&&(r(new ko("Request aborted",ko.ECONNABORTED,t,u)),u=null)},u.onerror=function(){r(new ko("Network Error",ko.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||Oo;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new ko(e,n.clarifyTimeoutError?ko.ETIMEDOUT:ko.ECONNABORTED,t,u)),u=null},bo.isStandardBrowserEnv()&&(s&&bo.isFunction(s)&&(s=s(t)),s||!1!==s&&Co(d))){var f=t.xsrfHeaderName&&t.xsrfCookieName&&So.read(t.xsrfCookieName);f&&(a[t.xsrfHeaderName]=f)}"setRequestHeader"in u&&bo.forEach(a,(function(t,e){void 0===i&&"content-type"===e.toLowerCase()?delete a[e]:u.setRequestHeader(e,t)})),bo.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(e){u&&(r(!e||e.type?new Bo(null,t,req):e),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),i||!1===i||0===i||""===i||(i=null);var g=Ro(d);g&&-1===xo.protocols.indexOf(g)?r(new ko("Unsupported protocol "+g+":",ko.ERR_BAD_REQUEST,t)):u.send(i)}))},Po=Ea,Lo=Ya,Io=Ra,No=Va,_o=function(t,e){return eo(t,new ro.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return n.defaultVisitor.apply(this,arguments)}},e))},Mo=to,Vo=io,jo={"Content-Type":"application/x-www-form-urlencoded"};function Uo(t,e){!Po.isUndefined(t)&&Po.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var Fo,zo={transitional:Qa,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Fo=Do),Fo),transformRequest:[function(t,e){Lo(e,"Accept"),Lo(e,"Content-Type");var r,n=e&&e["Content-Type"]||"",i=n.indexOf("application/json")>-1,a=Po.isObject(t);if(a&&Po.isHTMLForm(t)&&(t=new FormData(t)),Po.isFormData(t))return i?JSON.stringify(Vo(t)):t;if(Po.isArrayBuffer(t)||Po.isBuffer(t)||Po.isStream(t)||Po.isFile(t)||Po.isBlob(t))return t;if(Po.isArrayBufferView(t))return t.buffer;if(Po.isURLSearchParams(t))return Uo(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();if(a){if(-1!==n.indexOf("application/x-www-form-urlencoded"))return _o(t,this.formSerializer).toString();if((r=Po.isFileList(t))||n.indexOf("multipart/form-data")>-1){var o=this.env&&this.env.FormData;return No(r?{"files[]":t}:t,o&&new o,this.formSerializer)}}return a||i?(Uo(e,"application/json"),function(t,e,r){if(Po.isString(t))try{return(e||JSON.parse)(t),Po.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||zo.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&Po.isString(t)&&(r&&!this.responseType||n)){var i=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw Io.from(t,Io.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mo.classes.FormData,Blob:Mo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Po.forEach(["delete","get","head"],(function(t){zo.headers[t]={}})),Po.forEach(["post","put","patch"],(function(t){zo.headers[t]=Po.merge(jo)}));var qo=zo,Ho=Ea,$o=qo,Go=function(t){return!(!t||!t.__CANCEL__)},Ko=Ea,Wo=function(t,e,r,n){var i=this||$o;return Ho.forEach(n,(function(n){t=n.call(i,t,e,r)})),t},Xo=Go,Zo=qo,Jo=vo,Yo=Ya;function Qo(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Jo}var ts=Ea,es=function(t,e){e=e||{};var r={};function n(t,e){return ts.isPlainObject(t)&&ts.isPlainObject(e)?ts.merge(t,e):ts.isEmptyObject(e)?ts.merge({},t):ts.isPlainObject(e)?ts.merge({},e):ts.isArray(e)?e.slice():e}function i(r){return ts.isUndefined(e[r])?ts.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function a(t){if(!ts.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return ts.isUndefined(e[r])?ts.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function s(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return ts.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||i,n=e(t);ts.isUndefined(n)&&e!==s||(r[t]=n)})),r},rs="0.28.0",ns=rs,is=Ra,as={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){as[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var os={};as.transitional=function(t,e,r){function n(t,e){return"[Axios v"+ns+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,i,a){if(!1===t)throw new is(n(i," has been removed"+(e?" in "+e:"")),is.ERR_DEPRECATED);return e&&!os[i]&&(os[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,a)}};var ss={assertOptions:function(t,e,r){if("object"!=typeof t)throw new is("options must be an object",is.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),i=n.length;i-- >0;){var a=n[i],o=e[a];if(o){var s=t[a],c=void 0===s||o(s,a,t);if(!0!==c)throw new is("option "+a+" must be "+c,is.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new is("Unknown option "+a,is.ERR_BAD_OPTION)}},validators:as},cs=Ea,us=Ka,hs=Za,ls=function(t){return Qo(t),t.headers=t.headers||{},t.data=Wo.call(t,t.data,t.headers,null,t.transformRequest),Yo(t.headers,"Accept"),Yo(t.headers,"Content-Type"),t.headers=Ko.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Ko.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||Zo.adapter)(t).then((function(e){return Qo(t),e.data=Wo.call(t,e.data,e.headers,e.status,t.transformResponse),e}),(function(e){return Xo(e)||(Qo(t),e&&e.response&&(e.response.data=Wo.call(t,e.response.data,e.response.headers,e.response.status,t.transformResponse))),Promise.reject(e)}))},ds=es,ps=ho,fs=ss,gs=fs.validators;function ms(t){this.defaults=t,this.interceptors={request:new hs,response:new hs}}ms.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=ds(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&fs.assertOptions(r,{silentJSONParsing:gs.transitional(gs.boolean),forcedJSONParsing:gs.transitional(gs.boolean),clarifyTimeoutError:gs.transitional(gs.boolean)},!1);var n=e.paramsSerializer;cs.isFunction(n)&&(e.paramsSerializer={serialize:n});var i=[],a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));var o,s=[];if(this.interceptors.response.forEach((function(t){s.push(t.fulfilled,t.rejected)})),!a){var c=[ls,void 0];for(Array.prototype.unshift.apply(c,i),c=c.concat(s),o=Promise.resolve(e);c.length;)o=o.then(c.shift(),c.shift());return o}for(var u=e;i.length;){var h=i.shift(),l=i.shift();try{u=h(u)}catch(t){l(t);break}}try{o=ls(u)}catch(t){return Promise.reject(t)}for(;s.length;)o=o.then(s.shift(),s.shift());return o},ms.prototype.getUri=function(t){t=ds(this.defaults,t);var e=ps(t.baseURL,t.url);return us(e,t.params,t.paramsSerializer)},cs.forEach(["delete","get","head","options"],(function(t){ms.prototype[t]=function(e,r){return this.request(ds(r||{},{method:t,url:e,data:(r||{}).data}))}})),cs.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,i){return this.request(ds(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ms.prototype[t]=e(),ms.prototype[t+"Form"]=e(!0)}));var ys=ms,vs=vo;function bs(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){for(var e=r._listeners.length;e-- >0;)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,i){r.reason||(r.reason=new vs(t,n,i),e(r.reason))}))}bs.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},bs.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},bs.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},bs.source=function(){var t;return{token:new bs((function(e){t=e})),cancel:t}};var Ts=bs,Ss=Ea,ws=Ea,As=ea,Es=ys,Cs=es,Os=io;var ks=function t(e){var r=new Es(e),n=As(Es.prototype.request,r);return ws.extend(n,Es.prototype,r),ws.extend(n,r),n.create=function(r){return t(Cs(e,r))},n}(qo);ks.Axios=Es,ks.CanceledError=vo,ks.CancelToken=Ts,ks.isCancel=Go,ks.VERSION=rs,ks.toFormData=Va,ks.AxiosError=Ra,ks.Cancel=ks.CanceledError,ks.all=function(t){return Promise.all(t)},ks.spread=function(t){return function(e){return t.apply(null,e)}},ks.isAxiosError=function(t){return Ss.isObject(t)&&!0===t.isAxiosError},ks.formToJSON=function(t){return Os(ws.isHTMLForm(t)?new FormData(t):t)},ta.exports=ks,ta.exports.default=ks;var Bs=ta.exports,Rs=Object.prototype.hasOwnProperty,xs=Array.isArray,Ds=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ps=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},Ls={arrayToObject:Ps,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],a=i.obj[i.prop],o=Object.keys(a),s=0;s<o.length;++s){var c=o[s],u=a[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(e.push({obj:a,prop:c}),r.push(u))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(xs(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r){if(0===t.length)return t;var n="string"==typeof t?t:String(t);if("iso-8859-1"===r)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var i="",a=0;a<n.length;++a){var o=n.charCodeAt(a);45===o||46===o||95===o||126===o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?i+=n.charAt(a):o<128?i+=Ds[o]:o<2048?i+=Ds[192|o>>6]+Ds[128|63&o]:o<55296||o>=57344?i+=Ds[224|o>>12]+Ds[128|o>>6&63]+Ds[128|63&o]:(a+=1,o=65536+((1023&o)<<10|1023&n.charCodeAt(a)),i+=Ds[240|o>>18]+Ds[128|o>>12&63]+Ds[128|o>>6&63]+Ds[128|63&o])}return i},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(xs(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Rs.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var i=e;return xs(e)&&!xs(r)&&(i=Ps(e,n)),xs(e)&&xs(r)?(r.forEach((function(r,i){if(Rs.call(e,i)){var a=e[i];a&&"object"==typeof a&&r&&"object"==typeof r?e[i]=t(a,r,n):e.push(r)}else e[i]=r})),e):Object.keys(r).reduce((function(e,i){var a=r[i];return Rs.call(e,i)?e[i]=t(e[i],a,n):e[i]=a,e}),i)}},Is=String.prototype.replace,Ns=/%20/g,_s={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ms=Ls.assign({default:_s.RFC3986,formatters:{RFC1738:function(t){return Is.call(t,Ns,"+")},RFC3986:function(t){return String(t)}}},_s),Vs=Ls,js=Ms,Us=Object.prototype.hasOwnProperty,Fs={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},zs=Array.isArray,qs=String.prototype.split,Hs=Array.prototype.push,$s=function(t,e){Hs.apply(t,zs(e)?e:[e])},Gs=Date.prototype.toISOString,Ks=js.default,Ws={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Vs.encode,encodeValuesOnly:!1,format:Ks,formatter:js.formatters[Ks],indices:!1,serializeDate:function(t){return Gs.call(t)},skipNulls:!1,strictNullHandling:!1},Xs=function t(e,r,n,i,a,o,s,c,u,h,l,d,p){var f=e;if("function"==typeof s?f=s(r,f):f instanceof Date?f=h(f):"comma"===n&&zs(f)&&(f=f.join(",")),null===f){if(i)return o&&!d?o(r,Ws.encoder,p):r;f=""}if("string"==typeof f||"number"==typeof f||"boolean"==typeof f||Vs.isBuffer(f)){if(o){var g=d?r:o(r,Ws.encoder,p);if("comma"===n&&d){for(var m=qs.call(String(f),","),y="",v=0;v<m.length;++v)y+=(0===v?"":",")+l(o(m[v],Ws.encoder,p));return[l(g)+"="+y]}return[l(g)+"="+l(o(f,Ws.encoder,p))]}return[l(r)+"="+l(String(f))]}var b,T=[];if(void 0===f)return T;if(zs(s))b=s;else{var S=Object.keys(f);b=c?S.sort(c):S}for(var w=0;w<b.length;++w){var A=b[w],E="object"==typeof A&&void 0!==A.value?A.value:f[A];a&&null===f[A]||(zs(f)?$s(T,t(E,"function"==typeof n?n(r,A):r,n,i,a,o,s,c,u,h,l,d,p)):$s(T,t(E,r+(u?"."+A:"["+A+"]"),n,i,a,o,s,c,u,h,l,d,p)))}return T},Zs=Ls,Js=Object.prototype.hasOwnProperty,Ys=Array.isArray,Qs={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Zs.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},tc=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},ec=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},rc=function(t,e){if(Ys(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},nc=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,o=/(\[[^[\]]*])/.exec(i),s=o?i.slice(0,o.index):i,c=[];if(s){if(!r.plainObjects&&Js.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var u=0;null!==(o=a.exec(i))&&u<r.depth;){if(u+=1,!r.plainObjects&&Js.call(Object.prototype,o[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(o[1])}return o&&c.push("["+i.slice(o.index)+"]"),function(t,e,r,n){for(var i=n?e:ec(e,r),a=t.length-1;a>=0;--a){var o,s=t[a];if("[]"===s&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[])[u]=i:"__proto__"!==c&&(o[c]=i):o={0:i}}i=o}return i}(c,e,r,n)}},ic=function(t,e){var r,n=t,i=function(t){if(!t)return Ws;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||Ws.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=js.default;if(void 0!==t.format){if(!Us.call(js.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=js.formatters[r],i=Ws.filter;return("function"==typeof t.filter||zs(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Ws.addQueryPrefix,allowDots:void 0===t.allowDots?Ws.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Ws.charsetSentinel,delimiter:void 0===t.delimiter?Ws.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Ws.encode,encoder:"function"==typeof t.encoder?t.encoder:Ws.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Ws.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Ws.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Ws.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Ws.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):zs(i.filter)&&(r=i.filter);var a,o=[];if("object"!=typeof n||null===n)return"";a=e&&e.arrayFormat in Fs?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=Fs[a];r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var c=0;c<r.length;++c){var u=r[c];i.skipNulls&&null===n[u]||$s(o,Xs(n[u],u,s,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.formatter,i.encodeValuesOnly,i.charset))}var h=o.join(i.delimiter),l=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?l+="utf8=%26%2310003%3B&":l+="utf8=%E2%9C%93&"),h.length>0?l+h:""},ac=function(t,e){var r=function(t){if(!t)return Qs;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?Qs.charset:t.charset;return{allowDots:void 0===t.allowDots?Qs.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:Qs.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:Qs.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Qs.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:Qs.comma,decoder:"function"==typeof t.decoder?t.decoder:Qs.decoder,delimiter:"string"==typeof t.delimiter||Zs.isRegExp(t.delimiter)?t.delimiter:Qs.delimiter,depth:"number"==typeof t.depth?t.depth:Qs.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:Qs.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:Qs.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:Qs.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Qs.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,a=e.parameterLimit===1/0?void 0:e.parameterLimit,o=i.split(e.delimiter,a),s=-1,c=e.charset;if(e.charsetSentinel)for(r=0;r<o.length;++r)0===o[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===o[r]?c="utf-8":"utf8=%26%2310003%3B"===o[r]&&(c="iso-8859-1"),s=r,r=o.length);for(r=0;r<o.length;++r)if(r!==s){var u,h,l=o[r],d=l.indexOf("]="),p=-1===d?l.indexOf("="):d+1;-1===p?(u=e.decoder(l,Qs.decoder,c),h=e.strictNullHandling?null:""):(u=e.decoder(l.slice(0,p),Qs.decoder,c),h=rc(ec(l.slice(p+1),e),(function(t){return e.decoder(t,Qs.decoder,c)}))),h&&e.interpretNumericEntities&&"iso-8859-1"===c&&(h=tc(h)),l.indexOf("[]=")>-1&&(h=Ys(h)?[h]:h),Js.call(n,u)?n[u]=Zs.combine(n[u],h):n[u]=h}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],c=nc(s,n[s],r,"string"==typeof t);i=Zs.merge(i,c,r)}return Zs.compact(i)},oc={formats:Ms,parse:ac,stringify:ic};const sc=Bs.create({paramsSerializer:t=>{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).filter((e=>![void 0,null].includes(t[e]))).reduce(((e,r)=>({...e,[r]:t[r]})),{})}(t);return oc.stringify(e,{arrayFormat:"brackets"})}}),cc=()=>{try{return window?window.localStorage&&window.localStorage.getItem("i18nextLng")||navigator&&navigator.language:null}catch(t){return null}},uc={requestInline(t){const e=cc(),{connect_account:r}=t,n={...e&&{"Accept-Language":e},...r&&{"x-connect-account":r}},i=new URL("/checkout/request_inline",Ki.paystackApiUrl).toString();return sc.post(i,t,{headers:n}).then((t=>t.data))},requestStandard(t){const e=cc(),r={...e&&{"Accept-Language":e}},n=`${Ki.paystackApiUrl}transaction/verify_access_code/${t}`;return sc.get(n,{headers:r}).then((t=>t.data))},getByAccessCode(t,e){const r=cc(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL(`/transaction/get_by_access_code/${t}`,Ki.paystackApiUrl).toString();return sc.get(i,{headers:n}).then((t=>t.data))},verify(t){const e=cc(),r={...e&&{"Accept-Language":e}},n=`${Ki.paystackApiUrl}transaction/verify/${t}`;return sc.get(n,{headers:r}).then((t=>t.data))},requery(t){const e=cc(),r={...e&&{"Accept-Language":e}},n=`${Ki.paymentBaseUrl}charge/requery/${t}`;return sc.get(n,{headers:r}).then((t=>Zi.parse(t.data)))},markAsAbandoned(t){let{publicKey:e,transactionId:r}=t;const n=`${Ki.paystackApiUrl}transaction/${r}/mark-as-abandoned`,i=cc(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return sc.patch(n,{},{headers:a}).then((t=>t.data))},verifyStatus(t){let{reference:e,publicKey:r}=t;const n=new URL(`transaction/verify_status/${e}`,Ki.paystackApiUrl).toString(),i=cc(),a={Authorization:`Bearer ${r}`,...i&&{"Accept-Language":i}};return sc.get(n,{headers:a}).then((t=>t.data))},initializeCustomerSubscriptionAuthorization(t,e){const r=new URL("/customer/authorization/initialize_subscription",Ki.paystackApiUrl).toString(),n={Authorization:`Bearer ${e}`};return sc.post(r,t,{headers:n}).then((t=>t.data))}},hc={generateManagedAccount(t,e){const r=cc(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL("checkout/pay_with_transfer",Ki.paystackApiUrl).toString();return sc.post(i,t,{headers:n}).then((t=>Zi.parse(t.data)))},incorrectAmountDecision(t,e){const r=cc(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL("pay-with-transfer/incorrect-amount/decision",Ki.paystackApiUrl).toString();return sc.post(i,t,{headers:n}).then((t=>Zi.parse(t.data)))},authenticatePayer(t,e){const r=cc(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL("pay-with-transfer/authenticate-payer",Ki.paystackApiUrl).toString();return sc.post(i,t,{headers:n}).then((t=>Zi.parse(t.data)))}};var lc={getManagedAccount(t){let{fulfilLateNotification:e,preferredProvider:r}=t;const n={transaction_id:this.id,fulfil_late_notification:e,preferred_provider:r};return hc.generateManagedAccount(n,this.merchant.key).then((t=>("success"===t.status&&(this.bankTransfer=t),t)))},listenForPayWithTransferCharge(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{data:r}=this.bankTransfer,n={channel:r&&r.pusher_channel||e,paymentMethod:"bank_transfer"};return this.listenForCharge(n,t)},sendIncorrectAmountDecision(t){const e={transaction_id:this.id,decision:t};return hc.incorrectAmountDecision(e,this.merchant.key)},sendAuthenticatePayer(t){let{amountPaid:e,payerAccountNumber:r,payerBankSlug:n}=t;const i={transaction_id:this.id,amount:e,payer_account_number:r,payer_bank_slug:n};return hc.authenticatePayer(i,this.merchant.key)}},dc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Boolean(e.sorted),n=Boolean(e.skipIndex),i=Boolean(e.ignorenull),a=function(t){return String(t).replace(/(?:[\0-\x1F"-&\+-\}\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,encodeURIComponent).replace(/ /g,"+").replace(/[!'()~\*]/g,(function(t){return"%"+t.charCodeAt().toString(16).slice(-2).toUpperCase()}))},o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(t);return r?e.sort():e},s=function(t){return t.filter((function(t){return t})).join("&")},c=function(t,e){return s(o(e).map((function(r){return h(t+"["+r+"]",e[r])})))},u=function(t,e){return e.length?s(e.map((function(e,r){return h(n?t+"[]":t+"["+r+"]",e)}))):a(t+"[]")},h=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0===e?"undefined":dc(e),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return e===n?n=i?n:a(t)+"="+n:/string|number|boolean/.test(r)?n=a(t)+"="+a(e):Array.isArray(e)?n=u(t,e):"object"===r&&(n=c(t,e)),n};return t&&s(o(t).map((function(e){return h(e,t[e])})))};const fc={charge(t){let{transactionId:e,phoneNumber:r}=t;const n=`${Ki.paymentBaseUrl}payattitude/charge/${e}`,i=cc(),a={"Content-Type":"application/x-www-form-urlencoded",...i&&{"Accept-Language":i}},o=pc({phone_number:r});return sc.post(n,o,{headers:a}).then((t=>{let{data:e}=t;return Zi.parse(e)}))}},gc="payattitude";var mc={chargePayattitude(t){let{phoneNumber:e}=t;const r={transactionId:this.id,phoneNumber:e};return fc.charge(r).then((t=>(this.logAPIResponse(t,gc),t)))},listenForPayattitudeCharge(t){const e={paymentMethod:gc,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}};const yc={getEFTUrl(t){let{eftGateway:e}=t;return new Promise(((t,r)=>{e||r(Error("Please pass the `eftGateway`"));const n=`${Ki.paymentBaseUrl}eft/${e}/${this.id}`;t(Zi.success({url:n}))}))},listenForEFTCharge(t){const e={channel:`EFT_${this.id}`,paymentMethod:"eft"};return this.listenForCharge(e,t)}},vc={validateApplePaySession(t){let{sessionUrl:e,displayName:r,transactionId:n,domainName:i}=t;const a=cc(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s=`${Ki.paymentBaseUrl}applepay/validate-session`,c=pc({sessionUrl:e,displayName:r,domainName:i,transaction:n});return sc.post(s,c,{headers:o}).then((t=>Zi.parse(t.data)))},charge(t){let{transactionId:e,paymentObject:r}=t;const n=cc(),i={"Content-Type":"application/x-www-form-urlencoded",...n&&{"Accept-Language":n}},a=`${Ki.paymentBaseUrl}applepay/charge`,o=pc({paymentObject:r,transaction:e});return sc.post(a,o,{headers:i}).then((t=>Zi.parse(t.data)))}},bc="apple pay";var Tc={validateApplePaySession(t){let{sessionUrl:e,displayName:r,domainName:n}=t;return this.logAttempt(bc),vc.validateApplePaySession({sessionUrl:e,displayName:r,domainName:n,transactionId:this.id}).then((t=>(this.logAPIResponseMessage(t.message),t)))},chargeApplePay(t){let{paymentObject:e}=t;return vc.charge({transactionId:this.id,device:this.deviceFingerprint,paymentObject:e}).then((t=>(this.logAPIResponse(t,bc),t)))}};const Sc={createOrder(t){const e=`${Ki.paymentBaseUrl}paypal/${t}/create`,r=cc(),n={...r&&{"Accept-Language":r}};return sc.post(e,{headers:n}).then((t=>Zi.parse(t.data)))},captureOrder(t){const e=`${Ki.paymentBaseUrl}paypal/${t}/capture`,r=cc(),n={...r&&{"Accept-Language":r}};return sc.post(e,{headers:n}).then((t=>Zi.parse(t.data)))},getConfig(t){let{publicKey:e,transactionId:r}=t;const n=`${Ki.paystackApiUrl}paypal/config?transaction=${r}`,i=cc(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return sc.get(n,{headers:a}).then((t=>t.data))}},wc="paypal";var Ac={createPayPalOrder(){return this.logAttempt(wc),Sc.createOrder(this.id).then((t=>(this.logAPIResponseMessage(t.message),t)))},capturePayPalOrder(){return Sc.captureOrder(this.id).then((t=>(this.logAPIResponse(t,wc),t)))},getPayPalConfig(){return Sc.getConfig({publicKey:this.merchant.key,transactionId:this.id})}},Ec={exports:{}};function Cc(t){const e=new Ec.exports.JSEncrypt;return e.setPublicKey(Ki.publicKey),e.encrypt(t)}!function(t){var e="0123456789abcdefghijklmnopqrstuvwxyz";function r(t){return e.charAt(t)}function n(t,e){return t&e}function i(t,e){return t|e}function a(t,e){return t^e}function o(t,e){return t&~e}function s(t){if(0==t)return-1;var e=0;return 65535&t||(t>>=16,e+=16),255&t||(t>>=8,e+=8),15&t||(t>>=4,e+=4),3&t||(t>>=2,e+=2),1&t||++e,e}function c(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="=";function l(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=u.charAt(r>>6)+u.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=u.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=u.charAt(r>>2)+u.charAt((3&r)<<4));(3&n.length)>0;)n+=h;return n}function d(t){var e,n="",i=0,a=0;for(e=0;e<t.length&&t.charAt(e)!=h;++e){var o=u.indexOf(t.charAt(e));o<0||(0==i?(n+=r(o>>2),a=3&o,i=1):1==i?(n+=r(a<<2|o>>4),a=15&o,i=2):2==i?(n+=r(a),n+=r(o>>2),a=3&o,i=3):(n+=r(a<<2|o>>4),n+=r(15&o),i=0))}return 1==i&&(n+=r(a<<2)),n}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -12,7 +12,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
12
12
|
|
|
13
13
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
14
|
and limitations under the License.
|
|
15
|
-
***************************************************************************** */var p,f=function(t,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},f(t,e)};function g(t,e){function r(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var m,y={decode:function(t){var e;if(void 0===p){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(p={},e=0;e<16;++e)p[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)p[r.charAt(e)]=e;for(e=0;e<n.length;++e)p[n.charAt(e)]=-1}var i=[],a=0,o=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=p[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);a|=s,++o>=2?(i[i.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return i}},v={decode:function(t){var e;if(void 0===m){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="= \f\n\r\t \u2028\u2029";for(m=Object.create(null),e=0;e<64;++e)m[r.charAt(e)]=e;for(e=0;e<n.length;++e)m[n.charAt(e)]=-1}var i=[],a=0,o=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=m[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);a|=s,++o>=4?(i[i.length]=a>>16,i[i.length]=a>>8&255,i[i.length]=255&a,a=0,o=0):a<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:i[i.length]=a>>10;break;case 3:i[i.length]=a>>16,i[i.length]=a>>8&255}return i},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=v.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return v.decode(t)}},b=1e13,T=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var r,n,i=this.buf,a=i.length;for(r=0;r<a;++r)(n=i[r]*t+e)<b?e=0:n-=(e=0|n/b)*b,i[r]=n;e>0&&(i[r]=e)},t.prototype.sub=function(t){var e,r,n=this.buf,i=n.length;for(e=0;e<i;++e)(r=n[e]-t)<0?(r+=b,t=1):t=0,n[e]=r;for(;0===n[n.length-1];)n.pop()},t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,r=e[e.length-1].toString(),n=e.length-2;n>=0;--n)r+=(b+e[n]).toString().substring(1);return r},t.prototype.valueOf=function(){for(var t=this.buf,e=0,r=t.length-1;r>=0;--r)e=e*b+t[r];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),S="…",w=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,A=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function E(t,e){return t.length>e&&(t=t.substring(0,e)+S),t}var C,k=function(){function t(e,r){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=r)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,r){for(var n="",i=t;i<e;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var r="",n=t;n<e;++n)r+=String.fromCharCode(this.get(n));return r},t.prototype.parseStringUTF=function(t,e){for(var r="",n=t;n<e;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},t.prototype.parseStringBMP=function(t,e){for(var r,n,i="",a=t;a<e;)r=this.get(a++),n=this.get(a++),i+=String.fromCharCode(r<<8|n);return i},t.prototype.parseTime=function(t,e,r){var n=this.parseStringISO(t,e),i=(r?w:A).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},t.prototype.parseInteger=function(t,e){for(var r,n=this.get(t),i=n>127,a=i?255:0,o="";n==a&&++t<e;)n=this.get(t);if(0==(r=e-t))return i?-1:0;if(r>4){for(o=n,r<<=3;!(128&(+o^a));)o=+o<<1,--r;o="("+r+" bit)\n"}i&&(n-=256);for(var s=new T(n),c=t+1;c<e;++c)s.mulAdd(256,this.get(c));return o+s.toString()},t.prototype.parseBitString=function(t,e,r){for(var n=this.get(t),i="("+((e-t-1<<3)-n)+" bit)\n",a="",o=t+1;o<e;++o){for(var s=this.get(o),c=o==e-1?n:0,u=7;u>=c;--u)a+=s>>u&1?"1":"0";if(a.length>r)return i+E(a,r)}return i+a},t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return E(this.parseStringISO(t,e),r);var n=e-t,i="("+n+" byte)\n";n>(r/=2)&&(e=t+r);for(var a=t;a<e;++a)i+=this.hexByte(this.get(a));return n>r&&(i+=S),i},t.prototype.parseOID=function(t,e,r){for(var n="",i=new T,a=0,o=t;o<e;++o){var s=this.get(o);if(i.mulAdd(128,127&s),a+=7,!(128&s)){if(""===n)if((i=i.simplify())instanceof T)i.sub(80),n="2."+i.toString();else{var c=i<80?i<40?0:1:2;n=c+"."+(i-40*c)}else n+="."+i.toString();if(n.length>r)return E(n,r);i=new T,a=0}}return a>0&&(n+=".incomplete"),n},t}(),x=function(){function t(t,e,r,n,i){if(!(n instanceof O))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=r,this.tag=n,this.sub=i}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return E(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return E(this.stream.parseStringISO(e,e+r),t);case 30:return E(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var r=0,n=this.sub.length;r<n;++r)e+=this.sub[r].toPrettyString(t)}return e},t.prototype.posStart=function(){return this.stream.pos},t.prototype.posContent=function(){return this.stream.pos+this.header},t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},t.decodeLength=function(t){var e=t.get(),r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var n=0;n<r;++n)e=256*e+t.get();return e},t.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,r=2*this.length;return t.substr(e,r)},t.decode=function(e){var r;r=e instanceof k?e:new k(e,0);var n=new k(r),i=new O(r),a=t.decodeLength(r),o=r.pos,s=o-n.pos,c=null,u=function(){var e=[];if(null!==a){for(var n=o+a;r.pos<n;)e[e.length]=t.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var i=t.decode(r);if(i.tag.isEOC())break;e[e.length]=i}a=o-r.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(i.tagConstructed)c=u();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var h=0;h<c.length;++h)if(c[h].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){c=null}if(null===c){if(null===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);r.pos=o+Math.abs(a)}return new t(n,s,a,i,c)},t}(),O=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=!!(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new T;do{e=t.get(),r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),B=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],D=(1<<26)/B[B.length-1],P=function(){function t(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;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 n,i=(1<<e)-1,a=!1,o="",s=this.t,c=this.DB-s*this.DB%e;if(s-- >0)for(c<this.DB&&(n=this[s]>>c)>0&&(a=!0,o=r(n));s>=0;)c<e?(n=(this[s]&(1<<c)-1)<<e-c,n|=this[--s]>>(c+=this.DB-e)):(n=this[s]>>(c-=e)&i,c<=0&&(c+=this.DB,--s)),n>0&&(a=!0),a&&(o+=r(n));return a?o:"0"},t.prototype.negate=function(){var e=M();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+K(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var r=M();return this.abs().divRemTo(e,null,r),this.s<0&&r.compareTo(t.ZERO)>0&&e.subTo(r,r),r},t.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new I(e):new L(e),this.exp(t,r)},t.prototype.clone=function(){var t=M();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=M();return this.bitwiseTo(t,n,e),e},t.prototype.or=function(t){var e=M();return this.bitwiseTo(t,i,e),e},t.prototype.xor=function(t){var e=M();return this.bitwiseTo(t,a,e),e},t.prototype.andNot=function(t){var e=M();return this.bitwiseTo(t,o,e),e},t.prototype.not=function(){for(var t=M(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},t.prototype.shiftLeft=function(t){var e=M();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=M();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+s(this[t]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=c(this[r]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:!!(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,i)},t.prototype.clearBit=function(t){return this.changeBit(t,o)},t.prototype.flipBit=function(t){return this.changeBit(t,a)},t.prototype.add=function(t){var e=M();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=M();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=M();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=M();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=M();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=M(),r=M();return this.divRemTo(t,e,r),[e,r]},t.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),a=G(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new I(e):e.isEven()?new N(e):new L(e);var o=[],s=3,c=r-1,u=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=M();for(n.sqrTo(o[1],h);s<=u;)o[s]=M(),n.mulTo(h,o[s-2],o[s]),s+=2}var l,d,p=t.t-1,f=!0,g=M();for(i=K(t[p])-1;p>=0;){for(i>=c?l=t[p]>>i-c&u:(l=(t[p]&(1<<i+1)-1)<<c-i,p>0&&(l|=t[p-1]>>this.DB+i-c)),s=r;!(1&l);)l>>=1,--s;if((i-=s)<0&&(i+=this.DB,--p),f)o[l].copyTo(a),f=!1;else{for(;s>1;)n.sqrTo(a,g),n.sqrTo(g,a),s-=2;s>0?n.sqrTo(a,g):(d=a,a=g,g=d),n.mulTo(g,o[l],a)}for(;p>=0&&!(t[p]&1<<i);)n.sqrTo(a,g),d=a,a=g,g=d,--i<0&&(i=this.DB-1,--p)}return n.revert(a)},t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;for(var n=e.clone(),i=this.clone(),a=G(1),o=G(0),s=G(0),c=G(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(e,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(e,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);n.compareTo(i)>=0?(n.subTo(i,n),r&&a.subTo(s,a),o.subTo(c,o)):(i.subTo(n,i),r&&s.subTo(a,s),c.subTo(o,c))}return 0!=i.compareTo(t.ONE)?t.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},t.prototype.pow=function(t){return this.exp(t,new R)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},t.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=B[B.length-1]){for(e=0;e<B.length;++e)if(r[0]==B[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<B.length;){for(var n=B[e],i=e+1;i<B.length&&n<D;)n*=B[i++];for(n=r.modInt(n);e<i;)if(n%B[e++]==0)return!1}return r.millerRabin(t)},t.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},t.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},t.prototype.fromString=function(e,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(e,r);n=2}this.t=0,this.s=0;for(var i=e.length,a=!1,o=0;--i>=0;){var s=8==n?255&+e[i]:$(e,i);s<0?"-"==e.charAt(i)&&(a=!0):(a=!1,0==o?this[this.t++]=s:o+n>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+=n)>=this.DB&&(o-=this.DB))}8==n&&128&+e[0]&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},t.prototype.lShiftTo=function(t,e){for(var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(t/this.DB),o=this.s<<r&this.DM,s=this.t-1;s>=0;--s)e[s+a+1]=this[s]>>n|o,o=(this[s]&i)<<r;for(s=a-1;s>=0;--s)e[s]=0;e[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,a=(1<<n)-1;e[0]=this[r]>>n;for(var o=r+1;o<this.t;++o)e[o-r-1]|=(this[o]&a)<<i,e[o-r]=this[o]>>n;n>0&&(e[this.t-r-1]|=(this.s&a)<<i),e.t=this.t-r,e.clamp()}},t.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},t.prototype.multiplyTo=function(e,r){var n=this.abs(),i=e.abs(),a=n.t;for(r.t=a+i.t;--a>=0;)r[a]=0;for(a=0;a<i.t;++a)r[a+n.t]=n.am(0,i[a],r,a,0,n.t);r.s=0,r.clamp(),this.s!=e.s&&t.ZERO.subTo(r,r)},t.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,r,n){var i=e.abs();if(!(i.t<=0)){var a=this.abs();if(a.t<i.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=M());var o=M(),s=this.s,c=e.s,u=this.DB-K(i[i.t-1]);u>0?(i.lShiftTo(u,o),a.lShiftTo(u,n)):(i.copyTo(o),a.copyTo(n));var h=o.t,l=o[h-1];if(0!=l){var d=l*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),p=this.FV/d,f=(1<<this.F1)/d,g=1<<this.F2,m=n.t,y=m-h,v=null==r?M():r;for(o.dlShiftTo(y,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),t.ONE.dlShiftTo(h,v),v.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--y>=0;){var b=n[--m]==l?this.DM:Math.floor(n[m]*p+(n[m-1]+g)*f);if((n[m]+=o.am(0,b,n,y,0,h))<b)for(o.dlShiftTo(y,v),n.subTo(v,n);n[m]<--b;)n.subTo(v,n)}null!=r&&(n.drShiftTo(h,r),s!=c&&t.ZERO.subTo(r,r)),n.t=h,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&t.ZERO.subTo(n,n)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(!(1&t))return 0;var e=3&t;return(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},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var n=M(),i=M(),a=r.convert(this),o=K(e)-1;for(a.copyTo(n);--o>=0;)if(r.sqrTo(n,i),(e&1<<o)>0)r.mulTo(i,a,n);else{var s=n;n=i,i=s}return r.revert(n)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=G(r),i=M(),a=M(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(t)+o},t.prototype.fromRadix=function(e,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),a=!1,o=0,s=0,c=0;c<e.length;++c){var u=$(e,c);u<0?"-"==e.charAt(c)&&0==this.signum()&&(a=!0):(s=r*s+u,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(r,o)),this.dAddOffset(s,0)),a&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,r,n){if("number"==typeof r)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),i,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var a=[],o=7&e;a.length=1+(e>>3),r.nextBytes(a),o>0?a[0]&=(1<<o)-1:a[0]=0,this.fromString(a,256)}},t.prototype.bitwiseTo=function(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n<a;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=a;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},t.prototype.changeBit=function(e,r){var n=t.ONE.shiftLeft(e);return this.bitwiseTo(n,r,n),n},t.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()},t.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(e=e+1>>1)>B.length&&(e=B.length);for(var a=M(),o=0;o<e;++o){a.fromInt(B[Math.floor(Math.random()*B.length)]);var s=a.modPow(i,this);if(0!=s.compareTo(t.ONE)&&0!=s.compareTo(r)){for(var c=1;c++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(t.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},t.prototype.square=function(){var t=M();return this.squareTo(t),t},t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var a=r.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)e(r);else{a<o&&(o=a),o>0&&(r.rShiftTo(o,r),n.rShiftTo(o,n));var s=function(){(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(s,0):(o>0&&n.lShiftTo(o,n),setTimeout((function(){e(n)}),0))};setTimeout(s,10)}},t.prototype.fromNumberAsync=function(e,r,n,a){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),i,this),this.isEven()&&this.dAddOffset(1,0);var o=this,s=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(t.ONE.shiftLeft(e-1),o),o.isProbablePrime(r)?setTimeout((function(){a()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var c=[],u=7&e;c.length=1+(e>>3),r.nextBytes(c),u>0?c[0]&=(1<<u)-1:c[0]=0,this.fromString(c,256)}},t}(),R=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),I=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),L=function(){function t(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}return t.prototype.convert=function(t){var e=M();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},t.prototype.revert=function(t){var e=M();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),N=function(){function t(t){this.m=t,this.r2=M(),this.q3=M(),P.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=M();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function M(){return new P(null)}function V(t,e){return new P(t,e)}function _(t,e,r,n,i,a){for(;--a>=0;){var o=e*this[t++]+r[n]+i;i=Math.floor(o/67108864),r[n++]=67108863&o}return i}function j(t,e,r,n,i,a){for(var o=32767&e,s=e>>15;--a>=0;){var c=32767&this[t],u=this[t++]>>15,h=s*c+u*o;i=((c=o*c+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+s*u+(i>>>30),r[n++]=1073741823&c}return i}function U(t,e,r,n,i,a){for(var o=16383&e,s=e>>14;--a>=0;){var c=16383&this[t],u=this[t++]>>14,h=s*c+u*o;i=((c=o*c+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+s*u,r[n++]=268435455&c}return i}"Microsoft Internet Explorer"==navigator.appName?(P.prototype.am=j,C=30):"Netscape"!=navigator.appName?(P.prototype.am=_,C=26):(P.prototype.am=U,C=28),P.prototype.DB=C,P.prototype.DM=(1<<C)-1,P.prototype.DV=1<<C;var F=52;P.prototype.FV=Math.pow(2,F),P.prototype.F1=F-C,P.prototype.F2=2*C-F;var q,z,H=[];for(q="0".charCodeAt(0),z=0;z<=9;++z)H[q++]=z;for(q="a".charCodeAt(0),z=10;z<36;++z)H[q++]=z;for(q="A".charCodeAt(0),z=10;z<36;++z)H[q++]=z;function $(t,e){var r=H[t.charCodeAt(e)];return null==r?-1:r}function G(t){var e=M();return e.fromInt(t),e}function K(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}P.ZERO=G(0),P.ONE=G(1);var W=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;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]},t}();function X(){return new W}var Z,J,Y=256,Q=null;if(null==Q){Q=[],J=0;var tt=void 0;if(window.crypto&&window.crypto.getRandomValues){var et=new Uint32Array(256);for(window.crypto.getRandomValues(et),tt=0;tt<et.length;++tt)Q[J++]=255&et[tt]}var rt=function(t){if(this.count=this.count||0,this.count>=256||J>=Y)window.removeEventListener?window.removeEventListener("mousemove",rt,!1):window.detachEvent&&window.detachEvent("onmousemove",rt);else try{var e=t.x+t.y;Q[J++]=255&e,this.count+=1}catch(t){}};window.addEventListener?window.addEventListener("mousemove",rt,!1):window.attachEvent&&window.attachEvent("onmousemove",rt)}function nt(){if(null==Z){for(Z=X();J<Y;){var t=Math.floor(65536*Math.random());Q[J++]=255&t}for(Z.init(Q),J=0;J<Q.length;++J)Q[J]=0;J=0}return Z.next()}var it=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=nt()},t}();function at(t,e){if(e<t.length+22)return console.error("Message too long for RSA"),null;for(var r=e-t.length-6,n="",i=0;i<r;i+=2)n+="ff";return V("0001"+n+"00"+t,16)}function ot(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=t.length-1;n>=0&&e>0;){var i=t.charCodeAt(n--);i<128?r[--e]=i:i>127&&i<2048?(r[--e]=63&i|128,r[--e]=i>>6|192):(r[--e]=63&i|128,r[--e]=i>>6&63|128,r[--e]=i>>12|224)}r[--e]=0;for(var a=new it,o=[];e>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);r[--e]=o[0]}return r[--e]=2,r[--e]=0,new P(r)}var st=function(){function t(){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 t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=V(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=ot(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var n=r.toString(16);return 1&n.length?"0"+n:n},t.prototype.setPrivate=function(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=V(t,16),this.e=parseInt(e,16),this.d=V(r,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,r,n,i,a,o,s){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=V(t,16),this.e=parseInt(e,16),this.d=V(r,16),this.p=V(n,16),this.q=V(i,16),this.dmp1=V(a,16),this.dmq1=V(o,16),this.coeff=V(s,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var r=new it,n=t>>1;this.e=parseInt(e,16);for(var i=new P(e,16);;){for(;this.p=new P(t-n,1,r),0!=this.p.subtract(P.ONE).gcd(i).compareTo(P.ONE)||!this.p.isProbablePrime(10););for(;this.q=new P(n,1,r),0!=this.q.subtract(P.ONE).gcd(i).compareTo(P.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(P.ONE),s=this.q.subtract(P.ONE),c=o.multiply(s);if(0==c.gcd(i).compareTo(P.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(c),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=V(t,16),r=this.doPrivate(e);return null==r?null:ct(r,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,r){var n=new it,i=t>>1;this.e=parseInt(e,16);var a=new P(e,16),o=this,s=function(){var e=function(){if(o.p.compareTo(o.q)<=0){var t=o.p;o.p=o.q,o.q=t}var e=o.p.subtract(P.ONE),n=o.q.subtract(P.ONE),i=e.multiply(n);0==i.gcd(a).compareTo(P.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(i),o.dmp1=o.d.mod(e),o.dmq1=o.d.mod(n),o.coeff=o.q.modInverse(o.p),setTimeout((function(){r()}),0)):setTimeout(s,0)},c=function(){o.q=M(),o.q.fromNumberAsync(i,1,n,(function(){o.q.subtract(P.ONE).gcda(a,(function(t){0==t.compareTo(P.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(c,0)}))}))},u=function(){o.p=M(),o.p.fromNumberAsync(t-i,1,n,(function(){o.p.subtract(P.ONE).gcda(a,(function(t){0==t.compareTo(P.ONE)&&o.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(s,0)},t.prototype.sign=function(t,e,r){var n=at(ht(r)+e(t).toString(),this.n.bitLength()/4);if(null==n)return null;var i=this.doPrivate(n);if(null==i)return null;var a=i.toString(16);return 1&a.length?"0"+a:a},t.prototype.verify=function(t,e,r){var n=V(e,16),i=this.doPublic(n);return null==i?null:lt(i.toString(16).replace(/^1f+00/,""))==r(t).toString()},t}();function ct(t,e){for(var r=t.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var a=255&r[n];a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&a)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}var ut={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ht(t){return ut[t]||""}function lt(t){for(var e in ut)if(ut.hasOwnProperty(e)){var r=ut[e],n=r.length;if(t.substr(0,n)==r)return t.substr(n)}return t}
|
|
15
|
+
***************************************************************************** */var p,f=function(t,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},f(t,e)};function g(t,e){function r(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var m,y={decode:function(t){var e;if(void 0===p){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(p={},e=0;e<16;++e)p[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)p[r.charAt(e)]=e;for(e=0;e<n.length;++e)p[n.charAt(e)]=-1}var i=[],a=0,o=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=p[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);a|=s,++o>=2?(i[i.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return i}},v={decode:function(t){var e;if(void 0===m){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="= \f\n\r\t \u2028\u2029";for(m=Object.create(null),e=0;e<64;++e)m[r.charAt(e)]=e;for(e=0;e<n.length;++e)m[n.charAt(e)]=-1}var i=[],a=0,o=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=m[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);a|=s,++o>=4?(i[i.length]=a>>16,i[i.length]=a>>8&255,i[i.length]=255&a,a=0,o=0):a<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:i[i.length]=a>>10;break;case 3:i[i.length]=a>>16,i[i.length]=a>>8&255}return i},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=v.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return v.decode(t)}},b=1e13,T=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var r,n,i=this.buf,a=i.length;for(r=0;r<a;++r)(n=i[r]*t+e)<b?e=0:n-=(e=0|n/b)*b,i[r]=n;e>0&&(i[r]=e)},t.prototype.sub=function(t){var e,r,n=this.buf,i=n.length;for(e=0;e<i;++e)(r=n[e]-t)<0?(r+=b,t=1):t=0,n[e]=r;for(;0===n[n.length-1];)n.pop()},t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,r=e[e.length-1].toString(),n=e.length-2;n>=0;--n)r+=(b+e[n]).toString().substring(1);return r},t.prototype.valueOf=function(){for(var t=this.buf,e=0,r=t.length-1;r>=0;--r)e=e*b+t[r];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),S="…",w=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,A=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function E(t,e){return t.length>e&&(t=t.substring(0,e)+S),t}var C,O=function(){function t(e,r){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=r)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,r){for(var n="",i=t;i<e;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var r="",n=t;n<e;++n)r+=String.fromCharCode(this.get(n));return r},t.prototype.parseStringUTF=function(t,e){for(var r="",n=t;n<e;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},t.prototype.parseStringBMP=function(t,e){for(var r,n,i="",a=t;a<e;)r=this.get(a++),n=this.get(a++),i+=String.fromCharCode(r<<8|n);return i},t.prototype.parseTime=function(t,e,r){var n=this.parseStringISO(t,e),i=(r?w:A).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},t.prototype.parseInteger=function(t,e){for(var r,n=this.get(t),i=n>127,a=i?255:0,o="";n==a&&++t<e;)n=this.get(t);if(0==(r=e-t))return i?-1:0;if(r>4){for(o=n,r<<=3;!(128&(+o^a));)o=+o<<1,--r;o="("+r+" bit)\n"}i&&(n-=256);for(var s=new T(n),c=t+1;c<e;++c)s.mulAdd(256,this.get(c));return o+s.toString()},t.prototype.parseBitString=function(t,e,r){for(var n=this.get(t),i="("+((e-t-1<<3)-n)+" bit)\n",a="",o=t+1;o<e;++o){for(var s=this.get(o),c=o==e-1?n:0,u=7;u>=c;--u)a+=s>>u&1?"1":"0";if(a.length>r)return i+E(a,r)}return i+a},t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return E(this.parseStringISO(t,e),r);var n=e-t,i="("+n+" byte)\n";n>(r/=2)&&(e=t+r);for(var a=t;a<e;++a)i+=this.hexByte(this.get(a));return n>r&&(i+=S),i},t.prototype.parseOID=function(t,e,r){for(var n="",i=new T,a=0,o=t;o<e;++o){var s=this.get(o);if(i.mulAdd(128,127&s),a+=7,!(128&s)){if(""===n)if((i=i.simplify())instanceof T)i.sub(80),n="2."+i.toString();else{var c=i<80?i<40?0:1:2;n=c+"."+(i-40*c)}else n+="."+i.toString();if(n.length>r)return E(n,r);i=new T,a=0}}return a>0&&(n+=".incomplete"),n},t}(),k=function(){function t(t,e,r,n,i){if(!(n instanceof B))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=r,this.tag=n,this.sub=i}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return E(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return E(this.stream.parseStringISO(e,e+r),t);case 30:return E(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var r=0,n=this.sub.length;r<n;++r)e+=this.sub[r].toPrettyString(t)}return e},t.prototype.posStart=function(){return this.stream.pos},t.prototype.posContent=function(){return this.stream.pos+this.header},t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},t.decodeLength=function(t){var e=t.get(),r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var n=0;n<r;++n)e=256*e+t.get();return e},t.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,r=2*this.length;return t.substr(e,r)},t.decode=function(e){var r;r=e instanceof O?e:new O(e,0);var n=new O(r),i=new B(r),a=t.decodeLength(r),o=r.pos,s=o-n.pos,c=null,u=function(){var e=[];if(null!==a){for(var n=o+a;r.pos<n;)e[e.length]=t.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var i=t.decode(r);if(i.tag.isEOC())break;e[e.length]=i}a=o-r.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(i.tagConstructed)c=u();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var h=0;h<c.length;++h)if(c[h].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){c=null}if(null===c){if(null===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);r.pos=o+Math.abs(a)}return new t(n,s,a,i,c)},t}(),B=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=!!(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new T;do{e=t.get(),r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),R=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],x=(1<<26)/R[R.length-1],D=function(){function t(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;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 n,i=(1<<e)-1,a=!1,o="",s=this.t,c=this.DB-s*this.DB%e;if(s-- >0)for(c<this.DB&&(n=this[s]>>c)>0&&(a=!0,o=r(n));s>=0;)c<e?(n=(this[s]&(1<<c)-1)<<e-c,n|=this[--s]>>(c+=this.DB-e)):(n=this[s]>>(c-=e)&i,c<=0&&(c+=this.DB,--s)),n>0&&(a=!0),a&&(o+=r(n));return a?o:"0"},t.prototype.negate=function(){var e=_();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+K(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var r=_();return this.abs().divRemTo(e,null,r),this.s<0&&r.compareTo(t.ZERO)>0&&e.subTo(r,r),r},t.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new L(e):new I(e),this.exp(t,r)},t.prototype.clone=function(){var t=_();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=_();return this.bitwiseTo(t,n,e),e},t.prototype.or=function(t){var e=_();return this.bitwiseTo(t,i,e),e},t.prototype.xor=function(t){var e=_();return this.bitwiseTo(t,a,e),e},t.prototype.andNot=function(t){var e=_();return this.bitwiseTo(t,o,e),e},t.prototype.not=function(){for(var t=_(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},t.prototype.shiftLeft=function(t){var e=_();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=_();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+s(this[t]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=c(this[r]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:!!(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,i)},t.prototype.clearBit=function(t){return this.changeBit(t,o)},t.prototype.flipBit=function(t){return this.changeBit(t,a)},t.prototype.add=function(t){var e=_();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=_();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=_();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=_();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=_();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=_(),r=_();return this.divRemTo(t,e,r),[e,r]},t.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),a=G(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new L(e):e.isEven()?new N(e):new I(e);var o=[],s=3,c=r-1,u=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=_();for(n.sqrTo(o[1],h);s<=u;)o[s]=_(),n.mulTo(h,o[s-2],o[s]),s+=2}var l,d,p=t.t-1,f=!0,g=_();for(i=K(t[p])-1;p>=0;){for(i>=c?l=t[p]>>i-c&u:(l=(t[p]&(1<<i+1)-1)<<c-i,p>0&&(l|=t[p-1]>>this.DB+i-c)),s=r;!(1&l);)l>>=1,--s;if((i-=s)<0&&(i+=this.DB,--p),f)o[l].copyTo(a),f=!1;else{for(;s>1;)n.sqrTo(a,g),n.sqrTo(g,a),s-=2;s>0?n.sqrTo(a,g):(d=a,a=g,g=d),n.mulTo(g,o[l],a)}for(;p>=0&&!(t[p]&1<<i);)n.sqrTo(a,g),d=a,a=g,g=d,--i<0&&(i=this.DB-1,--p)}return n.revert(a)},t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;for(var n=e.clone(),i=this.clone(),a=G(1),o=G(0),s=G(0),c=G(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(e,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(e,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);n.compareTo(i)>=0?(n.subTo(i,n),r&&a.subTo(s,a),o.subTo(c,o)):(i.subTo(n,i),r&&s.subTo(a,s),c.subTo(o,c))}return 0!=i.compareTo(t.ONE)?t.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},t.prototype.pow=function(t){return this.exp(t,new P)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},t.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=R[R.length-1]){for(e=0;e<R.length;++e)if(r[0]==R[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<R.length;){for(var n=R[e],i=e+1;i<R.length&&n<x;)n*=R[i++];for(n=r.modInt(n);e<i;)if(n%R[e++]==0)return!1}return r.millerRabin(t)},t.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},t.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},t.prototype.fromString=function(e,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(e,r);n=2}this.t=0,this.s=0;for(var i=e.length,a=!1,o=0;--i>=0;){var s=8==n?255&+e[i]:$(e,i);s<0?"-"==e.charAt(i)&&(a=!0):(a=!1,0==o?this[this.t++]=s:o+n>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+=n)>=this.DB&&(o-=this.DB))}8==n&&128&+e[0]&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},t.prototype.lShiftTo=function(t,e){for(var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(t/this.DB),o=this.s<<r&this.DM,s=this.t-1;s>=0;--s)e[s+a+1]=this[s]>>n|o,o=(this[s]&i)<<r;for(s=a-1;s>=0;--s)e[s]=0;e[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,a=(1<<n)-1;e[0]=this[r]>>n;for(var o=r+1;o<this.t;++o)e[o-r-1]|=(this[o]&a)<<i,e[o-r]=this[o]>>n;n>0&&(e[this.t-r-1]|=(this.s&a)<<i),e.t=this.t-r,e.clamp()}},t.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},t.prototype.multiplyTo=function(e,r){var n=this.abs(),i=e.abs(),a=n.t;for(r.t=a+i.t;--a>=0;)r[a]=0;for(a=0;a<i.t;++a)r[a+n.t]=n.am(0,i[a],r,a,0,n.t);r.s=0,r.clamp(),this.s!=e.s&&t.ZERO.subTo(r,r)},t.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,r,n){var i=e.abs();if(!(i.t<=0)){var a=this.abs();if(a.t<i.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=_());var o=_(),s=this.s,c=e.s,u=this.DB-K(i[i.t-1]);u>0?(i.lShiftTo(u,o),a.lShiftTo(u,n)):(i.copyTo(o),a.copyTo(n));var h=o.t,l=o[h-1];if(0!=l){var d=l*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),p=this.FV/d,f=(1<<this.F1)/d,g=1<<this.F2,m=n.t,y=m-h,v=null==r?_():r;for(o.dlShiftTo(y,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),t.ONE.dlShiftTo(h,v),v.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--y>=0;){var b=n[--m]==l?this.DM:Math.floor(n[m]*p+(n[m-1]+g)*f);if((n[m]+=o.am(0,b,n,y,0,h))<b)for(o.dlShiftTo(y,v),n.subTo(v,n);n[m]<--b;)n.subTo(v,n)}null!=r&&(n.drShiftTo(h,r),s!=c&&t.ZERO.subTo(r,r)),n.t=h,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&t.ZERO.subTo(n,n)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(!(1&t))return 0;var e=3&t;return(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},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var n=_(),i=_(),a=r.convert(this),o=K(e)-1;for(a.copyTo(n);--o>=0;)if(r.sqrTo(n,i),(e&1<<o)>0)r.mulTo(i,a,n);else{var s=n;n=i,i=s}return r.revert(n)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=G(r),i=_(),a=_(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(t)+o},t.prototype.fromRadix=function(e,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),a=!1,o=0,s=0,c=0;c<e.length;++c){var u=$(e,c);u<0?"-"==e.charAt(c)&&0==this.signum()&&(a=!0):(s=r*s+u,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(r,o)),this.dAddOffset(s,0)),a&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,r,n){if("number"==typeof r)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),i,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var a=[],o=7&e;a.length=1+(e>>3),r.nextBytes(a),o>0?a[0]&=(1<<o)-1:a[0]=0,this.fromString(a,256)}},t.prototype.bitwiseTo=function(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n<a;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=a;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},t.prototype.changeBit=function(e,r){var n=t.ONE.shiftLeft(e);return this.bitwiseTo(n,r,n),n},t.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()},t.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(e=e+1>>1)>R.length&&(e=R.length);for(var a=_(),o=0;o<e;++o){a.fromInt(R[Math.floor(Math.random()*R.length)]);var s=a.modPow(i,this);if(0!=s.compareTo(t.ONE)&&0!=s.compareTo(r)){for(var c=1;c++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(t.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},t.prototype.square=function(){var t=_();return this.squareTo(t),t},t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var a=r.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)e(r);else{a<o&&(o=a),o>0&&(r.rShiftTo(o,r),n.rShiftTo(o,n));var s=function(){(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(s,0):(o>0&&n.lShiftTo(o,n),setTimeout((function(){e(n)}),0))};setTimeout(s,10)}},t.prototype.fromNumberAsync=function(e,r,n,a){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),i,this),this.isEven()&&this.dAddOffset(1,0);var o=this,s=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(t.ONE.shiftLeft(e-1),o),o.isProbablePrime(r)?setTimeout((function(){a()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var c=[],u=7&e;c.length=1+(e>>3),r.nextBytes(c),u>0?c[0]&=(1<<u)-1:c[0]=0,this.fromString(c,256)}},t}(),P=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),L=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),I=function(){function t(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}return t.prototype.convert=function(t){var e=_();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(D.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=_();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),N=function(){function t(t){this.m=t,this.r2=_(),this.q3=_(),D.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=_();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function _(){return new D(null)}function M(t,e){return new D(t,e)}function V(t,e,r,n,i,a){for(;--a>=0;){var o=e*this[t++]+r[n]+i;i=Math.floor(o/67108864),r[n++]=67108863&o}return i}function j(t,e,r,n,i,a){for(var o=32767&e,s=e>>15;--a>=0;){var c=32767&this[t],u=this[t++]>>15,h=s*c+u*o;i=((c=o*c+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+s*u+(i>>>30),r[n++]=1073741823&c}return i}function U(t,e,r,n,i,a){for(var o=16383&e,s=e>>14;--a>=0;){var c=16383&this[t],u=this[t++]>>14,h=s*c+u*o;i=((c=o*c+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+s*u,r[n++]=268435455&c}return i}"Microsoft Internet Explorer"==navigator.appName?(D.prototype.am=j,C=30):"Netscape"!=navigator.appName?(D.prototype.am=V,C=26):(D.prototype.am=U,C=28),D.prototype.DB=C,D.prototype.DM=(1<<C)-1,D.prototype.DV=1<<C;var F=52;D.prototype.FV=Math.pow(2,F),D.prototype.F1=F-C,D.prototype.F2=2*C-F;var z,q,H=[];for(z="0".charCodeAt(0),q=0;q<=9;++q)H[z++]=q;for(z="a".charCodeAt(0),q=10;q<36;++q)H[z++]=q;for(z="A".charCodeAt(0),q=10;q<36;++q)H[z++]=q;function $(t,e){var r=H[t.charCodeAt(e)];return null==r?-1:r}function G(t){var e=_();return e.fromInt(t),e}function K(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}D.ZERO=G(0),D.ONE=G(1);var W=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;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]},t}();function X(){return new W}var Z,J,Y=256,Q=null;if(null==Q){Q=[],J=0;var tt=void 0;if(window.crypto&&window.crypto.getRandomValues){var et=new Uint32Array(256);for(window.crypto.getRandomValues(et),tt=0;tt<et.length;++tt)Q[J++]=255&et[tt]}var rt=function(t){if(this.count=this.count||0,this.count>=256||J>=Y)window.removeEventListener?window.removeEventListener("mousemove",rt,!1):window.detachEvent&&window.detachEvent("onmousemove",rt);else try{var e=t.x+t.y;Q[J++]=255&e,this.count+=1}catch(t){}};window.addEventListener?window.addEventListener("mousemove",rt,!1):window.attachEvent&&window.attachEvent("onmousemove",rt)}function nt(){if(null==Z){for(Z=X();J<Y;){var t=Math.floor(65536*Math.random());Q[J++]=255&t}for(Z.init(Q),J=0;J<Q.length;++J)Q[J]=0;J=0}return Z.next()}var it=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=nt()},t}();function at(t,e){if(e<t.length+22)return console.error("Message too long for RSA"),null;for(var r=e-t.length-6,n="",i=0;i<r;i+=2)n+="ff";return M("0001"+n+"00"+t,16)}function ot(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=t.length-1;n>=0&&e>0;){var i=t.charCodeAt(n--);i<128?r[--e]=i:i>127&&i<2048?(r[--e]=63&i|128,r[--e]=i>>6|192):(r[--e]=63&i|128,r[--e]=i>>6&63|128,r[--e]=i>>12|224)}r[--e]=0;for(var a=new it,o=[];e>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);r[--e]=o[0]}return r[--e]=2,r[--e]=0,new D(r)}var st=function(){function t(){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 t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=M(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=ot(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var n=r.toString(16);return 1&n.length?"0"+n:n},t.prototype.setPrivate=function(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=M(t,16),this.e=parseInt(e,16),this.d=M(r,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,r,n,i,a,o,s){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=M(t,16),this.e=parseInt(e,16),this.d=M(r,16),this.p=M(n,16),this.q=M(i,16),this.dmp1=M(a,16),this.dmq1=M(o,16),this.coeff=M(s,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var r=new it,n=t>>1;this.e=parseInt(e,16);for(var i=new D(e,16);;){for(;this.p=new D(t-n,1,r),0!=this.p.subtract(D.ONE).gcd(i).compareTo(D.ONE)||!this.p.isProbablePrime(10););for(;this.q=new D(n,1,r),0!=this.q.subtract(D.ONE).gcd(i).compareTo(D.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(D.ONE),s=this.q.subtract(D.ONE),c=o.multiply(s);if(0==c.gcd(i).compareTo(D.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(c),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=M(t,16),r=this.doPrivate(e);return null==r?null:ct(r,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,r){var n=new it,i=t>>1;this.e=parseInt(e,16);var a=new D(e,16),o=this,s=function(){var e=function(){if(o.p.compareTo(o.q)<=0){var t=o.p;o.p=o.q,o.q=t}var e=o.p.subtract(D.ONE),n=o.q.subtract(D.ONE),i=e.multiply(n);0==i.gcd(a).compareTo(D.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(i),o.dmp1=o.d.mod(e),o.dmq1=o.d.mod(n),o.coeff=o.q.modInverse(o.p),setTimeout((function(){r()}),0)):setTimeout(s,0)},c=function(){o.q=_(),o.q.fromNumberAsync(i,1,n,(function(){o.q.subtract(D.ONE).gcda(a,(function(t){0==t.compareTo(D.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(c,0)}))}))},u=function(){o.p=_(),o.p.fromNumberAsync(t-i,1,n,(function(){o.p.subtract(D.ONE).gcda(a,(function(t){0==t.compareTo(D.ONE)&&o.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(s,0)},t.prototype.sign=function(t,e,r){var n=at(ht(r)+e(t).toString(),this.n.bitLength()/4);if(null==n)return null;var i=this.doPrivate(n);if(null==i)return null;var a=i.toString(16);return 1&a.length?"0"+a:a},t.prototype.verify=function(t,e,r){var n=M(e,16),i=this.doPublic(n);return null==i?null:lt(i.toString(16).replace(/^1f+00/,""))==r(t).toString()},t}();function ct(t,e){for(var r=t.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var a=255&r[n];a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&a)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}var ut={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ht(t){return ut[t]||""}function lt(t){for(var e in ut)if(ut.hasOwnProperty(e)){var r=ut[e],n=r.length;if(t.substr(0,n)==r)return t.substr(n)}return t}
|
|
16
16
|
/*!
|
|
17
17
|
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
|
18
18
|
Code licensed under the BSD License:
|
|
@@ -27,4 +27,4 @@ version: 2.9.0
|
|
|
27
27
|
* @since jsrsasign 2.1
|
|
28
28
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
29
29
|
*/
|
|
30
|
-
var pt={};void 0!==pt.asn1&&pt.asn1||(pt.asn1={}),pt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";e=new P(n,16).xor(t).add(P.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=pt.asn1,r=e.DERBoolean,n=e.DERInteger,i=e.DERBitString,a=e.DEROctetString,o=e.DERNull,s=e.DERObjectIdentifier,c=e.DEREnumerated,u=e.DERUTF8String,h=e.DERNumericString,l=e.DERPrintableString,d=e.DERTeletexString,p=e.DERIA5String,f=e.DERUTCTime,g=e.DERGeneralizedTime,m=e.DERSequence,y=e.DERSet,v=e.DERTaggedObject,b=e.ASN1Util.newObject,T=Object.keys(t);if(1!=T.length)throw"key of param shall be only one.";var S=T[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+S+":"))throw"undefined key: "+S;if("bool"==S)return new r(t[S]);if("int"==S)return new n(t[S]);if("bitstr"==S)return new i(t[S]);if("octstr"==S)return new a(t[S]);if("null"==S)return new o(t[S]);if("oid"==S)return new s(t[S]);if("enum"==S)return new c(t[S]);if("utf8str"==S)return new u(t[S]);if("numstr"==S)return new h(t[S]);if("prnstr"==S)return new l(t[S]);if("telstr"==S)return new d(t[S]);if("ia5str"==S)return new p(t[S]);if("utctime"==S)return new f(t[S]);if("gentime"==S)return new g(t[S]);if("seq"==S){for(var w=t[S],A=[],E=0;E<w.length;E++){var C=b(w[E]);A.push(C)}return new m({array:A})}if("set"==S){for(w=t[S],A=[],E=0;E<w.length;E++)C=b(w[E]),A.push(C);return new y({array:A})}if("tag"==S){var k=t[S];if("[object Array]"===Object.prototype.toString.call(k)&&3==k.length){var x=b(k[2]);return new v({tag:k[0],explicit:k[1],obj:x})}var O={};if(void 0!==k.explicit&&(O.explicit=k.explicit),void 0!==k.tag&&(O.tag=k.tag),void 0===k.obj)throw"obj shall be specified for 'tag'.";return O.obj=b(k.obj),new v(O)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},pt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),n=(e=Math.floor(r/40)+"."+r%40,""),i=2;i<t.length;i+=2){var a=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);n+=a.substr(1,7),"0"==a.substr(0,1)&&(e=e+"."+new P(n,2).toString(10),n="")}return e},pt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new P(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=e(parseInt(s,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=e(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);return n},pt.asn1.ASN1Object=function(){var t="";this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+t.length+",v="+this.hV;var e=this.hV.length/2,r=e.toString(16);if(r.length%2==1&&(r="0"+r),e<128)return r;var n=r.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+r},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},pt.asn1.DERAbstractString=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},dt.lang.extend(pt.asn1.DERAbstractString,pt.asn1.ASN1Object),pt.asn1.DERAbstractTime=function(t){pt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,r){var n=this.zeroPadding,i=this.localDateToUTC(t),a=String(i.getFullYear());"utc"==e&&(a=a.substr(2,2));var o=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var c=n(String(s),3);o=o+"."+(c=c.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,r,n,i,a){var o=new Date(Date.UTC(t,e-1,r,n,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},dt.lang.extend(pt.asn1.DERAbstractTime,pt.asn1.ASN1Object),pt.asn1.DERAbstractStructured=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},dt.lang.extend(pt.asn1.DERAbstractStructured,pt.asn1.ASN1Object),pt.asn1.DERBoolean=function(){pt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},dt.lang.extend(pt.asn1.DERBoolean,pt.asn1.ASN1Object),pt.asn1.DERInteger=function(t){pt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new P(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},dt.lang.extend(pt.asn1.DERInteger,pt.asn1.ASN1Object),pt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}pt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var r=0;r<=e;r++)t+="0";var n="";for(r=0;r<t.length-1;r+=8){var i=t.substr(r,8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),n+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},dt.lang.extend(pt.asn1.DERBitString,pt.asn1.ASN1Object),pt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}pt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},dt.lang.extend(pt.asn1.DEROctetString,pt.asn1.DERAbstractString),pt.asn1.DERNull=function(){pt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},dt.lang.extend(pt.asn1.DERNull,pt.asn1.ASN1Object),pt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new P(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=e(parseInt(s,2))}return r};pt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=e(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(t){var e=pt.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},dt.lang.extend(pt.asn1.DERObjectIdentifier,pt.asn1.ASN1Object),pt.asn1.DEREnumerated=function(t){pt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new P(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},dt.lang.extend(pt.asn1.DEREnumerated,pt.asn1.ASN1Object),pt.asn1.DERUTF8String=function(t){pt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},dt.lang.extend(pt.asn1.DERUTF8String,pt.asn1.DERAbstractString),pt.asn1.DERNumericString=function(t){pt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},dt.lang.extend(pt.asn1.DERNumericString,pt.asn1.DERAbstractString),pt.asn1.DERPrintableString=function(t){pt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},dt.lang.extend(pt.asn1.DERPrintableString,pt.asn1.DERAbstractString),pt.asn1.DERTeletexString=function(t){pt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},dt.lang.extend(pt.asn1.DERTeletexString,pt.asn1.DERAbstractString),pt.asn1.DERIA5String=function(t){pt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},dt.lang.extend(pt.asn1.DERIA5String,pt.asn1.DERAbstractString),pt.asn1.DERUTCTime=function(t){pt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},dt.lang.extend(pt.asn1.DERUTCTime,pt.asn1.DERAbstractTime),pt.asn1.DERGeneralizedTime=function(t){pt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},dt.lang.extend(pt.asn1.DERGeneralizedTime,pt.asn1.DERAbstractTime),pt.asn1.DERSequence=function(t){pt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},dt.lang.extend(pt.asn1.DERSequence,pt.asn1.DERAbstractStructured),pt.asn1.DERSet=function(t){pt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},dt.lang.extend(pt.asn1.DERSet,pt.asn1.DERAbstractStructured),pt.asn1.DERTaggedObject=function(t){pt.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,r){this.hT=e,this.isExplicit=t,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},dt.lang.extend(pt.asn1.DERTaggedObject,pt.asn1.ASN1Object);var ft=function(t){function e(r){var n=t.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(e.hasPrivateKeyProperty(r)||e.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return g(e,t),e.prototype.parseKey=function(t){try{var e=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?y.decode(t):v.unarmor(t),i=x.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){e=i.sub[1].getHexStringValue(),this.n=V(e,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=i.sub[3].getHexStringValue();this.d=V(a,16);var o=i.sub[4].getHexStringValue();this.p=V(o,16);var s=i.sub[5].getHexStringValue();this.q=V(s,16);var c=i.sub[6].getHexStringValue();this.dmp1=V(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=V(u,16);var h=i.sub[8].getHexStringValue();this.coeff=V(h,16)}else{if(2!==i.sub.length)return!1;var l=i.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=V(e,16),r=l.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new pt.asn1.DERInteger({int:0}),new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e}),new pt.asn1.DERInteger({bigint:this.d}),new pt.asn1.DERInteger({bigint:this.p}),new pt.asn1.DERInteger({bigint:this.q}),new pt.asn1.DERInteger({bigint:this.dmp1}),new pt.asn1.DERInteger({bigint:this.dmq1}),new pt.asn1.DERInteger({bigint:this.coeff})]};return new pt.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return l(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new pt.asn1.DERSequence({array:[new pt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new pt.asn1.DERNull]}),e=new pt.asn1.DERSequence({array:[new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e})]}),r=new pt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new pt.asn1.DERSequence({array:[t,r]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return l(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(!t)return t;var r="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"},e.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(st),gt=function(){function t(t){t=t||{},this.default_key_size=parseInt(t.default_key_size,10)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return t.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ft(t)},t.prototype.setPrivateKey=function(t){this.setKey(t)},t.prototype.setPublicKey=function(t){this.setKey(t)},t.prototype.decrypt=function(t){try{return this.getKey().decrypt(d(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return l(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,r){try{return l(this.getKey().sign(t,e,r))}catch(t){return!1}},t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,d(e),r)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new ft,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.version="3.0.0-rc.1",t}();window.JSEncrypt=gt,t.JSEncrypt=gt,t.default=gt,Object.defineProperty(t,"__esModule",{value:!0})}(Cs.exports);var xs=function(t){for(var e,r=0,n=!1,i=t.length-1;i>=0;)e=parseInt(t.charAt(i),10),n&&(e*=2)>9&&(e=e%10+1),n=!n,r+=e,i--;return r%10==0};var Os=function(t){return t?JSON.parse(JSON.stringify(t)):null};var Bs=function(t){return"string"==typeof t||t instanceof String};var Ds=function(t,e){return Array.isArray(e)?function(t,e,r){var n=String(e).length,i=t.substr(0,n),a=parseInt(i,10);return e=parseInt(String(e).substr(0,i.length),10),r=parseInt(String(r).substr(0,i.length),10),a>=e&&a<=r}(t,e[0],e[1]):function(t,e){return(e=String(e)).substring(0,t.length)===t.substring(0,e.length)}(t,e)},Ps=Os,Rs=Ds;var Is,Ls=function(t,e,r){var n,i,a,o;for(n=0;n<e.patterns.length;n++)if(i=e.patterns[n],Rs(t,i)){o=Ps(e),a=Array.isArray(i)?String(i[0]).length:String(i).length,t.length>=a&&(o.matchStrength=a),r.push(o);break}},Ns={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}},Ms=Os,Vs=function(t){if(function(t){var e=t.filter((function(t){return t.matchStrength})).length;return e>0&&e===t.length}(t))return t.reduce((function(t,e){return t?t.matchStrength<e.matchStrength?e:t:e}))},_s=Bs,js=Ls,Us={},Fs={VISA:"visa",MASTERCARD:"mastercard",AMERICAN_EXPRESS:"american-express",DINERS_CLUB:"diners-club",DISCOVER:"discover",JCB:"jcb",UNIONPAY:"unionpay",MAESTRO:"maestro",ELO:"elo",MIR:"mir",HIPER:"hiper",HIPERCARD:"hipercard"},qs=[Fs.VISA,Fs.MASTERCARD,Fs.AMERICAN_EXPRESS,Fs.DINERS_CLUB,Fs.DISCOVER,Fs.JCB,Fs.UNIONPAY,Fs.MAESTRO,Fs.ELO,Fs.MIR,Fs.HIPER,Fs.HIPERCARD];function zs(t){return Us[t]||Ns[t]}function Hs(t,e){var r=Is.indexOf(t);if(!e&&-1===r)throw new Error('"'+t+'" is not a supported card type.');return r}function $s(t){var e,r=[];return _s(t)?0===t.length?Is.map((function(t){return Ms(zs(t))})):(Is.forEach((function(e){var n=zs(e);js(t,n,r)})),(e=Vs(r))?[e]:r):[]}Is=Ms(qs),$s.getTypeInfo=function(t){return Ms(zs(t))},$s.removeCard=function(t){var e=Hs(t);Is.splice(e,1)},$s.addCard=function(t){var e=Hs(t.type,!0);Us[t.type]=t,-1===e&&Is.push(t.type)},$s.updateCard=function(t,e){var r,n=Us[t]||Ns[t];if(!n)throw new Error('"'+t+'" is not a recognized type. Use `addCard` instead.');if(e.type&&n.type!==e.type)throw new Error("Cannot overwrite type parameter.");r=Ms(n),Object.keys(r).forEach((function(t){e[t]&&(r[t]=e[t])})),Us[r.type]=r},$s.changeOrder=function(t,e){var r=Hs(t);Is.splice(r,1),Is.splice(e,0,t)},$s.resetModifications=function(){Is=Ms(qs),Us={}},$s.types=Fs;var Gs=$s,Ks=xs,Ws=Gs;function Xs(t,e,r){return{card:t,isPotentiallyValid:e,isValid:r}}var Zs=function(t,e){var r,n,i,a,o;if(e=e||{},"number"==typeof t&&(t=String(t)),"string"!=typeof t)return Xs(null,!1,!1);if(t=t.replace(/\-|\s/g,""),!/^\d*$/.test(t))return Xs(null,!1,!1);if(0===(r=Ws(t)).length)return Xs(null,!1,!1);if(1!==r.length)return Xs(null,!0,!1);if(n=r[0],e.maxLength&&t.length>e.maxLength)return Xs(n,!1,!1);for(i=n.type===Ws.types.UNIONPAY&&!0!==e.luhnValidateUnionPay||Ks(t),o=Math.max.apply(null,n.lengths),e.maxLength&&(o=Math.min(e.maxLength,o)),a=0;a<n.lengths.length;a++)if(n.lengths[a]===t.length)return Xs(n,t.length<o||i,i);return Xs(n,t.length<o,!1)};function Js(t,e,r){return{isValid:t,isPotentiallyValid:e,isCurrentYear:r||!1}}var Ys=function(t,e){var r,n,i,a,o;return e=e||19,"string"!=typeof t?Js(!1,!1):""===t.replace(/\s/g,"")?Js(!1,!0):/^\d*$/.test(t)?(n=t.length)<2?Js(!1,!0):(r=(new Date).getFullYear(),3===n?Js(!1,t.slice(0,2)===String(r).slice(0,2)):n>4?Js(!1,!1):(t=parseInt(t,10),i=Number(String(r).substr(2,2)),2===n?(o=i===t,a=t>=i&&t<=i+e):4===n&&(o=r===t,a=t>=r&&t<=r+e),Js(a,a,o))):Js(!1,!1)},Qs=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},tc=Ys,ec=Qs;function rc(t,e,r){return{isValid:t,isPotentiallyValid:e,isValidForThisYear:r||!1}}var nc=function(t){var e,r,n=(new Date).getMonth()+1;return"string"!=typeof t?rc(!1,!1):""===t.replace(/\s/g,"")||"0"===t?rc(!1,!0):/^\d*$/.test(t)?(e=parseInt(t,10),isNaN(t)?rc(!1,!1):rc(r=e>0&&e<13,r,r&&e>=n)):rc(!1,!1)},ic=function(t){var e,r,n,i,a;return/^\d{4}-\d{1,2}$/.test(t)?t=t.split("-").reverse():/\//.test(t)?t=t.split(/\s*\/\s*/g):/\s/.test(t)&&(t=t.split(/ +/g)),ec(t)?{month:t[0]||"",year:t.slice(1).join()}:(n=t,r=0===(a=Number(n[0]))?2:a>1||1===a&&Number(n[1])>2?1:1===a?(i=n.substr(1),tc(i).isPotentiallyValid?1:2):5===n.length?1:n.length>5?2:1,{month:e=t.substr(0,r),year:t.substr(e.length)})},ac=nc,oc=Ys;function sc(t,e,r,n){return{isValid:t,isPotentiallyValid:e,month:r,year:n}}var cc=3;function uc(t,e){return{isValid:t,isPotentiallyValid:e}}function hc(t,e){return{isValid:t,isPotentiallyValid:e}}var lc={number:Zs,expirationDate:function(t,e){var r,n,i,a;if("string"==typeof t)t=t.replace(/^(\d\d) (\d\d(\d\d)?)$/,"$1/$2"),r=ic(t);else{if(null===t||"object"!=typeof t)return sc(!1,!1,null,null);r={month:String(t.month),year:String(t.year)}}if(n=ac(r.month),i=oc(r.year,e),n.isValid){if(i.isCurrentYear)return sc(a=n.isValidForThisYear,a,r.month,r.year);if(i.isValid)return sc(!0,!0,r.month,r.year)}return n.isPotentiallyValid&&i.isPotentiallyValid?sc(!1,!0,null,null):sc(!1,!1,null,null)},expirationMonth:nc,expirationYear:Ys,cvv:function(t,e){return e=(e=e||cc)instanceof Array?e:[e],"string"!=typeof t?uc(!1,!1):/^\d*$/.test(t)?function(t,e){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}(e,t.length)?uc(!0,!0):t.length<Math.min.apply(null,e)?uc(!1,!0):t.length>function(t){for(var e=cc,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return e}(e)?uc(!1,!1):uc(!0,!0):uc(!1,!1)},postalCode:function(t,e){var r;return r=(e=e||{}).minLength||3,"string"!=typeof t?hc(!1,!1):t.length<r?hc(!1,!0):hc(!0,!0)},creditCardType:Gs},dc=[{type:"bank_auth",name:"Bank authorization",number:"4084080000000409",cvv:"000",month:"01",year:"30"},{type:"success",name:"Success",number:"4084084084084081",cvv:"408",month:"12",year:"30"},{type:"declined",name:"Declined",number:"4084080000005408",cvv:"001",month:"12",year:"30"},{type:"pin",name:"Pin only validation",number:"507850785078507812",cvv:"884",month:"01",year:"30"},{type:"pin+otp",name:"Pin and OTP validation",number:"5060666666666666666",cvv:"123",month:"01",year:"30"},{type:"pin+phone+otp",name:"Pin, phone and OTP validation",number:"507850785078507812",cvv:"884",month:"01",year:"30"},{type:"default",name:"No validation",number:"4084084084084081",cvv:"408",month:"01",year:"30"}];lc.creditCardType.addCard({niceType:"Verve",type:"verve",patterns:[[506e3,507999],[65e4,650009]],gaps:[4,8,12,16],lengths:[16,18,19],code:{name:"CVV",size:3}}),lc.creditCardType.changeOrder("verve",0);const pc={getEncryptedPin:t=>t?ks(t):void 0,getLast4:t=>t.substring(t.length-4),tokenize(t){let{number:e,cvv:r,month:n,year:i}=t;return ks(`${e}*${r}*${n}*${i}`)},getType(t){const e=lc.number(t);return e&&e.card?{type:e.card.type,maxLength:Math.max(...e.card.lengths),minLength:Math.min(...e.card.lengths)}:{type:null,maxLength:0}},validate(t){let{number:e,cvv:r,month:n,year:i}=t;const{type:a}=this.getType(e),o={number:this.isNumberValid(e),expiry:this.isExpiryValid({month:n,year:i}),cvv:this.isCvvValid(r,a)};return{isValid:Object.values(o).every((t=>!0===t)),result:o}},validateNumber:t=>lc.number(t),isNumberValid:t=>pc.validateNumber(t).isValid,validateCVV(t,e){const r="american-express"===e?4:3;return lc.cvv(t,r)},isCvvValid:(t,e)=>pc.validateCVV(t,e).isValid,validateExpiry(t){if(null!==t&&"object"==typeof t){const{month:e,year:r}=t;return lc.expirationMonth(e)&&lc.expirationYear(r)}return lc.expirationDate(t)},isExpiryValid:t=>pc.validateExpiry(t).isValid,findTestCard(t){const e=t||"default";return dc.find((t=>t.type===e))}};class fc{constructor(t){let{number:e,cvv:r,month:n,year:i,pin:a}=t;this.number=e,this.cvv=r,this.month=n,this.year=i,this.pin=a}getEncryptedPin(){return pc.getEncryptedPin(this.pin)}getLast4(){return pc.getLast4(this.number)}tokenize(){return pc.tokenize({number:this.number,cvv:this.cvv,month:this.month,year:this.year})}static getType(t){return pc.getType(t)}static validate(t){let{number:e,cvv:r,month:n,year:i}=t;return pc.validate({number:e,cvv:r,month:n,year:i})}static validateNumber(t){return pc.validateNumber(t)}static isNumberValid(t){return pc.isNumberValid(t)}static validateCVV(t,e){return pc.validateCVV(t,e)}static isCvvValid(t,e){return pc.isCvvValid(t,e)}static validateExpiry(t){return pc.validateExpiry(t)}static isExpiryValid(t){return pc.isExpiryValid(t)}static generateTestCard(t){return new fc(pc.findTestCard(t))}}const gc={charge(t){let{clientdata:e,last4:r,pin:n,trans:i,device:a,rememberCard:o,transactionType:s,subscription:c,customFields:u}=t;const h=`${Ki.paymentBaseUrl}charge/`,l=us(),d={"Content-Type":"application/x-www-form-urlencoded",...l&&{"Accept-Language":l}},p={clientdata:e,last4:r,trans:i,device:a,offset:(new Date).getTimezoneOffset(),remember_card:o,...s&&{transaction_type:s},...c&&{subscription:c},...u&&u};n&&(p.handle=n);const f=fs(p);return cs.post(h,f,{headers:d}).then((t=>Zi.parse(t.data)))},resumeCardCharge(t){let{device:e,accessCode:r,pin:n}=t;const i=`${Ki.paymentBaseUrl}charge/resume/${r}`,a=us(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s={device:e,...n&&{handle:n}},c=fs(s);return cs.post(i,c,{headers:o}).then((t=>Zi.parse(t.data)))},chargeRememberedCard(t){let{last4:e,trans:r,device:n,authorizationCode:i,cvv:a,pin:o,transactionType:s,subscription:c}=t;const u=`${Ki.paymentBaseUrl}charge/`,h=us(),l={"Content-Type":"application/x-www-form-urlencoded",...h&&{"Accept-Language":h}},d={last4:e,trans:r,device:n,cvv:a,handle:o,authorization_code:i,...s&&{transaction_type:s},...c&&{subscription:c}},p=fs(d);return cs.post(u,p,{headers:l}).then((t=>Zi.parse(t.data)))},authenticate(t,e){const r=`${Ki.paymentBaseUrl}charge/validate`,n={trans:t,token:e},i=us(),a={...i&&{"Accept-Language":i}},o=fs(n);return cs.post(r,o,{headers:a}).then((t=>Zi.parse(t.data)))},verifyAddress(t){let{address:e,city:r,state:n,zipCode:i,transactionId:a}=t;const o=`${Ki.paymentBaseUrl}charge/avs`,s=us(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u=fs({city:r,state:n,address:e,zip_code:i,trans:a});return cs.post(o,u,{headers:c}).then((t=>Zi.parse(t.data)))},forgetRememberedCard(t){let{authorizationId:e,publicKey:r}=t;const n=us(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}},a={authorization_id:e},o=`${Ki.paystackApiUrl}rememberme/forget_card`;return cs.post(o,a,{headers:i}).then((t=>Zi.parse(t.data)))},async sendSavedCardsOTP(t){let{transaction:e,phone:r,channels:n,email:i}=t;const a=new URL("/saved_cards/authorize",Ki.paystackApiUrl).toString(),o=us(),s={...o&&{"Accept-Language":o}},c={...r&&{phone:r},...n&&{channels:n},...i&&{email:i},transaction:e};return(await cs.post(a,c,{headers:s})).data},async verifySavedCardsOtp(t){let{code:e,transaction:r,token:n}=t;const i=new URL("/saved_cards/authorize/verify",Ki.paystackApiUrl).toString(),a=us(),o={Authorization:`Bearer ${n}`,...a&&{"Accept-Language":a}},s={code:e,transaction:r};return(await cs.post(i,s,{headers:o})).data},async getSavedCards(t){let{token:e}=t;const r=new URL("/saved_cards/cards",Ki.paystackApiUrl).toString(),n=us(),i={Authorization:`Bearer ${e}`,"jwt-auth":!0,...n&&{"Accept-Language":n}};return(await cs.get(r,{headers:i})).data},async deleteSavedCard(t){let{cardCode:e,token:r}=t;const n=new URL(`/saved_cards/cards/${e}`,Ki.paystackApiUrl).toString(),i=us(),a={Authorization:`Bearer ${r}`,"jwt-auth":!0,...i&&{"Accept-Language":i}};return(await cs.delete(n,{headers:a})).data},async chargeSavedCard(t){let{token:e,device:r,cardCode:n,transaction:i,selectedCurrency:a}=t;const o=new URL(`/saved_cards/cards/${n}/charge`,Ki.paystackApiUrl).toString(),s=us(),c={Authorization:`Bearer ${e}`,"jwt-auth":!0,...s&&{"Accept-Language":s}},u={device:r,transaction:i,selected_currency:a},h=await cs.post(o,u,{headers:c});return Zi.parse(h.data)}},mc="card",yc="saved card",vc="otp";function bc(t,e){return new Promise(((r,n)=>{const i=fc.validate(t);if(!i.isValid){const r=e||t.number,a=`Invalid card details: ${Object.keys(i.result).filter((t=>!1===i.result[t])).join(", ")}`;n(Error(r?a:"Please set a valid card with Transaction.setCard()"))}r()}))}var Tc={setCard(t){return bc(t,!0).then((()=>{this.card=new fc(t)}))},rememberCard(){this.remember_card=!0},chargeCard(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!this.card.number&&this.card.pin?this.chargeCardWithPin(t):bc(this.card).then((()=>{this.logAttempt(mc);const e={clientdata:this.card.tokenize(),last4:this.card.getLast4(),pin:this.card.getEncryptedPin(),trans:this.id,device:this.deviceFingerprint,rememberCard:this.remember_card,transactionType:this.transactionType,subscription:this.subscription,customFields:t};return gc.charge(e).then((t=>(this.logAPIResponse(t,mc),t)))}))},chargeCardWithPin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logAttempt(mc);const e={pin:ks(this.card.pin),trans:this.id,device:this.deviceFingerprint,rememberCard:this.remember_card,transactionType:this.transactionType,subscription:this.subscription,customFields:t};return gc.charge(e).then((t=>(this.logAPIResponse(t,mc),t)))},chargeRememberedCard(t){let{cvv:e,authorizationCode:r,cardLast4:n,pin:i}=t;this.logAttempt(mc);const a=ks(i),o={authorizationCode:r,cvv:e,last4:n,trans:this.id,device:this.deviceFingerprint,pin:a,transactionType:this.transactionType,subscription:this.subscription};return gc.chargeRememberedCard(o).then((t=>(this.logAPIResponse(t,mc),t)))},resumeCardCharge(t){let{accessCode:e,pin:r}=t;const n={...r&&{pin:ks(r)},accessCode:e,device:this.deviceFingerprint};return gc.resumeCardCharge(n).then((t=>(this.logAPIResponse(t,mc),t)))},forgetRememberedCard(t){const e={authorizationId:t,publicKey:this.merchant.key};return gc.forgetRememberedCard(e).then((t=>(this.logAPIResponse(t,mc),t)))},authenticateCard(t){return gc.authenticate(this.id,t).then((t=>(this.logAPIResponse(t,mc),t)))},verifyAddress(t){let{address:e,city:r,state:n,zipCode:i}=t;const a={city:r,state:n,address:e,zipCode:i,transactionId:this.id};return gc.verifyAddress(a).then((t=>(this.logAPIResponse(t,mc),t)))},listenFor3DSCharge(t){const e={channel:`3DS_${this.id}`,paymentMethod:mc};return this.listenForCharge(e,t)},async sendSavedCardsOTP(){let{phone:t,channels:e,email:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{this.logAuth(vc);const n=await gc.sendSavedCardsOTP({phone:t,transaction:this.id,channels:e,email:r});return this.savedCardsTempAuthToken=n.data.token,n}catch(t){throw this.savedCardsTempAuthToken=null,t}},async verifySavedCardsOtp(t){let{code:e}=t;const r={code:e,transaction:this.id,token:this.savedCardsTempAuthToken};try{const t=await gc.verifySavedCardsOtp(r);return this.savedCardsToken=t.data.token,t}catch(t){throw this.savedCardsToken=null,t}},getSavedCards(){return gc.getSavedCards({token:this.savedCardsToken})},deleteSavedCard(t){return gc.deleteSavedCard({cardCode:t,token:this.savedCardsToken})},chargeSavedCard(t){let{cardCode:e,selectedCurrency:r=this.currency}=t;return this.logAttempt(yc),gc.chargeSavedCard({cardCode:e,transaction:this.id,token:this.savedCardsToken,device:this.deviceFingerprint,selectedCurrency:r})}};class Sc{constructor(t){let{bankId:e,accountType:r,accountNumber:n}=t;this.bankId=e,this.accountType=r,this.accountNumber=n}static validate(t){let{bankId:e,accountType:r,accountNumber:n}=t;const i=[];return e&&"number"==typeof e||i.push("Invalid bankId. Please check for supported banks with BankAccount.supportedBanks()"),Sc.types.indexOf(r)>-1?"nuban"!==r||Sc.isValidNubanAccount(n)||i.push("Invalid account number. Nuban accounts must be 10 digit numbers"):i.push("Invalid bank type. Please check BankAccount.types for the list of valid bank types"),{isValid:0===i.length,errors:i}}static isValidNubanAccount(t){if(!t)return!1;return("number"==typeof t||/^\d+$/.test(t))&&10===t.length}static supportedBanks(){const t=`${Ki.paymentBaseUrl}bank?pay_with_bank=true`,e=us(),r={...e&&{"Accept-Language":e}};return cs.post(t,{headers:r}).then((t=>t.data))}}Sc.types=["nuban"];const wc={verify(t){let{bankId:e,transactionId:r,accountNumber:n,device:i}=t;const a=`${Ki.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=us(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=fs({account_number:n,device:i});return cs.post(a,c,{headers:s}).then((t=>Zi.parse(t.data)))},register(t){let{bankId:e,transactionId:r,accountNumber:n,birthday:i}=t;const a=`${Ki.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=us(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=fs({account_number:n,birthday:i});return cs.post(a,c,{headers:s}).then((t=>Zi.parse(t.data)))},authenticate(t){let{bankId:e,transactionId:r,token:n,device:i}=t;const a=`${Ki.paymentBaseUrl}bank/validate_token/${e}/${r}`,o=us(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=fs({device:i,token:n});return cs.post(a,c,{headers:s}).then((t=>Zi.parse(t.data)))}},Ac="bank account";function Ec(t,e){return new Promise(((r,n)=>{const i=Sc.validate(t);if(!i.isValid){const r=e||t.accountNumber?i.errors[0]:"Please set a valid bank account with Transaction.setBank()";n(Error(r))}r()}))}const Cc={charge(t){let{bankId:e,transactionId:r,phoneNumber:n,payId:i,walletId:a}=t;const o=`${Ki.paymentBaseUrl}bank/digitalbankmandate/${e}/${r}`,s=us(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u=fs(a?{wallet_id:a}:{phone_number:n,token:i});return cs.post(o,u,{headers:c}).then((t=>Zi.parse(t.data)))}},kc="bank",xc={...{setBankAccount(t){return Ec(t,!0).then((()=>{this.bankAccount=new Sc(t)}))},chargeBankAccount(){return Ec(this.bankAccount).then((()=>{this.logAttempt(Ac);const t={bankId:this.bankAccount.bankId,transactionId:this.id,accountNumber:this.bankAccount.accountNumber,device:this.deviceFingerprint};return wc.verify(t).then((t=>(this.logAPIResponse(t,Ac),t)))}))},registerBankAccount(t){return Ec(this.bankAccount).then((()=>{const e={bankId:this.bankAccount.bankId,transactionId:this.id,accountNumber:this.bankAccount.accountNumber,birthday:t};return wc.register(e).then((t=>(this.logAPIResponse(t,Ac),t)))}))},authenticateBankAccount(t){return Ec(this.bankAccount).then((()=>{const e={bankId:this.bankAccount.bankId,transactionId:this.id,token:t,device:this.deviceFingerprint};return wc.authenticate(e).then((t=>(this.logAPIResponse(t,Ac),t)))}))}},...{getIbankUrl(t){let{bankId:e}=t;return new Promise(((t,r)=>{e||r(Error("Please send bankId"));const n=`${Ki.paymentBaseUrl}bank/ibank/${e}/${this.id}`;t(Zi.success({url:n}))}))},listenForIbankCharge(t){const e={channel:`IBANK_${this.id}`,paymentMethod:"ibank"};return this.listenForCharge(e,t)}},...{chargeDigitalBankMandate(t){let{phoneNumber:e,payId:r,bankId:n,walletId:i}=t;const a={transactionId:this.id,phoneNumber:e,payId:r,bankId:n,walletId:i};return Cc.charge(a).then((t=>(this.logAPIResponse(t,kc),t)))},listenForDigitalBankMandateCharge(t){const e={paymentMethod:kc,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}}},Oc={generateShortcode(t,e){const r=us(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return cs.post(`${Ki.paystackApiUrl}checkout/ussd/reference`,t,{headers:n}).then((t=>Zi.parse(t.data)))},generatePWTUSSDShortcode(t,e){const r=us(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return cs.post(`${Ki.paystackApiUrl}checkout/pay_with_transfer_ussd`,t,{headers:n}).then((t=>Zi.parse(t.data)))}};var Bc={getUSSDShortcode(t){let{channel:e}=t;const r={transaction:this.id,channel:e};return Oc.generateShortcode(r,this.merchant.key).then((t=>("success"===t.status&&(this.ussd[e]=t),t)))},getPWTUSSDShortcode(t){let{bankSlug:e,fulfilLateNotification:r=!1}=t;const n={transaction_id:this.id,fulfil_late_notification:r,bank_slug:e};return Oc.generatePWTUSSDShortcode(n,this.merchant.key).then((t=>("success"===t.status&&(this.ussd[e]=t),t)))},listenForPWTUSSDCharge(t,e){let{bankSlug:r}=t;if(!this.ussd[r])return Promise.reject(Error("Please generate a ussd shortcode with Transaction.getPWTUSSDShortcode()"));const{data:n}=this.ussd[r],i={channel:n.pusher_channel,paymentMethod:"ussd"};return this.listenForCharge(i,e)},listenForUSSDCharge(t,e){let{channel:r}=t;if(!this.ussd[r])return Promise.reject(Error("Please generate a ussd shortcode with Transaction.getUSSDShortcode()"));const{data:n}=this.ussd[r],i={channel:n.channel,paymentMethod:r};return this.listenForCharge(i,e)}};const Dc={generateQrCode(t,e){let{transaction:r,channel:n}=t;const i={source:"checkout",reference:r,channel:n},a=us(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return cs.post(`${Ki.paystackApiUrl}offline/qr/generate`,i,{headers:o}).then((t=>Zi.parse(t.data)))}};function Pc(t){return new Promise(((e,r)=>{const n=["visa","MPASS_OLTI"];if(n.indexOf(t)<=-1){const t=`Invalid channel. Available channels: ${n.join(", ")}`;r(Error(t))}else e()}))}var Rc={getQRCode(t){let{channel:e}=t;return Pc(e).then((()=>{if(this.qr[e])return this.qr[e];const t={transaction:this.id,channel:e};return Dc.generateQrCode(t,this.merchant.key).then((t=>("success"===t.status&&(this.qr[e]=t),t)))}))},listenForQRCharge(t,e){let{channel:r}=t;return Pc(r).then((()=>{if(!this.qr[r])return Promise.reject(Error("Please generate qr code with Transaction.getQRCode()"));const{data:t}=this.qr[r],n={channel:t.channel,paymentMethod:r};return this.listenForCharge(n,e)}))}};class Ic{static hasCountryCode(t){return t&&"+"===t[0]}static hasOnlyDigits(t){return t&&(e=t.substring(1),/^\d+$/.test(e));var e}static isE164Number(t){return t&&t.length<17}static validate(t){const e=[];return Ic.hasCountryCode(t)||e.push("Number should include country code prefix"),Ic.hasOnlyDigits(t)||e.push("Number should contain only digits"),Ic.isE164Number(t)||e.push("Number should not be longer than 16 digits"),{isValid:0===e.length,errors:e}}}const Lc={charge(t){let{transaction:e,phone:r,device:n,channel_name:i,provider:a,voucher:o,registrationToken:s}=t;const c={transaction:e,phone:r,device:n,channel_name:i,provider:a,voucher:o,registration_token:s},u=us(),h={...u&&{"Accept-Language":u}};return cs.post(`${Ki.paystackApiUrl}charge/mobile_money`,c,{headers:h}).then((t=>Zi.parse(t.data))).catch((t=>{let{response:e}=t;return Zi.parse(e.data)}))},submitCode(t){let{transaction:e,code:r}=t;const n=us(),i={...n&&{"Accept-Language":n}},a=fs({transaction:e,otp:r}),o=new URL("charge/momo_payin_finalize",Ki.paymentBaseUrl).toString();return cs.post(o,a,{headers:i}).then((t=>Zi.parse(t.data)))}};function Nc(t){return new Promise(((e,r)=>{const n=Ic.validate(t);if(!n.isValid){const e=t?n.errors[0]:"Please start a mobile money transaction with Transaction.chargeMobileMoney()";r(Error(e))}e(n)}))}var Mc={mobileMoneyChargeAPI(t){return Lc.charge(t).then((t=>("success"===t.status&&(this.mobileMoney=t,t.data&&t.data.display&&1===t.data.display.otpSentCount&&this.logTokenRequest("mobile money")),t)))},chargeMobileMoney(t){let{phoneNumber:e,provider:r,voucher:n,registrationToken:i}=t;return Nc(e).then((()=>{this.logAttempt("mobile money");const t={provider:r,voucher:n,registrationToken:i,transaction:this.id,phone:e,device:this.deviceFingerprint,channel_name:`MOBILE_MONEY_${this.id}`};return this.mobileMoneyChargeAPI(t)}))},chargeMpesaOffline(t){let{provider:e,voucher:r,registrationToken:n}=t;this.logAttempt("mobile money");const i={provider:e,voucher:r,registrationToken:n,transaction:this.id,device:this.deviceFingerprint,channel_name:`MOBILE_MONEY_${this.id}`};return this.mobileMoneyChargeAPI(i)},authenticateMobileMoney(t){const{phoneNumber:e,provider:r,registrationToken:n}=t;return Nc(e).then((()=>{this.logMobileMoneyActions(t);const i={provider:r,registrationToken:n,transaction:this.id,phone:e,device:this.deviceFingerprint,channel_name:`MOBILE_MONEY_${this.id}`};return Lc.charge(i).then((t=>("success"===t.status?(this.mobileMoney=t,t.data&&t.data.display&&1===t.data.display.otpSentCount&&this.logTokenRequest("mobile money")):t.errors&&t.errors.data&&"awaiting_registration_token"===t.errors.data.status?this.logTokenAuthenticationFailure(t.message):this.logError(t.message),t)))}))},submitMobileMoneyCode(t){return Lc.submitCode({code:t.code,transaction:this.id}).then((t=>(this.logAPIResponse(t,"mobile_money"),t)))},listenForMobileMoneyCharge(t){if("success"!==this.mobileMoney.status)return Promise.reject(Error("Please start a mobile money charge with Transaction.chargeMobileMoney()"));const{channel:e,channel_name:r}=this.mobileMoney.data,n={channel:e||r,paymentMethod:"mobile_money"};return this.listenForCharge(n,t)}};const Vc={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r},i=us(),a={...i&&{"Accept-Language":i}};return cs.post(`${Ki.paystackApiUrl}login`,n,{headers:a}).then((t=>Zi.parse(t.data)))},charge(t){let{account_code:e,transaction:r,token:n}=t;const i=us(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={account_code:e,transaction:r};return cs.post(`${Ki.paystackApiUrl}directdebit/initiate`,o,{headers:a}).then((t=>Zi.parse(t.data)))},authenticate(t){let{otp:e,transaction:r,token:n}=t;const i=us(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={otp:e,transaction:r};return cs.post(`${Ki.paystackApiUrl}directdebit/validate`,o,{headers:a}).then((t=>Zi.parse(t.data)))},getProvisionedAccounts(t){const e=us(),r={Authorization:`Bearer ${t}`,"jwt-auth":!0,...e&&{"Accept-Language":e}};return cs.get(`${Ki.paystackApiUrl}directdebit/account`,{headers:r}).then((t=>t.data))}},_c="direct debit";var jc={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r};return Ri(e)?Vc.loginToDirectDebitAccount(n).then((t=>{if("success"===t.status){const{data:{token:e,user:{permissions:r}}}=t;if(!r||r.length<1)throw Error("You do not have the privileges to perform this action");if(r.find((t=>"directdebit-*"===t)))return this.directDebit.token=e,t;throw Error("You do not have the privileges to perform this action")}return t})):Promise.reject(Error("Invalid email"))},chargeDirectDebit(t){if(!this.directDebit.token)return Promise.reject(Error("Please login with Transaction.loginToDirectDebitAccount() to start a Direct debit charge"));this.logAttempt(_c);const e={account_code:t,transaction:this.id,token:this.directDebit.token};return Vc.charge(e).then((t=>(this.logAPIResponse(t,_c),t.status&&(this.directDebit.chargeResponse=t),t)))},getProvisionedAccounts(){return Vc.getProvisionedAccounts(this.directDebit.token).then((t=>{this.logAPIResponse(t,_c);const{status:e,data:r}=t;if(e){if(r&&r.length<1)return Promise.reject(Error("You have not provisioned any bank account for Direct Debit yet"));this.directDebit.accounts=t.data}return t}))},authenticateAccount(t){const e={otp:t,transaction:this.id,token:this.directDebit.token};return Vc.authenticate(e).then((t=>(this.logAPIResponse(t,_c),t)))}},Uc={get:t=>({card:Tc,bank:xc,ussd:Bc,qr:Rc,mobile_money:Mc,direct_debit:jc,bank_transfer:ds,eft:vs,payattitude:ys,apple_pay:Ss,paypal:Es}[t])},Fc=function(t){t||"undefined"==typeof navigator||(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return"string"==typeof t&&(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))};const qc={initializeLog(t){const{attempts:e,authentication:r,errors:n,history:i}=t||{};return{start_time:Math.round(Date.now()/1e3),time_spent:0,attempts:e||0,authentication:r,errors:n||0,success:!1,mobile:Fc(),input:[],history:i||[]}},getTimeSpent:t=>Math.round(Date.now()/1e3)-t},zc={saveLog(t,e){let{merchantKey:r,log:n}=e;const i=us(),a={Authorization:`Bearer ${r}`,...i&&{"Accept-Language":i}};return cs.post(t,{payload:JSON.stringify(n)},{headers:a}).then((t=>t.data))},getIp(){const t=us(),e={...t&&{"Accept-Language":t}};return cs.get("https://api.paystack.co/decision/ip",{headers:e}).then((t=>t.data.data.ip_address))},saveIp(t,e){let{merchantKey:r}=e;const n=us(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}};return cs.post(t,null,{headers:i}).then((t=>t.data))},saveReferrer(t,e){let{merchantKey:r,referrer:n}=e;const i=us(),a={Authorization:`Bearer ${r}`,...i&&{"Accept-Language":i}};return cs.post(t,{referrer:n},{headers:a}).then((t=>t.data))}},Hc={saveLog(t,e,r){const n=new URL(`transaction/update_log/${t}`,Ki.paystackApiUrl).toString();return zc.saveLog(n,{merchantKey:e,log:r})},getIp:()=>zc.getIp(),saveIp(t,e){const r=new URL(`transaction/set_ip/${t}`,Ki.paystackApiUrl).toString();return zc.saveIp(r,{merchantKey:e})},saveReferrer(t,e,r){const n=new URL(`transaction/set_referrer/${t}`,Ki.paystackApiUrl).toString();return zc.saveReferrer(n,{merchantKey:e,referrer:r})}};var $c={initializeLog(t){this.log=qc.initializeLog(t)},getTimeSpent(){return this.log.time_spent=qc.getTimeSpent(this.log.start_time),this.log.time_spent},logPageOpen(){return this.log.history.push({type:"open",message:"Opened checkout",time:this.getTimeSpent()}),this.saveLog()},logChannelSwitch(t){return this.log.history.push({type:"action",message:`Set payment method to: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logValidationErrors(t){return t.forEach((t=>{this.log.history.push({type:"error",message:`Invalid ${t}`,time:this.getTimeSpent()})})),this.saveLog()},logInput(t){const e=this.log.history.find((e=>e.message===`Filled this field: ${t}`));return this.log.history.push({type:"input",message:`${e?"Changed":"Filled"} this field: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logBankSelect(t){return this.log.history.push({type:"action",message:`Selected bank: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logSavedCardSelect(){return this.log.history.push({type:"action",message:"Selected saved card",time:this.getTimeSpent()}),this.saveLog()},logAuthWindowOpen(){return this.log.history.push({type:"action",message:"Third-party authentication window opened",time:this.getTimeSpent()}),this.saveLog()},logAuthWindowClose(){return this.log.history.push({type:"action",message:"Third-party authentication window closed",time:this.getTimeSpent()}),this.saveLog()},logAPIResponse(t,e){switch(t.status){case"success":return this.logSuccess(e);case"pending":return this.logPending(e);case"failed":return this.logError(t.message);case"auth":return this.logAuth(t.data.auth);default:return!1}},logMobileMoneyActions(t){let{numberOfTokenRequests:e,registrationToken:r}=t;e?this.logTokenRequest("mobile money",e):r?this.logTokenSubmitted("mobile money"):this.logAttempt("mobile money")},logAPIResponseMessage(t){return this.log.history.push({type:"action",message:t,time:this.getTimeSpent()}),this.saveLog()},logAttempt(t){let e="Attempted to pay";return t&&(e+=` with ${t}`),this.log.attempts+=1,this.log.history.push({type:"action",message:e,time:this.getTimeSpent()}),this.saveLog()},logTokenRequest(t){const e=0===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)?"Waiting for customer to submit OTP":"Customer requested to resend OTP";return this.log.history.push({type:"action",message:e,channel:t,time:this.getTimeSpent()}),this.saveLog()},logTokenSubmitted(t){return this.log.history.push({type:"action",message:"Customer submitted OTP",channel:t,time:this.getTimeSpent()}),this.saveLog()},logTokenAuthenticationFailure(t){const e=t?`Error: ${t}`:"Error";return this.log.errors+=1,this.log.history.push({type:"error",message:e,authentication:"failed",time:this.getTimeSpent()}),this.saveLog()},logError(t){let e="Error";return t&&(e+=`: ${t}`),this.log.errors+=1,this.log.history.push({type:"error",message:e,time:this.getTimeSpent()}),this.saveLog()},logAuth(t){return this.log.authentication=t,this.log.history.push({type:"auth",message:`Authentication Required: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logSuccess(t){let e="Successfully paid";return t&&(e+=` with ${t}`),this.log.success=!0,this.log.history.push({type:"success",message:e,time:this.getTimeSpent()}),this.saveLog()},logPending(t){let e="Payment in progress";return t&&(e+=` with ${t}`),this.log.history.push({type:"pending",message:e,time:this.getTimeSpent()}),this.saveLog()},logPageClose(){return this.log.history.push({type:"close",message:"Closed checkout",time:this.getTimeSpent()}),this.saveLog()},logTransactionCurrencySwitch(t){let{currency:e,isUserAction:r=!0}=t;const n=r?"User switched":"Switched";return this.log.history.push({type:"action",message:`${n} transaction currency to ${e}`,time:this.getTimeSpent()}),this.saveLog()},saveLog(){return Hc.saveLog(this.id,this.merchant.key,this.log)},saveIpAddress(){return Hc.saveIp(this.id,this.merchant.key)},saveReferrer(t){return Hc.saveReferrer(this.id,this.merchant.key,t)}};class Gc{constructor(t){this.email=t.email,this.merchant={id:t.merchant_id,logo:t.merchant_logo,name:t.merchant_name,key:t.merchant_key,channelSettings:t.merchant_channel_settings||{}},this.status=t.transaction_status||t.status,this.accessCode=t.access_code,this.amount=t.amount,this.domain=t.domain,this.isTest="test"===t.domain,this.currency=t.currency,this.id=t.id,this.channels=t.channels,this.label=t.label,this.metadata=t.metadata||{},this.cancel_action=t.cancel_action||null,this.channel_options=t.channel_options||null,this.hash=t.hash||null,this.authorizations=t.authorizations,this.remember_card=!1,this.rememberMeEnabled=t.is_remember_me_enabled,this.card={},this.bankAccount={},this.mobileMoney={},this.ussd={},this.bankTransfer={},this.qr={},this.directDebit={},this.deviceFingerprint=t.deviceFingerprint||null,this.customer=t.customer,this.custom_filters=t.custom_filters||null,this.isCharging=!1,this.isListening=!1,this.transactionType=t.transaction_type||null,this.subscription=t.subscription||null,this.planDetails=t.plan_details||null,this.exchangeRate=t.exchange_rate||null,this.savedCardsConfig=t.saved_cards||{},this.savedCardsTempAuthToken=null,this.savedCardsToken=null,this.reference=t.reference,Ji(),this.log=null,Object.assign(this,$c),this.initializeLog(t.log),this.saveIpAddress(),this.channels.forEach((t=>{const e=Uc.get(t);Object.assign(this,e)})),"GHS"===t.currency&&t.elevy_percentage&&(this.elevyPercentage=t.elevy_percentage)}setMetadata(t,e){this.metadata[t]=e}setDevice(t){this.deviceFingerprint?Fi("Device ID has already been set by Checkout JS so there's no need to set this again"):this.deviceFingerprint=t}listenForCharge(t,e){return Yi(t,this,e)}requery(){return hs.requery(this.id)}markAsAbandoned(){return hs.markAsAbandoned({publicKey:this.merchant.key,transactionId:this.id})}verifyStatus(){return hs.verifyStatus({reference:this.reference,publicKey:this.merchant.key}).then((t=>t&&t.data))}}const Kc={validate(t){const e=function(t){const e=[];return t&&"object"==typeof t?(Object.keys(Ni).forEach((r=>{const n=Ni[r],i=t[r];!n.required||i||t[n.fallback]?i&&!n.isValid(i)&&e.push({field:r,message:`Invalid field: ${r}`}):e.push({field:r,message:`Required field: ${r}`})})),e):(e.push({message:"Please supply a valid object"}),e)}(t);if(e.length){const[{message:t}]=e;throw new Pi(e,t)}},async request(t){const e=await qi(),r=await hs.requestInline({...t,device:e});return r&&Object.seal(new Gc({...r.data,deviceFingerprint:e}))},async requestWithAccessCode(t){const e=await qi(),r=await hs.requestStandard(t);return r&&Object.seal(new Gc({...r.data,deviceFingerprint:e}))},async getByAccessCode(t,e){const r=await qi(),n=await hs.getByAccessCode(t,e);return n&&Object.seal(new Gc({...n.data,deviceFingerprint:r}))},initialize:t=>Object.seal(new Gc(t)),async verify(t){const e=await hs.verify(t);return e&&e.data}},Wc={},Xc={fetchBanks(t){const e=new URL("/bank",Ki.paystackApiUrl).toString(),r=us(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return cs.get(e,n).then((t=>t.data))},fetchResolutions(){const t=new URL("/checkout/resolutions",Ki.paystackApiUrl).toString(),e=us(),r={...e&&{"Accept-Language":e}};return cs.get(t,{headers:r}).then((t=>t.data))},fetchCelebrations(){const t=new URL("/checkout/celebrations",Ki.paystackApiUrl).toString(),e=us(),r={...e&&{"Accept-Language":e}};return cs.get(t,{headers:r}).then((t=>t.data))},fetchStates(t){const e=new URL("/address_verification/states",Ki.paystackApiUrl).toString(),r=us(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return cs.get(e,n).then((t=>t.data))},resolveCardBin(t){const e=new URL(`/decision/bin/${t}`,Ki.paystackApiUrl).toString(),r=us(),n={...r&&{"Accept-Language":r}};return Wc[t]?Promise.resolve(Wc[t]):cs.get(e,{headers:n}).then((e=>{let{data:r}=e;return Wc[t]=r,r}))}};class Zc{constructor(t){let{number:e,cvv:r,month:n,year:i,pin:a}=t;this.number=e,this.cvv=r,this.month=n,this.year=i,this.pin=a}getEncryptedPin(){return pc.getEncryptedPin(this.pin)}getLast4(){return pc.getLast4(this.number)}tokenize(){return pc.tokenize({number:this.number,cvv:this.cvv,month:this.month,year:this.year})}static getType(t){return pc.getType(t)}static validate(t){let{number:e,cvv:r,month:n,year:i}=t;return pc.validate({number:e,cvv:r,month:n,year:i})}static validateNumber(t){return pc.validateNumber(t)}static isNumberValid(t){return pc.isNumberValid(t)}static validateCVV(t,e){return pc.validateCVV(t,e)}static isCvvValid(t,e){return pc.isCvvValid(t,e)}static validateExpiry(t){return pc.validateExpiry(t)}static isExpiryValid(t){return pc.isExpiryValid(t)}static generateTestCard(t){return new Zc(pc.findTestCard(t))}}const Jc={reserveFunds(t){let{clientdata:e,last4:r,preauthorizationId:n,publicKey:i}=t;const a=new URL("preauthorization/create",Ki.paystackApiUrl).toString(),o=us(),s={Authorization:`Bearer ${i}`,...o&&{"Accept-Language":o}};return cs.post(a,{clientdata:e,last4:r,preauthorization:n},{headers:s}).then((t=>Zi.parse(t.data)))}},Yc="card";function Qc(t,e){return new Promise(((r,n)=>{const i=Zc.validate(t);if(!i.isValid){const r=e||t.number,a=`Invalid card details: ${Object.keys(i.result).filter((t=>!1===i.result[t])).join(", ")}`;n(Error(r?a:"Please set a valid card with setCard()"))}r()}))}var tu={setCard(t){return Qc(t,!0).then((()=>{this.card=new Zc(t)}))},reserveFunds(t){let{preauthorizationId:e,publicKey:r,customFields:n={}}=t;return Qc(this.card).then((()=>{this.logAttempt(Yc);const t={clientdata:this.card.tokenize(),last4:this.card.getLast4(),device:this.deviceFingerprint,preauthorizationId:e,publicKey:r,customFields:n};return Jc.reserveFunds(t).then((t=>(this.logAPIResponse(t,Yc),t)))}))},listenFor3DSCharge(t){const e={channel:`3DS_${this.id}`,paymentMethod:Yc};return this.listenForCharge(e,t)}};const eu={getByAccessCode(t){const e=us(),r={...e&&{"Accept-Language":e}},n=new URL(`preauthorization/verify_access_code/${t}`,Ki.paystackApiUrl).toString();return cs.get(n,{headers:r}).then((t=>t.data))},requery(t){let{reference:e,publicKey:r}=t;const n=us(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}},a=new URL(`preauthorization/verify/${e}`,Ki.paystackApiUrl).toString();return cs.get(a,{headers:i}).then((t=>Zi.parse(t.data)))}},ru={saveLog(t,e,r){const n=new URL(`preauthorization/update_log/${t}`,Ki.paystackApiUrl).toString();return zc.saveLog(n,{merchantKey:e,log:r})},getIp:()=>zc.getIp(),saveIp(t,e){const r=new URL(`preauthorization/set_ip/${t}`,Ki.paystackApiUrl).toString();return zc.saveIp(r,{merchantKey:e})}};var nu={initializeLog(t){this.log=qc.initializeLog(t)},getTimeSpent(){return this.log.time_spent=qc.getTimeSpent(this.log.start_time),this.log.time_spent},logPageOpen(){return this.log.history.push({type:"open",message:"Opened checkout",time:this.getTimeSpent()}),this.saveLog()},logChannelSwitch(t){return this.log.history.push({type:"action",message:`Set charge method to: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logValidationErrors(t){return t.forEach((t=>{this.log.history.push({type:"error",message:`Invalid ${t}`,time:this.getTimeSpent()})})),this.saveLog()},logInput(t){const e=this.log.history.find((e=>e.message===`Filled this field: ${t}`));return this.log.history.push({type:"input",message:`${e?"Changed":"Filled"} this field: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logAuthWindowOpen(){return this.log.history.push({type:"action",message:"Third-party authentication window opened",time:this.getTimeSpent()}),this.saveLog()},logAuthWindowClose(){return this.log.history.push({type:"action",message:"Third-party authentication window closed",time:this.getTimeSpent()}),this.saveLog()},logAPIResponse(t,e){switch(t.status){case"authorized":return this.logAuthorized(e);case"failed":return this.logError(t.message);case"auth":return this.logAuth(t.data.auth);default:return!1}},logAPIResponseMessage(t){return this.log.history.push({type:"action",message:t,time:this.getTimeSpent()}),this.saveLog()},logAttempt(t){let e="Attempted to charge";return t&&(e+=` with ${t}`),this.log.attempts+=1,this.log.history.push({type:"action",message:e,time:this.getTimeSpent()}),this.saveLog()},logAuth(t){return this.log.authentication=t,this.log.history.push({type:"auth",message:`Authentication Required: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logAuthorized(t){let e="Successfully preauthorized funds";return t&&(e+=` with ${t}`),this.log.success=!0,this.log.history.push({type:"authorized",message:e,time:this.getTimeSpent()}),this.saveLog()},logPageClose(){return this.log.history.push({type:"close",message:"Closed checkout",time:this.getTimeSpent()}),this.saveLog()},logError(t){let e="Error";return t&&(e+=`: ${t}`),this.log.errors+=1,this.log.history.push({type:"error",message:e,time:this.getTimeSpent()}),this.saveLog()},saveLog(){return ru.saveLog(this.id,this.merchant.key,this.log)},saveIpAddress(){return ru.saveIp(this.id,this.merchant.key)}};class iu{constructor(t){this.id=t.id,this.email=t.email,this.status=t.status,this.reference=t.reference,this.amount=t.amount,this.currency=t.currency,this.metadata=t.metadata||{},this.customer=t.customer,this.channels=t.channels||["card"],this.isListening=!1,this.isTest="test"===t.domain,this.deviceFingerprint=t.deviceFingerprint||null,this.merchant={id:t.merchant_id,logo:t.merchant_logo,name:t.merchant_name,key:t.merchant_key},this.card={},Ji(),this.log=null,Object.assign(this,nu),this.initializeLog(t.log),this.saveIpAddress(),Object.assign(this,tu)}setMetadata(t,e){this.metadata[t]=e}requery(){return eu.requery({reference:this.reference,publicKey:this.merchant.key}).then((t=>(this.logAPIResponse(t,"card"),t)))}listenForCharge(t,e){return Yi(t,this,e)}}const au={initialize:t=>Object.seal(new iu(t)),async getByAccessCode(t){const e=await qi(),r=await eu.getByAccessCode(t);return r&&Object.seal(new iu({...r.data,deviceFingerprint:e}))}};exports.BankAccount=Sc,exports.Card=fc,exports.Preauthorization=au,exports.Toolkit=class{static contents(){return[{key:"banks",usage:"Returns a list of banks that can be used to complete checkout"},{key:"resolutions",usage:"Returns a list of known errors, mapped to their suggested resolutions"},{key:"celebrations",usage:"Returns a list of upcoming celebrations"},{key:"states",usage:"Returns a list of states for a particular country"}]}static fetch(t,e){if(this.contents().map((t=>t.key)).indexOf(t)<=-1)throw new Error("Please provide a valid config key. Use Toolkit.contents() to see available options.");let r;switch(t){case"banks":r=Xc.fetchBanks(e||{pay_with_bank:"1"});break;case"resolutions":r=Xc.fetchResolutions();break;case"celebrations":r=Xc.fetchCelebrations();break;case"states":r=Xc.fetchStates(e)}return r}static resolveCardBin(t){return Xc.resolveCardBin(t)}},exports.Transaction=Kc;
|
|
30
|
+
var pt={};void 0!==pt.asn1&&pt.asn1||(pt.asn1={}),pt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";e=new D(n,16).xor(t).add(D.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=pt.asn1,r=e.DERBoolean,n=e.DERInteger,i=e.DERBitString,a=e.DEROctetString,o=e.DERNull,s=e.DERObjectIdentifier,c=e.DEREnumerated,u=e.DERUTF8String,h=e.DERNumericString,l=e.DERPrintableString,d=e.DERTeletexString,p=e.DERIA5String,f=e.DERUTCTime,g=e.DERGeneralizedTime,m=e.DERSequence,y=e.DERSet,v=e.DERTaggedObject,b=e.ASN1Util.newObject,T=Object.keys(t);if(1!=T.length)throw"key of param shall be only one.";var S=T[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+S+":"))throw"undefined key: "+S;if("bool"==S)return new r(t[S]);if("int"==S)return new n(t[S]);if("bitstr"==S)return new i(t[S]);if("octstr"==S)return new a(t[S]);if("null"==S)return new o(t[S]);if("oid"==S)return new s(t[S]);if("enum"==S)return new c(t[S]);if("utf8str"==S)return new u(t[S]);if("numstr"==S)return new h(t[S]);if("prnstr"==S)return new l(t[S]);if("telstr"==S)return new d(t[S]);if("ia5str"==S)return new p(t[S]);if("utctime"==S)return new f(t[S]);if("gentime"==S)return new g(t[S]);if("seq"==S){for(var w=t[S],A=[],E=0;E<w.length;E++){var C=b(w[E]);A.push(C)}return new m({array:A})}if("set"==S){for(w=t[S],A=[],E=0;E<w.length;E++)C=b(w[E]),A.push(C);return new y({array:A})}if("tag"==S){var O=t[S];if("[object Array]"===Object.prototype.toString.call(O)&&3==O.length){var k=b(O[2]);return new v({tag:O[0],explicit:O[1],obj:k})}var B={};if(void 0!==O.explicit&&(B.explicit=O.explicit),void 0!==O.tag&&(B.tag=O.tag),void 0===O.obj)throw"obj shall be specified for 'tag'.";return B.obj=b(O.obj),new v(B)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},pt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),n=(e=Math.floor(r/40)+"."+r%40,""),i=2;i<t.length;i+=2){var a=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);n+=a.substr(1,7),"0"==a.substr(0,1)&&(e=e+"."+new D(n,2).toString(10),n="")}return e},pt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new D(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=e(parseInt(s,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=e(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);return n},pt.asn1.ASN1Object=function(){var t="";this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+t.length+",v="+this.hV;var e=this.hV.length/2,r=e.toString(16);if(r.length%2==1&&(r="0"+r),e<128)return r;var n=r.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+r},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},pt.asn1.DERAbstractString=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},dt.lang.extend(pt.asn1.DERAbstractString,pt.asn1.ASN1Object),pt.asn1.DERAbstractTime=function(t){pt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,r){var n=this.zeroPadding,i=this.localDateToUTC(t),a=String(i.getFullYear());"utc"==e&&(a=a.substr(2,2));var o=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var c=n(String(s),3);o=o+"."+(c=c.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,r,n,i,a){var o=new Date(Date.UTC(t,e-1,r,n,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},dt.lang.extend(pt.asn1.DERAbstractTime,pt.asn1.ASN1Object),pt.asn1.DERAbstractStructured=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},dt.lang.extend(pt.asn1.DERAbstractStructured,pt.asn1.ASN1Object),pt.asn1.DERBoolean=function(){pt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},dt.lang.extend(pt.asn1.DERBoolean,pt.asn1.ASN1Object),pt.asn1.DERInteger=function(t){pt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new D(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},dt.lang.extend(pt.asn1.DERInteger,pt.asn1.ASN1Object),pt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}pt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var r=0;r<=e;r++)t+="0";var n="";for(r=0;r<t.length-1;r+=8){var i=t.substr(r,8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),n+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},dt.lang.extend(pt.asn1.DERBitString,pt.asn1.ASN1Object),pt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}pt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},dt.lang.extend(pt.asn1.DEROctetString,pt.asn1.DERAbstractString),pt.asn1.DERNull=function(){pt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},dt.lang.extend(pt.asn1.DERNull,pt.asn1.ASN1Object),pt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new D(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=e(parseInt(s,2))}return r};pt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=e(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(t){var e=pt.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},dt.lang.extend(pt.asn1.DERObjectIdentifier,pt.asn1.ASN1Object),pt.asn1.DEREnumerated=function(t){pt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new D(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},dt.lang.extend(pt.asn1.DEREnumerated,pt.asn1.ASN1Object),pt.asn1.DERUTF8String=function(t){pt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},dt.lang.extend(pt.asn1.DERUTF8String,pt.asn1.DERAbstractString),pt.asn1.DERNumericString=function(t){pt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},dt.lang.extend(pt.asn1.DERNumericString,pt.asn1.DERAbstractString),pt.asn1.DERPrintableString=function(t){pt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},dt.lang.extend(pt.asn1.DERPrintableString,pt.asn1.DERAbstractString),pt.asn1.DERTeletexString=function(t){pt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},dt.lang.extend(pt.asn1.DERTeletexString,pt.asn1.DERAbstractString),pt.asn1.DERIA5String=function(t){pt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},dt.lang.extend(pt.asn1.DERIA5String,pt.asn1.DERAbstractString),pt.asn1.DERUTCTime=function(t){pt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},dt.lang.extend(pt.asn1.DERUTCTime,pt.asn1.DERAbstractTime),pt.asn1.DERGeneralizedTime=function(t){pt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},dt.lang.extend(pt.asn1.DERGeneralizedTime,pt.asn1.DERAbstractTime),pt.asn1.DERSequence=function(t){pt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},dt.lang.extend(pt.asn1.DERSequence,pt.asn1.DERAbstractStructured),pt.asn1.DERSet=function(t){pt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},dt.lang.extend(pt.asn1.DERSet,pt.asn1.DERAbstractStructured),pt.asn1.DERTaggedObject=function(t){pt.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,r){this.hT=e,this.isExplicit=t,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},dt.lang.extend(pt.asn1.DERTaggedObject,pt.asn1.ASN1Object);var ft=function(t){function e(r){var n=t.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(e.hasPrivateKeyProperty(r)||e.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return g(e,t),e.prototype.parseKey=function(t){try{var e=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?y.decode(t):v.unarmor(t),i=k.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){e=i.sub[1].getHexStringValue(),this.n=M(e,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=i.sub[3].getHexStringValue();this.d=M(a,16);var o=i.sub[4].getHexStringValue();this.p=M(o,16);var s=i.sub[5].getHexStringValue();this.q=M(s,16);var c=i.sub[6].getHexStringValue();this.dmp1=M(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=M(u,16);var h=i.sub[8].getHexStringValue();this.coeff=M(h,16)}else{if(2!==i.sub.length)return!1;var l=i.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=M(e,16),r=l.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new pt.asn1.DERInteger({int:0}),new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e}),new pt.asn1.DERInteger({bigint:this.d}),new pt.asn1.DERInteger({bigint:this.p}),new pt.asn1.DERInteger({bigint:this.q}),new pt.asn1.DERInteger({bigint:this.dmp1}),new pt.asn1.DERInteger({bigint:this.dmq1}),new pt.asn1.DERInteger({bigint:this.coeff})]};return new pt.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return l(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new pt.asn1.DERSequence({array:[new pt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new pt.asn1.DERNull]}),e=new pt.asn1.DERSequence({array:[new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e})]}),r=new pt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new pt.asn1.DERSequence({array:[t,r]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return l(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(!t)return t;var r="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"},e.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(st),gt=function(){function t(t){t=t||{},this.default_key_size=parseInt(t.default_key_size,10)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return t.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ft(t)},t.prototype.setPrivateKey=function(t){this.setKey(t)},t.prototype.setPublicKey=function(t){this.setKey(t)},t.prototype.decrypt=function(t){try{return this.getKey().decrypt(d(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return l(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,r){try{return l(this.getKey().sign(t,e,r))}catch(t){return!1}},t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,d(e),r)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new ft,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.version="3.0.0-rc.1",t}();window.JSEncrypt=gt,t.JSEncrypt=gt,t.default=gt,Object.defineProperty(t,"__esModule",{value:!0})}(Ec.exports);var Oc=function(t){for(var e,r=0,n=!1,i=t.length-1;i>=0;)e=parseInt(t.charAt(i),10),n&&(e*=2)>9&&(e=e%10+1),n=!n,r+=e,i--;return r%10==0};var kc=function(t){return t?JSON.parse(JSON.stringify(t)):null};var Bc=function(t){return"string"==typeof t||t instanceof String};var Rc=function(t,e){return Array.isArray(e)?function(t,e,r){var n=String(e).length,i=t.substr(0,n),a=parseInt(i,10);return e=parseInt(String(e).substr(0,i.length),10),r=parseInt(String(r).substr(0,i.length),10),a>=e&&a<=r}(t,e[0],e[1]):function(t,e){return(e=String(e)).substring(0,t.length)===t.substring(0,e.length)}(t,e)},xc=kc,Dc=Rc;var Pc,Lc=function(t,e,r){var n,i,a,o;for(n=0;n<e.patterns.length;n++)if(i=e.patterns[n],Dc(t,i)){o=xc(e),a=Array.isArray(i)?String(i[0]).length:String(i).length,t.length>=a&&(o.matchStrength=a),r.push(o);break}},Ic={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}},Nc=kc,_c=function(t){if(function(t){var e=t.filter((function(t){return t.matchStrength})).length;return e>0&&e===t.length}(t))return t.reduce((function(t,e){return t?t.matchStrength<e.matchStrength?e:t:e}))},Mc=Bc,Vc=Lc,jc={},Uc={VISA:"visa",MASTERCARD:"mastercard",AMERICAN_EXPRESS:"american-express",DINERS_CLUB:"diners-club",DISCOVER:"discover",JCB:"jcb",UNIONPAY:"unionpay",MAESTRO:"maestro",ELO:"elo",MIR:"mir",HIPER:"hiper",HIPERCARD:"hipercard"},Fc=[Uc.VISA,Uc.MASTERCARD,Uc.AMERICAN_EXPRESS,Uc.DINERS_CLUB,Uc.DISCOVER,Uc.JCB,Uc.UNIONPAY,Uc.MAESTRO,Uc.ELO,Uc.MIR,Uc.HIPER,Uc.HIPERCARD];function zc(t){return jc[t]||Ic[t]}function qc(t,e){var r=Pc.indexOf(t);if(!e&&-1===r)throw new Error('"'+t+'" is not a supported card type.');return r}function Hc(t){var e,r=[];return Mc(t)?0===t.length?Pc.map((function(t){return Nc(zc(t))})):(Pc.forEach((function(e){var n=zc(e);Vc(t,n,r)})),(e=_c(r))?[e]:r):[]}Pc=Nc(Fc),Hc.getTypeInfo=function(t){return Nc(zc(t))},Hc.removeCard=function(t){var e=qc(t);Pc.splice(e,1)},Hc.addCard=function(t){var e=qc(t.type,!0);jc[t.type]=t,-1===e&&Pc.push(t.type)},Hc.updateCard=function(t,e){var r,n=jc[t]||Ic[t];if(!n)throw new Error('"'+t+'" is not a recognized type. Use `addCard` instead.');if(e.type&&n.type!==e.type)throw new Error("Cannot overwrite type parameter.");r=Nc(n),Object.keys(r).forEach((function(t){e[t]&&(r[t]=e[t])})),jc[r.type]=r},Hc.changeOrder=function(t,e){var r=qc(t);Pc.splice(r,1),Pc.splice(e,0,t)},Hc.resetModifications=function(){Pc=Nc(Fc),jc={}},Hc.types=Uc;var $c=Hc,Gc=Oc,Kc=$c;function Wc(t,e,r){return{card:t,isPotentiallyValid:e,isValid:r}}var Xc=function(t,e){var r,n,i,a,o;if(e=e||{},"number"==typeof t&&(t=String(t)),"string"!=typeof t)return Wc(null,!1,!1);if(t=t.replace(/\-|\s/g,""),!/^\d*$/.test(t))return Wc(null,!1,!1);if(0===(r=Kc(t)).length)return Wc(null,!1,!1);if(1!==r.length)return Wc(null,!0,!1);if(n=r[0],e.maxLength&&t.length>e.maxLength)return Wc(n,!1,!1);for(i=n.type===Kc.types.UNIONPAY&&!0!==e.luhnValidateUnionPay||Gc(t),o=Math.max.apply(null,n.lengths),e.maxLength&&(o=Math.min(e.maxLength,o)),a=0;a<n.lengths.length;a++)if(n.lengths[a]===t.length)return Wc(n,t.length<o||i,i);return Wc(n,t.length<o,!1)};function Zc(t,e,r){return{isValid:t,isPotentiallyValid:e,isCurrentYear:r||!1}}var Jc=function(t,e){var r,n,i,a,o;return e=e||19,"string"!=typeof t?Zc(!1,!1):""===t.replace(/\s/g,"")?Zc(!1,!0):/^\d*$/.test(t)?(n=t.length)<2?Zc(!1,!0):(r=(new Date).getFullYear(),3===n?Zc(!1,t.slice(0,2)===String(r).slice(0,2)):n>4?Zc(!1,!1):(t=parseInt(t,10),i=Number(String(r).substr(2,2)),2===n?(o=i===t,a=t>=i&&t<=i+e):4===n&&(o=r===t,a=t>=r&&t<=r+e),Zc(a,a,o))):Zc(!1,!1)},Yc=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Qc=Jc,tu=Yc;function eu(t,e,r){return{isValid:t,isPotentiallyValid:e,isValidForThisYear:r||!1}}var ru=function(t){var e,r,n=(new Date).getMonth()+1;return"string"!=typeof t?eu(!1,!1):""===t.replace(/\s/g,"")||"0"===t?eu(!1,!0):/^\d*$/.test(t)?(e=parseInt(t,10),isNaN(t)?eu(!1,!1):eu(r=e>0&&e<13,r,r&&e>=n)):eu(!1,!1)},nu=function(t){var e,r,n,i,a;return/^\d{4}-\d{1,2}$/.test(t)?t=t.split("-").reverse():/\//.test(t)?t=t.split(/\s*\/\s*/g):/\s/.test(t)&&(t=t.split(/ +/g)),tu(t)?{month:t[0]||"",year:t.slice(1).join()}:(n=t,r=0===(a=Number(n[0]))?2:a>1||1===a&&Number(n[1])>2?1:1===a?(i=n.substr(1),Qc(i).isPotentiallyValid?1:2):5===n.length?1:n.length>5?2:1,{month:e=t.substr(0,r),year:t.substr(e.length)})},iu=ru,au=Jc;function ou(t,e,r,n){return{isValid:t,isPotentiallyValid:e,month:r,year:n}}var su=3;function cu(t,e){return{isValid:t,isPotentiallyValid:e}}function uu(t,e){return{isValid:t,isPotentiallyValid:e}}var hu={number:Xc,expirationDate:function(t,e){var r,n,i,a;if("string"==typeof t)t=t.replace(/^(\d\d) (\d\d(\d\d)?)$/,"$1/$2"),r=nu(t);else{if(null===t||"object"!=typeof t)return ou(!1,!1,null,null);r={month:String(t.month),year:String(t.year)}}if(n=iu(r.month),i=au(r.year,e),n.isValid){if(i.isCurrentYear)return ou(a=n.isValidForThisYear,a,r.month,r.year);if(i.isValid)return ou(!0,!0,r.month,r.year)}return n.isPotentiallyValid&&i.isPotentiallyValid?ou(!1,!0,null,null):ou(!1,!1,null,null)},expirationMonth:ru,expirationYear:Jc,cvv:function(t,e){return e=(e=e||su)instanceof Array?e:[e],"string"!=typeof t?cu(!1,!1):/^\d*$/.test(t)?function(t,e){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}(e,t.length)?cu(!0,!0):t.length<Math.min.apply(null,e)?cu(!1,!0):t.length>function(t){for(var e=su,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return e}(e)?cu(!1,!1):cu(!0,!0):cu(!1,!1)},postalCode:function(t,e){var r;return r=(e=e||{}).minLength||3,"string"!=typeof t?uu(!1,!1):t.length<r?uu(!1,!0):uu(!0,!0)},creditCardType:$c},lu=[{type:"bank_auth",name:"Bank authorization",number:"4084080000000409",cvv:"000",month:"01",year:"30"},{type:"success",name:"Success",number:"4084084084084081",cvv:"408",month:"12",year:"30"},{type:"declined",name:"Declined",number:"4084080000005408",cvv:"001",month:"12",year:"30"},{type:"pin",name:"Pin only validation",number:"507850785078507812",cvv:"884",month:"01",year:"30"},{type:"pin+otp",name:"Pin and OTP validation",number:"5060666666666666666",cvv:"123",month:"01",year:"30"},{type:"pin+phone+otp",name:"Pin, phone and OTP validation",number:"507850785078507812",cvv:"884",month:"01",year:"30"},{type:"default",name:"No validation",number:"4084084084084081",cvv:"408",month:"01",year:"30"}];hu.creditCardType.addCard({niceType:"Verve",type:"verve",patterns:[[506e3,507999],[65e4,650009]],gaps:[4,8,12,16],lengths:[16,18,19],code:{name:"CVV",size:3}}),hu.creditCardType.changeOrder("verve",0);const du={getEncryptedPin:t=>t?Cc(t):void 0,getLast4:t=>t.substring(t.length-4),tokenize(t){let{number:e,cvv:r,month:n,year:i}=t;return Cc(`${e}*${r}*${n}*${i}`)},getType(t){const e=hu.number(t);return e&&e.card?{type:e.card.type,maxLength:Math.max(...e.card.lengths),minLength:Math.min(...e.card.lengths)}:{type:null,maxLength:0}},validate(t){let{number:e,cvv:r,month:n,year:i}=t;const{type:a}=this.getType(e),o={number:this.isNumberValid(e),expiry:this.isExpiryValid({month:n,year:i}),cvv:this.isCvvValid(r,a)};return{isValid:Object.values(o).every((t=>!0===t)),result:o}},validateNumber:t=>hu.number(t),isNumberValid:t=>du.validateNumber(t).isValid,validateCVV(t,e){const r="american-express"===e?4:3;return hu.cvv(t,r)},isCvvValid:(t,e)=>du.validateCVV(t,e).isValid,validateExpiry(t){if(null!==t&&"object"==typeof t){const{month:e,year:r}=t;return hu.expirationMonth(e)&&hu.expirationYear(r)}return hu.expirationDate(t)},isExpiryValid:t=>du.validateExpiry(t).isValid,findTestCard(t){const e=t||"default";return lu.find((t=>t.type===e))}};class pu{constructor(t){let{number:e,cvv:r,month:n,year:i,pin:a}=t;this.number=e,this.cvv=r,this.month=n,this.year=i,this.pin=a}getEncryptedPin(){return du.getEncryptedPin(this.pin)}getLast4(){return du.getLast4(this.number)}tokenize(){return du.tokenize({number:this.number,cvv:this.cvv,month:this.month,year:this.year})}static getType(t){return du.getType(t)}static validate(t){let{number:e,cvv:r,month:n,year:i}=t;return du.validate({number:e,cvv:r,month:n,year:i})}static validateNumber(t){return du.validateNumber(t)}static isNumberValid(t){return du.isNumberValid(t)}static validateCVV(t,e){return du.validateCVV(t,e)}static isCvvValid(t,e){return du.isCvvValid(t,e)}static validateExpiry(t){return du.validateExpiry(t)}static isExpiryValid(t){return du.isExpiryValid(t)}static generateTestCard(t){return new pu(du.findTestCard(t))}}const fu={charge(t){let{clientdata:e,last4:r,pin:n,trans:i,device:a,rememberCard:o,transactionType:s,subscription:c,customFields:u}=t;const h=`${Ki.paymentBaseUrl}charge/`,l=cc(),d={"Content-Type":"application/x-www-form-urlencoded",...l&&{"Accept-Language":l}},p={clientdata:e,last4:r,trans:i,device:a,offset:(new Date).getTimezoneOffset(),remember_card:o,...s&&{transaction_type:s},...c&&{subscription:c},...u&&u};n&&(p.handle=n);const f=pc(p);return sc.post(h,f,{headers:d}).then((t=>Zi.parse(t.data)))},resumeCardCharge(t){let{device:e,accessCode:r,pin:n}=t;const i=`${Ki.paymentBaseUrl}charge/resume/${r}`,a=cc(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s={device:e,...n&&{handle:n}},c=pc(s);return sc.post(i,c,{headers:o}).then((t=>Zi.parse(t.data)))},chargeRememberedCard(t){let{last4:e,trans:r,device:n,authorizationCode:i,cvv:a,pin:o,transactionType:s,subscription:c}=t;const u=`${Ki.paymentBaseUrl}charge/`,h=cc(),l={"Content-Type":"application/x-www-form-urlencoded",...h&&{"Accept-Language":h}},d={last4:e,trans:r,device:n,cvv:a,handle:o,authorization_code:i,...s&&{transaction_type:s},...c&&{subscription:c}},p=pc(d);return sc.post(u,p,{headers:l}).then((t=>Zi.parse(t.data)))},authenticate(t,e){const r=`${Ki.paymentBaseUrl}charge/validate`,n={trans:t,token:e},i=cc(),a={...i&&{"Accept-Language":i}},o=pc(n);return sc.post(r,o,{headers:a}).then((t=>Zi.parse(t.data)))},verifyAddress(t){let{address:e,city:r,state:n,zipCode:i,transactionId:a}=t;const o=`${Ki.paymentBaseUrl}charge/avs`,s=cc(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u=pc({city:r,state:n,address:e,zip_code:i,trans:a});return sc.post(o,u,{headers:c}).then((t=>Zi.parse(t.data)))},forgetRememberedCard(t){let{authorizationId:e,publicKey:r}=t;const n=cc(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}},a={authorization_id:e},o=`${Ki.paystackApiUrl}rememberme/forget_card`;return sc.post(o,a,{headers:i}).then((t=>Zi.parse(t.data)))},async sendSavedCardsOTP(t){let{transaction:e,phone:r,channels:n,email:i}=t;const a=new URL("/saved_cards/authorize",Ki.paystackApiUrl).toString(),o=cc(),s={...o&&{"Accept-Language":o}},c={...r&&{phone:r},...n&&{channels:n},...i&&{email:i},transaction:e};return(await sc.post(a,c,{headers:s})).data},async verifySavedCardsOtp(t){let{code:e,transaction:r,token:n}=t;const i=new URL("/saved_cards/authorize/verify",Ki.paystackApiUrl).toString(),a=cc(),o={Authorization:`Bearer ${n}`,...a&&{"Accept-Language":a}},s={code:e,transaction:r};return(await sc.post(i,s,{headers:o})).data},async getSavedCards(t){let{token:e}=t;const r=new URL("/saved_cards/cards",Ki.paystackApiUrl).toString(),n=cc(),i={Authorization:`Bearer ${e}`,"jwt-auth":!0,...n&&{"Accept-Language":n}};return(await sc.get(r,{headers:i})).data},async deleteSavedCard(t){let{cardCode:e,token:r}=t;const n=new URL(`/saved_cards/cards/${e}`,Ki.paystackApiUrl).toString(),i=cc(),a={Authorization:`Bearer ${r}`,"jwt-auth":!0,...i&&{"Accept-Language":i}};return(await sc.delete(n,{headers:a})).data},async chargeSavedCard(t){let{token:e,device:r,cardCode:n,transaction:i,selectedCurrency:a}=t;const o=new URL(`/saved_cards/cards/${n}/charge`,Ki.paystackApiUrl).toString(),s=cc(),c={Authorization:`Bearer ${e}`,"jwt-auth":!0,...s&&{"Accept-Language":s}},u={device:r,transaction:i,selected_currency:a},h=await sc.post(o,u,{headers:c});return Zi.parse(h.data)}},gu="card",mu="saved card",yu="otp";function vu(t,e){return new Promise(((r,n)=>{const i=pu.validate(t);if(!i.isValid){const r=e||t.number,a=`Invalid card details: ${Object.keys(i.result).filter((t=>!1===i.result[t])).join(", ")}`;n(Error(r?a:"Please set a valid card with Transaction.setCard()"))}r()}))}var bu={setCard(t){return vu(t,!0).then((()=>{this.card=new pu(t)}))},rememberCard(){this.remember_card=!0},chargeCard(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!this.card.number&&this.card.pin?this.chargeCardWithPin(t):vu(this.card).then((()=>{this.logAttempt(gu);const e={clientdata:this.card.tokenize(),last4:this.card.getLast4(),pin:this.card.getEncryptedPin(),trans:this.id,device:this.deviceFingerprint,rememberCard:this.remember_card,transactionType:this.transactionType,subscription:this.subscription,customFields:t};return fu.charge(e).then((t=>(this.logAPIResponse(t,gu),t)))}))},chargeCardWithPin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logAttempt(gu);const e={pin:Cc(this.card.pin),trans:this.id,device:this.deviceFingerprint,rememberCard:this.remember_card,transactionType:this.transactionType,subscription:this.subscription,customFields:t};return fu.charge(e).then((t=>(this.logAPIResponse(t,gu),t)))},chargeRememberedCard(t){let{cvv:e,authorizationCode:r,cardLast4:n,pin:i}=t;this.logAttempt(gu);const a=Cc(i),o={authorizationCode:r,cvv:e,last4:n,trans:this.id,device:this.deviceFingerprint,pin:a,transactionType:this.transactionType,subscription:this.subscription};return fu.chargeRememberedCard(o).then((t=>(this.logAPIResponse(t,gu),t)))},resumeCardCharge(t){let{accessCode:e,pin:r}=t;const n={...r&&{pin:Cc(r)},accessCode:e,device:this.deviceFingerprint};return fu.resumeCardCharge(n).then((t=>(this.logAPIResponse(t,gu),t)))},forgetRememberedCard(t){const e={authorizationId:t,publicKey:this.merchant.key};return fu.forgetRememberedCard(e).then((t=>(this.logAPIResponse(t,gu),t)))},authenticateCard(t){return fu.authenticate(this.id,t).then((t=>(this.logAPIResponse(t,gu),t)))},verifyAddress(t){let{address:e,city:r,state:n,zipCode:i}=t;const a={city:r,state:n,address:e,zipCode:i,transactionId:this.id};return fu.verifyAddress(a).then((t=>(this.logAPIResponse(t,gu),t)))},listenFor3DSCharge(t){const e={channel:`3DS_${this.id}`,paymentMethod:gu};return this.listenForCharge(e,t)},async sendSavedCardsOTP(){let{phone:t,channels:e,email:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{this.logAuth(yu);const n=await fu.sendSavedCardsOTP({phone:t,transaction:this.id,channels:e,email:r});return this.savedCardsTempAuthToken=n.data.token,n}catch(t){throw this.savedCardsTempAuthToken=null,t}},async verifySavedCardsOtp(t){let{code:e}=t;const r={code:e,transaction:this.id,token:this.savedCardsTempAuthToken};try{const t=await fu.verifySavedCardsOtp(r);return this.savedCardsToken=t.data.token,t}catch(t){throw this.savedCardsToken=null,t}},getSavedCards(){return fu.getSavedCards({token:this.savedCardsToken})},deleteSavedCard(t){return fu.deleteSavedCard({cardCode:t,token:this.savedCardsToken})},chargeSavedCard(t){let{cardCode:e,selectedCurrency:r=this.currency}=t;return this.logAttempt(mu),fu.chargeSavedCard({cardCode:e,transaction:this.id,token:this.savedCardsToken,device:this.deviceFingerprint,selectedCurrency:r})}};class Tu{constructor(t){let{bankId:e,accountType:r,accountNumber:n}=t;this.bankId=e,this.accountType=r,this.accountNumber=n}static validate(t){let{bankId:e,accountType:r,accountNumber:n}=t;const i=[];return e&&"number"==typeof e||i.push("Invalid bankId. Please check for supported banks with BankAccount.supportedBanks()"),Tu.types.indexOf(r)>-1?"nuban"!==r||Tu.isValidNubanAccount(n)||i.push("Invalid account number. Nuban accounts must be 10 digit numbers"):i.push("Invalid bank type. Please check BankAccount.types for the list of valid bank types"),{isValid:0===i.length,errors:i}}static isValidNubanAccount(t){if(!t)return!1;return("number"==typeof t||/^\d+$/.test(t))&&10===t.length}static supportedBanks(){const t=`${Ki.paymentBaseUrl}bank?pay_with_bank=true`,e=cc(),r={...e&&{"Accept-Language":e}};return sc.post(t,{headers:r}).then((t=>t.data))}}Tu.types=["nuban"];const Su={verify(t){let{bankId:e,transactionId:r,accountNumber:n,device:i}=t;const a=`${Ki.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=cc(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=pc({account_number:n,device:i});return sc.post(a,c,{headers:s}).then((t=>Zi.parse(t.data)))},register(t){let{bankId:e,transactionId:r,accountNumber:n,birthday:i}=t;const a=`${Ki.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=cc(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=pc({account_number:n,birthday:i});return sc.post(a,c,{headers:s}).then((t=>Zi.parse(t.data)))},authenticate(t){let{bankId:e,transactionId:r,token:n,device:i}=t;const a=`${Ki.paymentBaseUrl}bank/validate_token/${e}/${r}`,o=cc(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=pc({device:i,token:n});return sc.post(a,c,{headers:s}).then((t=>Zi.parse(t.data)))}},wu="bank account";function Au(t,e){return new Promise(((r,n)=>{const i=Tu.validate(t);if(!i.isValid){const r=e||t.accountNumber?i.errors[0]:"Please set a valid bank account with Transaction.setBank()";n(Error(r))}r()}))}const Eu={charge(t){let{bankId:e,transactionId:r,phoneNumber:n,payId:i,walletId:a}=t;const o=`${Ki.paymentBaseUrl}bank/digitalbankmandate/${e}/${r}`,s=cc(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u=pc(a?{wallet_id:a}:{phone_number:n,token:i});return sc.post(o,u,{headers:c}).then((t=>Zi.parse(t.data)))}},Cu="bank",Ou={...{setBankAccount(t){return Au(t,!0).then((()=>{this.bankAccount=new Tu(t)}))},chargeBankAccount(){return Au(this.bankAccount).then((()=>{this.logAttempt(wu);const t={bankId:this.bankAccount.bankId,transactionId:this.id,accountNumber:this.bankAccount.accountNumber,device:this.deviceFingerprint};return Su.verify(t).then((t=>(this.logAPIResponse(t,wu),t)))}))},registerBankAccount(t){return Au(this.bankAccount).then((()=>{const e={bankId:this.bankAccount.bankId,transactionId:this.id,accountNumber:this.bankAccount.accountNumber,birthday:t};return Su.register(e).then((t=>(this.logAPIResponse(t,wu),t)))}))},authenticateBankAccount(t){return Au(this.bankAccount).then((()=>{const e={bankId:this.bankAccount.bankId,transactionId:this.id,token:t,device:this.deviceFingerprint};return Su.authenticate(e).then((t=>(this.logAPIResponse(t,wu),t)))}))}},...{getIbankUrl(t){let{bankId:e}=t;return new Promise(((t,r)=>{e||r(Error("Please send bankId"));const n=`${Ki.paymentBaseUrl}bank/ibank/${e}/${this.id}`;t(Zi.success({url:n}))}))},listenForIbankCharge(t){const e={channel:`IBANK_${this.id}`,paymentMethod:"ibank"};return this.listenForCharge(e,t)}},...{chargeDigitalBankMandate(t){let{phoneNumber:e,payId:r,bankId:n,walletId:i}=t;const a={transactionId:this.id,phoneNumber:e,payId:r,bankId:n,walletId:i};return Eu.charge(a).then((t=>(this.logAPIResponse(t,Cu),t)))},listenForDigitalBankMandateCharge(t){const e={paymentMethod:Cu,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}}},ku={generateShortcode(t,e){const r=cc(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return sc.post(`${Ki.paystackApiUrl}checkout/ussd/reference`,t,{headers:n}).then((t=>Zi.parse(t.data)))},generatePWTUSSDShortcode(t,e){const r=cc(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return sc.post(`${Ki.paystackApiUrl}checkout/pay_with_transfer_ussd`,t,{headers:n}).then((t=>Zi.parse(t.data)))}};var Bu={getUSSDShortcode(t){let{channel:e}=t;const r={transaction:this.id,channel:e};return ku.generateShortcode(r,this.merchant.key).then((t=>("success"===t.status&&(this.ussd[e]=t),t)))},getPWTUSSDShortcode(t){let{bankSlug:e,fulfilLateNotification:r=!1}=t;const n={transaction_id:this.id,fulfil_late_notification:r,bank_slug:e};return ku.generatePWTUSSDShortcode(n,this.merchant.key).then((t=>("success"===t.status&&(this.ussd[e]=t),t)))},listenForPWTUSSDCharge(t,e){let{bankSlug:r}=t;if(!this.ussd[r])return Promise.reject(Error("Please generate a ussd shortcode with Transaction.getPWTUSSDShortcode()"));const{data:n}=this.ussd[r],i={channel:n.pusher_channel,paymentMethod:"ussd"};return this.listenForCharge(i,e)},listenForUSSDCharge(t,e){let{channel:r}=t;if(!this.ussd[r])return Promise.reject(Error("Please generate a ussd shortcode with Transaction.getUSSDShortcode()"));const{data:n}=this.ussd[r],i={channel:n.channel,paymentMethod:r};return this.listenForCharge(i,e)}};const Ru={generateQrCode(t,e){let{transaction:r,channel:n}=t;const i={source:"checkout",reference:r,channel:n},a=cc(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return sc.post(`${Ki.paystackApiUrl}offline/qr/generate`,i,{headers:o}).then((t=>Zi.parse(t.data)))}};function xu(t){return new Promise(((e,r)=>{const n=["visa","MPASS_OLTI"];if(n.indexOf(t)<=-1){const t=`Invalid channel. Available channels: ${n.join(", ")}`;r(Error(t))}else e()}))}var Du={getQRCode(t){let{channel:e}=t;return xu(e).then((()=>{if(this.qr[e])return this.qr[e];const t={transaction:this.id,channel:e};return Ru.generateQrCode(t,this.merchant.key).then((t=>("success"===t.status&&(this.qr[e]=t),t)))}))},listenForQRCharge(t,e){let{channel:r}=t;return xu(r).then((()=>{if(!this.qr[r])return Promise.reject(Error("Please generate qr code with Transaction.getQRCode()"));const{data:t}=this.qr[r],n={channel:t.channel,paymentMethod:r};return this.listenForCharge(n,e)}))}};class Pu{static hasCountryCode(t){return t&&"+"===t[0]}static hasOnlyDigits(t){return t&&(e=t.substring(1),/^\d+$/.test(e));var e}static isE164Number(t){return t&&t.length<17}static validate(t){const e=[];return Pu.hasCountryCode(t)||e.push("Number should include country code prefix"),Pu.hasOnlyDigits(t)||e.push("Number should contain only digits"),Pu.isE164Number(t)||e.push("Number should not be longer than 16 digits"),{isValid:0===e.length,errors:e}}}const Lu={charge(t){let{transaction:e,phone:r,device:n,channel_name:i,provider:a,voucher:o,registrationToken:s}=t;const c={transaction:e,phone:r,device:n,channel_name:i,provider:a,voucher:o,registration_token:s},u=cc(),h={...u&&{"Accept-Language":u}};return sc.post(`${Ki.paystackApiUrl}charge/mobile_money`,c,{headers:h}).then((t=>Zi.parse(t.data))).catch((t=>{let{response:e}=t;return Zi.parse(e.data)}))},submitCode(t){let{transaction:e,code:r}=t;const n=cc(),i={...n&&{"Accept-Language":n}},a=pc({transaction:e,otp:r}),o=new URL("charge/momo_payin_finalize",Ki.paymentBaseUrl).toString();return sc.post(o,a,{headers:i}).then((t=>Zi.parse(t.data)))}};function Iu(t){return new Promise(((e,r)=>{const n=Pu.validate(t);if(!n.isValid){const e=t?n.errors[0]:"Please start a mobile money transaction with Transaction.chargeMobileMoney()";r(Error(e))}e(n)}))}var Nu={mobileMoneyChargeAPI(t){return Lu.charge(t).then((t=>("success"===t.status&&(this.mobileMoney=t,t.data&&t.data.display&&1===t.data.display.otpSentCount&&this.logTokenRequest("mobile money")),t)))},chargeMobileMoney(t){let{phoneNumber:e,provider:r,voucher:n,registrationToken:i}=t;return Iu(e).then((()=>{this.logAttempt("mobile money");const t={provider:r,voucher:n,registrationToken:i,transaction:this.id,phone:e,device:this.deviceFingerprint,channel_name:`MOBILE_MONEY_${this.id}`};return this.mobileMoneyChargeAPI(t)}))},chargeMpesaOffline(t){let{provider:e,voucher:r,registrationToken:n}=t;this.logAttempt("mobile money");const i={provider:e,voucher:r,registrationToken:n,transaction:this.id,device:this.deviceFingerprint,channel_name:`MOBILE_MONEY_${this.id}`};return this.mobileMoneyChargeAPI(i)},authenticateMobileMoney(t){const{phoneNumber:e,provider:r,registrationToken:n}=t;return Iu(e).then((()=>{this.logMobileMoneyActions(t);const i={provider:r,registrationToken:n,transaction:this.id,phone:e,device:this.deviceFingerprint,channel_name:`MOBILE_MONEY_${this.id}`};return Lu.charge(i).then((t=>("success"===t.status?(this.mobileMoney=t,t.data&&t.data.display&&1===t.data.display.otpSentCount&&this.logTokenRequest("mobile money")):t.errors&&t.errors.data&&"awaiting_registration_token"===t.errors.data.status?this.logTokenAuthenticationFailure(t.message):this.logError(t.message),t)))}))},submitMobileMoneyCode(t){return Lu.submitCode({code:t.code,transaction:this.id}).then((t=>(this.logAPIResponse(t,"mobile_money"),t)))},listenForMobileMoneyCharge(t){if("success"!==this.mobileMoney.status)return Promise.reject(Error("Please start a mobile money charge with Transaction.chargeMobileMoney()"));const{channel:e,channel_name:r}=this.mobileMoney.data,n={channel:e||r,paymentMethod:"mobile_money"};return this.listenForCharge(n,t)}};const _u={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r},i=cc(),a={...i&&{"Accept-Language":i}};return sc.post(`${Ki.paystackApiUrl}login`,n,{headers:a}).then((t=>Zi.parse(t.data)))},charge(t){let{account_code:e,transaction:r,token:n}=t;const i=cc(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={account_code:e,transaction:r};return sc.post(`${Ki.paystackApiUrl}directdebit/initiate`,o,{headers:a}).then((t=>Zi.parse(t.data)))},authenticate(t){let{otp:e,transaction:r,token:n}=t;const i=cc(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={otp:e,transaction:r};return sc.post(`${Ki.paystackApiUrl}directdebit/validate`,o,{headers:a}).then((t=>Zi.parse(t.data)))},getProvisionedAccounts(t){const e=cc(),r={Authorization:`Bearer ${t}`,"jwt-auth":!0,...e&&{"Accept-Language":e}};return sc.get(`${Ki.paystackApiUrl}directdebit/account`,{headers:r}).then((t=>t.data))}},Mu="direct debit";var Vu={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r};return Pi(e)?_u.loginToDirectDebitAccount(n).then((t=>{if("success"===t.status){const{data:{token:e,user:{permissions:r}}}=t;if(!r||r.length<1)throw Error("You do not have the privileges to perform this action");if(r.find((t=>"directdebit-*"===t)))return this.directDebit.token=e,t;throw Error("You do not have the privileges to perform this action")}return t})):Promise.reject(Error("Invalid email"))},chargeDirectDebit(t){if(!this.directDebit.token)return Promise.reject(Error("Please login with Transaction.loginToDirectDebitAccount() to start a Direct debit charge"));this.logAttempt(Mu);const e={account_code:t,transaction:this.id,token:this.directDebit.token};return _u.charge(e).then((t=>(this.logAPIResponse(t,Mu),t.status&&(this.directDebit.chargeResponse=t),t)))},getProvisionedAccounts(){return _u.getProvisionedAccounts(this.directDebit.token).then((t=>{this.logAPIResponse(t,Mu);const{status:e,data:r}=t;if(e){if(r&&r.length<1)return Promise.reject(Error("You have not provisioned any bank account for Direct Debit yet"));this.directDebit.accounts=t.data}return t}))},authenticateAccount(t){const e={otp:t,transaction:this.id,token:this.directDebit.token};return _u.authenticate(e).then((t=>(this.logAPIResponse(t,Mu),t)))}},ju={get:t=>({card:bu,bank:Ou,ussd:Bu,qr:Du,mobile_money:Nu,direct_debit:Vu,bank_transfer:lc,eft:yc,payattitude:mc,apple_pay:Tc,paypal:Ac}[t])},Uu=function(t){t||"undefined"==typeof navigator||(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return"string"==typeof t&&(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))};const Fu={initializeLog(t){const{attempts:e,authentication:r,errors:n,history:i}=t||{};return{start_time:Math.round(Date.now()/1e3),time_spent:0,attempts:e||0,authentication:r,errors:n||0,success:!1,mobile:Uu(),input:[],history:i||[]}},getTimeSpent:t=>Math.round(Date.now()/1e3)-t},zu={saveLog(t,e){let{merchantKey:r,log:n}=e;const i=cc(),a={Authorization:`Bearer ${r}`,...i&&{"Accept-Language":i}};return sc.post(t,{payload:JSON.stringify(n)},{headers:a}).then((t=>t.data))},getIp(){const t=cc(),e={...t&&{"Accept-Language":t}};return sc.get("https://api.paystack.co/decision/ip",{headers:e}).then((t=>t.data.data.ip_address))},saveIp(t,e){let{merchantKey:r}=e;const n=cc(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}};return sc.post(t,null,{headers:i}).then((t=>t.data))},saveReferrer(t,e){let{merchantKey:r,referrer:n}=e;const i=cc(),a={Authorization:`Bearer ${r}`,...i&&{"Accept-Language":i}};return sc.post(t,{referrer:n},{headers:a}).then((t=>t.data))}},qu={saveLog(t,e,r){const n=new URL(`transaction/update_log/${t}`,Ki.paystackApiUrl).toString();return zu.saveLog(n,{merchantKey:e,log:r})},getIp:()=>zu.getIp(),saveIp(t,e){const r=new URL(`transaction/set_ip/${t}`,Ki.paystackApiUrl).toString();return zu.saveIp(r,{merchantKey:e})},saveReferrer(t,e,r){const n=new URL(`transaction/set_referrer/${t}`,Ki.paystackApiUrl).toString();return zu.saveReferrer(n,{merchantKey:e,referrer:r})}};var Hu={initializeLog(t){this.log=Fu.initializeLog(t)},getTimeSpent(){return this.log.time_spent=Fu.getTimeSpent(this.log.start_time),this.log.time_spent},logPageOpen(){return this.log.history.push({type:"open",message:"Opened checkout",time:this.getTimeSpent()}),this.saveLog()},logChannelSwitch(t){return this.log.history.push({type:"action",message:`Set payment method to: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logValidationErrors(t){return t.forEach((t=>{this.log.history.push({type:"error",message:`Invalid ${t}`,time:this.getTimeSpent()})})),this.saveLog()},logInput(t){const e=this.log.history.find((e=>e.message===`Filled this field: ${t}`));return this.log.history.push({type:"input",message:`${e?"Changed":"Filled"} this field: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logBankSelect(t){return this.log.history.push({type:"action",message:`Selected bank: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logSavedCardSelect(){return this.log.history.push({type:"action",message:"Selected saved card",time:this.getTimeSpent()}),this.saveLog()},logAuthWindowOpen(){return this.log.history.push({type:"action",message:"Third-party authentication window opened",time:this.getTimeSpent()}),this.saveLog()},logAuthWindowClose(){return this.log.history.push({type:"action",message:"Third-party authentication window closed",time:this.getTimeSpent()}),this.saveLog()},logAPIResponse(t,e){switch(t.status){case"success":return this.logSuccess(e);case"pending":return this.logPending(e);case"failed":return this.logError(t.message);case"auth":return this.logAuth(t.data.auth);default:return!1}},logMobileMoneyActions(t){let{numberOfTokenRequests:e,registrationToken:r}=t;e?this.logTokenRequest("mobile money",e):r?this.logTokenSubmitted("mobile money"):this.logAttempt("mobile money")},logAPIResponseMessage(t){return this.log.history.push({type:"action",message:t,time:this.getTimeSpent()}),this.saveLog()},logAttempt(t){let e="Attempted to pay";return t&&(e+=` with ${t}`),this.log.attempts+=1,this.log.history.push({type:"action",message:e,time:this.getTimeSpent()}),this.saveLog()},logTokenRequest(t){const e=0===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)?"Waiting for customer to submit OTP":"Customer requested to resend OTP";return this.log.history.push({type:"action",message:e,channel:t,time:this.getTimeSpent()}),this.saveLog()},logTokenSubmitted(t){return this.log.history.push({type:"action",message:"Customer submitted OTP",channel:t,time:this.getTimeSpent()}),this.saveLog()},logTokenAuthenticationFailure(t){const e=t?`Error: ${t}`:"Error";return this.log.errors+=1,this.log.history.push({type:"error",message:e,authentication:"failed",time:this.getTimeSpent()}),this.saveLog()},logError(t){let e="Error";return t&&(e+=`: ${t}`),this.log.errors+=1,this.log.history.push({type:"error",message:e,time:this.getTimeSpent()}),this.saveLog()},logAuth(t){return this.log.authentication=t,this.log.history.push({type:"auth",message:`Authentication Required: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logSuccess(t){let e="Successfully paid";return t&&(e+=` with ${t}`),this.log.success=!0,this.log.history.push({type:"success",message:e,time:this.getTimeSpent()}),this.saveLog()},logPending(t){let e="Payment in progress";return t&&(e+=` with ${t}`),this.log.history.push({type:"pending",message:e,time:this.getTimeSpent()}),this.saveLog()},logPageClose(){return this.log.history.push({type:"close",message:"Closed checkout",time:this.getTimeSpent()}),this.saveLog()},logTransactionCurrencySwitch(t){let{currency:e,isUserAction:r=!0}=t;const n=r?"User switched":"Switched";return this.log.history.push({type:"action",message:`${n} transaction currency to ${e}`,time:this.getTimeSpent()}),this.saveLog()},saveLog(){return qu.saveLog(this.id,this.merchant.key,this.log)},saveIpAddress(){return qu.saveIp(this.id,this.merchant.key)},saveReferrer(t){return qu.saveReferrer(this.id,this.merchant.key,t)}};const $u={async sendLinkOtp(t){let{transaction:e,phone:r,channels:n,email:i}=t;const a=new URL("/saved_cards/authorize",Ki.paystackApiUrl).toString(),o=cc(),s={...o&&{"Accept-Language":o}},c={...r&&{phone:r},...n&&{channels:n},...i&&{email:i},transaction:e,is_six_digit_otp:!0};return(await sc.post(a,c,{headers:s})).data},async verifyLinkOtp(t){let{code:e,transaction:r,token:n}=t;const i=new URL("/saved_cards/authorize/verify",Ki.paystackApiUrl).toString(),a=cc(),o={Authorization:`Bearer ${n}`,...a&&{"Accept-Language":a}},s={code:e,transaction:r};return(await sc.post(i,s,{headers:o})).data},async getLinkPaymentInstruments(t){let{token:e}=t;const r=new URL("/saved_cards/links",Ki.paystackApiUrl).toString(),n=cc(),i={Authorization:`Bearer ${e}`,"jwt-auth":!0,...n&&{"Accept-Language":n}};return(await sc.get(r,{headers:i})).data}};var Gu={async sendLinkOtp(){let{phone:t,channels:e,email:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const n=await $u.sendLinkOtp({phone:t,transaction:this.id,channels:e,email:r});return this.linkTempAuthToken=n.data.token,n}catch(t){throw this.linkTempAuthToken=null,t}},async verifyLinkOtp(t){let{code:e}=t;try{const t=await $u.verifyLinkOtp({code:e,transaction:this.id,token:this.linkTempAuthToken});return this.linkToken=t.data.token,t}catch(t){throw this.linkToken=null,t}},async getLinkPaymentInstruments(){return $u.getLinkPaymentInstruments({token:this.linkToken})}};class Ku{constructor(t){this.email=t.email,this.merchant={id:t.merchant_id,logo:t.merchant_logo,name:t.merchant_name,key:t.merchant_key,channelSettings:t.merchant_channel_settings||{}},this.status=t.transaction_status||t.status,this.accessCode=t.access_code,this.amount=t.amount,this.domain=t.domain,this.isTest="test"===t.domain,this.currency=t.currency,this.id=t.id,this.channels=t.channels,this.label=t.label,this.metadata=t.metadata||{},this.cancel_action=t.cancel_action||null,this.channel_options=t.channel_options||null,this.hash=t.hash||null,this.authorizations=t.authorizations,this.remember_card=!1,this.rememberMeEnabled=t.is_remember_me_enabled,this.card={},this.bankAccount={},this.mobileMoney={},this.ussd={},this.bankTransfer={},this.qr={},this.directDebit={},this.deviceFingerprint=t.deviceFingerprint||null,this.customer=t.customer,this.custom_filters=t.custom_filters||null,this.isCharging=!1,this.isListening=!1,this.transactionType=t.transaction_type||null,this.subscription=t.subscription||null,this.planDetails=t.plan_details||null,this.exchangeRate=t.exchange_rate||null,this.savedCardsConfig=t.saved_cards||{},this.savedCardsTempAuthToken=null,this.savedCardsToken=null,this.reference=t.reference,this.linkConfig=t.saved_cards||{},this.linkTempAuthToken=null,this.linkToken=null,Ji(),this.log=null,Object.assign(this,Hu),this.initializeLog(t.log),this.saveIpAddress(),this.channels.forEach((t=>{const e=ju.get(t);Object.assign(this,e)})),(this.channels.includes("card")||this.channels.includes("bank"))&&Object.assign(this,Gu),"GHS"===t.currency&&t.elevy_percentage&&(this.elevyPercentage=t.elevy_percentage)}setMetadata(t,e){this.metadata[t]=e}setDevice(t){this.deviceFingerprint?Fi("Device ID has already been set by Checkout JS so there's no need to set this again"):this.deviceFingerprint=t}listenForCharge(t,e){return Yi(t,this,e)}requery(){return uc.requery(this.id)}markAsAbandoned(){return uc.markAsAbandoned({publicKey:this.merchant.key,transactionId:this.id})}verifyStatus(){return uc.verifyStatus({reference:this.reference,publicKey:this.merchant.key}).then((t=>t&&t.data))}initializeCustomerSubscriptionAuthorization(t){return uc.initializeCustomerSubscriptionAuthorization(t,this.merchant.key).then((t=>t&&t.data))}}const Wu={validate(t){const e=function(t){const e=[];return t&&"object"==typeof t?(Object.keys(Ni).forEach((r=>{const n=Ni[r],i=t[r];!n.required||i||t[n.fallback]?i&&!n.isValid(i)&&e.push({field:r,message:`Invalid field: ${r}`}):e.push({field:r,message:`Required field: ${r}`})})),e):(e.push({message:"Please supply a valid object"}),e)}(t);if(e.length){const[{message:t}]=e;throw new Di(e,t)}},async request(t){const e=await zi(),r=await uc.requestInline({...t,device:e});return r&&Object.seal(new Ku({...r.data,deviceFingerprint:e}))},async requestWithAccessCode(t){const e=await zi(),r=await uc.requestStandard(t);return r&&Object.seal(new Ku({...r.data,deviceFingerprint:e}))},async getByAccessCode(t,e){const r=await zi(),n=await uc.getByAccessCode(t,e);return n&&Object.seal(new Ku({...n.data,deviceFingerprint:r}))},initialize:t=>Object.seal(new Ku(t)),async verify(t){const e=await uc.verify(t);return e&&e.data}},Xu={},Zu={fetchBanks(t){const e=new URL("/bank",Ki.paystackApiUrl).toString(),r=cc(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return sc.get(e,n).then((t=>t.data))},fetchResolutions(){const t=new URL("/checkout/resolutions",Ki.paystackApiUrl).toString(),e=cc(),r={...e&&{"Accept-Language":e}};return sc.get(t,{headers:r}).then((t=>t.data))},fetchCelebrations(){const t=new URL("/checkout/celebrations",Ki.paystackApiUrl).toString(),e=cc(),r={...e&&{"Accept-Language":e}};return sc.get(t,{headers:r}).then((t=>t.data))},fetchStates(t){const e=new URL("/address_verification/states",Ki.paystackApiUrl).toString(),r=cc(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return sc.get(e,n).then((t=>t.data))},resolveCardBin(t){const e=new URL(`/decision/bin/${t}`,Ki.paystackApiUrl).toString(),r=cc(),n={...r&&{"Accept-Language":r}};return Xu[t]?Promise.resolve(Xu[t]):sc.get(e,{headers:n}).then((e=>{let{data:r}=e;return Xu[t]=r,r}))},resolveIPAddress(t){const e=new URL(`decision/resolve_ip/${t}`,Ki.paystackApiUrl).toString(),r=cc(),n={...r&&{"Accept-Language":r}};return sc.get(e,{headers:n}).then((t=>{let{data:e}=t;return e}))}};class Ju{constructor(t){let{number:e,cvv:r,month:n,year:i,pin:a}=t;this.number=e,this.cvv=r,this.month=n,this.year=i,this.pin=a}getEncryptedPin(){return du.getEncryptedPin(this.pin)}getLast4(){return du.getLast4(this.number)}tokenize(){return du.tokenize({number:this.number,cvv:this.cvv,month:this.month,year:this.year})}static getType(t){return du.getType(t)}static validate(t){let{number:e,cvv:r,month:n,year:i}=t;return du.validate({number:e,cvv:r,month:n,year:i})}static validateNumber(t){return du.validateNumber(t)}static isNumberValid(t){return du.isNumberValid(t)}static validateCVV(t,e){return du.validateCVV(t,e)}static isCvvValid(t,e){return du.isCvvValid(t,e)}static validateExpiry(t){return du.validateExpiry(t)}static isExpiryValid(t){return du.isExpiryValid(t)}static generateTestCard(t){return new Ju(du.findTestCard(t))}}const Yu={reserveFunds(t){let{clientdata:e,last4:r,preauthorizationId:n,publicKey:i}=t;const a=new URL("preauthorization/create",Ki.paystackApiUrl).toString(),o=cc(),s={Authorization:`Bearer ${i}`,...o&&{"Accept-Language":o}};return sc.post(a,{clientdata:e,last4:r,preauthorization:n},{headers:s}).then((t=>Zi.parse(t.data)))}},Qu="card";function th(t,e){return new Promise(((r,n)=>{const i=Ju.validate(t);if(!i.isValid){const r=e||t.number,a=`Invalid card details: ${Object.keys(i.result).filter((t=>!1===i.result[t])).join(", ")}`;n(Error(r?a:"Please set a valid card with setCard()"))}r()}))}var eh={setCard(t){return th(t,!0).then((()=>{this.card=new Ju(t)}))},reserveFunds(t){let{preauthorizationId:e,publicKey:r,customFields:n={}}=t;return th(this.card).then((()=>{this.logAttempt(Qu);const t={clientdata:this.card.tokenize(),last4:this.card.getLast4(),device:this.deviceFingerprint,preauthorizationId:e,publicKey:r,customFields:n};return Yu.reserveFunds(t).then((t=>(this.logAPIResponse(t,Qu),t)))}))},listenFor3DSCharge(t){const e={channel:`3DS_${this.id}`,paymentMethod:Qu};return this.listenForCharge(e,t)}};const rh={getByAccessCode(t){const e=cc(),r={...e&&{"Accept-Language":e}},n=new URL(`preauthorization/verify_access_code/${t}`,Ki.paystackApiUrl).toString();return sc.get(n,{headers:r}).then((t=>t.data))},requery(t){let{reference:e,publicKey:r}=t;const n=cc(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}},a=new URL(`preauthorization/verify/${e}`,Ki.paystackApiUrl).toString();return sc.get(a,{headers:i}).then((t=>Zi.parse(t.data)))}},nh={saveLog(t,e,r){const n=new URL(`preauthorization/update_log/${t}`,Ki.paystackApiUrl).toString();return zu.saveLog(n,{merchantKey:e,log:r})},getIp:()=>zu.getIp(),saveIp(t,e){const r=new URL(`preauthorization/set_ip/${t}`,Ki.paystackApiUrl).toString();return zu.saveIp(r,{merchantKey:e})}};var ih={initializeLog(t){this.log=Fu.initializeLog(t)},getTimeSpent(){return this.log.time_spent=Fu.getTimeSpent(this.log.start_time),this.log.time_spent},logPageOpen(){return this.log.history.push({type:"open",message:"Opened checkout",time:this.getTimeSpent()}),this.saveLog()},logChannelSwitch(t){return this.log.history.push({type:"action",message:`Set charge method to: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logValidationErrors(t){return t.forEach((t=>{this.log.history.push({type:"error",message:`Invalid ${t}`,time:this.getTimeSpent()})})),this.saveLog()},logInput(t){const e=this.log.history.find((e=>e.message===`Filled this field: ${t}`));return this.log.history.push({type:"input",message:`${e?"Changed":"Filled"} this field: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logAuthWindowOpen(){return this.log.history.push({type:"action",message:"Third-party authentication window opened",time:this.getTimeSpent()}),this.saveLog()},logAuthWindowClose(){return this.log.history.push({type:"action",message:"Third-party authentication window closed",time:this.getTimeSpent()}),this.saveLog()},logAPIResponse(t,e){switch(console.log("api response",t),t.status){case"authorized":return this.logAuthorized(e);case"failed":return this.logError(t.message);case"auth":return this.logAuth(t.data.auth);default:return!1}},logAPIResponseMessage(t){return this.log.history.push({type:"action",message:t,time:this.getTimeSpent()}),this.saveLog()},logAttempt(t){let e="Attempted to charge";return t&&(e+=` with ${t}`),this.log.attempts+=1,this.log.history.push({type:"action",message:e,time:this.getTimeSpent()}),this.saveLog()},logAuth(t){return this.log.authentication=t,this.log.history.push({type:"auth",message:`Authentication Required: ${t}`,time:this.getTimeSpent()}),this.saveLog()},logAuthorized(t){let e="Successfully preauthorized funds";return t&&(e+=` with ${t}`),this.log.success=!0,this.log.history.push({type:"authorized",message:e,time:this.getTimeSpent()}),this.saveLog()},logPageClose(){return this.log.history.push({type:"close",message:"Closed checkout",time:this.getTimeSpent()}),this.saveLog()},logError(t){let e="Error";return t&&(e+=`: ${t}`),this.log.errors+=1,this.log.history.push({type:"error",message:e,time:this.getTimeSpent()}),this.saveLog()},saveLog(){return nh.saveLog(this.id,this.merchant.key,this.log)},saveIpAddress(){return nh.saveIp(this.id,this.merchant.key)}};class ah{constructor(t){this.id=t.id,this.email=t.email,this.status=t.status,this.reference=t.reference,this.amount=t.amount,this.currency=t.currency,this.metadata=t.metadata||{},this.customer=t.customer,this.channels=t.channels||["card"],this.isListening=!1,this.isTest="test"===t.domain,this.deviceFingerprint=t.deviceFingerprint||null,this.merchant={id:t.merchant_id,logo:t.merchant_logo,name:t.merchant_name,key:t.merchant_key},this.card={},Ji(),this.log=null,Object.assign(this,ih),this.initializeLog(t.log),this.saveIpAddress(),Object.assign(this,eh)}setMetadata(t,e){this.metadata[t]=e}requery(){return rh.requery({reference:this.reference,publicKey:this.merchant.key}).then((t=>(this.logAPIResponse(t,"card"),t)))}listenForCharge(t,e){return Yi(t,this,e)}}const oh={initialize:t=>Object.seal(new ah(t)),async getByAccessCode(t){const e=await zi(),r=await rh.getByAccessCode(t);return r&&Object.seal(new ah({...r.data,deviceFingerprint:e}))}};exports.BankAccount=Tu,exports.Card=pu,exports.Preauthorization=oh,exports.Toolkit=class{static contents(){return[{key:"banks",usage:"Returns a list of banks that can be used to complete checkout"},{key:"resolutions",usage:"Returns a list of known errors, mapped to their suggested resolutions"},{key:"celebrations",usage:"Returns a list of upcoming celebrations"},{key:"states",usage:"Returns a list of states for a particular country"}]}static fetch(t,e){if(this.contents().map((t=>t.key)).indexOf(t)<=-1)throw new Error("Please provide a valid config key. Use Toolkit.contents() to see available options.");let r;switch(t){case"banks":r=Zu.fetchBanks(e||{pay_with_bank:"1"});break;case"resolutions":r=Zu.fetchResolutions();break;case"celebrations":r=Zu.fetchCelebrations();break;case"states":r=Zu.fetchStates(e)}return r}static resolveCardBin(t){return Zu.resolveCardBin(t)}static resolveIPAddress(t){return Zu.resolveIPAddress(t)}},exports.Transaction=Wu;
|