bluetime-ewallet
Version:
BlueTime Orchestra library for eWallet payments (GooglePay, Applepay, payPal, Banks...)
18 lines • 62.7 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("eWallet",[],t):"object"==typeof exports?exports.eWallet=t():e.eWallet=t()}(self,(()=>(()=>{var e={945:(e,t,r)=>{var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,o=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},o="URLSearchParams"in n,s="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,l="ArrayBuffer"in n;if(l)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function y(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function g(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=g(t);return t.readAsArrayBuffer(e),r}function _(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():l&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=_(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l&&(ArrayBuffer.prototype.isPrototypeOf(e)||d(e))?this._bodyArrayBuffer=_(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=y(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=y(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i)return this.blob().then(m);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,o,s=y(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=g(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=n?n[1]:"utf-8",t.readAsText(e,o),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=u(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[u(e)]},f.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},f.prototype.set=function(e,t){this.map[u(e)]=h(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),p(e)},s&&(f.prototype[Symbol.iterator]=f.prototype.entries);var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,o,s=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,s||null==e._bodyInit||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=t.method||this.method||"GET",o=r.toUpperCase(),w.indexOf(o)>-1?o:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function A(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function P(e,t){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},P.error=function(){var e=new P(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var S=[301,302,303,307,308];P.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new P(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(e,r){return new Promise((function(o,s){var a=new b(e,r);if(a.signal&&a.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}if(c.onload=function(){var e,t,r={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{t.append(n,o)}catch(e){console.warn("Response "+e.message)}}})),t)};0===a.url.indexOf("file://")&&(c.status<200||c.status>599)?r.status=200:r.status=c.status,r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var n="response"in c?c.response:c.responseText;setTimeout((function(){o(new P(n,r))}),0)},c.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request timed out"))}),0)},c.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},c.open(a.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&(i?c.responseType="blob":l&&(c.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof f||n.Headers&&r.headers instanceof n.Headers)){var p=[];Object.getOwnPropertyNames(r.headers).forEach((function(e){p.push(u(e)),c.setRequestHeader(e,h(r.headers[e]))})),a.headers.forEach((function(e,t){-1===p.indexOf(t)&&c.setRequestHeader(t,e)}))}else a.headers.forEach((function(e,t){c.setRequestHeader(t,e)}));a.signal&&(a.signal.addEventListener("abort",d),c.onreadystatechange=function(){4===c.readyState&&a.signal.removeEventListener("abort",d)}),c.send(void 0===a._bodyInit?null:a._bodyInit)}))}C.polyfill=!0,n.fetch||(n.fetch=C,n.Headers=f,n.Request=b,n.Response=P),t.Headers=f,t.Request=b,t.Response=P,t.fetch=C}({})}(o),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var s=n.fetch?n:o;(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},612:(e,t,r)=>{!function(){"use strict";e.exports={inflate:r(967),deflate:r(931)}}()},931:e=>{!function(){var t,r,n,o,s,i,a,l,c,d,u,h,p,f,y,g,m,_,v,w,b,A,P,S,C,E,I,k,B,O,T,x,R,q,N,M,D,L,j,U,$,W,F,z,H,J,V,G,X,K,Y,Z,Q,ee,te,re,ne=32768,oe=258,se=32768,ie=32767,ae=262,le=32506,ce=15,de=256,ue=286,he=30,pe=parseInt(17/3,10),fe=null;function ye(){this.fc=0,this.dl=0}function ge(){this.dyn_tree=null,this.static_tree=null,this.extra_bits=null,this.extra_base=0,this.elems=0,this.max_length=0,this.max_code=0}function me(e,t,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n}function _e(){this.next=null,this.len=0,this.ptr=[],this.off=0}var ve=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],we=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],be=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Pe=[new me(0,0,0,0),new me(4,4,8,4),new me(4,5,16,8),new me(4,6,32,32),new me(4,4,16,16),new me(8,16,32,32),new me(8,16,128,128),new me(8,32,128,256),new me(32,128,258,1024),new me(32,258,258,4096)];function Se(e){e.next=t,t=e}function Ce(e){return u[ne+e]}function Ee(e,t){return u[ne+e]=t}function Ie(e){fe[i+s++]=e,i+s===8192&&function(){var e,o;if(0!==s){for(null!==t?(a=t,t=t.next):a=new _e,a.next=null,a.len=a.off=0,e=a,null===r?r=n=e:n=n.next=e,e.len=s-i,o=0;o<e.len;o++)e.ptr[o]=fe[i+o];s=i=0}var a}()}function ke(e){e&=65535,i+s<8190?(fe[i+s++]=255&e,fe[i+s++]=e>>>8):(Ie(255&e),Ie(e>>>8))}function Be(){y=(y<<pe^255&l[b+3-1])&ie,g=Ce(y),u[32767&b]=g,Ee(y,b)}function Oe(e,t){Xe(t[e].fc,t[e].dl)}function Te(e){return 255&(e<256?z[e]:z[256+(e>>7)])}function xe(e,t,r){return e[t].fc<e[r].fc||e[t].fc===e[r].fc&&W[t]<=W[r]}function Re(e,t,r){var n;for(n=0;n<r&&re<te.length;n++)e[t+n]=255&te[re++];return n}function qe(e){var t,r,n,o,s=C,i=b,a=w,c=b>le?b-le:0,d=b+oe,h=l[i+a-1],p=l[i+a];w>=k&&(s>>=2);do{if(l[(t=e)+a]===p&&l[t+a-1]===h&&l[t]===l[i]&&l[++t]===l[i+1]){for(i+=2,t++;i<d;){for(o=!1,n=0;n<8;n+=1)if(t+=1,l[i+=1]!==l[t]){o=!0;break}if(o)break}if(r=oe-(d-i),i=d-oe,r>a){if(A=e,a=r,r>=B)break;h=l[i+a-1],p=l[i+a]}}}while((e=u[32767&e])>c&&0!=--s);return a}function Ne(){var e,t,r=65536-S-b;if(-1===r)r--;else if(b>=65274){for(e=0;e<ne;e++)l[e]=l[e+ne];for(A-=ne,b-=ne,f-=ne,e=0;e<se;e++)Ee(e,(t=Ce(e))>=ne?t-ne:0);for(e=0;e<ne;e++)t=u[e],u[e]=t>=ne?t-ne:0;r+=ne}P||((e=Re(l,b+S,r))<=0?P=!0:S+=e)}function Me(){P||(h=0,p=0,function(){var e,t,r,n,o;if(0!==R[0].dl)return;for(N.dyn_tree=O,N.static_tree=x,N.extra_bits=ve,N.extra_base=257,N.elems=ue,N.max_length=ce,N.max_code=0,M.dyn_tree=T,M.static_tree=R,M.extra_bits=we,M.extra_base=0,M.elems=he,M.max_length=ce,M.max_code=0,D.dyn_tree=q,D.static_tree=null,D.extra_bits=be,D.extra_base=0,D.elems=19,D.max_length=7,D.max_code=0,r=0,n=0;n<28;n++)for(H[n]=r,e=0;e<1<<ve[n];e++)F[r++]=n;for(F[r-1]=n,o=0,n=0;n<16;n++)for(J[n]=o,e=0;e<1<<we[n];e++)z[o++]=n;for(o>>=7;n<he;n++)for(J[n]=o<<7,e=0;e<1<<we[n]-7;e++)z[256+o++]=n;for(t=0;t<=ce;t++)L[t]=0;e=0;for(;e<=143;)x[e++].dl=8,L[8]++;for(;e<=255;)x[e++].dl=9,L[9]++;for(;e<=279;)x[e++].dl=7,L[7]++;for(;e<=287;)x[e++].dl=8,L[8]++;for($e(x,287),e=0;e<he;e++)R[e].dl=5,R[e].fc=Ke(e,5);je()}(),function(){var e;for(e=0;e<se;e++)u[ne+e]=0;if(E=Pe[I].max_lazy,k=Pe[I].good_length,B=Pe[I].nice_length,C=Pe[I].max_chain,b=0,f=0,(S=Re(l,0,65536))<=0)return P=!0,void(S=0);for(P=!1;S<ae&&!P;)Ne();for(y=0,e=0;e<2;e++)y=(y<<pe^255&l[e])&ie}(),r=null,s=0,i=0,I<=3?(w=2,v=0):(v=2,_=!1),a=!1)}function De(e,t,n){var s;return o||(Me(),o=!0,0!==S)?(s=Le(e,t,n))===n?n:a?s:(I<=3?function(){for(;0!==S&&null===r;){var e;if(Be(),0!==g&&b-g<=le&&(v=qe(g))>S&&(v=S),v>=3)if(e=Je(b-A,v-3),S-=v,v<=E){v--;do{b++,Be()}while(0!=--v);b++}else b+=v,v=0,y=((y=255&l[b])<<pe^255&l[b+1])&ie;else e=Je(0,255&l[b]),S--,b++;for(e&&(He(0),f=b);S<ae&&!P;)Ne()}}():function(){for(;0!==S&&null===r;){if(Be(),w=v,m=A,v=2,0!==g&&w<E&&b-g<=le&&((v=qe(g))>S&&(v=S),3===v&&b-A>4096&&v--),w>=3&&v<=w){var e;e=Je(b-1-m,w-3),S-=w-1,w-=2;do{b++,Be()}while(0!=--w);_=!1,v=2,b++,e&&(He(0),f=b)}else _?(Je(0,255&l[b-1])&&(He(0),f=b),b++,S--):(_=!0,b++,S--);for(;S<ae&&!P;)Ne()}}(),0===S&&(_&&Je(0,255&l[b-1]),He(1),a=!0),s+Le(e,s+t,n-s)):(a=!0,0)}function Le(e,t,n){var o,a,l;for(o=0;null!==r&&o<n;){for((a=n-o)>r.len&&(a=r.len),l=0;l<a;l++)e[t+o+l]=r.ptr[r.off+l];var c;if(r.off+=a,r.len-=a,o+=a,0===r.len)c=r,r=r.next,Se(c)}if(o===n)return o;if(i<s){for((a=n-o)>s-i&&(a=s-i),l=0;l<a;l++)e[t+o+l]=fe[i+l];o+=a,s===(i+=a)&&(s=i=0)}return o}function je(){var e;for(e=0;e<ue;e++)O[e].fc=0;for(e=0;e<he;e++)T[e].fc=0;for(e=0;e<19;e++)q[e].fc=0;O[256].fc=1,Q=ee=0,G=X=K=0,Y=0,Z=1}function Ue(e,t){for(var r=j[t],n=t<<1;n<=U&&(n<U&&xe(e,j[n+1],j[n])&&n++,!xe(e,r,j[n]));)j[t]=j[n],t=n,n<<=1;j[t]=r}function $e(e,t){var r,n,o=[],s=0;for(r=1;r<=ce;r++)s=s+L[r-1]<<1,o[r]=s;for(n=0;n<=t;n++){var i=e[n].dl;0!==i&&(e[n].fc=Ke(o[i]++,i))}}function We(e){var t,r,n=e.dyn_tree,o=e.static_tree,s=e.elems,i=-1,a=s;for(U=0,$=573,t=0;t<s;t++)0!==n[t].fc?(j[++U]=i=t,W[t]=0):n[t].dl=0;for(;U<2;){var l=j[++U]=i<2?++i:0;n[l].fc=1,W[l]=0,Q--,null!==o&&(ee-=o[l].dl)}for(e.max_code=i,t=U>>1;t>=1;t--)Ue(n,t);do{t=j[1],j[1]=j[U--],Ue(n,1),r=j[1],j[--$]=t,j[--$]=r,n[a].fc=n[t].fc+n[r].fc,W[t]>W[r]+1?W[a]=W[t]:W[a]=W[r]+1,n[t].dl=n[r].dl=a,j[1]=a++,Ue(n,1)}while(U>=2);j[--$]=j[1],function(e){var t,r,n,o,s,i,a=e.dyn_tree,l=e.extra_bits,c=e.extra_base,d=e.max_code,u=e.max_length,h=e.static_tree,p=0;for(o=0;o<=ce;o++)L[o]=0;for(a[j[$]].dl=0,t=$+1;t<573;t++)(o=a[a[r=j[t]].dl].dl+1)>u&&(o=u,p++),a[r].dl=o,r>d||(L[o]++,s=0,r>=c&&(s=l[r-c]),i=a[r].fc,Q+=i*(o+s),null!==h&&(ee+=i*(h[r].dl+s)));if(0!==p){do{for(o=u-1;0===L[o];)o--;L[o]--,L[o+1]+=2,L[u]--,p-=2}while(p>0);for(o=u;0!==o;o--)for(r=L[o];0!==r;)(n=j[--t])>d||(a[n].dl!==o&&(Q+=(o-a[n].dl)*a[n].fc,a[n].fc=o),r--)}}(e),$e(n,i)}function Fe(e,t){var r,n,o=-1,s=e[0].dl,i=0,a=7,l=4;for(0===s&&(a=138,l=3),e[t+1].dl=65535,r=0;r<=t;r++)n=s,s=e[r+1].dl,++i<a&&n===s||(i<l?q[n].fc+=i:0!==n?(n!==o&&q[n].fc++,q[16].fc++):i<=10?q[17].fc++:q[18].fc++,i=0,o=n,0===s?(a=138,l=3):n===s?(a=6,l=3):(a=7,l=4))}function ze(e,t){var r,n,o=-1,s=e[0].dl,i=0,a=7,l=4;for(0===s&&(a=138,l=3),r=0;r<=t;r++)if(n=s,s=e[r+1].dl,!(++i<a&&n===s)){if(i<l)do{Oe(n,q)}while(0!=--i);else 0!==n?(n!==o&&(Oe(n,q),i--),Oe(16,q),Xe(i-3,2)):i<=10?(Oe(17,q),Xe(i-3,3)):(Oe(18,q),Xe(i-11,7));i=0,o=n,0===s?(a=138,l=3):n===s?(a=6,l=3):(a=7,l=4)}}function He(e){var t,r,n,o,s;if(o=b-f,V[K]=Y,We(N),We(M),n=function(){var e;for(Fe(O,N.max_code),Fe(T,M.max_code),We(D),e=18;e>=3&&0===q[Ae[e]].dl;e--);return Q+=3*(e+1)+5+5+4,e}(),(r=ee+3+7>>3)<=(t=Q+3+7>>3)&&(t=r),o+4<=t&&f>=0)for(Xe(0+e,3),Ye(),ke(o),ke(~o),s=0;s<o;s++)Ie(l[f+s]);else r===t?(Xe(2+e,3),Ve(x,R)):(Xe(4+e,3),function(e,t,r){var n;for(Xe(e-257,5),Xe(t-1,5),Xe(r-4,4),n=0;n<r;n++)Xe(q[Ae[n]].dl,3);ze(O,e-1),ze(T,t-1)}(N.max_code+1,M.max_code+1,n+1),Ve(O,T));je(),0!==e&&Ye()}function Je(e,t){if(d[G++]=t,0===e?O[t].fc++:(e--,O[F[t]+de+1].fc++,T[Te(e)].fc++,c[X++]=e,Y|=Z),Z<<=1,7&G||(V[K++]=Y,Y=0,Z=1),I>2&&!(4095&G)){var r,n=8*G,o=b-f;for(r=0;r<he;r++)n+=T[r].fc*(5+we[r]);if(n>>=3,X<parseInt(G/2,10)&&n<parseInt(o/2,10))return!0}return 8191===G||8192===X}function Ve(e,t){var r,n,o,s,i=0,a=0,l=0,u=0;if(0!==G)do{7&i||(u=V[l++]),n=255&d[i++],1&u?(Oe((o=F[n])+de+1,e),0!==(s=ve[o])&&Xe(n-=H[o],s),Oe(o=Te(r=c[a++]),t),0!==(s=we[o])&&Xe(r-=J[o],s)):Oe(n,e),u>>=1}while(i<G);Oe(256,e)}var Ge=16;function Xe(e,t){p>Ge-t?(ke(h|=e<<p),h=e>>Ge-p,p+=t-Ge):(h|=e<<p,p+=t)}function Ke(e,t){var r=0;do{r|=1&e,e>>=1,r<<=1}while(--t>0);return r>>1}function Ye(){p>8?ke(h):p>0&&Ie(h),h=0,p=0}e.exports=function(e,s){var i,a;te=e,re=0,void 0===s&&(s=6),function(e){var s;if(e?e<1?e=1:e>9&&(e=9):e=6,I=e,o=!1,P=!1,null===fe){for(t=r=n=null,fe=[],l=[],c=[],d=[],u=[],O=[],s=0;s<573;s++)O[s]=new ye;for(T=[],s=0;s<61;s++)T[s]=new ye;for(x=[],s=0;s<288;s++)x[s]=new ye;for(R=[],s=0;s<he;s++)R[s]=new ye;for(q=[],s=0;s<39;s++)q[s]=new ye;N=new ge,M=new ge,D=new ge,L=[],j=[],W=[],F=[],z=[],H=[],J=[],V=[]}}(s),a=[];do{i=De(a,a.length,1024)}while(i>0);return te=null,a},e.exports.DEFAULT_LEVEL=6}()},967:e=>{!function(){var t,r,n,o,s,i,a,l,c,d,u,h,p,f,y,g,m,_=null,v=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],w=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],A=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function C(){this.next=null,this.list=null}function E(){this.e=0,this.b=0,this.n=0,this.t=null}function I(e,t,r,n,o,s){var i;this.BMAX=16,this.N_MAX=288,this.status=0,this.root=null,this.m=0;var a,l,c,d,u,h,p,f,y,g,m,_,v,w,b,A,P=[],S=[],I=new E,k=[],B=[],O=[];for(A=this.root=null,u=0;u<this.BMAX+1;u++)P[u]=0;for(u=0;u<this.BMAX+1;u++)S[u]=0;for(u=0;u<this.BMAX;u++)k[u]=null;for(u=0;u<this.N_MAX;u++)B[u]=0;for(u=0;u<this.BMAX+1;u++)O[u]=0;a=t>256?e[256]:this.BMAX,f=e,y=0,u=t;do{P[f[y]]++,y++}while(--u>0);if(P[0]===t)return this.root=null,this.m=0,void(this.status=0);for(h=1;h<=this.BMAX&&0===P[h];h++);for(p=h,s<h&&(s=h),u=this.BMAX;0!==u&&0===P[u];u--);for(c=u,s>u&&(s=u),v=1<<h;h<u;h++,v<<=1)if((v-=P[h])<0)return this.status=2,void(this.m=s);if((v-=P[u])<0)return this.status=2,void(this.m=s);for(P[u]+=v,O[1]=h=0,f=P,y=1,_=2;--u>0;)O[_++]=h+=f[y++];f=e,y=0,u=0;do{0!==(h=f[y++])&&(B[O[h]++]=u)}while(++u<t);for(t=O[c],O[0]=u=0,f=B,y=0,d=-1,m=S[0]=0,g=null,w=0;p<=c;p++)for(i=P[p];i-- >0;){for(;p>m+S[1+d];){if(m+=S[1+d],d++,w=(w=c-m)>s?s:w,(l=1<<(h=p-m))>i+1)for(l-=i+1,_=p;++h<w&&!((l<<=1)<=P[++_]);)l-=P[_];for(m+h>a&&m<a&&(h=a-m),w=1<<h,S[1+d]=h,g=[],b=0;b<w;b++)g[b]=new E;(A=A?A.next=new C:this.root=new C).next=null,A.list=g,k[d]=g,d>0&&(O[d]=u,I.b=S[d],I.e=16+h,I.t=g,h=(u&(1<<m)-1)>>m-S[d],k[d-1][h].e=I.e,k[d-1][h].b=I.b,k[d-1][h].n=I.n,k[d-1][h].t=I.t)}for(I.b=p-m,y>=t?I.e=99:f[y]<r?(I.e=f[y]<256?16:15,I.n=f[y++]):(I.e=o[f[y]-r],I.n=n[f[y++]-r]),l=1<<p-m,h=u>>m;h<w;h+=l)g[h].e=I.e,g[h].b=I.b,g[h].n=I.n,g[h].t=I.t;for(h=1<<p-1;u&h;h>>=1)u^=h;for(u^=h;(u&(1<<m)-1)!==O[d];)m-=S[d],d--}this.m=S[1],this.status=0!==v&&1!==c?1:0}function k(e){for(;a<e;)i|=(g.length===m?-1:255&g[m++])<<a,a+=8}function B(e){return i&v[e]}function O(e){i>>=e,a-=e}function T(e,n,o){var s,i,a;if(0===o)return 0;for(a=0;;){for(k(f),s=(i=h.list[B(f)]).e;s>16;){if(99===s)return-1;O(i.b),k(s-=16),s=(i=i.t[B(s)]).e}if(O(i.b),16!==s){if(15===s)break;for(k(s),d=i.n+B(s),O(s),k(y),s=(i=p.list[B(y)]).e;s>16;){if(99===s)return-1;O(i.b),k(s-=16),s=(i=i.t[B(s)]).e}for(O(i.b),k(s),u=r-i.n-B(s),O(s);d>0&&a<o;)d--,u&=32767,r&=32767,e[n+a++]=t[r++]=t[u++];if(a===o)return o}else if(r&=32767,e[n+a++]=t[r++]=i.n,a===o)return o}return l=-1,a}function x(e,n,o){var s;if(O(s=7&a),k(16),s=B(16),O(16),k(16),s!==(65535&~i))return-1;for(O(16),d=s,s=0;d>0&&s<o;)d--,r&=32767,k(8),e[n+s++]=t[r++]=B(8),O(8);return 0===d&&(l=-1),s}function R(e,t,r){if(!_){var i,a,l=[];for(i=0;i<144;i++)l[i]=8;for(;i<256;i++)l[i]=9;for(;i<280;i++)l[i]=7;for(;i<288;i++)l[i]=8;if(0!==(a=new I(l,288,257,w,b,o=7)).status)return console.error("HufBuild error: "+a.status),-1;for(_=a.root,o=a.m,i=0;i<30;i++)l[i]=5;if((a=new I(l,30,0,A,P,s=5)).status>1)return _=null,console.error("HufBuild error: "+a.status),-1;n=a.root,s=a.m}return h=_,p=n,f=o,y=s,T(e,t,r)}function q(e,t,r){var n,o,s,i,a,l,c,d,u,g=[];for(n=0;n<316;n++)g[n]=0;if(k(5),c=257+B(5),O(5),k(5),d=1+B(5),O(5),k(4),l=4+B(4),O(4),c>286||d>30)return-1;for(o=0;o<l;o++)k(3),g[S[o]]=B(3),O(3);for(;o<19;o++)g[S[o]]=0;if(0!==(u=new I(g,19,19,null,null,f=7)).status)return-1;for(h=u.root,f=u.m,i=c+d,n=s=0;n<i;)if(k(f),O(o=(a=h.list[B(f)]).b),(o=a.n)<16)g[n++]=s=o;else if(16===o){if(k(2),o=3+B(2),O(2),n+o>i)return-1;for(;o-- >0;)g[n++]=s}else if(17===o){if(k(3),o=3+B(3),O(3),n+o>i)return-1;for(;o-- >0;)g[n++]=0;s=0}else{if(k(7),o=11+B(7),O(7),n+o>i)return-1;for(;o-- >0;)g[n++]=0;s=0}if(u=new I(g,c,257,w,b,f=9),0===f&&(u.status=1),0!==u.status&&1!==u.status)return-1;for(h=u.root,f=u.m,n=0;n<d;n++)g[n]=g[n+c];return u=new I(g,d,0,A,P,y=6),p=u.root,0===(y=u.m)&&c>257||0!==u.status?-1:T(e,t,r)}function N(e,n,o){var s,i;for(s=0;s<o;){if(c&&-1===l)return s;if(d>0){if(0!==l)for(;d>0&&s<o;)d--,u&=32767,r&=32767,e[n+s++]=t[r++]=t[u++];else{for(;d>0&&s<o;)d--,r&=32767,k(8),e[n+s++]=t[r++]=B(8),O(8);0===d&&(l=-1)}if(s===o)return s}if(-1===l){if(c)break;k(1),0!==B(1)&&(c=!0),O(1),k(2),l=B(2),O(2),h=null,d=0}switch(l){case 0:i=x(e,n+s,o-s);break;case 1:i=h?T(e,n+s,o-s):R(e,n+s,o-s);break;case 2:i=h?T(e,n+s,o-s):q(e,n+s,o-s);break;default:i=-1}if(-1===i)return c?0:-1;s+=i}return s}e.exports=function(e){var n,o=[];t||(t=[]),r=0,i=0,a=0,l=-1,c=!1,d=u=0,h=null,g=e,m=0;do{n=N(o,o.length,1024)}while(n>0);return g=null,o}}()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function e(e){return t(o(e).map((e=>e.charCodeAt(0))))}function t(e){return decodeURIComponent(e.map((function(e){return"%"+("00"+e.toString(16)).slice(-2)})).join(""))}function o(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");return window.atob(t).split("")}r.r(n),r.d(n,{Engine:()=>Engine});var s,i,a=r(612);function l(r){const n=r.split(".");if(3!==n.length)return;const s=e(n[0]),i=JSON.parse(s);var l=e(n[1]);if("Def"===i?.cmp){var c=JSON.parse(l),d=o(c).map((e=>e.charCodeAt(0)));l=t(a.inflate(d))}return JSON.parse(l)}!function(e){e.MIN="MIN",e.FULL="FULL"}(s||(s={}));class MinAddress{phoneNumber;emailAddress;countryCode;name;postalCode}class FullAddress extends MinAddress{addressLines;locality;administrativeArea}!function(e){e.renderButton=function(e,t,r){var n=document.createElement("button");return n.innerHTML=r,n.title=r,n.style.width="200px",n.style.height="40px",n.style.borderRadius="8px",n.style.backgroundColor="Dark"===t?.color?"DarkOrange":"LightYellow",n.onclick=t=>e(t),n},e.popupCenter=function(e,t,r,n,o){const s=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,l=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,c=a/window.screen.availWidth,d=(a-r)/2/c+s,u=(l-n)/2/c+i,h=window.open(e,t,`\n width=${r/c}, \n height=${n/c}, \n top=${u}, \n left=${d}\n `),p=window.setInterval((function(){try{(null==h||h.closed)&&(window.clearInterval(p),o())}catch(e){}}),1e3);return h?.focus(),h},e.setOverlay=function(e){const t=document.createElement("div");t.style.zIndex="1",t.style.width="100%",t.style.top="0",t.style.position="fixed",t.style.height="100vh",t.style.display="flex",t.style.opacity="0.5",t.style.background="Gray",t.style.color="White",t.style.justifyContent="center",t.style.alignItems="center",t.onclick=()=>{e?e.focus():t.remove()};const r=document.createElement("div");return r.style.fontSize="2rem",r.style.width="100%",r.style.textAlign="center",r.innerHTML="Click here to resume payment authorization",t.appendChild(r),document.body.appendChild(t),t}}(i||(i={}));class Mock{_requiredAncillaryInfo;worksWithPaymentGateway=!0;rendersButton=!1;requiresLanguageResource=!1;name="Mock";constructor(e){this._requiredAncillaryInfo=e}isAvailable(){return new Promise((e=>{e(!0)}))}createButton(e,t,r){const n=`${t?.text??"Pay"} by Mock`;return i.renderButton((t=>{e(t,"Mock")}),t,n)}async startSession(e){return{success:!0,message:void 0,data:JSON.stringify({number:"4580458045804580",expirationYear:2030,expirationMonth:12,nameOnCard:"John Doe",type:"Visa"}),resultCode:"OK"}}getBillingInfo(){if(this._requiredAncillaryInfo?.billingInfo){if(this._requiredAncillaryInfo.billingInfo.details===s.FULL){return{addressLines:["123 Main St."],name:"John Smith",countryCode:"US",administrativeArea:"NY",postalCode:"012345",locality:"New York",phoneNumber:this._requiredAncillaryInfo?.billingInfo.phoneRequired?"+1(203)555-1234":"",emailAddress:"customer@domain.com"}}if(this._requiredAncillaryInfo.billingInfo.details===s.MIN){return{name:"John Smith",countryCode:"US",postalCode:"012345",phoneNumber:this._requiredAncillaryInfo?.billingInfo.phoneRequired?"+1(203)555-1234":"",emailAddress:"customer@domain.com"}}}}getShippingInfo(){if(this._requiredAncillaryInfo?.shippingInfo)return{addressLines:["123 Main St.","2nd floor","Suite 2030"],name:"John Smith",countryCode:"US",administrativeArea:"NY",postalCode:"012345",locality:"New York",phoneNumber:this._requiredAncillaryInfo?.shippingInfo.phoneRequired?"+1(203)555-1234":"",emailAddress:"customer@domain.com"}}completeSession(e){}}var c=r(945);function d(e,t){if(e||t)return e?t?`${e} ${t}`:e:t}function u(e){let t;if("localhost"===window.location.hostname&&"Dev"===e)t=`${window.location.origin}`;else{t=`https://static${"Prod"===e?"":"-oper"}.pcibooking.net`}return`${t}/pay/`}function h(e){return`${u(e)}#/`}function p(...e){const t=[];return e.forEach((e=>{e&&t.push(e)})),t}async function f(e,t=""){const r={method:"GET",headers:{Authorization:""}};return t&&(r.headers.Authorization=`Bearer ${t}`),(0,c.fetch)(e,r).then((e=>g(e)))}async function y(e,t="",r,n="application/json"){const o={method:"POST",body:JSON.stringify(r),headers:{"Content-Type":n,Authorization:""}};return t&&(o.headers.Authorization=`Bearer ${t}`),(0,c.fetch)(e,o).then((e=>g(e)))}async function g(e){if(e.status>=400)throw new Error("Bad response from server");return e.json()}function m(e){var t=e.split("/");return e=t[0]+"//"+t[2]}async function _(e){return new Promise(((t,r)=>{var n=document.createElement("script");n.src=e,n.addEventListener("load",(e=>t(e))),n.onerror=()=>{r(new Error("Failed to load script."))},document.body.appendChild(n)}))}class GooglePay{API_VERSION=2;API_MINOR_VERSION=0;_googlePayClient=null;_config;_request;_requiredAncillaryInfo=void 0;_receivedBillingAddress=void 0;_receivedShippingAddress=void 0;_receivedEmailAddress;constructor(e,t,r){this._request=e,this._config=t,this._requiredAncillaryInfo=r}_cardPaymentMethod={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:[]}};_directTokenizationSpecification={type:"DIRECT",parameters:{protocolVersion:"ECv2",publicKey:""}};_googlePayConfiguration={apiVersion:this.API_VERSION,apiVersionMinor:this.API_MINOR_VERSION,allowedPaymentMethods:[]};worksWithPaymentGateway=!0;rendersButton=!1;requiresLanguageResource=!1;name="GooglePay";async isAvailable(){try{if(!await _("https://pay.google.com/gp/p/pay.js"))return Promise.resolve(!1);this._googlePayClient=new google.payments.api.PaymentsClient({environment:"TEST"===this._request.mode?"TEST":"PRODUCTION"}),this._directTokenizationSpecification.parameters.publicKey=this._config.pub,this._cardPaymentMethod.tokenizationSpecification=this._directTokenizationSpecification,this._cardPaymentMethod.parameters.allowedCardNetworks=this.populateCardNetworks(),this._googlePayConfiguration.allowedPaymentMethods=[this._cardPaymentMethod];const t={...this._googlePayConfiguration};try{var e=await(this._googlePayClient?.isReadyToPay(t));return Promise.resolve(e.result)}catch{return Promise.resolve(!1)}}catch(e){return console.error(e),Promise.resolve(!1)}}createButton(e,t,r){var n={onClick:t=>e(t,"GooglePay"),allowedPaymentMethods:[this._cardPaymentMethod]};t&&(n.buttonColor=this.populateButtonColor(t?.color),n.buttonType=this.populateButtonType(t?.text),n.buttonLocale=this._request.language);const o=this._googlePayClient?.createButton(n);return o}populateButtonColor(e){switch(e){case"Dark":return"black";case"Light":return"white";default:return"default"}}populateButtonType(e){switch(e){case"Book":return"book";case"Buy":return"buy";case"Checkout":return"checkout";case"Donate":return"donate";case"Pay":return"pay";case"Subscribe":return"subscribe";default:return"plain"}}async startSession(e){const t={allowedPaymentMethods:[{type:"CARD",tokenizationSpecification:this._directTokenizationSpecification,parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:this.populateCardNetworks(),billingAddressRequired:null!=this._requiredAncillaryInfo?.billingInfo,billingAddressParameters:{format:this._requiredAncillaryInfo?.billingInfo?.details??"MIN",phoneNumberRequired:this._requiredAncillaryInfo?.billingInfo?.phoneRequired??!1}}}],apiVersion:this.API_VERSION,apiVersionMinor:this.API_MINOR_VERSION,merchantInfo:{merchantId:this._config.mid,merchantName:this._config.mname},shippingAddressRequired:null!=this._requiredAncillaryInfo?.shippingInfo,emailRequired:this._requiredAncillaryInfo?.billingInfo?.emailAddressRequired||this._requiredAncillaryInfo?.shippingInfo?.emailAddressRequired,transactionInfo:{totalPriceStatus:"FINAL",totalPrice:this._request.amt.toString(),currencyCode:this._request.cur,countryCode:this._request.ctry}};try{const e=await(this._googlePayClient?.loadPaymentData(t));if(!e)throw new Error("paymentData not available");console.log("Loaded paymentData from GooglePay"),console.log(e);const r=e?.paymentMethodData;this._receivedBillingAddress=e?.paymentMethodData?.info?.billingAddress,this._receivedShippingAddress=e?.shippingAddress,this._receivedEmailAddress=e?.email;const n=r?.tokenizationData;return{success:!0,message:void 0,data:n?.token,resultCode:"OK"}}catch(e){const t=`loadPaymentData error: ${e}`;return console.error(t),{success:!1,data:void 0,message:t,resultCode:"Other"}}}getBillingInfo(){if(this._receivedBillingAddress){if(this._requiredAncillaryInfo?.billingInfo?.details===s.FULL){return{addressLines:p(this._receivedBillingAddress.address1,this._receivedBillingAddress.address2,this._receivedBillingAddress.address3),name:this._receivedBillingAddress.name,countryCode:this._receivedBillingAddress.countryCode,administrativeArea:this._receivedBillingAddress.administrativeArea,postalCode:this._receivedBillingAddress.postalCode,locality:this._receivedBillingAddress.locality,phoneNumber:this._receivedBillingAddress.phoneNumber,emailAddress:this._receivedEmailAddress}}if(this._requiredAncillaryInfo?.billingInfo?.details===s.MIN){return{name:this._receivedBillingAddress.name,countryCode:this._receivedBillingAddress.countryCode,postalCode:this._receivedBillingAddress.postalCode,phoneNumber:this._receivedBillingAddress.phoneNumber,emailAddress:this._receivedEmailAddress}}}}getShippingInfo(){if(!this._receivedShippingAddress)return;return{addressLines:p(this._receivedShippingAddress.address1,this._receivedShippingAddress.address2,this._receivedShippingAddress.address3),name:this._receivedShippingAddress.name,countryCode:this._receivedShippingAddress.countryCode,administrativeArea:this._receivedShippingAddress.administrativeArea,postalCode:this._receivedShippingAddress.postalCode,locality:this._receivedShippingAddress.locality,phoneNumber:this._receivedShippingAddress.phoneNumber,emailAddress:this._receivedEmailAddress}}completeSession(e){}populateCardNetworks(){const e=[];return this._request.brnd.forEach((t=>{let r;switch(t){case"AMEX":r="AMEX";break;case"Discover":r="DISCOVER";break;case"JCB":r="JCB";break;case"MasterCard":r="MASTERCARD";break;case"Visa":r="VISA"}r&&e.push(r)})),e}}class ExpectedEvent{timer;allowedOrigin;messageType;resolver;rejector}class Message{messageType;payload}let v=[],w=!1;const b=function(e){console.log("message received onmessage"),console.log(e);const t=e.data,r=A(e.origin,t.messageType);if(r)return window.clearTimeout(r.timer),t?r.resolver(t.payload):void 0};function A(e,t){let r=!1;for(var n=0;n<v.length;n++)if((!v[n].allowedOrigin||"*"===v[n].allowedOrigin||v[n].allowedOrigin===e)&&t===v[n].messageType){r=!0;break}if(!r)return;const o=v.splice(n,1)[0];return 0===v.length&&(window.removeEventListener("message",b),w=!1),o}async function P(e,t=void 0,r=void 0){const n=new ExpectedEvent;n.messageType=e,n.allowedOrigin=t,w||(w=!0,window.onmessage=b);const o=new Promise(((e,t)=>{n.resolver=e,n.rejector=t}));return v.push(n),console.log(`Number of expected messages: ${v.length}`),r&&(n.timer=window.setTimeout((()=>{A(n.allowedOrigin,n.messageType),n.rejector(`Timed out after ${r} milli-seconds`)}),r)),o}class PaymentResults_PerformPaymentRequestBase{providerName;countryCode}class EveriFin{async getPaymentMessage(e,t,r){const n=m(e),o=await P("PaymentId",n,3e5);if(console.log(o),!o?.success)return;const s=new EverifinPaymentSessionData;s.paymentId=o.paymentId,s.orderId=r.data,s.providerName="EveriFin";return JSON.stringify(s)}getBillingInfo(){}}class EverifinPaymentSessionData extends PaymentResults_PerformPaymentRequestBase{paymentId;orderId}class Usio{_contactInfo;async getPaymentMessage(e,t,r){const n=m(e);if(!await P("Ready",n,5e3))return;const o=new Message;o.messageType="USAccount",o.payload={language:"en",branding:"",publicKey:r.data},console.log(o),console.log("Sending public Key to popup window"),t.postMessage(o,n);const s=await P("USAccount",n,3e5);if(console.log(s),!s)return;const i=s;this._contactInfo={addressLines:[i.address1,i.address2],locality:i.city,administrativeArea:i.state,countryCode:"US",emailAddress:i.emailAddress,phoneNumber:void 0,postalCode:i.zip,name:`${i.firstName} ${i.lastName}`},i.providerName="Usio";return JSON.stringify(i)}getBillingInfo(){return this._contactInfo}}var S;!function(e){let t;!function(e){e.en="en",e.he="he",e.cs="cs",e.el="el",e.de="de",e.es="es",e.fi="fi",e.fr="fr",e.it="ja",e.ko="ko",e.no="no",e.nl="nl",e.pl="pl",e.pt="pt",e.ru="ru",e.sk="sk",e.sr="sr",e.sv="sv",e.tr="tr",e.zh="zh",e.xx="xx"}(t=e.supportedLanguages||(e.supportedLanguages={}));const r=t.en;let n={};const o=Object.keys(t);e.autoDetectLanguage=function(){return navigator.languages.forEach((e=>{const t=e.split("-")[0];if(o.includes(t))return t})),r},e.setLanguage=async function(e,t="Prod"){n={};try{const r=`${function(e){return`${u(e)}assets/i18n/`}(t)}${e}.json`;return n=await f(r),!0}catch(e){return console.error(e),!1}},e.text=function(e){return n[e]||`--${e}--`}}(S||(S={}));class BankPay{constructor(e,t,r){this._request=e,this._config=t,this._requiredAncillaryInfo=r}worksWithPaymentGateway=!1;rendersButton=!1;requiresLanguageResource=!0;name="BankPay";_config;_request;_requiredAncillaryInfo;_selectedProvider;_overlay;_popupWindowObjectReference;isAvailable(){return Promise.resolve(!0)}createButton(e,t,r){const n=t?.text??"Pay",o=`${S.text(n)} ${S.text("By")} ${S.text("BankTransfer")}`;return i.renderButton((t=>{e(t,"BankPay")}),t,o)}getBillingInfo(){return this._selectedProvider?.getBillingInfo()}getShippingInfo(){}async startSession(e){const t={success:!1,message:"Unknown error",data:void 0,resultCode:"Other"},r=this.getCountrySelectionUrl(),n=new Promise((e=>{console.log("Opening popup to "+r),this._popupWindowObjectReference=i.popupCenter(r,"Card entry",800,600,(()=>{console.log("Popup window was closed"),e()}))})),o=m(r);if(!this._popupWindowObjectReference){const e="Could not open a popup window";return console.error(e),t.message=e,t}this._overlay=i.setOverlay(this._popupWindowObjectReference);try{const r=(async()=>{try{const e=await P("Ready",o,5e3);console.log(e)}catch(e){const r="Ready message was not received within 5 seconds";return console.error(r),t.message=r,t}await this.sendCountryList(this._popupWindowObjectReference,o);try{const n=await P("Country",o,18e4);if(console.log(n),!n){const e="No country was selected";return console.error(e),t.message=e,t}const s=await e(JSON.stringify(n));if(!s){const e="Could not get bank authorization (empty)";return console.error(e),t.message=e,t}if(console.log(s),!s?.Success){const e=`Could not get bank authorization. Message: ${s?.Message}`;return console.error(e),t.message=e,t}const i=JSON.parse(s.Data);switch(console.log(i),i.providerName){case"EveriFin":this._selectedProvider=new EveriFin;break;case"Usio":this._selectedProvider=new Usio;break;default:const e=`Cannot find implementation for bank provider: ${i.providerName}`;return console.error(e),t.message=e,t}var r=await this.handlePaymentAuthorization(this._popupWindowObjectReference,o,i);return console.log("paymentValidationResults:"),console.log(r),t.success=!0,t.message=void 0,t.data=r,t}catch(e){return console.error(e),t.message=e,t}})();return await Promise.race([r,n.then((()=>(t.message="Popup window was closed",t)))])}catch(e){return console.error(e),t.message=e instanceof Error?e.message:"Unknown error occurred",t}finally{this._overlay?.remove(),this._popupWindowObjectReference?.close()}}async handlePaymentAuthorization(e,t,r){if(!e)return;const n=new Message;n.messageType="AuthUrl",n.payload=r.authUrl,console.log("Sending message to iFrame with origin: "+t),console.log(n),e.postMessage(n,t);const o=this.getAuthorizationRedirectUrl(r.providerName);try{console.log("Awaiting up to 5 minutes for authorization");return await this._selectedProvider.getPaymentMessage(o,e,r)}catch(e){return void console.error(e)}}async sendCountryList(e,t){if(!e)return;const r=new Message;r.messageType="CountryList";const n=`${this._request.url}/coveredCountries`;console.log("url: "+n),r.payload=await f(n),r.payload.language=this._request.language,r.payload.branding=this._request.brndng,console.log(r),console.log("Sending country list to popup window"),e.postMessage(r,t)}completeSession(e){}getCountrySelectionUrl(){return`${h(this._request.stg)}countrySelect`}getAuthorizationRedirectUrl(e){return`${h(this._request.stg)}/${e.toLowerCase()}`}}class ApplePay{_config;_request;APPLE_JS_VERSION=12;_applePaySession;_requiredAncillaryInfo;_receivedBillingInfo;_receivedShippingAddress;constructor(e,t,r){this._request=e,this._config=t,this._requiredAncillaryInfo=r}worksWithPaymentGateway=!0;rendersButton=!1;requiresLanguageResource=!1;name="ApplePay";async isAvailable(){if(!await _("https://applepay.cdn-apple.com/jsapi/v1.1.0/apple-pay-sdk.js"))return Promise.resolve(!1);var e;try{ApplePaySession.supportsVersion(this.APPLE_JS_VERSION)?e=ApplePaySession.canMakePayments():(e=!1,console.log("Not supported version. See https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778014-supportsversion"))}catch{e=!1}return new Promise((t=>{t(e)}))}createButton(e,t,r){const n=document.createElement("apple-pay-button");return t&&(n.setAttribute("buttonstyle",this.populateButtonColor(t.color)),n.setAttribute("type",this.populateButtonType(t.text)),n.setAttribute("locale",this._request.language)),n.title="Click to pay by Apple Pay",n.style.appearance="-apple-pay-button",n.onclick=t=>e(t,"ApplePay"),n}populateButtonColor(e){switch(e){case"Dark":default:return"black";case"Light":return"white"}}populateButtonType(e){switch(e){case"Book":return"book";case"Buy":return"buy";case"Checkout":return"check-out";case"Donate":return"donate";case"Pay":return"pay";case"Subscribe":return"subscribe";default:return"plain"}}async startSession(e){const t={currencyCode:this._request.cur,countryCode:this._request.ctry,merchantCapabilities:["supports3DS","supportsCredit","supportsDebit"],supportedNetworks:this.populateCardNetworks(),total:{label:this._config.mname,amount:this._request.amt.toString(),type:"final"}};return this._requiredAncillaryInfo&&(this._requiredAncillaryInfo.billingInfo&&(t.requiredBillingContactFields=["postalAddress","name","phone","email"]),this._requiredAncillaryInfo.shippingInfo&&(t.requiredShippingContactFields=["postalAddress","name"],this._requiredAncillaryInfo.shippingInfo.emailAddressRequired&&t.requiredShippingContactFields.push("email"),this._requiredAncillaryInfo.shippingInfo.phoneRequired&&t.requiredShippingContactFields.push("phone"))),this._applePaySession=new ApplePaySession(this.APPLE_JS_VERSION,t),new Promise(((t,r)=>{this._applePaySession.onvalidatemerchant=t=>{const r=JSON.stringify({appleUrl:t.validationURL});e(r).then((e=>{if(console.log("sessionValidationCallback handling completion; Session data follows"),console.log(e?.Data),!e?.Success)throw new Error(`Bad response from session Validation ${e?.Message}`);var t=JSON.parse(e?.Data);console.log("data to completeMerchantValidation:"),console.log(e?.Data),this._applePaySession.completeMerchantValidation(t),console.log("onvalidatemerchant event handling completion")})).catch((e=>{console.error(e)}))},this._applePaySession.oncancel=e=>{console.log("oncancel event fired"),console.log(e);t({success:!1,message:"User canceled transaction",data:void 0,resultCode:"Canceled"})},this._applePaySession.onpaymentauthorized=e=>{console.log("onpaymentauthorized event fired"),this._receivedBillingInfo=e.payment?.billingContact,this._receivedShippingAddress=e.payment.shippingContact;try{console.log(e),this._applePaySession.completePayment({status:ApplePaySession.STATUS_SUCCESS});const r={success:!0,message:void 0,data:JSON.stringify(e.payment.token),resultCode:"OK"};t(r)}catch(e){console.error("onpaymentauthorized error"),console.error(e),r(e)}},this._applePaySession.begin()}))}getBillingInfo(){if(this._receivedBillingInfo){if(this._requiredAncillaryInfo?.billingInfo?.details===s.FULL){return{addressLines:this._receivedBillingInfo.addressLines??[],name:d(this._receivedBillingInfo.givenName,this._receivedBillingInfo.familyName),countryCode:this._receivedBillingInfo.countryCode,administrativeArea:this._receivedBillingInfo.administrativeArea,postalCode:this._receivedBillingInfo.postalCode,locality:this._receivedBillingInfo.locality,phoneNumber:this._receivedBillingInfo.phoneNumber,emailAddress:this._receivedBillingInfo.emailAddress}}if(this._requiredAncillaryInfo?.billingInfo?.details===s.MIN){return{name:d(this._receivedBillingInfo.givenName,this._receivedBillingInfo.familyName),countryCode:this._receivedBillingInfo.countryCode,postalCode:this._receivedBillingInfo.postalCode,phoneNumber:this._receivedBillingInfo.phoneNumber,emailAddress:this._receivedBillingInfo.emailAddress}}}}getShippingInfo(){if(!this._receivedShippingAddress)return;return{addressLines:this._receivedShippingAddress.addressLines??[],name:d(this._receivedShippingAddress.givenName,this._receivedShippingAddress.familyName),countryCode:this._receivedShippingAddress.countryCode,administrativeArea:this._receivedShippingAddress.administrativeArea,postalCode:this._receivedShippingAddress.postalCode,locality:this._receivedShippingAddress.locality,phoneNumber:this._receivedShippingAddress.phoneNumber,emailAddress:this._receivedShippingAddress.emailAddress}}completeSession(e){const t=e?ApplePaySession.STATUS_SUCCESS:ApplePaySession.STATUS_FAILURE,r={status:t};console.log(`Reporting session status: ${JSON.stringify(r)}`);try{this._applePaySession.completePayment(t)}catch(e){console.error(e)}}populateCardNetworks(){const e=[];return this._request.brnd.forEach((t=>{let r;switch(t){case"AMEX":r="amex";break;case"UnionPay":r="chinaUnionPay";break;case"Dankort":r="dankort";break;case"Discover":r="discover";break;case"Electron":r="electron";break;case"Elo":r="elo";break;case"JCB":r="jcb";break;case"MasterCard":r="masterCard";break;case"Maestro":r="maestro";break;case"Visa":r="visa"}r&&e.push(r)})),e}}function C(e){var t=e.sdkBaseUrl,r=e.environment,n=
/*!
* paypal-js v8.2.0 (2025-01-23T17:26:53.747Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["sdkBaseUrl","environment"]),o=t||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(r),s=n,i=Object.keys(s).filter((function(e){return void 0!==s[e]&&null!==s[e]&&""!==s[e]})).reduce((function(e,t){var r,n=s[t].toString();return r=function(e,t){return(t?"-":"")+e.toLowerCase()},"data"===(t=t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===t?e.attributes[t]=n:e.queryParams[t]=n,e}),{queryParams:{},attributes:{}}),a=i.queryParams,l=i.attributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(l["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(o,"?").concat(E(a)),attributes:l}}function E(e){var t="";return Object.keys(e).forEach((function(r){0!==t.length&&(t+="&"),t+=r+"="+e[r]})),t}function I(e,t){void 0===t&&(t={});var r=document.createElement("script");return r.src=e,Object.keys(t).forEach((function(e){r.setAttribute(e,t[e]),"data-csp-nonce"===e&&r.setAttribute("nonce",t["data-csp-nonce"])})),r}function k(e,t){if(void 0===t&&(t=Promise),O(e,t),"undefined"==typeof document)return t.resolve(null);var r=C(e),n=r.url,o=r.attributes,s=o["data-namespace"]||"paypal",i=B(s);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(e,t){var r=document.querySelector('script[src="'.concat(e,'"]'));if(null===r)return null;var n=I(e,t),o=r.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(n.dataset).length)return null;var s=!0;return Object.keys(o.dataset).forEach((function(e){o.dataset[e]!==n.dataset[e]&&(s=!1)})),s?r:null}(n,o)&&i?t.resolve(i):function(e,t){void 0===t&&(t=Promise);O(e,t);var r=e.url,n=e.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new t((function(e,t){if("undefined"==typeof document)return e();!function(e){var t=e.url,r=e.attributes,n=e.onSuccess,o=e.onError,s=I(t,r);s.onerror=o,s.onload=n,document.head.insertBefore(s,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(r,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return t(e)}})}))}({url:n,attributes:o},t).then((function(){var e=B(s);if(e)return e;throw new Error("The window.".concat(s," global variable is not available."))}))}function B(e){return window[e]}function O(e,t){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var r=e.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==t&&"function"!=typeof t)throw new Error("Expected PromisePonyfill to be a