@paystack/checkout-js 2.0.0-dev.3 → 2.0.0-dev.4
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 +13 -20
- package/lib/checkout.js +13 -20
- package/package.json +1 -1
package/dist/checkout.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var Paystack=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(t){return t&&t.Math==Math&&t},n=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")(),i={},a=function(t){try{return!!t()}catch(t){return!0}},o=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s=!a((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),c=s,u=Function.prototype.call,h=c?u.bind(u):function(){return u.apply(u,arguments)},l={},d={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,f=p&&!d.call({1:2},1);l.f=f?function(t){var e=p(this,t);return!!e&&e.enumerable}:d;var g,m,y=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v=s,b=Function.prototype,T=b.call,w=v&&b.bind.bind(T,T),S=v?w:function(t){return function(){return T.apply(t,arguments)}},A=S,E=A({}.toString),x=A("".slice),k=function(t){return x(E(t),8,-1)},C=k,B=S,O=function(t){if("Function"===C(t))return B(t)},D=a,P=k,R=Object,I=O("".split),N=D((function(){return!R("z").propertyIsEnumerable(0)}))?function(t){return"String"==P(t)?I(t,""):R(t)}:R,L=function(t){return null==t},M=L,_=TypeError,V=function(t){if(M(t))throw _("Can't call method on "+t);return t},j=N,U=V,F=function(t){return j(U(t))},q="object"==typeof document&&document.all,H={all:q,IS_HTMLDDA:void 0===q&&void 0!==q},$=H.all,z=H.IS_HTMLDDA?function(t){return"function"==typeof t||t===$}:function(t){return"function"==typeof t},G=z,K=H.all,W=H.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:G(t)||t===K}:function(t){return"object"==typeof t?null!==t:G(t)},X=n,Z=z,J=function(t){return Z(t)?t:void 0},Y=function(t,e){return arguments.length<2?J(X[t]):X[t]&&X[t][e]},Q=O({}.isPrototypeOf),tt=n,et=Y("navigator","userAgent")||"",rt=tt.process,nt=tt.Deno,it=rt&&rt.versions||nt&&nt.version,at=it&&it.v8;at&&(m=(g=at.split("."))[0]>0&&g[0]<4?1:+(g[0]+g[1])),!m&&et&&(!(g=et.match(/Edge\/(\d+)/))||g[1]>=74)&&(g=et.match(/Chrome\/(\d+)/))&&(m=+g[1]);var ot=m,st=a,ct=!!Object.getOwnPropertySymbols&&!st((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ot&&ot<41})),ut=ct&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ht=Y,lt=z,dt=Q,pt=Object,ft=ut?function(t){return"symbol"==typeof t}:function(t){var e=ht("Symbol");return lt(e)&&dt(e.prototype,pt(t))},gt=String,mt=z,yt=function(t){try{return gt(t)}catch(t){return"Object"}},vt=TypeError,bt=function(t){if(mt(t))return t;throw vt(yt(t)+" is not a function")},Tt=L,wt=h,St=z,At=W,Et=TypeError,xt={exports:{}},kt=n,Ct=Object.defineProperty,Bt=function(t,e){try{Ct(kt,t,{value:e,configurable:!0,writable:!0})}catch(r){kt[t]=e}return e},Ot=Bt,Dt="__core-js_shared__",Pt=n[Dt]||Ot(Dt,{}),Rt=Pt;(xt.exports=function(t,e){return Rt[t]||(Rt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var It=V,Nt=Object,Lt=function(t){return Nt(It(t))},Mt=O({}.hasOwnProperty),_t=Object.hasOwn||function(t,e){return Mt(Lt(t),e)},Vt=O,jt=0,Ut=Math.random(),Ft=Vt(1..toString),qt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Ft(++jt+Ut,36)},Ht=n,$t=xt.exports,zt=_t,Gt=qt,Kt=ct,Wt=ut,Xt=$t("wks"),Zt=Ht.Symbol,Jt=Zt&&Zt.for,Yt=Wt?Zt:Zt&&Zt.withoutSetter||Gt,Qt=function(t){if(!zt(Xt,t)||!Kt&&"string"!=typeof Xt[t]){var e="Symbol."+t;Kt&&zt(Zt,t)?Xt[t]=Zt[t]:Xt[t]=Wt&&Jt?Jt(e):Yt(e)}return Xt[t]},te=h,ee=W,re=ft,ne=function(t,e){var r=t[e];return Tt(r)?void 0:bt(r)},ie=function(t,e){var r,n;if("string"===e&&St(r=t.toString)&&!At(n=wt(r,t)))return n;if(St(r=t.valueOf)&&!At(n=wt(r,t)))return n;if("string"!==e&&St(r=t.toString)&&!At(n=wt(r,t)))return n;throw Et("Can't convert object to primitive value")},ae=TypeError,oe=Qt("toPrimitive"),se=function(t,e){if(!ee(t)||re(t))return t;var r,n=ne(t,oe);if(n){if(void 0===e&&(e="default"),r=te(n,t,e),!ee(r)||re(r))return r;throw ae("Can't convert object to primitive value")}return void 0===e&&(e="number"),ie(t,e)},ce=ft,ue=function(t){var e=se(t,"string");return ce(e)?e:e+""},he=W,le=n.document,de=he(le)&&he(le.createElement),pe=function(t){return de?le.createElement(t):{}},fe=!o&&!a((function(){return 7!=Object.defineProperty(pe("div"),"a",{get:function(){return 7}}).a})),ge=o,me=h,ye=l,ve=y,be=F,Te=ue,we=_t,Se=fe,Ae=Object.getOwnPropertyDescriptor;i.f=ge?Ae:function(t,e){if(t=be(t),e=Te(e),Se)try{return Ae(t,e)}catch(t){}if(we(t,e))return ve(!me(ye.f,t,e),t[e])};var Ee={},xe=o&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),ke=W,Ce=String,Be=TypeError,Oe=function(t){if(ke(t))return t;throw Be(Ce(t)+" is not an object")},De=o,Pe=fe,Re=xe,Ie=Oe,Ne=ue,Le=TypeError,Me=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,Ve="enumerable",je="configurable",Ue="writable";Ee.f=De?Re?function(t,e,r){if(Ie(t),e=Ne(e),Ie(r),"function"==typeof t&&"prototype"===e&&"value"in r&&Ue in r&&!r.writable){var n=_e(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:je in r?r.configurable:n.configurable,enumerable:Ve in r?r.enumerable:n.enumerable,writable:!1})}return Me(t,e,r)}:Me:function(t,e,r){if(Ie(t),e=Ne(e),Ie(r),Pe)try{return Me(t,e,r)}catch(t){}if("get"in r||"set"in r)throw Le("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Fe=Ee,qe=y,He=o?function(t,e,r){return Fe.f(t,e,qe(1,r))}:function(t,e,r){return t[e]=r,t},$e={exports:{}},ze=o,Ge=_t,Ke=Function.prototype,We=ze&&Object.getOwnPropertyDescriptor,Xe=Ge(Ke,"name"),Ze={EXISTS:Xe,PROPER:Xe&&"something"===function(){}.name,CONFIGURABLE:Xe&&(!ze||ze&&We(Ke,"name").configurable)},Je=z,Ye=Pt,Qe=O(Function.toString);Je(Ye.inspectSource)||(Ye.inspectSource=function(t){return Qe(t)});var tr,er,rr,nr=Ye.inspectSource,ir=z,ar=n.WeakMap,or=ir(ar)&&/native code/.test(String(ar)),sr=xt.exports,cr=qt,ur=sr("keys"),hr={},lr=or,dr=n,pr=W,fr=He,gr=_t,mr=Pt,yr=function(t){return ur[t]||(ur[t]=cr(t))},vr=hr,br="Object already initialized",Tr=dr.TypeError,wr=dr.WeakMap;if(lr||mr.state){var Sr=mr.state||(mr.state=new wr);Sr.get=Sr.get,Sr.has=Sr.has,Sr.set=Sr.set,tr=function(t,e){if(Sr.has(t))throw Tr(br);return e.facade=t,Sr.set(t,e),e},er=function(t){return Sr.get(t)||{}},rr=function(t){return Sr.has(t)}}else{var Ar=yr("state");vr[Ar]=!0,tr=function(t,e){if(gr(t,Ar))throw Tr(br);return e.facade=t,fr(t,Ar,e),e},er=function(t){return gr(t,Ar)?t[Ar]:{}},rr=function(t){return gr(t,Ar)}}var Er={set:tr,get:er,has:rr,enforce:function(t){return rr(t)?er(t):tr(t,{})},getterFor:function(t){return function(e){var r;if(!pr(e)||(r=er(e)).type!==t)throw Tr("Incompatible receiver, "+t+" required");return r}}},xr=a,kr=z,Cr=_t,Br=o,Or=Ze.CONFIGURABLE,Dr=nr,Pr=Er.enforce,Rr=Er.get,Ir=Object.defineProperty,Nr=Br&&!xr((function(){return 8!==Ir((function(){}),"length",{value:8}).length})),Lr=String(String).split("String"),Mr=$e.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Cr(t,"name")||Or&&t.name!==e)&&(Br?Ir(t,"name",{value:e,configurable:!0}):t.name=e),Nr&&r&&Cr(r,"arity")&&t.length!==r.arity&&Ir(t,"length",{value:r.arity});try{r&&Cr(r,"constructor")&&r.constructor?Br&&Ir(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Pr(t);return Cr(n,"source")||(n.source=Lr.join("string"==typeof e?e:"")),t};Function.prototype.toString=Mr((function(){return kr(this)&&Rr(this).source||Dr(this)}),"toString");var _r=z,Vr=Ee,jr=$e.exports,Ur=Bt,Fr={},qr=Math.ceil,Hr=Math.floor,$r=Math.trunc||function(t){var e=+t;return(e>0?Hr:qr)(e)},zr=function(t){var e=+t;return e!=e||0===e?0:$r(e)},Gr=zr,Kr=Math.max,Wr=Math.min,Xr=zr,Zr=Math.min,Jr=function(t){return t>0?Zr(Xr(t),9007199254740991):0},Yr=F,Qr=function(t,e){var r=Gr(t);return r<0?Kr(r+e,0):Wr(r,e)},tn=function(t){return Jr(t.length)},en=function(t){return function(e,r,n){var i,a=Yr(e),o=tn(a),s=Qr(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}},rn={includes:en(!0),indexOf:en(!1)},nn=_t,an=F,on=rn.indexOf,sn=hr,cn=O([].push),un=function(t,e){var r,n=an(t),i=0,a=[];for(r in n)!nn(sn,r)&&nn(n,r)&&cn(a,r);for(;e.length>i;)nn(n,r=e[i++])&&(~on(a,r)||cn(a,r));return a},hn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Fr.f=Object.getOwnPropertyNames||function(t){return un(t,hn)};var ln={};ln.f=Object.getOwnPropertySymbols;var dn=Y,pn=Fr,fn=ln,gn=Oe,mn=O([].concat),yn=dn("Reflect","ownKeys")||function(t){var e=pn.f(gn(t)),r=fn.f;return r?mn(e,r(t)):e},vn=_t,bn=yn,Tn=i,wn=Ee,Sn=function(t,e,r){for(var n=bn(e),i=wn.f,a=Tn.f,o=0;o<n.length;o++){var s=n[o];vn(t,s)||r&&vn(r,s)||i(t,s,a(e,s))}},An=a,En=z,xn=/#|\.prototype\./,kn=function(t,e){var r=Bn[Cn(t)];return r==Dn||r!=On&&(En(e)?An(e):!!e)},Cn=kn.normalize=function(t){return String(t).replace(xn,".").toLowerCase()},Bn=kn.data={},On=kn.NATIVE="N",Dn=kn.POLYFILL="P",Pn=kn,Rn=n,In=i.f,Nn=He,Ln=function(t,e,r,n){n||(n={});var i=n.enumerable,a=void 0!==n.name?n.name:e;if(_r(r)&&jr(r,a,n),n.global)i?t[e]=r:Ur(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=r:Vr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Mn=Bt,_n=Sn,Vn=Pn,jn=s,Un=Function.prototype,Fn=Un.apply,qn=Un.call,Hn="object"==typeof Reflect&&Reflect.apply||(jn?qn.bind(Fn):function(){return qn.apply(Fn,arguments)}),$n=z,zn=String,Gn=TypeError,Kn=O,Wn=Oe,Xn=function(t){if("object"==typeof t||$n(t))return t;throw Gn("Can't set "+zn(t)+" as a prototype")},Zn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Kn(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Wn(r),Xn(n),e?t(r,n):r.__proto__=n,r}}():void 0),Jn=Ee.f,Yn=z,Qn=W,ti=Zn,ei={};ei[Qt("toStringTag")]="z";var ri="[object z]"===String(ei),ni=z,ii=k,ai=Qt("toStringTag"),oi=Object,si="Arguments"==ii(function(){return arguments}()),ci=ri?ii: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=oi(t),ai))?r:si?ii(e):"Object"==(n=ii(e))&&ni(e.callee)?"Arguments":n},ui=String,hi=function(t){if("Symbol"===ci(t))throw TypeError("Cannot convert a Symbol value to a string");return ui(t)},li=W,di=He,pi=Error,fi=O("".replace),gi=String(pi("zxcasd").stack),mi=/\n\s*at [^:]*:[^\n]*/,yi=mi.test(gi),vi=y,bi=!a((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",vi(1,7)),7!==t.stack)})),Ti=Y,wi=_t,Si=He,Ai=Q,Ei=Zn,xi=Sn,ki=function(t,e,r){r in t||Jn(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})},Ci=function(t,e,r){var n,i;return ti&&Yn(n=e.constructor)&&n!==r&&Qn(i=n.prototype)&&i!==r.prototype&&ti(t,i),t},Bi=function(t,e){return void 0===t?arguments.length<2?"":e:hi(t)},Oi=function(t,e){li(e)&&"cause"in e&&di(t,"cause",e.cause)},Di=function(t,e){if(yi&&"string"==typeof t&&!pi.prepareStackTrace)for(;e--;)t=fi(t,mi,"");return t},Pi=bi,Ri=o,Ii=function(t,e){var r,n,i,a,o,s=t.target,c=t.global,u=t.stat;if(r=c?Rn:u?Rn[s]||Mn(s,{}):(Rn[s]||{}).prototype)for(n in e){if(a=e[n],i=t.dontCallGetSet?(o=In(r,n))&&o.value:r[n],!Vn(c?n:s+(u?".":"#")+n,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;_n(a,i)}(t.sham||i&&i.sham)&&Nn(a,"sham",!0),Ln(r,n,a,t)}},Ni=Hn,Li=function(t,e,r,n){var i="stackTraceLimit",a=n?2:1,o=t.split("."),s=o[o.length-1],c=Ti.apply(null,o);if(c){var u=c.prototype;if(wi(u,"cause")&&delete u.cause,!r)return c;var h=Ti("Error"),l=e((function(t,e){var r=Bi(n?e:t,void 0),i=n?new c(t):new c;return void 0!==r&&Si(i,"message",r),Pi&&Si(i,"stack",Di(i.stack,2)),this&&Ai(u,this)&&Ci(i,this,l),arguments.length>a&&Oi(i,arguments[a]),i}));l.prototype=u,"Error"!==s?Ei?Ei(l,h):xi(l,h,{name:!0}):Ri&&i in c&&(ki(l,c,i),ki(l,c,"prepareStackTrace")),xi(l,c);try{u.name!==s&&Si(u,"name",s),u.constructor=l}catch(t){}return l}},Mi="WebAssembly",_i=n.WebAssembly,Vi=7!==Error("e",{cause:7}).cause,ji=function(t,e){var r={};r[t]=Li(t,e,Vi),Ii({global:!0,constructor:!0,arity:1,forced:Vi},r)},Ui=function(t,e){if(_i&&_i[t]){var r={};r[t]=Li("WebAssembly."+t,e,Vi),Ii({target:Mi,stat:!0,constructor:!0,arity:1,forced:Vi},r)}};ji("Error",(function(t){return function(e){return Ni(t,this,arguments)}})),ji("EvalError",(function(t){return function(e){return Ni(t,this,arguments)}})),ji("RangeError",(function(t){return function(e){return Ni(t,this,arguments)}})),ji("ReferenceError",(function(t){return function(e){return Ni(t,this,arguments)}})),ji("SyntaxError",(function(t){return function(e){return Ni(t,this,arguments)}})),ji("TypeError",(function(t){return function(e){return Ni(t,this,arguments)}})),ji("URIError",(function(t){return function(e){return Ni(t,this,arguments)}})),Ui("CompileError",(function(t){return function(e){return Ni(t,this,arguments)}})),Ui("LinkError",(function(t){return function(e){return Ni(t,this,arguments)}})),Ui("RuntimeError",(function(t){return function(e){return Ni(t,this,arguments)}}));class Fi 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,Fi),this.errors=t}}function qi(t){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)}function Hi(t){return parseInt(t,10)===Number(t)&&Number(t)>=0}function $i(t){return t&&"string"==typeof t}const zi={ref:{required:!1,isValid:$i},key:{required:!0,isValid:function(t){return t&&"pk"===t.substring(0,2)}},email:{required:!0,fallback:"customer_code",isValid:qi},customer_code:{required:!1,isValid:$i},amount:{required:!0,fallback:"plan",isValid:Hi},plan:{required:!1,isValid:$i},transaction_charge:{required:!1,isValid:Hi},bearer:{required:!1,isValid:$i},channels:{required:!1,isValid:function(t){return t instanceof Array}},currency:{required:!1,isValid:$i},firstname:{required:!1,isValid:$i},lastname:{required:!1,isValid:$i},phone:{required:!1,isValid:$i},remark:{required:!1,isValid:$i},payment_page:{required:!1,isValid:Hi},payment_request:{required:!1,isValid:$i},quantity:{required:!1,isValid:$i},coupon:{required:!1,isValid:$i},start_date:{required:!1,isValid:$i},interval:{required:!1,isValid:$i},invoice_limit:{required:!1,isValid:Hi},subaccount:{required:!1,isValid:$i},split_code:{required:!1,isValid:$i},hash:{required:!1,isValid:$i},metadata:{required:!1,isValid:$i},transaction_type:{required:!1,isValid:$i},subscription:{required:!1,isValid:Hi}};var Gi,Ki,Wi,Xi={exports:{}};Ki=e,Wi=function(){void 0===Array.isArray&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});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,adBlock:!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){if(L())return t.EXCLUDED;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},w=function(t){return navigator.platform?navigator.platform:t.NOT_AVAILABLE},S=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},x=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=j()))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)}))}))}))})),U(t),r):(U(t),r)},k=function(){try{var t=j(),e=t.getExtension("WEBGL_debug_renderer_info"),r=t.getParameter(e.UNMASKED_VENDOR_WEBGL)+"~"+t.getParameter(e.UNMASKED_RENDERER_WEBGL);return U(t),r}catch(t){return null}},C=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},O=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("windows")>=0||e.indexOf("win16")>=0||e.indexOf("win32")>=0||e.indexOf("win64")>=0||e.indexOf("win95")>=0||e.indexOf("win98")>=0||e.indexOf("winnt")>=0||e.indexOf("wow64")>=0?"Windows":e.indexOf("android")>=0?"Android":e.indexOf("linux")>=0||e.indexOf("cros")>=0||e.indexOf("x11")>=0?"Linux":e.indexOf("iphone")>=0||e.indexOf("ipad")>=0||e.indexOf("ipod")>=0||e.indexOf("crios")>=0||e.indexOf("fxios")>=0?"iOS":e.indexOf("macintosh")>=0||e.indexOf("mac_powerpc)")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows"!==t&&"Windows Phone"!==t&&"Android"!==t&&"iOS"!==t&&"Other"!==t&&-1===e.indexOf("cros"))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||!(n.indexOf("arm")>=0&&"Windows Phone"===t)&&!(n.indexOf("pike")>=0&&e.indexOf("opera mini")>=0)&&((n.indexOf("win")<0&&n.indexOf("linux")<0&&n.indexOf("mac")<0&&n.indexOf("iphone")<0&&n.indexOf("ipad")<0&&n.indexOf("ipod")<0)!=("Other"===t)||void 0===navigator.plugins&&"Windows"!==t&&"Windows Phone"!==t)},P=function(){var t,e=navigator.userAgent.toLowerCase(),r=navigator.productSub;if(e.indexOf("edge/")>=0||e.indexOf("iemobile/")>=0)return!1;if(e.indexOf("opera mini")>=0)return!1;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?e.indexOf("android 1.")>=0||e.indexOf("android 2.")>=0||e.indexOf("android 3.")>=0||e.indexOf("android 4.")>=0?"AOSP":"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&&"AOSP"!==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=j(),e=!!window.WebGLRenderingContext&&!!t;return U(t),e},N=function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},L=function(){return("msWriteProfilerMark"in window)+("msLaunchUri"in navigator)+("msSaveBlob"in navigator)>=2},M=function(){return void 0!==window.swfobject},_=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"},{})},j=function(){var t=document.createElement("canvas"),e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return e||(e=null),e},U=function(t){var e=t.getExtension("WEBGL_lose_context");null!=e&&e.loseContext()},F=[{key:"userAgent",getData:function(t){t(navigator.userAgent)}},{key:"webdriver",getData:function(t,e){t(null==navigator.webdriver?e.NOT_AVAILABLE:navigator.webdriver)}},{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||e.NOT_AVAILABLE):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(!!window.HTMLElement.prototype.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(w(e))}},{key:"doNotTrack",getData:function(t,e){t(S(e))}},{key:"plugins",getData:function(t,e){N()?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(x()):t(e.NOT_AVAILABLE)}},{key:"webglVendorAndRenderer",getData:function(t){I()?t(k()):t()}},{key:"adBlock",getData:function(t){t(C())}},{key:"hasLiedLanguages",getData:function(t){t(B())}},{key:"hasLiedResolution",getData:function(t){t(O())}},{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 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/fingerprintjs/fingerprintjs 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)}))}}],q=function(t){throw new Error("'new Fingerprint()' is deprecated, see https://github.com/fingerprintjs/fingerprintjs#upgrade-guide-from-182-to-200")};return q.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(F);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)},q.getPromise=function(t){return new Promise((function(e,r){q.get(t,e)}))},q.getV18=function(t,e){return null==e&&(e=t,t={}),q.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)&&Array.isArray(a.value))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)}))},q.x64hash128=o,q.VERSION="2.1.4",q},(Gi=Xi).exports?Gi.exports=Wi():Ki.exports?Ki.exports=Wi():Ki.Fingerprint2=Wi();var Zi=Xi.exports;const Ji=t=>{(console?console.log:()=>{})(t)},Yi=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 Zi.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 Zi.x64hash128(r,n)}Ji("Device ID could not be calculated")}catch(t){Ji(t)}return null})())}catch(t){Ji("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-----"},ta={...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"},ea={...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"},ra={...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"},na={dev:ta,staging:ea,production:ra}[(window||process.env).paystackEnvironment]||ra;const ia=()=>{};var aa={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}},transferCreditRequest(t){const{message:e,status:r,errors:n,...i}=t;return{status:r,message:e||"Transfer credit request",data:i}},incorrectAmountSent(t){const{message:e,status:r,errors:n,...i}=t;return{status:r,message:e||"Incorrect amount sent",data:i}},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):"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.transferCreditRequest(e):"incorrect-amount-sent"===e.status?this.incorrectAmountSent(e):e.auth&&"none"!==e.auth?this.auth(e):this.error(e)}},oa={exports:{}},sa=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)}},ca=sa,ua=Object.prototype.toString;function ha(t){return"[object Array]"===ua.call(t)}function la(t){return void 0===t}function da(t){return null!==t&&"object"==typeof t}function pa(t){if("[object Object]"!==ua.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function fa(t){return"[object Function]"===ua.call(t)}function ga(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),ha(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 ma={isArray:ha,isArrayBuffer:function(t){return"[object ArrayBuffer]"===ua.call(t)},isBuffer:function(t){return null!==t&&!la(t)&&null!==t.constructor&&!la(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:da,isPlainObject:pa,isUndefined:la,isDate:function(t){return"[object Date]"===ua.call(t)},isFile:function(t){return"[object File]"===ua.call(t)},isBlob:function(t){return"[object Blob]"===ua.call(t)},isFunction:fa,isStream:function(t){return da(t)&&fa(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:ga,merge:function t(){var e={};function r(r,n){pa(e[n])&&pa(r)?e[n]=t(e[n],r):pa(r)?e[n]=t({},r):ha(r)?e[n]=r.slice():e[n]=r}for(var n=0,i=arguments.length;n<i;n++)ga(arguments[n],r);return e},extend:function(t,e,r){return ga(e,(function(e,n){t[n]=r&&"function"==typeof e?ca(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}},ya=ma;function va(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ba=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(ya.isURLSearchParams(e))n=e.toString();else{var i=[];ya.forEach(e,(function(t,e){null!=t&&(ya.isArray(t)?e+="[]":t=[t],ya.forEach(t,(function(t){ya.isDate(t)?t=t.toISOString():ya.isObject(t)&&(t=JSON.stringify(t)),i.push(va(e)+"="+va(t))})))})),n=i.join("&")}if(n){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},Ta=ma;function wa(){this.handlers=[]}wa.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},wa.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},wa.prototype.forEach=function(t){Ta.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var Sa=wa,Aa=ma,Ea=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},xa=Ea,ka=function(t,e,r,n,i){var a=new Error(t);return xa(a,e,r,n,i)},Ca=ka,Ba=ma,Oa=Ba.isStandardBrowserEnv()?{write:function(t,e,r,n,i,a){var o=[];o.push(t+"="+encodeURIComponent(e)),Ba.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Ba.isString(n)&&o.push("path="+n),Ba.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(){}},Da=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Pa=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Ra=ma,Ia=["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"],Na=ma,La=Na.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=Na.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0},Ma=ma,_a=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Ca("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},Va=Oa,ja=ba,Ua=function(t,e){return t&&!Da(e)?Pa(t,e):e},Fa=function(t){var e,r,n,i={};return t?(Ra.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Ra.trim(t.substr(0,n)).toLowerCase(),r=Ra.trim(t.substr(n+1)),e){if(i[e]&&Ia.indexOf(e)>=0)return;i[e]="set-cookie"===e?(i[e]?i[e]:[]).concat([r]):i[e]?i[e]+", "+r:r}})),i):i},qa=La,Ha=ka,$a=function(t){return new Promise((function(e,r){var n=t.data,i=t.headers,a=t.responseType;Ma.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=Ua(t.baseURL,t.url);function h(){if(o){var n="getAllResponseHeaders"in o?Fa(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};_a(e,r,i),o=null}}if(o.open(t.method.toUpperCase(),ja(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(Ha("Request aborted",t,"ECONNABORTED",o)),o=null)},o.onerror=function(){r(Ha("Network Error",t,null,o)),o=null},o.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(Ha(e,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Ma.isStandardBrowserEnv()){var l=(t.withCredentials||qa(u))&&t.xsrfCookieName?Va.read(t.xsrfCookieName):void 0;l&&(i[t.xsrfHeaderName]=l)}"setRequestHeader"in o&&Ma.forEach(i,(function(t,e){void 0===n&&"content-type"===e.toLowerCase()?delete i[e]:o.setRequestHeader(e,t)})),Ma.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)}))},za=ma,Ga=function(t,e){Aa.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},Ka=Ea,Wa={"Content-Type":"application/x-www-form-urlencoded"};function Xa(t,e){!za.isUndefined(t)&&za.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var Za,Ja={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Za=$a),Za),transformRequest:[function(t,e){return Ga(e,"Accept"),Ga(e,"Content-Type"),za.isFormData(t)||za.isArrayBuffer(t)||za.isBuffer(t)||za.isStream(t)||za.isFile(t)||za.isBlob(t)?t:za.isArrayBufferView(t)?t.buffer:za.isURLSearchParams(t)?(Xa(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):za.isObject(t)||e&&"application/json"===e["Content-Type"]?(Xa(e,"application/json"),function(t,e,r){if(za.isString(t))try{return(e||JSON.parse)(t),za.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&&za.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw Ka(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}};Ja.headers={common:{Accept:"application/json, text/plain, */*"}},za.forEach(["delete","get","head"],(function(t){Ja.headers[t]={}})),za.forEach(["post","put","patch"],(function(t){Ja.headers[t]=za.merge(Wa)}));var Ya=Ja,Qa=ma,to=Ya,eo=function(t){return!(!t||!t.__CANCEL__)},ro=ma,no=function(t,e,r){var n=this||to;return Qa.forEach(r,(function(r){t=r.call(n,t,e)})),t},io=eo,ao=Ya;function oo(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var so=ma,co=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 so.isPlainObject(t)&&so.isPlainObject(e)?so.merge(t,e):so.isPlainObject(e)?so.merge({},e):so.isArray(e)?e.slice():e}function c(n){so.isUndefined(e[n])?so.isUndefined(t[n])||(r[n]=s(void 0,t[n])):r[n]=s(t[n],e[n])}so.forEach(n,(function(t){so.isUndefined(e[t])||(r[t]=s(void 0,e[t]))})),so.forEach(i,c),so.forEach(a,(function(n){so.isUndefined(e[n])?so.isUndefined(t[n])||(r[n]=s(void 0,t[n])):r[n]=s(void 0,e[n])})),so.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 so.forEach(h,c),r},uo={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"},ho={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){ho[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var lo={},po=uo.version.split(".");function fo(t,e){for(var r=e?e.split("."):po,n=t.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}ho.transitional=function(t,e,r){var n=e&&fo(e);function i(t,e){return"[Axios v"+uo.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&&!lo[a]&&(lo[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 go={isOlderVersion:fo,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:ho},mo=ma,yo=ba,vo=Sa,bo=function(t){return oo(t),t.headers=t.headers||{},t.data=no.call(t,t.data,t.headers,t.transformRequest),t.headers=ro.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),ro.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||ao.adapter)(t).then((function(e){return oo(t),e.data=no.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return io(e)||(oo(t),e&&e.response&&(e.response.data=no.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},To=co,wo=go,So=wo.validators;function Ao(t){this.defaults=t,this.interceptors={request:new vo,response:new vo}}Ao.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=To(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&&wo.assertOptions(e,{silentJSONParsing:So.transitional(So.boolean,"1.0.0"),forcedJSONParsing:So.transitional(So.boolean,"1.0.0"),clarifyTimeoutError:So.transitional(So.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=[bo,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=bo(s)}catch(t){return Promise.reject(t)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},Ao.prototype.getUri=function(t){return t=To(this.defaults,t),yo(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},mo.forEach(["delete","get","head","options"],(function(t){Ao.prototype[t]=function(e,r){return this.request(To(r||{},{method:t,url:e,data:(r||{}).data}))}})),mo.forEach(["post","put","patch"],(function(t){Ao.prototype[t]=function(e,r,n){return this.request(To(n||{},{method:t,url:e,data:r}))}}));var Eo=Ao;function xo(t){this.message=t}xo.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},xo.prototype.__CANCEL__=!0;var ko=xo,Co=ko;function Bo(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 Co(t),e(r.reason))}))}Bo.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Bo.source=function(){var t;return{token:new Bo((function(e){t=e})),cancel:t}};var Oo=Bo,Do=ma,Po=sa,Ro=Eo,Io=co;function No(t){var e=new Ro(t),r=Po(Ro.prototype.request,e);return Do.extend(r,Ro.prototype,e),Do.extend(r,e),r}var Lo=No(Ya);Lo.Axios=Ro,Lo.create=function(t){return No(Io(Lo.defaults,t))},Lo.Cancel=ko,Lo.CancelToken=Oo,Lo.isCancel=eo,Lo.all=function(t){return Promise.all(t)},Lo.spread=function(t){return function(e){return t.apply(null,e)}},Lo.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},oa.exports=Lo,oa.exports.default=Lo;var Mo=oa.exports;const _o=Mo.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 function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(t).reduce(((t,e)=>{const[r,n]=e;return[...t,`${r}=${n}`]}),[]).join("&")}(e)}}),Vo=()=>{try{return window?window.localStorage&&window.localStorage.getItem("i18nextLng")||navigator&&navigator.language:null}catch(t){return null}},jo={requestInline(t){const e=Vo(),r={...e&&{"Accept-Language":e}},n=new URL("/checkout/request_inline",na.paystackApiUrl).toString();return _o.post(n,t,{headers:r}).then((t=>t.data))},requestStandard(t){const e=Vo(),r={...e&&{"Accept-Language":e}},n=`${na.paystackApiUrl}transaction/verify_access_code/${t}`;return _o.get(n,{headers:r}).then((t=>t.data))},getByAccessCode(t,e){const r=Vo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL(`/transaction/get_by_access_code/${t}`,na.paystackApiUrl).toString();return _o.get(i,{headers:n}).then((t=>t.data))},verify(t){const e=Vo(),r={...e&&{"Accept-Language":e}},n=`${na.paystackApiUrl}transaction/verify/${t}`;return _o.get(n,{headers:r}).then((t=>t.data))},requery(t){const e=Vo(),r={...e&&{"Accept-Language":e}},n=`${na.paymentBaseUrl}charge/requery/${t}`;return _o.get(n,{headers:r}).then((t=>aa.parse(t.data)))},markAsAbandoned(t){let{publicKey:e,transactionId:r}=t;const n=`${na.paystackApiUrl}transaction/${r}/mark-as-abandoned`,i=Vo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return _o.patch(n,{},{headers:a}).then((t=>t.data))}},Uo={generateManagedAccount(t,e){const r=Vo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return _o.post(`${na.paystackApiUrl}checkout/pay_with_transfer`,t,{headers:n}).then((t=>aa.parse(t.data)))},submitPayerDetails(t,e){const r={Authorization:`Bearer ${e}`};return _o.post(`${na.paystackApiUrl}managed_account/customer_claim`,t,{headers:r}).then((t=>aa.parse(t.data)))}};var Fo={getManagedAccount(t){let{fulfilLateNotification:e}=t;const r={transaction_id:this.id,fulfil_late_notification:e};return Uo.generateManagedAccount(r,this.merchant.key).then((t=>("success"===t.status&&(this.bankTransfer=t),t)))},submitPayerDetails(t){let{email:e,accountNumber:r,bankId:n,managedAccountNumber:i,providerSlug:a,claimType:o}=t;const s={reference_id:this.id,account_number:r,email:e,institution_id:n,institution_type:"bank",claim_type:o,managed_account_number:i,provider_slug:a};return Uo.submitPayerDetails(s,this.merchant.key)},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)}},qo="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},Ho=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":qo(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 $o={charge(t){let{transactionId:e,phoneNumber:r}=t;const n=`${na.paymentBaseUrl}payattitude/charge/${e}`,i=Vo(),a={"Content-Type":"application/x-www-form-urlencoded",...i&&{"Accept-Language":i}},o=Ho({phone_number:r});return _o.post(n,o,{headers:a}).then((t=>{let{data:e}=t;return aa.parse(e)}))}},zo="payattitude";var Go={chargePayattitude(t){let{phoneNumber:e}=t;const r={transactionId:this.id,phoneNumber:e};return $o.charge(r).then((t=>(this.logAPIResponse(t,zo),t)))},listenForPayattitudeCharge(t){const e={paymentMethod:zo,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}};const Ko={getEFTUrl(t){let{eftGateway:e}=t;return new Promise(((t,r)=>{e||r(Error("Please pass the `eftGateway`"));const n=`${na.paymentBaseUrl}eft/${e}/${this.id}`;t(aa.success({url:n}))}))},listenForEFTCharge(t){const e={channel:`EFT_${this.id}`,paymentMethod:"eft"};return this.listenForCharge(e,t)}},Wo={validateApplePaySession(t){let{sessionUrl:e,displayName:r,transactionId:n,domainName:i}=t;const a=Vo(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s=`${na.paymentBaseUrl}applepay/validate-session`,c=Ho({sessionUrl:e,displayName:r,domainName:i,transaction:n});return _o.post(s,c,{headers:o}).then((t=>aa.parse(t.data)))},charge(t){let{transactionId:e,paymentObject:r}=t;const n=Vo(),i={"Content-Type":"application/x-www-form-urlencoded",...n&&{"Accept-Language":n}},a=`${na.paymentBaseUrl}applepay/charge`,o=Ho({paymentObject:r,transaction:e});return _o.post(a,o,{headers:i}).then((t=>aa.parse(t.data)))}},Xo="apple pay";var Zo={validateApplePaySession(t){let{sessionUrl:e,displayName:r,domainName:n}=t;return this.logAttempt(Xo),Wo.validateApplePaySession({sessionUrl:e,displayName:r,domainName:n,transactionId:this.id}).then((t=>(this.logAPIResponseMessage(t.message),t)))},chargeApplePay(t){let{paymentObject:e}=t;return Wo.charge({transactionId:this.id,device:this.deviceFingerprint,paymentObject:e}).then((t=>(this.logAPIResponse(t,Xo),t)))}};const Jo={createOrder(t){const e=`${na.paymentBaseUrl}paypal/${t}/create`,r=Vo(),n={...r&&{"Accept-Language":r}};return _o.post(e,{headers:n}).then((t=>aa.parse(t.data)))},captureOrder(t){const e=`${na.paymentBaseUrl}paypal/${t}/capture`,r=Vo(),n={...r&&{"Accept-Language":r}};return _o.post(e,{headers:n}).then((t=>aa.parse(t.data)))},getConfig(t){let{publicKey:e,transactionId:r}=t;const n=`${na.paystackApiUrl}paypal/config?transaction=${r}`,i=Vo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return _o.get(n,{headers:a}).then((t=>t.data))}},Yo="paypal";var Qo={createPayPalOrder(){return this.logAttempt(Yo),Jo.createOrder(this.id).then((t=>(this.logAPIResponseMessage(t.message),t)))},capturePayPalOrder(){return Jo.captureOrder(this.id).then((t=>(this.logAPIResponse(t,Yo),t)))},getPayPalConfig(){return Jo.getConfig({publicKey:this.merchant.key,transactionId:this.id})}};function ts(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function es(t,e){return t&e}function rs(t,e){return t|e}function ns(t,e){return t^e}function is(t,e){return t&~e}function as(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function os(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var ss,cs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function us(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=cs.charAt(r>>6)+cs.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=cs.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=cs.charAt(r>>2)+cs.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function hs(t){var e,r="",n=0,i=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e){var a=cs.indexOf(t.charAt(e));a<0||(0==n?(r+=ts(a>>2),i=3&a,n=1):1==n?(r+=ts(i<<2|a>>4),i=15&a,n=2):2==n?(r+=ts(i),r+=ts(a>>2),i=3&a,n=3):(r+=ts(i<<2|a>>4),r+=ts(15&a),n=0))}return 1==n&&(r+=ts(i<<2)),r}var ls,ds=function(t){var e;if(void 0===ss){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(ss={},e=0;e<16;++e)ss[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)ss[r.charAt(e)]=e;for(e=0;e<n.length;++e)ss[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=ss[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},ps={decode:function(t){var e;if(void 0===ls){var r="= \f\n\r\t \u2028\u2029";for(ls=Object.create(null),e=0;e<64;++e)ls["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(ls["-"]=62,ls._=63,e=0;e<r.length;++e)ls[r.charAt(e)]=-1}var n=[],i=0,a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;if(-1!=(o=ls[o])){if(void 0===o)throw new Error("Illegal character at offset "+e);i|=o,++a>=4?(n[n.length]=i>>16,n[n.length]=i>>8&255,n[n.length]=255&i,i=0,a=0):i<<=6}}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=i>>10;break;case 3:n[n.length]=i>>16,n[n.length]=i>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=ps.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 ps.decode(t)}},fs=1e13,gs=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)<fs?e=0:n-=(e=0|n/fs)*fs,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+=fs,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+=(fs+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*fs+t[r];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),ms=/^(\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)?)?$/,ys=/^(\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 vs(t,e){return t.length>e&&(t=t.substring(0,e)+"…"),t}var bs,Ts=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 ".concat(t," on a stream of length ").concat(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?ms:ys).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;0==(128&(+o^a));)o=+o<<1,--r;o="("+r+" bit)\n"}i&&(n-=256);for(var s=new gs(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+vs(a,r)}return i+a},t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return vs(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+="…"),i},t.prototype.parseOID=function(t,e,r){for(var n="",i=new gs,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 gs)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 vs(n,r);i=new gs,a=0}}return a>0&&(n+=".incomplete"),n},t}(),ws=function(){function t(t,e,r,n,i){if(!(n instanceof Ss))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 vs(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return vs(this.stream.parseStringISO(e,e+r),t);case 30:return vs(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 Ts?e:new Ts(e,0);var n=new Ts(r),i=new Ss(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}(),Ss=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new gs;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}(),As=[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],Es=(1<<26)/As[As.length-1],xs=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 r,n=(1<<e)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%e;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=ts(r));o>=0;)s<e?(r=(this[o]&(1<<s)-1)<<e-s,r|=this[--o]>>(s+=this.DB-e)):(r=this[o]>>(s-=e)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=ts(r));return i?a:"0"},t.prototype.negate=function(){var e=Ds();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)+Vs(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var r=Ds();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 Cs(e):new Bs(e),this.exp(t,r)},t.prototype.clone=function(){var t=Ds();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)),0!=(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=Ds();return this.bitwiseTo(t,es,e),e},t.prototype.or=function(t){var e=Ds();return this.bitwiseTo(t,rs,e),e},t.prototype.xor=function(t){var e=Ds();return this.bitwiseTo(t,ns,e),e},t.prototype.andNot=function(t){var e=Ds();return this.bitwiseTo(t,is,e),e},t.prototype.not=function(){for(var t=Ds(),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=Ds();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=Ds();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+as(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+=os(this[r]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,rs)},t.prototype.clearBit=function(t){return this.changeBit(t,is)},t.prototype.flipBit=function(t){return this.changeBit(t,ns)},t.prototype.add=function(t){var e=Ds();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=Ds();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=Ds();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=Ds();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=Ds();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=Ds(),r=Ds();return this.divRemTo(t,e,r),[e,r]},t.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),a=_s(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Cs(e):e.isEven()?new Os(e):new Bs(e);var o=[],s=3,c=r-1,u=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=Ds();for(n.sqrTo(o[1],h);s<=u;)o[s]=Ds(),n.mulTo(h,o[s-2],o[s]),s+=2}var l,d,p=t.t-1,f=!0,g=Ds();for(i=Vs(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;0==(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&&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=_s(1),o=_s(0),s=_s(0),c=_s(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 ks)},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]<=As[As.length-1]){for(e=0;e<As.length;++e)if(r[0]==As[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<As.length;){for(var n=As[e],i=e+1;i<As.length&&n<Es;)n*=As[i++];for(n=r.modInt(n);e<i;)if(n%As[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]:Ms(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&&0!=(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=Ds());var o=Ds(),s=this.s,c=e.s,u=this.DB-Vs(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?Ds():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(0==(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=Ds(),i=Ds(),a=r.convert(this),o=Vs(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=_s(r),i=Ds(),a=Ds(),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=Ms(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),rs,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 i=[],a=7&e;i.length=1+(e>>3),r.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,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)>As.length&&(e=As.length);for(var a=Ds(),o=0;o<e;++o){a.fromInt(As[Math.floor(Math.random()*As.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=Ds();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,i){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),rs,this),this.isEven()&&this.dAddOffset(1,0);var a=this,o=function(){a.dAddOffset(2,0),a.bitLength()>e&&a.subTo(t.ONE.shiftLeft(e-1),a),a.isProbablePrime(r)?setTimeout((function(){i()}),0):setTimeout(o,0)};setTimeout(o,0)}else{var s=[],c=7&e;s.length=1+(e>>3),r.nextBytes(s),c>0?s[0]&=(1<<c)-1:s[0]=0,this.fromString(s,256)}},t}(),ks=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}(),Cs=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}(),Bs=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=Ds();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(xs.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=Ds();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}(),Os=function(){function t(t){this.m=t,this.r2=Ds(),this.q3=Ds(),xs.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=Ds();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 Ds(){return new xs(null)}function Ps(t,e){return new xs(t,e)}var Rs="undefined"!=typeof navigator;Rs&&"Microsoft Internet Explorer"==navigator.appName?(xs.prototype.am=function(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},bs=30):Rs&&"Netscape"!=navigator.appName?(xs.prototype.am=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},bs=26):(xs.prototype.am=function(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},bs=28),xs.prototype.DB=bs,xs.prototype.DM=(1<<bs)-1,xs.prototype.DV=1<<bs;xs.prototype.FV=Math.pow(2,52),xs.prototype.F1=52-bs,xs.prototype.F2=2*bs-52;var Is,Ns,Ls=[];for(Is="0".charCodeAt(0),Ns=0;Ns<=9;++Ns)Ls[Is++]=Ns;for(Is="a".charCodeAt(0),Ns=10;Ns<36;++Ns)Ls[Is++]=Ns;for(Is="A".charCodeAt(0),Ns=10;Ns<36;++Ns)Ls[Is++]=Ns;function Ms(t,e){var r=Ls[t.charCodeAt(e)];return null==r?-1:r}function _s(t){var e=Ds();return e.fromInt(t),e}function Vs(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}xs.ZERO=_s(0),xs.ONE=_s(1);var js=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}();var Us,Fs,qs=null;if(null==qs){qs=[],Fs=0;var Hs=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var $s=new Uint32Array(256);for(window.crypto.getRandomValues($s),Hs=0;Hs<$s.length;++Hs)qs[Fs++]=255&$s[Hs]}var zs=0,Gs=function(t){if((zs=zs||0)>=256||Fs>=256)window.removeEventListener?window.removeEventListener("mousemove",Gs,!1):window.detachEvent&&window.detachEvent("onmousemove",Gs);else try{var e=t.x+t.y;qs[Fs++]=255&e,zs+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",Gs,!1):window.attachEvent&&window.attachEvent("onmousemove",Gs))}function Ks(){if(null==Us){for(Us=new js;Fs<256;){var t=Math.floor(65536*Math.random());qs[Fs++]=255&t}for(Us.init(qs),Fs=0;Fs<qs.length;++Fs)qs[Fs]=0;Fs=0}return Us.next()}var Ws=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=Ks()},t}();var Xs=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=Ps(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,r=function(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 Ws,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 xs(r)}(t,e);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var i=n.toString(16),a=i.length,o=0;o<2*e-a;o++)i="0"+i;return i},t.prototype.setPrivate=function(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=Ps(t,16),this.e=parseInt(e,16),this.d=Ps(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=Ps(t,16),this.e=parseInt(e,16),this.d=Ps(r,16),this.p=Ps(n,16),this.q=Ps(i,16),this.dmp1=Ps(a,16),this.dmq1=Ps(o,16),this.coeff=Ps(s,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var r=new Ws,n=t>>1;this.e=parseInt(e,16);for(var i=new xs(e,16);;){for(;this.p=new xs(t-n,1,r),0!=this.p.subtract(xs.ONE).gcd(i).compareTo(xs.ONE)||!this.p.isProbablePrime(10););for(;this.q=new xs(n,1,r),0!=this.q.subtract(xs.ONE).gcd(i).compareTo(xs.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(xs.ONE),s=this.q.subtract(xs.ONE),c=o.multiply(s);if(0==c.gcd(i).compareTo(xs.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=Ps(t,16),r=this.doPrivate(e);return null==r?null:function(t,e){var r=t.toByteArray(),n=0;for(;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;++n;for(;0!=r[n];)if(++n>=r.length)return null;var i="";for(;++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}(r,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,r){var n=new Ws,i=t>>1;this.e=parseInt(e,16);var a=new xs(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(xs.ONE),n=o.q.subtract(xs.ONE),i=e.multiply(n);0==i.gcd(a).compareTo(xs.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=Ds(),o.q.fromNumberAsync(i,1,n,(function(){o.q.subtract(xs.ONE).gcda(a,(function(t){0==t.compareTo(xs.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(c,0)}))}))},u=function(){o.p=Ds(),o.p.fromNumberAsync(t-i,1,n,(function(){o.p.subtract(xs.ONE).gcda(a,(function(t){0==t.compareTo(xs.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=function(t){return Zs[t]||""}(r),i=function(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 Ps("0001"+n+"00"+t,16)}(n+e(t).toString(),this.n.bitLength()/4);if(null==i)return null;var a=this.doPrivate(i);if(null==a)return null;var o=a.toString(16);return 0==(1&o.length)?o:"0"+o},t.prototype.verify=function(t,e,r){var n=Ps(e,16),i=this.doPublic(n);return null==i?null:function(t){for(var e in Zs)if(Zs.hasOwnProperty(e)){var r=Zs[e],n=r.length;if(t.substr(0,n)==r)return t.substr(n)}return t}
|
|
1
|
+
var Paystack=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(t){return t&&t.Math==Math&&t},n=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")(),i={},a=function(t){try{return!!t()}catch(t){return!0}},o=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s=!a((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),c=s,u=Function.prototype.call,h=c?u.bind(u):function(){return u.apply(u,arguments)},l={},d={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,f=p&&!d.call({1:2},1);l.f=f?function(t){var e=p(this,t);return!!e&&e.enumerable}:d;var g,m,y=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v=s,b=Function.prototype,T=b.call,w=v&&b.bind.bind(T,T),S=v?w:function(t){return function(){return T.apply(t,arguments)}},A=S,E=A({}.toString),x=A("".slice),k=function(t){return x(E(t),8,-1)},C=a,B=k,O=Object,D=S("".split),P=C((function(){return!O("z").propertyIsEnumerable(0)}))?function(t){return"String"==B(t)?D(t,""):O(t)}:O,R=function(t){return null==t},I=R,N=TypeError,L=function(t){if(I(t))throw N("Can't call method on "+t);return t},M=P,_=L,V=function(t){return M(_(t))},j="object"==typeof document&&document.all,U={all:j,IS_HTMLDDA:void 0===j&&void 0!==j},F=U.all,q=U.IS_HTMLDDA?function(t){return"function"==typeof t||t===F}:function(t){return"function"==typeof t},H=q,$=U.all,z=U.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:H(t)||t===$}:function(t){return"object"==typeof t?null!==t:H(t)},G=n,K=q,W=function(t){return K(t)?t:void 0},X=function(t,e){return arguments.length<2?W(G[t]):G[t]&&G[t][e]},Z=S({}.isPrototypeOf),J=n,Y=X("navigator","userAgent")||"",Q=J.process,tt=J.Deno,et=Q&&Q.versions||tt&&tt.version,rt=et&&et.v8;rt&&(m=(g=rt.split("."))[0]>0&&g[0]<4?1:+(g[0]+g[1])),!m&&Y&&(!(g=Y.match(/Edge\/(\d+)/))||g[1]>=74)&&(g=Y.match(/Chrome\/(\d+)/))&&(m=+g[1]);var nt=m,it=a,at=!!Object.getOwnPropertySymbols&&!it((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&nt&&nt<41})),ot=at&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=X,ct=q,ut=Z,ht=Object,lt=ot?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ct(e)&&ut(e.prototype,ht(t))},dt=String,pt=q,ft=function(t){try{return dt(t)}catch(t){return"Object"}},gt=TypeError,mt=function(t){if(pt(t))return t;throw gt(ft(t)+" is not a function")},yt=R,vt=h,bt=q,Tt=z,wt=TypeError,St={exports:{}},At=n,Et=Object.defineProperty,xt=function(t,e){try{Et(At,t,{value:e,configurable:!0,writable:!0})}catch(r){At[t]=e}return e},kt=xt,Ct="__core-js_shared__",Bt=n[Ct]||kt(Ct,{}),Ot=Bt;(St.exports=function(t,e){return Ot[t]||(Ot[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Dt=L,Pt=Object,Rt=function(t){return Pt(Dt(t))},It=S({}.hasOwnProperty),Nt=Object.hasOwn||function(t,e){return It(Rt(t),e)},Lt=S,Mt=0,_t=Math.random(),Vt=Lt(1..toString),jt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Vt(++Mt+_t,36)},Ut=n,Ft=St.exports,qt=Nt,Ht=jt,$t=at,zt=ot,Gt=Ft("wks"),Kt=Ut.Symbol,Wt=Kt&&Kt.for,Xt=zt?Kt:Kt&&Kt.withoutSetter||Ht,Zt=function(t){if(!qt(Gt,t)||!$t&&"string"!=typeof Gt[t]){var e="Symbol."+t;$t&&qt(Kt,t)?Gt[t]=Kt[t]:Gt[t]=zt&&Wt?Wt(e):Xt(e)}return Gt[t]},Jt=h,Yt=z,Qt=lt,te=function(t,e){var r=t[e];return yt(r)?void 0:mt(r)},ee=function(t,e){var r,n;if("string"===e&&bt(r=t.toString)&&!Tt(n=vt(r,t)))return n;if(bt(r=t.valueOf)&&!Tt(n=vt(r,t)))return n;if("string"!==e&&bt(r=t.toString)&&!Tt(n=vt(r,t)))return n;throw wt("Can't convert object to primitive value")},re=TypeError,ne=Zt("toPrimitive"),ie=function(t,e){if(!Yt(t)||Qt(t))return t;var r,n=te(t,ne);if(n){if(void 0===e&&(e="default"),r=Jt(n,t,e),!Yt(r)||Qt(r))return r;throw re("Can't convert object to primitive value")}return void 0===e&&(e="number"),ee(t,e)},ae=lt,oe=function(t){var e=ie(t,"string");return ae(e)?e:e+""},se=z,ce=n.document,ue=se(ce)&&se(ce.createElement),he=function(t){return ue?ce.createElement(t):{}},le=!o&&!a((function(){return 7!=Object.defineProperty(he("div"),"a",{get:function(){return 7}}).a})),de=o,pe=h,fe=l,ge=y,me=V,ye=oe,ve=Nt,be=le,Te=Object.getOwnPropertyDescriptor;i.f=de?Te:function(t,e){if(t=me(t),e=ye(e),be)try{return Te(t,e)}catch(t){}if(ve(t,e))return ge(!pe(fe.f,t,e),t[e])};var we={},Se=o&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ae=z,Ee=String,xe=TypeError,ke=function(t){if(Ae(t))return t;throw xe(Ee(t)+" is not an object")},Ce=o,Be=le,Oe=Se,De=ke,Pe=oe,Re=TypeError,Ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Le="enumerable",Me="configurable",_e="writable";we.f=Ce?Oe?function(t,e,r){if(De(t),e=Pe(e),De(r),"function"==typeof t&&"prototype"===e&&"value"in r&&_e in r&&!r[_e]){var n=Ne(t,e);n&&n[_e]&&(t[e]=r.value,r={configurable:Me in r?r[Me]:n[Me],enumerable:Le in r?r[Le]:n[Le],writable:!1})}return Ie(t,e,r)}:Ie:function(t,e,r){if(De(t),e=Pe(e),De(r),Be)try{return Ie(t,e,r)}catch(t){}if("get"in r||"set"in r)throw Re("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Ve=we,je=y,Ue=o?function(t,e,r){return Ve.f(t,e,je(1,r))}:function(t,e,r){return t[e]=r,t},Fe={exports:{}},qe=o,He=Nt,$e=Function.prototype,ze=qe&&Object.getOwnPropertyDescriptor,Ge=He($e,"name"),Ke={EXISTS:Ge,PROPER:Ge&&"something"===function(){}.name,CONFIGURABLE:Ge&&(!qe||qe&&ze($e,"name").configurable)},We=q,Xe=Bt,Ze=S(Function.toString);We(Xe.inspectSource)||(Xe.inspectSource=function(t){return Ze(t)});var Je,Ye,Qe,tr=Xe.inspectSource,er=q,rr=n.WeakMap,nr=er(rr)&&/native code/.test(String(rr)),ir=St.exports,ar=jt,or=ir("keys"),sr={},cr=nr,ur=n,hr=z,lr=Ue,dr=Nt,pr=Bt,fr=function(t){return or[t]||(or[t]=ar(t))},gr=sr,mr="Object already initialized",yr=ur.TypeError,vr=ur.WeakMap;if(cr||pr.state){var br=pr.state||(pr.state=new vr);br.get=br.get,br.has=br.has,br.set=br.set,Je=function(t,e){if(br.has(t))throw yr(mr);return e.facade=t,br.set(t,e),e},Ye=function(t){return br.get(t)||{}},Qe=function(t){return br.has(t)}}else{var Tr=fr("state");gr[Tr]=!0,Je=function(t,e){if(dr(t,Tr))throw yr(mr);return e.facade=t,lr(t,Tr,e),e},Ye=function(t){return dr(t,Tr)?t[Tr]:{}},Qe=function(t){return dr(t,Tr)}}var wr={set:Je,get:Ye,has:Qe,enforce:function(t){return Qe(t)?Ye(t):Je(t,{})},getterFor:function(t){return function(e){var r;if(!hr(e)||(r=Ye(e)).type!==t)throw yr("Incompatible receiver, "+t+" required");return r}}},Sr=a,Ar=q,Er=Nt,xr=o,kr=Ke.CONFIGURABLE,Cr=tr,Br=wr.enforce,Or=wr.get,Dr=Object.defineProperty,Pr=xr&&!Sr((function(){return 8!==Dr((function(){}),"length",{value:8}).length})),Rr=String(String).split("String"),Ir=Fe.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Er(t,"name")||kr&&t.name!==e)&&(xr?Dr(t,"name",{value:e,configurable:!0}):t.name=e),Pr&&r&&Er(r,"arity")&&t.length!==r.arity&&Dr(t,"length",{value:r.arity});try{r&&Er(r,"constructor")&&r.constructor?xr&&Dr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Br(t);return Er(n,"source")||(n.source=Rr.join("string"==typeof e?e:"")),t};Function.prototype.toString=Ir((function(){return Ar(this)&&Or(this).source||Cr(this)}),"toString");var Nr=q,Lr=we,Mr=Fe.exports,_r=xt,Vr={},jr=Math.ceil,Ur=Math.floor,Fr=Math.trunc||function(t){var e=+t;return(e>0?Ur:jr)(e)},qr=function(t){var e=+t;return e!=e||0===e?0:Fr(e)},Hr=qr,$r=Math.max,zr=Math.min,Gr=qr,Kr=Math.min,Wr=function(t){return t>0?Kr(Gr(t),9007199254740991):0},Xr=V,Zr=function(t,e){var r=Hr(t);return r<0?$r(r+e,0):zr(r,e)},Jr=function(t){return Wr(t.length)},Yr=function(t){return function(e,r,n){var i,a=Xr(e),o=Jr(a),s=Zr(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}},Qr={includes:Yr(!0),indexOf:Yr(!1)},tn=Nt,en=V,rn=Qr.indexOf,nn=sr,an=S([].push),on=function(t,e){var r,n=en(t),i=0,a=[];for(r in n)!tn(nn,r)&&tn(n,r)&&an(a,r);for(;e.length>i;)tn(n,r=e[i++])&&(~rn(a,r)||an(a,r));return a},sn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Vr.f=Object.getOwnPropertyNames||function(t){return on(t,sn)};var cn={};cn.f=Object.getOwnPropertySymbols;var un=X,hn=Vr,ln=cn,dn=ke,pn=S([].concat),fn=un("Reflect","ownKeys")||function(t){var e=hn.f(dn(t)),r=ln.f;return r?pn(e,r(t)):e},gn=Nt,mn=fn,yn=i,vn=we,bn=function(t,e,r){for(var n=mn(e),i=vn.f,a=yn.f,o=0;o<n.length;o++){var s=n[o];gn(t,s)||r&&gn(r,s)||i(t,s,a(e,s))}},Tn=a,wn=q,Sn=/#|\.prototype\./,An=function(t,e){var r=xn[En(t)];return r==Cn||r!=kn&&(wn(e)?Tn(e):!!e)},En=An.normalize=function(t){return String(t).replace(Sn,".").toLowerCase()},xn=An.data={},kn=An.NATIVE="N",Cn=An.POLYFILL="P",Bn=An,On=n,Dn=i.f,Pn=Ue,Rn=function(t,e,r,n){n||(n={});var i=n.enumerable,a=void 0!==n.name?n.name:e;if(Nr(r)&&Mr(r,a,n),n.global)i?t[e]=r:_r(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=r:Lr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},In=xt,Nn=bn,Ln=Bn,Mn=s,_n=Function.prototype,Vn=_n.apply,jn=_n.call,Un="object"==typeof Reflect&&Reflect.apply||(Mn?jn.bind(Vn):function(){return jn.apply(Vn,arguments)}),Fn=q,qn=String,Hn=TypeError,$n=S,zn=ke,Gn=function(t){if("object"==typeof t||Fn(t))return t;throw Hn("Can't set "+qn(t)+" as a prototype")},Kn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=$n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return zn(r),Gn(n),e?t(r,n):r.__proto__=n,r}}():void 0),Wn=we.f,Xn=q,Zn=z,Jn=Kn,Yn={};Yn[Zt("toStringTag")]="z";var Qn="[object z]"===String(Yn),ti=q,ei=k,ri=Zt("toStringTag"),ni=Object,ii="Arguments"==ei(function(){return arguments}()),ai=Qn?ei: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=ni(t),ri))?r:ii?ei(e):"Object"==(n=ei(e))&&ti(e.callee)?"Arguments":n},oi=String,si=function(t){if("Symbol"===ai(t))throw TypeError("Cannot convert a Symbol value to a string");return oi(t)},ci=z,ui=Ue,hi=Error,li=S("".replace),di=String(hi("zxcasd").stack),pi=/\n\s*at [^:]*:[^\n]*/,fi=pi.test(di),gi=y,mi=!a((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",gi(1,7)),7!==t.stack)})),yi=X,vi=Nt,bi=Ue,Ti=Z,wi=Kn,Si=bn,Ai=function(t,e,r){r in t||Wn(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})},Ei=function(t,e,r){var n,i;return Jn&&Xn(n=e.constructor)&&n!==r&&Zn(i=n.prototype)&&i!==r.prototype&&Jn(t,i),t},xi=function(t,e){return void 0===t?arguments.length<2?"":e:si(t)},ki=function(t,e){ci(e)&&"cause"in e&&ui(t,"cause",e.cause)},Ci=function(t,e){if(fi&&"string"==typeof t&&!hi.prepareStackTrace)for(;e--;)t=li(t,pi,"");return t},Bi=mi,Oi=o,Di=function(t,e){var r,n,i,a,o,s=t.target,c=t.global,u=t.stat;if(r=c?On:u?On[s]||In(s,{}):(On[s]||{}).prototype)for(n in e){if(a=e[n],i=t.dontCallGetSet?(o=Dn(r,n))&&o.value:r[n],!Ln(c?n:s+(u?".":"#")+n,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;Nn(a,i)}(t.sham||i&&i.sham)&&Pn(a,"sham",!0),Rn(r,n,a,t)}},Pi=Un,Ri=function(t,e,r,n){var i="stackTraceLimit",a=n?2:1,o=t.split("."),s=o[o.length-1],c=yi.apply(null,o);if(c){var u=c.prototype;if(vi(u,"cause")&&delete u.cause,!r)return c;var h=yi("Error"),l=e((function(t,e){var r=xi(n?e:t,void 0),i=n?new c(t):new c;return void 0!==r&&bi(i,"message",r),Bi&&bi(i,"stack",Ci(i.stack,2)),this&&Ti(u,this)&&Ei(i,this,l),arguments.length>a&&ki(i,arguments[a]),i}));l.prototype=u,"Error"!==s?wi?wi(l,h):Si(l,h,{name:!0}):Oi&&i in c&&(Ai(l,c,i),Ai(l,c,"prepareStackTrace")),Si(l,c);try{u.name!==s&&bi(u,"name",s),u.constructor=l}catch(t){}return l}},Ii="WebAssembly",Ni=n[Ii],Li=7!==Error("e",{cause:7}).cause,Mi=function(t,e){var r={};r[t]=Ri(t,e,Li),Di({global:!0,constructor:!0,arity:1,forced:Li},r)},_i=function(t,e){if(Ni&&Ni[t]){var r={};r[t]=Ri(Ii+"."+t,e,Li),Di({target:Ii,stat:!0,constructor:!0,arity:1,forced:Li},r)}};Mi("Error",(function(t){return function(e){return Pi(t,this,arguments)}})),Mi("EvalError",(function(t){return function(e){return Pi(t,this,arguments)}})),Mi("RangeError",(function(t){return function(e){return Pi(t,this,arguments)}})),Mi("ReferenceError",(function(t){return function(e){return Pi(t,this,arguments)}})),Mi("SyntaxError",(function(t){return function(e){return Pi(t,this,arguments)}})),Mi("TypeError",(function(t){return function(e){return Pi(t,this,arguments)}})),Mi("URIError",(function(t){return function(e){return Pi(t,this,arguments)}})),_i("CompileError",(function(t){return function(e){return Pi(t,this,arguments)}})),_i("LinkError",(function(t){return function(e){return Pi(t,this,arguments)}})),_i("RuntimeError",(function(t){return function(e){return Pi(t,this,arguments)}}));class Vi 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,Vi),this.errors=t}}function ji(t){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)}function Ui(t){return parseInt(t,10)===Number(t)&&Number(t)>=0}function Fi(t){return t&&"string"==typeof t}const qi={ref:{required:!1,isValid:Fi},key:{required:!0,isValid:function(t){return t&&"pk"===t.substring(0,2)}},email:{required:!0,fallback:"customer_code",isValid:ji},customer_code:{required:!1,isValid:Fi},amount:{required:!0,fallback:"plan",isValid:Ui},plan:{required:!1,isValid:Fi},transaction_charge:{required:!1,isValid:Ui},bearer:{required:!1,isValid:Fi},channels:{required:!1,isValid:function(t){return t instanceof Array}},currency:{required:!1,isValid:Fi},firstname:{required:!1,isValid:Fi},lastname:{required:!1,isValid:Fi},phone:{required:!1,isValid:Fi},remark:{required:!1,isValid:Fi},payment_page:{required:!1,isValid:Ui},payment_request:{required:!1,isValid:Fi},quantity:{required:!1,isValid:Fi},coupon:{required:!1,isValid:Fi},start_date:{required:!1,isValid:Fi},interval:{required:!1,isValid:Fi},invoice_limit:{required:!1,isValid:Ui},subaccount:{required:!1,isValid:Fi},split_code:{required:!1,isValid:Fi},hash:{required:!1,isValid:Fi},metadata:{required:!1,isValid:Fi},transaction_type:{required:!1,isValid:Fi},subscription:{required:!1,isValid:Ui}};var Hi,$i,zi,Gi={exports:{}};$i=e,zi=function(){void 0===Array.isArray&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});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,adBlock:!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){if(L())return t.EXCLUDED;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},w=function(t){return navigator.platform?navigator.platform:t.NOT_AVAILABLE},S=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},x=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=j()))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)}))}))}))})),U(t),r):(U(t),r)},k=function(){try{var t=j(),e=t.getExtension("WEBGL_debug_renderer_info"),r=t.getParameter(e.UNMASKED_VENDOR_WEBGL)+"~"+t.getParameter(e.UNMASKED_RENDERER_WEBGL);return U(t),r}catch(t){return null}},C=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},O=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("windows")>=0||e.indexOf("win16")>=0||e.indexOf("win32")>=0||e.indexOf("win64")>=0||e.indexOf("win95")>=0||e.indexOf("win98")>=0||e.indexOf("winnt")>=0||e.indexOf("wow64")>=0?"Windows":e.indexOf("android")>=0?"Android":e.indexOf("linux")>=0||e.indexOf("cros")>=0||e.indexOf("x11")>=0?"Linux":e.indexOf("iphone")>=0||e.indexOf("ipad")>=0||e.indexOf("ipod")>=0||e.indexOf("crios")>=0||e.indexOf("fxios")>=0?"iOS":e.indexOf("macintosh")>=0||e.indexOf("mac_powerpc)")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows"!==t&&"Windows Phone"!==t&&"Android"!==t&&"iOS"!==t&&"Other"!==t&&-1===e.indexOf("cros"))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||!(n.indexOf("arm")>=0&&"Windows Phone"===t)&&!(n.indexOf("pike")>=0&&e.indexOf("opera mini")>=0)&&((n.indexOf("win")<0&&n.indexOf("linux")<0&&n.indexOf("mac")<0&&n.indexOf("iphone")<0&&n.indexOf("ipad")<0&&n.indexOf("ipod")<0)!=("Other"===t)||void 0===navigator.plugins&&"Windows"!==t&&"Windows Phone"!==t)},P=function(){var t,e=navigator.userAgent.toLowerCase(),r=navigator.productSub;if(e.indexOf("edge/")>=0||e.indexOf("iemobile/")>=0)return!1;if(e.indexOf("opera mini")>=0)return!1;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?e.indexOf("android 1.")>=0||e.indexOf("android 2.")>=0||e.indexOf("android 3.")>=0||e.indexOf("android 4.")>=0?"AOSP":"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&&"AOSP"!==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=j(),e=!!window.WebGLRenderingContext&&!!t;return U(t),e},N=function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},L=function(){return("msWriteProfilerMark"in window)+("msLaunchUri"in navigator)+("msSaveBlob"in navigator)>=2},M=function(){return void 0!==window.swfobject},_=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"},{})},j=function(){var t=document.createElement("canvas"),e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return e||(e=null),e},U=function(t){var e=t.getExtension("WEBGL_lose_context");null!=e&&e.loseContext()},F=[{key:"userAgent",getData:function(t){t(navigator.userAgent)}},{key:"webdriver",getData:function(t,e){t(null==navigator.webdriver?e.NOT_AVAILABLE:navigator.webdriver)}},{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||e.NOT_AVAILABLE):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(!!window.HTMLElement.prototype.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(w(e))}},{key:"doNotTrack",getData:function(t,e){t(S(e))}},{key:"plugins",getData:function(t,e){N()?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(x()):t(e.NOT_AVAILABLE)}},{key:"webglVendorAndRenderer",getData:function(t){I()?t(k()):t()}},{key:"adBlock",getData:function(t){t(C())}},{key:"hasLiedLanguages",getData:function(t){t(B())}},{key:"hasLiedResolution",getData:function(t){t(O())}},{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 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/fingerprintjs/fingerprintjs 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)}))}}],q=function(t){throw new Error("'new Fingerprint()' is deprecated, see https://github.com/fingerprintjs/fingerprintjs#upgrade-guide-from-182-to-200")};return q.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(F);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)},q.getPromise=function(t){return new Promise((function(e,r){q.get(t,e)}))},q.getV18=function(t,e){return null==e&&(e=t,t={}),q.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)&&Array.isArray(a.value))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)}))},q.x64hash128=o,q.VERSION="2.1.4",q},(Hi=Gi).exports?Hi.exports=zi():$i.exports?$i.exports=zi():$i.Fingerprint2=zi();var Ki=Gi.exports;const Wi=t=>{(console?console.log:()=>{})(t)},Xi=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 Ki.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 Ki.x64hash128(r,n)}Wi("Device ID could not be calculated")}catch(t){Wi(t)}return null})())}catch(t){Wi("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-----"},Ji={...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"},Yi={...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"},Qi={...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"},ta={dev:Ji,staging:Yi,production:Qi}[(window||process.env).paystackEnvironment]||Qi;const ea=()=>{};var ra={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}},transferCreditRequest(t){const{message:e,status:r,errors:n,...i}=t;return{status:r,message:e||"Transfer credit request",data:i}},incorrectAmountSent(t){const{message:e,status:r,errors:n,...i}=t;return{status:r,message:e||"Incorrect amount sent",data:i}},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):"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.transferCreditRequest(e):"incorrect-amount-sent"===e.status?this.incorrectAmountSent(e):e.auth&&"none"!==e.auth?this.auth(e):this.error(e)}},na={exports:{}},ia=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)}},aa=ia,oa=Object.prototype.toString;function sa(t){return"[object Array]"===oa.call(t)}function ca(t){return void 0===t}function ua(t){return null!==t&&"object"==typeof t}function ha(t){if("[object Object]"!==oa.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function la(t){return"[object Function]"===oa.call(t)}function da(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),sa(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 pa={isArray:sa,isArrayBuffer:function(t){return"[object ArrayBuffer]"===oa.call(t)},isBuffer:function(t){return null!==t&&!ca(t)&&null!==t.constructor&&!ca(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:ua,isPlainObject:ha,isUndefined:ca,isDate:function(t){return"[object Date]"===oa.call(t)},isFile:function(t){return"[object File]"===oa.call(t)},isBlob:function(t){return"[object Blob]"===oa.call(t)},isFunction:la,isStream:function(t){return ua(t)&&la(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:da,merge:function t(){var e={};function r(r,n){ha(e[n])&&ha(r)?e[n]=t(e[n],r):ha(r)?e[n]=t({},r):sa(r)?e[n]=r.slice():e[n]=r}for(var n=0,i=arguments.length;n<i;n++)da(arguments[n],r);return e},extend:function(t,e,r){return da(e,(function(e,n){t[n]=r&&"function"==typeof e?aa(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}},fa=pa;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 ma=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(fa.isURLSearchParams(e))n=e.toString();else{var i=[];fa.forEach(e,(function(t,e){null!=t&&(fa.isArray(t)?e+="[]":t=[t],fa.forEach(t,(function(t){fa.isDate(t)?t=t.toISOString():fa.isObject(t)&&(t=JSON.stringify(t)),i.push(ga(e)+"="+ga(t))})))})),n=i.join("&")}if(n){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},ya=pa;function va(){this.handlers=[]}va.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},va.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},va.prototype.forEach=function(t){ya.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var ba=va,Ta=pa,wa=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},Sa=wa,Aa=function(t,e,r,n,i){var a=new Error(t);return Sa(a,e,r,n,i)},Ea=Aa,xa=pa,ka=xa.isStandardBrowserEnv()?{write:function(t,e,r,n,i,a){var o=[];o.push(t+"="+encodeURIComponent(e)),xa.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),xa.isString(n)&&o.push("path="+n),xa.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(){}},Ca=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Ba=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Oa=pa,Da=["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"],Pa=pa,Ra=Pa.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=Pa.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0},Ia=pa,Na=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Ea("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},La=ka,Ma=ma,_a=function(t,e){return t&&!Ca(e)?Ba(t,e):e},Va=function(t){var e,r,n,i={};return t?(Oa.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Oa.trim(t.substr(0,n)).toLowerCase(),r=Oa.trim(t.substr(n+1)),e){if(i[e]&&Da.indexOf(e)>=0)return;i[e]="set-cookie"===e?(i[e]?i[e]:[]).concat([r]):i[e]?i[e]+", "+r:r}})),i):i},ja=Ra,Ua=Aa,Fa=function(t){return new Promise((function(e,r){var n=t.data,i=t.headers,a=t.responseType;Ia.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=_a(t.baseURL,t.url);function h(){if(o){var n="getAllResponseHeaders"in o?Va(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};Na(e,r,i),o=null}}if(o.open(t.method.toUpperCase(),Ma(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(Ua("Request aborted",t,"ECONNABORTED",o)),o=null)},o.onerror=function(){r(Ua("Network Error",t,null,o)),o=null},o.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(Ua(e,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Ia.isStandardBrowserEnv()){var l=(t.withCredentials||ja(u))&&t.xsrfCookieName?La.read(t.xsrfCookieName):void 0;l&&(i[t.xsrfHeaderName]=l)}"setRequestHeader"in o&&Ia.forEach(i,(function(t,e){void 0===n&&"content-type"===e.toLowerCase()?delete i[e]:o.setRequestHeader(e,t)})),Ia.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)}))},qa=pa,Ha=function(t,e){Ta.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},$a=wa,za={"Content-Type":"application/x-www-form-urlencoded"};function Ga(t,e){!qa.isUndefined(t)&&qa.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var Ka,Wa={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ka=Fa),Ka),transformRequest:[function(t,e){return Ha(e,"Accept"),Ha(e,"Content-Type"),qa.isFormData(t)||qa.isArrayBuffer(t)||qa.isBuffer(t)||qa.isStream(t)||qa.isFile(t)||qa.isBlob(t)?t:qa.isArrayBufferView(t)?t.buffer:qa.isURLSearchParams(t)?(Ga(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):qa.isObject(t)||e&&"application/json"===e["Content-Type"]?(Ga(e,"application/json"),function(t,e,r){if(qa.isString(t))try{return(e||JSON.parse)(t),qa.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&&qa.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw $a(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}};Wa.headers={common:{Accept:"application/json, text/plain, */*"}},qa.forEach(["delete","get","head"],(function(t){Wa.headers[t]={}})),qa.forEach(["post","put","patch"],(function(t){Wa.headers[t]=qa.merge(za)}));var Xa=Wa,Za=pa,Ja=Xa,Ya=function(t){return!(!t||!t.__CANCEL__)},Qa=pa,to=function(t,e,r){var n=this||Ja;return Za.forEach(r,(function(r){t=r.call(n,t,e)})),t},eo=Ya,ro=Xa;function no(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var io=pa,ao=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 io.isPlainObject(t)&&io.isPlainObject(e)?io.merge(t,e):io.isPlainObject(e)?io.merge({},e):io.isArray(e)?e.slice():e}function c(n){io.isUndefined(e[n])?io.isUndefined(t[n])||(r[n]=s(void 0,t[n])):r[n]=s(t[n],e[n])}io.forEach(n,(function(t){io.isUndefined(e[t])||(r[t]=s(void 0,e[t]))})),io.forEach(i,c),io.forEach(a,(function(n){io.isUndefined(e[n])?io.isUndefined(t[n])||(r[n]=s(void 0,t[n])):r[n]=s(void 0,e[n])})),io.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 io.forEach(h,c),r},oo={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"},so={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){so[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var co={},uo=oo.version.split(".");function ho(t,e){for(var r=e?e.split("."):uo,n=t.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}so.transitional=function(t,e,r){var n=e&&ho(e);function i(t,e){return"[Axios v"+oo.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&&!co[a]&&(co[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 lo={isOlderVersion:ho,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:so},po=pa,fo=ma,go=ba,mo=function(t){return no(t),t.headers=t.headers||{},t.data=to.call(t,t.data,t.headers,t.transformRequest),t.headers=Qa.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Qa.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||ro.adapter)(t).then((function(e){return no(t),e.data=to.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return eo(e)||(no(t),e&&e.response&&(e.response.data=to.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},yo=ao,vo=lo,bo=vo.validators;function To(t){this.defaults=t,this.interceptors={request:new go,response:new go}}To.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=yo(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&&vo.assertOptions(e,{silentJSONParsing:bo.transitional(bo.boolean,"1.0.0"),forcedJSONParsing:bo.transitional(bo.boolean,"1.0.0"),clarifyTimeoutError:bo.transitional(bo.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=[mo,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=mo(s)}catch(t){return Promise.reject(t)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},To.prototype.getUri=function(t){return t=yo(this.defaults,t),fo(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},po.forEach(["delete","get","head","options"],(function(t){To.prototype[t]=function(e,r){return this.request(yo(r||{},{method:t,url:e,data:(r||{}).data}))}})),po.forEach(["post","put","patch"],(function(t){To.prototype[t]=function(e,r,n){return this.request(yo(n||{},{method:t,url:e,data:r}))}}));var wo=To;function So(t){this.message=t}So.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},So.prototype.__CANCEL__=!0;var Ao=So,Eo=Ao;function xo(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 Eo(t),e(r.reason))}))}xo.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},xo.source=function(){var t;return{token:new xo((function(e){t=e})),cancel:t}};var ko=xo,Co=pa,Bo=ia,Oo=wo,Do=ao;function Po(t){var e=new Oo(t),r=Bo(Oo.prototype.request,e);return Co.extend(r,Oo.prototype,e),Co.extend(r,e),r}var Ro=Po(Xa);Ro.Axios=Oo,Ro.create=function(t){return Po(Do(Ro.defaults,t))},Ro.Cancel=Ao,Ro.CancelToken=ko,Ro.isCancel=Ya,Ro.all=function(t){return Promise.all(t)},Ro.spread=function(t){return function(e){return t.apply(null,e)}},Ro.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},na.exports=Ro,na.exports.default=Ro;var Io=na.exports;const No=Io.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 function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=Object.entries(t);return e.reduce(((t,e)=>{const[r,n]=e;return[...t,`${r}=${n}`]}),[]).join("&")}(e)}}),Lo=()=>{try{return window?window.localStorage&&window.localStorage.getItem("i18nextLng")||navigator&&navigator.language:null}catch(t){return null}},Mo={requestInline(t){const e=Lo(),r={...e&&{"Accept-Language":e}},n=new URL("/checkout/request_inline",ta.paystackApiUrl).toString();return No.post(n,t,{headers:r}).then((t=>t.data))},requestStandard(t){const e=Lo(),r={...e&&{"Accept-Language":e}},n=`${ta.paystackApiUrl}transaction/verify_access_code/${t}`;return No.get(n,{headers:r}).then((t=>t.data))},getByAccessCode(t,e){const r=Lo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}},i=new URL(`/transaction/get_by_access_code/${t}`,ta.paystackApiUrl).toString();return No.get(i,{headers:n}).then((t=>t.data))},verify(t){const e=Lo(),r={...e&&{"Accept-Language":e}},n=`${ta.paystackApiUrl}transaction/verify/${t}`;return No.get(n,{headers:r}).then((t=>t.data))},requery(t){const e=Lo(),r={...e&&{"Accept-Language":e}},n=`${ta.paymentBaseUrl}charge/requery/${t}`;return No.get(n,{headers:r}).then((t=>ra.parse(t.data)))},markAsAbandoned(t){let{publicKey:e,transactionId:r}=t;const n=`${ta.paystackApiUrl}transaction/${r}/mark-as-abandoned`,i=Lo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return No.patch(n,{},{headers:a}).then((t=>t.data))}},_o={generateManagedAccount(t,e){const r=Lo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return No.post(`${ta.paystackApiUrl}checkout/pay_with_transfer`,t,{headers:n}).then((t=>ra.parse(t.data)))},submitPayerDetails(t,e){const r={Authorization:`Bearer ${e}`};return No.post(`${ta.paystackApiUrl}managed_account/customer_claim`,t,{headers:r}).then((t=>ra.parse(t.data)))}};var Vo={getManagedAccount(t){let{fulfilLateNotification:e}=t;const r={transaction_id:this.id,fulfil_late_notification:e};return _o.generateManagedAccount(r,this.merchant.key).then((t=>("success"===t.status&&(this.bankTransfer=t),t)))},submitPayerDetails(t){let{email:e,accountNumber:r,bankId:n,managedAccountNumber:i,providerSlug:a,claimType:o}=t;const s={reference_id:this.id,account_number:r,email:e,institution_id:n,institution_type:"bank",claim_type:o,managed_account_number:i,provider_slug:a};return _o.submitPayerDetails(s,this.merchant.key)},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)}},jo="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},Uo=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":jo(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 Fo={charge(t){let{transactionId:e,phoneNumber:r}=t;const n=`${ta.paymentBaseUrl}payattitude/charge/${e}`,i=Lo(),a={"Content-Type":"application/x-www-form-urlencoded",...i&&{"Accept-Language":i}},o=Uo({phone_number:r});return No.post(n,o,{headers:a}).then((t=>{let{data:e}=t;return ra.parse(e)}))}},qo="payattitude";var Ho={chargePayattitude(t){let{phoneNumber:e}=t;const r={transactionId:this.id,phoneNumber:e};return Fo.charge(r).then((t=>(this.logAPIResponse(t,qo),t)))},listenForPayattitudeCharge(t){const e={paymentMethod:qo,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}};const $o={getEFTUrl(t){let{eftGateway:e}=t;return new Promise(((t,r)=>{e||r(Error("Please pass the `eftGateway`"));const n=`${ta.paymentBaseUrl}eft/${e}/${this.id}`;t(ra.success({url:n}))}))},listenForEFTCharge(t){const e={channel:`EFT_${this.id}`,paymentMethod:"eft"};return this.listenForCharge(e,t)}},zo={validateApplePaySession(t){let{sessionUrl:e,displayName:r,transactionId:n,domainName:i}=t;const a=Lo(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s=`${ta.paymentBaseUrl}applepay/validate-session`,c=Uo({sessionUrl:e,displayName:r,domainName:i,transaction:n});return No.post(s,c,{headers:o}).then((t=>ra.parse(t.data)))},charge(t){let{transactionId:e,paymentObject:r}=t;const n=Lo(),i={"Content-Type":"application/x-www-form-urlencoded",...n&&{"Accept-Language":n}},a=`${ta.paymentBaseUrl}applepay/charge`,o=Uo({paymentObject:r,transaction:e});return No.post(a,o,{headers:i}).then((t=>ra.parse(t.data)))}},Go="apple pay";var Ko={validateApplePaySession(t){let{sessionUrl:e,displayName:r,domainName:n}=t;return this.logAttempt(Go),zo.validateApplePaySession({sessionUrl:e,displayName:r,domainName:n,transactionId:this.id}).then((t=>(this.logAPIResponseMessage(t.message),t)))},chargeApplePay(t){let{paymentObject:e}=t;return zo.charge({transactionId:this.id,device:this.deviceFingerprint,paymentObject:e}).then((t=>(this.logAPIResponse(t,Go),t)))}};const Wo={createOrder(t){const e=`${ta.paymentBaseUrl}paypal/${t}/create`,r=Lo(),n={...r&&{"Accept-Language":r}};return No.post(e,{headers:n}).then((t=>ra.parse(t.data)))},captureOrder(t){const e=`${ta.paymentBaseUrl}paypal/${t}/capture`,r=Lo(),n={...r&&{"Accept-Language":r}};return No.post(e,{headers:n}).then((t=>ra.parse(t.data)))},getConfig(t){let{publicKey:e,transactionId:r}=t;const n=`${ta.paystackApiUrl}paypal/config?transaction=${r}`,i=Lo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return No.get(n,{headers:a}).then((t=>t.data))}},Xo="paypal";var Zo={createPayPalOrder(){return this.logAttempt(Xo),Wo.createOrder(this.id).then((t=>(this.logAPIResponseMessage(t.message),t)))},capturePayPalOrder(){return Wo.captureOrder(this.id).then((t=>(this.logAPIResponse(t,Xo),t)))},getPayPalConfig(){return Wo.getConfig({publicKey:this.merchant.key,transactionId:this.id})}};function Jo(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function Yo(t,e){return t&e}function Qo(t,e){return t|e}function ts(t,e){return t^e}function es(t,e){return t&~e}function rs(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function ns(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var is,as="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function os(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=as.charAt(r>>6)+as.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=as.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=as.charAt(r>>2)+as.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function ss(t){var e,r="",n=0,i=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e){var a=as.indexOf(t.charAt(e));a<0||(0==n?(r+=Jo(a>>2),i=3&a,n=1):1==n?(r+=Jo(i<<2|a>>4),i=15&a,n=2):2==n?(r+=Jo(i),r+=Jo(a>>2),i=3&a,n=3):(r+=Jo(i<<2|a>>4),r+=Jo(15&a),n=0))}return 1==n&&(r+=Jo(i<<2)),r}var cs,us=function(t){var e;if(void 0===is){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(is={},e=0;e<16;++e)is[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)is[r.charAt(e)]=e;for(e=0;e<n.length;++e)is[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=is[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},hs={decode:function(t){var e;if(void 0===cs){var r="= \f\n\r\t \u2028\u2029";for(cs=Object.create(null),e=0;e<64;++e)cs["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(cs["-"]=62,cs._=63,e=0;e<r.length;++e)cs[r.charAt(e)]=-1}var n=[],i=0,a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;if(-1!=(o=cs[o])){if(void 0===o)throw new Error("Illegal character at offset "+e);i|=o,++a>=4?(n[n.length]=i>>16,n[n.length]=i>>8&255,n[n.length]=255&i,i=0,a=0):i<<=6}}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=i>>10;break;case 3:n[n.length]=i>>16,n[n.length]=i>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=hs.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 hs.decode(t)}},ls=1e13,ds=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)<ls?e=0:n-=(e=0|n/ls)*ls,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+=ls,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+=(ls+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*ls+t[r];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),ps=/^(\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)?)?$/,fs=/^(\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 gs(t,e){return t.length>e&&(t=t.substring(0,e)+"…"),t}var ms,ys=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 ".concat(t," on a stream of length ").concat(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?ps:fs).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;0==(128&(+o^a));)o=+o<<1,--r;o="("+r+" bit)\n"}i&&(n-=256);for(var s=new ds(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+gs(a,r)}return i+a},t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return gs(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+="…"),i},t.prototype.parseOID=function(t,e,r){for(var n="",i=new ds,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 ds)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 gs(n,r);i=new ds,a=0}}return a>0&&(n+=".incomplete"),n},t}(),vs=function(){function t(t,e,r,n,i){if(!(n instanceof bs))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 gs(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return gs(this.stream.parseStringISO(e,e+r),t);case 30:return gs(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 ys?e:new ys(e,0);var n=new ys(r),i=new bs(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}(),bs=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new ds;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}(),Ts=[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],ws=(1<<26)/Ts[Ts.length-1],Ss=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 r,n=(1<<e)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%e;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=Jo(r));o>=0;)s<e?(r=(this[o]&(1<<s)-1)<<e-s,r|=this[--o]>>(s+=this.DB-e)):(r=this[o]>>(s-=e)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=Jo(r));return i?a:"0"},t.prototype.negate=function(){var e=Cs();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)+Ls(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var r=Cs();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 Es(e):new xs(e),this.exp(t,r)},t.prototype.clone=function(){var t=Cs();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)),0!=(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=Cs();return this.bitwiseTo(t,Yo,e),e},t.prototype.or=function(t){var e=Cs();return this.bitwiseTo(t,Qo,e),e},t.prototype.xor=function(t){var e=Cs();return this.bitwiseTo(t,ts,e),e},t.prototype.andNot=function(t){var e=Cs();return this.bitwiseTo(t,es,e),e},t.prototype.not=function(){for(var t=Cs(),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=Cs();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=Cs();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+rs(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+=ns(this[r]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,Qo)},t.prototype.clearBit=function(t){return this.changeBit(t,es)},t.prototype.flipBit=function(t){return this.changeBit(t,ts)},t.prototype.add=function(t){var e=Cs();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=Cs();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=Cs();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=Cs();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=Cs();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=Cs(),r=Cs();return this.divRemTo(t,e,r),[e,r]},t.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),a=Ns(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Es(e):e.isEven()?new ks(e):new xs(e);var o=[],s=3,c=r-1,u=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=Cs();for(n.sqrTo(o[1],h);s<=u;)o[s]=Cs(),n.mulTo(h,o[s-2],o[s]),s+=2}var l,d,p=t.t-1,f=!0,g=Cs();for(i=Ls(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;0==(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&&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=Ns(1),o=Ns(0),s=Ns(0),c=Ns(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 As)},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]<=Ts[Ts.length-1]){for(e=0;e<Ts.length;++e)if(r[0]==Ts[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<Ts.length;){for(var n=Ts[e],i=e+1;i<Ts.length&&n<ws;)n*=Ts[i++];for(n=r.modInt(n);e<i;)if(n%Ts[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]:Is(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&&0!=(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=Cs());var o=Cs(),s=this.s,c=e.s,u=this.DB-Ls(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?Cs():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(0==(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=Cs(),i=Cs(),a=r.convert(this),o=Ls(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=Ns(r),i=Cs(),a=Cs(),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=Is(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),Qo,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 i=[],a=7&e;i.length=1+(e>>3),r.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,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)>Ts.length&&(e=Ts.length);for(var a=Cs(),o=0;o<e;++o){a.fromInt(Ts[Math.floor(Math.random()*Ts.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=Cs();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,i){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),Qo,this),this.isEven()&&this.dAddOffset(1,0);var a=this,o=function(){a.dAddOffset(2,0),a.bitLength()>e&&a.subTo(t.ONE.shiftLeft(e-1),a),a.isProbablePrime(r)?setTimeout((function(){i()}),0):setTimeout(o,0)};setTimeout(o,0)}else{var s=[],c=7&e;s.length=1+(e>>3),r.nextBytes(s),c>0?s[0]&=(1<<c)-1:s[0]=0,this.fromString(s,256)}},t}(),As=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}(),Es=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}(),xs=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=Cs();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(Ss.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=Cs();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}(),ks=function(){function t(t){this.m=t,this.r2=Cs(),this.q3=Cs(),Ss.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=Cs();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 Cs(){return new Ss(null)}function Bs(t,e){return new Ss(t,e)}var Os="undefined"!=typeof navigator;Os&&"Microsoft Internet Explorer"==navigator.appName?(Ss.prototype.am=function(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},ms=30):Os&&"Netscape"!=navigator.appName?(Ss.prototype.am=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},ms=26):(Ss.prototype.am=function(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},ms=28),Ss.prototype.DB=ms,Ss.prototype.DM=(1<<ms)-1,Ss.prototype.DV=1<<ms;Ss.prototype.FV=Math.pow(2,52),Ss.prototype.F1=52-ms,Ss.prototype.F2=2*ms-52;var Ds,Ps,Rs=[];for(Ds="0".charCodeAt(0),Ps=0;Ps<=9;++Ps)Rs[Ds++]=Ps;for(Ds="a".charCodeAt(0),Ps=10;Ps<36;++Ps)Rs[Ds++]=Ps;for(Ds="A".charCodeAt(0),Ps=10;Ps<36;++Ps)Rs[Ds++]=Ps;function Is(t,e){var r=Rs[t.charCodeAt(e)];return null==r?-1:r}function Ns(t){var e=Cs();return e.fromInt(t),e}function Ls(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}Ss.ZERO=Ns(0),Ss.ONE=Ns(1);var Ms=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}();var _s,Vs,js=null;if(null==js){js=[],Vs=0;var Us=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var Fs=new Uint32Array(256);for(window.crypto.getRandomValues(Fs),Us=0;Us<Fs.length;++Us)js[Vs++]=255&Fs[Us]}var qs=0,Hs=function(t){if((qs=qs||0)>=256||Vs>=256)window.removeEventListener?window.removeEventListener("mousemove",Hs,!1):window.detachEvent&&window.detachEvent("onmousemove",Hs);else try{var e=t.x+t.y;js[Vs++]=255&e,qs+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",Hs,!1):window.attachEvent&&window.attachEvent("onmousemove",Hs))}function $s(){if(null==_s){for(_s=new Ms;Vs<256;){var t=Math.floor(65536*Math.random());js[Vs++]=255&t}for(_s.init(js),Vs=0;Vs<js.length;++Vs)js[Vs]=0;Vs=0}return _s.next()}var zs=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=$s()},t}();var Gs=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=Bs(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,r=function(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 zs,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 Ss(r)}(t,e);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var i=n.toString(16),a=i.length,o=0;o<2*e-a;o++)i="0"+i;return i},t.prototype.setPrivate=function(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=Bs(t,16),this.e=parseInt(e,16),this.d=Bs(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=Bs(t,16),this.e=parseInt(e,16),this.d=Bs(r,16),this.p=Bs(n,16),this.q=Bs(i,16),this.dmp1=Bs(a,16),this.dmq1=Bs(o,16),this.coeff=Bs(s,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var r=new zs,n=t>>1;this.e=parseInt(e,16);for(var i=new Ss(e,16);;){for(;this.p=new Ss(t-n,1,r),0!=this.p.subtract(Ss.ONE).gcd(i).compareTo(Ss.ONE)||!this.p.isProbablePrime(10););for(;this.q=new Ss(n,1,r),0!=this.q.subtract(Ss.ONE).gcd(i).compareTo(Ss.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(Ss.ONE),s=this.q.subtract(Ss.ONE),c=o.multiply(s);if(0==c.gcd(i).compareTo(Ss.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=Bs(t,16),r=this.doPrivate(e);return null==r?null:function(t,e){var r=t.toByteArray(),n=0;for(;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;++n;for(;0!=r[n];)if(++n>=r.length)return null;var i="";for(;++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}(r,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,r){var n=new zs,i=t>>1;this.e=parseInt(e,16);var a=new Ss(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(Ss.ONE),n=o.q.subtract(Ss.ONE),i=e.multiply(n);0==i.gcd(a).compareTo(Ss.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=Cs(),o.q.fromNumberAsync(i,1,n,(function(){o.q.subtract(Ss.ONE).gcda(a,(function(t){0==t.compareTo(Ss.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(c,0)}))}))},u=function(){o.p=Cs(),o.p.fromNumberAsync(t-i,1,n,(function(){o.p.subtract(Ss.ONE).gcda(a,(function(t){0==t.compareTo(Ss.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=function(t){return Ks[t]||""}(r),i=function(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 Bs("0001"+n+"00"+t,16)}(n+e(t).toString(),this.n.bitLength()/4);if(null==i)return null;var a=this.doPrivate(i);if(null==a)return null;var o=a.toString(16);return 0==(1&o.length)?o:"0"+o},t.prototype.verify=function(t,e,r){var n=Bs(e,16),i=this.doPublic(n);return null==i?null:function(t){for(var e in Ks)if(Ks.hasOwnProperty(e)){var r=Ks[e],n=r.length;if(t.substr(0,n)==r)return t.substr(n)}return t}
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
|
4
4
|
Code licensed under the BSD License:
|
|
5
5
|
http://developer.yahoo.com/yui/license.html
|
|
6
6
|
version: 2.9.0
|
|
7
|
-
*/(i.toString(16).replace(/^1f+00/,""))==r(t).toString()},t}();var
|
|
7
|
+
*/(i.toString(16).replace(/^1f+00/,""))==r(t).toString()},t}();var Ks={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};var Ws={};Ws.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),r){var i;for(i in r)t.prototype[i]=r[i];var a=function(){},o=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(a=function(t,e){for(i=0;i<o.length;i+=1){var r=o[i],n=e[r];"function"==typeof n&&n!=Object.prototype[r]&&(t[r]=n)}})}catch(t){}a(t.prototype,r)}}};
|
|
8
8
|
/**
|
|
9
9
|
* @fileOverview
|
|
10
10
|
* @name asn1-1.0.js
|
|
@@ -13,4 +13,4 @@ var Paystack=function(t){"use strict";var e="undefined"!=typeof globalThis?globa
|
|
|
13
13
|
* @since jsrsasign 2.1
|
|
14
14
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
15
15
|
*/
|
|
16
|
-
var Ys={};void 0!==Ys.asn1&&Ys.asn1||(Ys.asn1={}),Ys.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 xs(n,16).xor(t).add(xs.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=Ys.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 w=T[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new r(t[w]);if("int"==w)return new n(t[w]);if("bitstr"==w)return new i(t[w]);if("octstr"==w)return new a(t[w]);if("null"==w)return new o(t[w]);if("oid"==w)return new s(t[w]);if("enum"==w)return new c(t[w]);if("utf8str"==w)return new u(t[w]);if("numstr"==w)return new h(t[w]);if("prnstr"==w)return new l(t[w]);if("telstr"==w)return new d(t[w]);if("ia5str"==w)return new p(t[w]);if("utctime"==w)return new f(t[w]);if("gentime"==w)return new g(t[w]);if("seq"==w){for(var S=t[w],A=[],E=0;E<S.length;E++){var x=b(S[E]);A.push(x)}return new m({array:A})}if("set"==w){for(S=t[w],A=[],E=0;E<S.length;E++){x=b(S[E]);A.push(x)}return new y({array:A})}if("tag"==w){var k=t[w];if("[object Array]"===Object.prototype.toString.call(k)&&3==k.length){var C=b(k[2]);return new v({tag:k[0],explicit:k[1],obj:C})}var B={};if(void 0!==k.explicit&&(B.explicit=k.explicit),void 0!==k.tag&&(B.tag=k.tag),void 0===k.obj)throw"obj shall be specified for 'tag'.";return B.obj=b(k.obj),new v(B)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},Ys.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);if(n+=a.substr(1,7),"0"==a.substr(0,1))e=e+"."+new xs(n,2).toString(10),n=""}return e},Ys.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 xs(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";n=a+n;for(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},Ys.asn1.ASN1Object=function(){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="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+r).toString(16)+e},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""}},Ys.asn1.DERAbstractString=function(t){Ys.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))},Js.lang.extend(Ys.asn1.DERAbstractString,Ys.asn1.ASN1Object),Ys.asn1.DERAbstractTime=function(t){Ys.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}},Js.lang.extend(Ys.asn1.DERAbstractTime,Ys.asn1.ASN1Object),Ys.asn1.DERAbstractStructured=function(t){Ys.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)},Js.lang.extend(Ys.asn1.DERAbstractStructured,Ys.asn1.ASN1Object),Ys.asn1.DERBoolean=function(){Ys.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Js.lang.extend(Ys.asn1.DERBoolean,Ys.asn1.ASN1Object),Ys.asn1.DERInteger=function(t){Ys.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Ys.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new xs(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))},Js.lang.extend(Ys.asn1.DERInteger,Ys.asn1.ASN1Object),Ys.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Ys.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}Ys.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))},Js.lang.extend(Ys.asn1.DERBitString,Ys.asn1.ASN1Object),Ys.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Ys.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}Ys.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Js.lang.extend(Ys.asn1.DEROctetString,Ys.asn1.DERAbstractString),Ys.asn1.DERNull=function(){Ys.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Js.lang.extend(Ys.asn1.DERNull,Ys.asn1.ASN1Object),Ys.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 xs(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";n=a+n;for(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};Ys.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=Ys.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))},Js.lang.extend(Ys.asn1.DERObjectIdentifier,Ys.asn1.ASN1Object),Ys.asn1.DEREnumerated=function(t){Ys.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Ys.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new xs(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))},Js.lang.extend(Ys.asn1.DEREnumerated,Ys.asn1.ASN1Object),Ys.asn1.DERUTF8String=function(t){Ys.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Js.lang.extend(Ys.asn1.DERUTF8String,Ys.asn1.DERAbstractString),Ys.asn1.DERNumericString=function(t){Ys.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Js.lang.extend(Ys.asn1.DERNumericString,Ys.asn1.DERAbstractString),Ys.asn1.DERPrintableString=function(t){Ys.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Js.lang.extend(Ys.asn1.DERPrintableString,Ys.asn1.DERAbstractString),Ys.asn1.DERTeletexString=function(t){Ys.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Js.lang.extend(Ys.asn1.DERTeletexString,Ys.asn1.DERAbstractString),Ys.asn1.DERIA5String=function(t){Ys.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Js.lang.extend(Ys.asn1.DERIA5String,Ys.asn1.DERAbstractString),Ys.asn1.DERUTCTime=function(t){Ys.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))},Js.lang.extend(Ys.asn1.DERUTCTime,Ys.asn1.DERAbstractTime),Ys.asn1.DERGeneralizedTime=function(t){Ys.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))},Js.lang.extend(Ys.asn1.DERGeneralizedTime,Ys.asn1.DERAbstractTime),Ys.asn1.DERSequence=function(t){Ys.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}},Js.lang.extend(Ys.asn1.DERSequence,Ys.asn1.DERAbstractStructured),Ys.asn1.DERSet=function(t){Ys.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)},Js.lang.extend(Ys.asn1.DERSet,Ys.asn1.DERAbstractStructured),Ys.asn1.DERTaggedObject=function(t){Ys.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)))},Js.lang.extend(Ys.asn1.DERTaggedObject,Ys.asn1.ASN1Object);var Qs,tc=(Qs=function(t,e){return Qs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Qs(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}Qs(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ec=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 tc(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)?ds(t):ps.unarmor(t),i=ws.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){e=i.sub[1].getHexStringValue(),this.n=Ps(e,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=i.sub[3].getHexStringValue();this.d=Ps(a,16);var o=i.sub[4].getHexStringValue();this.p=Ps(o,16);var s=i.sub[5].getHexStringValue();this.q=Ps(s,16);var c=i.sub[6].getHexStringValue();this.dmp1=Ps(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=Ps(u,16);var h=i.sub[8].getHexStringValue();this.coeff=Ps(h,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var l=i.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=Ps(e,16),r=l.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else e=i.sub[0].getHexStringValue(),this.n=Ps(e,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new Ys.asn1.DERInteger({int:0}),new Ys.asn1.DERInteger({bigint:this.n}),new Ys.asn1.DERInteger({int:this.e}),new Ys.asn1.DERInteger({bigint:this.d}),new Ys.asn1.DERInteger({bigint:this.p}),new Ys.asn1.DERInteger({bigint:this.q}),new Ys.asn1.DERInteger({bigint:this.dmp1}),new Ys.asn1.DERInteger({bigint:this.dmq1}),new Ys.asn1.DERInteger({bigint:this.coeff})]};return new Ys.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return us(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new Ys.asn1.DERSequence({array:[new Ys.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new Ys.asn1.DERNull]}),e=new Ys.asn1.DERSequence({array:[new Ys.asn1.DERInteger({bigint:this.n}),new Ys.asn1.DERInteger({int:this.e})]}),r=new Ys.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new Ys.asn1.DERSequence({array:[t,r]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return us(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}(Xs),rc=process.env.npm_package_version,nc=function(){function t(t){void 0===t&&(t={}),t=t||{},this.default_key_size=t.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 ec(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(hs(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return us(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,r){try{return us(this.getKey().sign(t,e,r))}catch(t){return!1}},t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,hs(e),r)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new ec,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=rc,t}();function ic(t){const e=new nc;return e.setPublicKey(na.publicKey),e.encrypt(t)}var ac=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 oc=function(t){return t?JSON.parse(JSON.stringify(t)):null};var sc=function(t){return"string"==typeof t||t instanceof String};var cc=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)},uc=oc,hc=cc;var lc,dc=function(t,e,r){var n,i,a,o;for(n=0;n<e.patterns.length;n++)if(i=e.patterns[n],hc(t,i)){o=uc(e),a=Array.isArray(i)?String(i[0]).length:String(i).length,t.length>=a&&(o.matchStrength=a),r.push(o);break}},pc={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,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],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}}},fc=oc,gc=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=sc,yc=dc,vc={},bc={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"},Tc=[bc.VISA,bc.MASTERCARD,bc.AMERICAN_EXPRESS,bc.DINERS_CLUB,bc.DISCOVER,bc.JCB,bc.UNIONPAY,bc.MAESTRO,bc.ELO,bc.MIR,bc.HIPER,bc.HIPERCARD];function wc(t){return vc[t]||pc[t]}function Sc(t,e){var r=lc.indexOf(t);if(!e&&-1===r)throw new Error('"'+t+'" is not a supported card type.');return r}function Ac(t){var e,r=[];return mc(t)?0===t.length?lc.map((function(t){return fc(wc(t))})):(lc.forEach((function(e){var n=wc(e);yc(t,n,r)})),(e=gc(r))?[e]:r):[]}lc=fc(Tc),Ac.getTypeInfo=function(t){return fc(wc(t))},Ac.removeCard=function(t){var e=Sc(t);lc.splice(e,1)},Ac.addCard=function(t){var e=Sc(t.type,!0);vc[t.type]=t,-1===e&&lc.push(t.type)},Ac.updateCard=function(t,e){var r,n=vc[t]||pc[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=fc(n),Object.keys(r).forEach((function(t){e[t]&&(r[t]=e[t])})),vc[r.type]=r},Ac.changeOrder=function(t,e){var r=Sc(t);lc.splice(r,1),lc.splice(e,0,t)},Ac.resetModifications=function(){lc=fc(Tc),vc={}},Ac.types=bc;var Ec=Ac,xc=ac,kc=Ec;function Cc(t,e,r){return{card:t,isPotentiallyValid:e,isValid:r}}var Bc=function(t,e){var r,n,i,a,o;if(e=e||{},"number"==typeof t&&(t=String(t)),"string"!=typeof t)return Cc(null,!1,!1);if(t=t.replace(/\-|\s/g,""),!/^\d*$/.test(t))return Cc(null,!1,!1);if(0===(r=kc(t)).length)return Cc(null,!1,!1);if(1!==r.length)return Cc(null,!0,!1);if(n=r[0],e.maxLength&&t.length>e.maxLength)return Cc(n,!1,!1);for(i=n.type===kc.types.UNIONPAY&&!0!==e.luhnValidateUnionPay||xc(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 Cc(n,t.length<o||i,i);return Cc(n,t.length<o,!1)};function Oc(t,e,r){return{isValid:t,isPotentiallyValid:e,isCurrentYear:r||!1}}var Dc=function(t,e){var r,n,i,a,o;return e=e||19,"string"!=typeof t?Oc(!1,!1):""===t.replace(/\s/g,"")?Oc(!1,!0):/^\d*$/.test(t)?(n=t.length)<2?Oc(!1,!0):(r=(new Date).getFullYear(),3===n?Oc(!1,t.slice(0,2)===String(r).slice(0,2)):n>4?Oc(!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),Oc(a,a,o))):Oc(!1,!1)},Pc=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Rc=Dc,Ic=Pc;function Nc(t,e,r){return{isValid:t,isPotentiallyValid:e,isValidForThisYear:r||!1}}var Lc=function(t){var e,r,n=(new Date).getMonth()+1;return"string"!=typeof t?Nc(!1,!1):""===t.replace(/\s/g,"")||"0"===t?Nc(!1,!0):/^\d*$/.test(t)?(e=parseInt(t,10),isNaN(t)?Nc(!1,!1):Nc(r=e>0&&e<13,r,r&&e>=n)):Nc(!1,!1)},Mc=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)),Ic(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),Rc(i).isPotentiallyValid?1:2):5===n.length?1:n.length>5?2:1,{month:e=t.substr(0,r),year:t.substr(e.length)})},_c=Lc,Vc=Dc;function jc(t,e,r,n){return{isValid:t,isPotentiallyValid:e,month:r,year:n}}function Uc(t,e){return{isValid:t,isPotentiallyValid:e}}function Fc(t,e){return{isValid:t,isPotentiallyValid:e}}var qc={number:Bc,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=Mc(t);else{if(null===t||"object"!=typeof t)return jc(!1,!1,null,null);r={month:String(t.month),year:String(t.year)}}if(n=_c(r.month),i=Vc(r.year,e),n.isValid){if(i.isCurrentYear)return jc(a=n.isValidForThisYear,a,r.month,r.year);if(i.isValid)return jc(!0,!0,r.month,r.year)}return n.isPotentiallyValid&&i.isPotentiallyValid?jc(!1,!0,null,null):jc(!1,!1,null,null)},expirationMonth:Lc,expirationYear:Dc,cvv:function(t,e){return e=(e=e||3)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=3,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?Fc(!1,!1):t.length<r?Fc(!1,!0):Fc(!0,!0)},creditCardType:Ec},Hc=[{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"}];qc.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}}),qc.creditCardType.changeOrder("verve",0);class $c{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 this.pin?ic(this.pin):void 0}getLast4(){return this.number.substring(this.number.length-4)}tokenize(){return ic(`${this.number}*${this.cvv}*${this.month}*${this.year}`)}static getType(t){const e=qc.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}}static validate(t){let{number:e,cvv:r,month:n,year:i}=t;const{type:a}=$c.getType(e),o={number:$c.isNumberValid(e),expiry:$c.isExpiryValid({month:n,year:i}),cvv:$c.isCvvValid(r,a)};return{isValid:Object.values(o).every((t=>!0===t)),result:o}}static validateNumber(t){return qc.number(t)}static isNumberValid(t){return $c.validateNumber(t).isValid}static validateCVV(t,e){const r="american-express"===e?4:3;return qc.cvv(t,r)}static isCvvValid(t,e){return $c.validateCVV(t,e).isValid}static validateExpiry(t){if("object"==typeof t){const{month:e,year:r}=t;return qc.expirationMonth(e)&&qc.expirationYear(r)}return qc.expirationDate(t)}static isExpiryValid(t){return $c.validateExpiry(t).isValid}static generateTestCard(t){const e=t||"default",r=Hc.find((t=>t.type===e));return new $c(r)}}const zc={charge(t){let{clientdata:e,last4:r,pin:n,trans:i,device:a,rememberCard:o,transactionType:s,subscription:c,customFields:u}=t;const h=`${na.paymentBaseUrl}charge/`,l=Vo(),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=Ho(p);return _o.post(h,f,{headers:d}).then((t=>aa.parse(t.data)))},resumeCardCharge(t){let{device:e,accessCode:r,pin:n}=t;const i=`${na.paymentBaseUrl}charge/resume/${r}`,a=Vo(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s={device:e,...n&&{handle:n}},c=Ho(s);return _o.post(i,c,{headers:o}).then((t=>aa.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=`${na.paymentBaseUrl}charge/`,h=Vo(),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=Ho(d);return _o.post(u,p,{headers:l}).then((t=>aa.parse(t.data)))},authenticate(t,e){const r=`${na.paymentBaseUrl}charge/validate`,n={trans:t,token:e},i=Vo(),a={...i&&{"Accept-Language":i}},o=Ho(n);return _o.post(r,o,{headers:a}).then((t=>aa.parse(t.data)))},verifyAddress(t){let{address:e,city:r,state:n,zipCode:i,transactionId:a}=t;const o=`${na.paymentBaseUrl}charge/avs`,s=Vo(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u=Ho({city:r,state:n,address:e,zip_code:i,trans:a});return _o.post(o,u,{headers:c}).then((t=>aa.parse(t.data)))},forgetRememberedCard(t){let{authorizationId:e,publicKey:r}=t;const n=Vo(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}},a={authorization_id:e},o=`${na.paystackApiUrl}rememberme/forget_card`;return _o.post(o,a,{headers:i}).then((t=>aa.parse(t.data)))}},Gc="card";function Kc(t,e){return new Promise(((r,n)=>{const i=$c.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 Wc={setCard(t){return Kc(t,!0).then((()=>{this.card=new $c(t)}))},rememberCard(){this.remember_card=!0},chargeCard(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Kc(this.card).then((()=>{this.logAttempt(Gc);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 zc.charge(e).then((t=>(this.logAPIResponse(t,Gc),t)))}))},chargeRememberedCard(t){let{cvv:e,authorizationCode:r,cardLast4:n,pin:i}=t;this.logAttempt(Gc);const a=ic(i),o={authorizationCode:r,cvv:e,last4:n,trans:this.id,device:this.deviceFingerprint,pin:a,transactionType:this.transactionType,subscription:this.subscription};return zc.chargeRememberedCard(o).then((t=>(this.logAPIResponse(t,Gc),t)))},resumeCardCharge(t){let{accessCode:e,pin:r}=t;const n={...r&&{pin:ic(r)},accessCode:e,device:this.deviceFingerprint};return zc.resumeCardCharge(n).then((t=>(this.logAPIResponse(t,Gc),t)))},forgetRememberedCard(t){const e={authorizationId:t,publicKey:this.merchant.key};return zc.forgetRememberedCard(e).then((t=>(this.logAPIResponse(t,Gc),t)))},authenticateCard(t){return zc.authenticate(this.id,t).then((t=>(this.logAPIResponse(t,Gc),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 zc.verifyAddress(a).then((t=>(this.logAPIResponse(t,Gc),t)))},listenFor3DSCharge(t){const e={channel:`3DS_${this.id}`,paymentMethod:Gc};return this.listenForCharge(e,t)}};class Xc{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()"),Xc.types.indexOf(r)>-1?"nuban"!==r||Xc.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=`${na.paymentBaseUrl}bank?pay_with_bank=true`,e=Vo(),r={...e&&{"Accept-Language":e}};return _o.post(t,{headers:r}).then((t=>t.data))}}Xc.types=["nuban"];const Zc={verify(t){let{bankId:e,transactionId:r,accountNumber:n,device:i}=t;const a=`${na.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=Vo(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=Ho({account_number:n,device:i});return _o.post(a,c,{headers:s}).then((t=>aa.parse(t.data)))},register(t){let{bankId:e,transactionId:r,accountNumber:n,birthday:i}=t;const a=`${na.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=Vo(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=Ho({account_number:n,birthday:i});return _o.post(a,c,{headers:s}).then((t=>aa.parse(t.data)))},authenticate(t){let{bankId:e,transactionId:r,token:n,device:i}=t;const a=`${na.paymentBaseUrl}bank/validate_token/${e}/${r}`,o=Vo(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=Ho({device:i,token:n});return _o.post(a,c,{headers:s}).then((t=>aa.parse(t.data)))}},Jc="bank account";function Yc(t,e){return new Promise(((r,n)=>{const i=Xc.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 Qc={charge(t){let{bankId:e,transactionId:r,phoneNumber:n,token:i,accountNumber:a}=t;const o=`${na.paymentBaseUrl}bank/digitalbankmandate/${e}/${r}`,s=Vo(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u={..."sterling-bank"==={16:"sterling-bank",62:"kuda-bank"}[e]?{account_number:a}:{phone_number:n},token:i},h=Ho(u);return _o.post(o,h,{headers:c}).then((t=>aa.parse(t.data)))}},tu="bank",eu={chargeDigitalBankMandate(t){let{phoneNumber:e,token:r,bankId:n,accountNumber:i}=t;const a={transactionId:this.id,phoneNumber:e,token:r,bankId:n,accountNumber:i};return Qc.charge(a).then((t=>(this.logAPIResponse(t,tu),t)))},listenForDigitalBankMandateCharge(t){const e={paymentMethod:tu,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}},ru={...{setBankAccount(t){return Yc(t,!0).then((()=>{this.bankAccount=new Xc(t)}))},chargeBankAccount(){return Yc(this.bankAccount).then((()=>{this.logAttempt(Jc);const t={bankId:this.bankAccount.bankId,transactionId:this.id,accountNumber:this.bankAccount.accountNumber,device:this.deviceFingerprint};return Zc.verify(t).then((t=>(this.logAPIResponse(t,Jc),t)))}))},registerBankAccount(t){return Yc(this.bankAccount).then((()=>{const e={bankId:this.bankAccount.bankId,transactionId:this.id,accountNumber:this.bankAccount.accountNumber,birthday:t};return Zc.register(e).then((t=>(this.logAPIResponse(t,Jc),t)))}))},authenticateBankAccount(t){return Yc(this.bankAccount).then((()=>{const e={bankId:this.bankAccount.bankId,transactionId:this.id,token:t,device:this.deviceFingerprint};return Zc.authenticate(e).then((t=>(this.logAPIResponse(t,Jc),t)))}))}},...{getIbankUrl(t){let{bankId:e}=t;return new Promise(((t,r)=>{e||r(Error("Please send bankId"));const n=`${na.paymentBaseUrl}bank/ibank/${e}/${this.id}`;t(aa.success({url:n}))}))},listenForIbankCharge(t){const e={channel:`IBANK_${this.id}`,paymentMethod:"ibank"};return this.listenForCharge(e,t)}},...eu},nu={generateShortcode(t,e){const r=Vo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return _o.post(`${na.paystackApiUrl}checkout/ussd/reference`,t,{headers:n}).then((t=>aa.parse(t.data)))},generatePWTUSSDShortcode(t,e){const r=Vo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return _o.post(`${na.paystackApiUrl}checkout/pay_with_transfer_ussd`,t,{headers:n}).then((t=>aa.parse(t.data)))}};var iu={getUSSDShortcode(t){let{channel:e}=t;const r={transaction:this.id,channel:e};return nu.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 nu.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 au={generateQrCode(t,e){let{transaction:r,channel:n}=t;const i={source:"checkout",reference:r,channel:n},a=Vo(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return _o.post(`${na.paystackApiUrl}offline/qr/generate`,i,{headers:o}).then((t=>aa.parse(t.data)))}};function ou(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 su={getQRCode(t){let{channel:e}=t;return ou(e).then((()=>{if(this.qr[e])return this.qr[e];const t={transaction:this.id,channel:e};return au.generateQrCode(t,this.merchant.key).then((t=>("success"===t.status&&(this.qr[e]=t),t)))}))},listenForQRCharge(t,e){let{channel:r}=t;return ou(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 cu{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 cu.hasCountryCode(t)||e.push("Number should include country code prefix"),cu.hasOnlyDigits(t)||e.push("Number should contain only digits"),cu.isE164Number(t)||e.push("Number should not be longer than 16 digits"),{isValid:0===e.length,errors:e}}}const uu={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=Vo(),h={...u&&{"Accept-Language":u}};return _o.post(`${na.paystackApiUrl}charge/mobile_money`,c,{headers:h}).then((t=>aa.parse(t.data))).catch((t=>{const e=t.response&&t.response.data;let r={};return e&&(r={...e,errors:e}),aa.parse(r||t)}))}};var hu={chargeMobileMoney(t){let{phoneNumber:e,provider:r,voucher:n,registrationToken:i,numberOfTokenRequests:a}=t;return function(t){return new Promise(((e,r)=>{const n=cu.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)}))}(e).then((()=>{a?this.logTokenRequest("mobile money",a):i?this.logTokenSubmitted("mobile money"):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 uu.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.errors&&t.errors.data&&"awaiting_registration_token"===t.errors.data.status?this.logTokenAuthenticationFailure(t.message):this.logError(t.message),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 lu={verify(t,e){const r=`${na.paystackApiUrl}checkout/pay_with_phone/verify`,n=Vo(),i={Authorization:`Bearer ${e}`,...n&&{"Accept-Language":n}};return _o.post(r,{phone:t},{headers:i}).then((t=>t.data))},deleteCard(t,e,r){const n=`${na.paystackApiUrl}checkout/pay_with_phone/remove_card`,i=Vo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return _o.post(n,{phone:t,id:r},{headers:a}).then((t=>t.data))},authenticateOtp(t,e,r,n){const i=`${na.paystackApiUrl}checkout/pay_with_phone/validate_otp`,a=Vo(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return _o.post(i,{phone:t,otp:r,transaction:n},{headers:o}).then((t=>t.data))},authenticatePin(t,e,r,n){const i=`${na.paystackApiUrl}checkout/pay_with_phone/validate_pin`,a=Vo(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return _o.post(i,{phone:t,pin:r,transaction:n},{headers:o}).then((t=>t.data))},setPin(t,e,r,n,i){const a=Vo(),o=`${na.paystackApiUrl}checkout/pay_with_phone/set_pin`,s={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return _o.post(o,{phone:t,token:r,transaction:n,pin:i},{headers:s}).then((t=>t.data))},charge(t,e,r,n,i,a){const o=`${na.paystackApiUrl}checkout/pay_with_phone/charge`,s=Vo(),c={Authorization:`Bearer ${e}`,...s&&{"Accept-Language":s}};return _o.post(o,{id:t,token:r,cvv:i,transaction:n,phone:a},{headers:c}).then((t=>t.data))},enrollPhoneNumber(t,e,r){const n=`${na.paystackApiUrl}checkout/pay_with_phone/enroll`,i=Vo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return _o.post(n,{phone:t,transaction:r},{headers:a}).then((t=>t.data))}};function du(t){return new Promise(((e,r)=>{const n=cu.validate(t);if(!n.isValid){const e=t?n.errors[0]:"Please set a valid customer with Transaction.setCustomer()";r(Error(e))}e(n)}))}var pu={setCustomer(t){let{phoneNumber:e}=t;return du(e).then((()=>{this.customer=e}))},verifyCustomer(){return du(this.customer).then((()=>lu.verify(this.customer,this.merchant.key)))},deleteSavedCard(t){return du(this.customer).then((()=>lu.deleteCard(this.customer,this.merchant.key,t)))},authenticateCustomerOtp(t){return du(this.customer).then((()=>lu.authenticateOtp(this.customer,this.merchant.key,t,this.id)))},authenticateCustomerPin(t){return du(this.customer).then((()=>lu.authenticatePin(this.customer,this.merchant.key,t,this.id)))},setCustomerPin(t){let{pin:e,token:r}=t;return du(this.customer).then((()=>lu.setPin(this.customer,this.merchant.key,r,this.id,e)))},chargeSavedCard(t){let{cardId:e,token:r,cvv:n}=t;return du(this.customer).then((()=>lu.charge(e,this.merchant.key,r,this.id,n,this.customer)))},enrollPhoneNumber(t){return du(this.customer).then((()=>lu.enrollPhoneNumber(t,this.merchant.key,this.id)))}};const fu={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r},i=Vo(),a={...i&&{"Accept-Language":i}};return _o.post(`${na.paystackApiUrl}login`,n,{headers:a}).then((t=>aa.parse(t.data)))},charge(t){let{account_code:e,transaction:r,token:n}=t;const i=Vo(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={account_code:e,transaction:r};return _o.post(`${na.paystackApiUrl}directdebit/initiate`,o,{headers:a}).then((t=>aa.parse(t.data)))},authenticate(t){let{otp:e,transaction:r,token:n}=t;const i=Vo(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={otp:e,transaction:r};return _o.post(`${na.paystackApiUrl}directdebit/validate`,o,{headers:a}).then((t=>aa.parse(t.data)))},getProvisionedAccounts(t){const e=Vo(),r={Authorization:`Bearer ${t}`,"jwt-auth":!0,...e&&{"Accept-Language":e}};return _o.get(`${na.paystackApiUrl}directdebit/account`,{headers:r}).then((t=>t.data))}},gu="direct debit";var mu={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r};return qi(e)?fu.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(gu);const e={account_code:t,transaction:this.id,token:this.directDebit.token};return fu.charge(e).then((t=>(this.logAPIResponse(t,gu),t.status&&(this.directDebit.chargeResponse=t),t)))},getProvisionedAccounts(){return fu.getProvisionedAccounts(this.directDebit.token).then((t=>{this.logAPIResponse(t,gu);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 fu.authenticate(e).then((t=>(this.logAPIResponse(t,gu),t)))}},yu={get:t=>({card:Wc,bank:ru,ussd:iu,qr:su,mobile_money:hu,phone:pu,direct_debit:mu,bank_transfer:Fo,eft:Ko,payattitude:Go,apple_pay:Zo,paypal:Qo}[t])},vu=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 bu={saveLog(t,e,r){const n=`${na.paystackApiUrl}transaction/update_log/${t}`,i=Vo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return _o.post(n,{payload:JSON.stringify(r)},{headers:a}).then((t=>t.data))},getIp(){const t=Vo(),e={...t&&{"Accept-Language":t}};return _o.get("https://api.paystack.co/decision/ip",{headers:e}).then((t=>t.data.data.ip_address))},saveIp(t,e){const r=`${na.paystackApiUrl}transaction/set_ip/${t}`,n=Vo(),i={Authorization:`Bearer ${e}`,...n&&{"Accept-Language":n}};return _o.post(r,null,{headers:i}).then((t=>t.data))},saveReferrer(t,e,r){const n=`${na.paystackApiUrl}transaction/set_referrer/${t}`,i=Vo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return _o.post(n,{referrer:r},{headers:a}).then((t=>t.data))}};var Tu={initializeLog(t){const{attempts:e,authentication:r,errors:n,history:i}=t||{};this.log={start_time:Math.round(Date.now()/1e3),time_spent:0,attempts:e||0,authentication:r,errors:n||0,success:!1,mobile:vu(),input:[],history:i||[]}},getTimeSpent(){const t=Math.round(Date.now()/1e3);return this.log.time_spent=t-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()},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}},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){let e="Error";return t&&(e+=`: ${t}`),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()},saveLog(){return bu.saveLog(this.id,this.merchant.key,this.log)},saveIpAddress(){return bu.saveIp(this.id,this.merchant.key)},saveReferrer(t){return bu.saveReferrer(this.id,this.merchant.key,t)}};class wu{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=["apple_pay"].concat(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.elevyPercentage=t.elevy_percentage||null,this.subscription=t.subscription||null,this.planDetails=t.plan_details||null,window?new Promise(((t,e)=>{const r=new XMLHttpRequest;r.open("GET",na.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")),this.log=null,Object.assign(this,Tu),this.initializeLog(t.log),this.saveIpAddress(),this.channels.forEach((t=>{const e=yu.get(t);Object.assign(this,e)})),this.channels.includes("ussd")&&!this.channels.includes("bank_transfer")&&Object.assign(this,yu.get("bank_transfer")),"GHS"===t.currency&&t.elevy_percentage&&(this.elevyPercentage=t.elevy_percentage)}setMetadata(t,e){this.metadata[t]=e}setDevice(t){this.deviceFingerprint?Ji("Device ID has already been set by Checkout JS so there's no need to set this again"):this.deviceFingerprint=t}listenForCharge(t,e){const{channel:r,paymentMethod:n}=t;let i;window&&window.Pusher&&(i=new window.Pusher(na.pusherKey,{cluster:"eu",disableStats:!0}));const a={status:"error",message:"We could not listen for charge response. Use transaction.requery() to check the status."},o=()=>{i.unsubscribe(r)};if(!i)return e({status:"error",message:"We could not listen for charge response."},ia);const s=i.subscribe(r);s.bind("pusher:subscription_succeeded",(()=>{this.isListening=!0})),s.bind("pusher:subscription_error",(()=>{this.isListening=!1,e(a,ia)})),s.bind("response",(t=>{const r=aa.parse(t);this.logAPIResponse(r,n),e(r,o)}))}requery(){return jo.requery(this.id)}markAsAbandoned(){return jo.markAsAbandoned({publicKey:this.merchant.key,transactionId:this.id})}}const Su={validate(t){const e=function(t){const e=[];return t&&"object"==typeof t?(Object.keys(zi).forEach((r=>{const n=zi[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 Fi(e,t)}},async request(t){const e=await Yi(),r=await jo.requestInline({...t,device:e});return r&&Object.seal(new wu({...r.data,deviceFingerprint:e}))},async requestWithAccessCode(t){const e=await Yi(),r=await jo.requestStandard(t);return r&&Object.seal(new wu({...r.data,deviceFingerprint:e}))},async getByAccessCode(t,e){const r=await Yi(),n=await jo.getByAccessCode(t,e);return n&&Object.seal(new wu({...n.data,deviceFingerprint:r}))},initialize:t=>Object.seal(new wu(t)),async verify(t){const e=await jo.verify(t);return e&&e.data}},Au={fetchBanks(t){const e=`${na.paystackApiUrl}bank`,r=Vo(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return _o.get(e,n).then((t=>t.data))},fetchResolutions(){const t=`${na.paystackApiUrl}checkout/resolutions`,e=Vo(),r={...e&&{"Accept-Language":e}};return _o.get(t,{headers:r}).then((t=>t.data))},fetchCelebrations(){const t=`${na.paystackApiUrl}checkout/celebrations`,e=Vo(),r={...e&&{"Accept-Language":e}};return _o.get(t,{headers:r}).then((t=>t.data))},fetchStates(t){const e=`${na.paystackApiUrl}address_verification/states`,r=Vo(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return _o.get(e,n).then((t=>t.data))}};return t.BankAccount=Xc,t.Card=$c,t.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=Au.fetchBanks(e||{pay_with_bank:"1"});break;case"resolutions":r=Au.fetchResolutions();break;case"celebrations":r=Au.fetchCelebrations();break;case"states":r=Au.fetchStates(e)}return r}},t.Transaction=Su,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
16
|
+
var Xs={};void 0!==Xs.asn1&&Xs.asn1||(Xs.asn1={}),Xs.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 Ss(n,16).xor(t).add(Ss.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=Xs.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 w=T[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new r(t[w]);if("int"==w)return new n(t[w]);if("bitstr"==w)return new i(t[w]);if("octstr"==w)return new a(t[w]);if("null"==w)return new o(t[w]);if("oid"==w)return new s(t[w]);if("enum"==w)return new c(t[w]);if("utf8str"==w)return new u(t[w]);if("numstr"==w)return new h(t[w]);if("prnstr"==w)return new l(t[w]);if("telstr"==w)return new d(t[w]);if("ia5str"==w)return new p(t[w]);if("utctime"==w)return new f(t[w]);if("gentime"==w)return new g(t[w]);if("seq"==w){for(var S=t[w],A=[],E=0;E<S.length;E++){var x=b(S[E]);A.push(x)}return new m({array:A})}if("set"==w){for(S=t[w],A=[],E=0;E<S.length;E++){x=b(S[E]);A.push(x)}return new y({array:A})}if("tag"==w){var k=t[w];if("[object Array]"===Object.prototype.toString.call(k)&&3==k.length){var C=b(k[2]);return new v({tag:k[0],explicit:k[1],obj:C})}var B={};if(void 0!==k.explicit&&(B.explicit=k.explicit),void 0!==k.tag&&(B.tag=k.tag),void 0===k.obj)throw"obj shall be specified for 'tag'.";return B.obj=b(k.obj),new v(B)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},Xs.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);if(n+=a.substr(1,7),"0"==a.substr(0,1))e=e+"."+new Ss(n,2).toString(10),n=""}return e},Xs.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 Ss(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";n=a+n;for(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},Xs.asn1.ASN1Object=function(){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="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+r).toString(16)+e},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""}},Xs.asn1.DERAbstractString=function(t){Xs.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))},Ws.lang.extend(Xs.asn1.DERAbstractString,Xs.asn1.ASN1Object),Xs.asn1.DERAbstractTime=function(t){Xs.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}},Ws.lang.extend(Xs.asn1.DERAbstractTime,Xs.asn1.ASN1Object),Xs.asn1.DERAbstractStructured=function(t){Xs.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)},Ws.lang.extend(Xs.asn1.DERAbstractStructured,Xs.asn1.ASN1Object),Xs.asn1.DERBoolean=function(){Xs.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Ws.lang.extend(Xs.asn1.DERBoolean,Xs.asn1.ASN1Object),Xs.asn1.DERInteger=function(t){Xs.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Xs.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new Ss(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))},Ws.lang.extend(Xs.asn1.DERInteger,Xs.asn1.ASN1Object),Xs.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Xs.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}Xs.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))},Ws.lang.extend(Xs.asn1.DERBitString,Xs.asn1.ASN1Object),Xs.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Xs.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}Xs.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Ws.lang.extend(Xs.asn1.DEROctetString,Xs.asn1.DERAbstractString),Xs.asn1.DERNull=function(){Xs.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Ws.lang.extend(Xs.asn1.DERNull,Xs.asn1.ASN1Object),Xs.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 Ss(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";n=a+n;for(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};Xs.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=Xs.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))},Ws.lang.extend(Xs.asn1.DERObjectIdentifier,Xs.asn1.ASN1Object),Xs.asn1.DEREnumerated=function(t){Xs.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Xs.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new Ss(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))},Ws.lang.extend(Xs.asn1.DEREnumerated,Xs.asn1.ASN1Object),Xs.asn1.DERUTF8String=function(t){Xs.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Ws.lang.extend(Xs.asn1.DERUTF8String,Xs.asn1.DERAbstractString),Xs.asn1.DERNumericString=function(t){Xs.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Ws.lang.extend(Xs.asn1.DERNumericString,Xs.asn1.DERAbstractString),Xs.asn1.DERPrintableString=function(t){Xs.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Ws.lang.extend(Xs.asn1.DERPrintableString,Xs.asn1.DERAbstractString),Xs.asn1.DERTeletexString=function(t){Xs.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Ws.lang.extend(Xs.asn1.DERTeletexString,Xs.asn1.DERAbstractString),Xs.asn1.DERIA5String=function(t){Xs.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Ws.lang.extend(Xs.asn1.DERIA5String,Xs.asn1.DERAbstractString),Xs.asn1.DERUTCTime=function(t){Xs.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))},Ws.lang.extend(Xs.asn1.DERUTCTime,Xs.asn1.DERAbstractTime),Xs.asn1.DERGeneralizedTime=function(t){Xs.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))},Ws.lang.extend(Xs.asn1.DERGeneralizedTime,Xs.asn1.DERAbstractTime),Xs.asn1.DERSequence=function(t){Xs.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}},Ws.lang.extend(Xs.asn1.DERSequence,Xs.asn1.DERAbstractStructured),Xs.asn1.DERSet=function(t){Xs.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)},Ws.lang.extend(Xs.asn1.DERSet,Xs.asn1.DERAbstractStructured),Xs.asn1.DERTaggedObject=function(t){Xs.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)))},Ws.lang.extend(Xs.asn1.DERTaggedObject,Xs.asn1.ASN1Object);var Zs,Js,Ys=(Zs=function(t,e){return Zs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Zs(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}Zs(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),Qs=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 Ys(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)?us(t):hs.unarmor(t),i=vs.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){e=i.sub[1].getHexStringValue(),this.n=Bs(e,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=i.sub[3].getHexStringValue();this.d=Bs(a,16);var o=i.sub[4].getHexStringValue();this.p=Bs(o,16);var s=i.sub[5].getHexStringValue();this.q=Bs(s,16);var c=i.sub[6].getHexStringValue();this.dmp1=Bs(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=Bs(u,16);var h=i.sub[8].getHexStringValue();this.coeff=Bs(h,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var l=i.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=Bs(e,16),r=l.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else e=i.sub[0].getHexStringValue(),this.n=Bs(e,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new Xs.asn1.DERInteger({int:0}),new Xs.asn1.DERInteger({bigint:this.n}),new Xs.asn1.DERInteger({int:this.e}),new Xs.asn1.DERInteger({bigint:this.d}),new Xs.asn1.DERInteger({bigint:this.p}),new Xs.asn1.DERInteger({bigint:this.q}),new Xs.asn1.DERInteger({bigint:this.dmp1}),new Xs.asn1.DERInteger({bigint:this.dmq1}),new Xs.asn1.DERInteger({bigint:this.coeff})]};return new Xs.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return os(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new Xs.asn1.DERSequence({array:[new Xs.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new Xs.asn1.DERNull]}),e=new Xs.asn1.DERSequence({array:[new Xs.asn1.DERInteger({bigint:this.n}),new Xs.asn1.DERInteger({int:this.e})]}),r=new Xs.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new Xs.asn1.DERSequence({array:[t,r]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return os(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}(Gs),tc="undefined"!=typeof process?null===(Js=process.env)||void 0===Js?void 0:Js.npm_package_version:void 0,ec=function(){function t(t){void 0===t&&(t={}),t=t||{},this.default_key_size=t.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 Qs(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(ss(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return os(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,r){try{return os(this.getKey().sign(t,e,r))}catch(t){return!1}},t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,ss(e),r)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new Qs,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=tc,t}();function rc(t){const e=new ec;return e.setPublicKey(ta.publicKey),e.encrypt(t)}var nc=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 ic=function(t){return t?JSON.parse(JSON.stringify(t)):null};var ac=function(t){return"string"==typeof t||t instanceof String};var oc=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)},sc=ic,cc=oc;var uc,hc=function(t,e,r){var n,i,a,o;for(n=0;n<e.patterns.length;n++)if(i=e.patterns[n],cc(t,i)){o=sc(e),a=Array.isArray(i)?String(i[0]).length:String(i).length,t.length>=a&&(o.matchStrength=a),r.push(o);break}},lc={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,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],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}}},dc=ic,pc=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}))},fc=ac,gc=hc,mc={},yc={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"},vc=[yc.VISA,yc.MASTERCARD,yc.AMERICAN_EXPRESS,yc.DINERS_CLUB,yc.DISCOVER,yc.JCB,yc.UNIONPAY,yc.MAESTRO,yc.ELO,yc.MIR,yc.HIPER,yc.HIPERCARD];function bc(t){return mc[t]||lc[t]}function Tc(t,e){var r=uc.indexOf(t);if(!e&&-1===r)throw new Error('"'+t+'" is not a supported card type.');return r}function wc(t){var e,r=[];return fc(t)?0===t.length?uc.map((function(t){return dc(bc(t))})):(uc.forEach((function(e){var n=bc(e);gc(t,n,r)})),(e=pc(r))?[e]:r):[]}uc=dc(vc),wc.getTypeInfo=function(t){return dc(bc(t))},wc.removeCard=function(t){var e=Tc(t);uc.splice(e,1)},wc.addCard=function(t){var e=Tc(t.type,!0);mc[t.type]=t,-1===e&&uc.push(t.type)},wc.updateCard=function(t,e){var r,n=mc[t]||lc[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=dc(n),Object.keys(r).forEach((function(t){e[t]&&(r[t]=e[t])})),mc[r.type]=r},wc.changeOrder=function(t,e){var r=Tc(t);uc.splice(r,1),uc.splice(e,0,t)},wc.resetModifications=function(){uc=dc(vc),mc={}},wc.types=yc;var Sc=wc,Ac=nc,Ec=Sc;function xc(t,e,r){return{card:t,isPotentiallyValid:e,isValid:r}}var kc=function(t,e){var r,n,i,a,o;if(e=e||{},"number"==typeof t&&(t=String(t)),"string"!=typeof t)return xc(null,!1,!1);if(t=t.replace(/\-|\s/g,""),!/^\d*$/.test(t))return xc(null,!1,!1);if(0===(r=Ec(t)).length)return xc(null,!1,!1);if(1!==r.length)return xc(null,!0,!1);if(n=r[0],e.maxLength&&t.length>e.maxLength)return xc(n,!1,!1);for(i=n.type===Ec.types.UNIONPAY&&!0!==e.luhnValidateUnionPay||Ac(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 xc(n,t.length<o||i,i);return xc(n,t.length<o,!1)};function Cc(t,e,r){return{isValid:t,isPotentiallyValid:e,isCurrentYear:r||!1}}var Bc=function(t,e){var r,n,i,a,o;return e=e||19,"string"!=typeof t?Cc(!1,!1):""===t.replace(/\s/g,"")?Cc(!1,!0):/^\d*$/.test(t)?(n=t.length)<2?Cc(!1,!0):(r=(new Date).getFullYear(),3===n?Cc(!1,t.slice(0,2)===String(r).slice(0,2)):n>4?Cc(!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),Cc(a,a,o))):Cc(!1,!1)},Oc=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Dc=Bc,Pc=Oc;function Rc(t,e,r){return{isValid:t,isPotentiallyValid:e,isValidForThisYear:r||!1}}var Ic=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)},Nc=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)),Pc(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),Dc(i).isPotentiallyValid?1:2):5===n.length?1:n.length>5?2:1,{month:e=t.substr(0,r),year:t.substr(e.length)})},Lc=Ic,Mc=Bc;function _c(t,e,r,n){return{isValid:t,isPotentiallyValid:e,month:r,year:n}}function Vc(t,e){return{isValid:t,isPotentiallyValid:e}}function jc(t,e){return{isValid:t,isPotentiallyValid:e}}var Uc={number:kc,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=Nc(t);else{if(null===t||"object"!=typeof t)return _c(!1,!1,null,null);r={month:String(t.month),year:String(t.year)}}if(n=Lc(r.month),i=Mc(r.year,e),n.isValid){if(i.isCurrentYear)return _c(a=n.isValidForThisYear,a,r.month,r.year);if(i.isValid)return _c(!0,!0,r.month,r.year)}return n.isPotentiallyValid&&i.isPotentiallyValid?_c(!1,!0,null,null):_c(!1,!1,null,null)},expirationMonth:Ic,expirationYear:Bc,cvv:function(t,e){return e=(e=e||3)instanceof Array?e:[e],"string"!=typeof t?Vc(!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)?Vc(!0,!0):t.length<Math.min.apply(null,e)?Vc(!1,!0):t.length>function(t){for(var e=3,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return e}(e)?Vc(!1,!1):Vc(!0,!0):Vc(!1,!1)},postalCode:function(t,e){var r;return r=(e=e||{}).minLength||3,"string"!=typeof t?jc(!1,!1):t.length<r?jc(!1,!0):jc(!0,!0)},creditCardType:Sc},Fc=[{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"}];Uc.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}}),Uc.creditCardType.changeOrder("verve",0);class qc{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 this.pin?rc(this.pin):void 0}getLast4(){return this.number.substring(this.number.length-4)}tokenize(){return rc(`${this.number}*${this.cvv}*${this.month}*${this.year}`)}static getType(t){const e=Uc.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}}static validate(t){let{number:e,cvv:r,month:n,year:i}=t;const{type:a}=qc.getType(e),o={number:qc.isNumberValid(e),expiry:qc.isExpiryValid({month:n,year:i}),cvv:qc.isCvvValid(r,a)};return{isValid:Object.values(o).every((t=>!0===t)),result:o}}static validateNumber(t){return Uc.number(t)}static isNumberValid(t){return qc.validateNumber(t).isValid}static validateCVV(t,e){const r="american-express"===e?4:3;return Uc.cvv(t,r)}static isCvvValid(t,e){return qc.validateCVV(t,e).isValid}static validateExpiry(t){if("object"==typeof t){const{month:e,year:r}=t;return Uc.expirationMonth(e)&&Uc.expirationYear(r)}return Uc.expirationDate(t)}static isExpiryValid(t){return qc.validateExpiry(t).isValid}static generateTestCard(t){const e=t||"default",r=Fc.find((t=>t.type===e));return new qc(r)}}const Hc={charge(t){let{clientdata:e,last4:r,pin:n,trans:i,device:a,rememberCard:o,transactionType:s,subscription:c,customFields:u}=t;const h=`${ta.paymentBaseUrl}charge/`,l=Lo(),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=Uo(p);return No.post(h,f,{headers:d}).then((t=>ra.parse(t.data)))},resumeCardCharge(t){let{device:e,accessCode:r,pin:n}=t;const i=`${ta.paymentBaseUrl}charge/resume/${r}`,a=Lo(),o={"Content-Type":"application/x-www-form-urlencoded",...a&&{"Accept-Language":a}},s={device:e,...n&&{handle:n}},c=Uo(s);return No.post(i,c,{headers:o}).then((t=>ra.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=`${ta.paymentBaseUrl}charge/`,h=Lo(),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=Uo(d);return No.post(u,p,{headers:l}).then((t=>ra.parse(t.data)))},authenticate(t,e){const r=`${ta.paymentBaseUrl}charge/validate`,n={trans:t,token:e},i=Lo(),a={...i&&{"Accept-Language":i}},o=Uo(n);return No.post(r,o,{headers:a}).then((t=>ra.parse(t.data)))},verifyAddress(t){let{address:e,city:r,state:n,zipCode:i,transactionId:a}=t;const o=`${ta.paymentBaseUrl}charge/avs`,s=Lo(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u=Uo({city:r,state:n,address:e,zip_code:i,trans:a});return No.post(o,u,{headers:c}).then((t=>ra.parse(t.data)))},forgetRememberedCard(t){let{authorizationId:e,publicKey:r}=t;const n=Lo(),i={Authorization:`Bearer ${r}`,...n&&{"Accept-Language":n}},a={authorization_id:e},o=`${ta.paystackApiUrl}rememberme/forget_card`;return No.post(o,a,{headers:i}).then((t=>ra.parse(t.data)))}},$c="card";function zc(t,e){return new Promise(((r,n)=>{const i=qc.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 Gc={setCard(t){return zc(t,!0).then((()=>{this.card=new qc(t)}))},rememberCard(){this.remember_card=!0},chargeCard(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return zc(this.card).then((()=>{this.logAttempt($c);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 Hc.charge(e).then((t=>(this.logAPIResponse(t,$c),t)))}))},chargeRememberedCard(t){let{cvv:e,authorizationCode:r,cardLast4:n,pin:i}=t;this.logAttempt($c);const a=rc(i),o={authorizationCode:r,cvv:e,last4:n,trans:this.id,device:this.deviceFingerprint,pin:a,transactionType:this.transactionType,subscription:this.subscription};return Hc.chargeRememberedCard(o).then((t=>(this.logAPIResponse(t,$c),t)))},resumeCardCharge(t){let{accessCode:e,pin:r}=t;const n={...r&&{pin:rc(r)},accessCode:e,device:this.deviceFingerprint};return Hc.resumeCardCharge(n).then((t=>(this.logAPIResponse(t,$c),t)))},forgetRememberedCard(t){const e={authorizationId:t,publicKey:this.merchant.key};return Hc.forgetRememberedCard(e).then((t=>(this.logAPIResponse(t,$c),t)))},authenticateCard(t){return Hc.authenticate(this.id,t).then((t=>(this.logAPIResponse(t,$c),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 Hc.verifyAddress(a).then((t=>(this.logAPIResponse(t,$c),t)))},listenFor3DSCharge(t){const e={channel:`3DS_${this.id}`,paymentMethod:$c};return this.listenForCharge(e,t)}};class Kc{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()"),Kc.types.indexOf(r)>-1?"nuban"!==r||Kc.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=`${ta.paymentBaseUrl}bank?pay_with_bank=true`,e=Lo(),r={...e&&{"Accept-Language":e}};return No.post(t,{headers:r}).then((t=>t.data))}}Kc.types=["nuban"];const Wc={verify(t){let{bankId:e,transactionId:r,accountNumber:n,device:i}=t;const a=`${ta.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=Lo(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=Uo({account_number:n,device:i});return No.post(a,c,{headers:s}).then((t=>ra.parse(t.data)))},register(t){let{bankId:e,transactionId:r,accountNumber:n,birthday:i}=t;const a=`${ta.paymentBaseUrl}bank/charge_account/${e}/${r}`,o=Lo(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=Uo({account_number:n,birthday:i});return No.post(a,c,{headers:s}).then((t=>ra.parse(t.data)))},authenticate(t){let{bankId:e,transactionId:r,token:n,device:i}=t;const a=`${ta.paymentBaseUrl}bank/validate_token/${e}/${r}`,o=Lo(),s={"Content-Type":"application/x-www-form-urlencoded",...o&&{"Accept-Language":o}},c=Uo({device:i,token:n});return No.post(a,c,{headers:s}).then((t=>ra.parse(t.data)))}},Xc="bank account";function Zc(t,e){return new Promise(((r,n)=>{const i=Kc.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 Jc={charge(t){let{bankId:e,transactionId:r,phoneNumber:n,token:i,accountNumber:a}=t;const o=`${ta.paymentBaseUrl}bank/digitalbankmandate/${e}/${r}`,s=Lo(),c={"Content-Type":"application/x-www-form-urlencoded",...s&&{"Accept-Language":s}},u={..."sterling-bank"==={16:"sterling-bank",62:"kuda-bank"}[e]?{account_number:a}:{phone_number:n},token:i},h=Uo(u);return No.post(o,h,{headers:c}).then((t=>ra.parse(t.data)))}},Yc="bank",Qc={chargeDigitalBankMandate(t){let{phoneNumber:e,token:r,bankId:n,accountNumber:i}=t;const a={transactionId:this.id,phoneNumber:e,token:r,bankId:n,accountNumber:i};return Jc.charge(a).then((t=>(this.logAPIResponse(t,Yc),t)))},listenForDigitalBankMandateCharge(t){const e={paymentMethod:Yc,channel:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return this.listenForCharge(e,t)}},tu={...{setBankAccount(t){return Zc(t,!0).then((()=>{this.bankAccount=new Kc(t)}))},chargeBankAccount(){return Zc(this.bankAccount).then((()=>{this.logAttempt(Xc);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,Xc),t)))}))},registerBankAccount(t){return Zc(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,Xc),t)))}))},authenticateBankAccount(t){return Zc(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,Xc),t)))}))}},...{getIbankUrl(t){let{bankId:e}=t;return new Promise(((t,r)=>{e||r(Error("Please send bankId"));const n=`${ta.paymentBaseUrl}bank/ibank/${e}/${this.id}`;t(ra.success({url:n}))}))},listenForIbankCharge(t){const e={channel:`IBANK_${this.id}`,paymentMethod:"ibank"};return this.listenForCharge(e,t)}},...Qc},eu={generateShortcode(t,e){const r=Lo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return No.post(`${ta.paystackApiUrl}checkout/ussd/reference`,t,{headers:n}).then((t=>ra.parse(t.data)))},generatePWTUSSDShortcode(t,e){const r=Lo(),n={Authorization:`Bearer ${e}`,...r&&{"Accept-Language":r}};return No.post(`${ta.paystackApiUrl}checkout/pay_with_transfer_ussd`,t,{headers:n}).then((t=>ra.parse(t.data)))}};var ru={getUSSDShortcode(t){let{channel:e}=t;const r={transaction:this.id,channel:e};return eu.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 eu.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 nu={generateQrCode(t,e){let{transaction:r,channel:n}=t;const i={source:"checkout",reference:r,channel:n},a=Lo(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return No.post(`${ta.paystackApiUrl}offline/qr/generate`,i,{headers:o}).then((t=>ra.parse(t.data)))}};function iu(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 au={getQRCode(t){let{channel:e}=t;return iu(e).then((()=>{if(this.qr[e])return this.qr[e];const t={transaction:this.id,channel:e};return nu.generateQrCode(t,this.merchant.key).then((t=>("success"===t.status&&(this.qr[e]=t),t)))}))},listenForQRCharge(t,e){let{channel:r}=t;return iu(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 ou{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 ou.hasCountryCode(t)||e.push("Number should include country code prefix"),ou.hasOnlyDigits(t)||e.push("Number should contain only digits"),ou.isE164Number(t)||e.push("Number should not be longer than 16 digits"),{isValid:0===e.length,errors:e}}}const su={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=Lo(),h={...u&&{"Accept-Language":u}};return No.post(`${ta.paystackApiUrl}charge/mobile_money`,c,{headers:h}).then((t=>ra.parse(t.data))).catch((t=>{const e=t.response&&t.response.data;let r={};return e&&(r={...e,errors:e}),ra.parse(r||t)}))}};var cu={chargeMobileMoney(t){let{phoneNumber:e,provider:r,voucher:n,registrationToken:i,numberOfTokenRequests:a}=t;return function(t){return new Promise(((e,r)=>{const n=ou.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)}))}(e).then((()=>{a?this.logTokenRequest("mobile money",a):i?this.logTokenSubmitted("mobile money"):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 su.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.errors&&t.errors.data&&"awaiting_registration_token"===t.errors.data.status?this.logTokenAuthenticationFailure(t.message):this.logError(t.message),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 uu={verify(t,e){const r=`${ta.paystackApiUrl}checkout/pay_with_phone/verify`,n=Lo(),i={Authorization:`Bearer ${e}`,...n&&{"Accept-Language":n}};return No.post(r,{phone:t},{headers:i}).then((t=>t.data))},deleteCard(t,e,r){const n=`${ta.paystackApiUrl}checkout/pay_with_phone/remove_card`,i=Lo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return No.post(n,{phone:t,id:r},{headers:a}).then((t=>t.data))},authenticateOtp(t,e,r,n){const i=`${ta.paystackApiUrl}checkout/pay_with_phone/validate_otp`,a=Lo(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return No.post(i,{phone:t,otp:r,transaction:n},{headers:o}).then((t=>t.data))},authenticatePin(t,e,r,n){const i=`${ta.paystackApiUrl}checkout/pay_with_phone/validate_pin`,a=Lo(),o={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return No.post(i,{phone:t,pin:r,transaction:n},{headers:o}).then((t=>t.data))},setPin(t,e,r,n,i){const a=Lo(),o=`${ta.paystackApiUrl}checkout/pay_with_phone/set_pin`,s={Authorization:`Bearer ${e}`,...a&&{"Accept-Language":a}};return No.post(o,{phone:t,token:r,transaction:n,pin:i},{headers:s}).then((t=>t.data))},charge(t,e,r,n,i,a){const o=`${ta.paystackApiUrl}checkout/pay_with_phone/charge`,s=Lo(),c={Authorization:`Bearer ${e}`,...s&&{"Accept-Language":s}};return No.post(o,{id:t,token:r,cvv:i,transaction:n,phone:a},{headers:c}).then((t=>t.data))},enrollPhoneNumber(t,e,r){const n=`${ta.paystackApiUrl}checkout/pay_with_phone/enroll`,i=Lo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return No.post(n,{phone:t,transaction:r},{headers:a}).then((t=>t.data))}};function hu(t){return new Promise(((e,r)=>{const n=ou.validate(t);if(!n.isValid){const e=t?n.errors[0]:"Please set a valid customer with Transaction.setCustomer()";r(Error(e))}e(n)}))}var lu={setCustomer(t){let{phoneNumber:e}=t;return hu(e).then((()=>{this.customer=e}))},verifyCustomer(){return hu(this.customer).then((()=>uu.verify(this.customer,this.merchant.key)))},deleteSavedCard(t){return hu(this.customer).then((()=>uu.deleteCard(this.customer,this.merchant.key,t)))},authenticateCustomerOtp(t){return hu(this.customer).then((()=>uu.authenticateOtp(this.customer,this.merchant.key,t,this.id)))},authenticateCustomerPin(t){return hu(this.customer).then((()=>uu.authenticatePin(this.customer,this.merchant.key,t,this.id)))},setCustomerPin(t){let{pin:e,token:r}=t;return hu(this.customer).then((()=>uu.setPin(this.customer,this.merchant.key,r,this.id,e)))},chargeSavedCard(t){let{cardId:e,token:r,cvv:n}=t;return hu(this.customer).then((()=>uu.charge(e,this.merchant.key,r,this.id,n,this.customer)))},enrollPhoneNumber(t){return hu(this.customer).then((()=>uu.enrollPhoneNumber(t,this.merchant.key,this.id)))}};const du={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r},i=Lo(),a={...i&&{"Accept-Language":i}};return No.post(`${ta.paystackApiUrl}login`,n,{headers:a}).then((t=>ra.parse(t.data)))},charge(t){let{account_code:e,transaction:r,token:n}=t;const i=Lo(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={account_code:e,transaction:r};return No.post(`${ta.paystackApiUrl}directdebit/initiate`,o,{headers:a}).then((t=>ra.parse(t.data)))},authenticate(t){let{otp:e,transaction:r,token:n}=t;const i=Lo(),a={Authorization:`Bearer ${n}`,"jwt-auth":!0,...i&&{"Accept-Language":i}},o={otp:e,transaction:r};return No.post(`${ta.paystackApiUrl}directdebit/validate`,o,{headers:a}).then((t=>ra.parse(t.data)))},getProvisionedAccounts(t){const e=Lo(),r={Authorization:`Bearer ${t}`,"jwt-auth":!0,...e&&{"Accept-Language":e}};return No.get(`${ta.paystackApiUrl}directdebit/account`,{headers:r}).then((t=>t.data))}},pu="direct debit";var fu={loginToDirectDebitAccount(t){let{email:e,password:r}=t;const n={email:e,password:r};return ji(e)?du.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(pu);const e={account_code:t,transaction:this.id,token:this.directDebit.token};return du.charge(e).then((t=>(this.logAPIResponse(t,pu),t.status&&(this.directDebit.chargeResponse=t),t)))},getProvisionedAccounts(){return du.getProvisionedAccounts(this.directDebit.token).then((t=>{this.logAPIResponse(t,pu);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 du.authenticate(e).then((t=>(this.logAPIResponse(t,pu),t)))}},gu={get:t=>({card:Gc,bank:tu,ussd:ru,qr:au,mobile_money:cu,phone:lu,direct_debit:fu,bank_transfer:Vo,eft:$o,payattitude:Ho,apple_pay:Ko,paypal:Zo}[t])},mu=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 yu={saveLog(t,e,r){const n=`${ta.paystackApiUrl}transaction/update_log/${t}`,i=Lo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return No.post(n,{payload:JSON.stringify(r)},{headers:a}).then((t=>t.data))},getIp(){const t=Lo(),e={...t&&{"Accept-Language":t}};return No.get("https://api.paystack.co/decision/ip",{headers:e}).then((t=>t.data.data.ip_address))},saveIp(t,e){const r=`${ta.paystackApiUrl}transaction/set_ip/${t}`,n=Lo(),i={Authorization:`Bearer ${e}`,...n&&{"Accept-Language":n}};return No.post(r,null,{headers:i}).then((t=>t.data))},saveReferrer(t,e,r){const n=`${ta.paystackApiUrl}transaction/set_referrer/${t}`,i=Lo(),a={Authorization:`Bearer ${e}`,...i&&{"Accept-Language":i}};return No.post(n,{referrer:r},{headers:a}).then((t=>t.data))}};var vu={initializeLog(t){const{attempts:e,authentication:r,errors:n,history:i}=t||{};this.log={start_time:Math.round(Date.now()/1e3),time_spent:0,attempts:e||0,authentication:r,errors:n||0,success:!1,mobile:mu(),input:[],history:i||[]}},getTimeSpent(){const t=Math.round(Date.now()/1e3);return this.log.time_spent=t-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()},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}},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){let e="Error";return t&&(e+=`: ${t}`),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()},saveLog(){return yu.saveLog(this.id,this.merchant.key,this.log)},saveIpAddress(){return yu.saveIp(this.id,this.merchant.key)},saveReferrer(t){return yu.saveReferrer(this.id,this.merchant.key,t)}};class bu{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=["apple_pay"].concat(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.elevyPercentage=t.elevy_percentage||null,this.subscription=t.subscription||null,this.planDetails=t.plan_details||null,window?new Promise(((t,e)=>{const r=new XMLHttpRequest;r.open("GET",ta.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")),this.log=null,Object.assign(this,vu),this.initializeLog(t.log),this.saveIpAddress(),this.channels.forEach((t=>{const e=gu.get(t);Object.assign(this,e)})),this.channels.includes("ussd")&&!this.channels.includes("bank_transfer")&&Object.assign(this,gu.get("bank_transfer")),"GHS"===t.currency&&t.elevy_percentage&&(this.elevyPercentage=t.elevy_percentage)}setMetadata(t,e){this.metadata[t]=e}setDevice(t){this.deviceFingerprint?Wi("Device ID has already been set by Checkout JS so there's no need to set this again"):this.deviceFingerprint=t}listenForCharge(t,e){const{channel:r,paymentMethod:n}=t;let i;window&&window.Pusher&&(i=new window.Pusher(ta.pusherKey,{cluster:"eu",disableStats:!0}));const a={status:"error",message:"We could not listen for charge response. Use transaction.requery() to check the status."},o=()=>{i.unsubscribe(r)};if(!i)return e({status:"error",message:"We could not listen for charge response."},ea);const s=i.subscribe(r);s.bind("pusher:subscription_succeeded",(()=>{this.isListening=!0})),s.bind("pusher:subscription_error",(()=>{this.isListening=!1,e(a,ea)})),s.bind("response",(t=>{const r=ra.parse(t);this.logAPIResponse(r,n),e(r,o)}))}requery(){return Mo.requery(this.id)}markAsAbandoned(){return Mo.markAsAbandoned({publicKey:this.merchant.key,transactionId:this.id})}}const Tu={validate(t){const e=function(t){const e=[];return t&&"object"==typeof t?(Object.keys(qi).forEach((r=>{const n=qi[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 Vi(e,t)}},async request(t){const e=await Xi(),r=await Mo.requestInline({...t,device:e});return r&&Object.seal(new bu({...r.data,deviceFingerprint:e}))},async requestWithAccessCode(t){const e=await Xi(),r=await Mo.requestStandard(t);return r&&Object.seal(new bu({...r.data,deviceFingerprint:e}))},async getByAccessCode(t,e){const r=await Xi(),n=await Mo.getByAccessCode(t,e);return n&&Object.seal(new bu({...n.data,deviceFingerprint:r}))},initialize:t=>Object.seal(new bu(t)),async verify(t){const e=await Mo.verify(t);return e&&e.data}},wu={fetchBanks(t){const e=`${ta.paystackApiUrl}bank`,r=Lo(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return No.get(e,n).then((t=>t.data))},fetchResolutions(){const t=`${ta.paystackApiUrl}checkout/resolutions`,e=Lo(),r={...e&&{"Accept-Language":e}};return No.get(t,{headers:r}).then((t=>t.data))},fetchCelebrations(){const t=`${ta.paystackApiUrl}checkout/celebrations`,e=Lo(),r={...e&&{"Accept-Language":e}};return No.get(t,{headers:r}).then((t=>t.data))},fetchStates(t){const e=`${ta.paystackApiUrl}address_verification/states`,r=Lo(),n={params:t,headers:{...r&&{"Accept-Language":r}}};return No.get(e,n).then((t=>t.data))}};return t.BankAccount=Kc,t.Card=qc,t.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=wu.fetchBanks(e||{pay_with_bank:"1"});break;case"resolutions":r=wu.fetchResolutions();break;case"celebrations":r=wu.fetchCelebrations();break;case"states":r=wu.fetchStates(e)}return r}},t.Transaction=Tu,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
package/es/checkout.js
CHANGED
|
@@ -81,34 +81,24 @@ var FunctionPrototype$2 = Function.prototype;
|
|
|
81
81
|
var call$4 = FunctionPrototype$2.call;
|
|
82
82
|
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$4, call$4);
|
|
83
83
|
|
|
84
|
-
var
|
|
84
|
+
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
85
85
|
return function () {
|
|
86
86
|
return call$4.apply(fn, arguments);
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
var
|
|
90
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
91
91
|
|
|
92
|
-
var toString$4 =
|
|
93
|
-
var stringSlice =
|
|
92
|
+
var toString$4 = uncurryThis$9({}.toString);
|
|
93
|
+
var stringSlice = uncurryThis$9(''.slice);
|
|
94
94
|
|
|
95
|
-
var classofRaw$
|
|
95
|
+
var classofRaw$1 = function (it) {
|
|
96
96
|
return stringSlice(toString$4(it), 8, -1);
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
var classofRaw$1 = classofRaw$2;
|
|
100
|
-
var uncurryThisRaw = functionUncurryThisRaw;
|
|
101
|
-
|
|
102
|
-
var functionUncurryThis = function (fn) {
|
|
103
|
-
// Nashorn bug:
|
|
104
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
105
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
106
|
-
if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
99
|
var uncurryThis$8 = functionUncurryThis;
|
|
110
100
|
var fails$6 = fails$9;
|
|
111
|
-
var classof$2 = classofRaw$
|
|
101
|
+
var classof$2 = classofRaw$1;
|
|
112
102
|
|
|
113
103
|
var $Object$3 = Object;
|
|
114
104
|
var split = uncurryThis$8(''.split);
|
|
@@ -339,10 +329,10 @@ var store$2 = sharedStore;
|
|
|
339
329
|
(shared$3.exports = function (key, value) {
|
|
340
330
|
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
341
331
|
})('versions', []).push({
|
|
342
|
-
version: '3.26.
|
|
332
|
+
version: '3.26.1',
|
|
343
333
|
mode: 'global',
|
|
344
334
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
345
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.26.
|
|
335
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
|
|
346
336
|
source: 'https://github.com/zloirock/core-js'
|
|
347
337
|
});
|
|
348
338
|
|
|
@@ -1104,7 +1094,7 @@ var toStringTagSupport = String(test) === '[object z]';
|
|
|
1104
1094
|
|
|
1105
1095
|
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1106
1096
|
var isCallable = isCallable$d;
|
|
1107
|
-
var classofRaw = classofRaw$
|
|
1097
|
+
var classofRaw = classofRaw$1;
|
|
1108
1098
|
var wellKnownSymbol = wellKnownSymbol$3;
|
|
1109
1099
|
|
|
1110
1100
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
@@ -10630,7 +10620,10 @@ var JSEncryptRSAKey = /** @class */ (function (_super) {
|
|
|
10630
10620
|
return JSEncryptRSAKey;
|
|
10631
10621
|
}(RSAKey));
|
|
10632
10622
|
|
|
10633
|
-
var
|
|
10623
|
+
var _a;
|
|
10624
|
+
var version = typeof process !== 'undefined'
|
|
10625
|
+
? (_a = process.env) === null || _a === void 0 ? void 0 : _a.npm_package_version
|
|
10626
|
+
: undefined;
|
|
10634
10627
|
/**
|
|
10635
10628
|
*
|
|
10636
10629
|
* @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
|
package/lib/checkout.js
CHANGED
|
@@ -85,34 +85,24 @@ var FunctionPrototype$2 = Function.prototype;
|
|
|
85
85
|
var call$4 = FunctionPrototype$2.call;
|
|
86
86
|
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$4, call$4);
|
|
87
87
|
|
|
88
|
-
var
|
|
88
|
+
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
89
89
|
return function () {
|
|
90
90
|
return call$4.apply(fn, arguments);
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
var
|
|
94
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
95
95
|
|
|
96
|
-
var toString$4 =
|
|
97
|
-
var stringSlice =
|
|
96
|
+
var toString$4 = uncurryThis$9({}.toString);
|
|
97
|
+
var stringSlice = uncurryThis$9(''.slice);
|
|
98
98
|
|
|
99
|
-
var classofRaw$
|
|
99
|
+
var classofRaw$1 = function (it) {
|
|
100
100
|
return stringSlice(toString$4(it), 8, -1);
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
var classofRaw$1 = classofRaw$2;
|
|
104
|
-
var uncurryThisRaw = functionUncurryThisRaw;
|
|
105
|
-
|
|
106
|
-
var functionUncurryThis = function (fn) {
|
|
107
|
-
// Nashorn bug:
|
|
108
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
109
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
110
|
-
if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
103
|
var uncurryThis$8 = functionUncurryThis;
|
|
114
104
|
var fails$6 = fails$9;
|
|
115
|
-
var classof$2 = classofRaw$
|
|
105
|
+
var classof$2 = classofRaw$1;
|
|
116
106
|
|
|
117
107
|
var $Object$3 = Object;
|
|
118
108
|
var split = uncurryThis$8(''.split);
|
|
@@ -343,10 +333,10 @@ var store$2 = sharedStore;
|
|
|
343
333
|
(shared$3.exports = function (key, value) {
|
|
344
334
|
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
345
335
|
})('versions', []).push({
|
|
346
|
-
version: '3.26.
|
|
336
|
+
version: '3.26.1',
|
|
347
337
|
mode: 'global',
|
|
348
338
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
349
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.26.
|
|
339
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
|
|
350
340
|
source: 'https://github.com/zloirock/core-js'
|
|
351
341
|
});
|
|
352
342
|
|
|
@@ -1108,7 +1098,7 @@ var toStringTagSupport = String(test) === '[object z]';
|
|
|
1108
1098
|
|
|
1109
1099
|
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1110
1100
|
var isCallable = isCallable$d;
|
|
1111
|
-
var classofRaw = classofRaw$
|
|
1101
|
+
var classofRaw = classofRaw$1;
|
|
1112
1102
|
var wellKnownSymbol = wellKnownSymbol$3;
|
|
1113
1103
|
|
|
1114
1104
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
@@ -10634,7 +10624,10 @@ var JSEncryptRSAKey = /** @class */ (function (_super) {
|
|
|
10634
10624
|
return JSEncryptRSAKey;
|
|
10635
10625
|
}(RSAKey));
|
|
10636
10626
|
|
|
10637
|
-
var
|
|
10627
|
+
var _a;
|
|
10628
|
+
var version = typeof process !== 'undefined'
|
|
10629
|
+
? (_a = process.env) === null || _a === void 0 ? void 0 : _a.npm_package_version
|
|
10630
|
+
: undefined;
|
|
10638
10631
|
/**
|
|
10639
10632
|
*
|
|
10640
10633
|
* @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
|