@payfurl/client 4.10.0 → 4.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/README.md +76 -0
- package/dist/sdk/{CloseIcon-B65NDIbM.js → CloseIcon-Ejad61tT.js} +377 -363
- package/dist/sdk/{DefaultThreeDsProvider-CzqbXEws.js → DefaultThreeDsProvider-bLoDSnkd.js} +24 -24
- package/dist/sdk/{MetricsGlobalThreeDsProvider-B-EQQsEV.js → MetricsGlobalThreeDsProvider-C93ttqbB.js} +16 -16
- package/dist/sdk/{PayWayAppleButton-C-XfcgNS.js → PayWayAppleButton-B1Ttj4J_.js} +1 -1
- package/dist/sdk/{alerts-BvNnAm_q.js → alerts-1YSRy5iI.js} +9 -9
- package/dist/sdk/{cxpay-VbaQA3_P.js → cxpay-DblHb5vN.js} +1 -1
- package/dist/sdk/{default-Diji0SXY.js → default-C7f86Fx-.js} +1 -1
- package/dist/sdk/{ecentric-BlNDCZo_.js → ecentric-B3UohyO_.js} +11 -11
- package/dist/sdk/{epna-CxmJ_mqR.js → epna-DwUg2IlB.js} +1 -1
- package/dist/sdk/{flashbanc-BAxvqtBB.js → flashbanc-LXs8bahL.js} +1 -1
- package/dist/sdk/forter-CLFaJUYa.js +30 -0
- package/dist/sdk/{gpayments-B5KWQV4S.js → gpayments-DoZug3PV.js} +13 -13
- package/dist/sdk/{metrics_global-HMMDzPlb.js → metrics_global-BM-ooge-.js} +1 -1
- package/dist/sdk/{nmi-Ch7qQ6Av.js → nmi-BA3ZTdQa.js} +1 -1
- package/dist/sdk/{nuvei-DRmlfpTL.js → nuvei-DIWsLlLz.js} +29 -29
- package/dist/sdk/{payabli-CiBJ1-vC.js → payabli-DgrTI1Et.js} +1 -1
- package/dist/sdk/payfurl.d.ts +35 -3
- package/dist/sdk/payfurl.es.js +1121 -834
- package/dist/sdk/payfurl.umd.js +8 -8
- package/dist/sdk/{payglocal-uAPlijwL.js → payglocal-ezp0MsaZ.js} +18 -18
- package/dist/sdk/{payway_rest-CjgIP42z.js → payway_rest-4Pjb1c7k.js} +1 -1
- package/dist/sdk/{skybank-D7uRF17E.js → skybank-BgDLlFXX.js} +1 -1
- package/dist/sdk/{strings-BthDdeA6.js → strings-DyifLS9r.js} +13 -13
- package/dist/sdk/style.css +1 -1
- package/dist/sdk/whenRendered-jR4Jls4M.js +12 -0
- package/package.json +1 -1
- package/dist/sdk/forter-R2alfHeE.js +0 -26
package/dist/sdk/payfurl.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.payfurl=t())})(this,function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function d(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var f,p=o((()=>{f={baseUrl:``,cssUrl:``,redirectUrl:``,url:``,secureUrl:`/dist/secure/index.html`,apiUrl:``,errorUrl:`https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws`}})),m,h=o((()=>{m={baseUrl:`https://assets.payfurl.com`,cssUrl:`https://assets.payfurl.com/v4.10.0/js/`,url:`https://assets.payfurl.com/v4.10.0/iframe/index.html`,secureUrl:`https://assets.payfurl.com/v4.10.0/secure/index.html`,redirectUrl:`https://assets.payfurl.com/v4.10.0/checkout/redirect.html`,apiUrl:`https://develop-api.payfurl.com`,errorUrl:`https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws`}})),g,_=o((()=>{g={baseUrl:`https://assets.payfurl.com`,cssUrl:`https://assets.payfurl.com/v4.10.0/js/`,url:`https://assets.payfurl.com/v4.10.0/iframe/index.html`,secureUrl:`https://assets.payfurl.com/v4.10.0/secure/index.html`,redirectUrl:`https://assets.payfurl.com/v4.10.0/checkout/redirect.html`,apiUrl:`https://sandbox-api.payfurl.com`,errorUrl:`https://gujl7xo5fhpkjaain4swyiymt40loyia.lambda-url.ap-southeast-2.on.aws`}})),v,y=o((()=>{v={baseUrl:`https://assets.payfurl.com`,cssUrl:`https://assets.payfurl.com/v4.10.0/js/`,url:`https://assets.payfurl.com/v4.10.0/iframe/index.html`,secureUrl:`https://assets.payfurl.com/v4.10.0/secure/index.html`,redirectUrl:`https://assets.payfurl.com/v4.10.0/checkout/redirect.html`,apiUrl:`https://api.payfurl.com`,errorUrl:`https://4rvkh6tupgcmqk3b2igkpdi2zi0mveyg.lambda-url.ap-southeast-2.on.aws`}})),b,ee,te,ne,x,S,re,ie,ae,oe,se,ce,le,ue,de=o((()=>{b=`@payfurl/client`,ee=`4.10.0`,te=`https://docs.payfurl.com/client_sdk/overview`,ne={url:`https://docs.payfurl.com/support`},x=[`dist/sdk`,`CHANGELOG.md`],S=`module`,re=`./dist/sdk/payfurl.umd.js`,ie=`./dist/sdk/payfurl.es.js`,ae=`./dist/sdk/payfurl.d.ts`,oe={".":{types:`./dist/sdk/payfurl.d.ts`,import:`./dist/sdk/payfurl.es.js`,require:`./dist/sdk/payfurl.umd.js`}},se={dev:`node .build/config-local.mjs && vite -c vite.iframe.config.ts`,"build-iframe":`node .build/config-local.mjs && vite build -c vite.iframe.config.ts --emptyOutDir`,"build-secure":`node .build/config-local.mjs && vite build -c vite.secure.config.ts --emptyOutDir`,"build-sdk":`node .build/config-local.mjs && vite build -c vite.sdk.config.ts`,build:`npm run build-all`,"build-all":`npm run build-iframe && npm run build-secure && npm run build-sdk`,preview:`vite preview`,server:`python3 -m http.server 3001`,test:`node .build/config-local.mjs && jest`,"update-packages":`ncu -u && npm update --save`,remove_js:`git ls-files -o --exclude-standard | grep '.js' | xargs rm`,remove_d_ts:`git ls-files -o --exclude-standard | grep '.d.ts' | xargs rm`},ce={dayjs:`^1.11.13`,vue:`^3.5.10`},le={"@babel/preset-env":`^7.25.4`,"@babel/types":`^7.25.6`,"@jest/globals":`^29.7.0`,"@rollup/plugin-typescript":`^12.1.0`,"@types/applepayjs":`^14.0.8`,"@types/jest":`^29.5.13`,"@types/jest-when":`^3.5.5`,"@types/node":`^22.7.4`,"@vitejs/plugin-vue":`^6.0.7`,"@vue/eslint-config-prettier":`^9.0.0`,"@vue/eslint-config-typescript":`^13.0.0`,"@vue/vue3-jest":`^29.2.6`,"babel-jest":`^29.7.0`,eslint:`^8.56.0`,"eslint-plugin-vue":`^9.28.0`,jest:`^29.7.0`,"jest-environment-jsdom":`^29.7.0`,"jest-when":`^3.6.0`,prettier:`^3.3.3`,"rollup-plugin-visualizer":`^5.12.0`,"ts-jest":`^29.2.5`,"ts-node":`^10.9.2`,tslib:`^2.8.1`,typescript:`^5.6.2`,vite:`^8.0.16`,"vite-plugin-checker":`^0.8.0`,"vite-plugin-dts":`^4.5.4`,"vue-tsc":`^2.1.6`},ue={name:b,private:!1,version:ee,homepage:te,bugs:ne,files:x,type:S,main:re,module:ie,types:ae,exports:oe,scripts:se,dependencies:ce,devDependencies:le}}));function fe(e){let t=me[e];return t&&Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.split(`{VERSION}`).join(ue.version)]))}function pe(e){let t=me[e];return t||=me[C.PRODUCTION],t.errorUrl}var C,me,he=o((()=>{p(),h(),_(),y(),de(),(function(e){e.LOCAL=`local`,e.DEVELOPMENT=`development`,e.SANDBOX=`sandbox`,e.PRODUCTION=`production`})(C||={}),me={[C.LOCAL]:f,[C.DEVELOPMENT]:m,[C.SANDBOX]:g,[C.PRODUCTION]:v}})),ge,_e=o((()=>{ge=class{publicKey=``;version=``;regionResolver=null;constructor(e,t,n){this.publicKey=e||``,this.version=t||``,this.regionResolver=n||null}invoke(e,t,n,r,i,a){let o=new XMLHttpRequest;o||i?.(0,``),o.onreadystatechange=function(){o.readyState===4&&(o.status===200||o.status===201?r?.(o.status,o.responseText):i?.(o.status,o.responseText))};let s=new URL(e);if(this.regionResolver&&(s.hostname=new URL(this.regionResolver.getRegionUrl()).hostname),o.open(t,s.toString()),o.setRequestHeader(`Content-Type`,`application/json`),this.publicKey&&o.setRequestHeader(`x-publickey`,this.publicKey),this.version&&o.setRequestHeader(`sdk-version`,this.version),a)for(let[e,t]of Object.entries(a))o.setRequestHeader(e,t);o.send(String(n))}}}));function ve(){let e=[1,4,8,15,16,24,32,48],t=screen.colorDepth;if(e.indexOf(t)==-1){let n=e[0],r=Math.abs(e[0]-t);for(let i=1;i<=e.length;i++){let a=Math.abs(e[i]-t);a<r&&(n=e[i],r=a)}t=n}return t}var ye=o((()=>{}));he(),_e(),ye();var be=class e{static instance;static environment;static publicKey;static version;httpInvoker=null;constructor(){if(e.instance)return e.instance;this.httpInvoker=new ge,e.instance=this}static init(t,n,r){return e.environment=t,e.publicKey=n,e.version=r,new e}sendError(t,n,r){try{let i=pe(e.environment),a=new Date;this.httpInvoker?.invoke(i,`POST`,JSON.stringify({method:t,message:n,context:{publicKey:e.publicKey,version:e.version,environment:e.environment,browser:{userAgent:navigator.userAgent,language:window.navigator.language,colorDepth:String(ve()),screenHeight:screen.height+``,screenWidth:screen.width+``,timezone:Math.round(a.getTimezoneOffset()/60)+``,referrer:document.referrer}},arguments:Object.values(r).map(e=>typeof e==`object`?JSON.stringify(e):String(e))}))}catch(e){console.error(`Error sending error`,e)}}};function xe(e){return`**** **** **** `+e.replace(/[\s-]/g,``).slice(-4)}function Se(e){let t=e.replace(/[\s-]/g,``);return Ee.test(e.trim())&&t.length>=12&&t.length<=19?xe(e):De.test(t)?`***`:e}function Ce(e,t=new WeakSet){if(typeof e==`string`)return Se(e);if(typeof e!=`object`||!e)return e;if(t.has(e))return`[circular]`;if(t.add(e),Array.isArray(e))return e.map(e=>Ce(e,t));if(e instanceof Error)return{name:e.name,message:e.message};let n={};if(e.constructor!==Object&&e.constructor!==void 0&&e.name!==`click2PayError`)return n;for(let r of Object.keys(e)){let i=e[r];if(typeof i==`function`||typeof Node<`u`&&i instanceof Node)continue;let a=r.toLowerCase();n[r]=we.includes(a)&&i?xe(String(i)):Te.includes(a)&&i!=null&&i!==``?`***`:Ce(i,t)}return n}var we,Te,Ee,De,Oe=o((()=>{we=[`cardnumber`,`acctnumber`],Te=[`ccv`,`cvv`,`cvv2`,`cvc`,`cvc2`,`csc`,`securitycode`,`cardsecuritycode`,`paymentdata`,`tokenizationdata`,`cryptogram`,`onlinepaymentcryptogram`,`authenticationvalue`,`cavv`,`recognitiontoken`,`otp`],Ee=/^\d[\d -]{10,24}\d$/,De=/^\d{3,4}$/}));Oe();function w(e,t,n){let r=n.value;n.value=function(){try{return r.apply(this,arguments)}catch(e){throw new be().sendError(t,e.message,Ae(Array.from(arguments))),console.warn(`[ErrorHandled], exception`,{error:e,propertyKey:t,arguments:Ae(Array.from(arguments))}),e}}}function T(e,t,n){return function(...r){try{return n.apply(e,r)}catch(e){throw new be().sendError(t,e.message,Ae(r)),console.warn(`[ErrorHandledFunction], exception`,{error:e,funcName:t,args:Ae(r)}),e}}}function ke(e,t,n){new be().sendError(e,t,Ae(n))}function Ae(e){return e.map(e=>Ce(e))}function je(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}function Me(e){if(O(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=A(r)?Ne(r):Me(r);if(i)for(let e in i)t[e]=i[e]}return t}if(A(e)||j(e))return e}function Ne(e){let t={};return e.replace(St,e=>e.startsWith(`/*`)?``:e).split(bt).forEach(e=>{if(e){let n=e.split(xt);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Pe(e){let t=``;if(A(e))t=e;else if(O(e))for(let n=0;n<e.length;n++){let r=Pe(e[n]);r&&(t+=r+` `)}else if(j(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function Fe(e){return!!e||e===``}function Ie(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Be(e[i],t[i],n);return r}function Le(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Be(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Re(e,t,n){let r=Xe(e),i=Xe(t);if(r||i||(r=Ze(e),i=Ze(t),r||i))return r&&i?Le(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Be(e[r],t[r],n))return!1}return String(e)===String(t)}function ze(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Be(e,t,n){if(e===t)return!0;let r=Qe(e),i=Qe(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=$e(e),i=$e(t),r||i?e===t:(r=O(e),i=O(t),r||i?r&&i?ze(e,t,n,Ie):!1:(r=j(e),i=j(t),r||i?!r||!i?!1:ze(e,t,n,Re):String(e)===String(t))))}function Ve(e,t){return e.findIndex(e=>Be(e,t))}var E,He,Ue,We,Ge,Ke,qe,Je,Ye,D,O,Xe,Ze,Qe,k,A,$e,j,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,M,Et,Dt,Ot=o((()=>{E={},He=[],Ue=()=>{},We=()=>!1,Ge=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ke=e=>e.startsWith(`onUpdate:`),qe=Object.assign,Je=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},Ye=Object.prototype.hasOwnProperty,D=(e,t)=>Ye.call(e,t),O=Array.isArray,Xe=e=>nt(e)===`[object Map]`,Ze=e=>nt(e)===`[object Set]`,Qe=e=>nt(e)===`[object Date]`,k=e=>typeof e==`function`,A=e=>typeof e==`string`,$e=e=>typeof e==`symbol`,j=e=>typeof e==`object`&&!!e,et=e=>(j(e)||k(e))&&k(e.then)&&k(e.catch),tt=Object.prototype.toString,nt=e=>tt.call(e),rt=e=>nt(e).slice(8,-1),it=e=>nt(e)===`[object Object]`,at=e=>A(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ot=je(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),st=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ct=/-\w/g,lt=st(e=>e.replace(ct,e=>e.slice(1).toUpperCase())),ut=/\B([A-Z])/g,dt=st(e=>e.replace(ut,`-$1`).toLowerCase()),ft=st(e=>e.charAt(0).toUpperCase()+e.slice(1)),pt=st(e=>e?`on${ft(e)}`:``),mt=(e,t)=>!Object.is(e,t),ht=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},gt=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},_t=e=>{let t=parseFloat(e);return isNaN(t)?e:t},yt=()=>vt||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},bt=/;(?![^(]*\))/g,xt=/:([^]+)/,St=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g,Ct=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,wt=je(Ct),Tt=e=>!!(e&&e.__v_isRef===!0),M=e=>A(e)?e:e==null?``:O(e)||j(e)&&(e.toString===tt||!k(e.toString))?Tt(e)?M(e.value):JSON.stringify(e,Et,2):String(e),Et=(e,t)=>Tt(t)?Et(e,t.value):Xe(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Dt(t,r)+` =>`]=n,e),{})}:Ze(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Dt(e))}:$e(t)?Dt(t):j(t)&&!O(t)&&!it(t)?String(t):t,Dt=(e,t=``)=>$e(e)?`Symbol(${e.description??t})`:e}));function kt(){return Cn}function At(e,t=!1){e.flags|=8,t?(e.next=kn,kn=e):(e.next=On,On=e)}function jt(){Dn++}function Mt(){if(--Dn>0)return;if(kn){let e=kn;for(kn=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;On;){let t=On;for(On=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Nt(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Pt(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Lt(r),Rt(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Ft(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(It(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function It(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Mn)||(e.globalVersion=Mn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ft(e))))return;e.flags|=2;let t=e.dep,n=I,r=An;I=e,An=!0;try{Nt(e);let n=e.fn(e._value);(t.version===0||mt(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{I=n,An=r,Pt(e),e.flags&=-3}}function Lt(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Lt(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Rt(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function zt(){jn.push(An),An=!1}function Bt(){let e=jn.pop();An=e===void 0||e}function Vt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=I;I=void 0;try{t()}finally{I=e}}}function Ht(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ht(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}function Ut(e,t,n){if(An&&I){let t=Fn.get(e);t||Fn.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Pn),r.map=t,r.key=n),r.track()}}function Wt(e,t,n,r,i,a){let o=Fn.get(e);if(!o){Mn++;return}let s=e=>{e&&e.trigger()};if(jt(),t===`clear`)o.forEach(s);else{let i=O(e),a=i&&at(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Rn||!$e(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Rn)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(In)),Xe(e)&&s(o.get(Ln)));break;case`delete`:i||(s(o.get(In)),Xe(e)&&s(o.get(Ln)));break;case`set`:Xe(e)&&s(o.get(In))}}Mt()}function Gt(e){let t=N(e);return t===e||(Ut(t,`iterate`,Rn),pn(e))?t:fn(e)?dn(e)?t.map(e=>ar(ir(e))):t.map(ar):t.map(ir)}function Kt(e){return Ut(e=N(e),`iterate`,Rn),e}function qt(e,t){return fn(e)?ar(dn(e)?ir(t):t):ir(t)}function Jt(e,t,n){let r=Kt(e),i=r[t],a=i.call(r);if(r!==e&&!pn(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>Yt(a.next(),n),i!==Bn[t]&&Object.defineProperties(e,{return:{get(){let e=a.return;return typeof e==`function`?e.bind(a):e}},throw:{get(){let e=a.throw;return typeof e==`function`?e.bind(a):e}}}),e}a._next=a.next,a.next=()=>Yt(a._next(),n)}return a}function Yt(e,t){return e.done||(e.value=t(e.value)),e}function Xt(e,t,n,r,i,a){let o=Kt(e),s=o!==e&&!pn(e),c=o[t];if(c!==Bn[t]){let t=c.apply(e,a);return s?ir(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,qt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Zt(e,t,n,r){let i=Kt(e),a=i!==e&&!pn(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=qt(e,t)),n.call(this,t,qt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?qt(e,c):c}function Qt(e,t,n){let r=N(e);Ut(r,`iterate`,Rn);let i=r[t](...n);return(i===-1||i===!1)&&mn(n[0])?(n[0]=N(n[0]),r[t](...n)):i}function $t(e,t,n=[]){zt(),jt();let r=N(e)[t].apply(e,n);return Mt(),Bt(),r}function en(e){$e(e)||(e=String(e));let t=N(this);return Ut(t,`has`,e),t.hasOwnProperty(e)}function tn(e,t,n){return function(...r){let i=this.__v_raw,a=N(i),o=Xe(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Yn:t?ar:ir;return!t&&Ut(a,`iterate`,c?Ln:In),qe(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function nn(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function rn(e,t){let n={get(n){let r=this.__v_raw,i=N(r),a=N(n);e||(mt(n,a)&&Ut(i,`get`,n),Ut(i,`get`,a));let{has:o}=Xn(i),s=t?Yn:e?ar:ir;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&Ut(N(t),`iterate`,In),t.size},has(t){let n=this.__v_raw,r=N(n),i=N(t);return e||(mt(t,i)&&Ut(r,`has`,t),Ut(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=N(a),s=t?Yn:e?ar:ir;return!e&&Ut(o,`iterate`,In),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return qe(n,e?{add:nn(`add`),set:nn(`set`),delete:nn(`delete`),clear:nn(`clear`)}:{add(e){let n=N(this),r=Xn(n),i=N(e),a=!t&&!pn(e)&&!fn(e)?i:e;return r.has.call(n,a)||mt(e,a)&&r.has.call(n,e)||mt(i,a)&&r.has.call(n,i)||(n.add(a),Wt(n,`add`,a,a)),this},set(e,n){t||pn(n)||fn(n)||(n=N(n));let r=N(this),{has:i,get:a}=Xn(r),o=i.call(r,e);o||=(e=N(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?mt(n,s)&&Wt(r,`set`,e,n,s):Wt(r,`add`,e,n),this},delete(e){let t=N(this),{has:n,get:r}=Xn(t),i=n.call(t,e);i||=(e=N(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Wt(t,`delete`,e,void 0,a),o},clear(){let e=N(this),t=e.size!==0,n=e.clear();return t&&Wt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=tn(r,e,t)}),n}function an(e,t){let n=rn(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(D(n,i)&&i in r?n:r,i,a)}function on(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function sn(e){return fn(e)?e:un(e,!1,Kn,Zn,er)}function cn(e){return un(e,!1,Jn,Qn,tr)}function ln(e){return un(e,!0,qn,$n,nr)}function un(e,t,n,r,i){if(!j(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=on(rt(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function dn(e){return fn(e)?dn(e.__v_raw):!!(e&&e.__v_isReactive)}function fn(e){return!!(e&&e.__v_isReadonly)}function pn(e){return!!(e&&e.__v_isShallow)}function mn(e){return e?!!e.__v_raw:!1}function N(e){let t=e&&e.__v_raw;return t?N(t):e}function hn(e){return!D(e,`__v_skip`)&&Object.isExtensible(e)&>(e,`__v_skip`,!0),e}function gn(e){return e?e.__v_isRef===!0:!1}function P(e){return _n(e,!1)}function _n(e,t){return gn(e)?e:new or(e,t)}function F(e){return gn(e)?e.value:e}function vn(e){return dn(e)?e:new Proxy(e,sr)}function yn(e,t,n=!1){let r,i;return k(e)?r=e:(r=e.get,i=e.set),new cr(r,i,n)}function bn(e,t=!1,n=dr){if(n){let t=ur.get(n);t||ur.set(n,t=[]),t.push(e)}}function xn(e,t,n=E){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:pn(e)||i===!1||i===0?Sn(e,1):Sn(e),u,d,f,p,m=!1,h=!1;if(gn(e)?(d=()=>e.value,m=pn(e)):dn(e)?(d=()=>l(e),m=!0):O(e)?(h=!0,m=e.some(e=>dn(e)||pn(e)),d=()=>e.map(e=>{if(gn(e))return e.value;if(dn(e))return l(e);if(k(e))return c?c(e,2):e()})):d=k(e)?t?c?()=>c(e,2):e:()=>{if(f){zt();try{f()}finally{Bt()}}let t=dr;dr=u;try{return c?c(e,3,[p]):e(p)}finally{dr=t}}:Ue,t&&i){let e=d,t=i===!0?1/0:i;d=()=>Sn(e(),t)}let g=kt(),_=()=>{u.stop(),g&&g.active&&Je(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{try{return e(...t)}finally{_()}}}let v=h?Array(e.length).fill(lr):lr,y=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>mt(e,v[t])):mt(n,v))){let e=dr;zt();try{f&&f(),dr=u;let e=[n,v===lr?void 0:h&&v[0]===lr?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{dr=e,Bt()}}}else u.run()}};return s&&s(y),u=new En(d),u.scheduler=o?()=>o(y,!1):y,p=e=>bn(e,!1,u),f=u.onStop=()=>{let e=ur.get(u);if(e){if(c)c(e,4);else for(let t of e)t();ur.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Sn(e,t=1/0,n){if(t<=0||!j(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,gn(e))Sn(e.value,t,n);else if(O(e))for(let r=0;r<e.length;r++)Sn(e[r],t,n);else if(Ze(e)||Xe(e))e.forEach(e=>{Sn(e,t,n)});else if(it(e)){for(let r in e)Sn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Sn(e[r],t,n)}return e}var Cn,wn,I,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr=o((()=>{Ot(),wn=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Cn&&(Cn.active?(this.parent=Cn,this.index=(Cn.scopes||(Cn.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=Cn;try{return Cn=this,e()}finally{Cn=t}}}on(){++this._on===1&&(this.prevScope=Cn,Cn=this)}off(){if(this._on>0&&--this._on===0){if(Cn===this)Cn=this.prevScope;else{let e=Cn;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}},Tn=new WeakSet,En=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Cn&&(Cn.active?Cn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Tn.has(this)&&(Tn.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||At(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vt(this),Nt(this);let e=I,t=An;I=this,An=!0;try{return this.fn()}finally{Pt(this),I=e,An=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Lt(e);this.deps=this.depsTail=void 0,Vt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Tn.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ft(this)&&this.run()}get dirty(){return Ft(this)}},Dn=0,An=!0,jn=[],Mn=0,Nn=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Pn=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!I||!An||I===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==I)t=this.activeLink=new Nn(I,this),I.deps?(t.prevDep=I.depsTail,I.depsTail.nextDep=t,I.depsTail=t):I.deps=I.depsTail=t,Ht(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=I.depsTail,t.nextDep=void 0,I.depsTail.nextDep=t,I.depsTail=t,I.deps===t&&(I.deps=e)}return t}trigger(e){this.version++,Mn++,this.notify(e)}notify(e){jt();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Mt()}}},Fn=new WeakMap,In=Symbol(``),Ln=Symbol(``),Rn=Symbol(``),zn={__proto__:null,[Symbol.iterator](){return Jt(this,Symbol.iterator,e=>qt(this,e))},concat(...e){return Gt(this).concat(...e.map(e=>O(e)?Gt(e):e))},entries(){return Jt(this,`entries`,e=>(e[1]=qt(this,e[1]),e))},every(e,t){return Xt(this,`every`,e,t,void 0,arguments)},filter(e,t){return Xt(this,`filter`,e,t,e=>e.map(e=>qt(this,e)),arguments)},find(e,t){return Xt(this,`find`,e,t,e=>qt(this,e),arguments)},findIndex(e,t){return Xt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Xt(this,`findLast`,e,t,e=>qt(this,e),arguments)},findLastIndex(e,t){return Xt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Xt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Qt(this,`includes`,e)},indexOf(...e){return Qt(this,`indexOf`,e)},join(e){return Gt(this).join(e)},lastIndexOf(...e){return Qt(this,`lastIndexOf`,e)},map(e,t){return Xt(this,`map`,e,t,void 0,arguments)},pop(){return $t(this,`pop`)},push(...e){return $t(this,`push`,e)},reduce(e,...t){return Zt(this,`reduce`,e,t)},reduceRight(e,...t){return Zt(this,`reduceRight`,e,t)},shift(){return $t(this,`shift`)},some(e,t){return Xt(this,`some`,e,t,void 0,arguments)},splice(...e){return $t(this,`splice`,e)},toReversed(){return Gt(this).toReversed()},toSorted(e){return Gt(this).toSorted(e)},toSpliced(...e){return Gt(this).toSpliced(...e)},unshift(...e){return $t(this,`unshift`,e)},values(){return Jt(this,`values`,e=>qt(this,e))}},Bn=Array.prototype,Vn=je(`__proto__,__v_isRef,__isVue`),Hn=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter($e)),Un=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?rr:nr:i?tr:er).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=O(e);if(!r){let e;if(a&&(e=zn[t]))return e;if(t===`hasOwnProperty`)return en}let o=Reflect.get(e,t,gn(e)?e:n);if(($e(t)?Hn.has(t):Vn(t))||(r||Ut(e,`get`,t),i))return o;if(gn(o)){let e=a&&at(t)?o:o.value;return r&&j(e)?ln(e):e}return j(o)?r?ln(o):sn(o):o}},Wn=class extends Un{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=O(e)&&at(t);if(!this._isShallow){let e=fn(i);if(!pn(n)&&!fn(n)&&(i=N(i),n=N(n)),!a&&gn(i)&&!gn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:D(e,t),s=Reflect.set(e,t,n,gn(e)?e:r);return e===N(r)&&s&&(o?mt(n,i)&&Wt(e,`set`,t,n,i):Wt(e,`add`,t,n)),s}deleteProperty(e,t){let n=D(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Wt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return $e(t)&&Hn.has(t)||Ut(e,`has`,t),n}ownKeys(e){return Ut(e,`iterate`,O(e)?`length`:In),Reflect.ownKeys(e)}},Gn=class extends Un{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Kn=new Wn,qn=new Gn,Jn=new Wn(!0),Yn=e=>e,Xn=e=>Reflect.getPrototypeOf(e),Zn={get:an(!1,!1)},Qn={get:an(!1,!0)},$n={get:an(!0,!1)},er=new WeakMap,tr=new WeakMap,nr=new WeakMap,rr=new WeakMap,ir=e=>j(e)?sn(e):e,ar=e=>j(e)?ln(e):e,or=class{constructor(e,t){this.dep=new Pn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:N(e),this._value=t?e:ir(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||pn(e)||fn(e);e=n?e:N(e),mt(e,t)&&(this._rawValue=e,this._value=n?e:ir(e),this.dep.trigger())}},sr={get:(e,t,n)=>t===`__v_raw`?e:F(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return gn(i)&&!gn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}},cr=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Pn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Mn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&I!==this)return At(this,!0),!0}get value(){let e=this.dep.track();return It(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}},lr={},ur=new WeakMap,dr=void 0}));function pr(e,t,n,r){try{return r?e(...r):e()}catch(e){hr(e,t,n)}}function mr(e,t,n,r){if(k(e)){let i=pr(e,t,n,r);return i&&et(i)&&i.catch(e=>{hr(e,t,n)}),i}if(O(e)){let i=[];for(let a=0;a<e.length;a++)i.push(mr(e[a],t,n,r));return i}}function hr(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||E;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){zt(),pr(a,null,10,[e,i,o]),Bt();return}}gr(e,n,i,r,o)}function gr(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}function _r(e){let t=Ta||wa;return e?t.then(this?e.bind(this):e):t}function vr(e){let t=ba+1,n=ya.length;for(;t<n;){let r=t+n>>>1,i=ya[r],a=Da(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function yr(e){if(!(e.flags&1)){let t=Da(e),n=ya[ya.length-1];!n||!(e.flags&2)&&t>=Da(n)?ya.push(e):ya.splice(vr(t),0,e),e.flags|=1,br()}}function br(){Ta||=wa.then(Tr)}function xr(e){if(!O(e))Sa&&e.id===-1?Sa.splice(Ca+1,0,e):e.flags&1||(xa.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)xa.push(e[t]);br()}function Sr(e,t,n,r=ba+1){for(;r<ya.length;r++){let n=ya[r];if(n&&n.flags&2){if(e&&n.id!==e.uid||t!==void 0&&!(n.id>=t))continue;ya.splice(r,1),r=e?r-1:ba,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Cr(e,t,n=0){if(xa.length){let e=xa,r=0;if(t){e=[];for(let i=0;i<xa.length;i++){let a=xa[i];(a.i===void 0?t.has(a):!a.i||a.i.uid<n)?xa[r++]=a:e.push(a)}}let i=[...new Set(e)].sort((e,t)=>Da(e)-Da(t));if(xa.length=r,Sa){for(let e=0;e<i.length;e++)Sa.push(i[e]);return}for(Sa=i,Ca=0;Ca<Sa.length;Ca++){let e=Sa[Ca];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Sa=null,Ca=0}}function wr(e,t){if(Ea){e();return}let n=t===void 0?void 0:new Set(xa);e(),Ea=!0;try{Sr(void 0,t),Cr(void 0,n,t)}finally{Ea=!1}}function Tr(e){try{for(ba=0;ba<ya.length;ba++){let e=ya[ba];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),pr(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ba<ya.length;ba++){let e=ya[ba];e&&(e.flags&=-2)}ba=-1,ya.length=0,Cr(e),Ta=null,(ya.length||xa.length)&&Tr(e)}}function Er(e){let t=Oa;return Oa=e,ka=e&&e.type.__scopeId||null,t}function Dr(e,t=Oa,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&qi(-1);let i=Er(t),a=Eo.length,o;try{o=e(...n)}finally{for(let e=Eo.length;e>a;e--)Ki();Er(i),r._d&&qi(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Or(e,t){if(Oa===null)return e;let n=ga(Oa),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=E]=t[e];i&&(k(i)&&(i={mounted:i,updated:i}),i.deep&&Sn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function kr(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(zt(),mr(c,n,8,[e.el,s,e,t]),Bt())}}function Ar(e,t){if(No){let n=No.provides,r=No.parent&&No.parent.provides;r===n&&(n=No.provides=Object.create(r)),n[e]=t}}function jr(e,t,n=!1){let r=Po();if(r||ro){let i=ro?ro._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&k(t)?t.call(r&&r.proxy):t}}function Mr(e,t,n){return Nr(e,t,n)}function Nr(e,t,n=E){let{immediate:r,deep:i,flush:a,once:o}=n,s=qe({},n),c=t&&r||!t&&a!==`post`,l;if(zo){if(a===`sync`){let e=ja();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=Ue,e.resume=Ue,e.pause=Ue,e}}let u=No;s.call=(e,t,n)=>mr(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{e.i=u,xo(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():yr(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=xn(e,t,s);return zo&&(l?l.push(f):c&&f()),f}function Pr(e,t,n){let r=this.proxy,i=A(e)?e.includes(`.`)?Fr(r,e):()=>r[e]:e.bind(r,r),a;k(t)?a=t:(a=t.handler,n=t);let o=Lo(this),s=Nr(i,a.bind(r),n);return o(),s}function Fr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function Ir(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==wo){t=n;break}}return t}function Lr(e){if(!La(e))return Na(e.type)&&e.children?Ir(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&k(n.default))return n.default()}}function Rr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Rr(Na(n.type)&&Lr(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===H&&O(e.children)){let n=wi(e.children,!1);n&&Rr(n,t)}}function zr(e){if(e.component)return zr(e.component.subTree);if(e.type===H){let t=O(e.children)&&wi(e.children,!1);return t?zr(t):void 0}if(e.type!==wo)return e}function L(e,t){return k(e)?qe({name:e.name},t,{setup:e}):e}function Br(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Vr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}function Hr(e,t,n,r,i=!1){if(O(e)){e.forEach((e,a)=>Hr(e,t&&(O(t)?t[a]:t),n,r,i));return}if(Ia(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Hr(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?ga(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===E?s.refs={}:s.refs,d=s.setupState,f=N(d),p=d===E?We:e=>!Vr(u,e)&&D(f,e),m=(e,t)=>!(t&&Vr(u,t));if(l!=null&&l!==c){if(Ur(t),A(l))u[l]=null,p(l)&&(d[l]=null);else if(gn(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(k(c))pr(c,s,12,[o,u]);else{let t=A(c),r=gn(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)O(n)&&Je(n,a);else if(O(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Fa.delete(e)};t.id=-1,Fa.set(e,t),xo(t,n)}else Ur(e),s()}}}function Ur(e){let t=Fa.get(e);t&&(t.flags|=8,Fa.delete(e))}function Wr(e,t){Kr(e,`a`,t)}function Gr(e,t){Kr(e,`da`,t)}function Kr(e,t,n=No){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Jr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)La(e.parent.vnode)&&qr(r,t,n,e),e=e.parent}}function qr(e,t,n,r){let i=Jr(t,e,r,!0);Wa(()=>{Je(r[t],i)},n)}function Jr(e,t,n=No,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{zt();let i=Lo(n),a=mr(t,n,e,r);return i(),Bt(),a};return r?i.unshift(a):i.push(a),a}}function Yr(e,t=No){Jr(`ec`,e,t)}function Xr(e){return A(e)?Zr(Ja,e,!1)||e:e||Ya}function Zr(e,t,n=!0,r=!1){let i=Oa||No;if(i){let n=i.type;if(e===Ja){let e=_a(n,!1);if(e&&(e===t||e===lt(t)||e===ft(lt(t))))return n}let a=Qr(i[e]||n[e],t)||Qr(i.appContext[e],t);return!a&&r?n:a}}function Qr(e,t){return e&&(e[t]||e[lt(t)]||e[ft(lt(t))])}function $r(e,t,n,r){let i,a=n&&n[r],o=O(e);if(o||A(e)){let n=o&&dn(e),r=!1,s=!1;n&&(r=!pn(e),s=fn(e),e=Kt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?ar(ir(e[n])):ir(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){if(!Number.isInteger(e)||e<0)i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}}else if(j(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function ei(e,t,n,r,i,a){if(n??={},Oa.ce||Oa.parent&&Ia(Oa.parent)&&Oa.parent.ce){let e=a!=null&&n.key==null?qe({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),R(),Yi(H,null,[U(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=Eo.length;R();let c;try{let i=o&&ti(o(n)),s=n.key||a||i&&i.key;c=Yi(H,{key:(s&&!$e(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Eo.length;e>s;e--)Ki();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function ti(e){return e.some(e=>!Xi(e)||!(e.type===wo||e.type===H&&!ti(e.children)))?e:null}function ni(){return ri(`useSlots`).slots}function ri(e){let t=Po();return t.setupContext||=ha(t)}function ii(e){return O(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function ai(e){let t=li(e),n=e.proxy,r=e.ctx;eo=!1,t.beforeCreate&&si(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:v,destroyed:y,unmounted:b,render:ee,renderTracked:te,renderTriggered:ne,errorCaptured:x,serverPrefetch:S,expose:re,inheritAttrs:ie,components:ae,directives:oe,filters:se}=t;if(l&&oi(l,r,null),o)for(let e in o){let t=o[e];k(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);j(t)&&(e.data=sn(t))}if(eo=!0,a)for(let e in a){let t=a[e],i=k(t)?t.bind(n,n):k(t.get)?t.get.bind(n,n):Ue,o=!k(t)&&k(t.set)?t.set.bind(n):Ue,s=Uo({get:i,set:o});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(s)for(let e in s)ci(s[e],r,n,e);if(c){let e=k(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Ar(t,e[t])})}u&&si(u,e,`c`);function ce(e,t){O(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(ce(za,d),ce(Ba,f),ce(Va,p),ce(Ha,m),ce(Wr,h),ce(Gr,g),ce(Yr,x),ce(qa,te),ce(Ka,ne),ce(Ua,v),ce(Wa,b),ce(Ga,S),O(re)){if(re.length){let t=e.exposed||={};re.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}ee&&e.render===Ue&&(e.render=ee),ie!=null&&(e.inheritAttrs=ie),ae&&(e.components=ae),oe&&(e.directives=oe),S&&Br(e)}function oi(e,t,n=Ue){O(e)&&(e=pi(e));for(let n in e){let r=e[n],i;i=j(r)?`default`in r?jr(r.from||n,r.default,!0):jr(r.from||n):jr(r),gn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function si(e,t,n){mr(O(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ci(e,t,n,r){let i=r.includes(`.`)?Fr(n,r):()=>n[r];if(A(e)){let n=t[e];k(n)&&Mr(i,n)}else if(k(e))Mr(i,e.bind(n));else if(j(e)){if(O(e))e.forEach(e=>ci(e,t,n,r));else{let r=k(e.handler)?e.handler.bind(n):t[e.handler];k(r)&&Mr(i,r,e)}}}function li(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>ui(c,e,o,!0)),ui(c,t,o)),j(t)&&a.set(t,c),c}function ui(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&ui(e,a,n,!0),i&&i.forEach(t=>ui(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=to[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}function di(e,t){return t?e?function(){return qe(k(e)?e.call(this,this):e,k(t)?t.call(this,this):t)}:t:e}function fi(e,t){return hi(pi(e),pi(t))}function pi(e){if(O(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function mi(e,t){return e?[...new Set([].concat(e,t))]:t}function hi(e,t){return e?qe(Object.create(null),e,t):t}function gi(e,t){return e?O(e)&&O(t)?[...new Set([...e,...t])]:qe(Object.create(null),ii(e),ii(t??{})):t}function _i(e,t){if(!e)return t;if(!t)return e;let n=qe(Object.create(null),e);for(let r in t)n[r]=mi(e[r],t[r]);return n}function vi(){return{app:null,config:{isNativeTag:We,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}function yi(e,t){return function(n,r=null){k(n)||(n=qe({},n)),r!=null&&!j(r)&&(r=null);let i=vi(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:no++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Wo,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&k(e.install)?(a.add(e),e.install(c,...t)):k(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||U(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,ga(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(mr(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=ro;ro=c;try{return e()}finally{ro=t}}};return c}}function bi(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||E,i=n,a=t.startsWith(`update:`),o=a&&io(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>A(e)?e.trim():e)),o.number&&(i=i.map(_t)));let s,c=r[s=pt(t)]||r[s=pt(lt(t))];!c&&a&&(c=r[s=pt(dt(t))]),c&&mr(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,mr(l,e,6,i)}}function xi(e,t,n=!1){let r=n?ao:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!k(e)){let r=e=>{let n=xi(e,t,!0);n&&(s=!0,qe(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(j(e)&&r.set(e,null),null):(O(a)?a.forEach(e=>o[e]=null):qe(o,a),j(e)&&r.set(e,o),o)}function Si(e,t){return!e||!Ge(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),D(e,t[0].toLowerCase()+t.slice(1))||D(e,dt(t))||D(e,t))}function Ci(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=Er(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=ra(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=ra(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:oo(s)}}catch(t){Eo.length=0,hr(t,e,1),_=U(wo)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(Ke)&&(v=so(v,a)),y=ea(y,v,!1,!0))}return n.dirs&&(y=ea(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Rr(Na(y.type)&&Lr(y)||y,n.transition),_=y,Er(g),_}function wi(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(Xi(r)){if(r.type!==wo||r.children===`v-if`){if(n)return;n=r}}else return}return n}function Ti(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ei(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Di(o,r,n)&&!Si(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Ei(r,o,l):!!o;return!1}function Ei(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(!D(e,a)||Di(t,e,a)&&!Si(n,a))return!0}return!1}function Di(e,t,n){let r=e[n],i=t[n];return n===`style`&&j(r)&&j(i)?!Be(r,i):r!==i}function Oi({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}function ki(e,t,n,r=!1){let i={},a=lo();e.propsDefaults=Object.create(null),ji(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:cn(i):e.type.props?i:a,e.attrs=a}function Ai(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=N(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Si(e.emitsOptions,o))continue;let u=t[o];if(c){if(D(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=lt(o);i[t]=Mi(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{ji(e,t,i,a)&&(l=!0);let r;for(let a in s)t&&(D(t,a)||(r=dt(a))!==a&&D(t,r))||(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Mi(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)t&&D(t,e)||(delete a[e],l=!0)}l&&Wt(e.attrs,`set`,``)}function ji(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(ot(c))continue;let l=t[c],u;i&&D(i,u=lt(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Si(e.emitsOptions,c)||c in r&&l===r[c]||(r[c]=l,o=!0)}if(a){let t=N(n),r=s||E;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Mi(i,t,s,r[s],e,!D(r,s))}}return o}function Mi(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=D(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&k(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Lo(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===dt(n))&&(r=!0))}return r}function Ni(e,t,n=!1){let r=n?fo:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!k(e)){let r=e=>{c=!0;let[n,r]=Ni(e,t,!0);qe(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return j(e)&&r.set(e,He),He;if(O(a))for(let e=0;e<a.length;e++){let t=lt(a[e]);Pi(t)&&(o[t]=E)}else if(a)for(let e in a){let t=lt(e);if(Pi(t)){let n=a[e],r=o[t]=O(n)||k(n)?{type:n}:qe({},n),i=r.type,c=!1,l=!0;if(O(i))for(let e=0;e<i.length;++e){let t=i[e],n=k(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=k(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||D(r,`default`))&&s.push(t)}}let l=[o,s];return j(e)&&r.set(e,l),l}function Pi(e){return e[0]!==`$`&&!ot(e)}function Fi(e){return Ii(e)}function Ii(e,t){let n=yt();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=Ue,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Zi(e,t)&&(r=ye(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===He&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Co:g(e,t,n,r);break;case wo:_(e,t,n,r);break;case To:e??v(t,n,r,o);break;case H:ae(e,t,n,r,i,a,o,s,c);break;default:d&1?ee(e,t,n,r,i,a,o,s,c):d&6?oe(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,xe)}u!=null&&i?Hr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Hr(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},ee=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)te(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),S(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},te=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&x(e.children,f,null,i,s,Li(e,c),l,d),_&&kr(e,null,i,`created`),ne(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ot(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&sa(p,i,e)}_&&kr(e,null,i,`beforeMount`);let v=zi(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&xo(()=>{try{p&&sa(p,i,e),v&&g.enter(f),_&&kr(e,null,i,`mounted`)}finally{}},s)},ne=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||So(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;ne(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},x=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?ia(e[l]):ra(e[l]);h(null,c,t,n,r,i,a,o,s)}},S=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||E,m=t.props||E,h;if(n&&Ri(n,!1),(h=m.onVnodeBeforeUpdate)&&sa(h,n,t,e),f&&kr(t,e,n,`beforeUpdate`),n&&Ri(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?re(e.dynamicChildren,d,c,n,r,Li(t,i),o):s||de(e,t,c,null,n,r,Li(t,i),o,!1),l>0){if(l&16)ie(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&ie(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&xo(()=>{h&&sa(h,n,t,e),f&&kr(t,e,n,`updated`)},r)},re=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el||Wi(c),f=u&&(c.type===H||!Zi(c,l)||c.shapeFlag&198)?d(u):n;h(c,l,f,null,r,i,a,o,!0)}},ie=(e,t,n,r,i)=>{if(t!==n){if(t!==E)for(let o in t)!ot(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ot(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ae=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),x(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(re(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Bi(e,t,!0)):de(e,t,n,f,a,o,c,l,u)},oe=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):se(t,n,r,i,a,o,c):ce(e,t,c)},se=(e,t,n,r,i,a,o)=>{let s=e.component=la(e,r,i);if(La(e)&&(s.ctx.renderer=xe),da(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,le,o,a),!e.el){let r=s.subTree=U(wo);_(null,r,t,n),e.placeholder=r.el}}else le(s,e,t,n,i,a,o)},ce=(e,t,n)=>{let r=t.component=e.component;if(Ti(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,ue(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},le=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Hi(e);if(n){t&&(t.el=c.el,ue(e,t,o)),n.asyncDep.then(()=>{xo(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;Ri(e,!1),t?(t.el=c.el,ue(e,t,o)):t=c,n&&ht(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&sa(f,s,t,c),Ri(e,!0);let p=Ci(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el),ye(m),e,i,a),t.el=p.el,u===null&&Oi(e,p.el),r&&xo(r,i),(f=t.props&&t.props.onVnodeUpdated)&&xo(()=>sa(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Ia(t);if(Ri(e,!1),l&&ht(l),!m&&(o=c&&c.onVnodeBeforeMount)&&sa(o,d,t),Ri(e,!0),s&&Ce){let t=()=>{e.subTree=Ci(e),Ce(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Ci(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&xo(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;xo(()=>sa(o,d,e),i)}(t.shapeFlag&256||d&&Ia(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&xo(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new En(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>yr(u),Ri(e,!0),l()},ue=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Ai(e,t.props,r,n),bo(e,t.children,n),zt(),Sr(e),Bt()},de=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){pe(l,f,n,r,i,a,o,s,c);return}if(p&256){fe(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&ve(l,i,a),f!==l&&u(n,f)):d&16?m&16?pe(l,f,n,r,i,a,o,s,c):ve(l,i,a,!0):(d&8&&u(n,``),m&16&&x(f,n,r,i,a,o,s,c))},fe=(e,t,n,r,i,a,o,s,c)=>{e||=He,t||=He;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?ia(t[f]):ra(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?ve(e,i,a,!0,!1,d):x(t,n,r,i,a,o,s,c,d)},pe=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?ia(t[l]):ra(t[l]);if(Zi(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?ia(t[f]):ra(t[f]);if(Zi(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?ia(t[l]):ra(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)me(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?ia(t[l]):ra(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,ee=0,te=Array(y);for(l=0;l<y;l++)te[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){me(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(te[_-m]===0&&Zi(r,t[_])){u=_;break}u===void 0?me(r,i,a,!0):(te[u-m]=l+1,u>=ee?ee=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let ne=b?Vi(te):He;for(_=ne.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Wi(f):r;te[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==ne[_]?C(d,n,p,2):_--)}}},C=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)C(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,xe);else if(c===H){r(s,t,n);for(let e=0;e<u.length;e++)C(u[e],t,n,a);r(e.anchor,t,n)}else if(c===To)y(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[Pa]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),xo(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[Pa];s._isLeaving&&s[Pa](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(zt(),Hr(s,null,n,e,!0),Bt()),p==null||e.ctx&&e.ctx!==t||(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Ia(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&sa(_,t,e),u&6)_e(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&kr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,xe,r):l&&!l.hasOnce&&(a!==H||d>0&&d&64)?ve(l,t,n,!1,!0):(a===H&&d&384||!i&&u&16)&&ve(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&xo(()=>{_&&sa(_,t,e),h&&kr(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:a}=e,o=t===H;if(o&&!a){ge(n,r);return}if(t===To){b(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let s=o?zr(e):e,c=()=>{o?d(n)&&ge(n,r):i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(s&&s.shapeFlag&1&&a&&!a.persisted){let{leave:e,delayLeave:t}=a,n=s.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},ge=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},_e=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Ui(c),Ui(l),r&&ht(r),i.stop(),a?(a.flags|=8,me(o,e,t,n)):e.vnode.el&&o&&(o.transition=e.vnode.transition,me(o,e,t,n)),s&&xo(s,t),xo(()=>{e.isUnmounted=!0},t)},ve=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)me(e[o],t,n,r,i)},ye=e=>{if(e.shapeFlag&6)return ye(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[Ma];return n?f(n):t},be=(e,t,n)=>{wr(()=>{e==null?t._vnode&&me(t._vnode,null,null,!0):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:ca())},xe={p:h,um:me,m:C,r:he,mt:se,mc:x,pc:de,pbc:re,n:ye,o:e},Se,Ce;return t&&([Se,Ce]=t(xe)),{render:be,hydrate:Se,createApp:yi(be,Se)}}function Li({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Ri({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function zi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Bi(e,t,n=!1){let r=e.children,i=t.children;if(O(r)&&O(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=ia(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Bi(t,a)),a.type===Co&&(a.patchFlag===-1&&(a=i[e]=ia(a)),a.el=t.el),a.type===wo&&!a.el&&(a.el=t.el)}}function Vi(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Hi(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Hi(t)}function Ui(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Wi(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Wi(t.subTree):null}function Gi(e,t){t&&t.pendingBranch?O(e)?t.effects.push(...e):t.effects.push(e):xr(e)}function R(e=!1){Eo.push(Do=e?null:[])}function Ki(){Eo.pop(),Do=Eo[Eo.length-1]||null}function qi(e,t=!1){Oo+=e,e<0&&Do&&t&&(Do.hasOnce=!0)}function Ji(e){return e.dynamicChildren=Oo>0?Do||He:null,Ki(),Oo>0&&Do&&Do.push(e),e}function z(e,t,n,r,i,a){return Ji(B(e,t,n,r,i,a,!0))}function Yi(e,t,n,r,i){return Ji(U(e,t,n,r,i,!0))}function Xi(e){return e?e.__v_isVNode===!0:!1}function Zi(e,t){return e.type===t.type&&e.key===t.key}function B(e,t=null,n=null,r=0,i=null,a=e===H?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ko(t),ref:t&&Ao(t),scopeId:ka,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Oa};return s?(aa(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=A(n)?8:16),Oo>0&&!o&&Do&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Do.push(c),c}function Qi(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==Ya||(e=wo),Xi(e)){let r=ea(e,t,!0);return n&&aa(r,n),Oo>0&&!a&&Do&&(r.shapeFlag&6?Do[Do.indexOf(e)]=r:Do.push(r)),r.patchFlag=-2,r}if(va(e)&&(e=e.__vccOpts),t){t=$i(t);let{class:e,style:n}=t;e&&!A(e)&&(t.class=Pe(e)),j(n)&&(mn(n)&&!O(n)&&(n=qe({},n)),t.style=Me(n))}let o=A(e)?1:So(e)?128:Na(e)?64:j(e)?4:k(e)?2:0;return B(e,t,n,r,i,o,a,!0)}function $i(e){return e?mn(e)||uo(e)?qe({},e):e:null}function ea(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?oa(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ko(l),ref:t&&t.ref?n&&a?O(a)?a.concat(Ao(t)):[a,Ao(t)]:Ao(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==H?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ea(e.ssContent),ssFallback:e.ssFallback&&ea(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&Rr(u,c.clone(u)),u}function ta(e=` `,t=0){return U(Co,null,e,t)}function na(e,t){let n=U(To,null,e);return n.staticCount=t,n}function V(e=``,t=!1){return t?(R(),Yi(wo,null,e)):U(wo,null,e)}function ra(e){return e==null||typeof e==`boolean`?U(wo):O(e)?U(H,null,e.slice()):Xi(e)?ia(e):U(Co,null,String(e))}function ia(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ea(e)}function aa(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(O(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),aa(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!uo(t)?t._ctx=Oa:r===3&&Oa&&(Oa.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(k(t)){if(r&65){aa(e,{default:t});return}t={default:t,_ctx:Oa},n=32}else t=String(t),r&64?(n=16,t=[ta(t)]):n=8;e.children=t,e.shapeFlag|=n}function oa(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=Pe([t.class,r.class]));else if(e===`style`)t.style=Me([t.style,r.style]);else if(Ge(e)){let n=t[e],i=r[e];i&&n!==i&&!(O(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!Ke(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function sa(e,t,n,r=null){mr(e,t,7,[n,r])}function ca(){return Mo}function la(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||jo,a={uid:Mo++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new wn(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ni(r,i),emitsOptions:xi(r,i),emit:null,emitted:null,propsDefaults:E,inheritAttrs:r.inheritAttrs,ctx:E,data:E,props:E,attrs:E,slots:E,refs:E,setupState:E,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=bi.bind(null,a),e.ce&&e.ce(a),a}function ua(e){return e.vnode.shapeFlag&4}function da(e,t=!1,n=!1){t&&Io(t);let{props:r,children:i}=e.vnode,a=ua(e);ki(e,r,a,t),yo(e,i,n||t);let o=a?fa(e,t):void 0;return t&&Io(!1),o}function fa(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$a);let{setup:r}=n;if(r){zt();let n=e.setupContext=r.length>1?ha(e):null,i=Lo(e),a=pr(r,e,0,[e.props,n]),o=et(a);if(Bt(),i(),(o||e.sp)&&!Ia(e)&&Br(e),o){if(a.then(Ro,Ro),t)return a.then(n=>{Io(!0);try{pa(e,n,t)}finally{Io(!1)}}).catch(t=>{hr(t,e,0)});e.asyncDep=a}else pa(e,a,t)}else ma(e,t)}function pa(e,t,n){k(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:j(t)&&(e.setupState=vn(t)),ma(e,n)}function ma(e,t,n){let r=e.type;if(!e.render){if(!t&&Bo&&!r.render){let t=r.template||li(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Bo(t,qe(qe({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||Ue,Vo&&Vo(e)}{let t=Lo(e);zt();try{ai(e)}finally{Bt(),t()}}}function ha(e){return{attrs:new Proxy(e.attrs,Ho),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function ga(e){return e.exposed?e.exposeProxy||=new Proxy(vn(hn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Za)return Za[n](e)},has(e,t){return t in e||t in Za}}):e.proxy}function _a(e,t=!0){return k(e)?e.displayName||e.name:e.name||t&&e.__name}function va(e){return k(e)&&`__vccOpts`in e}var ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,H,Co,wo,To,Eo,Do,Oo,ko,Ao,U,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go=o((()=>{fr(),Ot(),ya=[],ba=-1,xa=[],Sa=null,Ca=0,wa=Promise.resolve(),Ta=null,Ea=!1,Da=e=>e.id==null?e.flags&2?-1:1/0:e.id,Oa=null,ka=null,Aa=Symbol.for(`v-scx`),ja=()=>jr(Aa),Ma=Symbol(`_vte`),Na=e=>e.__isTeleport,Pa=Symbol(`_leaveCb`),Fa=new WeakMap,yt().requestIdleCallback,yt().cancelIdleCallback,Ia=e=>!!e.type.__asyncLoader,La=e=>e.type.__isKeepAlive,Ra=e=>(t,n=No)=>{zo&&e!==`sp`||Jr(e,(...e)=>t(...e),n)},za=Ra(`bm`),Ba=Ra(`m`),Va=Ra(`bu`),Ha=Ra(`u`),Ua=Ra(`bum`),Wa=Ra(`um`),Ga=Ra(`sp`),Ka=Ra(`rtg`),qa=Ra(`rtc`),Ja=`components`,Ya=Symbol.for(`v-ndc`),Xa=e=>e?ua(e)?ga(e):Xa(e.parent):null,Za=qe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xa(e.parent),$root:e=>Xa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>li(e),$forceUpdate:e=>e.f||=()=>{yr(e.update)},$nextTick:e=>e.n||=_r.bind(e.proxy),$watch:e=>Pr.bind(e)}),Qa=(e,t)=>e!==E&&!e.__isScriptSetup&&D(e,t),$a={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Qa(r,t))return o[t]=1,r[t];else if(i!==E&&D(i,t))return o[t]=2,i[t];else if(D(a,t))return o[t]=3,a[t];else if(n!==E&&D(n,t))return o[t]=4,n[t];else eo&&(o[t]=0)}let l=Za[t],u,d;if(l)return t===`$attrs`&&Ut(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==E&&D(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,D(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Qa(i,t)?(i[t]=n,!0):r!==E&&D(r,t)?(r[t]=n,!0):D(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==E&&s[0]!==`$`&&D(e,s)||Qa(t,s)||D(a,s)||D(r,s)||D(Za,s)||D(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?D(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},eo=!0,to={data:di,props:gi,emits:gi,methods:hi,computed:hi,beforeCreate:mi,created:mi,beforeMount:mi,mounted:mi,beforeUpdate:mi,updated:mi,beforeDestroy:mi,beforeUnmount:mi,destroyed:mi,unmounted:mi,activated:mi,deactivated:mi,errorCaptured:mi,serverPrefetch:mi,components:hi,directives:hi,watch:_i,provide:di,inject:fi},no=0,ro=null,io=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${lt(t)}Modifiers`]||e[`${dt(t)}Modifiers`],ao=new WeakMap,oo=e=>{let t;for(let n in e)(n===`class`||n===`style`||Ge(n))&&((t||={})[n]=e[n]);return t},so=(e,t)=>{let n={};for(let r in e)Ke(r)&&r.slice(9)in t||(n[r]=e[r]);return n},co={},lo=()=>Object.create(co),uo=e=>Object.getPrototypeOf(e)===co,fo=new WeakMap,po=e=>e===`_`||e===`_ctx`||e===`$stable`,mo=e=>O(e)?e.map(ra):[ra(e)],ho=(e,t,n)=>{if(t._n)return t;let r=Dr((...e)=>mo(t(...e)),n);return r._c=!1,r},go=(e,t,n)=>{let r=e._ctx;for(let n in e){if(po(n))continue;let i=e[n];if(k(i))t[n]=ho(n,i,r);else if(i!=null){let e=mo(i);t[n]=()=>e}}},_o=(e,t)=>{let n=mo(t);e.slots.default=()=>n},vo=(e,t,n)=>{for(let r in t)(n||!po(r))&&(e[r]=t[r])},yo=(e,t,n)=>{let r=e.slots=lo();if(e.vnode.shapeFlag&32){let e=t._;e?(vo(r,t,n),n&>(r,`_`,e,!0)):go(t,r)}else t&&_o(e,t)},bo=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=E;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:vo(i,t,n):(a=!t.$stable,go(t,i)),o=t}else t&&(_o(e,t),o={default:1});if(a)for(let e in i)!po(e)&&o[e]==null&&delete i[e]},xo=Gi,So=e=>e.__isSuspense,H=Symbol.for(`v-fgt`),Co=Symbol.for(`v-txt`),wo=Symbol.for(`v-cmt`),To=Symbol.for(`v-stc`),Eo=[],Do=null,Oo=1,ko=({key:e})=>e??null,Ao=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:A(e)||gn(e)||k(e)?{i:Oa,r:e,k:t,f:!!n}:e),U=Qi,jo=vi(),Mo=0,No=null,Po=()=>No||Oa;{let e=yt(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Fo=t(`__VUE_INSTANCE_SETTERS__`,e=>No=e),Io=t(`__VUE_SSR_SETTERS__`,e=>zo=e)}Lo=e=>{let t=No;return Fo(e),e.scope.on(),()=>{e.scope.off(),Fo(t)}},Ro=()=>{No&&No.scope.off(),Fo(null)},zo=!1,Ho={get(e,t){return Ut(e,`get`,``),e[t]}},Uo=(e,t)=>yn(e,t,zo),Wo=`3.5.44`}));function Ko(e,t,n){let r=e[Ss];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}function qo(e,t){e.style.display=t?e[Cs]:`none`,e[ws]=!t}function Jo(e,t,n){let r=e.style,i=A(n),a=!1;if(n&&!i){if(t){if(A(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Yo(r,t,``)}else for(let e in t)n[e]??Yo(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Yo(r,i,``):Zo(e,i,!A(t)&&t?t[i]:void 0,o)||Yo(r,i,o)}}else if(i){if(t!==n){let e=r[Es];e&&(n+=`;`+e),r.cssText=n,a=Ds.test(n)}}else t&&e.removeAttribute(`style`);Cs in e&&(i&&t===n||(e[Cs]=a?r.display:``),e[ws]&&(r.display=`none`))}function Yo(e,t,n){if(O(n))n.forEach(n=>Yo(e,t,n));else if(n??=``,t.startsWith(`--`))Os.test(n)?e.setProperty(t,n.replace(Os,``),`important`):e.setProperty(t,n);else{let r=Xo(e,t);Os.test(n)?e.setProperty(dt(r),n.replace(Os,``),`important`):e[r]=n}}function Xo(e,t){let n=As[t];if(n)return n;let r=lt(t);if(r!==`filter`&&r in e)return As[t]=r;r=ft(r);for(let n=0;n<ks.length;n++){let i=ks[n]+r;if(i in e)return As[t]=i}return t}function Zo(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&A(r)&&n===r}function Qo(e,t,n,r,i,a=wt(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(js,t.slice(6,t.length)):e.setAttributeNS(js,t,n):n==null||a&&!Fe(n)?e.removeAttribute(t):e.setAttribute(t,a?``:$e(n)?String(n):n)}function $o(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?gs(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);r===i&&`_value`in e||(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Fe(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function es(e,t,n,r){e.addEventListener(t,n,r)}function ts(e,t,n,r){e.removeEventListener(t,n,r)}function ns(e,t,n,r,i=null){let a=e[Ms]||(e[Ms]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=rs(t);r?es(e,n,a[t]=is(r,i),s):o&&(ts(e,n,o,s),a[t]=void 0)}}function rs(e){let t,n;for(;(n=e.match(Ns))&&!Ps.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):dt(e.slice(2)),t]}function is(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(O(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&mr(e,t,5,a)}}else mr(r,t,5,[e])};return n.value=e,n.attached=Ls(),n}function as(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Rs(t)&&k(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Rs(t)&&A(n)?!1:t in e}function os(e,t){let n=e._def.props;if(!n)return!1;let r=lt(t);return Array.isArray(n)?n.some(e=>lt(e)===r):Object.keys(n).some(e=>lt(e)===r)}function ss(e){e.target.composing=!0}function cs(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}function ls(e,t,n){return t&&(e=e.trim()),n&&(e=_t(e)),e}function us(e,t,n){if(!n||O(e))return Be(e,t);if(Ze(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function ds(e,t){let n=e.multiple,r=O(t);if(!n||r||Ze(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=fs(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ve(t,o)>-1}else a.selected=t.has(o)}else if(Be(fs(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function fs(e){return`_value`in e?e._value:e.value}function ps(){return Ys||=Fi(Js)}var ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs=o((()=>{if(Go(),Go(),Ot(),ms=void 0,hs=typeof window<`u`&&window.trustedTypes,hs)try{ms=hs.createPolicy(`vue`,{createHTML:e=>e})}catch{}gs=ms?e=>ms.createHTML(e):e=>e,_s=`http://www.w3.org/2000/svg`,vs=`http://www.w3.org/1998/Math/MathML`,ys=typeof document<`u`?document:null,bs=ys&&ys.createElement(`template`),xs={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?ys.createElementNS(_s,e):t===`mathml`?ys.createElementNS(vs,e):n?ys.createElement(e,{is:n}):ys.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ys.createTextNode(e),createComment:e=>ys.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ys.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{bs.innerHTML=gs(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=bs.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ss=Symbol(`_vtc`),Cs=Symbol(`_vod`),ws=Symbol(`_vsh`),Ts={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Cs]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):qo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),qo(e,!0),r.enter(e)):r.leave(e,()=>{qo(e,!1)}):qo(e,t))},beforeUnmount(e,{value:t}){qo(e,t)}},Es=Symbol(``),Ds=/(?:^|;)\s*display\s*:/,Os=/\s*!important$/,ks=[`Webkit`,`Moz`,`ms`],As={},js=`http://www.w3.org/1999/xlink`,Ms=Symbol(`_vei`),Ns=/(Once|Passive|Capture)$/,Ps=/^on:?(?:Once|Passive|Capture)$/,Fs=0,Is=Promise.resolve(),Ls=()=>Fs||=(Is.then(()=>Fs=0),Date.now()),Rs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,zs=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Ko(e,r,o):t===`style`?Jo(e,n,r):Ge(t)?Ke(t)||ns(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):as(e,t,r,o))?($o(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||Qo(e,t,r,o,a,t!==`value`)):e._isVueCE&&(os(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!A(r)))?$o(e,lt(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Qo(e,t,r,o))},Bs=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return O(t)?e=>ht(t,e):t},Vs=Symbol(`_assign`),Hs=Symbol(`_initialValue`),Us={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Hs]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Hs]=e.defaultValue.replace(/\r\n?/g,`
|
|
2
|
-
`))),e[Vs]=Bs(i);let a=r||i.props&&i.props.type===`number`;es(e,t?`change`:`input`,t=>{t.target.composing||e[Vs](ls(e.value,n,a))}),(n||a)&&es(e,`change`,()=>{e.value=ls(e.value,n,a)}),t||(es(e,`compositionstart`,ss),es(e,`compositionend`,cs),es(e,`change`,cs))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Hs];delete e[Hs],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Vs](ls(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Vs]=Bs(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?_t(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Ws={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,es(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?_t(fs(e)):fs(e)),r=e.multiple,i=r?Ze(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?O(i)?t.slice():t:i];try{e[Vs](i)}finally{_r(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Vs]=Bs(r)},mounted(e,{value:t}){ds(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Vs]=Bs(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,n&&n[0]===e.multiple&&us(t,n[1],n[0])||ds(e,t)}},Gs=[`ctrl`,`shift`,`alt`,`meta`],Ks={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Gs.some(n=>e[`${n}Key`]&&!t.includes(n))},qs=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Ks[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Js=qe({patchProp:zs},xs),Xs=((...e)=>{ps().render(...e)})})),W=o((()=>{Zs()}));function Qs(e){let t,n=e.el===document.body,r=n?document.createElement(`div`):e.el;n&&document.body.appendChild(r);let i=()=>{Xs(null,r),t=void 0,n&&r.remove()},a=Object.keys(e.on||{}).reduce((t,n)=>{let r=n.charAt(0).toUpperCase()+n.slice(1);return t[`on${r}`]=e.on[n],t},{})||{};a.onClose||=()=>i();let o={...e.props,...a,onVnodeUnmounted:()=>{},onVnodeMounted:()=>{}};return t=U(e.component,o),Xs(t,r),{vnode:t,destroy:i}}var $s=o((()=>{W()})),ec=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var ee=`$isDayjsObject`,te=function(e){return e instanceof re||!(!e||!e[ee])},ne=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},x=function(e,t){if(te(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new re(n)},S=v;S.l=ne,S.i=te,S.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var re=function(){function g(e){this.$L=ne(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[ee]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return S},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=x(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return x(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<x(e)},_.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!S.u(t)||t,u=S.p(e),p=function(e,t){var i=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return S.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=S.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[S.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=S.p(u),h=function(e){var t=x(p);return S.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return S.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=S.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return S.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return S.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return S.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return S.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return S.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return S.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return S.s(t.$s,2,`0`);case`SSS`:return S.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=S.p(f),_=x(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return S.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:S.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=ne(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return S.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),ie=re.prototype;return x.prototype=ie,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){ie[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),x.extend=function(e,t){return e.$i||=(e(t,re,x),!0),x},x.locale=ne,x.isDayjs=te,x.unix=function(e){return x(1e3*e)},x.en=b[y],x.Ls=b,x.p={},x}))}));function tc(e){return e=e.replace(/ /g,``).trim(),e.search(/^\d{14,16}$/i)!==-1&&nc(e)}function nc(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let i=e.charAt(r),a=parseInt(i,10);n&&(a*=2)>9&&(a-=9),t+=a,n=!n}return t%10==0}function rc(e){if(e.search(/^\d{2}\/\d{2}$/i)===-1)return!1;let t=e.split(`/`),n=parseInt(t[0],10),r=parseInt(t[1],10);if(n<0||n>12)return!1;let i=`20`+r.toString()+`-`+n.toString()+`-01`,a=(0,gc.default)(i,`YYYY-MM-DD`);return!((0,gc.default)().startOf(`month`).diff(a,`days`)>0)}function ic(e){return e.slice().replaceAll(/[^0-9]/g,``)}function ac(e){let t=ic(e);return t.length>9&&(t=t.slice(t.length-9)),`0`+t}function oc(e){let t=ic(e);return t.search(/^0[0-9]{9}$/)>-1||t.search(/^61[0-9]{9}$/)>-1||e.startsWith(`+`)&&t.search(/^[0-9]{11}$/)>-1}function sc(e){return e.search(/^\w+([+.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/)>-1}function cc(e){return e?e.search(/^\d{3,4}$/i)>-1:!1}function lc(e){return e?Array.isArray(e)?e.length>0:typeof e==`object`?Object.keys(e).length>0:!!e:!1}function uc(e){return!isNaN(parseFloat(e))&&parseFloat(e)>0}function dc(e,t,n,r){t(e)||r&&r({error:n})}function fc(e){let t=[10,1,3,5,7,9,11,13,15,17,19];if(e.length!==11||e.search(/\D/)>-1)return!1;let n=0,r=0;for(let i=0;i<=t.length-1;i++){r=t[i];let a=parseInt(e[i],10)-+!i;n+=r*a}return n%89==0}function pc(e){let t=RegExp(`^4`);return e.match(t)?`visa`:/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(e)?`mastercard`:(t=RegExp(`^3[47]`),e.match(t)?`amex`:(t=RegExp(`^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)`),e.match(t)?`discover`:(t=RegExp(`^36`),e.match(t)?`diners`:(t=RegExp(`^30[0-5]`),e.match(t)?`diners - carte blanche`:(t=RegExp(`^35(2[89]|[3-8][0-9])`),e.match(t)?`jcb`:(t=RegExp(`^(4026|417500|4508|4844|491(3|7))`),e.match(t)?`visa electron`:``))))))}function mc(e){if(e===!0)return!0;if(e===!1)return!1}function hc(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}var gc,_c=o((()=>{gc=u(ec(),1)}));$s(),_c(),W();var vc=L({__name:`PaypalIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=e,n=t.grayscale?`#2A2A2B`:`#253b80`,r=t.grayscale?`#555557`:`#179bd7`,i=t.grayscale?`#000000`:`#222d65`,a=`--size: ${t.size}px`;return(e,t)=>(R(),z(`svg`,{id:`paypal`,style:a,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25.576353 30.177`},[B(`path`,{d:`m 7.2659888,29.154 0.523,-3.322 -1.165,-0.027 -5.563,0 3.866,-24.513 c 0.012,-0.074 0.051,-0.143 0.108,-0.192 0.057,-0.049 0.13,-0.076 0.206,-0.076 l 9.3800002,0 c 3.114,0 5.263,0.648 6.385,1.927 0.526,0.6 0.861,1.227 1.023,1.917 0.17,0.724 0.173,1.589 0.007,2.644 l -0.012,0.077 0,0.676 0.526,0.298 c 0.443,0.235 0.795,0.504 1.065,0.812 0.45,0.513 0.741,1.165 0.864,1.938 0.127,0.795 0.085,1.741 -0.123,2.812 -0.24,1.232 -0.628,2.305 -1.152,3.183 -0.482,0.809 -1.096,1.48 -1.825,2 -0.696,0.494 -1.523,0.869 -2.458,1.109 -0.906,0.236 -1.939,0.355 -3.072,0.355 l -0.73,0 c -0.522,0 -1.029,0.188 -1.427,0.525 -0.399,0.344 -0.663,0.814 -0.744,1.328 l -0.055,0.299 -0.924,5.855 -0.042,0.215 c -0.011,0.068 -0.03,0.102 -0.058,0.125 -0.025,0.021 -0.061,0.035 -0.096,0.035 l -4.5070002,0 z`,style:Me(`fill: ${F(n)}`)},null,4),B(`path`,{d:`m 23.047989,7.667 0,0 0,0 c -0.028,0.179 -0.06,0.362 -0.096,0.55 -1.237,6.351 -5.469,8.545 -10.874,8.545 l -2.7520002,0 c -0.661,0 -1.218,0.48 -1.321,1.132 l 0,0 0,0 -1.409,8.936 -0.399,2.533 c -0.067,0.428 0.263,0.814 0.695,0.814 l 4.8810002,0 c 0.578,0 1.069,-0.42 1.16,-0.99 l 0.048,-0.248 0.919,-5.832 0.059,-0.32 c 0.09,-0.572 0.582,-0.992 1.16,-0.992 l 0.73,0 c 4.729,0 8.431,-1.92 9.513,-7.476 0.452,-2.321 0.218,-4.259 -0.978,-5.622 -0.362,-0.411 -0.811,-0.752 -1.336,-1.03 z`,style:Me(`fill: ${F(r)}`)},null,4),B(`path`,{d:`m 21.753989,7.151 c -0.189,-0.055 -0.384,-0.105 -0.584,-0.15 -0.201,-0.044 -0.407,-0.083 -0.619,-0.117 -0.742,-0.12 -1.555,-0.177 -2.426,-0.177 l -7.352,0 c -0.181,0 -0.353,0.041 -0.507,0.115 C 9.9269888,6.985 9.6749888,7.306 9.6139888,7.699 l -1.564,9.906 -0.045,0.289 c 0.103,-0.652 0.66,-1.132 1.321,-1.132 l 2.7520002,0 c 5.405,0 9.637,-2.195 10.874,-8.545 0.037,-0.188 0.068,-0.371 0.096,-0.55 -0.313,-0.166 -0.652,-0.308 -1.017,-0.429 -0.09,-0.03 -0.183,-0.059 -0.277,-0.087 z`,style:Me(`fill: ${F(i)}`)},null,4),B(`path`,{d:`m 9.6139888,7.699 c 0.061,-0.393 0.313,-0.714 0.6520002,-0.876 0.155,-0.074 0.326,-0.115 0.507,-0.115 l 7.352,0 c 0.871,0 1.684,0.057 2.426,0.177 0.212,0.034 0.418,0.073 0.619,0.117 0.2,0.045 0.395,0.095 0.584,0.15 0.094,0.028 0.187,0.057 0.278,0.086 0.365,0.121 0.704,0.264 1.017,0.429 0.368,-2.347 -0.003,-3.945 -1.272,-5.392 C 20.377989,0.682 17.852989,0 14.621989,0 L 5.2419888,0 c -0.66,0 -1.223,0.48 -1.325,1.133 L 0.00998882,25.898 c -0.077,0.49 0.301,0.932 0.795,0.932 l 5.79099998,0 1.454,-9.225 1.564,-9.906 z`,style:Me(`fill: ${F(n)}`)},null,4)]))}}),G,K=o((()=>{G=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n}}));K();var yc=G(vc,[[`__scopeId`,`data-v-2b840669`]]);W();var bc=L({__name:`CreditCardIcon`,props:{size:{},grayscale:{type:Boolean},color:{}},setup(e){let t=e,n=P(t.color);Mr(()=>t.color,e=>{n.value=e});let r=Uo(()=>`--size: ${t.size}px;fill:${n.value}`);return(e,t)=>(R(),z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,style:Me([{width:`1.2587890625em`,height:`1em`,"vertical-align":`middle`,overflow:`hidden`},r.value]),viewBox:`0 0 1289 1024`},[...t[0]||=[B(`path`,{d:`M1188.420307 68.911452c16.92562 0 32.642267 14.507674 32.642267 32.642267v822.101535c0 16.92562-14.507674 32.642267-32.642267 32.642267h-1088.075561c-16.92562 0-32.642267-14.507674-32.642267-32.642267v-822.101535c0-16.92562 14.507674-32.642267 32.642267-32.642267h1088.075561m0-68.911452h-1088.075561C44.731995 0 0 45.940968 0 100.344746v822.101535c0 55.612751 44.731995 100.344746 100.344746 100.344746h1088.075561c55.612751 0 100.344746-44.731995 100.344746-100.344746v-822.101535c1.208973-54.403778-44.731995-100.344746-100.344746-100.344746z`},null,-1),B(`path`,{d:`M41.105077 252.675325h1221.062574v258.720189H41.105077zM177.719008 778.578512h174.09209v71.329398H177.719008zM432.812279 778.578512h259.929161v71.329398H432.812279z`},null,-1)]],4))}});K();var xc=G(bc,[[`__scopeId`,`data-v-6a1e8b23`]]);W();var Sc=L({__name:`GooglePayIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=`--size: ${Number(e.size||30)+10}px`;return(e,n)=>(R(),z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,style:t,viewBox:`170.7 170 752 400`},[...n[0]||=[na(`<path id="Base_1_" fill="#FFFFFF" d="M722.7,170h-352c-110,0-200,90-200,200l0,0c0,110,90,200,200,200h352c110,0,200-90,200-200l0,0 C922.7,260,832.7,170,722.7,170z" data-v-f87e02ce></path><path id="Outline" fill="#3C4043" d="M722.7,186.2c24.7,0,48.7,4.9,71.3,14.5c21.9,9.3,41.5,22.6,58.5,39.5 c16.9,16.9,30.2,36.6,39.5,58.5c9.6,22.6,14.5,46.6,14.5,71.3s-4.9,48.7-14.5,71.3c-9.3,21.9-22.6,41.5-39.5,58.5 c-16.9,16.9-36.6,30.2-58.5,39.5c-22.6,9.6-46.6,14.5-71.3,14.5h-352c-24.7,0-48.7-4.9-71.3-14.5c-21.9-9.3-41.5-22.6-58.5-39.5 c-16.9-16.9-30.2-36.6-39.5-58.5c-9.6-22.6-14.5-46.6-14.5-71.3s4.9-48.7,14.5-71.3c9.3-21.9,22.6-41.5,39.5-58.5 c16.9-16.9,36.6-30.2,58.5-39.5c22.6-9.6,46.6-14.5,71.3-14.5L722.7,186.2 M722.7,170h-352c-110,0-200,90-200,200l0,0 c0,110,90,200,200,200h352c110,0,200-90,200-200l0,0C922.7,260,832.7,170,722.7,170L722.7,170z" data-v-f87e02ce></path><g id="Google_Pay_Lockup_1_" data-v-f87e02ce><g id="Pay_Typeface_3_" data-v-f87e02ce><path id="Letter_p_3_" fill="#3C4043" d="M529.3,384.2v60.5h-19.2V295.3H561c12.9,0,23.9,4.3,32.9,12.9 c9.2,8.6,13.8,19.1,13.8,31.5c0,12.7-4.6,23.2-13.8,31.7c-8.9,8.5-19.9,12.7-32.9,12.7h-31.7V384.2z M529.3,313.7v52.1h32.1 c7.6,0,14-2.6,19-7.7c5.1-5.1,7.7-11.3,7.7-18.3c0-6.9-2.6-13-7.7-18.1c-5-5.3-11.3-7.9-19-7.9h-32.1V313.7z" data-v-f87e02ce></path><path id="Letter_a_3_" fill="#3C4043" d="M657.9,339.1c14.2,0,25.4,3.8,33.6,11.4c8.2,7.6,12.3,18,12.3,31.2v63h-18.3v-14.2h-0.8 c-7.9,11.7-18.5,17.5-31.7,17.5c-11.3,0-20.7-3.3-28.3-10s-11.4-15-11.4-25c0-10.6,4-19,12-25.2c8-6.3,18.7-9.4,32-9.4 c11.4,0,20.8,2.1,28.1,6.3v-4.4c0-6.7-2.6-12.3-7.9-17c-5.3-4.7-11.5-7-18.6-7c-10.7,0-19.2,4.5-25.4,13.6l-16.9-10.6 C625.9,345.8,639.7,339.1,657.9,339.1z M633.1,413.3c0,5,2.1,9.2,6.4,12.5c4.2,3.3,9.2,5,14.9,5c8.1,0,15.3-3,21.6-9 s9.5-13,9.5-21.1c-6-4.7-14.3-7.1-25-7.1c-7.8,0-14.3,1.9-19.5,5.6C635.7,403.1,633.1,407.8,633.1,413.3z" data-v-f87e02ce></path><path id="Letter_y_3_" fill="#3C4043" d="M808.2,342.4l-64,147.2h-19.8l23.8-51.5L706,342.4h20.9l30.4,73.4h0.4l29.6-73.4H808.2z" data-v-f87e02ce></path></g><g id="Google_Mark_1_" data-v-f87e02ce><path id="Blue_500" fill="#4285F4" d="M452.93,372c0-6.26-0.56-12.25-1.6-18.01h-80.48v33L417.2,387 c-1.88,10.98-7.93,20.34-17.2,26.58v21.41h27.59C443.7,420.08,452.93,398.04,452.93,372z" data-v-f87e02ce></path><path id="Green_500_1_" fill="#34A853" d="M400.01,413.58c-7.68,5.18-17.57,8.21-29.14,8.21c-22.35,0-41.31-15.06-48.1-35.36 h-28.46v22.08c14.1,27.98,43.08,47.18,76.56,47.18c23.14,0,42.58-7.61,56.73-20.71L400.01,413.58z" data-v-f87e02ce></path><path id="Yellow_500_1_" fill="#FABB05" d="M320.09,370.05c0-5.7,0.95-11.21,2.68-16.39v-22.08h-28.46 c-5.83,11.57-9.11,24.63-9.11,38.47s3.29,26.9,9.11,38.47l28.46-22.08C321.04,381.26,320.09,375.75,320.09,370.05z" data-v-f87e02ce></path><path id="Red_500" fill="#E94235" d="M370.87,318.3c12.63,0,23.94,4.35,32.87,12.85l24.45-24.43 c-14.85-13.83-34.21-22.32-57.32-22.32c-33.47,0-62.46,19.2-76.56,47.18l28.46,22.08C329.56,333.36,348.52,318.3,370.87,318.3z" data-v-f87e02ce></path></g></g>`,3)]]))}});K();var Cc=G(Sc,[[`__scopeId`,`data-v-f87e02ce`]]);W();var wc=[`fill`],Tc=L({__name:`PayToIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=e;t.grayscale;let n=`--size: ${t.size}px`;return(e,t)=>(R(),z(`svg`,{id:`payto-icon`,viewBox:`0 0 120 57`,xmlns:`http://www.w3.org/2000/svg`,style:n},[B(`path`,{d:`m8.285 27.63c.8 0 1.562-.06 2.285-.176a6.262 6.262 0 0 0 1.937-.624 3.529 3.529 0 0 0 1.354-1.227c.335-.52.502-1.194.502-2.025s-.169-1.463-.502-1.97a3.492 3.492 0 0 0 -1.337-1.187c-.555-.287-1.186-.473-1.897-.565a17.32 17.32 0 0 0 -2.188-.136h-3.56v7.91zm-8.285-12.04h8.945c1.573 0 2.994.144 4.258.429 1.265.288 2.349.754 3.254 1.404.902.648 1.599 1.479 2.092 2.493.488 1.012.736 2.235.736 3.663 0 1.533-.283 2.818-.853 3.858a6.956 6.956 0 0 1 -2.303 2.512c-.968.637-2.098 1.097-3.388 1.383-1.29.285-2.66.43-4.103.43h-3.76v11.415h-4.878zm32.679 19.054h-1.043c-.751 0-1.538.034-2.364.098s-1.588.207-2.283.427c-.697.223-1.279.534-1.742.937-.464.403-.696.954-.696 1.655 0 .442.095.812.29 1.11.195.3.446.54.755.721.31.183.659.311 1.045.39a5.94 5.94 0 0 0 1.161.117c1.6 0 2.813-.427 3.639-1.287.826-.857 1.238-2.026 1.238-3.505zm.078 6.156h-.116c-.466.832-1.213 1.516-2.247 2.047-1.034.532-2.206.8-3.523.8-.749 0-1.53-.099-2.343-.293a6.902 6.902 0 0 1 -2.245-.972 5.624 5.624 0 0 1 -1.705-1.793c-.45-.74-.676-1.656-.676-2.745 0-1.404.394-2.52 1.18-3.351.787-.831 1.8-1.468 3.04-1.91 1.24-.44 2.614-.732 4.124-.875a47.58 47.58 0 0 1 4.433-.215v-.47c0-1.168-.42-2.031-1.259-2.589s-1.839-.839-3-.839c-.981 0-1.923.21-2.826.624-.903.417-1.652.924-2.246 1.521l-2.4-2.844a10.478 10.478 0 0 1 3.659-2.222 12.448 12.448 0 0 1 4.203-.74c1.651 0 3.013.233 4.084.7 1.072.468 1.916 1.079 2.536 1.83a6.571 6.571 0 0 1 1.298 2.534c.245.936.369 1.869.369 2.806v11.376h-4.338v-2.377l-.002-.004zm5.719-16.325h5.15l5.189 13.599h.078l4.607-13.6h4.84l-8.791 22.717a16.433 16.433 0 0 1 -1.083 2.278 6.33 6.33 0 0 1 -1.395 1.676 5.56 5.56 0 0 1 -1.916 1.032c-.736.234-1.62.351-2.654.351-.386 0-.78-.019-1.182-.058a8.113 8.113 0 0 1 -1.219-.215l.386-4.052c.31.104.614.175.91.215s.575.058.834.058c.49 0 .902-.058 1.238-.175.337-.117.62-.298.852-.545.232-.248.438-.552.618-.917.181-.364.376-.792.582-1.286l.93-2.376-7.977-18.702zm42.808 14.279c.893 0 2.072-.328 2.536-.49v3.735c-.468.183-1.478.535-2.536.535-3.691 0-6.695-3.064-6.697-6.831v-11.228h-4.225v-3.675h4.225v-4.66h3.665v4.66h10a13.83 13.83 0 0 0 -3.625 3.675h-6.375v11.228c0 1.688 1.39 3.05 3.032 3.05zm15 3.78c-6.038 0-10.801-4.79-10.801-10.866s4.845-10.868 10.8-10.868h12.183l.004-3.376 6.267 5.245-6.278 5.256.004-3.45h-12.337c-3.775 0-6.897 3.396-6.897 7.193s3.11 7.13 7.053 7.13c3.942 0 7.053-3.163 7.053-7.13 0-1.755-.62-3.377-1.386-4.553h4.139c.65 1.402.993 3.006.993 4.553 0 6.076-4.761 10.866-10.801 10.866zm10.909-42.534h-31.031c-7.074 0-12.807 5.77-12.807 12.886v31.226c0 7.117 5.735 12.886 12.807 12.886h31.031c7.074 0 12.806-5.77 12.806-12.886v-31.226c0-7.116-5.734-12.886-12.806-12.886z`,fill:F(`#000`)},null,8,wc)]))}});K();var Ec=G(Tc,[[`__scopeId`,`data-v-0b2d8aa0`]]),Dc=`payfurl-combined-container`;function Oc(e,t){if(!e)return null;for(;e.parentNode&&e.parentNode.nodeName.toLowerCase()!==`body`;)if(e=e.parentNode,e.id===t)return e;return null}W();var kc=[`id`],Ac=[`id`,`onClick`],jc=[`value`,`id`],Mc={class:`combined-tab-title`},Nc={class:`combined-tab-name`},Pc={key:0,class:`combined-tab-description`},Fc=[`src`,`alt`],Ic=[`id`],Lc=L({__name:`Combined`,props:{elements:{}},setup(e){let t=e,n=P(0),r={},i=P({});function a(e){n.value=e,setTimeout(()=>{l(e),t.elements[e].activate()},200);let r=document.getElementById(`payment-type${e}`);r.checked=!0}function o(e){return e.icon&&typeof e.icon==`object`}function s(e){return e.icon&&typeof e.icon==`string`}function c(e){return n.value===e}function l(e){if(t.elements[e].render&&!r[e]){try{t.elements[e].render(document.getElementById(`container-component${e}`)),i.value[e]=!1}catch(t){console.error(t),i.value[e]=!0;return}r[e]=!0}}return Ba(()=>{t.elements.forEach((e,t)=>{l(t)}),a(0)}),(e,r)=>(R(),z(`div`,{class:`payfurl-sdk-combined-container`,id:F(Dc)},[(R(!0),z(H,null,$r(t.elements,(e,t)=>(R(),z(H,{key:`container-component${t}`},[i.value[t]?V(``,!0):(R(),z(`div`,{key:0,class:Pe([`payfurl-sdk-combined-tab`,t===n.value?`active`:``]),id:e.id||`combined-tab${t}`,onClick:e=>a(t)},[B(`input`,{type:`radio`,name:`payment-type`,value:e.title,id:`payment-type${t}`},null,8,jc),B(`div`,Mc,[B(`div`,Nc,M(e.title),1),e.description?(R(),z(`div`,Pc,M(e.description),1)):V(``,!0)]),o(e)?(R(),Yi(Xr(e.icon),{key:0,size:30})):V(``,!0),s(e)?(R(),z(`img`,{key:1,src:e.icon,style:{width:`40px`,height:`30px`,"object-fit":`contain`},alt:e.title},null,8,Fc)):V(``,!0)],10,Ac)),Or(B(`div`,{class:`payfurl-sdk-container-component`,id:`container-component${t}`},null,8,Ic),[[Ts,c(t)]])],64))),128))],8,kc))}});K();var Rc=G(Lc,[[`__scopeId`,`data-v-240dc514`]]),zc,Bc,Vc=o((()=>{W(),zc={class:`message`},Bc=L({__name:`Error`,props:{error:{}},setup(e){let t=P(e.error);return(e,n)=>(R(),z(`div`,zc,M(t.value),1))}})})),Hc=o((()=>{})),Uc=o((()=>{})),Wc,Gc=o((()=>{Vc(),Vc(),Hc(),Uc(),K(),Wc=G(Bc,[[`__scopeId`,`data-v-ae4be0f9`]])})),Kc,qc,Jc,Yc=o((()=>{W(),Kc={class:`message`},qc={key:0},Jc=L({__name:`Success`,props:{message:{},token:{}},emits:[`close`],setup(e,{emit:t}){let n=e;return(e,t)=>(R(),z(H,null,[B(`div`,Kc,M(n.message),1),n.token?(R(),z(`div`,qc,`TokenId = `+M(n.token),1)):V(``,!0)],64))}})})),Xc=o((()=>{})),Zc=o((()=>{})),Qc,$c=o((()=>{Yc(),Yc(),Xc(),Zc(),K(),Qc=G(Jc,[[`__scopeId`,`data-v-6a4e1608`]])}));function q(e,t){e&&Qs({el:e,component:Wc,props:{error:t}})}function el(e,t,n){e&&Qs({el:e,component:Qc,props:{message:t,...n||{}}})}var tl=o((()=>{Gc(),$c()}));tl();var nl={AED:`784`,AFN:`971`,ALL:`008`,AMD:`051`,ANG:`532`,AOA:`973`,ARS:`032`,AUD:`036`,AWG:`533`,AZN:`944`,BAM:`977`,BBD:`052`,BDT:`050`,BGN:`975`,BHD:`048`,BIF:`108`,BMD:`060`,BND:`096`,BOB:`068`,BOV:`984`,BRL:`986`,BSD:`044`,BTN:`064`,BWP:`072`,BYN:`933`,BZD:`084`,CAD:`124`,CDF:`976`,CHE:`947`,CHF:`756`,CHW:`948`,CLF:`990`,CLP:`152`,CNY:`156`,COP:`170`,COU:`970`,CRC:`188`,CUC:`931`,CUP:`192`,CVE:`132`,CZK:`203`,DJF:`262`,DKK:`208`,DOP:`214`,DZD:`012`,EGP:`818`,ERN:`232`,ETB:`230`,EUR:`978`,FJD:`242`,FKP:`238`,GBP:`826`,GEL:`981`,GHS:`936`,GIP:`292`,GMD:`270`,GNF:`324`,GTQ:`320`,GYD:`328`,HKD:`344`,HNL:`340`,HRK:`191`,HTG:`332`,HUF:`348`,IDR:`360`,ILS:`376`,INR:`356`,IQD:`368`,IRR:`364`,ISK:`352`,JMD:`388`,JOD:`400`,JPY:`392`,KES:`404`,KGS:`417`,KHR:`116`,KMF:`174`,KPW:`408`,KRW:`410`,KWD:`414`,KYD:`136`,KZT:`398`,LAK:`418`,LBP:`422`,LKR:`144`,LRD:`430`,LSL:`426`,LYD:`434`,MAD:`504`,MDL:`498`,MGA:`969`,MKD:`807`,MMK:`104`,MNT:`496`,MOP:`446`,MUR:`480`,MVR:`462`,MWK:`454`,MXN:`484`,MXV:`979`,MYR:`458`,MZN:`943`,NAD:`516`,NGN:`566`,NIO:`558`,NOK:`578`,NPR:`524`,NZD:`554`,OMR:`512`,PAB:`590`,PEN:`604`,PGK:`598`,PHP:`608`,PKR:`586`,PLN:`985`,PYG:`600`,QAR:`634`,RON:`946`,RSD:`941`,RUB:`643`,RWF:`646`,SAR:`682`,SBD:`090`,SCR:`690`,SDG:`938`,SEK:`752`,SGD:`702`,SHP:`654`,SLL:`694`,SOS:`706`,SRD:`968`,SSP:`728`,SVC:`222`,SYP:`760`,SZL:`748`,THB:`764`,TJS:`972`,TMT:`934`,TND:`788`,TOP:`776`,TRY:`949`,TTD:`780`,TWD:`901`,TZS:`834`,UAH:`980`,UGX:`800`,USD:`840`,USN:`997`,UYI:`940`,UYU:`858`,UYW:`927`,UZS:`860`,VED:`926`,VES:`928`,VND:`704`,VUV:`548`,WST:`882`,XAF:`950`,XAG:`961`,XAU:`959`,XBA:`955`,XBB:`956`,XBC:`957`,XBD:`958`,XCD:`951`,XDR:`960`,XOF:`952`,XPD:`964`,XPF:`953`,XPT:`962`,XSU:`994`,XTS:`963`,XUA:`965`,XXX:`999`,YER:`886`,ZAR:`710`,ZMW:`967`,ZWL:`932`},rl={BHD:3,BIF:0,CLF:4,CLP:0,DJF:0,GNF:0,IQD:3,ISK:0,JOD:3,JPY:0,KMF:3,KRW:0,KWD:3,LYD:3,OMR:3,PYG:0,RWF:0,TND:3,UGX:0,UYI:0,UYW:4,VND:0,VUV:0,XAF:0,XOF:0,XPF:0};function il(e){return!!nl[String(e).toUpperCase()]}function al(e){return nl[String(e).toUpperCase()]||``}function ol(e){return rl[String(e).toUpperCase()]||2}var sl,cl,ll=o((()=>{sl=`payfurl.com`,cl={domain:sl}})),ul,dl,fl=o((()=>{he(),ll(),ul={[C.DEVELOPMENT]:{AU:`https://develop-api-au.${cl.domain}`,DEFAULT:`https://develop-api.${cl.domain}`},[C.SANDBOX]:{AU:`https://sandbox-api-au.${cl.domain}`,DEFAULT:`https://sandbox-api.${cl.domain}`},[C.PRODUCTION]:{AU:`https://api-au.${cl.domain}`,DEFAULT:`https://api.${cl.domain}`},[C.LOCAL]:{DEFAULT:`https://localhost:5001`}},dl=class{environment;location;constructor(e,t){this.environment=e.toLowerCase(),this.location=t.toUpperCase()}getRegionUrl(){if(!ul[this.environment])throw Error(`Invalid environment: ${this.environment}`);return ul[this.environment][this.location]||ul[this.environment].DEFAULT}}}));function pl(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ml(e){return e.match(/-([a-z]{2})$/)?.[1]||``}function hl(e){let t=e.match(/\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)(\d{1,14})$/);return t?[t[1],t[2]]:[e]}function gl(e){return e?e.replace(/(\d{4})\d{8}(\d{4})/,`$1 **** **** $2`):``}function _l(e){return e.replace(/\s/g,``)}var vl=o((()=>{})),yl,bl,xl,Sl,Cl=o((()=>{W(),yl={key:0,class:`masked`},bl={key:0,class:`message`},xl={key:1,class:`lds-spinner single`},Sl=L({__name:`Spinner`,props:{color:{default:`#1a82b7`},size:{default:50},message:{},useLocal:{type:Boolean}},setup(e){let t=e;return(n,r)=>t.useLocal?(R(),z(`div`,xl,[...r[1]||=[B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1),B(`div`,null,null,-1)]])):(R(),z(`div`,yl,[e.message?(R(),z(`div`,bl,M(e.message),1)):V(``,!0),r[0]||=B(`div`,{class:`lds-spinner`},[B(`div`),B(`div`),B(`div`),B(`div`),B(`div`),B(`div`),B(`div`),B(`div`),B(`div`),B(`div`),B(`div`),B(`div`)],-1)]))}})})),wl=o((()=>{})),Tl,El=o((()=>{Cl(),Cl(),wl(),K(),Tl=G(Sl,[[`__scopeId`,`data-v-2b4dad6b`]])})),Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au=o((()=>{Dl=`payfurl-init`,Ol=`init-card-form`,kl=`checkout-ready`,Al=`submit-card-form`,jl=`tokenise-card-form`,Ml=`request-card`,Nl=`card-details`,Pl=`secure-orchestrator-submit`,Fl=`secure-orchestrator-submit-secondary-3ds`,Il=`secure-orchestrator-update-state`,Ll=`secure-orchestrator-show-challenge`,Rl=`secure-orchestrator-hide-challenge`,zl=`show-spinner`,Bl=`hide-spinner`,Vl=`set-amount`,Hl=`set-currency`,Ul=`set-billing-address`,Wl=`set-customer-info`,Gl=`set-order-info`,Kl=`click2pay-cards`,ql=`show-card-form`,Jl=`start-loading-card-form`,Yl=`stop-loading-card-form`,Xl=`pause-loading-card-form`,Zl=`unpause-loading-card-form`,Ql=`click2pay-stop-using`,$l=`click2pay-update-available-card-brands`,eu=`card-form-error`,tu=`card-form-info-message`,nu=`card-form-validation-status-change`,ru=`Payment Details Collected`,iu=`3D Secure failed`}));function ou(){window.self===window.top?(uu||cu(),uu&&(uu.style.display=`none`)):window.parent.postMessage({status:Bl},`*`)}function su(){window.self===window.top?(uu||cu(),uu&&(uu.style.display=`block`)):window.parent.postMessage({status:zl},`*`)}function cu(){uu=document.getElementById(`payfurl-spinner`),!uu&&document.body&&(uu=document.createElement(`div`),uu.id=`payfurl-spinner`,uu.style.display=`none`,document.body.appendChild(uu),Qs({el:uu,component:Tl}))}function lu(){return window.self===window.top&&cu(),{showSpinner:su,hideSpinner:ou}}var uu,du=o((()=>{$s(),El(),au(),uu=null}));_e(),ye(),fl(),vl(),du();var{hideSpinner:fu,showSpinner:pu}=lu(),mu={PREAUTH:`PREAUTH`,AUTH:`AUTH`,POSTAUTH:`POSTAUTH`,AUTH_COMPLETE:`AUTH_COMPLETE`,GET_GATEWAY_DATA:`GET_GATEWAY_DATA`,TOKENISE_CARD:`TOKENISE_CARD`,PUT_TOKEN_EXTERNAL_3DS_DATA:`PUT_TOKEN_EXTERNAL_3DS_DATA`},hu=(e,t)=>({[mu.PREAUTH]:{url:e+(t?`/3ds/preauth/token/`+t:`/3ds/preauth`),method:`POST`},[mu.AUTH]:{url:e+(t?`/3ds/auth/token/`+t:`/3ds/auth`),method:`POST`},[mu.POSTAUTH]:{url:e+`/3ds/postauth`,method:`POST`},[mu.AUTH_COMPLETE]:{url:e+`/3ds/auth_complete`,method:`POST`},[mu.GET_GATEWAY_DATA]:{url:e+`/token/`+t+`/gateway_data`,method:`GET`},[mu.TOKENISE_CARD]:{url:e+`/token/card`,method:`POST`},[mu.PUT_TOKEN_EXTERNAL_3DS_DATA]:{url:e+`/token/`+t+`/external3dsdata`,method:`PUT`}}),gu=class{container=null;log;apiUrl=``;threeDsInvoker=null;providerId;requireChallenge=!1;cardProviderId;address=null;paymentInfo=null;tokenId=``;currency=`AUD`;amount=0;email=null;clientParameters={};failureCallback=null;successCallback=null;threeDSCompleteHandler=null;threeDSFailureHandler=null;httpInvoker=null;constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.providerId=t.providerId,this.cardProviderId=t.cardProviderId,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null,this.threeDsInvoker=t.threeDsInvoker||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setTokenId(e){this.tokenId=e}getTokenId(){return this.tokenId}getProviderId(){return this.providerId}setEmail(e){this.email=e}getEmail(){return this.email||``}setCurrency(e){this.currency=e}getCurrency(){return this.currency}setAmount(e){this.amount=e}getAmount(){return this.amount}setPaymentInfo(e){let t=e.expiryDate.split(`/`);this.paymentInfo={cardNumber:e.cardNumber,expiryDate:(t[1]||``)+(t[0]||``),cardholder:e.cardholder,ccv:e.ccv}}getPaymentInfo(){return{...this.paymentInfo}}setAddressInfo(e){this.address={...e}}getAddressInfo(){return{...this.address}}setClientParameters(e){this.clientParameters={...e}}getClientParameters(){return{...this.clientParameters}}onError(e){this.log(`[3ds error]`,e),fu(),q(this.container,e.error),this.threeDSFailureHandler?this.threeDSFailureHandler(e):this.failureCallback?.(e)}onSuccess(e){fu(),this.log(`[3ds success]`,e),this.threeDSCompleteHandler?this.threeDSCompleteHandler?.(e):this.successCallback?.(e)}onPreAuth(e,t){let n={acctNumber:this.paymentInfo?.cardNumber,providerId:this.providerId,ccv:this.paymentInfo?.ccv,cardProviderId:this.cardProviderId};this.log(`[onPreAuth]`,n),this.httpInvoker?.invoke(hu(this.apiUrl,this.tokenId)[mu.PREAUTH].url,hu(this.apiUrl,this.tokenId)[mu.PREAUTH].method,JSON.stringify(n),e,t)}onAuth(e,t,n,r,i,a,o){this.log(`[onAuth]`,{threeDSServerTransID:n,isMethodPerformed:r});let s=al(this.currency),c=ol(this.currency),l=new Date,u={acctNumber:this.paymentInfo?.cardNumber,notificationURL:this.apiUrl+`/3ds/auth_complete`,threeDSAuthURL:e,threeDSCompInd:r?`Y`:`U`,threeDSRequestorTransID:t,threeDSServerTransID:n,threeDSRequestorURL:window.location.href,cardExpiryDate:this.paymentInfo?.expiryDate,email:this.email,threeDSRequestorAuthenticationInd:`01`,cardholderName:this.paymentInfo?.cardholder,deviceChannel:`02`,browserInfo:i,browserJavascriptEnabled:!0,browserJavaEnabled:!1,browserLanguage:window.navigator.language,browserColorDepth:String(ve()),browserScreenHeight:screen.height+``,browserScreenWidth:screen.width+``,browserTZ:Math.round(l.getTimezoneOffset()/60)+``,browserUserAgent:navigator.userAgent,browserAcceptHeader:``,browserIP:``,messageCategory:`01`,messageType:`AReq`,messageVersion:`2.2.0`,purchaseAmount:(this.amount*10**c).toFixed(0)+``,payTokenInd:!0,purchaseCurrency:s,purchaseExponent:c+``,purchaseDate:l.toISOString().slice(0,19).replace(/[-:T]/g,``),transType:`01`,ccv:this.paymentInfo?.ccv&&String(this.paymentInfo?.ccv)||``,threeDSRequestorChallengeInd:this.requireChallenge?`04`:`01`};this.httpInvoker?.invoke(hu(this.apiUrl,this.tokenId)[mu.AUTH].url,hu(this.apiUrl,this.tokenId)[mu.AUTH].method,JSON.stringify(u),(e,t)=>{fu(),a(e,t)},o)}onPostAuth(e,t,n){this.log(`[onPostAuth]`,e),pu(),this.httpInvoker?.invoke(hu(this.apiUrl,this.tokenId)[mu.POSTAUTH].url,hu(this.apiUrl,this.tokenId)[mu.POSTAUTH].method,JSON.stringify(e),t,n)}threeDSInvoke(e,t,n,r){this.container=e,this.threeDSCompleteHandler=n||null,this.threeDSFailureHandler=r||null,this.requireChallenge=t,this.threeDsInvoker?.onPreAuth()}getGatewayData(e,t,n,r){this.httpInvoker?.invoke(hu(this.apiUrl,t)[mu.GET_GATEWAY_DATA].url,hu(this.apiUrl,t)[mu.GET_GATEWAY_DATA].method,null,T(this,`[getGatewayDataSuccessCallback]`,(e,t)=>{this.log(`getGatewayDataSuccessCallback`,e),n(JSON.parse(t))}),T(this,`[getGatewayDataFailureCallback]`,(e,t)=>{this.log(`getGatewayDataFailureCallback`,e,t),fu(),r()}),{providerId:e})}tokeniseCard(e,t,n){let r=this.getPaymentInfo();!r.cardNumber||!r.expiryDate||!r.cardholder?n(`Card information is missing`):(pu(),this.httpInvoker?.invoke(hu(this.apiUrl)[mu.TOKENISE_CARD].url,hu(this.apiUrl)[mu.TOKENISE_CARD].method,JSON.stringify({paymentInformation:{cardNumber:r.cardNumber,expiryDate:`${r.expiryDate.slice(2)}/${r.expiryDate.slice(0,2)}`,cardholder:r.cardNumber,ccv:r.ccv},currency:this.getCurrency(),amount:this.getAmount()}),T(this,`[tokeniseCardSuccessCallback]`,(e,n)=>{this.log(`tokeniseCardSuccessCallback`,e,n),fu(),t(JSON.parse(n))}),T(this,`[tokeniseCardFailureCallback]`,(e,t)=>{this.log(`tokeniseCardFailureCallback`,e,t),fu(),n(`Unable to tokenise payment information`)}),{providerId:e}))}updateTokenExternal3dsData(e){this.tokenId&&e&&Object.keys(e).length!==0&&this.httpInvoker?.invoke(hu(this.apiUrl,this.tokenId)[mu.PUT_TOKEN_EXTERNAL_3DS_DATA].url,hu(this.apiUrl,this.tokenId)[mu.PUT_TOKEN_EXTERNAL_3DS_DATA].method,JSON.stringify(e),(e,t)=>{this.log(`updateTokenExternal3dsDataSuccessCallback`,e,t)},(e,t)=>{this.log(`updateTokenExternal3dsDataFailureCallback`,e,t),fu()},{})}};d([w],gu.prototype,`setPaymentInfo`,null),d([w],gu.prototype,`onError`,null),d([w],gu.prototype,`onSuccess`,null),d([w],gu.prototype,`onPreAuth`,null),d([w],gu.prototype,`onAuth`,null),d([w],gu.prototype,`onPostAuth`,null),d([w],gu.prototype,`threeDSInvoke`,null),d([w],gu.prototype,`getGatewayData`,null),d([w],gu.prototype,`tokeniseCard`,null),d([w],gu.prototype,`updateTokenExternal3dsData`,null),W();var _u=P(!1);function vu(){return{isLoading:_u,startLoading:()=>{_u.value=!0},stopLoading:()=>{_u.value=!1}}}W(),El(),au();var yu={style:{position:`relative`}},bu={key:0,class:`error text-normal`},xu=`payfurl-paypal-script`,Su=L({__name:`PaypalForm`,props:{log:{type:Function},el:{},currency:{},enablePayIn4:{type:Boolean},buttonStyle:{},clickGate:{type:Function}},emits:[`approve`,`submit`,`activate`,`close`],setup(e,{emit:t}){let n=e,r=t,i=P(null),a=P(!0),o=P(``),s=P(null),c=!1,l=null,{isLoading:u}=vu();function d(e){s.value=e,n.log&&n.log(`[Paypal]: checkout`,s.value),c||(c=!0,f())}function f(){if(document.getElementById(xu)){p();return}let e={"client-id":s.value?.gatewayTransactionData.ClientId||``,currency:n.currency.toUpperCase(),"disable-funding":`card`};n.enablePayIn4&&(e[`enable-funding`]=`paylater`);let t=`https://www.paypal.com/sdk/js?${new URLSearchParams(e)}`;window.paypal=null;let r=document.createElement(`script`);r.src=t,r.id=xu,r.onload=p,document.body.appendChild(r)}function p(){window.paypal&&window.paypal.Buttons&&(window.paypal.Buttons({style:{color:n.buttonStyle},createOrder:function(){return s.value?.gatewayTransactionId},onApprove:function(e,t){r(`approve`,{data:e,actions:t})},onInit(e,t){t.disable(),l=setInterval(()=>{n.clickGate()?.()===!1?t.disable():t.enable()},1e3)}}).render(n.el),window.postMessage({status:Dl},`*`))}function m(e){e?.data?.status&&(e.data.status===`activate`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),a.value=!0,r(`activate`)),e.data.status===`deactivate`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),a.value=!1),e.data.status===`checkout-ready`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),d(e.data.checkoutData)),e.data.status===`message`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),o.value=e.data.message),e.data.status===`error`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),o.value=e.data.error))}return Wa(()=>{window.removeEventListener(`message`,m),l&&clearInterval(l)}),Ba(()=>{window.addEventListener(`message`,m),Oc(i.value,`payfurl-combined-container`)||(a.value=!0,r(`activate`))}),(e,t)=>(R(),z(H,null,[B(`div`,yu,[Or(U(Tl,null,null,512),[[Ts,F(u)]])]),B(`div`,{style:{position:`relative`},ref_key:`root`,ref:i},[o.value?(R(),z(`div`,bu,M(o.value),1)):V(``,!0)],512)],64))}}),Cu={APPROVED:`Approved`,DECLINED:`Declined`,UNDECIDED:`Undecided`};function wu(e){return e?e.decision===Cu.DECLINED&&e.stopPaymentOnFailure===!0:!1}function Tu(e){return e===`forter`}function J(e){if(e==null)return null;var t={};for(var n in e)t[n]=e[n];return t}$s(),_e(),tl(),fl(),vl(),du(),au();var{hideSpinner:Eu,showSpinner:Du}=lu(),Ou=class{container=null;log;apiUrl=``;failureCallback=null;successCallback=null;userOnValidate;fraudProcessor=null;httpInvoker=null;destroy=()=>{};checkoutExternalId=``;amount=0;userSuccessMessage=ru;constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}addFraudProcessor(e){this.fraudProcessor=e}setSuccessMessage(e){this.userSuccessMessage=e}getSuccessMessage(){return this.userSuccessMessage}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){this.container?.id===e?.id&&(this.log(`[paypalProcessor], cleanUp`),this.destroy?.())}addPaypal(e,t,n,r,i,a){this.log(`[paypalProcessor][addPaypal]`,{amount:n,currency:r,providerId:i,options:a}),this.validateOptions(e,n,r);let o=!1;this.container=e,this.fraudProcessor&&(this.fraudProcessor.setAmount(n),this.fraudProcessor.setCurrency(r));let s=Qs({el:e,component:Su,props:{log:this.log,el:e,currency:r,enablePayIn4:!!a?.paypalEnablePayIn4,buttonStyle:a?.paypalButtonStyle,clickGate:this.getOnValidate.bind(this)},on:{activate:T(this,`[Paypal]: activate`,()=>{o||(o=!0,this.log(`[Paypal]: activate paypal form`),this.checkout(this.amount||n,r,i,a||{},()=>{o=!1}),this.setAmount=e=>{this.log(`[Paypal][setAmount][inside]`,e),this.checkout(e,r,i,a||{},()=>{o=!1})})}),approve:T(this,`[Paypal]: approved`,({data:t,actions:n})=>{this.log(`[Paypal]: approved`,{data:t,actions:n});let r=n.order.get();this.log(`[Paypal]: order`,r);let i=setInterval(()=>{if(this.log(`[Paypal]: setInterval resolved = `+r.resolved),r.resolved){clearInterval(i);try{this.chargeApproved(e,r)}catch(t){Eu(),q(e,`Payment couldn't be processed`),this.failureCallback?.({error:t?.message||`Payment couldn't be processed`})}}},200)})}});this.destroy=s.destroy}chargeApproved(e,t){this.fraudProcessor?(this.fraudProcessor.setPaypalInfo({payerId:t.value.payer.payer_id,payerEmail:t.value.payer.email_address,paymentStatus:t.value.status,payerAccountCountry:t.value.payer.address?.country_code,paymentId:t.value.id}),Du(),this.fraudProcessor.fraudCheck(t=>{Eu(),wu(t)?(q(e,`Payment couldn't be processed`),this.failureCallback?.({error:`Payment couldn't be processed`})):this.addCharge(e,t)},t=>{Eu(),q(e,t.error),this.failureCallback?.(t)})):this.addCharge(e,null)}setAmount(e){this.amount=e,this.fraudProcessor?.setAmount(e)}checkout(e,t,n,r,i){let a=this.apiUrl+`/payment_method/checkout`;r||={hideShipping:!1,paypalButtonStyle:null,paypalEnablePayIn4:!1,transfer:null};let o={providerId:n,amount:e,currency:t,options:{HideShipping:r.hideShipping?`true`:`false`},metadata:J(r?.metadata)};r.transfer?.amount&&(o.transfer={account:r.transfer.account,amount:r.transfer.amount}),vu().startLoading(),this.httpInvoker?.invoke(a,`POST`,JSON.stringify(o),this.successCheckoutHandler.bind(this),(e,t)=>{i?.(e,t),this.failureCheckoutHandler.bind(this)(e,t)})}failureCheckoutHandler=(e,t)=>{vu().stopLoading(),this.failureCallback?.({error:`Failed to configure paypal`,body:t}),window.postMessage({status:`error`,component:`paypal`,error:`Failed to configure paypal`},`*`)};successCheckoutHandler=T(this,`[PayPal][successCheckoutHandler]`,(e,t)=>{vu().stopLoading();let n=JSON.parse(t);this.log(`paypal success`,n);let r=JSON.parse(t),i=JSON.parse(window.atob(r.checkoutData));this.checkoutExternalId=i.externalId,window.postMessage({status:kl,component:`paypal`,checkoutData:i},`*`)});getFailureAddChargeHandler(e){return T(this,`[PayPalProcessor][getFailureAddChargeHandler]`,(t,n)=>{q(e,`Unable to tokenise payment information`),this.failureCallback?.({error:`Unable to finish AddCharge`,body:n}),this.log(`Unable to finish AddCharge, error: `+n)})}getSuccessAddChargeHandler(e){return T(this,`[PayPalProcessor][getSuccessAddChargeHandler]`,(t,n)=>{let r=JSON.parse(n);this.log(`[getSuccessAddChargeHandler]`,r),el(e,this.getSuccessMessage()),this.successCallback?.({transactionId:r.chargeId})})}addCharge(e,t){let n=this.apiUrl+`/charge/checkout`;this.httpInvoker?.invoke(n,`POST`,JSON.stringify({externalId:this.checkoutExternalId,fraudCheck:t}),this.getSuccessAddChargeHandler(e).bind(this),this.getFailureAddChargeHandler(e).bind(this))}validateOptions(e,t,n){if(!il(n))throw q(e,`Invalid currency: `+n),TypeError(`invalid currency: `+n);if(!uc(t))throw q(e,`Invalid amount: `+t),TypeError(`invalid amount: `+t)}};d([w],Ou.prototype,`cleanUp`,null),d([w],Ou.prototype,`addPaypal`,null),d([w],Ou.prototype,`setAmount`,null),d([w],Ou.prototype,`checkout`,null),d([w],Ou.prototype,`getFailureAddChargeHandler`,null),d([w],Ou.prototype,`getSuccessAddChargeHandler`,null),d([w],Ou.prototype,`addCharge`,null),d([w],Ou.prototype,`validateOptions`,null),W(),au();var ku=[`src`],Au={key:0,id:`threeDs`},ju=620,Mu=L({__name:`CardForm`,props:{log:{type:Function},iframeSrc:{},form:{},threeDSEnabled:{type:Boolean},clickGate:{type:Function}},emits:[`load`,`submit`,`close`],setup(e,{emit:t}){let n=e,r=t,i=P(null),a=P(n.iframeSrc+`?v=`+Math.random()),o=P(n.threeDSEnabled),s=P(!1),c=P(!0),l=P(!1),u=``;function d(e){if(e?.data?.status){if(e.data.status===`iframe-has-changed`&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),e.stopPropagation(),p(e.data.message?.height||0)),(e.data.status===`secure-orchestrator-show-challenge`||e.data.status===`secure-orchestrator-hide-challenge`)&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),m(e.data.status===Ll)),e.data.status===`submit-card-form`){if(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),!n.form||!c.value)return;if(e.stopPropagation(),n.form.querySelector(`input[name="token"]`)?.value){n.form.submit();return}if(n.clickGate()?.()===!1)return;r(`submit`)}e.data.status===`activate`&&e.data.component===`card`&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),c.value=!0),e.data.status===`deactivate`&&e.data.component===`card`&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),c.value=!1)}}Wa(()=>{window.removeEventListener(`message`,d)}),Ba(()=>{window.addEventListener(`message`,d)});function f(){r(`load`,i.value)}function p(e){if(l.value)return;let t=i.value;if(e===0){t?.setAttribute(`style`,`height:0`);return}let n=e||200;t?.setAttribute(`style`,`height: ${n+5}px`),s.value=!0}function m(e){let t=i.value;t&&(e?(u=t.style.height||`200px`,l.value=!0,t.setAttribute(`style`,`height: ${ju}px`)):(l.value=!1,t.setAttribute(`style`,`height: ${u}`)))}return(e,t)=>(R(),z(H,null,[B(`iframe`,{src:a.value,onLoad:f,ref_key:`iframe`,ref:i,style:Me(`height:${F(200)}px`),id:`payfurl-card-iframe`},null,44,ku),o.value?(R(),z(`div`,Au)):V(``,!0)],64))}});au();var Nu=class{log;startLoadingCardFormHandler=null;constructor(e){this.log=e}getCardFormFrame(){return document.getElementById(`payfurl-card-iframe`)}startLoadingCardForm(){let e=this.getCardFormFrame();if(!e)this.startLoadingCardFormHandler=setTimeout(()=>{this.startLoadingCardForm()},200);else{this.startLoadingCardFormHandler=null,this.log(`[startLoadingCardForm]`);try{e.contentWindow?.postMessage({status:Jl},`*`)}catch(e){this.log(`[startLoadingCardForm] iframe error`,e)}}}stopLoadingCardForm(){this.startLoadingCardFormHandler&&=(clearTimeout(this.startLoadingCardFormHandler),null);let e=this.getCardFormFrame();if(!e)setTimeout(()=>{this.stopLoadingCardForm()},200);else{this.log(`[stopLoadingCardForm]`);try{e.contentWindow?.postMessage({status:Yl},`*`)}catch(e){this.log(`[stopLoadingCardForm] iframe error`,e)}}}pauseLoadingCardForm(){let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:Xl},`*`)}catch(e){this.log(`[pauseLoadingCardForm] iframe error`,e)}}unpauseLoadingCardForm(){let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:Zl},`*`)}catch(e){this.log(`[unpauseLoadingCardForm] iframe error`,e)}}showMessage(e){let t=this.getCardFormFrame();t&&t.contentWindow?.postMessage({status:eu,message:e},`*`)}showInfoMessage(e){let t=this.getCardFormFrame();t&&t.contentWindow?.postMessage({status:tu,message:e},`*`)}requestCardDetails(){let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:Ml},`*`)}catch(e){this.log(`[requestCardDetails] iframe error`,e)}}};d([w],Nu.prototype,`startLoadingCardForm`,null),d([w],Nu.prototype,`stopLoadingCardForm`,null),d([w],Nu.prototype,`pauseLoadingCardForm`,null),d([w],Nu.prototype,`unpauseLoadingCardForm`,null),d([w],Nu.prototype,`showMessage`,null),d([w],Nu.prototype,`showInfoMessage`,null),d([w],Nu.prototype,`requestCardDetails`,null),he();function Pu(e){return e===C.PRODUCTION?{acquirerMerchantId:`550e8400`,acquirerBIN:`444444`,authenticationReasons:[`TRANSACTION_AUTHENTICATION`]}:{acquirerMerchantId:`SRC3DS`,acquirerBIN:`545301`,authenticationReasons:[`TRANSACTION_AUTHENTICATION`]}}fl(),vl(),_e(),_c(),du();var{hideSpinner:Fu,showSpinner:Iu}=lu(),Lu={UPDATE:`UPDATE`},Ru=(e,t)=>({[Lu.UPDATE]:{url:e+(`/token/`+t+`/authentication`),method:`PUT`}}),zu=class extends Nu{environment;token;networkToken;networkTokenData;networkTokenAuthenticateUrl;networkTokenProvider;networkTokenOptions;isReady=!1;invokeHandler=null;modal=null;apiUrl;httpInvoker=null;onSuccessCallback;onFailureCallback;constructor(e,t){super(e),this.log(`[MastercardTokenAuthenticationProcessor]`,t),this.environment=t.environment,this.token=t.token,this.networkToken=t.networkToken,this.networkTokenData=t.networkTokenData,this.networkTokenAuthenticateUrl=t.redirectUrl,this.networkTokenProvider=t.networkTokenProvider;let n=Pu(this.environment);this.networkTokenOptions={...n,...t.networkTokenOptions};let r=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,``,r),this.apiUrl=t.apiUrl,window.addEventListener(`message`,this.messageHandler.bind(this)),this.init()}invoke(e,t,n,r){this.log(`[MastercardTokenAuthenticationProcessor][invoke]`,{isReady:this.isReady,amount:e,currency:t}),this.onSuccessCallback=n,this.onFailureCallback=r,this.invokeHandler=()=>{this.invokeHandler=null,this.authenticate(e,t)},this.isReady?this.invokeHandler():this.modalShow()}messageHandler(e){if(e.data?.action){if(this.log(`[MastercardTokenAuthenticationProcessor][messageHandler]`,e),e.data.action===`Ready`)this.isReady=!0,this.invokeHandler&&this.invokeHandler();else if(e.data.action===`Error`){if(this.modalHide(),e.data.payload.message===`NOT_SUPPORTED`){this.showMessage(`This card is not supported token authentication. Please use another card.`),this.onFailureCallback?.({error:`This card is not supported token authentication. Please use another card.`});return}this.showMessage(`Unknown error. Please try again later.`),this.onFailureCallback?.({error:`Unknown error. Please try again later.`})}else if(e.data.action===`Success`){if(e.data.payload.authenticationStatus===`CANCELLED`){this.modalHide(),this.showMessage(`Cancelled 3DS Challenge`),this.onFailureCallback?.({error:`Cancelled 3DS Challenge`});return}if(e.data.payload.authenticationResult===`NOT_AUTHENTICATED`){this.modalHide(),this.showMessage(`Failed 3DS Challenge`),this.onFailureCallback?.({error:`Failed 3DS Challenge`});return}this.updateToken(e.data.payload)}}}authenticate(e,t){let n=this.networkTokenOptions?.authenticationReasons||[`ENROL_FINANCIAL_INSTRUMENT`];n.includes(`ENROL_FINANCIAL_INSTRUMENT`)&&(e=0);let r={srcClientId:this.networkTokenProvider.clientParameters.SrcClientId,serviceId:this.networkTokenProvider.clientParameters.ServiceId,srcCorrelationId:this.networkTokenData.SrcCorrelationId,traceId:this.networkTokenData[`X-Src-Cx-Flow-Id`],accountReference:{srcDigitalCardId:this.networkToken},authenticationMethod:{authenticationMethodType:`MANAGED_AUTHENTICATION`,uriData:{uri:this.networkTokenAuthenticateUrl,uriType:`WEB_URI`}},authenticationContext:{authenticationReasons:n,dpaTransactionOptions:{dpaLocale:`en_AU`,merchantCountryCode:`AU`,transactionAmount:{transactionAmount:Number(e),transactionCurrencyCode:String(t).toUpperCase()}}}};n.includes(`TRANSACTION_AUTHENTICATION`)?r.authenticationContext.dpaData={dpaName:this.networkTokenProvider.clientParameters.DpaName,merchantCountryCode:`AU`}:r.authenticationContext.srcDpaId=this.networkTokenProvider.clientParameters.SrcDpaId,this.networkTokenOptions?.acquirerMerchantId&&(r.authenticationContext.acquirerMerchantId=this.networkTokenOptions.acquirerMerchantId),this.networkTokenOptions?.acquirerBIN&&(r.authenticationContext.acquirerBIN=this.networkTokenOptions.acquirerBIN),this.networkTokenOptions?.merchantCategoryCode&&(r.authenticationContext.dpaTransactionOptions.merchantCategoryCode=this.networkTokenOptions.merchantCategoryCode,r.authenticationContext.dpaData&&(r.authenticationContext.dpaData.merchantCategoryCode=this.networkTokenOptions.merchantCategoryCode)),this.log(`[MastercardTokenAuthenticationProcessor][authenticate]`,r),this.modal?.postMessage({action:`Authenticate`,payload:r},`*`)}init(){this.initCss()}initCss(){let e=document.createElement(`style`);e.textContent=`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.payfurl=t())})(this,function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function d(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var f,p=o((()=>{f={baseUrl:``,cssUrl:``,redirectUrl:``,url:``,secureUrl:`/dist/secure/index.html`,apiUrl:``,errorUrl:`https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws`}})),m,h=o((()=>{m={baseUrl:`https://assets.payfurl.com`,cssUrl:`https://assets.payfurl.com/v4.11.1/js/`,url:`https://assets.payfurl.com/v4.11.1/iframe/index.html`,secureUrl:`https://assets.payfurl.com/v4.11.1/secure/index.html`,redirectUrl:`https://assets.payfurl.com/v4.11.1/checkout/redirect.html`,apiUrl:`https://develop-api.payfurl.com`,errorUrl:`https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws`}})),g,_=o((()=>{g={baseUrl:`https://assets.payfurl.com`,cssUrl:`https://assets.payfurl.com/v4.11.1/js/`,url:`https://assets.payfurl.com/v4.11.1/iframe/index.html`,secureUrl:`https://assets.payfurl.com/v4.11.1/secure/index.html`,redirectUrl:`https://assets.payfurl.com/v4.11.1/checkout/redirect.html`,apiUrl:`https://sandbox-api.payfurl.com`,errorUrl:`https://gujl7xo5fhpkjaain4swyiymt40loyia.lambda-url.ap-southeast-2.on.aws`}})),v,y=o((()=>{v={baseUrl:`https://assets.payfurl.com`,cssUrl:`https://assets.payfurl.com/v4.11.1/js/`,url:`https://assets.payfurl.com/v4.11.1/iframe/index.html`,secureUrl:`https://assets.payfurl.com/v4.11.1/secure/index.html`,redirectUrl:`https://assets.payfurl.com/v4.11.1/checkout/redirect.html`,apiUrl:`https://api.payfurl.com`,errorUrl:`https://4rvkh6tupgcmqk3b2igkpdi2zi0mveyg.lambda-url.ap-southeast-2.on.aws`}})),b,ee,te,ne,x,S,re,ie,ae,oe,se,ce,le,ue,de=o((()=>{b=`@payfurl/client`,ee=`4.11.1`,te=`https://docs.payfurl.com/client_sdk/overview`,ne={url:`https://docs.payfurl.com/support`},x=[`dist/sdk`,`CHANGELOG.md`],S=`module`,re=`./dist/sdk/payfurl.umd.js`,ie=`./dist/sdk/payfurl.es.js`,ae=`./dist/sdk/payfurl.d.ts`,oe={".":{types:`./dist/sdk/payfurl.d.ts`,import:`./dist/sdk/payfurl.es.js`,require:`./dist/sdk/payfurl.umd.js`}},se={dev:`node .build/config-local.mjs && vite -c vite.iframe.config.ts`,"build-iframe":`node .build/config-local.mjs && vite build -c vite.iframe.config.ts --emptyOutDir`,"build-secure":`node .build/config-local.mjs && vite build -c vite.secure.config.ts --emptyOutDir`,"build-sdk":`node .build/config-local.mjs && vite build -c vite.sdk.config.ts`,build:`npm run build-all`,"build-all":`npm run build-iframe && npm run build-secure && npm run build-sdk`,preview:`vite preview`,server:`python3 -m http.server 3001`,test:`node .build/config-local.mjs && jest`,"update-packages":`ncu -u && npm update --save`,remove_js:`git ls-files -o --exclude-standard | grep '.js' | xargs rm`,remove_d_ts:`git ls-files -o --exclude-standard | grep '.d.ts' | xargs rm`},ce={dayjs:`^1.11.13`,vue:`^3.5.10`},le={"@babel/preset-env":`^7.25.4`,"@babel/types":`^7.25.6`,"@jest/globals":`^29.7.0`,"@rollup/plugin-typescript":`^12.1.0`,"@types/applepayjs":`^14.0.8`,"@types/jest":`^29.5.13`,"@types/jest-when":`^3.5.5`,"@types/node":`^22.7.4`,"@vitejs/plugin-vue":`^6.0.7`,"@vue/eslint-config-prettier":`^9.0.0`,"@vue/eslint-config-typescript":`^13.0.0`,"@vue/vue3-jest":`^29.2.6`,"babel-jest":`^29.7.0`,eslint:`^8.56.0`,"eslint-plugin-vue":`^9.28.0`,jest:`^29.7.0`,"jest-environment-jsdom":`^29.7.0`,"jest-when":`^3.6.0`,prettier:`^3.3.3`,"rollup-plugin-visualizer":`^5.12.0`,"ts-jest":`^29.2.5`,"ts-node":`^10.9.2`,tslib:`^2.8.1`,typescript:`^5.6.2`,vite:`^8.0.16`,"vite-plugin-checker":`^0.8.0`,"vite-plugin-dts":`^4.5.4`,"vue-tsc":`^2.1.6`},ue={name:b,private:!1,version:ee,homepage:te,bugs:ne,files:x,type:S,main:re,module:ie,types:ae,exports:oe,scripts:se,dependencies:ce,devDependencies:le}}));function fe(e){let t=me[e];return t&&Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.split(`{VERSION}`).join(ue.version)]))}function pe(e){let t=me[e];return t||=me[C.PRODUCTION],t.errorUrl}var C,me,he=o((()=>{p(),h(),_(),y(),de(),(function(e){e.LOCAL=`local`,e.DEVELOPMENT=`development`,e.SANDBOX=`sandbox`,e.PRODUCTION=`production`})(C||={}),me={[C.LOCAL]:f,[C.DEVELOPMENT]:m,[C.SANDBOX]:g,[C.PRODUCTION]:v}})),ge,_e=o((()=>{ge=class{publicKey=``;version=``;regionResolver=null;constructor(e,t,n){this.publicKey=e||``,this.version=t||``,this.regionResolver=n||null}invoke(e,t,n,r,i,a){let o=new XMLHttpRequest;o||i?.(0,``),o.onreadystatechange=function(){o.readyState===4&&(o.status===200||o.status===201?r?.(o.status,o.responseText):i?.(o.status,o.responseText))};let s=new URL(e);if(this.regionResolver&&(s.hostname=new URL(this.regionResolver.getRegionUrl()).hostname),o.open(t,s.toString()),o.setRequestHeader(`Content-Type`,`application/json`),this.publicKey&&o.setRequestHeader(`x-publickey`,this.publicKey),this.version&&o.setRequestHeader(`sdk-version`,this.version),a)for(let[e,t]of Object.entries(a))o.setRequestHeader(e,t);o.send(String(n))}}}));function ve(){let e=[1,4,8,15,16,24,32,48],t=screen.colorDepth;if(e.indexOf(t)==-1){let n=e[0],r=Math.abs(e[0]-t);for(let i=1;i<=e.length;i++){let a=Math.abs(e[i]-t);a<r&&(n=e[i],r=a)}t=n}return t}var ye=o((()=>{}));he(),_e(),ye();var be=class e{static instance;static environment;static publicKey;static version;httpInvoker=null;constructor(){if(e.instance)return e.instance;this.httpInvoker=new ge,e.instance=this}static init(t,n,r){return e.environment=t,e.publicKey=n,e.version=r,new e}sendError(t,n,r){try{let i=pe(e.environment),a=new Date;this.httpInvoker?.invoke(i,`POST`,JSON.stringify({method:t,message:n,context:{publicKey:e.publicKey,version:e.version,environment:e.environment,browser:{userAgent:navigator.userAgent,language:window.navigator.language,colorDepth:String(ve()),screenHeight:screen.height+``,screenWidth:screen.width+``,timezone:Math.round(a.getTimezoneOffset()/60)+``,referrer:document.referrer}},arguments:Object.values(r).map(e=>typeof e==`object`?JSON.stringify(e):String(e))}))}catch(e){console.error(`Error sending error`,e)}}};function xe(e){return`**** **** **** `+e.replace(/[\s-]/g,``).slice(-4)}function Se(e){let t=e.replace(/[\s-]/g,``);return Ee.test(e.trim())&&t.length>=12&&t.length<=19?xe(e):De.test(t)?`***`:e}function Ce(e,t=new WeakSet){if(typeof e==`string`)return Se(e);if(typeof e!=`object`||!e)return e;if(t.has(e))return`[circular]`;if(t.add(e),Array.isArray(e))return e.map(e=>Ce(e,t));if(e instanceof Error)return{name:e.name,message:e.message};let n={};if(e.constructor!==Object&&e.constructor!==void 0&&e.name!==`click2PayError`)return n;for(let r of Object.keys(e)){let i=e[r];if(typeof i==`function`||typeof Node<`u`&&i instanceof Node)continue;let a=r.toLowerCase();n[r]=we.includes(a)&&i?xe(String(i)):Te.includes(a)&&i!=null&&i!==``?`***`:Ce(i,t)}return n}var we,Te,Ee,De,Oe=o((()=>{we=[`cardnumber`,`acctnumber`],Te=[`ccv`,`cvv`,`cvv2`,`cvc`,`cvc2`,`csc`,`securitycode`,`cardsecuritycode`,`paymentdata`,`tokenizationdata`,`cryptogram`,`onlinepaymentcryptogram`,`authenticationvalue`,`cavv`,`recognitiontoken`,`otp`],Ee=/^\d[\d -]{10,24}\d$/,De=/^\d{3,4}$/}));Oe();function w(e,t,n){let r=n.value;n.value=function(){try{return r.apply(this,arguments)}catch(e){throw new be().sendError(t,e.message,Ae(Array.from(arguments))),console.warn(`[ErrorHandled], exception`,{error:e,propertyKey:t,arguments:Ae(Array.from(arguments))}),e}}}function T(e,t,n){return function(...r){try{return n.apply(e,r)}catch(e){throw new be().sendError(t,e.message,Ae(r)),console.warn(`[ErrorHandledFunction], exception`,{error:e,funcName:t,args:Ae(r)}),e}}}function ke(e,t,n){new be().sendError(e,t,Ae(n))}function Ae(e){return e.map(e=>Ce(e))}function je(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}function Me(e){if(k(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=j(r)?Ne(r):Me(r);if(i)for(let e in i)t[e]=i[e]}return t}if(j(e)||M(e))return e}function Ne(e){let t={};return e.replace(xt,e=>e.startsWith(`/*`)?``:e).split(yt).forEach(e=>{if(e){let n=e.split(bt);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Pe(e){let t=``;if(j(e))t=e;else if(k(e))for(let n=0;n<e.length;n++){let r=Pe(e[n]);r&&(t+=r+` `)}else if(M(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function Fe(e){return!!e||e===``}function Ie(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Be(e[i],t[i],n);return r}function Le(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Be(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Re(e,t,n){let r=Ye(e),i=Ye(t);if(r||i||(r=Xe(e),i=Xe(t),r||i))return r&&i?Le(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Be(e[r],t[r],n))return!1}return String(e)===String(t)}function ze(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Be(e,t,n){if(e===t)return!0;let r=Ze(e),i=Ze(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=Qe(e),i=Qe(t),r||i?e===t:(r=k(e),i=k(t),r||i?r&&i?ze(e,t,n,Ie):!1:(r=M(e),i=M(t),r||i?!r||!i?!1:ze(e,t,n,Re):String(e)===String(t))))}function Ve(e,t){return e.findIndex(e=>Be(e,t))}var E,He,Ue,We,Ge,Ke,D,qe,Je,O,k,Ye,Xe,Ze,A,j,Qe,M,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,N,Tt,Et,Dt=o((()=>{E={},He=[],Ue=()=>{},We=()=>!1,Ge=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ke=e=>e.startsWith(`onUpdate:`),D=Object.assign,qe=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},Je=Object.prototype.hasOwnProperty,O=(e,t)=>Je.call(e,t),k=Array.isArray,Ye=e=>tt(e)===`[object Map]`,Xe=e=>tt(e)===`[object Set]`,Ze=e=>tt(e)===`[object Date]`,A=e=>typeof e==`function`,j=e=>typeof e==`string`,Qe=e=>typeof e==`symbol`,M=e=>typeof e==`object`&&!!e,$e=e=>(M(e)||A(e))&&A(e.then)&&A(e.catch),et=Object.prototype.toString,tt=e=>et.call(e),nt=e=>tt(e).slice(8,-1),rt=e=>tt(e)===`[object Object]`,it=e=>j(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,at=je(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ot=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},st=/-\w/g,ct=ot(e=>e.replace(st,e=>e.slice(1).toUpperCase())),lt=/\B([A-Z])/g,ut=ot(e=>e.replace(lt,`-$1`).toLowerCase()),dt=ot(e=>e.charAt(0).toUpperCase()+e.slice(1)),ft=ot(e=>e?`on${dt(e)}`:``),pt=(e,t)=>!Object.is(e,t),mt=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ht=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},gt=e=>{let t=parseFloat(e);return isNaN(t)?e:t},vt=()=>_t||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},yt=/;(?![^(]*\))/g,bt=/:([^]+)/,xt=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g,St=`itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,Ct=je(St),wt=e=>!!(e&&e.__v_isRef===!0),N=e=>j(e)?e:e==null?``:k(e)||M(e)&&(e.toString===et||!A(e.toString))?wt(e)?N(e.value):JSON.stringify(e,Tt,2):String(e),Tt=(e,t)=>wt(t)?Tt(e,t.value):Ye(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Et(t,r)+` =>`]=n,e),{})}:Xe(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Et(e))}:Qe(t)?Et(t):M(t)&&!k(t)&&!rt(t)?String(t):t,Et=(e,t=``)=>Qe(e)?`Symbol(${e.description??t})`:e}));function Ot(){return Sn}function kt(e,t=!1){e.flags|=8,t?(e.next=On,On=e):(e.next=Dn,Dn=e)}function At(){En++}function jt(){if(--En>0)return;if(On){let e=On;for(On=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Dn;){let t=Dn;for(Dn=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Mt(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Nt(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),It(r),Lt(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Pt(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ft(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ft(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===jn)||(e.globalVersion=jn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Pt(e))))return;e.flags|=2;let t=e.dep,n=L,r=kn;L=e,kn=!0;try{Mt(e);let n=e.fn(e._value);(t.version===0||pt(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{L=n,kn=r,Nt(e),e.flags&=-3}}function It(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)It(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Lt(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Rt(){An.push(kn),kn=!1}function zt(){let e=An.pop();kn=e===void 0||e}function Bt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=L;L=void 0;try{t()}finally{L=e}}}function Vt(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Vt(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}function Ht(e,t,n){if(kn&&L){let t=Pn.get(e);t||Pn.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Nn),r.map=t,r.key=n),r.track()}}function Ut(e,t,n,r,i,a){let o=Pn.get(e);if(!o){jn++;return}let s=e=>{e&&e.trigger()};if(At(),t===`clear`)o.forEach(s);else{let i=k(e),a=i&&it(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Ln||!Qe(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Ln)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Fn)),Ye(e)&&s(o.get(In)));break;case`delete`:i||(s(o.get(Fn)),Ye(e)&&s(o.get(In)));break;case`set`:Ye(e)&&s(o.get(Fn))}}jt()}function Wt(e){let t=P(e);return t===e||(Ht(t,`iterate`,Ln),fn(e))?t:dn(e)?un(e)?t.map(e=>ir(rr(e))):t.map(ir):t.map(rr)}function Gt(e){return Ht(e=P(e),`iterate`,Ln),e}function Kt(e,t){return dn(e)?ir(un(e)?rr(t):t):rr(t)}function qt(e,t,n){let r=Gt(e),i=r[t],a=i.call(r);if(r!==e&&!fn(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>Jt(a.next(),n),i!==zn[t]&&Object.defineProperties(e,{return:{get(){let e=a.return;return typeof e==`function`?e.bind(a):e}},throw:{get(){let e=a.throw;return typeof e==`function`?e.bind(a):e}}}),e}a._next=a.next,a.next=()=>Jt(a._next(),n)}return a}function Jt(e,t){return e.done||(e.value=t(e.value)),e}function Yt(e,t,n,r,i,a){let o=Gt(e),s=o!==e&&!fn(e),c=o[t];if(c!==zn[t]){let t=c.apply(e,a);return s?rr(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,Kt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Xt(e,t,n,r){let i=Gt(e),a=i!==e&&!fn(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=Kt(e,t)),n.call(this,t,Kt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?Kt(e,c):c}function Zt(e,t,n){let r=P(e);Ht(r,`iterate`,Ln);let i=r[t](...n);return(i===-1||i===!1)&&pn(n[0])?(n[0]=P(n[0]),r[t](...n)):i}function Qt(e,t,n=[]){Rt(),At();let r=P(e)[t].apply(e,n);return jt(),zt(),r}function $t(e){Qe(e)||(e=String(e));let t=P(this);return Ht(t,`has`,e),t.hasOwnProperty(e)}function en(e,t,n){return function(...r){let i=this.__v_raw,a=P(i),o=Ye(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Jn:t?ir:rr;return!t&&Ht(a,`iterate`,c?In:Fn),D(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function tn(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function nn(e,t){let n={get(n){let r=this.__v_raw,i=P(r),a=P(n);e||(pt(n,a)&&Ht(i,`get`,n),Ht(i,`get`,a));let{has:o}=Yn(i),s=t?Jn:e?ir:rr;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&Ht(P(t),`iterate`,Fn),t.size},has(t){let n=this.__v_raw,r=P(n),i=P(t);return e||(pt(t,i)&&Ht(r,`has`,t),Ht(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=P(a),s=t?Jn:e?ir:rr;return!e&&Ht(o,`iterate`,Fn),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return D(n,e?{add:tn(`add`),set:tn(`set`),delete:tn(`delete`),clear:tn(`clear`)}:{add(e){let n=P(this),r=Yn(n),i=P(e),a=!t&&!fn(e)&&!dn(e)?i:e;return r.has.call(n,a)||pt(e,a)&&r.has.call(n,e)||pt(i,a)&&r.has.call(n,i)||(n.add(a),Ut(n,`add`,a,a)),this},set(e,n){t||fn(n)||dn(n)||(n=P(n));let r=P(this),{has:i,get:a}=Yn(r),o=i.call(r,e);o||=(e=P(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?pt(n,s)&&Ut(r,`set`,e,n,s):Ut(r,`add`,e,n),this},delete(e){let t=P(this),{has:n,get:r}=Yn(t),i=n.call(t,e);i||=(e=P(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Ut(t,`delete`,e,void 0,a),o},clear(){let e=P(this),t=e.size!==0,n=e.clear();return t&&Ut(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=en(r,e,t)}),n}function rn(e,t){let n=nn(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(O(n,i)&&i in r?n:r,i,a)}function an(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function on(e){return dn(e)?e:ln(e,!1,Gn,Xn,$n)}function sn(e){return ln(e,!1,qn,Zn,er)}function cn(e){return ln(e,!0,Kn,Qn,tr)}function ln(e,t,n,r,i){if(!M(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=an(nt(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function un(e){return dn(e)?un(e.__v_raw):!!(e&&e.__v_isReactive)}function dn(e){return!!(e&&e.__v_isReadonly)}function fn(e){return!!(e&&e.__v_isShallow)}function pn(e){return e?!!e.__v_raw:!1}function P(e){let t=e&&e.__v_raw;return t?P(t):e}function mn(e){return!O(e,`__v_skip`)&&Object.isExtensible(e)&&ht(e,`__v_skip`,!0),e}function hn(e){return e?e.__v_isRef===!0:!1}function F(e){return gn(e,!1)}function gn(e,t){return hn(e)?e:new ar(e,t)}function I(e){return hn(e)?e.value:e}function _n(e){return un(e)?e:new Proxy(e,or)}function vn(e,t,n=!1){let r,i;return A(e)?r=e:(r=e.get,i=e.set),new sr(r,i,n)}function yn(e,t=!1,n=ur){if(n){let t=lr.get(n);t||lr.set(n,t=[]),t.push(e)}}function bn(e,t,n=E){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:fn(e)||i===!1||i===0?xn(e,1):xn(e),u,d,f,p,m=!1,h=!1;if(hn(e)?(d=()=>e.value,m=fn(e)):un(e)?(d=()=>l(e),m=!0):k(e)?(h=!0,m=e.some(e=>un(e)||fn(e)),d=()=>e.map(e=>{if(hn(e))return e.value;if(un(e))return l(e);if(A(e))return c?c(e,2):e()})):d=A(e)?t?c?()=>c(e,2):e:()=>{if(f){Rt();try{f()}finally{zt()}}let t=ur;ur=u;try{return c?c(e,3,[p]):e(p)}finally{ur=t}}:Ue,t&&i){let e=d,t=i===!0?1/0:i;d=()=>xn(e(),t)}let g=Ot(),_=()=>{u.stop(),g&&g.active&&qe(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{try{return e(...t)}finally{_()}}}let v=h?Array(e.length).fill(cr):cr,y=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>pt(e,v[t])):pt(n,v))){let e=ur;Rt();try{f&&f(),ur=u;let e=[n,v===cr?void 0:h&&v[0]===cr?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{ur=e,zt()}}}else u.run()}};return s&&s(y),u=new Tn(d),u.scheduler=o?()=>o(y,!1):y,p=e=>yn(e,!1,u),f=u.onStop=()=>{let e=lr.get(u);if(e){if(c)c(e,4);else for(let t of e)t();lr.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function xn(e,t=1/0,n){if(t<=0||!M(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,hn(e))xn(e.value,t,n);else if(k(e))for(let r=0;r<e.length;r++)xn(e[r],t,n);else if(Xe(e)||Ye(e))e.forEach(e=>{xn(e,t,n)});else if(rt(e)){for(let r in e)xn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&xn(e[r],t,n)}return e}var Sn,Cn,L,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr=o((()=>{Dt(),Cn=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Sn&&(Sn.active?(this.parent=Sn,this.index=(Sn.scopes||(Sn.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=Sn;try{return Sn=this,e()}finally{Sn=t}}}on(){++this._on===1&&(this.prevScope=Sn,Sn=this)}off(){if(this._on>0&&--this._on===0){if(Sn===this)Sn=this.prevScope;else{let e=Sn;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}},wn=new WeakSet,Tn=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Sn&&(Sn.active?Sn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,wn.has(this)&&(wn.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||kt(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Bt(this),Mt(this);let e=L,t=kn;L=this,kn=!0;try{return this.fn()}finally{Nt(this),L=e,kn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)It(e);this.deps=this.depsTail=void 0,Bt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?wn.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Pt(this)&&this.run()}get dirty(){return Pt(this)}},En=0,kn=!0,An=[],jn=0,Mn=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Nn=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!L||!kn||L===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==L)t=this.activeLink=new Mn(L,this),L.deps?(t.prevDep=L.depsTail,L.depsTail.nextDep=t,L.depsTail=t):L.deps=L.depsTail=t,Vt(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=L.depsTail,t.nextDep=void 0,L.depsTail.nextDep=t,L.depsTail=t,L.deps===t&&(L.deps=e)}return t}trigger(e){this.version++,jn++,this.notify(e)}notify(e){At();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{jt()}}},Pn=new WeakMap,Fn=Symbol(``),In=Symbol(``),Ln=Symbol(``),Rn={__proto__:null,[Symbol.iterator](){return qt(this,Symbol.iterator,e=>Kt(this,e))},concat(...e){return Wt(this).concat(...e.map(e=>k(e)?Wt(e):e))},entries(){return qt(this,`entries`,e=>(e[1]=Kt(this,e[1]),e))},every(e,t){return Yt(this,`every`,e,t,void 0,arguments)},filter(e,t){return Yt(this,`filter`,e,t,e=>e.map(e=>Kt(this,e)),arguments)},find(e,t){return Yt(this,`find`,e,t,e=>Kt(this,e),arguments)},findIndex(e,t){return Yt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Yt(this,`findLast`,e,t,e=>Kt(this,e),arguments)},findLastIndex(e,t){return Yt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Yt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Zt(this,`includes`,e)},indexOf(...e){return Zt(this,`indexOf`,e)},join(e){return Wt(this).join(e)},lastIndexOf(...e){return Zt(this,`lastIndexOf`,e)},map(e,t){return Yt(this,`map`,e,t,void 0,arguments)},pop(){return Qt(this,`pop`)},push(...e){return Qt(this,`push`,e)},reduce(e,...t){return Xt(this,`reduce`,e,t)},reduceRight(e,...t){return Xt(this,`reduceRight`,e,t)},shift(){return Qt(this,`shift`)},some(e,t){return Yt(this,`some`,e,t,void 0,arguments)},splice(...e){return Qt(this,`splice`,e)},toReversed(){return Wt(this).toReversed()},toSorted(e){return Wt(this).toSorted(e)},toSpliced(...e){return Wt(this).toSpliced(...e)},unshift(...e){return Qt(this,`unshift`,e)},values(){return qt(this,`values`,e=>Kt(this,e))}},zn=Array.prototype,Bn=je(`__proto__,__v_isRef,__isVue`),Vn=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(Qe)),Hn=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?nr:tr:i?er:$n).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=k(e);if(!r){let e;if(a&&(e=Rn[t]))return e;if(t===`hasOwnProperty`)return $t}let o=Reflect.get(e,t,hn(e)?e:n);if((Qe(t)?Vn.has(t):Bn(t))||(r||Ht(e,`get`,t),i))return o;if(hn(o)){let e=a&&it(t)?o:o.value;return r&&M(e)?cn(e):e}return M(o)?r?cn(o):on(o):o}},Un=class extends Hn{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=k(e)&&it(t);if(!this._isShallow){let e=dn(i);if(!fn(n)&&!dn(n)&&(i=P(i),n=P(n)),!a&&hn(i)&&!hn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:O(e,t),s=Reflect.set(e,t,n,hn(e)?e:r);return e===P(r)&&s&&(o?pt(n,i)&&Ut(e,`set`,t,n,i):Ut(e,`add`,t,n)),s}deleteProperty(e,t){let n=O(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Ut(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return Qe(t)&&Vn.has(t)||Ht(e,`has`,t),n}ownKeys(e){return Ht(e,`iterate`,k(e)?`length`:Fn),Reflect.ownKeys(e)}},Wn=class extends Hn{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Gn=new Un,Kn=new Wn,qn=new Un(!0),Jn=e=>e,Yn=e=>Reflect.getPrototypeOf(e),Xn={get:rn(!1,!1)},Zn={get:rn(!1,!0)},Qn={get:rn(!0,!1)},$n=new WeakMap,er=new WeakMap,tr=new WeakMap,nr=new WeakMap,rr=e=>M(e)?on(e):e,ir=e=>M(e)?cn(e):e,ar=class{constructor(e,t){this.dep=new Nn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:P(e),this._value=t?e:rr(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||fn(e)||dn(e);e=n?e:P(e),pt(e,t)&&(this._rawValue=e,this._value=n?e:rr(e),this.dep.trigger())}},or={get:(e,t,n)=>t===`__v_raw`?e:I(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return hn(i)&&!hn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}},sr=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Nn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=jn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&L!==this)return kt(this,!0),!0}get value(){let e=this.dep.track();return Ft(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}},cr={},lr=new WeakMap,ur=void 0}));function fr(e,t,n,r){try{return r?e(...r):e()}catch(e){mr(e,t,n)}}function pr(e,t,n,r){if(A(e)){let i=fr(e,t,n,r);return i&&$e(i)&&i.catch(e=>{mr(e,t,n,void 0,!0)}),i}if(k(e)){let i=[];for(let a=0;a<e.length;a++)i.push(pr(e[a],t,n,r));return i}}function mr(e,t,n,r=!0,i=!1){let a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||E;if(t){let r=t.parent,a=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t&&!r.isUnmounted&&(!i||r.scope.active)){for(let n=0;n<t.length;n++)if(t[n](e,a,s)===!1)return}r=r.parent}if(o){Rt(),fr(o,null,10,[e,a,s]),zt();return}}hr(e,n,a,r,s)}function hr(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}function gr(e){let t=wa||Ca;return e?t.then(this?e.bind(this):e):t}function _r(e){let t=ya+1,n=va.length;for(;t<n;){let r=t+n>>>1,i=va[r],a=Ea(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function vr(e){if(!(e.flags&1)){let t=Ea(e),n=va[va.length-1];!n||!(e.flags&2)&&t>=Ea(n)?va.push(e):va.splice(_r(t),0,e),e.flags|=1,yr()}}function yr(){wa||=Ca.then(wr)}function br(e){if(!k(e))xa&&e.id===-1?xa.splice(Sa+1,0,e):e.flags&1||(ba.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)ba.push(e[t]);yr()}function xr(e,t,n,r=ya+1){for(;r<va.length;r++){let n=va[r];if(n&&n.flags&2){if(e&&n.id!==e.uid||t!==void 0&&!(n.id>=t))continue;va.splice(r,1),r=e?r-1:ya,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Sr(e,t,n=0){if(ba.length){let e=ba,r=0;if(t){e=[];for(let i=0;i<ba.length;i++){let a=ba[i];(a.i===void 0?t.has(a):!a.i||a.i.uid<n)?ba[r++]=a:e.push(a)}}let i=[...new Set(e)].sort((e,t)=>Ea(e)-Ea(t));if(ba.length=r,xa){for(let e=0;e<i.length;e++)xa.push(i[e]);return}for(xa=i,Sa=0;Sa<xa.length;Sa++){let e=xa[Sa];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}xa=null,Sa=0}}function Cr(e,t){if(Ta){e();return}let n=t===void 0?void 0:new Set(ba);e(),Ta=!0;try{xr(void 0,t),Sr(void 0,n,t)}finally{Ta=!1}}function wr(e){try{for(ya=0;ya<va.length;ya++){let e=va[ya];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),fr(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ya<va.length;ya++){let e=va[ya];e&&(e.flags&=-2)}ya=-1,va.length=0,Sr(e),wa=null,(va.length||ba.length)&&wr(e)}}function Tr(e){let t=Da;return Da=e,Oa=e&&e.type.__scopeId||null,t}function Er(e,t=Da,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Ki(-1);let i=Tr(t),a=Eo.length,o;try{o=e(...n)}finally{for(let e=Eo.length;e>a;e--)Gi();Tr(i),r._d&&Ki(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Dr(e,t){if(Da===null)return e;let n=ha(Da),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=E]=t[e];i&&(A(i)&&(i={mounted:i,updated:i}),i.deep&&xn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function Or(e,t,n,r){let i=e;if(r===`beforeMount`)e._mount=e;else if(r===`beforeUpdate`){let n=t&&t._mount;n&&(n._latest=e,e._mount=n)}else if(r===`mounted`){let t=e._latest;e._mount=e._latest=void 0,t&&(i=t,t._mount=void 0)}let a=i.dirs,o=t&&t.dirs;for(let s=0;s<a.length;s++){let c=a[s];o?c.oldValue=o[s].value:r===`mounted`&&c.oldValue!==void 0&&(c=D({},c,{oldValue:void 0}));let l=c.dir[r];l&&(Rt(),pr(l,n,8,[e.el,c,i,t]),zt())}}function kr(e,t){if(No){let n=No.provides,r=No.parent&&No.parent.provides;r===n&&(n=No.provides=Object.create(r)),n[e]=t}}function Ar(e,t,n=!1){let r=Po();if(r||no){let i=no?no._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&A(t)?t.call(r&&r.proxy):t}}function jr(e,t,n){return Mr(e,t,n)}function Mr(e,t,n=E){let{immediate:r,deep:i,flush:a,once:o}=n,s=D({},n),c=t&&r||!t&&a!==`post`,l;if(zo){if(a===`sync`){let e=Aa();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=Ue,e.resume=Ue,e.pause=Ue,e}}let u=No;s.call=(e,t,n)=>pr(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{e.i=u,bo(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():vr(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=bn(e,t,s);return zo&&(l?l.push(f):c&&f()),f}function Nr(e,t,n){let r=this.proxy,i=j(e)?e.includes(`.`)?Pr(r,e):()=>r[e]:e.bind(r,r),a;A(t)?a=t:(a=t.handler,n=t);let o=Lo(this),s=Mr(i,a.bind(r),n);return o(),s}function Pr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function Fr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==wo){t=n;break}}return t}function Ir(e){if(!Ia(e))return Ma(e.type)&&e.children?Fr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&A(n.default))return n.default()}}function Lr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Lr(Ma(n.type)&&Ir(n)||n,t)}else if(e.shapeFlag&128){let n=e.suspense;if(n){let e=n.isHydrating?n.pendingBranch:n.activeBranch;e&&Lr(e,t.clone(e))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===U&&k(e.children)){let n=Ci(e.children,!1);n&&Lr(n,t)}}function Rr(e){if(e.component)return Rr(e.component.subTree);if(e.type===U){let t=k(e.children)&&Ci(e.children,!1);return t?Rr(t):void 0}if(e.type!==wo)return e}function R(e,t){return A(e)?D({name:e.name},t,{setup:e}):e}function zr(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Br(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}function Vr(e,t,n,r,i=!1){if(k(e)){e.forEach((e,a)=>Vr(e,t&&(k(t)?t[a]:t),n,r,i));return}if(Fa(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Vr(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?ha(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===E?s.refs={}:s.refs,d=s.setupState,f=P(d),p=d===E?We:e=>!Br(u,e)&&O(f,e),m=(e,t)=>!(t&&Br(u,t));if(l!=null&&l!==c){if(Hr(t),j(l))u[l]=null,p(l)&&(d[l]=null);else if(hn(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(A(c))fr(c,s,12,[o,u]);else{let t=j(c),r=hn(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)k(n)&&qe(n,a);else if(k(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Pa.delete(e)};t.id=-1,Pa.set(e,t),bo(t,n)}else Hr(e),s()}}}function Hr(e){let t=Pa.get(e);t&&(t.flags|=8,Pa.delete(e))}function Ur(e,t){Gr(e,`a`,t)}function Wr(e,t){Gr(e,`da`,t)}function Gr(e,t,n=No){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(qr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ia(e.parent.vnode)&&Kr(r,t,n,e),e=e.parent}}function Kr(e,t,n,r){let i=qr(t,e,r,!0),a=qr(`um`,()=>qe(r[t],i),n);a.flags=16}function qr(e,t,n=No,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Rt();let i=Lo(n),a=pr(t,n,e,r);return i(),zt(),a};return r?i.unshift(a):i.push(a),a}}function Jr(e,t=No){qr(`ec`,e,t)}function Yr(e){return j(e)?Xr(qa,e,!1)||e:e||Ja}function Xr(e,t,n=!0,r=!1){let i=Da||No;if(i){let n=i.type;if(e===qa){let e=ga(n,!1);if(e&&(e===t||e===ct(t)||e===dt(ct(t))))return n}let a=Zr(i[e]||n[e],t)||Zr(i.appContext[e],t);return!a&&r?n:a}}function Zr(e,t){return e&&(e[t]||e[ct(t)]||e[dt(ct(t))])}function Qr(e,t,n,r){let i,a=n&&n[r],o=k(e);if(o||j(e)){let n=o&&un(e),r=!1,s=!1;n&&(r=!fn(e),s=dn(e),e=Gt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?ir(rr(e[n])):rr(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){if(!Number.isInteger(e)||e<0)i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}}else if(M(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function $r(e,t,n,r,i,a){if(n??={},Da.ce||Da.parent&&Fa(Da.parent)&&Da.parent.ce){let e=a!=null&&n.key==null?D({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),z(),Ji(U,null,[W(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=Eo.length;z();let c;try{let i=o&&ei(o(n)),s=n.key||a||i&&i.key;c=Ji(U,{key:(s&&!Qe(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Eo.length;e>s;e--)Gi();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function ei(e){return e.some(e=>!Yi(e)||!(e.type===wo||e.type===U&&!ei(e.children)))?e:null}function ti(){return ni(`useSlots`).slots}function ni(e){let t=Po();return t.setupContext||=ma(t)}function ri(e){return k(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function ii(e){let t=ci(e),n=e.proxy,r=e.ctx;$a=!1,t.beforeCreate&&oi(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:v,destroyed:y,unmounted:b,render:ee,renderTracked:te,renderTriggered:ne,errorCaptured:x,serverPrefetch:S,expose:re,inheritAttrs:ie,components:ae,directives:oe,filters:se}=t;if(l&&ai(l,r,null),o)for(let e in o){let t=o[e];A(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);M(t)&&(e.data=on(t))}if($a=!0,a)for(let e in a){let t=a[e],i=A(t)?t.bind(n,n):A(t.get)?t.get.bind(n,n):Ue,o=!A(t)&&A(t.set)?t.set.bind(n):Ue,s=Wo({get:i,set:o});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(s)for(let e in s)si(s[e],r,n,e);if(c){let e=A(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{kr(t,e[t])})}u&&oi(u,e,`c`);function ce(e,t){k(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(ce(Ra,d),ce(za,f),ce(Ba,p),ce(Va,m),ce(Ur,h),ce(Wr,g),ce(Jr,x),ce(Ka,te),ce(Ga,ne),ce(Ha,v),ce(Ua,b),ce(Wa,S),k(re)){if(re.length){let t=e.exposed||={};re.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}ee&&e.render===Ue&&(e.render=ee),ie!=null&&(e.inheritAttrs=ie),ae&&(e.components=ae),oe&&(e.directives=oe),S&&zr(e)}function ai(e,t,n=Ue){k(e)&&(e=fi(e));for(let n in e){let r=e[n],i;i=M(r)?`default`in r?Ar(r.from||n,r.default,!0):Ar(r.from||n):Ar(r),hn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function oi(e,t,n){pr(k(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function si(e,t,n,r){let i=r.includes(`.`)?Pr(n,r):()=>n[r];if(j(e)){let n=t[e];A(n)&&jr(i,n)}else if(A(e))jr(i,e.bind(n));else if(M(e)){if(k(e))e.forEach(e=>si(e,t,n,r));else{let r=A(e.handler)?e.handler.bind(n):t[e.handler];A(r)&&jr(i,r,e)}}}function ci(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>li(c,e,o,!0)),li(c,t,o)),M(t)&&a.set(t,c),c}function li(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&li(e,a,n,!0),i&&i.forEach(t=>li(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=eo[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}function ui(e,t){return t?e?function(){return D(A(e)?e.call(this,this):e,A(t)?t.call(this,this):t)}:t:e}function di(e,t){return mi(fi(e),fi(t))}function fi(e){if(k(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function pi(e,t){return e?[...new Set([].concat(e,t))]:t}function mi(e,t){return e?D(Object.create(null),e,t):t}function hi(e,t){return e?k(e)&&k(t)?[...new Set([...e,...t])]:D(Object.create(null),ri(e),ri(t??{})):t}function gi(e,t){if(!e)return t;if(!t)return e;let n=D(Object.create(null),e);for(let r in t)n[r]=pi(e[r],t[r]);return n}function _i(){return{app:null,config:{isNativeTag:We,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}function vi(e,t){return function(n,r=null){A(n)||(n=D({},n)),r!=null&&!M(r)&&(r=null);let i=_i(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:to++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Go,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&A(e.install)?(a.add(e),e.install(c,...t)):A(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||W(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,ha(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(pr(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=no;no=c;try{return e()}finally{no=t}}};return c}}function yi(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||E,i=n,a=t.startsWith(`update:`),o=a&&ro(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>j(e)?e.trim():e)),o.number&&(i=i.map(gt)));let s,c=r[s=ft(t)]||r[s=ft(ct(t))];!c&&a&&(c=r[s=ft(ut(t))]),c&&pr(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,pr(l,e,6,i)}}function bi(e,t,n=!1){let r=n?io:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!A(e)){let r=e=>{let n=bi(e,t,!0);n&&(s=!0,D(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(M(e)&&r.set(e,null),null):(k(a)?a.forEach(e=>o[e]=null):D(o,a),M(e)&&r.set(e,o),o)}function xi(e,t){return!e||!Ge(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),O(e,t[0].toLowerCase()+t.slice(1))||O(e,ut(t))||O(e,t))}function Si(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=Tr(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=na(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=na(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:ao(s)}}catch(t){Eo.length=0,mr(t,e,1),_=W(wo)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(Ke)&&(v=oo(v,a)),y=$i(y,v,!1,!0))}return n.dirs&&(y=$i(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Lr(Ma(y.type)&&Ir(y)||y,n.transition),_=y,Tr(g),_}function Ci(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(Yi(r)){if(r.type!==wo||r.children===`v-if`){if(n)return;n=r}}else return}return n}function wi(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ti(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Ei(o,r,n)&&!xi(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Ti(r,o,l):!!o;return!1}function Ti(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(!O(e,a)||Ei(t,e,a)&&!xi(n,a))return!0}return!1}function Ei(e,t,n){let r=e[n],i=t[n];return n===`style`&&M(r)&&M(i)?!Be(r,i):r!==i}function Di({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}function Oi(e,t,n,r=!1){let i={},a=co();e.propsDefaults=Object.create(null),Ai(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:sn(i):e.type.props?i:a,e.attrs=a}function ki(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=P(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(xi(e.emitsOptions,o))continue;let u=t[o];if(c){if(O(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=ct(o);i[t]=ji(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Ai(e,t,i,a)&&(l=!0);let r;for(let a in s)t&&(O(t,a)||(r=ut(a))!==a&&O(t,r))||(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=ji(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)t&&O(t,e)||(delete a[e],l=!0)}l&&Ut(e.attrs,`set`,``)}function Ai(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(at(c))continue;let l=t[c],u;i&&O(i,u=ct(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:xi(e.emitsOptions,c)||c in r&&l===r[c]||(r[c]=l,o=!0)}if(a){let t=P(n),r=s||E;for(let o=0;o<a.length;o++){let s=a[o];n[s]=ji(i,t,s,r[s],e,!O(r,s))}}return o}function ji(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=O(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&A(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Lo(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===ut(n))&&(r=!0))}return r}function Mi(e,t,n=!1){let r=n?uo:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!A(e)){let r=e=>{c=!0;let[n,r]=Mi(e,t,!0);D(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return M(e)&&r.set(e,He),He;if(k(a))for(let e=0;e<a.length;e++){let t=ct(a[e]);Ni(t)&&(o[t]=E)}else if(a)for(let e in a){let t=ct(e);if(Ni(t)){let n=a[e],r=o[t]=k(n)||A(n)?{type:n}:D({},n),i=r.type,c=!1,l=!0;if(k(i))for(let e=0;e<i.length;++e){let t=i[e],n=A(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=A(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||O(r,`default`))&&s.push(t)}}let l=[o,s];return M(e)&&r.set(e,l),l}function Ni(e){return e[0]!==`$`&&!at(e)}function Pi(e){return Fi(e)}function Fi(e,t){let n=vt();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=Ue,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Xi(e,t)&&(r=ye(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===He&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Co:g(e,t,n,r);break;case wo:_(e,t,n,r);break;case To:e??v(t,n,r,o);break;case U:ae(e,t,n,r,i,a,o,s,c);break;default:d&1?ee(e,t,n,r,i,a,o,s,c):d&6?oe(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,xe)}u!=null&&i?Vr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Vr(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},ee=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)te(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),S(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},te=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&x(e.children,f,null,i,s,Ii(e,c),l,d),_&&Or(e,null,i,`created`),ne(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!at(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&oa(p,i,e)}_&&Or(e,null,i,`beforeMount`);let v=Ri(s,g);v?g.beforeEnter(f):g&&!g.persisted&&(f[So]=!0),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&bo(()=>{try{p&&oa(p,i,e),v&&g.enter(f),_&&Or(e,null,i,`mounted`)}finally{}},s)},ne=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||xo(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;ne(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},x=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?ra(e[l]):na(e[l]);h(null,c,t,n,r,i,a,o,s)}},S=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||E,m=t.props||E,h;if(n&&Li(n,!1),(h=m.onVnodeBeforeUpdate)&&oa(h,n,t,e),f&&Or(t,e,n,`beforeUpdate`),n&&Li(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?re(e.dynamicChildren,d,c,n,r,Ii(t,i),o):s||de(e,t,c,null,n,r,Ii(t,i),o,!1),l>0){if(l&16)ie(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&ie(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&bo(()=>{h&&oa(h,n,t,e),f&&Or(t,e,n,`updated`)},r)},re=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el||Ui(c),f=u&&(c.type===U||!Xi(c,l)||c.shapeFlag&198)?d(u):n;h(c,l,f,null,r,i,a,o,!0)}},ie=(e,t,n,r,i)=>{if(t!==n){if(t!==E)for(let o in t)!at(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(at(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ae=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),x(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(re(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&zi(e,t,!0)):de(e,t,n,f,a,o,c,l,u)},oe=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):se(t,n,r,i,a,o,c):ce(e,t,c)},se=(e,t,n,r,i,a,o)=>{let s=e.component=ca(e,r,i);if(Ia(e)&&(s.ctx.renderer=xe),ua(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,le,o,a),!e.el){let r=s.subTree=W(wo);_(null,r,t,n),e.placeholder=r.el}}else le(s,e,t,n,i,a,o)},ce=(e,t,n)=>{let r=t.component=e.component;if(wi(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,ue(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},le=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Vi(e);if(n){t&&(t.el=c.el,ue(e,t,o)),n.asyncDep.then(()=>{let t=()=>{e.job.flags&8||(i&&i.pendingBranch?bo(t,i):l())};t.flags=48,bo(t,i)});return}}let u=t,f;Li(e,!1),t?(t.el=c.el,ue(e,t,o)):t=c,n&&mt(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&oa(f,s,t,c),Li(e,!0);let p=Si(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el||Ui(m)),ye(m),e,i,a),t.el=p.el,u===null&&Di(e,p.el),r&&bo(r,i),(f=t.props&&t.props.onVnodeUpdated)&&bo(()=>oa(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Fa(t);if(Li(e,!1),l&&mt(l),!m&&(o=c&&c.onVnodeBeforeMount)&&oa(o,d,t),Li(e,!0),s&&Ce){let t=()=>{e.subTree=Si(e),Ce(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Si(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&bo(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;bo(()=>oa(o,d,e),i)}(t.shapeFlag&256||d&&Fa(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&bo(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Tn(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>vr(u),Li(e,!0),l()},ue=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,ki(e,t.props,r,n),yo(e,t.children,n),Rt(),xr(e),zt()},de=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){pe(l,f,n,r,i,a,o,s,c);return}if(p&256){fe(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&ve(l,i,a),f!==l&&u(n,f)):d&16?m&16?pe(l,f,n,r,i,a,o,s,c):ve(l,i,a,!0):(d&8&&u(n,``),m&16&&x(f,n,r,i,a,o,s,c))},fe=(e,t,n,r,i,a,o,s,c)=>{e||=He,t||=He;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?ra(t[f]):na(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?ve(e,i,a,!0,!1,d):x(t,n,r,i,a,o,s,c,d)},pe=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?ra(t[l]):na(t[l]);if(Xi(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?ra(t[f]):na(t[f]);if(Xi(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?ra(t[l]):na(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)me(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?ra(t[l]):na(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,ee=0,te=Array(y);for(l=0;l<y;l++)te[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){me(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(te[_-m]===0&&Xi(r,t[_])){u=_;break}u===void 0?me(r,i,a,!0):(te[u-m]=l+1,u>=ee?ee=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let ne=b?Bi(te):He;for(_=ne.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Ui(f):r;te[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==ne[_]?C(d,n,p,2):_--)}}},C=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)C(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,xe);else if(c===U){r(s,t,n);for(let e=0;e<u.length;e++)C(u[e],t,n,a);r(e.anchor,t,n)}else if(c===To)y(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[Na]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),bo(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[Na];s._isLeaving&&s[Na](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(Rt(),Vr(s,null,n,e,!0),zt()),p==null||e.ctx&&e.ctx!==t||(t.renderCache[p]=void 0),u&256&&t.ctx.deactivate(e))return;let h=u&1&&f,g=!Fa(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&oa(_,t,e),u&6)_e(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Or(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,xe,r):l&&!l.hasOnce&&(a!==U||d>0&&d&64)?ve(l,t,n,!1,!0):(a===U&&d&384||!i&&u&16)&&ve(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&bo(()=>{_&&oa(_,t,e),h&&Or(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:a}=e,o=t===U;if(o&&!a){ge(n,r);return}if(t===To){b(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let s=o?Rr(e):e,c=()=>{o?d(n)&&ge(n,r):i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(s&&s.shapeFlag&1&&a&&!a.persisted){let{leave:e,delayLeave:t}=a,n=s.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},ge=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},_e=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Hi(c),Hi(l),r&&mt(r),i.stop(),a?(a.flags|=8,me(o,e,t,n)):o&&(o.transition=e.vnode.transition,me(o,e,t,n)),s&&bo(s,t);let u=()=>{e.isUnmounted=!0};u.flags=16,bo(u,t)},ve=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)me(e[o],t,n,r,i)},ye=e=>{if(e.shapeFlag&6)return ye(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[ja];return n?f(n):t},be=(e,t,n)=>{Cr(()=>{e==null?t._vnode&&me(t._vnode,null,null,!0):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:sa())},xe={p:h,um:me,m:C,r:he,mt:se,mc:x,pc:de,pbc:re,n:ye,o:e},Se,Ce;return t&&([Se,Ce]=t(xe)),{render:be,hydrate:Se,createApp:vi(be,Se)}}function Ii({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Li({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ri(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function zi(e,t,n=!1){let r=e.children,i=t.children;if(k(r)&&k(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=ra(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&zi(t,a)),a.type===Co&&(a.patchFlag===-1&&(a=i[e]=ra(a)),a.el=t.el),a.type===wo&&!a.el&&(a.el=t.el)}}function Bi(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Vi(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Vi(t)}function Hi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ui(e){if(e.placeholder)return e.placeholder;let t=e.component;if(t)return Ui(t.subTree);let n=e.suspense;return n&&n.activeBranch?Ui(n.activeBranch):null}function Wi(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):br(e)}function z(e=!1){Eo.push(Do=e?null:[])}function Gi(){Eo.pop(),Do=Eo[Eo.length-1]||null}function Ki(e,t=!1){Oo+=e,e<0&&Do&&t&&(Do.hasOnce=!0)}function qi(e){return e.dynamicChildren=Oo>0?Do||He:null,Gi(),Oo>0&&Do&&Do.push(e),e}function B(e,t,n,r,i,a){return qi(V(e,t,n,r,i,a,!0))}function Ji(e,t,n,r,i){return qi(W(e,t,n,r,i,!0))}function Yi(e){return e?e.__v_isVNode===!0:!1}function Xi(e,t){return e.type===t.type&&e.key===t.key}function V(e,t=null,n=null,r=0,i=null,a=e===U?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ko(t),ref:t&&Ao(t),scopeId:Oa,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Da};return s?(ia(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=j(n)?8:16),Oo>0&&!o&&Do&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Do.push(c),c}function Zi(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==Ja||(e=wo),Yi(e)){let r=$i(e,t,!0);return n&&ia(r,n),Oo>0&&!a&&Do&&(r.shapeFlag&6?Do[Do.indexOf(e)]=r:Do.push(r)),r.patchFlag=-2,r}if(_a(e)&&(e=e.__vccOpts),t){t=Qi(t);let{class:e,style:n}=t;e&&!j(e)&&(t.class=Pe(e)),M(n)&&(pn(n)&&!k(n)&&(n=D({},n)),t.style=Me(n))}let o=j(e)?1:xo(e)?128:Ma(e)?64:M(e)?4:A(e)?2:0;return V(e,t,n,r,i,o,a,!0)}function Qi(e){return e?pn(e)?D({},e):lo(e)?D({},e[Ho]||e):e:null}function $i(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?aa(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ko(l),ref:t&&t.ref?n&&a?k(a)?a.concat(Ao(t)):[a,Ao(t)]:Ao(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==U?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&$i(e.ssContent),ssFallback:e.ssFallback&&$i(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&Lr(u,c.clone(u)),u}function ea(e=` `,t=0){return W(Co,null,e,t)}function ta(e,t){let n=W(To,null,e);return n.staticCount=t,n}function H(e=``,t=!1){return t?(z(),Ji(wo,null,e)):W(wo,null,e)}function na(e){return e==null||typeof e==`boolean`?W(wo):k(e)?W(U,null,e.slice()):Yi(e)?ra(e):W(Co,null,String(e))}function ra(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:$i(e)}function ia(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(k(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ia(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!lo(t)?t._ctx=Da:r===3&&Da&&(Da.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(A(t)){if(r&65){ia(e,{default:t});return}t={default:t,_ctx:Da},n=32}else t=String(t),r&64?(n=16,t=[ea(t)]):n=8;e.children=t,e.shapeFlag|=n}function aa(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=Pe([t.class,r.class]));else if(e===`style`)t.style=Me([t.style,r.style]);else if(Ge(e)){let n=t[e],i=r[e];i&&n!==i&&!(k(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!Ke(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function oa(e,t,n,r=null){pr(e,t,7,[n,r])}function sa(){return Mo}function ca(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||jo,a={uid:Mo++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Cn(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Mi(r,i),emitsOptions:bi(r,i),emit:null,emitted:null,propsDefaults:E,inheritAttrs:r.inheritAttrs,ctx:E,data:E,props:E,attrs:E,slots:E,refs:E,setupState:E,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=yi.bind(null,a),e.ce&&e.ce(a),a}function la(e){return e.vnode.shapeFlag&4}function ua(e,t=!1,n=!1){t&&Io(t);let{props:r,children:i}=e.vnode,a=la(e);Oi(e,r,a,t),vo(e,i,n||t);let o=a?da(e,t):void 0;return t&&Io(!1),o}function da(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Qa);let{setup:r}=n;if(r){Rt();let n=e.setupContext=r.length>1?ma(e):null,i=Lo(e),a=fr(r,e,0,[e.props,n]),o=$e(a);if(zt(),i(),(o||e.sp)&&!Fa(e)&&zr(e),o){if(a.then(Ro,Ro),t)return a.then(n=>{Io(!0);try{fa(e,n,t)}finally{Io(!1)}}).catch(t=>{mr(t,e,0,void 0,!0),e.ssrRender=(e,t)=>t(`<!---->`)});e.asyncDep=a}else fa(e,a,t)}else pa(e,t)}function fa(e,t,n){A(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:M(t)&&(e.setupState=_n(t)),pa(e,n)}function pa(e,t,n){let r=e.type;if(!e.render){if(!t&&Bo&&!r.render){let t=r.template||ci(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Bo(t,D(D({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||Ue,Vo&&Vo(e)}{let t=Lo(e);Rt();try{ii(e)}finally{zt(),t()}}}function ma(e){return{attrs:new Proxy(e.attrs,Uo),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function ha(e){return e.exposed?e.exposeProxy||=new Proxy(_n(mn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Xa)return Xa[n](e)},has(e,t){return t in e||t in Xa}}):e.proxy}function ga(e,t=!0){return A(e)?e.displayName||e.name:e.name||t&&e.__name}function _a(e){return A(e)&&`__vccOpts`in e}var va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,U,Co,wo,To,Eo,Do,Oo,ko,Ao,W,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko=o((()=>{dr(),Dt(),va=[],ya=-1,ba=[],xa=null,Sa=0,Ca=Promise.resolve(),wa=null,Ta=!1,Ea=e=>e.id==null?e.flags&2?-1:1/0:e.id,Da=null,Oa=null,ka=Symbol.for(`v-scx`),Aa=()=>Ar(ka),ja=Symbol(`_vte`),Ma=e=>e.__isTeleport,Na=Symbol(`_leaveCb`),Pa=new WeakMap,vt().requestIdleCallback,vt().cancelIdleCallback,Fa=e=>!!e.type.__asyncLoader,Ia=e=>e.type.__isKeepAlive,La=e=>(t,n=No)=>{zo&&e!==`sp`||qr(e,(...e)=>t(...e),n)},Ra=La(`bm`),za=La(`m`),Ba=La(`bu`),Va=La(`u`),Ha=La(`bum`),Ua=La(`um`),Wa=La(`sp`),Ga=La(`rtg`),Ka=La(`rtc`),qa=`components`,Ja=Symbol.for(`v-ndc`),Ya=e=>e?la(e)?ha(e):Ya(e.parent):null,Xa=D(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ya(e.parent),$root:e=>Ya(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ci(e),$forceUpdate:e=>e.f||=()=>{vr(e.update)},$nextTick:e=>e.n||=gr.bind(e.proxy),$watch:e=>Nr.bind(e)}),Za=(e,t)=>e!==E&&!e.__isScriptSetup&&O(e,t),Qa={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Za(r,t))return o[t]=1,r[t];else if(i!==E&&O(i,t))return o[t]=2,i[t];else if(O(a,t))return o[t]=3,a[t];else if(n!==E&&O(n,t))return o[t]=4,n[t];else $a&&(o[t]=0)}let l=Xa[t],u,d;if(l)return t===`$attrs`&&Ht(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==E&&O(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,O(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Za(i,t)?(i[t]=n,!0):r!==E&&O(r,t)?(r[t]=n,!0):O(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==E&&s[0]!==`$`&&O(e,s)||Za(t,s)||O(a,s)||O(r,s)||O(Xa,s)||O(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?O(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},$a=!0,eo={data:ui,props:hi,emits:hi,methods:mi,computed:mi,beforeCreate:pi,created:pi,beforeMount:pi,mounted:pi,beforeUpdate:pi,updated:pi,beforeDestroy:pi,beforeUnmount:pi,destroyed:pi,unmounted:pi,activated:pi,deactivated:pi,errorCaptured:pi,serverPrefetch:pi,components:mi,directives:mi,watch:gi,provide:ui,inject:di},to=0,no=null,ro=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${ct(t)}Modifiers`]||e[`${ut(t)}Modifiers`],io=new WeakMap,ao=e=>{let t;for(let n in e)(n===`class`||n===`style`||Ge(n))&&((t||={})[n]=e[n]);return t},oo=(e,t)=>{let n={};for(let r in e)Ke(r)&&r.slice(9)in t||(n[r]=e[r]);return n},so={},co=()=>Object.create(so),lo=e=>Object.getPrototypeOf(e)===so,uo=new WeakMap,fo=e=>e===`_`||e===`_ctx`||e===`$stable`,po=e=>k(e)?e.map(na):[na(e)],mo=(e,t,n)=>{if(t._n)return t;let r=Er((...e)=>po(t(...e)),n);return r._c=!1,r},ho=(e,t,n)=>{let r=e._ctx;for(let n in e){if(fo(n))continue;let i=e[n];if(A(i))t[n]=mo(n,i,r);else if(i!=null){let e=po(i);t[n]=()=>e}}},go=(e,t)=>{let n=po(t);e.slots.default=()=>n},_o=(e,t,n)=>{for(let r in t)(n||!fo(r))&&(e[r]=t[r])},vo=(e,t,n)=>{let r=e.slots=co();if(e.vnode.shapeFlag&32){let e=t._;e?(_o(r,t,n),n&&ht(r,`_`,e,!0)):ho(t,r)}else t&&go(e,t)},yo=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=E;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:_o(i,t,n):(a=!t.$stable,ho(t,i)),o=t}else t&&(go(e,t),o={default:1});if(a)for(let e in i)!fo(e)&&o[e]==null&&delete i[e]},bo=Wi,xo=e=>e.__isSuspense,So=Symbol(`_deferredEnter`),U=Symbol.for(`v-fgt`),Co=Symbol.for(`v-txt`),wo=Symbol.for(`v-cmt`),To=Symbol.for(`v-stc`),Eo=[],Do=null,Oo=1,ko=({key:e})=>e??null,Ao=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:j(e)||hn(e)||A(e)?{i:Da,r:e,k:t,f:!!n}:e),W=Zi,jo=_i(),Mo=0,No=null,Po=()=>No||Da;{let e=vt(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Fo=t(`__VUE_INSTANCE_SETTERS__`,e=>No=e),Io=t(`__VUE_SSR_SETTERS__`,e=>zo=e)}Lo=e=>{let t=No;return Fo(e),e.scope.on(),()=>{e.scope.off(),Fo(t)}},Ro=()=>{No&&No.scope.off(),Fo(null)},zo=!1,Ho=Symbol(),Uo={get(e,t){return Ht(e,`get`,``),t===Ho?e:e[t]}},Wo=(e,t)=>vn(e,t,zo),Go=`3.5.45`}));function qo(e,t,n){let r=e[Cs];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}function Jo(e,t){e.style.display=t?e[ws]:`none`,e[Ts]=!t}function Yo(e,t,n){let r=e.style,i=j(n),a=!1;if(n&&!i){if(t){if(j(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Xo(r,t,``)}else for(let e in t)n[e]??Xo(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Xo(r,i,``):Qo(e,i,!j(t)&&t?t[i]:void 0,o)||Xo(r,i,o)}}else if(i){if(t!==n){let e=r[Ds];e&&(n+=`;`+e),r.cssText=n,a=Os.test(n)}}else t&&e.removeAttribute(`style`);ws in e&&(i&&t===n||(e[ws]=a?r.display:``),e[Ts]&&(r.display=`none`))}function Xo(e,t,n){if(k(n))n.forEach(n=>Xo(e,t,n));else if(n??=``,t.startsWith(`--`))ks.test(n)?e.setProperty(t,n.replace(ks,``),`important`):e.setProperty(t,n);else{let r=Zo(e,t);ks.test(n)?e.setProperty(ut(r),n.replace(ks,``),`important`):e[r]=n}}function Zo(e,t){let n=js[t];if(n)return n;let r=ct(t);if(r!==`filter`&&r in e)return js[t]=r;r=dt(r);for(let n=0;n<As.length;n++){let i=As[n]+r;if(i in e)return js[t]=i}return t}function Qo(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&j(r)&&n===r}function $o(e,t,n,r,i,a=Ct(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Ms,t.slice(6,t.length)):e.setAttributeNS(Ms,t,n):n==null||a&&!Fe(n)?e.removeAttribute(t):e.setAttribute(t,a?``:Qe(n)?String(n):n)}function es(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?_s(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);r===i&&`_value`in e||(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Fe(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function ts(e,t,n,r){e.addEventListener(t,n,r)}function ns(e,t,n,r){e.removeEventListener(t,n,r)}function rs(e,t,n,r,i=null){let a=e[Ns]||(e[Ns]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=is(t);r?ts(e,n,a[t]=as(r,i),s):o&&(ns(e,n,o,s),a[t]=void 0)}}function is(e){let t,n;for(;(n=e.match(Ps))&&!Fs.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):ut(e.slice(2)),t]}function as(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(k(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&pr(e,t,5,a)}}else pr(r,t,5,[e])};return n.value=e,n.attached=Rs(),n}function os(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&zs(t)&&A(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return zs(t)&&j(n)?!1:t in e}function ss(e,t){let n=e._def.props;if(!n)return!1;let r=ct(t);return Array.isArray(n)?n.some(e=>ct(e)===r):Object.keys(n).some(e=>ct(e)===r)}function cs(e){e.target.composing=!0}function ls(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}function us(e,t,n){return t&&(e=e.trim()),n&&(e=gt(e)),e}function ds(e,t,n){if(!n||k(e))return Be(e,t);if(Xe(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function fs(e,t,n=!1){let r=e.multiple,i=k(t);if(!r||i||Xe(t)){for(let a=0,o=e.options.length;a<o;a++){let o=e.options[a],s=ps(o);if(r){if(i){let e=typeof s;o.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(s)):Ve(t,s)>-1}else o.selected=t.has(s)||n&&typeof s==`string`&&t.has(gt(s))}else if(Be(ps(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ps(e){return`_value`in e?e._value:e.value}function ms(){return Xs||=Pi(Ys)}var hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs=o((()=>{if(Ko(),Ko(),Dt(),hs=void 0,gs=typeof window<`u`&&window.trustedTypes,gs)try{hs=gs.createPolicy(`vue`,{createHTML:e=>e})}catch{}_s=hs?e=>hs.createHTML(e):e=>e,vs=`http://www.w3.org/2000/svg`,ys=`http://www.w3.org/1998/Math/MathML`,bs=typeof document<`u`?document:null,xs=bs&&bs.createElement(`template`),Ss={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?bs.createElementNS(vs,e):t===`mathml`?bs.createElementNS(ys,e):n?bs.createElement(e,{is:n}):bs.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>bs.createTextNode(e),createComment:e=>bs.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bs.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{xs.innerHTML=_s(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=xs.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Cs=Symbol(`_vtc`),ws=Symbol(`_vod`),Ts=Symbol(`_vsh`),Es={name:`show`,beforeMount(e,{value:t},{transition:n}){e[ws]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Jo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Jo(e,!0),r.enter(e)):r.leave(e,()=>{Jo(e,!1)}):Jo(e,t))},beforeUnmount(e,{value:t}){Jo(e,t)}},Ds=Symbol(``),Os=/(?:^|;)\s*display\s*:/,ks=/\s*!important$/,As=[`Webkit`,`Moz`,`ms`],js={},Ms=`http://www.w3.org/1999/xlink`,Ns=Symbol(`_vei`),Ps=/(Once|Passive|Capture)$/,Fs=/^on:?(?:Once|Passive|Capture)$/,Is=0,Ls=Promise.resolve(),Rs=()=>Is||=(Ls.then(()=>Is=0),Date.now()),zs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Bs=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?qo(e,r,o):t===`style`?Yo(e,n,r):Ge(t)?Ke(t)||rs(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):os(e,t,r,o))?(es(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||$o(e,t,r,o,a,t!==`value`)):e._isVueCE&&(ss(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!j(r)))?es(e,ct(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),$o(e,t,r,o))},Vs=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return k(t)?e=>mt(t,e):t},Hs=Symbol(`_assign`),Us=Symbol(`_initialValue`),Ws={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Us]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Us]=e.defaultValue.replace(/\r\n?/g,`
|
|
2
|
+
`))),e[Hs]=Vs(i);let a=r||i.props&&i.props.type===`number`;ts(e,t?`change`:`input`,t=>{t.target.composing||e[Hs](us(e.value,n,a))}),(n||a)&&ts(e,`change`,()=>{e.value=us(e.value,n,a)}),t||(ts(e,`compositionstart`,cs),ts(e,`compositionend`,ls),ts(e,`change`,ls))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Us];delete e[Us],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Hs](us(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Hs]=Vs(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?gt(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Gs={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ts(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?gt(ps(e)):ps(e)),r=e.multiple,i=r?Xe(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?k(i)?t.slice():t:i];try{e[Hs](i)}finally{gr(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Hs]=Vs(r)},mounted(e,{value:t,modifiers:{number:n}}){fs(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Hs]=Vs(n)},updated(e,{value:t,modifiers:{number:n}}){let r=e._pendingValue;e._pendingValue=void 0,r&&r[0]===e.multiple&&ds(t,r[1],r[0])||fs(e,t,n)}},Ks=[`ctrl`,`shift`,`alt`,`meta`],qs={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Ks.some(n=>e[`${n}Key`]&&!t.includes(n))},Js=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=qs[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Ys=D({patchProp:Bs},Ss),Zs=((...e)=>{ms().render(...e)})})),G=o((()=>{Qs()}));function $s(e){let t,n=e.el===document.body,r=n?document.createElement(`div`):e.el;n&&document.body.appendChild(r);let i=()=>{Zs(null,r),t=void 0,n&&r.remove()},a=Object.keys(e.on||{}).reduce((t,n)=>{let r=n.charAt(0).toUpperCase()+n.slice(1);return t[`on${r}`]=e.on[n],t},{})||{};a.onClose||=()=>i();let o={...e.props,...a,onVnodeUnmounted:()=>{},onVnodeMounted:()=>{}};return t=W(e.component,o),Zs(t,r),{vnode:t,destroy:i}}var ec=o((()=>{G()})),tc=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var ee=`$isDayjsObject`,te=function(e){return e instanceof re||!(!e||!e[ee])},ne=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},x=function(e,t){if(te(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new re(n)},S=v;S.l=ne,S.i=te,S.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var re=function(){function g(e){this.$L=ne(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[ee]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return S},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=x(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return x(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<x(e)},_.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!S.u(t)||t,u=S.p(e),p=function(e,t){var i=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return S.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=S.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[S.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=S.p(u),h=function(e){var t=x(p);return S.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return S.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=S.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return S.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return S.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return S.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return S.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return S.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return S.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return S.s(t.$s,2,`0`);case`SSS`:return S.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=S.p(f),_=x(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return S.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:S.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=ne(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return S.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),ie=re.prototype;return x.prototype=ie,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){ie[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),x.extend=function(e,t){return e.$i||=(e(t,re,x),!0),x},x.locale=ne,x.isDayjs=te,x.unix=function(e){return x(1e3*e)},x.en=b[y],x.Ls=b,x.p={},x}))}));function nc(e){return e=e.replace(/ /g,``).trim(),e.search(/^\d{14,16}$/i)!==-1&&rc(e)}function rc(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let i=e.charAt(r),a=parseInt(i,10);n&&(a*=2)>9&&(a-=9),t+=a,n=!n}return t%10==0}function ic(e){if(e.search(/^\d{2}\/\d{2}$/i)===-1)return!1;let t=e.split(`/`),n=parseInt(t[0],10),r=parseInt(t[1],10);if(n<0||n>12)return!1;let i=`20`+r.toString()+`-`+n.toString()+`-01`,a=(0,_c.default)(i,`YYYY-MM-DD`);return!((0,_c.default)().startOf(`month`).diff(a,`days`)>0)}function ac(e){return e.slice().replaceAll(/[^0-9]/g,``)}function oc(e){let t=ac(e);return t.length>9&&(t=t.slice(t.length-9)),`0`+t}function sc(e){let t=ac(e);return t.search(/^0[0-9]{9}$/)>-1||t.search(/^61[0-9]{9}$/)>-1||e.startsWith(`+`)&&t.search(/^[0-9]{11}$/)>-1}function cc(e){return e.search(/^\w+([+.-]?\w+)*@\w+([.-]?\w+)*(\.[A-Za-z]{2,})+$/)>-1}function lc(e){return e?e.search(/^\d{3,4}$/i)>-1:!1}function uc(e){return e?Array.isArray(e)?e.length>0:typeof e==`object`?Object.keys(e).length>0:!!e:!1}function dc(e){return!isNaN(parseFloat(e))&&parseFloat(e)>0}function fc(e,t,n,r){t(e)||r&&r({error:n})}function pc(e){let t=[10,1,3,5,7,9,11,13,15,17,19];if(e.length!==11||e.search(/\D/)>-1)return!1;let n=0,r=0;for(let i=0;i<=t.length-1;i++){r=t[i];let a=parseInt(e[i],10)-+!i;n+=r*a}return n%89==0}function mc(e){let t=RegExp(`^4`);return e.match(t)?`visa`:/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(e)?`mastercard`:(t=RegExp(`^3[47]`),e.match(t)?`amex`:(t=RegExp(`^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)`),e.match(t)?`discover`:(t=RegExp(`^36`),e.match(t)?`diners`:(t=RegExp(`^30[0-5]`),e.match(t)?`diners - carte blanche`:(t=RegExp(`^35(2[89]|[3-8][0-9])`),e.match(t)?`jcb`:(t=RegExp(`^(4026|417500|4508|4844|491(3|7))`),e.match(t)?`visa electron`:``))))))}function hc(e){if(e===!0)return!0;if(e===!1)return!1}function gc(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}var _c,vc=o((()=>{_c=u(tc(),1)}));ec(),vc(),G();var yc=R({__name:`PaypalIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=e,n=t.grayscale?`#2A2A2B`:`#253b80`,r=t.grayscale?`#555557`:`#179bd7`,i=t.grayscale?`#000000`:`#222d65`,a=`--size: ${t.size}px`;return(e,t)=>(z(),B(`svg`,{id:`paypal`,style:a,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25.576353 30.177`},[V(`path`,{d:`m 7.2659888,29.154 0.523,-3.322 -1.165,-0.027 -5.563,0 3.866,-24.513 c 0.012,-0.074 0.051,-0.143 0.108,-0.192 0.057,-0.049 0.13,-0.076 0.206,-0.076 l 9.3800002,0 c 3.114,0 5.263,0.648 6.385,1.927 0.526,0.6 0.861,1.227 1.023,1.917 0.17,0.724 0.173,1.589 0.007,2.644 l -0.012,0.077 0,0.676 0.526,0.298 c 0.443,0.235 0.795,0.504 1.065,0.812 0.45,0.513 0.741,1.165 0.864,1.938 0.127,0.795 0.085,1.741 -0.123,2.812 -0.24,1.232 -0.628,2.305 -1.152,3.183 -0.482,0.809 -1.096,1.48 -1.825,2 -0.696,0.494 -1.523,0.869 -2.458,1.109 -0.906,0.236 -1.939,0.355 -3.072,0.355 l -0.73,0 c -0.522,0 -1.029,0.188 -1.427,0.525 -0.399,0.344 -0.663,0.814 -0.744,1.328 l -0.055,0.299 -0.924,5.855 -0.042,0.215 c -0.011,0.068 -0.03,0.102 -0.058,0.125 -0.025,0.021 -0.061,0.035 -0.096,0.035 l -4.5070002,0 z`,style:Me(`fill: ${I(n)}`)},null,4),V(`path`,{d:`m 23.047989,7.667 0,0 0,0 c -0.028,0.179 -0.06,0.362 -0.096,0.55 -1.237,6.351 -5.469,8.545 -10.874,8.545 l -2.7520002,0 c -0.661,0 -1.218,0.48 -1.321,1.132 l 0,0 0,0 -1.409,8.936 -0.399,2.533 c -0.067,0.428 0.263,0.814 0.695,0.814 l 4.8810002,0 c 0.578,0 1.069,-0.42 1.16,-0.99 l 0.048,-0.248 0.919,-5.832 0.059,-0.32 c 0.09,-0.572 0.582,-0.992 1.16,-0.992 l 0.73,0 c 4.729,0 8.431,-1.92 9.513,-7.476 0.452,-2.321 0.218,-4.259 -0.978,-5.622 -0.362,-0.411 -0.811,-0.752 -1.336,-1.03 z`,style:Me(`fill: ${I(r)}`)},null,4),V(`path`,{d:`m 21.753989,7.151 c -0.189,-0.055 -0.384,-0.105 -0.584,-0.15 -0.201,-0.044 -0.407,-0.083 -0.619,-0.117 -0.742,-0.12 -1.555,-0.177 -2.426,-0.177 l -7.352,0 c -0.181,0 -0.353,0.041 -0.507,0.115 C 9.9269888,6.985 9.6749888,7.306 9.6139888,7.699 l -1.564,9.906 -0.045,0.289 c 0.103,-0.652 0.66,-1.132 1.321,-1.132 l 2.7520002,0 c 5.405,0 9.637,-2.195 10.874,-8.545 0.037,-0.188 0.068,-0.371 0.096,-0.55 -0.313,-0.166 -0.652,-0.308 -1.017,-0.429 -0.09,-0.03 -0.183,-0.059 -0.277,-0.087 z`,style:Me(`fill: ${I(i)}`)},null,4),V(`path`,{d:`m 9.6139888,7.699 c 0.061,-0.393 0.313,-0.714 0.6520002,-0.876 0.155,-0.074 0.326,-0.115 0.507,-0.115 l 7.352,0 c 0.871,0 1.684,0.057 2.426,0.177 0.212,0.034 0.418,0.073 0.619,0.117 0.2,0.045 0.395,0.095 0.584,0.15 0.094,0.028 0.187,0.057 0.278,0.086 0.365,0.121 0.704,0.264 1.017,0.429 0.368,-2.347 -0.003,-3.945 -1.272,-5.392 C 20.377989,0.682 17.852989,0 14.621989,0 L 5.2419888,0 c -0.66,0 -1.223,0.48 -1.325,1.133 L 0.00998882,25.898 c -0.077,0.49 0.301,0.932 0.795,0.932 l 5.79099998,0 1.454,-9.225 1.564,-9.906 z`,style:Me(`fill: ${I(n)}`)},null,4)]))}}),K,q=o((()=>{K=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n}}));q();var bc=K(yc,[[`__scopeId`,`data-v-2b840669`]]);G();var xc=R({__name:`CreditCardIcon`,props:{size:{},grayscale:{type:Boolean},color:{}},setup(e){let t=e,n=F(t.color);jr(()=>t.color,e=>{n.value=e});let r=Wo(()=>`--size: ${t.size}px;fill:${n.value}`);return(e,t)=>(z(),B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,style:Me([{width:`1.2587890625em`,height:`1em`,"vertical-align":`middle`,overflow:`hidden`},r.value]),viewBox:`0 0 1289 1024`},[...t[0]||=[V(`path`,{d:`M1188.420307 68.911452c16.92562 0 32.642267 14.507674 32.642267 32.642267v822.101535c0 16.92562-14.507674 32.642267-32.642267 32.642267h-1088.075561c-16.92562 0-32.642267-14.507674-32.642267-32.642267v-822.101535c0-16.92562 14.507674-32.642267 32.642267-32.642267h1088.075561m0-68.911452h-1088.075561C44.731995 0 0 45.940968 0 100.344746v822.101535c0 55.612751 44.731995 100.344746 100.344746 100.344746h1088.075561c55.612751 0 100.344746-44.731995 100.344746-100.344746v-822.101535c1.208973-54.403778-44.731995-100.344746-100.344746-100.344746z`},null,-1),V(`path`,{d:`M41.105077 252.675325h1221.062574v258.720189H41.105077zM177.719008 778.578512h174.09209v71.329398H177.719008zM432.812279 778.578512h259.929161v71.329398H432.812279z`},null,-1)]],4))}});q();var Sc=K(xc,[[`__scopeId`,`data-v-6a1e8b23`]]);G();var Cc=R({__name:`GooglePayIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=`--size: ${Number(e.size||30)+10}px`;return(e,n)=>(z(),B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,style:t,viewBox:`170.7 170 752 400`},[...n[0]||=[ta(`<path id="Base_1_" fill="#FFFFFF" d="M722.7,170h-352c-110,0-200,90-200,200l0,0c0,110,90,200,200,200h352c110,0,200-90,200-200l0,0 C922.7,260,832.7,170,722.7,170z" data-v-f87e02ce></path><path id="Outline" fill="#3C4043" d="M722.7,186.2c24.7,0,48.7,4.9,71.3,14.5c21.9,9.3,41.5,22.6,58.5,39.5 c16.9,16.9,30.2,36.6,39.5,58.5c9.6,22.6,14.5,46.6,14.5,71.3s-4.9,48.7-14.5,71.3c-9.3,21.9-22.6,41.5-39.5,58.5 c-16.9,16.9-36.6,30.2-58.5,39.5c-22.6,9.6-46.6,14.5-71.3,14.5h-352c-24.7,0-48.7-4.9-71.3-14.5c-21.9-9.3-41.5-22.6-58.5-39.5 c-16.9-16.9-30.2-36.6-39.5-58.5c-9.6-22.6-14.5-46.6-14.5-71.3s4.9-48.7,14.5-71.3c9.3-21.9,22.6-41.5,39.5-58.5 c16.9-16.9,36.6-30.2,58.5-39.5c22.6-9.6,46.6-14.5,71.3-14.5L722.7,186.2 M722.7,170h-352c-110,0-200,90-200,200l0,0 c0,110,90,200,200,200h352c110,0,200-90,200-200l0,0C922.7,260,832.7,170,722.7,170L722.7,170z" data-v-f87e02ce></path><g id="Google_Pay_Lockup_1_" data-v-f87e02ce><g id="Pay_Typeface_3_" data-v-f87e02ce><path id="Letter_p_3_" fill="#3C4043" d="M529.3,384.2v60.5h-19.2V295.3H561c12.9,0,23.9,4.3,32.9,12.9 c9.2,8.6,13.8,19.1,13.8,31.5c0,12.7-4.6,23.2-13.8,31.7c-8.9,8.5-19.9,12.7-32.9,12.7h-31.7V384.2z M529.3,313.7v52.1h32.1 c7.6,0,14-2.6,19-7.7c5.1-5.1,7.7-11.3,7.7-18.3c0-6.9-2.6-13-7.7-18.1c-5-5.3-11.3-7.9-19-7.9h-32.1V313.7z" data-v-f87e02ce></path><path id="Letter_a_3_" fill="#3C4043" d="M657.9,339.1c14.2,0,25.4,3.8,33.6,11.4c8.2,7.6,12.3,18,12.3,31.2v63h-18.3v-14.2h-0.8 c-7.9,11.7-18.5,17.5-31.7,17.5c-11.3,0-20.7-3.3-28.3-10s-11.4-15-11.4-25c0-10.6,4-19,12-25.2c8-6.3,18.7-9.4,32-9.4 c11.4,0,20.8,2.1,28.1,6.3v-4.4c0-6.7-2.6-12.3-7.9-17c-5.3-4.7-11.5-7-18.6-7c-10.7,0-19.2,4.5-25.4,13.6l-16.9-10.6 C625.9,345.8,639.7,339.1,657.9,339.1z M633.1,413.3c0,5,2.1,9.2,6.4,12.5c4.2,3.3,9.2,5,14.9,5c8.1,0,15.3-3,21.6-9 s9.5-13,9.5-21.1c-6-4.7-14.3-7.1-25-7.1c-7.8,0-14.3,1.9-19.5,5.6C635.7,403.1,633.1,407.8,633.1,413.3z" data-v-f87e02ce></path><path id="Letter_y_3_" fill="#3C4043" d="M808.2,342.4l-64,147.2h-19.8l23.8-51.5L706,342.4h20.9l30.4,73.4h0.4l29.6-73.4H808.2z" data-v-f87e02ce></path></g><g id="Google_Mark_1_" data-v-f87e02ce><path id="Blue_500" fill="#4285F4" d="M452.93,372c0-6.26-0.56-12.25-1.6-18.01h-80.48v33L417.2,387 c-1.88,10.98-7.93,20.34-17.2,26.58v21.41h27.59C443.7,420.08,452.93,398.04,452.93,372z" data-v-f87e02ce></path><path id="Green_500_1_" fill="#34A853" d="M400.01,413.58c-7.68,5.18-17.57,8.21-29.14,8.21c-22.35,0-41.31-15.06-48.1-35.36 h-28.46v22.08c14.1,27.98,43.08,47.18,76.56,47.18c23.14,0,42.58-7.61,56.73-20.71L400.01,413.58z" data-v-f87e02ce></path><path id="Yellow_500_1_" fill="#FABB05" d="M320.09,370.05c0-5.7,0.95-11.21,2.68-16.39v-22.08h-28.46 c-5.83,11.57-9.11,24.63-9.11,38.47s3.29,26.9,9.11,38.47l28.46-22.08C321.04,381.26,320.09,375.75,320.09,370.05z" data-v-f87e02ce></path><path id="Red_500" fill="#E94235" d="M370.87,318.3c12.63,0,23.94,4.35,32.87,12.85l24.45-24.43 c-14.85-13.83-34.21-22.32-57.32-22.32c-33.47,0-62.46,19.2-76.56,47.18l28.46,22.08C329.56,333.36,348.52,318.3,370.87,318.3z" data-v-f87e02ce></path></g></g>`,3)]]))}});q();var wc=K(Cc,[[`__scopeId`,`data-v-f87e02ce`]]);G();var Tc=[`fill`],Ec=R({__name:`PayToIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=e;t.grayscale;let n=`--size: ${t.size}px`;return(e,t)=>(z(),B(`svg`,{id:`payto-icon`,viewBox:`0 0 120 57`,xmlns:`http://www.w3.org/2000/svg`,style:n},[V(`path`,{d:`m8.285 27.63c.8 0 1.562-.06 2.285-.176a6.262 6.262 0 0 0 1.937-.624 3.529 3.529 0 0 0 1.354-1.227c.335-.52.502-1.194.502-2.025s-.169-1.463-.502-1.97a3.492 3.492 0 0 0 -1.337-1.187c-.555-.287-1.186-.473-1.897-.565a17.32 17.32 0 0 0 -2.188-.136h-3.56v7.91zm-8.285-12.04h8.945c1.573 0 2.994.144 4.258.429 1.265.288 2.349.754 3.254 1.404.902.648 1.599 1.479 2.092 2.493.488 1.012.736 2.235.736 3.663 0 1.533-.283 2.818-.853 3.858a6.956 6.956 0 0 1 -2.303 2.512c-.968.637-2.098 1.097-3.388 1.383-1.29.285-2.66.43-4.103.43h-3.76v11.415h-4.878zm32.679 19.054h-1.043c-.751 0-1.538.034-2.364.098s-1.588.207-2.283.427c-.697.223-1.279.534-1.742.937-.464.403-.696.954-.696 1.655 0 .442.095.812.29 1.11.195.3.446.54.755.721.31.183.659.311 1.045.39a5.94 5.94 0 0 0 1.161.117c1.6 0 2.813-.427 3.639-1.287.826-.857 1.238-2.026 1.238-3.505zm.078 6.156h-.116c-.466.832-1.213 1.516-2.247 2.047-1.034.532-2.206.8-3.523.8-.749 0-1.53-.099-2.343-.293a6.902 6.902 0 0 1 -2.245-.972 5.624 5.624 0 0 1 -1.705-1.793c-.45-.74-.676-1.656-.676-2.745 0-1.404.394-2.52 1.18-3.351.787-.831 1.8-1.468 3.04-1.91 1.24-.44 2.614-.732 4.124-.875a47.58 47.58 0 0 1 4.433-.215v-.47c0-1.168-.42-2.031-1.259-2.589s-1.839-.839-3-.839c-.981 0-1.923.21-2.826.624-.903.417-1.652.924-2.246 1.521l-2.4-2.844a10.478 10.478 0 0 1 3.659-2.222 12.448 12.448 0 0 1 4.203-.74c1.651 0 3.013.233 4.084.7 1.072.468 1.916 1.079 2.536 1.83a6.571 6.571 0 0 1 1.298 2.534c.245.936.369 1.869.369 2.806v11.376h-4.338v-2.377l-.002-.004zm5.719-16.325h5.15l5.189 13.599h.078l4.607-13.6h4.84l-8.791 22.717a16.433 16.433 0 0 1 -1.083 2.278 6.33 6.33 0 0 1 -1.395 1.676 5.56 5.56 0 0 1 -1.916 1.032c-.736.234-1.62.351-2.654.351-.386 0-.78-.019-1.182-.058a8.113 8.113 0 0 1 -1.219-.215l.386-4.052c.31.104.614.175.91.215s.575.058.834.058c.49 0 .902-.058 1.238-.175.337-.117.62-.298.852-.545.232-.248.438-.552.618-.917.181-.364.376-.792.582-1.286l.93-2.376-7.977-18.702zm42.808 14.279c.893 0 2.072-.328 2.536-.49v3.735c-.468.183-1.478.535-2.536.535-3.691 0-6.695-3.064-6.697-6.831v-11.228h-4.225v-3.675h4.225v-4.66h3.665v4.66h10a13.83 13.83 0 0 0 -3.625 3.675h-6.375v11.228c0 1.688 1.39 3.05 3.032 3.05zm15 3.78c-6.038 0-10.801-4.79-10.801-10.866s4.845-10.868 10.8-10.868h12.183l.004-3.376 6.267 5.245-6.278 5.256.004-3.45h-12.337c-3.775 0-6.897 3.396-6.897 7.193s3.11 7.13 7.053 7.13c3.942 0 7.053-3.163 7.053-7.13 0-1.755-.62-3.377-1.386-4.553h4.139c.65 1.402.993 3.006.993 4.553 0 6.076-4.761 10.866-10.801 10.866zm10.909-42.534h-31.031c-7.074 0-12.807 5.77-12.807 12.886v31.226c0 7.117 5.735 12.886 12.807 12.886h31.031c7.074 0 12.806-5.77 12.806-12.886v-31.226c0-7.116-5.734-12.886-12.806-12.886z`,fill:I(`#000`)},null,8,Tc)]))}});q();var Dc=K(Ec,[[`__scopeId`,`data-v-0b2d8aa0`]]),Oc=`payfurl-combined-container`;function kc(e,t){if(!e)return null;for(;e.parentNode&&e.parentNode.nodeName.toLowerCase()!==`body`;)if(e=e.parentNode,e.id===t)return e;return null}G();var Ac=[`id`],jc=[`id`,`onClick`],Mc=[`value`,`id`],Nc={class:`combined-tab-title`},Pc={class:`combined-tab-name`},Fc={key:0,class:`combined-tab-description`},Ic=[`src`,`alt`],Lc=[`id`],Rc=R({__name:`Combined`,props:{elements:{}},setup(e){let t=e,n=F(0),r={},i=F({});function a(e){n.value=e,setTimeout(()=>{l(e),t.elements[e].activate()},200);let r=document.getElementById(`payment-type${e}`);r.checked=!0}function o(e){return e.icon&&typeof e.icon==`object`}function s(e){return e.icon&&typeof e.icon==`string`}function c(e){return n.value===e}function l(e){if(t.elements[e].render&&!r[e]){try{t.elements[e].render(document.getElementById(`container-component${e}`)),i.value[e]=!1}catch(t){console.error(t),i.value[e]=!0;return}r[e]=!0}}return za(()=>{t.elements.forEach((e,t)=>{l(t)}),a(0)}),(e,r)=>(z(),B(`div`,{class:`payfurl-sdk-combined-container`,id:I(Oc)},[(z(!0),B(U,null,Qr(t.elements,(e,t)=>(z(),B(U,{key:`container-component${t}`},[i.value[t]?H(``,!0):(z(),B(`div`,{key:0,class:Pe([`payfurl-sdk-combined-tab`,t===n.value?`active`:``]),id:e.id||`combined-tab${t}`,onClick:e=>a(t)},[V(`input`,{type:`radio`,name:`payment-type`,value:e.title,id:`payment-type${t}`},null,8,Mc),V(`div`,Nc,[V(`div`,Pc,N(e.title),1),e.description?(z(),B(`div`,Fc,N(e.description),1)):H(``,!0)]),o(e)?(z(),Ji(Yr(e.icon),{key:0,size:30})):H(``,!0),s(e)?(z(),B(`img`,{key:1,src:e.icon,style:{width:`40px`,height:`30px`,"object-fit":`contain`},alt:e.title},null,8,Ic)):H(``,!0)],10,jc)),Dr(V(`div`,{class:`payfurl-sdk-container-component`,id:`container-component${t}`},null,8,Lc),[[Es,c(t)]])],64))),128))],8,Ac))}});q();var zc=K(Rc,[[`__scopeId`,`data-v-240dc514`]]),Bc,Vc,Hc=o((()=>{G(),Bc={class:`message`},Vc=R({__name:`Error`,props:{error:{}},setup(e){let t=F(e.error);return(e,n)=>(z(),B(`div`,Bc,N(t.value),1))}})})),Uc=o((()=>{})),Wc=o((()=>{})),Gc,Kc=o((()=>{Hc(),Hc(),Uc(),Wc(),q(),Gc=K(Vc,[[`__scopeId`,`data-v-ae4be0f9`]])})),qc,Jc,Yc,Xc=o((()=>{G(),qc={class:`message`},Jc={key:0},Yc=R({__name:`Success`,props:{message:{},token:{}},emits:[`close`],setup(e,{emit:t}){let n=e;return(e,t)=>(z(),B(U,null,[V(`div`,qc,N(n.message),1),n.token?(z(),B(`div`,Jc,`TokenId = `+N(n.token),1)):H(``,!0)],64))}})})),Zc=o((()=>{})),Qc=o((()=>{})),$c,el=o((()=>{Xc(),Xc(),Zc(),Qc(),q(),$c=K(Yc,[[`__scopeId`,`data-v-6a4e1608`]])}));function J(e,t){e&&$s({el:e,component:Gc,props:{error:t}})}function tl(e,t,n){e&&$s({el:e,component:$c,props:{message:t,...n||{}}})}var nl=o((()=>{Kc(),el()}));nl();var rl={AED:`784`,AFN:`971`,ALL:`008`,AMD:`051`,ANG:`532`,AOA:`973`,ARS:`032`,AUD:`036`,AWG:`533`,AZN:`944`,BAM:`977`,BBD:`052`,BDT:`050`,BGN:`975`,BHD:`048`,BIF:`108`,BMD:`060`,BND:`096`,BOB:`068`,BOV:`984`,BRL:`986`,BSD:`044`,BTN:`064`,BWP:`072`,BYN:`933`,BZD:`084`,CAD:`124`,CDF:`976`,CHE:`947`,CHF:`756`,CHW:`948`,CLF:`990`,CLP:`152`,CNY:`156`,COP:`170`,COU:`970`,CRC:`188`,CUC:`931`,CUP:`192`,CVE:`132`,CZK:`203`,DJF:`262`,DKK:`208`,DOP:`214`,DZD:`012`,EGP:`818`,ERN:`232`,ETB:`230`,EUR:`978`,FJD:`242`,FKP:`238`,GBP:`826`,GEL:`981`,GHS:`936`,GIP:`292`,GMD:`270`,GNF:`324`,GTQ:`320`,GYD:`328`,HKD:`344`,HNL:`340`,HRK:`191`,HTG:`332`,HUF:`348`,IDR:`360`,ILS:`376`,INR:`356`,IQD:`368`,IRR:`364`,ISK:`352`,JMD:`388`,JOD:`400`,JPY:`392`,KES:`404`,KGS:`417`,KHR:`116`,KMF:`174`,KPW:`408`,KRW:`410`,KWD:`414`,KYD:`136`,KZT:`398`,LAK:`418`,LBP:`422`,LKR:`144`,LRD:`430`,LSL:`426`,LYD:`434`,MAD:`504`,MDL:`498`,MGA:`969`,MKD:`807`,MMK:`104`,MNT:`496`,MOP:`446`,MUR:`480`,MVR:`462`,MWK:`454`,MXN:`484`,MXV:`979`,MYR:`458`,MZN:`943`,NAD:`516`,NGN:`566`,NIO:`558`,NOK:`578`,NPR:`524`,NZD:`554`,OMR:`512`,PAB:`590`,PEN:`604`,PGK:`598`,PHP:`608`,PKR:`586`,PLN:`985`,PYG:`600`,QAR:`634`,RON:`946`,RSD:`941`,RUB:`643`,RWF:`646`,SAR:`682`,SBD:`090`,SCR:`690`,SDG:`938`,SEK:`752`,SGD:`702`,SHP:`654`,SLL:`694`,SOS:`706`,SRD:`968`,SSP:`728`,SVC:`222`,SYP:`760`,SZL:`748`,THB:`764`,TJS:`972`,TMT:`934`,TND:`788`,TOP:`776`,TRY:`949`,TTD:`780`,TWD:`901`,TZS:`834`,UAH:`980`,UGX:`800`,USD:`840`,USN:`997`,UYI:`940`,UYU:`858`,UYW:`927`,UZS:`860`,VED:`926`,VES:`928`,VND:`704`,VUV:`548`,WST:`882`,XAF:`950`,XAG:`961`,XAU:`959`,XBA:`955`,XBB:`956`,XBC:`957`,XBD:`958`,XCD:`951`,XDR:`960`,XOF:`952`,XPD:`964`,XPF:`953`,XPT:`962`,XSU:`994`,XTS:`963`,XUA:`965`,XXX:`999`,YER:`886`,ZAR:`710`,ZMW:`967`,ZWL:`932`},il={BHD:3,BIF:0,CLF:4,CLP:0,DJF:0,GNF:0,IQD:3,ISK:0,JOD:3,JPY:0,KMF:3,KRW:0,KWD:3,LYD:3,OMR:3,PYG:0,RWF:0,TND:3,UGX:0,UYI:0,UYW:4,VND:0,VUV:0,XAF:0,XOF:0,XPF:0};function al(e){return!!rl[String(e).toUpperCase()]}function ol(e){return rl[String(e).toUpperCase()]||``}function sl(e){return il[String(e).toUpperCase()]||2}var cl,ll,ul=o((()=>{cl=`payfurl.com`,ll={domain:cl}})),dl,fl,pl=o((()=>{he(),ul(),dl={[C.DEVELOPMENT]:{AU:`https://develop-api-au.${ll.domain}`,DEFAULT:`https://develop-api.${ll.domain}`},[C.SANDBOX]:{AU:`https://sandbox-api-au.${ll.domain}`,DEFAULT:`https://sandbox-api.${ll.domain}`},[C.PRODUCTION]:{AU:`https://api-au.${ll.domain}`,DEFAULT:`https://api.${ll.domain}`},[C.LOCAL]:{DEFAULT:`https://localhost:5001`}},fl=class{environment;location;constructor(e,t){this.environment=e.toLowerCase(),this.location=t.toUpperCase()}getRegionUrl(){if(!dl[this.environment])throw Error(`Invalid environment: ${this.environment}`);return dl[this.environment][this.location]||dl[this.environment].DEFAULT}}}));function ml(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hl(e){return e.match(/-([a-z]{2})$/)?.[1]||``}function gl(e){let t=e.match(/\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)(\d{1,14})$/);return t?[t[1],t[2]]:[e]}function _l(e){return e?e.replace(/(\d{4})\d{8}(\d{4})/,`$1 **** **** $2`):``}function vl(e){return e.replace(/\s/g,``)}var yl=o((()=>{})),bl,xl,Sl,Cl,wl=o((()=>{G(),bl={key:0,class:`masked`},xl={key:0,class:`message`},Sl={key:1,class:`lds-spinner single`},Cl=R({__name:`Spinner`,props:{color:{default:`#1a82b7`},size:{default:50},message:{},useLocal:{type:Boolean}},setup(e){let t=e;return(n,r)=>t.useLocal?(z(),B(`div`,Sl,[...r[1]||=[V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1),V(`div`,null,null,-1)]])):(z(),B(`div`,bl,[e.message?(z(),B(`div`,xl,N(e.message),1)):H(``,!0),r[0]||=V(`div`,{class:`lds-spinner`},[V(`div`),V(`div`),V(`div`),V(`div`),V(`div`),V(`div`),V(`div`),V(`div`),V(`div`),V(`div`),V(`div`),V(`div`)],-1)]))}})})),Tl=o((()=>{})),El,Dl=o((()=>{wl(),wl(),Tl(),q(),El=K(Cl,[[`__scopeId`,`data-v-2b4dad6b`]])})),Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,Y=o((()=>{Ol=`payfurl-init`,kl=`payfurl-payment-method-unavailable`,Al=`init-card-form`,jl=`checkout-ready`,Ml=`submit-card-form`,Nl=`tokenise-card-form`,Pl=`request-card`,Fl=`card-details`,Il=`secure-orchestrator-submit`,Ll=`secure-orchestrator-submit-secondary-3ds`,Rl=`secure-orchestrator-update-state`,zl=`secure-orchestrator-show-challenge`,Bl=`secure-orchestrator-hide-challenge`,Vl=`show-spinner`,Hl=`hide-spinner`,Ul=`set-amount`,Wl=`set-currency`,Gl=`set-email`,Kl=`set-billing-address`,ql=`set-customer-info`,Jl=`set-order-info`,Yl=`click2pay-cards`,Xl=`show-card-form`,Zl=`start-loading-card-form`,Ql=`stop-loading-card-form`,$l=`pause-loading-card-form`,eu=`unpause-loading-card-form`,tu=`click2pay-stop-using`,nu=`click2pay-update-available-card-brands`,ru=`card-form-error`,iu=`card-form-info-message`,au=`card-form-validation-status-change`,ou=`Payment Details Collected`,su=`3D Secure failed`,cu=`Your bank couldn't verify this card. Please try again or use a different card.`}));function lu(){window.self===window.top?(pu||du(),pu&&(pu.style.display=`none`)):window.parent.postMessage({status:Hl},`*`)}function uu(){window.self===window.top?(pu||du(),pu&&(pu.style.display=`block`)):window.parent.postMessage({status:Vl},`*`)}function du(){pu=document.getElementById(`payfurl-spinner`),!pu&&document.body&&(pu=document.createElement(`div`),pu.id=`payfurl-spinner`,pu.style.display=`none`,document.body.appendChild(pu),$s({el:pu,component:El}))}function fu(){return window.self===window.top&&du(),{showSpinner:uu,hideSpinner:lu}}var pu,mu=o((()=>{ec(),Dl(),Y(),pu=null}));_e(),ye(),pl(),yl(),mu(),Y();var{hideSpinner:hu,showSpinner:gu}=fu(),_u={PREAUTH:`PREAUTH`,AUTH:`AUTH`,POSTAUTH:`POSTAUTH`,AUTH_COMPLETE:`AUTH_COMPLETE`,GET_GATEWAY_DATA:`GET_GATEWAY_DATA`,TOKENISE_CARD:`TOKENISE_CARD`,PUT_TOKEN_EXTERNAL_3DS_DATA:`PUT_TOKEN_EXTERNAL_3DS_DATA`},vu=(e,t)=>({[_u.PREAUTH]:{url:e+(t?`/3ds/preauth/token/`+t:`/3ds/preauth`),method:`POST`},[_u.AUTH]:{url:e+(t?`/3ds/auth/token/`+t:`/3ds/auth`),method:`POST`},[_u.POSTAUTH]:{url:e+`/3ds/postauth`,method:`POST`},[_u.AUTH_COMPLETE]:{url:e+`/3ds/auth_complete`,method:`POST`},[_u.GET_GATEWAY_DATA]:{url:e+`/token/`+t+`/gateway_data`,method:`GET`},[_u.TOKENISE_CARD]:{url:e+`/token/card`,method:`POST`},[_u.PUT_TOKEN_EXTERNAL_3DS_DATA]:{url:e+`/token/`+t+`/external3dsdata`,method:`PUT`}}),yu=class{container=null;log;apiUrl=``;threeDsInvoker=null;providerId;requireChallenge=!1;cardProviderId;address=null;paymentInfo=null;tokenId=``;currency=`AUD`;amount=0;email=null;clientParameters={};failureCallback=null;successCallback=null;threeDSCompleteHandler=null;threeDSFailureHandler=null;progressCallback=null;running=!1;challengeReported=!1;httpInvoker=null;constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.providerId=t.providerId,this.cardProviderId=t.cardProviderId,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null,this.progressCallback=t.onProgress||null,this.threeDsInvoker=t.threeDsInvoker||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setTokenId(e){this.tokenId=e}getTokenId(){return this.tokenId}getProviderId(){return this.providerId}setEmail(e){this.email=e}getEmail(){return this.email||``}setCurrency(e){this.currency=e}getCurrency(){return this.currency}setAmount(e){this.amount=e}getAmount(){return this.amount}setPaymentInfo(e){let t=e.expiryDate.split(`/`);this.paymentInfo={cardNumber:e.cardNumber,expiryDate:(t[1]||``)+(t[0]||``),cardholder:e.cardholder,ccv:e.ccv}}getPaymentInfo(){return{...this.paymentInfo}}setAddressInfo(e){this.address={...e}}getAddressInfo(){return{...this.address}}setClientParameters(e){this.clientParameters={...e}}getClientParameters(){return{...this.clientParameters}}onError(e){this.log(`[3ds error]`,e),hu(),J(this.container,cu),this.complete({step:`completed`,success:!1,error:e.error}),this.threeDSFailureHandler?this.threeDSFailureHandler(e):this.failureCallback?.(e)}onSuccess(e){hu(),this.log(`[3ds success]`,e),this.complete({step:`completed`,success:!0}),this.threeDSCompleteHandler?this.threeDSCompleteHandler?.(e):this.successCallback?.(e)}onPreAuth(e,t){let n={acctNumber:this.paymentInfo?.cardNumber,providerId:this.providerId,ccv:this.paymentInfo?.ccv,cardProviderId:this.cardProviderId};this.log(`[onPreAuth]`,n),this.httpInvoker?.invoke(vu(this.apiUrl,this.tokenId)[_u.PREAUTH].url,vu(this.apiUrl,this.tokenId)[_u.PREAUTH].method,JSON.stringify(n),e,t)}onAuth(e,t,n,r,i,a,o){this.log(`[onAuth]`,{threeDSServerTransID:n,isMethodPerformed:r});let s=ol(this.currency),c=sl(this.currency),l=new Date,u={acctNumber:this.paymentInfo?.cardNumber,notificationURL:this.apiUrl+`/3ds/auth_complete`,threeDSAuthURL:e,threeDSCompInd:r?`Y`:`U`,threeDSRequestorTransID:t,threeDSServerTransID:n,threeDSRequestorURL:window.location.href,cardExpiryDate:this.paymentInfo?.expiryDate,email:this.email,threeDSRequestorAuthenticationInd:`01`,cardholderName:this.paymentInfo?.cardholder,deviceChannel:`02`,browserInfo:i,browserJavascriptEnabled:!0,browserJavaEnabled:!1,browserLanguage:window.navigator.language,browserColorDepth:String(ve()),browserScreenHeight:screen.height+``,browserScreenWidth:screen.width+``,browserTZ:Math.round(l.getTimezoneOffset()/60)+``,browserUserAgent:navigator.userAgent,browserAcceptHeader:``,browserIP:``,messageCategory:`01`,messageType:`AReq`,messageVersion:`2.2.0`,purchaseAmount:(this.amount*10**c).toFixed(0)+``,payTokenInd:!0,purchaseCurrency:s,purchaseExponent:c+``,purchaseDate:l.toISOString().slice(0,19).replace(/[-:T]/g,``),transType:`01`,ccv:this.paymentInfo?.ccv&&String(this.paymentInfo?.ccv)||``,threeDSRequestorChallengeInd:this.requireChallenge?`04`:`01`};this.httpInvoker?.invoke(vu(this.apiUrl,this.tokenId)[_u.AUTH].url,vu(this.apiUrl,this.tokenId)[_u.AUTH].method,JSON.stringify(u),(e,t)=>{hu(),a(e,t)},o)}onPostAuth(e,t,n){this.log(`[onPostAuth]`,e),gu(),this.httpInvoker?.invoke(vu(this.apiUrl,this.tokenId)[_u.POSTAUTH].url,vu(this.apiUrl,this.tokenId)[_u.POSTAUTH].method,JSON.stringify(e),t,n)}challengeShown(){this.running&&!this.challengeReported&&(this.challengeReported=!0,this.progressCallback?.({step:`challenge`}))}complete(e){this.running&&(this.running=!1,this.progressCallback?.(e))}threeDSInvoke(e,t,n,r){this.running=!0,this.challengeReported=!1,this.progressCallback?.({step:`started`}),this.container=e,this.threeDSCompleteHandler=n||null,this.threeDSFailureHandler=r||null,this.requireChallenge=t,this.threeDsInvoker?.onPreAuth()}getGatewayData(e,t,n,r){this.httpInvoker?.invoke(vu(this.apiUrl,t)[_u.GET_GATEWAY_DATA].url,vu(this.apiUrl,t)[_u.GET_GATEWAY_DATA].method,null,T(this,`[getGatewayDataSuccessCallback]`,(e,t)=>{this.log(`getGatewayDataSuccessCallback`,e),n(JSON.parse(t))}),T(this,`[getGatewayDataFailureCallback]`,(e,t)=>{this.log(`getGatewayDataFailureCallback`,e,t),hu(),r()}),{providerId:e})}tokeniseCard(e,t,n){let r=this.getPaymentInfo();!r.cardNumber||!r.expiryDate||!r.cardholder?n(`Card information is missing`):(gu(),this.httpInvoker?.invoke(vu(this.apiUrl)[_u.TOKENISE_CARD].url,vu(this.apiUrl)[_u.TOKENISE_CARD].method,JSON.stringify({paymentInformation:{cardNumber:r.cardNumber,expiryDate:`${r.expiryDate.slice(2)}/${r.expiryDate.slice(0,2)}`,cardholder:r.cardNumber,ccv:r.ccv},currency:this.getCurrency(),amount:this.getAmount()}),T(this,`[tokeniseCardSuccessCallback]`,(e,n)=>{this.log(`tokeniseCardSuccessCallback`,e,n),hu(),t(JSON.parse(n))}),T(this,`[tokeniseCardFailureCallback]`,(e,t)=>{this.log(`tokeniseCardFailureCallback`,e,t),hu(),n(`Unable to tokenise payment information`)}),{providerId:e}))}updateTokenExternal3dsData(e){this.tokenId&&e&&Object.keys(e).length!==0&&this.httpInvoker?.invoke(vu(this.apiUrl,this.tokenId)[_u.PUT_TOKEN_EXTERNAL_3DS_DATA].url,vu(this.apiUrl,this.tokenId)[_u.PUT_TOKEN_EXTERNAL_3DS_DATA].method,JSON.stringify(e),(e,t)=>{this.log(`updateTokenExternal3dsDataSuccessCallback`,e,t)},(e,t)=>{this.log(`updateTokenExternal3dsDataFailureCallback`,e,t),hu()},{})}};d([w],yu.prototype,`setPaymentInfo`,null),d([w],yu.prototype,`onError`,null),d([w],yu.prototype,`onSuccess`,null),d([w],yu.prototype,`onPreAuth`,null),d([w],yu.prototype,`onAuth`,null),d([w],yu.prototype,`onPostAuth`,null),d([w],yu.prototype,`threeDSInvoke`,null),d([w],yu.prototype,`getGatewayData`,null),d([w],yu.prototype,`tokeniseCard`,null),d([w],yu.prototype,`updateTokenExternal3dsData`,null),G();var bu=F(!1);function xu(){return{isLoading:bu,startLoading:()=>{bu.value=!0},stopLoading:()=>{bu.value=!1}}}G(),Dl(),Y();var Su={style:{position:`relative`}},Cu={key:0,class:`error text-normal`},wu=`payfurl-paypal-script`,Tu=R({__name:`PaypalForm`,props:{log:{type:Function},el:{},currency:{},enablePayIn4:{type:Boolean},buttonStyle:{},clickGate:{type:Function}},emits:[`approve`,`submit`,`activate`,`close`],setup(e,{emit:t}){let n=e,r=t,i=F(null),a=F(!0),o=F(``),s=F(null),c=!1,l=null,{isLoading:u}=xu();function d(e){s.value=e,n.log&&n.log(`[Paypal]: checkout`,s.value),c||(c=!0,f())}function f(){if(document.getElementById(wu)){p();return}let e={"client-id":s.value?.gatewayTransactionData.ClientId||``,currency:n.currency.toUpperCase(),"disable-funding":`card`};n.enablePayIn4&&(e[`enable-funding`]=`paylater`);let t=`https://www.paypal.com/sdk/js?${new URLSearchParams(e)}`;window.paypal=null;let r=document.createElement(`script`);r.src=t,r.id=wu,r.onload=p,r.onerror=()=>{r.remove(),m(`PayPal script failed to load`)},document.body.appendChild(r)}function p(){window.paypal&&window.paypal.Buttons&&new Promise(e=>e(window.paypal.Buttons({style:typeof n.buttonStyle==`string`?{color:n.buttonStyle}:n.buttonStyle??{},createOrder:function(){return s.value?.gatewayTransactionId},onApprove:function(e,t){r(`approve`,{data:e,actions:t})},onInit(e,t){t.disable(),l=setInterval(()=>{n.clickGate()?.()===!1?t.disable():t.enable()},1e3)}}).render(n.el))).then(()=>window.postMessage({status:Ol,paymentMethod:`paypal`},`*`)).catch(e=>m(e?.message||`PayPal buttons failed to render`))}function m(e){window.postMessage({status:kl,paymentMethod:`paypal`,reason:`error`,message:e},`*`)}function h(e){e?.data?.status&&(e.data.status===`activate`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),a.value=!0,r(`activate`)),e.data.status===`deactivate`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),a.value=!1),e.data.status===`checkout-ready`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),d(e.data.checkoutData)),e.data.status===`message`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),o.value=e.data.message),e.data.status===`error`&&e.data.component===`paypal`&&(n.log?.(`[PayPal]: message "${e.data.status}" received`,e.data),o.value=e.data.error))}return Ua(()=>{window.removeEventListener(`message`,h),l&&clearInterval(l)}),za(()=>{window.addEventListener(`message`,h),kc(i.value,`payfurl-combined-container`)||(a.value=!0,r(`activate`))}),(e,t)=>(z(),B(U,null,[V(`div`,Su,[Dr(W(El,null,null,512),[[Es,I(u)]])]),V(`div`,{style:{position:`relative`},ref_key:`root`,ref:i},[o.value?(z(),B(`div`,Cu,N(o.value),1)):H(``,!0)],512)],64))}}),Eu={APPROVED:`Approved`,DECLINED:`Declined`,UNDECIDED:`Undecided`};function Du(e){return e?e.decision===Eu.DECLINED&&e.stopPaymentOnFailure===!0:!1}function Ou(e){return e===`forter`}function ku(e){if(e==null)return null;var t={};for(var n in e)t[n]=e[n];return t}ec(),_e(),nl(),pl(),yl(),mu(),Y();var{hideSpinner:Au,showSpinner:ju}=fu(),Mu=class{container=null;log;apiUrl=``;failureCallback=null;successCallback=null;userOnValidate;fraudProcessor=null;httpInvoker=null;destroy=()=>{};checkoutExternalId=``;amount=0;userSuccessMessage=ou;constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}addFraudProcessor(e){this.fraudProcessor=e}setSuccessMessage(e){this.userSuccessMessage=e}getSuccessMessage(){return this.userSuccessMessage}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){this.container?.id===e?.id&&(this.log(`[paypalProcessor], cleanUp`),this.destroy?.())}addPaypal(e,t,n,r,i,a){this.log(`[paypalProcessor][addPaypal]`,{amount:n,currency:r,providerId:i,options:a}),this.validateOptions(e,n,r);let o=!1;this.container=e,this.fraudProcessor&&(this.fraudProcessor.setAmount(n),this.fraudProcessor.setCurrency(r));let s=$s({el:e,component:Tu,props:{log:this.log,el:e,currency:r,enablePayIn4:!!a?.paypalEnablePayIn4,buttonStyle:a?.paypalButtonStyle,clickGate:this.getOnValidate.bind(this)},on:{activate:T(this,`[Paypal]: activate`,()=>{o||(o=!0,this.log(`[Paypal]: activate paypal form`),this.checkout(this.amount||n,r,i,a||{},()=>{o=!1}),this.setAmount=e=>{this.log(`[Paypal][setAmount][inside]`,e),this.checkout(e,r,i,a||{},()=>{o=!1})})}),approve:T(this,`[Paypal]: approved`,({data:t,actions:n})=>{this.log(`[Paypal]: approved`,{data:t,actions:n});let r=n.order.get();this.log(`[Paypal]: order`,r);let i=setInterval(()=>{if(this.log(`[Paypal]: setInterval resolved = `+r.resolved),r.resolved){clearInterval(i);try{this.chargeApproved(e,r)}catch(t){Au(),J(e,`Payment couldn't be processed`),this.failureCallback?.({error:t?.message||`Payment couldn't be processed`})}}},200)})}});this.destroy=s.destroy}chargeApproved(e,t){this.fraudProcessor?(this.fraudProcessor.setPaypalInfo({payerId:t.value.payer.payer_id,payerEmail:t.value.payer.email_address,paymentStatus:t.value.status,payerAccountCountry:t.value.payer.address?.country_code,paymentId:t.value.id}),ju(),this.fraudProcessor.fraudCheck(t=>{Au(),Du(t)?(J(e,`Payment couldn't be processed`),this.failureCallback?.({error:`Payment couldn't be processed`})):this.addCharge(e,t)},t=>{Au(),J(e,t.error),this.failureCallback?.(t)})):this.addCharge(e,null)}setAmount(e){this.amount=e,this.fraudProcessor?.setAmount(e)}checkout(e,t,n,r,i){let a=this.apiUrl+`/payment_method/checkout`;r||={hideShipping:!1,paypalButtonStyle:null,paypalEnablePayIn4:!1,transfer:null};let o={providerId:n,amount:e,currency:t,options:{HideShipping:r.hideShipping?`true`:`false`},metadata:ku(r?.metadata)};r.transfer?.amount&&(o.transfer={account:r.transfer.account,amount:r.transfer.amount}),xu().startLoading(),this.httpInvoker?.invoke(a,`POST`,JSON.stringify(o),this.successCheckoutHandler.bind(this),(e,t)=>{i?.(e,t),this.failureCheckoutHandler.bind(this)(e,t)})}failureCheckoutHandler=(e,t)=>{xu().stopLoading(),this.failureCallback?.({error:`Failed to configure paypal`,body:t}),window.postMessage({status:`error`,component:`paypal`,error:`Failed to configure paypal`},`*`)};successCheckoutHandler=T(this,`[PayPal][successCheckoutHandler]`,(e,t)=>{xu().stopLoading();let n=JSON.parse(t);this.log(`paypal success`,n);let r=JSON.parse(t),i=JSON.parse(window.atob(r.checkoutData));this.checkoutExternalId=i.externalId,window.postMessage({status:jl,component:`paypal`,checkoutData:i},`*`)});getFailureAddChargeHandler(e){return T(this,`[PayPalProcessor][getFailureAddChargeHandler]`,(t,n)=>{J(e,`Unable to tokenise payment information`),this.failureCallback?.({error:`Unable to finish AddCharge`,body:n}),this.log(`Unable to finish AddCharge, error: `+n)})}getSuccessAddChargeHandler(e){return T(this,`[PayPalProcessor][getSuccessAddChargeHandler]`,(t,n)=>{let r=JSON.parse(n);this.log(`[getSuccessAddChargeHandler]`,r),tl(e,this.getSuccessMessage()),this.successCallback?.({transactionId:r.chargeId})})}addCharge(e,t){let n=this.apiUrl+`/charge/checkout`;this.httpInvoker?.invoke(n,`POST`,JSON.stringify({externalId:this.checkoutExternalId,fraudCheck:t}),this.getSuccessAddChargeHandler(e).bind(this),this.getFailureAddChargeHandler(e).bind(this))}validateOptions(e,t,n){if(!al(n))throw J(e,`Invalid currency: `+n),TypeError(`invalid currency: `+n);if(!dc(t))throw J(e,`Invalid amount: `+t),TypeError(`invalid amount: `+t)}};d([w],Mu.prototype,`cleanUp`,null),d([w],Mu.prototype,`addPaypal`,null),d([w],Mu.prototype,`setAmount`,null),d([w],Mu.prototype,`checkout`,null),d([w],Mu.prototype,`getFailureAddChargeHandler`,null),d([w],Mu.prototype,`getSuccessAddChargeHandler`,null),d([w],Mu.prototype,`addCharge`,null),d([w],Mu.prototype,`validateOptions`,null),G(),Y();var Nu=[`src`],Pu={key:0,id:`threeDs`},Fu=620,Iu=R({__name:`CardForm`,props:{log:{type:Function},iframeSrc:{},form:{},threeDSEnabled:{type:Boolean},clickGate:{type:Function}},emits:[`load`,`submit`,`close`],setup(e,{emit:t}){let n=e,r=t,i=F(null),a=F(n.iframeSrc+`?v=`+Math.random()),o=F(n.threeDSEnabled),s=F(!1),c=F(!0),l=F(!1),u=``;function d(e){if(e?.data?.status){if(e.data.status===`iframe-has-changed`&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),e.stopPropagation(),p(e.data.message?.height||0)),(e.data.status===`secure-orchestrator-show-challenge`||e.data.status===`secure-orchestrator-hide-challenge`)&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),m(e.data.status===zl)),e.data.status===`submit-card-form`){if(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),!n.form||!c.value)return;if(e.stopPropagation(),n.form.querySelector(`input[name="token"]`)?.value){n.form.submit();return}if(n.clickGate()?.()===!1)return;r(`submit`)}e.data.status===`activate`&&e.data.component===`card`&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),c.value=!0),e.data.status===`deactivate`&&e.data.component===`card`&&(n.log?.(`[CardForm]: message "${e.data.status}" received`,e.data),c.value=!1)}}Ua(()=>{window.removeEventListener(`message`,d)}),za(()=>{window.addEventListener(`message`,d)});function f(){r(`load`,i.value)}function p(e){if(l.value)return;let t=i.value;if(e===0){t?.setAttribute(`style`,`height:0`);return}let n=e||200;t?.setAttribute(`style`,`height: ${n+5}px`),s.value=!0}function m(e){let t=i.value;t&&(e?(u=t.style.height||`200px`,l.value=!0,t.setAttribute(`style`,`height: ${Fu}px`)):(l.value=!1,t.setAttribute(`style`,`height: ${u}`)))}return(e,t)=>(z(),B(U,null,[V(`iframe`,{src:a.value,onLoad:f,ref_key:`iframe`,ref:i,style:Me(`height:${I(200)}px`),id:`payfurl-card-iframe`},null,44,Nu),o.value?(z(),B(`div`,Pu)):H(``,!0)],64))}});Y();var Lu=class{log;startLoadingCardFormHandler=null;constructor(e){this.log=e}getCardFormFrame(){return document.getElementById(`payfurl-card-iframe`)}startLoadingCardForm(){let e=this.getCardFormFrame();if(!e)this.startLoadingCardFormHandler=setTimeout(()=>{this.startLoadingCardForm()},200);else{this.startLoadingCardFormHandler=null,this.log(`[startLoadingCardForm]`);try{e.contentWindow?.postMessage({status:Zl},`*`)}catch(e){this.log(`[startLoadingCardForm] iframe error`,e)}}}stopLoadingCardForm(){this.startLoadingCardFormHandler&&=(clearTimeout(this.startLoadingCardFormHandler),null);let e=this.getCardFormFrame();if(!e)setTimeout(()=>{this.stopLoadingCardForm()},200);else{this.log(`[stopLoadingCardForm]`);try{e.contentWindow?.postMessage({status:Ql},`*`)}catch(e){this.log(`[stopLoadingCardForm] iframe error`,e)}}}pauseLoadingCardForm(){let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:$l},`*`)}catch(e){this.log(`[pauseLoadingCardForm] iframe error`,e)}}unpauseLoadingCardForm(){let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:eu},`*`)}catch(e){this.log(`[unpauseLoadingCardForm] iframe error`,e)}}showMessage(e){let t=this.getCardFormFrame();t&&t.contentWindow?.postMessage({status:ru,message:e},`*`)}showInfoMessage(e){let t=this.getCardFormFrame();t&&t.contentWindow?.postMessage({status:iu,message:e},`*`)}requestCardDetails(){let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:Pl},`*`)}catch(e){this.log(`[requestCardDetails] iframe error`,e)}}};d([w],Lu.prototype,`startLoadingCardForm`,null),d([w],Lu.prototype,`stopLoadingCardForm`,null),d([w],Lu.prototype,`pauseLoadingCardForm`,null),d([w],Lu.prototype,`unpauseLoadingCardForm`,null),d([w],Lu.prototype,`showMessage`,null),d([w],Lu.prototype,`showInfoMessage`,null),d([w],Lu.prototype,`requestCardDetails`,null),he();function Ru(e){return e===C.PRODUCTION?{acquirerMerchantId:`550e8400`,acquirerBIN:`444444`,authenticationReasons:[`TRANSACTION_AUTHENTICATION`]}:{acquirerMerchantId:`SRC3DS`,acquirerBIN:`545301`,authenticationReasons:[`TRANSACTION_AUTHENTICATION`]}}pl(),yl(),_e(),vc(),mu();var{hideSpinner:zu,showSpinner:Bu}=fu(),Vu={UPDATE:`UPDATE`},Hu=(e,t)=>({[Vu.UPDATE]:{url:e+(`/token/`+t+`/authentication`),method:`PUT`}}),Uu=class extends Lu{environment;token;networkToken;networkTokenData;networkTokenAuthenticateUrl;networkTokenProvider;networkTokenOptions;isReady=!1;invokeHandler=null;modal=null;apiUrl;httpInvoker=null;onSuccessCallback;onFailureCallback;constructor(e,t){super(e),this.log(`[MastercardTokenAuthenticationProcessor]`,t),this.environment=t.environment,this.token=t.token,this.networkToken=t.networkToken,this.networkTokenData=t.networkTokenData,this.networkTokenAuthenticateUrl=t.redirectUrl,this.networkTokenProvider=t.networkTokenProvider;let n=Ru(this.environment);this.networkTokenOptions={...n,...t.networkTokenOptions};let r=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,``,r),this.apiUrl=t.apiUrl,window.addEventListener(`message`,this.messageHandler.bind(this)),this.init()}invoke(e,t,n,r){this.log(`[MastercardTokenAuthenticationProcessor][invoke]`,{isReady:this.isReady,amount:e,currency:t}),this.onSuccessCallback=n,this.onFailureCallback=r,this.invokeHandler=()=>{this.invokeHandler=null,this.authenticate(e,t)},this.isReady?this.invokeHandler():this.modalShow()}messageHandler(e){if(e.data?.action){if(this.log(`[MastercardTokenAuthenticationProcessor][messageHandler]`,e),e.data.action===`Ready`)this.isReady=!0,this.invokeHandler&&this.invokeHandler();else if(e.data.action===`Error`){if(this.modalHide(),e.data.payload.message===`NOT_SUPPORTED`){this.showMessage(`This card is not supported token authentication. Please use another card.`),this.onFailureCallback?.({error:`This card is not supported token authentication. Please use another card.`});return}this.showMessage(`Unknown error. Please try again later.`),this.onFailureCallback?.({error:`Unknown error. Please try again later.`})}else if(e.data.action===`Success`){if(e.data.payload.authenticationStatus===`CANCELLED`){this.modalHide(),this.showMessage(`Cancelled 3DS Challenge`),this.onFailureCallback?.({error:`Cancelled 3DS Challenge`});return}if(e.data.payload.authenticationResult===`NOT_AUTHENTICATED`){this.modalHide(),this.showMessage(`Failed 3DS Challenge`),this.onFailureCallback?.({error:`Failed 3DS Challenge`});return}this.updateToken(e.data.payload)}}}authenticate(e,t){let n=this.networkTokenOptions?.authenticationReasons||[`ENROL_FINANCIAL_INSTRUMENT`];n.includes(`ENROL_FINANCIAL_INSTRUMENT`)&&(e=0);let r={srcClientId:this.networkTokenProvider.clientParameters.SrcClientId,serviceId:this.networkTokenProvider.clientParameters.ServiceId,srcCorrelationId:this.networkTokenData.SrcCorrelationId,traceId:this.networkTokenData[`X-Src-Cx-Flow-Id`],accountReference:{srcDigitalCardId:this.networkToken},authenticationMethod:{authenticationMethodType:`MANAGED_AUTHENTICATION`,uriData:{uri:this.networkTokenAuthenticateUrl,uriType:`WEB_URI`}},authenticationContext:{authenticationReasons:n,dpaTransactionOptions:{dpaLocale:`en_AU`,merchantCountryCode:`AU`,transactionAmount:{transactionAmount:Number(e),transactionCurrencyCode:String(t).toUpperCase()}}}};n.includes(`TRANSACTION_AUTHENTICATION`)?r.authenticationContext.dpaData={dpaName:this.networkTokenProvider.clientParameters.DpaName,merchantCountryCode:`AU`}:r.authenticationContext.srcDpaId=this.networkTokenProvider.clientParameters.SrcDpaId,this.networkTokenOptions?.acquirerMerchantId&&(r.authenticationContext.acquirerMerchantId=this.networkTokenOptions.acquirerMerchantId),this.networkTokenOptions?.acquirerBIN&&(r.authenticationContext.acquirerBIN=this.networkTokenOptions.acquirerBIN),this.networkTokenOptions?.merchantCategoryCode&&(r.authenticationContext.dpaTransactionOptions.merchantCategoryCode=this.networkTokenOptions.merchantCategoryCode,r.authenticationContext.dpaData&&(r.authenticationContext.dpaData.merchantCategoryCode=this.networkTokenOptions.merchantCategoryCode)),this.log(`[MastercardTokenAuthenticationProcessor][authenticate]`,r),this.modal?.postMessage({action:`Authenticate`,payload:r},`*`)}init(){this.initCss()}initCss(){let e=document.createElement(`style`);e.textContent=`
|
|
3
3
|
.token-authentication-payfurl {
|
|
4
4
|
align-items: normal;
|
|
5
5
|
display: flex;
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
overflow-y: visible
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`,document.head.appendChild(e)}modalShow(){if(this.modal)return;let e=`maxTouchPoints`in navigator&&navigator.maxTouchPoints>0?791:637,t=window.screenLeft===void 0?window.screenX:window.screenLeft,n=window.screenTop===void 0?window.screenY:window.screenTop,r=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=r/window.screen.availWidth,o=(r-375)/2/a+t,s=(i-e)/2/a+n;
|
|
121
|
+
`,document.head.appendChild(e)}modalShow(){if(this.modal)return;let e=`maxTouchPoints`in navigator&&navigator.maxTouchPoints>0?791:637,t=window.screenLeft===void 0?window.screenX:window.screenLeft,n=window.screenTop===void 0?window.screenY:window.screenTop,r=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=r/window.screen.availWidth,o=(r-375)/2/a+t,s=(i-e)/2/a+n;zu(),gc(this.networkTokenAuthenticateUrl)&&(this.modal=window.open(this.networkTokenAuthenticateUrl+`?origin=`+window.location.origin,`targetWindow`,`toolbar=no,
|
|
122
122
|
location=no,
|
|
123
123
|
status=no,
|
|
124
124
|
menubar=no,
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
width=375,
|
|
128
128
|
height=${e},
|
|
129
129
|
top=${s},
|
|
130
|
-
left=${o}`))}modalHide(){this.modal&&(Iu(),this.modal.close())}updateToken(e){if(this.log(`[MastercardTokenAuthenticationProcessor][updateToken]`,e),!e.assuranceData?.verificationData.length){this.modalHide(),this.onFailureCallback?.({error:`Verification data is empty`});return}if(!this.token){this.log(`[MastercardTokenAuthenticationProcessor]: No need to update token`),this.modalHide(),this.onSuccessCallback?.(e);return}let t=e.assuranceData.verificationData[0];this.httpInvoker?.invoke(Ru(this.apiUrl,this.token)[Lu.UPDATE].url,Ru(this.apiUrl,this.token)[Lu.UPDATE].method,JSON.stringify({VerificationType:t.verificationType,VerificationEntity:t.verificationEntity,VerificationMethod:t.verificationMethod,VerificationResults:t.verificationResults,VerificationTimestamp:t.verificationTimestamp,AdditionalData:t.additionalData,VerificationEvents:JSON.stringify(t.verificationEvents)}),T(this,`[MastercardTokenAuthenticationProcessor][updateToken]: successCallback`,(t,n)=>{this.log(`[MastercardTokenAuthenticationProcessor][updateToken]: successCallback`,t,n),this.modalHide(),this.onSuccessCallback?.(e)}),T(this,`[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback`,(e,t)=>{this.log(`[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback`,e,t),this.modalHide(),this.onFailureCallback?.({error:`Unknown error`})}))}};d([w],zu.prototype,`invoke`,null),d([w],zu.prototype,`messageHandler`,null),d([w],zu.prototype,`authenticate`,null),d([w],zu.prototype,`init`,null),d([w],zu.prototype,`initCss`,null),d([w],zu.prototype,`modalShow`,null),d([w],zu.prototype,`modalHide`,null),d([w],zu.prototype,`updateToken`,null),_c(),$s(),tl(),_e(),fl(),vl(),au(),du();var{hideSpinner:Y,showSpinner:Bu}=lu(),Vu={TOKENISE_CARD:`TOKENISE_CARD`,GET_PROVIDER_INFO:`GET_PROVIDER_INFO`},Hu=(e,t,n)=>({[Vu.TOKENISE_CARD]:{url:e+`/token/card`,method:`POST`},[Vu.GET_PROVIDER_INFO]:{url:e+`/info/providers/`+t,method:`GET`}}),X=class extends Nu{container=null;iframe=null;form=null;debug=!1;environment;apiUrl=``;url=``;secureUrl=``;version=``;publicKey=``;customer=null;billingAddress=null;order=null;geolocation=null;amount=0;currency=``;createNetworkToken=!1;vault;verifyCard;metadata;userSuccessMessage=ru;threeDSEnabled=!1;threeDsProcessor=null;secondaryThreeDsProcessor=null;fraudProcessor=null;clickToPayProcessor=null;tokenAuthenticationEnabled=!1;networkTokenProviders=[];networkTokenOptions={};failureCallback=null;successCallback=null;validationStatusChangeCallback=null;userOnValidate;httpInvoker;destroy=()=>{};cardDetailsPort=null;secureWindow=null;secureOrigin=``;secureReady=!1;secureEnabled=!1;secureFallback=!1;secureConfig=null;boundMessageHandler;isMessageListenerAttached=!1;constructor(e,t){super(e),this.debug=t.debug,this.environment=t.environment,this.url=t.url,this.apiUrl=t.apiUrl,this.secureUrl=t.secureUrl,this.version=t.version,this.publicKey=t.publicKey,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null,this.validationStatusChangeCallback=t.onValidationStatusChangeCallback||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(this.publicKey,t.version,n),this.boundMessageHandler=this.messageHandler.bind(this),this.attachMessageListener()}attachMessageListener(){this.isMessageListenerAttached||=(window.addEventListener(`message`,this.boundMessageHandler),!0)}detachMessageListener(){this.isMessageListenerAttached&&=(window.removeEventListener(`message`,this.boundMessageHandler),!1)}addThreeDsProcessor(e){this.threeDsProcessor=e}addSecondaryThreeDsProcessor(e){this.secondaryThreeDsProcessor=e}addFraudProcessor(e){this.fraudProcessor=e}addClickToPayProcessor(e){this.clickToPayProcessor=e}setSuccessMessage(e){this.userSuccessMessage=e}getSuccessMessage(){return this.userSuccessMessage}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){e?.id===this.container?.id&&(this.destroy?.(),this.container=null,this.form=null,this.iframe=null,this.closeCardDetailsPort(),this.secureReady=!1,this.secureEnabled=!1,this.secureFallback=!1,this.secureConfig=null,this.secureOrigin=``,this.secureWindow=null,this.detachMessageListener())}addCard(e,t,n,r,i,a){this.log(`[addCard]`,{providerId:n,amount:r,currency:i,options:a}),this.attachMessageListener(),a?.createNetworkToken&&!a?.tokenAuthenticationEnabled&&(a.clickToPayEnabled=!1),a?.clickToPayEnabled&&this.clickToPayProcessor&&(a.threeDSEnabled=!1),this.secureFallback=!1,this.secureReady=!1,this.secureEnabled=!!a?.secureCardOrchestration?.enabled;let o=a?.threeDSEmail||``;this.amount=r,this.currency=i,this.vault=mc(a?.vault),this.verifyCard=mc(a?.verifyCard),this.metadata=J(a?.metadata),this.fraudProcessor&&(this.fraudProcessor.setAmount(r),this.fraudProcessor.setCurrency(i)),this.threeDsProcessor&&(this.threeDsProcessor.setEmail(a?.threeDSEmail||``),this.threeDsProcessor.setAmount(r),this.threeDsProcessor.setCurrency(i),this.threeDsProcessor.setClientParameters(a?.clientParameters||{})),a?.threeDSEnabled&&(dc(r,lc,`Missing or invalid amount`,this.failureCallback),dc(i,il,`Missing or invalid currency`,this.failureCallback),this.threeDSEnabled=!0);let s=Object.keys(a?.networkTokenOptions||{}).length?a?.networkTokenOptions:a?.clickToPayOptions?.networkTokenOptions;a?.clickToPayEnabled&&this.clickToPayProcessor&&(this.clickToPayProcessor.setAmount(r),this.clickToPayProcessor.setCurrency(i),this.clickToPayProcessor.setCustomerInfo({...this.customer||{},email:a?.threeDSEmail||``},!0),this.clickToPayProcessor.setOptions({...a?.clickToPayOptions,dpaId:a?.clickToPayOptions?.dpaId||``,tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,networkTokenOptions:s}),this.clickToPayProcessor.setContainer(e),this.clickToPayProcessor.init(),this.clickToPayProcessor.start()),!a?.clickToPayEnabled&&this.clickToPayProcessor&&this.clickToPayProcessor.isInitialized()&&this.clickToPayProcessor.stopUsing(),this.createNetworkToken=!!a?.createNetworkToken,this.tokenAuthenticationEnabled=!!a?.tokenAuthenticationEnabled,this.networkTokenProviders=a?.networkTokenProviders||[],this.networkTokenOptions=a?.networkTokenOptions||{},this.container=e||null,this.form=t;let c=Qs({el:this.container,component:Mu,props:{log:this.log,iframeSrc:this.url,form:this.form,threeDSEnabled:this.threeDSEnabled,clickGate:this.getOnValidate.bind(this)},on:{load:T(this,`[addCard], onload`,e=>{this.iframe=e;let t=this.secureEnabled?{...a?.secureCardOrchestration,enabled:!0,secureUrl:this.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.apiUrl,version:this.version,amount:this.amount,currency:this.currency,metadata:this.metadata||{},billingAddress:this.billingAddress||null,customer:this.customer||null,order:this.order||null,geolocation:this.geolocation||null,clickToPay:a?.clickToPayEnabled&&this.clickToPayProcessor?{enabled:!0,rememberMe:this.clickToPayProcessor.getRememberMe(),tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,options:{...a?.clickToPayOptions,dpaId:a?.clickToPayOptions?.dpaId||``,tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,networkTokenOptions:s}}:void 0}:null;this.secureConfig=t;let c={status:Ol,environment:this.environment,debug:this.debug,publicKey:this.publicKey,providerId:n,apiUrl:this.apiUrl,amount:r,currency:i,vault:mc(a?.vault),verifyCard:mc(a?.verifyCard),showEmail:a?.threeDSEnabled&&!sc(o),visProviderId:a?.visProviderId,requiredFields:a?.requiredFields,clickToPayEnabled:a?.clickToPayEnabled,clickToPayOptions:a?.clickToPayOptions,secureCardOrchestration:t,style:a?.style||`compact`};if(this.closeCardDetailsPort(),!this.isSecureFlowEnabled()&&typeof MessageChannel<`u`){let t=new MessageChannel;this.setCardDetailsPort(t.port1),e?.contentWindow?.postMessage(c,`*`,[t.port2])}else e?.contentWindow?.postMessage(c,`*`);this.customer?.phoneNumber&&!oc(String(this.customer?.phoneNumber))&&this.getCardFormFrame()?.contentWindow?.postMessage({status:eu,message:`Invalid phone number`},`*`)}),submit:T(this,`[addCard], onsubmit`,()=>{this.log(`[CardProcessor]: submit event`),Bu(),this.requestCardDetails()})}});return this.destroy=c.destroy,this}messageHandler(e){if(e?.data?.status){if(e.data.status===`secure-orchestrator-ready`&&this.isTrustedSecureMessage(e))this.secureReady=!0;else if(e.data.status===`secure-orchestrator-tokenise`&&this.isTrustedSecureMessage(e)){let t=e.data.message||{};this.tokenise({threeDSServerTransID:t.threeDSServerTransID,fraudCheckResult:t.fraudCheckResult,externalThreeDsData:t.externalThreeDsData})}else if(e.data.status===`secure-orchestrator-click-to-pay-card`&&this.isTrustedSecureMessage(e))this.checkoutWithSecureClickToPayCard(e.data.message||{});else if(e.data.status===`secure-orchestrator-click-to-pay-new-card`&&this.isTrustedSecureMessage(e))this.checkoutWithSecureClickToPayNewCard(e.data.message||{});else if(e.data.status===`secure-orchestrator-failure`&&this.isTrustedSecureMessage(e))Y(),this.showMessage(e.data.error||`Unable to process payment details`),this.failureCallback?.({error:e.data.error||`Unable to process payment details`});else if(e.data.status===`hide-spinner`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),Y();else if(e.data.status===`show-spinner`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),Bu();else if(e.data.status===`card-form-validation-error`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),Y(),this.failureCallback?.({error:e.data.message});else if(e.data.status===`card-form-validation-status-change`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),Y(),this.validationStatusChangeCallback?.(e.data.message?.status,e.data.message?.message);else if(e.data.status===`tokenise-card-failure`){if(this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),Y(),e.data.message===`3D Secure required`&&this.isSecureFlowEnabled()){this.postSecureMessage(Fl);return}if(e.data.message===`3D Secure required`&&this.secondaryThreeDsProcessor){this.secondaryThreeDsProcessor?.threeDSInvoke(this.container,!0,e=>{Y(),this.log(`[threeDSInvoke], postAuthData`,e),this.tokenise({threeDSServerTransID:e.threeDSServerTransID,externalThreeDsData:e.externalThreeDsData})});return}this.showMessage(e.data.message),this.failureCallback?.({error:e.data.message,body:e.data.body})}else if(e.data.status===`tokenise-card-success`){this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),e.stopPropagation(),this.iframe=null;let t={token:e.data.tokenId};if(e.data.options?.cardDetails&&(t.cardDetails=e.data.options?.cardDetails),e.data.options?.iinData&&(t.iinData=e.data.options?.iinData),e.data.options?.clickToPay&&(t.clickToPayData={billingAddress:e.data.options?.clickToPay.billingAddress,panBin:e.data.options?.clickToPay?.cardData?.panBin||``,panLastFour:e.data.options?.clickToPay?.cardData?.panLastFour||``,scheme:e.data.options?.clickToPay?.cardData?.scheme||``,paymentCardType:e.data.options?.clickToPay?.cardData?.paymentCardType||``}),this.tokenAuthenticationEnabled&&e.data.options?.networkTokenAuthenticateUrl&&e.data.options?.networkToken){let n=this.initTokenAuthenticationProcessor(e.data.tokenId,e.data.options.networkToken,e.data.options?.networkTokenData,e.data.options.networkTokenAuthenticateUrl,e.data.options?.cardDetails,this.networkTokenOptions);if(n){n.invoke(this.amount,this.currency,T(this,`[sdk][cardProcessor], token authentication success`,()=>{this.log(`[sdk][cardProcessor], token authentication success`),Y(),el(this.container,this.getSuccessMessage()),this.successCallback?.(t)}),T(this,`[sdk][cardProcessor], token authentication error`,e=>{Y(),this.log(`[sdk][cardProcessor], token authentication error`,e)}));return}}Y(),el(this.container,this.getSuccessMessage()),this.successCallback?.(t)}}}setCardDetailsPort(e){this.closeCardDetailsPort(),this.cardDetailsPort=e,this.cardDetailsPort.onmessage=T(this,`[sdk][cardProcessor]: cardDetailsPort message`,e=>{e?.data?.status&&e.data.status===`card-details`&&this.handleCardDetailsMessage(e.data)})}closeCardDetailsPort(){this.cardDetailsPort&&=(this.cardDetailsPort.onmessage=null,this.cardDetailsPort.close(),null)}postSecureMessage(e,t){this.secureFallback||this.getCardFormFrame()?.contentWindow?.postMessage({status:e,message:t},this.getOriginFromUrl(this.url)||`*`)}getOriginFromUrl(e){try{return new URL(e,window.location.href).origin}catch{return``}}isTrustedSecureMessage(e){let t=this.getCardFormFrame(),n=this.getOriginFromUrl(this.url);return t?.contentWindow&&e.source===t.contentWindow?!n||e.origin===n:!!(this.secureWindow&&this.secureOrigin&&e.source===this.secureWindow&&e.origin===this.secureOrigin)}isSecureFlowEnabled(){return this.secureEnabled&&!this.secureFallback}requestCardDetails(){this.isSecureFlowEnabled()&&!this.secureReady?(Y(),this.showMessage(`Secure payment flow is not ready. Please try again.`),this.failureCallback?.({error:`Secure payment flow is not ready`})):this.isSecureFlowEnabled()&&this.secureReady?(this.secureConfig?.clickToPay&&this.clickToPayProcessor&&this.postSecureMessage(Il,{clickToPay:{...this.secureConfig.clickToPay,rememberMe:this.clickToPayProcessor.getRememberMe()}}),this.postSecureMessage(Pl)):this.cardDetailsPort?this.cardDetailsPort.postMessage({status:Ml}):super.requestCardDetails()}handleCardDetailsMessage(e){if(!e?.message)return;this.log(`[sdk][cardProcessor]: "${Nl}" message received`,e);let t=!!(this.clickToPayProcessor?.isEnabled()&&this.clickToPayProcessor?.getRememberMe()),n=!!(this.clickToPayProcessor?.isEnabled()&&e.message.srcDigitalCardId),r=!!(t&&!n&&e.message.cardNumber);r&&!this.clickToPayProcessor?.isSchemeSupported(e.message.cardNumber)?(this.log(`[clickToPayProcessor]: checkoutWithNewCard - Scheme is not supported!`),Y(),this.showMessage(`Please use another card or use an alternative payment method`)):n?(Y(),this.clickToPayProcessor?.checkoutWithCard(e.message,t=>{this.log(`[clickToPayProcessor]: checkoutWithCard`,t),t.checkoutActionCode!==`CANCEL`&&t.checkoutActionCode!==`CHANGE_CARD`&&(Bu(),this.tokenise({clickToPayInfo:{correlationId:t.checkoutResponseData.srcCorrelationId,srcFlowId:t.headers[`x-src-cx-flow-id`],merchantTransactionId:t.headers[`merchant-transaction-id`],ccv:e.message.ccv,digitalCardId:t.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))},e=>{this.log(`[clickToPayProcessor]: checkoutWithCard, error`,e),Y()})):(this.fraudProcessor?.setPaymentInfo({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv}),this.threeDsProcessor?.setPaymentInfo({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv}),this.secondaryThreeDsProcessor?.setPaymentInfo({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv}),e.message.email&&(this.threeDsProcessor?.setEmail(e.message.email),this.secondaryThreeDsProcessor?.setEmail(e.message.email)),this.fraudProcessor&&!(n||r)?(Bu(),this.fraudProcessor.fraudCheck(T(this,`[fraudProcessor][fraudCheck], success`,t=>{wu(t)?(Y(),q(this.container,`Payment couldn't be processed`),this.failureCallback?.({error:`Payment couldn't be processed`})):this.onSubmit({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv},t)}),T(this,`[fraudProcessor][fraudCheck], error`,e=>{Y(),q(this.container,e.error),this.failureCallback?.(e)}))):this.onSubmit({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv}))}onSubmit(e,t){this.log(`[cardProcessor]: onSubmit`,{cardInfo:{...e,cardNumber:gl(e.cardNumber),ccv:`***`},fraudCheckResult:t}),t?.managedOrderToken?(Y(),q(this.container,`3DS challenge could not be started`),this.failureCallback?.({error:`3DS challenge could not be started`})):this.clickToPayProcessor?.isEnabled()&&this.clickToPayProcessor?.getRememberMe()?this.tokeniseWithClickToPay(e,void 0,t):this.threeDsProcessor?this.threeDsProcessor?.threeDSInvoke(this.container,!1,e=>{Y(),this.log(`[threeDSInvoke], postAuthData`,e),this.tokenise({threeDSServerTransID:e.threeDSServerTransID,fraudCheckResult:t,externalThreeDsData:e.externalThreeDsData})}):this.tokenise({fraudCheckResult:t})}tokenise(e){if(this.log(`[cardProcessor]: tokenise`,e),!this.iframe)return;Bu();let t={status:jl,threeDSServerTransID:e.threeDSServerTransID,fraudCheckResult:e.fraudCheckResult,externalThreeDsData:e.externalThreeDsData,createNetworkToken:this.tokenAuthenticationEnabled||this.createNetworkToken,vault:mc(this.vault),verifyCard:mc(this.verifyCard),email:this.customer?.email,phone:this.customer?.phoneNumber,billingAddress:this.billingAddress||void 0,geolocation:this.geolocation||void 0,metadata:this.metadata};e.clickToPayInfo&&(t.clickToPayInfo={tokenAuthenticationEnabled:this.tokenAuthenticationEnabled,...e.clickToPayInfo}),this.iframe.contentWindow?.postMessage(t,`*`)}tokeniseWithClickToPay(e,t,n){Y(),this.clickToPayProcessor?.checkoutWithNewCard(e.cardNumber,e.expiryDate,e.ccv||``,!0,T(this,`[clickToPayProcessor]: checkoutWithNewCard`,r=>{this.log(`[clickToPayProcessor]: checkoutWithNewCard`,r),r.checkoutActionCode!==`CANCEL`&&(Bu(),this.tokenise({threeDSServerTransID:t,fraudCheckResult:n,clickToPayInfo:{correlationId:r.checkoutResponseData.srcCorrelationId,srcFlowId:r.headers[`x-src-cx-flow-id`],merchantTransactionId:r.headers[`merchant-transaction-id`],ccv:e.ccv||``,digitalCardId:r.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))}),T(this,`[clickToPayProcessor]: checkoutWithNewCard, error`,e=>{this.log(`[clickToPayProcessor]: checkoutWithNewCard, error`,e),Y(),q(this.container,e.message)}))}checkoutWithSecureClickToPayCard(e){Y(),this.clickToPayProcessor?.checkoutWithCard(e,T(this,`[clickToPayProcessor]: secure checkoutWithCard`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithCard`,e),e.checkoutActionCode!==`CANCEL`&&e.checkoutActionCode!==`CHANGE_CARD`&&(Bu(),this.tokenise({clickToPayInfo:{correlationId:e.checkoutResponseData.srcCorrelationId,srcFlowId:e.headers[`x-src-cx-flow-id`],merchantTransactionId:e.headers[`merchant-transaction-id`],digitalCardId:e.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))}),T(this,`[clickToPayProcessor]: secure checkoutWithCard, error`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithCard, error`,e),Y()}))}checkoutWithSecureClickToPayNewCard(e){!e.encryptedCard||!e.cardBrand?(Y(),this.showMessage(`Unable to process Click to Pay card`),this.failureCallback?.({error:`Unable to process Click to Pay card`})):(Y(),this.clickToPayProcessor?.checkoutWithEncryptedNewCard(e.encryptedCard,e.cardBrand,T(this,`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard`,e),e.checkoutActionCode!==`CANCEL`&&(Bu(),this.tokenise({clickToPayInfo:{correlationId:e.checkoutResponseData.srcCorrelationId,srcFlowId:e.headers[`x-src-cx-flow-id`],merchantTransactionId:e.headers[`merchant-transaction-id`],digitalCardId:e.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))}),T(this,`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard, error`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard, error`,e),Y(),q(this.container,e.message)})))}setAmount(e){this.amount=e,this.clickToPayProcessor?.setAmount(e),this.isSecureFlowEnabled()&&this.postSecureMessage(Il,{amount:e}),this.iframe&&this.iframe.contentWindow?.postMessage({status:Vl,amount:e},`*`)}setCurrency(e){this.currency=e,this.clickToPayProcessor?.setCurrency(e),this.isSecureFlowEnabled()&&this.postSecureMessage(Il,{currency:e}),this.iframe&&this.iframe.contentWindow?.postMessage({status:Hl,currency:e},`*`)}setCustomerInfo(e){this.customer={...e},this.clickToPayProcessor?.setCustomerInfo(e),this.isSecureFlowEnabled()&&this.postSecureMessage(Il,{customer:e})}setBillingAddress(e){this.billingAddress={...e},this.isSecureFlowEnabled()&&this.postSecureMessage(Il,{billingAddress:e})}setOrderInfo(e){this.order={...e},this.isSecureFlowEnabled()&&this.postSecureMessage(Il,{order:e})}setGeolocation(e){this.geolocation={...e},this.isSecureFlowEnabled()&&this.postSecureMessage(Il,{geolocation:e})}tokeniseCard(e,t,n,r,i,a,o,s,c){lc(e)?tc(t)?rc(n)?cc(i)?this.httpInvoker?.invoke(Hu(this.apiUrl,e)[Vu.TOKENISE_CARD].url,Hu(this.apiUrl,e)[Vu.TOKENISE_CARD].method,JSON.stringify({paymentInformation:{cardNumber:t,expiryDate:n,ccv:i,cardholder:r,threeDSServerTransID:o||null},vaultCard:!0,vaultExpireSeconds:s?.vault?null:14400,metadata:a,verify:s?.verify,createNetworkToken:s?.createNetworkToken,fraudCheck:c||null,amount:this.amount,currency:this.currency,firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email}),(e,t)=>{this.log(`[tokeniseCardSuccessCallback]`,e,t),Y();let n=JSON.parse(t);this.log(`[tokeniseCardSuccessCallback], data`,n);let r={token:n.tokenId};n.card&&(r.cardDetails={bin:n.card.cardIin,last4:String(n.card.cardNumber).slice(-4),expiryDate:n.card.expiryDate,cardholder:n.card.cardholder,scheme:n.card.iinData?.scheme},r.iinData=n.card.iinData),c&&(r.fraudCheckResult=c),this.successCallback?.(r)},(e,t)=>{this.log(`tokeniseCardFailureCallback`,e,t),Y(),this.failureCallback?.({error:`Unable to tokenise payment information`,body:t})},{providerId:e}):(this.log(`wrong parameter: ccv`),this.failureCallback?.({error:`wrong parameter: ccv`})):(this.log(`wrong parameter: expiryDate`),this.failureCallback?.({error:`wrong parameter: expiryDate`})):(this.log(`wrong parameter: cardNumber`),this.failureCallback?.({error:`wrong parameter: cardNumber`})):(this.log(`missing parameter: providerId`),this.failureCallback?.({error:`missing parameter: providerId`}))}initTokenAuthenticationProcessor(e,t,n,r,i,a){this.log(`[initTokenAuthenticationProcessor]`,{token:e,networkTokenAuthenticateUrl:r,networkTokenOptions:a});let o=(i?.scheme||``).toLowerCase(),s=this.networkTokenProviders.find(e=>e.providerType.toLowerCase()===o);switch(String(s?.providerType).toLowerCase()){case`mastercard`:return new zu(this.log.bind(this),{container:this.container,token:e,networkToken:t,networkTokenData:n,redirectUrl:r,networkTokenProvider:s,environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,networkTokenOptions:a});default:return this.log(`Unsupported network token provider`,o),null}}};d([w],X.prototype,`cleanUp`,null),d([w],X.prototype,`addCard`,null),d([w],X.prototype,`messageHandler`,null),d([w],X.prototype,`setCardDetailsPort`,null),d([w],X.prototype,`closeCardDetailsPort`,null),d([w],X.prototype,`postSecureMessage`,null),d([w],X.prototype,`requestCardDetails`,null),d([w],X.prototype,`handleCardDetailsMessage`,null),d([w],X.prototype,`onSubmit`,null),d([w],X.prototype,`tokenise`,null),d([w],X.prototype,`tokeniseWithClickToPay`,null),d([w],X.prototype,`checkoutWithSecureClickToPayCard`,null),d([w],X.prototype,`checkoutWithSecureClickToPayNewCard`,null),d([w],X.prototype,`setAmount`,null),d([w],X.prototype,`setCurrency`,null),d([w],X.prototype,`setCustomerInfo`,null),d([w],X.prototype,`setBillingAddress`,null),d([w],X.prototype,`setOrderInfo`,null),d([w],X.prototype,`setGeolocation`,null),d([w],X.prototype,`tokeniseCard`,null),d([w],X.prototype,`initTokenAuthenticationProcessor`,null),W();var Uu=P(``);function Wu(){return{errorMessage:Uu,showErrorMessage:e=>{Uu.value=e},hideErrorMessage:()=>{Uu.value=``}}}W(),El(),vl(),_c(),au();var Gu={id:`payfurl-payto-form`,class:`payfurl-form`},Ku={key:0,class:`error text-normal`},qu={class:`row`},Ju={class:`row`},Yu={class:`row`},Xu=[`placeholder`],Zu={key:0,class:`small`},Qu={key:1,class:`error`},$u=L({__name:`PayToForm`,props:{log:{type:Function},clickGate:{type:Function}},emits:[`submit`],setup(e,{emit:t}){let n=e,r=t,i=P({}),{isLoading:a}=vu(),o=P(``),s=P(`PHONE`),c=P(``),l=Uo(()=>s.value===`PHONE`?`0405123456 or 0212341234`:pl(s.value.toLowerCase())),u=P(!0),{errorMessage:d}=Wu();function f(){return i.value.payId=``,s.value===`PHONE`&&(oc(c.value)||(i.value.payId=`Invalid phone number`)),s.value===`EMAIL`&&(sc(c.value)||(i.value.payId=`Invalid email`)),s.value===`ABN`&&(fc(c.value.replace(/ /g,``))||(i.value.payId=`Invalid ABN`)),i.value.payId===``}function p(e){if(e?.data?.status){if(e.data.status===`submit-card-form`){if(n.log?.(`[PayTo]: message "${e.data.status}" received`,e.data),!u.value||(e.stopPropagation(),n.log&&n.log(`[PayTo]: form submit`,{payerName:o.value,payIdType:s.value,payId:c.value}),!f())||n.clickGate()?.()===!1)return;r(`submit`,{payerName:o.value,payIdType:s.value,payId:s.value===`PHONE`?ac(c.value):String(c.value).toLowerCase().replace(/ /g,``)})}e.data.status===`activate`&&e.data.component===`payto`&&(n.log?.(`[PayTo]: message "${e.data.status}" received`,e.data),d.value=``,u.value=!0),e.data.status===`deactivate`&&e.data.component===`payto`&&(n.log?.(`[PayTo]: message "${e.data.status}" received`,e.data),u.value=!1)}}return Ba(()=>{window.addEventListener(`message`,p),window.addEventListener(`keypress`,function(e){e.altKey&&e.code===`KeyP`&&(e.preventDefault(),o.value=`test`,s.value=`ABN`,c.value=`67384721620`)}),window.postMessage({status:Dl},`*`)}),Wa(()=>{window.removeEventListener(`message`,p)}),(e,t)=>(R(),z(`div`,Gu,[Or(U(Tl,null,null,512),[[Ts,F(a)]]),B(`div`,{class:`container-form`,style:Me(`visibility: ${F(a)?`hidden`:`visible`}`)},[F(d)?(R(),z(`div`,Ku,M(F(d)),1)):V(``,!0),B(`div`,qu,[t[3]||=B(`label`,null,`Payer Name`,-1),B(`div`,null,[Or(B(`input`,{type:`text`,maxlength:`100`,placeholder:`Payer Name`,"onUpdate:modelValue":t[0]||=e=>o.value=e},null,512),[[Us,o.value]])])]),B(`div`,Ju,[t[5]||=B(`label`,null,`Payer Id Type`,-1),B(`div`,null,[Or(B(`select`,{"onUpdate:modelValue":t[1]||=e=>s.value=e},[...t[4]||=[B(`option`,{value:`PHONE`},`Phone`,-1),B(`option`,{value:`EMAIL`},`Email`,-1),B(`option`,{value:`ABN`},`Abn`,-1)]],512),[[Ws,s.value]])])]),B(`div`,Yu,[t[6]||=B(`label`,null,` Pay Id `,-1),B(`div`,null,[Or(B(`input`,{type:`text`,maxlength:`100`,placeholder:l.value,"onUpdate:modelValue":t[2]||=e=>c.value=e,onKeyup:f},null,40,Xu),[[Us,c.value]]),s.value===`PHONE`?(R(),z(`div`,Zu,`(mobile or landline with area code)`)):V(``,!0),i.value.payId?(R(),z(`p`,Qu,M(i.value.payId),1)):V(``,!0)])])],4)]))}});K();var ed=G($u,[[`__scopeId`,`data-v-3e5bba92`]]);W(),El();var td={id:`payfurl-payto-agreement`,class:`payfurl-form`},nd=L({__name:`PayToAgreement`,props:{debug:{type:Boolean}},setup(e){return(e,t)=>(R(),z(`div`,td,[U(Tl),t[0]||=B(`div`,{class:`message`},`Approve the agreement in your banking app`,-1)]))}});K();var rd=G(nd,[[`__scopeId`,`data-v-f90fa6e7`]]);_e(),_c(),$s(),tl(),fl(),vl();var id={TOKENISE:`TOKENISE`,TOKEN_STATUS:`TOKEN_STATUS`},ad=(e,t)=>({[id.TOKENISE]:{url:e+`/token/payto`,method:`POST`},[id.TOKEN_STATUS]:{url:e+`/token/`+t,method:`GET`}}),od=class{container=null;log;apiUrl=``;options=null;providerId=``;tokenId=``;checkAgreementHandler=null;failureCallback=null;successCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){this.container?.id===e?.id&&this.destroy?.()}addPayTo(e,t,n,r){if(this.log(`[addPayTo]`,{amount:t,providerId:n,options:r}),this.container=e,this.providerId=n,this.options=r,this.options.metadata=J(r?.metadata),!uc(t))throw q(e,`Invalid amount: `+t),TypeError(`invalid amount: `+t);if(!String(r.description).trim())throw q(e,`Invalid description`),TypeError(`invalid description`);if(r.maximumAmount||=1e3,r.maximumAmount<0||r.maximumAmount>9999)throw q(e,`Invalid maximum amount: `+r.maximumAmount),TypeError(`invalid maximumAmount: `+r.maximumAmount);let i=Qs({el:this.container,component:ed,props:{el:this.container,log:this.log,clickGate:this.getOnValidate.bind(this)},on:{submit:T(this,`[PayTo]: submit`,e=>{this.log(`[PayTo]: submit payto form`,e),vu().startLoading(),setTimeout(()=>{this.tokenise(e)},500)})}});this.destroy=i.destroy}tokenise(e){let t={payerName:e.payerName,description:this.options?.description,maximumAmount:this.options?.maximumAmount,providerId:this.providerId,payerPayIdDetails:{payIdType:e.payIdType.toUpperCase(),payId:e.payId},metadata:this.options?.metadata};this.httpInvoker?.invoke(ad(this.apiUrl)[id.TOKENISE].url,ad(this.apiUrl)[id.TOKENISE].method,JSON.stringify(t),this.successPayToHandler.bind(this),this.failurePayToHandler.bind(this))}successPayToHandler=T(this,`[PayTo][tokenise][successPayToHandler]`,(e,t)=>{this.log(`successPayToHandler`,e,t);let n=JSON.parse(t);if(!n||!n?.tokenId)return this.failurePayToHandler(e,t);this.tokenId=n.tokenId,Qs({el:this.container,component:rd,props:{el:this.container,log:this.log}}),this.checkAgreement()});failurePayToHandler=T(this,`[PayTo][tokenise][failurePayToHandler]`,(e,t)=>{this.log(`failurePayToHandler`,e,t),vu().stopLoading(),Wu().showErrorMessage(`Invalid payment details`)});failurePayToAgreementHandler=T(this,`[PayTo][tokenise][failurePayToAgreementHandler]`,(e,t)=>{vu().stopLoading(),this.log(`failurePayToAgreementHandler`,e,t),q(this.container,`Agreement has been canceled`),this.failureCallback?.({error:`Agreement has been canceled`,body:t})});successPayToAgreementHandler(){vu().stopLoading(),this.log(`success agreement`,this.tokenId),el(this.container,`PayTo Agreement Approved`),this.successCallback?.({token:this.tokenId})}checkAgreement(){this.checkAgreementHandler||=setInterval(this.checkAgreement.bind(this),5e3),this.httpInvoker?.invoke(ad(this.apiUrl,this.tokenId)[id.TOKEN_STATUS].url,ad(this.apiUrl,this.tokenId)[id.TOKEN_STATUS].method,{},T(this,`[checkAgreement], success`,(e,t)=>{this.log(`checkAgreement`,e,t);let n=JSON.parse(t);if(!n)return clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(e,t);if(n.payToStatus!==`PENDING`)return n.payToStatus===`ACTIVE`?(clearInterval(this.checkAgreementHandler),this.successPayToAgreementHandler()):(clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(e,``))}),T(this,`[checkAgreement], failure`,(e,t)=>(this.log(`checkAgreement`,e,t),clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(e,t))))}};d([w],od.prototype,`cleanUp`,null),d([w],od.prototype,`addPayTo`,null),d([w],od.prototype,`tokenise`,null),d([w],od.prototype,`successPayToAgreementHandler`,null),d([w],od.prototype,`checkAgreement`,null);var Z;(function(e){e.AZUPAY=`azupay`,e.SHIFT=`shift`,e.PAYGLOCAL=`payglocal`,e.PESAPAL=`pesapal`,e.ADDI=`addi`,e.AFFIRM=`affirm`,e.AFTERPAY=`afterpay`,e.ALMA=`alma`,e.APLAZAME=`aplazame`,e.APLAZO=`aplazo`,e.ATOME=`atome`,e.BILLEASE=`billease`,e.CASHEW=`cashew`,e.CASHPRESSO=`cashpresso`,e.CLEARPAY=`clearpay`,e.CLEO=`cleo`,e.DANA=`dana`,e.EASYPAISA=`easypaisa`,e.FINVERO=`finvero`,e.FUPAY=`fupay`,e.GCASG=`gcasg`,e.GRABPAY=`grabpay`,e.HUMM=`humm`,e.KAKAOPAY=`kakaopay`,e.KLARNA=`klarna`,e.KUESKIPAY=`kueskipay`,e.LARA=`lara`,e.LATITUDEPAY=`latitudepay`,e.LAYBUY=`laybuy`,e.LIMEPAY=`limepay`,e.PACE=`pace`,e.PAGALEVE=`pagaleve`,e.PARIBAS=`paribas`,e.PAYWITHFOUR=`paywithfour`,e.PAYJUSTNOW=`payjustnow`,e.PAYTM=`paytm`,e.PAYBRIGHT=`paybright`,e.PAYFLEX=`payflex`,e.PAYRIGHT=`payright`,e.POSTPAY=`postpay`,e.RATEPAY=`ratepay`,e.RIVERTY=`riverty`,e.SCALAPAY=`scalapay`,e.SEZZLE=`sezzle`,e.SHOPBACK=`shopback`,e.SMARTPAY=`smartpay`,e.SOFINCO=`sofinco`,e.SPLITIT=`splitit`,e.TABBY=`tabby`,e.TAMARA=`tamara`,e.TENDOPAY=`tendopay`,e.TOUCHNGO=`touchngo`,e.TRIPLEA=`triplea`,e.TRUEMONEY=`truemoney`,e.TWISTO=`twisto`,e.UPLIFT=`uplift`,e.VALU=`valu`,e.ZEST=`zest`,e.ZIP=`zip`,e.ZOODPAY=`zoodpay`,e.BKASH=`bkash`,e.ERATY=`eraty`,e.PAYBYACCOUNT=`pay_by_account`,e.UPI=`upi`})(Z||={});var sd={[Z.AZUPAY]:{name:`PayID`,description:``,buttonTitle:`Pay with PayID`,icon:`PayId`},[Z.SHIFT]:{name:`Shift`,description:``,buttonTitle:`Pay with Shift`,icon:`Shift`},[Z.PAYGLOCAL]:{name:`PayGLocal`,description:``,buttonTitle:`Pay with PayGLocal`,icon:`PayGLocal`},[Z.PESAPAL]:{name:`PesaPal`,description:``,buttonTitle:`Pay with PesaPal`,icon:`Pesapal`},[Z.PAYBYACCOUNT]:{name:`Pay By Account`,description:``,buttonTitle:`Pay with Pay By Account`,icon:`PayByAccount`},[Z.UPI]:{name:`UPI`,description:``,buttonTitle:`Pay with UPI`,icon:`Upi`},[Z.ADDI]:{name:`Addi`,description:``,buttonTitle:`Pay with Addi`,icon:`Addi`},[Z.AFFIRM]:{name:`Affirm`,description:``,buttonTitle:`Pay with Affirm`,icon:`Affirm`},[Z.AFTERPAY]:{name:`Afterpay`,description:``,buttonTitle:`Pay with Afterpay`,icon:`Afterpay`},[Z.ALMA]:{name:`Alma`,description:``,buttonTitle:`Pay with Alma`,icon:`Alma`},[Z.APLAZAME]:{name:`Aplazame`,description:``,buttonTitle:`Pay with Aplazame`,icon:`Aplazame`},[Z.APLAZO]:{name:`Aplazo`,description:``,buttonTitle:`Pay with Aplazo`,icon:`Aplazo`},[Z.ATOME]:{name:`Atome`,description:``,buttonTitle:`Pay with Atome`,icon:`Atome`},[Z.BILLEASE]:{name:`Billease`,description:``,buttonTitle:`Pay with Billease`,icon:`Billease`},[Z.CASHEW]:{name:`Cashew`,description:``,buttonTitle:`Pay with Cashew`,icon:`Cashew`},[Z.CASHPRESSO]:{name:`Cashpresso`,description:``,buttonTitle:`Pay with Cashpresso`,icon:`Cashpresso`},[Z.CLEARPAY]:{name:`Clearpay`,description:``,buttonTitle:`Pay with Clearpay`,icon:`Clearpay`},[Z.CLEO]:{name:`Cleo`,description:``,buttonTitle:`Pay with Cleo`,icon:`Cleo`},[Z.DANA]:{name:`Dana`,description:``,buttonTitle:`Pay with Dana`,icon:`Dana`},[Z.EASYPAISA]:{name:`Easypaisa`,description:``,buttonTitle:`Pay with Easypaisa`,icon:`Easypaisa`},[Z.FINVERO]:{name:`Finvero`,description:``,buttonTitle:`Pay with Finvero`,icon:`Finvero`},[Z.FUPAY]:{name:`FuPay`,description:``,buttonTitle:`Pay with FuPay`,icon:`Fupay`},[Z.GCASG]:{name:`GCasg`,description:``,buttonTitle:`Pay with GCasg`,icon:`Gcasg`},[Z.GRABPAY]:{name:`GrabPay`,description:``,buttonTitle:`Pay with GrabPay`,icon:`Grabpay`},[Z.HUMM]:{name:`Humm`,description:``,buttonTitle:`Pay with Humm`,icon:`Humm`},[Z.KAKAOPAY]:{name:`KakaoPay`,description:``,buttonTitle:`Pay with KakaoPay`,icon:`Kakaopay`},[Z.KLARNA]:{name:`Klarna`,description:``,buttonTitle:`Pay with Klarna`,icon:`Klarna`},[Z.KUESKIPAY]:{name:`KueskiPay`,description:``,buttonTitle:`Pay with KueskiPay`,icon:`Kueskipay`},[Z.LARA]:{name:`Lara`,description:``,buttonTitle:`Pay with Lara`,icon:`Lara`},[Z.LATITUDEPAY]:{name:`LatitudePay`,description:``,buttonTitle:`Pay with LatitudePay`,icon:`Latitudepay`},[Z.LAYBUY]:{name:`Laybuy`,description:``,buttonTitle:`Pay with Laybuy`,icon:`Laybuy`},[Z.LIMEPAY]:{name:`Limepay`,description:``,buttonTitle:`Pay with Limepay`,icon:`Limepay`},[Z.PACE]:{name:`Pace`,description:``,buttonTitle:`Pay with Pace`,icon:`Pace`},[Z.PAGALEVE]:{name:`Pagaleve`,description:``,buttonTitle:`Pay with Pagaleve`,icon:`Pagaleve`},[Z.PARIBAS]:{name:`BNP Paribas`,description:``,buttonTitle:`Pay with BNP Paribas`,icon:`Paribas`},[Z.PAYWITHFOUR]:{name:`Pay With Four`,description:``,buttonTitle:`Pay with Pay With Four`,icon:`Paywithfour`},[Z.PAYJUSTNOW]:{name:`PayJustNow`,description:``,buttonTitle:`Pay with PayJustNow`,icon:`Payjustnow`},[Z.PAYTM]:{name:`PayTM`,description:``,buttonTitle:`Pay with PayTM`,icon:`Paytm`},[Z.PAYBRIGHT]:{name:`Paybright`,description:``,buttonTitle:`Pay with Paybright`,icon:`Paybright`},[Z.PAYFLEX]:{name:`Payflex`,description:``,buttonTitle:`Pay with Payflex`,icon:`Payflex`},[Z.PAYRIGHT]:{name:`Payright`,description:``,buttonTitle:`Pay with Payright`,icon:`Payright`},[Z.POSTPAY]:{name:`Postpay`,description:``,buttonTitle:`Pay with Postpay`,icon:`Postpay`},[Z.RATEPAY]:{name:`Ratepay`,description:``,buttonTitle:`Pay with Ratepay`,icon:`Ratepay`},[Z.RIVERTY]:{name:`Riverty`,description:``,buttonTitle:`Pay with Riverty`,icon:`Riverty`},[Z.SCALAPAY]:{name:`Scalapay`,description:``,buttonTitle:`Pay with Scalapay`,icon:`Scalapay`},[Z.SEZZLE]:{name:`Sezzle`,description:``,buttonTitle:`Pay with Sezzle`,icon:`Sezzle`},[Z.SHOPBACK]:{name:`ShopBack`,description:``,buttonTitle:`Pay with ShopBack`,icon:`Shopback`},[Z.SMARTPAY]:{name:`Smartpay`,description:``,buttonTitle:`Pay with Smartpay`,icon:`Smartpay`},[Z.SOFINCO]:{name:`Sofinco`,description:``,buttonTitle:`Pay with Sofinco`,icon:`Sofinco`},[Z.SPLITIT]:{name:`Splitit`,description:``,buttonTitle:`Pay with Splitit`,icon:`Splitit`},[Z.TABBY]:{name:`Tabby`,description:``,buttonTitle:`Pay with Tabby`,icon:`Tabby`},[Z.TAMARA]:{name:`Tamara`,description:``,buttonTitle:`Pay with Tamara`,icon:`Tamara`},[Z.TENDOPAY]:{name:`Tendopay`,description:``,buttonTitle:`Pay with Tendopay`,icon:`Tendopay`},[Z.TOUCHNGO]:{name:`Touch'n Go`,description:``,buttonTitle:`Pay with Touch'n Go`,icon:`Touchngo`},[Z.TRIPLEA]:{name:`Triple-A`,description:``,buttonTitle:`Pay with Triple-A`,icon:`Triplea`},[Z.TRUEMONEY]:{name:`TrueMoney`,description:``,buttonTitle:`Pay with TrueMoney`,icon:`Truemoney`},[Z.TWISTO]:{name:`Twisto`,description:``,buttonTitle:`Pay with Twisto`,icon:`Twisto`},[Z.UPLIFT]:{name:`Uplift`,description:``,buttonTitle:`Pay with Uplift`,icon:`Uplift`},[Z.VALU]:{name:`ValU`,description:``,buttonTitle:`Pay with ValU`,icon:`Valu`},[Z.ZEST]:{name:`Zest Money`,description:``,buttonTitle:`Pay with Zest Money`,icon:`Zest`},[Z.ZIP]:{name:`Zip`,description:``,buttonTitle:`Pay with Zip`,icon:`Zip`},[Z.ZOODPAY]:{name:`Zoodpay`,description:``,buttonTitle:`Pay with Zoodpay`,icon:`Zoodpay`},[Z.BKASH]:{name:`bKash`,description:``,buttonTitle:`Pay with bKash`,icon:`Bkash`},[Z.ERATY]:{name:`eRaty`,description:``,buttonTitle:`Pay with eRaty`,icon:`Eraty`}},cd=o((()=>{}));function ld(e,t){return R(),z(`svg`,dd,[...t[0]||=[B(`polygon`,{points:`39 10.44 37.56 9 24 22.56 10.44 9 9 10.44 22.56 24 9 37.56 10.44 39 24 25.44 37.56 39 39 37.56 25.44 24 39 10.44`},null,-1)]])}var ud,dd,fd,pd=o((()=>{W(),cd(),K(),ud={},dd={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 48 48`},fd=G(ud,[[`render`,ld],[`__scopeId`,`data-v-d7e8386b`]])}));W(),pd();var md={class:`modal-header`},hd={class:`main-title`},gd={class:`modal-body`},_d={key:0,class:`modal-footer`},vd=L({__name:`Modal`,props:{width:{},height:{},mode:{},backdrop:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t;function i(){r(`close`)}function a(){n.backdrop!==`static`&&i()}let o=ni(),s=Uo(()=>!!o.footer),c=Uo(()=>{let e=[];return n.width&&e.push(`width: ${n.width}`),n.height&&e.push(`height: ${n.height}`),e.join(`;`)}),l=Uo(()=>n.mode==`confirm`?`small`:``);return(e,t)=>(R(),z(`div`,{class:`modal-mask`,onMousedown:qs(a,[`self`])},[B(`div`,{class:Pe([`modal-wrapper`,l.value]),role:`document`,onClick:t[0]||=qs(()=>{},[`stop`])},[B(`div`,{class:`modal-content`,style:Me(c.value)},[B(`div`,md,[B(`div`,{class:`close-icon`,onClick:qs(i,[`stop`])},[U(fd,{size:15})]),B(`div`,hd,[ei(e.$slots,`title`,{},void 0,!0)])]),B(`div`,gd,[ei(e.$slots,`body`,{},void 0,!0)]),s.value?(R(),z(`div`,_d,[ei(e.$slots,`footer`,{},void 0,!0)])):V(``,!0),ei(e.$slots,`default`,{},void 0,!0)],4)],2)],32))}});K();var yd=G(vd,[[`__scopeId`,`data-v-2b2c8fc7`]]);W();var bd=[`src`],xd=L({__name:`CheckoutPopup`,props:{url:{},name:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=P(n.url);return Mr(()=>n.url,e=>{i.value=e}),Ba(()=>{}),(t,n)=>(R(),Yi(yd,{width:`80vw`,height:`80vh`,backdrop:`static`,onClose:n[0]||=e=>r(`close`)},{title:Dr(()=>[ta(M(e.name),1)]),body:Dr(()=>[B(`iframe`,{src:i.value,sandbox:`allow-same-origin allow-scripts allow-popups allow-forms`},null,8,bd)]),_:1}))}});K();var Sd=G(xd,[[`__scopeId`,`data-v-630d3092`]]);W(),El(),au(),_c();var Cd=[`id`],wd={key:0,class:`error text-normal`},Td={class:`row`},Ed={key:1,class:`error`},Dd=L({__name:`CheckoutForm`,props:{log:{type:Function},providerType:{},options:{},clickGate:{type:Function}},emits:[`activate`,`popup`,`popupClose`,`close`,`newWindow`,`newWindowClose`],setup(e,{emit:t}){let n=e,r=t,i=P(null),{isLoading:a}=vu(),o=P(!0),s=P(n.providerType),c=P(``),l=P(!!n.options.checkoutOptions?.newWindow),u=null,d=P(null),{errorMessage:f}=Wu(),p=Uo(()=>sd[s.value]?.buttonTitle||`Pay with ${s.value}`),m=Uo(()=>{let e=d.value?.gatewayTransactionData?.RedirectUrl||``;return!e||!hc(e)?``:l.value?e:`${e}${e.includes(`?`)?`&`:`?`}embedded=true`}),h=P(!1),g=P(!1),_=Uo(()=>m.value&&!h.value&&!g.value);function v(e){if(e?.data?.status){if(e.data.status===`activate`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),o.value=!0,r(`activate`,n.options)),e.data.status===`deactivate`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),o.value=!1),e.data.status===`checkout-ready`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),f.value=``,d.value=e.data.checkoutData,n.log?.(`[BNPL]: checkout`,d.value),window.postMessage({status:Dl},`*`)),e.data.status===`message`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),c.value=e.data.message,g.value=!1,h.value=!1),e.data.status===`error`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),c.value=e.data.error,e.data.originalError)){let t=JSON.parse(e.data.originalError);t?.message&&(c.value=t.message)}e.data.status===`redirect`&&e.data.component===`checkout`&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),h.value=!1,e.data.result===`failed`&&(c.value=`Payment has been canceled`,b())),e.data.component===`checkout`&&e.data.providerType===Z.PAYBYACCOUNT&&(e.data.status===`failure`?(n.log?.(`[BNPL][PayByAccount]: message received`,e.data),c.value=e.data.error,r(`newWindowClose`)):e.data.status===`success`&&(n.log?.(`[BNPL][PayByAccount]: message received`,e.data),f.value=``))}}function y(){if(c.value=``,n.clickGate()?.()!==!1){if(l.value){let e=`maxTouchPoints`in navigator&&navigator.maxTouchPoints>0?791:637,t=window.screenLeft===void 0?window.screenX:window.screenLeft,n=window.screenTop===void 0?window.screenY:window.screenTop,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,o=i/window.screen.availWidth,s=(i-400)/2/o+t,c=(a-e)/2/o+n;u=window.open(m.value,`_blank`,`popup=yes,
|
|
130
|
+
left=${o}`))}modalHide(){this.modal&&(Bu(),this.modal.close())}updateToken(e){if(this.log(`[MastercardTokenAuthenticationProcessor][updateToken]`,e),!e.assuranceData?.verificationData.length){this.modalHide(),this.onFailureCallback?.({error:`Verification data is empty`});return}if(!this.token){this.log(`[MastercardTokenAuthenticationProcessor]: No need to update token`),this.modalHide(),this.onSuccessCallback?.(e);return}let t=e.assuranceData.verificationData[0];this.httpInvoker?.invoke(Hu(this.apiUrl,this.token)[Vu.UPDATE].url,Hu(this.apiUrl,this.token)[Vu.UPDATE].method,JSON.stringify({VerificationType:t.verificationType,VerificationEntity:t.verificationEntity,VerificationMethod:t.verificationMethod,VerificationResults:t.verificationResults,VerificationTimestamp:t.verificationTimestamp,AdditionalData:t.additionalData,VerificationEvents:JSON.stringify(t.verificationEvents)}),T(this,`[MastercardTokenAuthenticationProcessor][updateToken]: successCallback`,(t,n)=>{this.log(`[MastercardTokenAuthenticationProcessor][updateToken]: successCallback`,t,n),this.modalHide(),this.onSuccessCallback?.(e)}),T(this,`[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback`,(e,t)=>{this.log(`[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback`,e,t),this.modalHide(),this.onFailureCallback?.({error:`Unknown error`})}))}};d([w],Uu.prototype,`invoke`,null),d([w],Uu.prototype,`messageHandler`,null),d([w],Uu.prototype,`authenticate`,null),d([w],Uu.prototype,`init`,null),d([w],Uu.prototype,`initCss`,null),d([w],Uu.prototype,`modalShow`,null),d([w],Uu.prototype,`modalHide`,null),d([w],Uu.prototype,`updateToken`,null),vc(),ec(),nl(),_e(),pl(),yl(),Y(),mu();var{hideSpinner:X,showSpinner:Wu}=fu(),Gu={TOKENISE_CARD:`TOKENISE_CARD`,GET_PROVIDER_INFO:`GET_PROVIDER_INFO`},Ku=(e,t,n)=>({[Gu.TOKENISE_CARD]:{url:e+`/token/card`,method:`POST`},[Gu.GET_PROVIDER_INFO]:{url:e+`/info/providers/`+t,method:`GET`}}),qu=class extends Lu{container=null;iframe=null;form=null;debug=!1;environment;apiUrl=``;url=``;secureUrl=``;version=``;publicKey=``;customer=null;threeDSEmail=``;billingAddress=null;order=null;geolocation=null;amount=0;currency=``;createNetworkToken=!1;vault;verifyCard;metadata;userSuccessMessage=ou;threeDSEnabled=!1;threeDsProcessor=null;secondaryThreeDsProcessor=null;fraudProcessor=null;clickToPayProcessor=null;tokenAuthenticationEnabled=!1;networkTokenProviders=[];networkTokenOptions={};failureCallback=null;successCallback=null;validationStatusChangeCallback=null;threeDsProgressCallback=null;userOnValidate;httpInvoker;destroy=()=>{};cardDetailsPort=null;secureWindow=null;secureOrigin=``;secureReady=!1;secureEnabled=!1;secureFallback=!1;secureConfig=null;boundMessageHandler;isMessageListenerAttached=!1;constructor(e,t){super(e),this.debug=t.debug,this.environment=t.environment,this.url=t.url,this.apiUrl=t.apiUrl,this.secureUrl=t.secureUrl,this.version=t.version,this.publicKey=t.publicKey,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null,this.validationStatusChangeCallback=t.onValidationStatusChangeCallback||null,this.threeDsProgressCallback=t.onThreeDsProgress||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(this.publicKey,t.version,n),this.boundMessageHandler=this.messageHandler.bind(this),this.attachMessageListener()}attachMessageListener(){this.isMessageListenerAttached||=(window.addEventListener(`message`,this.boundMessageHandler),!0)}detachMessageListener(){this.isMessageListenerAttached&&=(window.removeEventListener(`message`,this.boundMessageHandler),!1)}addThreeDsProcessor(e){this.threeDsProcessor=e}addSecondaryThreeDsProcessor(e){this.secondaryThreeDsProcessor=e}addFraudProcessor(e){this.fraudProcessor=e}addClickToPayProcessor(e){this.clickToPayProcessor=e}setSuccessMessage(e){this.userSuccessMessage=e}getSuccessMessage(){return this.userSuccessMessage}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){e?.id===this.container?.id&&(this.destroy?.(),this.container=null,this.form=null,this.iframe=null,this.closeCardDetailsPort(),this.secureReady=!1,this.secureEnabled=!1,this.secureFallback=!1,this.secureConfig=null,this.secureOrigin=``,this.secureWindow=null,this.detachMessageListener())}getEmail(){return this.customer?.email||this.threeDSEmail}getCustomerWithEmail(){let e=this.getEmail();return e?{...this.customer||{},email:e}:this.customer}addCard(e,t,n,r,i,a){this.log(`[addCard]`,{providerId:n,amount:r,currency:i,options:a}),this.attachMessageListener(),a?.createNetworkToken&&!a?.tokenAuthenticationEnabled&&(a.clickToPayEnabled=!1),a?.clickToPayEnabled&&this.clickToPayProcessor&&(a.threeDSEnabled=!1),this.secureFallback=!1,this.secureReady=!1,this.secureEnabled=!!a?.secureCardOrchestration?.enabled,this.threeDSEmail=a?.threeDSEmail||``;let o=this.getEmail();this.amount=r,this.currency=i,this.vault=hc(a?.vault),this.verifyCard=hc(a?.verifyCard),this.metadata=ku(a?.metadata),this.fraudProcessor&&(this.fraudProcessor.setAmount(r),this.fraudProcessor.setCurrency(i)),this.threeDsProcessor&&(this.threeDsProcessor.setEmail(o),this.threeDsProcessor.setAmount(r),this.threeDsProcessor.setCurrency(i),this.threeDsProcessor.setClientParameters(a?.clientParameters||{})),a?.threeDSEnabled&&(fc(r,uc,`Missing or invalid amount`,this.failureCallback),fc(i,al,`Missing or invalid currency`,this.failureCallback),this.threeDSEnabled=!0);let s=Object.keys(a?.networkTokenOptions||{}).length?a?.networkTokenOptions:a?.clickToPayOptions?.networkTokenOptions;a?.clickToPayEnabled&&this.clickToPayProcessor&&(this.clickToPayProcessor.setAmount(r),this.clickToPayProcessor.setCurrency(i),this.clickToPayProcessor.setCustomerInfo({...this.customer||{},email:o},!0),this.clickToPayProcessor.setOptions({...a?.clickToPayOptions,dpaId:a?.clickToPayOptions?.dpaId||``,tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,networkTokenOptions:s}),this.clickToPayProcessor.setContainer(e),this.clickToPayProcessor.init(),this.clickToPayProcessor.start()),!a?.clickToPayEnabled&&this.clickToPayProcessor&&this.clickToPayProcessor.isInitialized()&&this.clickToPayProcessor.stopUsing(),this.createNetworkToken=!!a?.createNetworkToken,this.tokenAuthenticationEnabled=!!a?.tokenAuthenticationEnabled,this.networkTokenProviders=a?.networkTokenProviders||[],this.networkTokenOptions=a?.networkTokenOptions||{},this.container=e||null,this.form=t;let c=$s({el:this.container,component:Iu,props:{log:this.log,iframeSrc:this.url,form:this.form,threeDSEnabled:this.threeDSEnabled,clickGate:this.getOnValidate.bind(this)},on:{load:T(this,`[addCard], onload`,e=>{this.iframe=e;let t=this.secureEnabled?{...a?.secureCardOrchestration,enabled:!0,secureUrl:this.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.apiUrl,version:this.version,amount:this.amount,currency:this.currency,metadata:this.metadata||{},billingAddress:this.billingAddress||null,customer:this.getCustomerWithEmail(),order:this.order||null,geolocation:this.geolocation||null,clickToPay:a?.clickToPayEnabled&&this.clickToPayProcessor?{enabled:!0,rememberMe:this.clickToPayProcessor.getRememberMe(),tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,options:{...a?.clickToPayOptions,dpaId:a?.clickToPayOptions?.dpaId||``,tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,networkTokenOptions:s}}:void 0}:null;this.secureConfig=t;let o={status:Al,environment:this.environment,debug:this.debug,publicKey:this.publicKey,providerId:n,apiUrl:this.apiUrl,amount:r,currency:i,vault:hc(a?.vault),verifyCard:hc(a?.verifyCard),showEmail:a?.threeDSEnabled&&!cc(this.getEmail()),visProviderId:a?.visProviderId,requiredFields:a?.requiredFields,clickToPayEnabled:a?.clickToPayEnabled,clickToPayOptions:a?.clickToPayOptions,secureCardOrchestration:t,style:a?.style||`compact`};if(this.closeCardDetailsPort(),!this.isSecureFlowEnabled()&&typeof MessageChannel<`u`){let t=new MessageChannel;this.setCardDetailsPort(t.port1),e?.contentWindow?.postMessage(o,`*`,[t.port2])}else e?.contentWindow?.postMessage(o,`*`);this.customer?.phoneNumber&&!sc(String(this.customer?.phoneNumber))&&this.getCardFormFrame()?.contentWindow?.postMessage({status:ru,message:`Invalid phone number`},`*`)}),submit:T(this,`[addCard], onsubmit`,()=>{this.log(`[CardProcessor]: submit event`),Wu(),this.requestCardDetails()})}});return this.destroy=c.destroy,this}messageHandler(e){if(e?.data?.status){if(e.data.status===`secure-orchestrator-ready`&&this.isTrustedSecureMessage(e))this.secureReady=!0;else if(e.data.status===`secure-orchestrator-tokenise`&&this.isTrustedSecureMessage(e)){let t=e.data.message||{};this.tokenise({threeDSServerTransID:t.threeDSServerTransID,fraudCheckResult:t.fraudCheckResult,externalThreeDsData:t.externalThreeDsData})}else if(e.data.status===`secure-orchestrator-three-ds-progress`&&this.isTrustedSecureMessage(e))this.threeDsProgressCallback?.(e.data.progress);else if(e.data.status===`secure-orchestrator-click-to-pay-card`&&this.isTrustedSecureMessage(e))this.checkoutWithSecureClickToPayCard(e.data.message||{});else if(e.data.status===`secure-orchestrator-click-to-pay-new-card`&&this.isTrustedSecureMessage(e))this.checkoutWithSecureClickToPayNewCard(e.data.message||{});else if(e.data.status===`secure-orchestrator-failure`&&this.isTrustedSecureMessage(e)){this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),X();let t=e.data.error||`Unable to process payment details`;this.showMessage(t);let n=typeof e.data.reason==`string`?e.data.reason:``;this.failureCallback?.({error:t,...n&&{errorDetails:{reason:n}}})}else if(e.data.status===`hide-spinner`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),X();else if(e.data.status===`show-spinner`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),Wu();else if(e.data.status===`card-form-validation-error`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),X(),this.failureCallback?.({error:e.data.message});else if(e.data.status===`card-form-validation-status-change`)this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),X(),this.validationStatusChangeCallback?.(e.data.message?.status,e.data.message?.message);else if(e.data.status===`tokenise-card-failure`){if(this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),X(),e.data.message===`3D Secure required`&&this.isSecureFlowEnabled()){this.postSecureMessage(Ll);return}if(e.data.message===`3D Secure required`&&this.secondaryThreeDsProcessor){this.secondaryThreeDsProcessor?.threeDSInvoke(this.container,!0,e=>{X(),this.log(`[threeDSInvoke], postAuthData`,e),this.tokenise({threeDSServerTransID:e.threeDSServerTransID,externalThreeDsData:e.externalThreeDsData})});return}this.showMessage(e.data.message),this.failureCallback?.({error:e.data.message,body:e.data.body})}else if(e.data.status===`tokenise-card-success`){this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`,e.data),e.stopPropagation(),this.iframe=null;let t={token:e.data.tokenId};if(e.data.options?.cardDetails&&(t.cardDetails=e.data.options?.cardDetails),e.data.options?.iinData&&(t.iinData=e.data.options?.iinData),e.data.options?.clickToPay&&(t.clickToPayData={billingAddress:e.data.options?.clickToPay.billingAddress,panBin:e.data.options?.clickToPay?.cardData?.panBin||``,panLastFour:e.data.options?.clickToPay?.cardData?.panLastFour||``,scheme:e.data.options?.clickToPay?.cardData?.scheme||``,paymentCardType:e.data.options?.clickToPay?.cardData?.paymentCardType||``}),this.tokenAuthenticationEnabled&&e.data.options?.networkTokenAuthenticateUrl&&e.data.options?.networkToken){let n=this.initTokenAuthenticationProcessor(e.data.tokenId,e.data.options.networkToken,e.data.options?.networkTokenData,e.data.options.networkTokenAuthenticateUrl,e.data.options?.cardDetails,this.networkTokenOptions);if(n){n.invoke(this.amount,this.currency,T(this,`[sdk][cardProcessor], token authentication success`,()=>{this.log(`[sdk][cardProcessor], token authentication success`),X(),tl(this.container,this.getSuccessMessage()),this.successCallback?.(t)}),T(this,`[sdk][cardProcessor], token authentication error`,e=>{X(),this.log(`[sdk][cardProcessor], token authentication error`,e)}));return}}X(),tl(this.container,this.getSuccessMessage()),this.successCallback?.(t)}}}setCardDetailsPort(e){this.closeCardDetailsPort(),this.cardDetailsPort=e,this.cardDetailsPort.onmessage=T(this,`[sdk][cardProcessor]: cardDetailsPort message`,e=>{e?.data?.status&&e.data.status===`card-details`&&this.handleCardDetailsMessage(e.data)})}closeCardDetailsPort(){this.cardDetailsPort&&=(this.cardDetailsPort.onmessage=null,this.cardDetailsPort.close(),null)}postSecureMessage(e,t){this.secureFallback||this.getCardFormFrame()?.contentWindow?.postMessage({status:e,message:t},this.getOriginFromUrl(this.url)||`*`)}getOriginFromUrl(e){try{return new URL(e,window.location.href).origin}catch{return``}}isTrustedSecureMessage(e){let t=this.getCardFormFrame(),n=this.getOriginFromUrl(this.url);return t?.contentWindow&&e.source===t.contentWindow?!n||e.origin===n:!!(this.secureWindow&&this.secureOrigin&&e.source===this.secureWindow&&e.origin===this.secureOrigin)}isSecureFlowEnabled(){return this.secureEnabled&&!this.secureFallback}requestCardDetails(){this.isSecureFlowEnabled()&&!this.secureReady?(X(),this.showMessage(`Secure payment flow is not ready. Please try again.`),this.failureCallback?.({error:`Secure payment flow is not ready`})):this.isSecureFlowEnabled()&&this.secureReady?(this.secureConfig?.clickToPay&&this.clickToPayProcessor&&this.postSecureMessage(Rl,{clickToPay:{...this.secureConfig.clickToPay,rememberMe:this.clickToPayProcessor.getRememberMe()}}),this.postSecureMessage(Il)):this.cardDetailsPort?this.cardDetailsPort.postMessage({status:Pl}):super.requestCardDetails()}handleCardDetailsMessage(e){if(!e?.message)return;this.log(`[sdk][cardProcessor]: "${Fl}" message received`,e);let t=!!(this.clickToPayProcessor?.isEnabled()&&this.clickToPayProcessor?.getRememberMe()),n=!!(this.clickToPayProcessor?.isEnabled()&&e.message.srcDigitalCardId),r=!!(t&&!n&&e.message.cardNumber);if(r&&!this.clickToPayProcessor?.isSchemeSupported(e.message.cardNumber)){this.log(`[clickToPayProcessor]: checkoutWithNewCard - Scheme is not supported!`),X(),this.showMessage(`Please use another card or use an alternative payment method`);return}if(n){X(),this.clickToPayProcessor?.checkoutWithCard(e.message,t=>{this.log(`[clickToPayProcessor]: checkoutWithCard`,t),t.checkoutActionCode!==`CANCEL`&&t.checkoutActionCode!==`CHANGE_CARD`&&(Wu(),this.tokenise({clickToPayInfo:{correlationId:t.checkoutResponseData.srcCorrelationId,srcFlowId:t.headers[`x-src-cx-flow-id`],merchantTransactionId:t.headers[`merchant-transaction-id`],ccv:e.message.ccv,digitalCardId:t.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))},e=>{this.log(`[clickToPayProcessor]: checkoutWithCard, error`,e),X()});return}this.fraudProcessor?.setPaymentInfo({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv}),this.threeDsProcessor?.setPaymentInfo({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv}),this.secondaryThreeDsProcessor?.setPaymentInfo({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv});let i=e.message.email||this.getEmail();i&&(this.threeDsProcessor?.setEmail(i),this.secondaryThreeDsProcessor?.setEmail(i)),this.fraudProcessor&&!(n||r)?(Wu(),this.fraudProcessor.fraudCheck(T(this,`[fraudProcessor][fraudCheck], success`,t=>{Du(t)?(X(),J(this.container,`Payment couldn't be processed`),this.failureCallback?.({error:`Payment couldn't be processed`})):this.onSubmit({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv},t)}),T(this,`[fraudProcessor][fraudCheck], error`,e=>{X(),J(this.container,e.error),this.failureCallback?.(e)}))):this.onSubmit({cardNumber:e.message.cardNumber,expiryDate:e.message.expiryDate,cardholder:e.message.cardholder,ccv:e.message.ccv})}onSubmit(e,t){this.log(`[cardProcessor]: onSubmit`,{cardInfo:{...e,cardNumber:_l(e.cardNumber),ccv:`***`},fraudCheckResult:t}),t?.managedOrderToken?(X(),J(this.container,cu),this.failureCallback?.({error:cu,errorDetails:{reason:`3DS challenge could not be started`}})):this.clickToPayProcessor?.isEnabled()&&this.clickToPayProcessor?.getRememberMe()?this.tokeniseWithClickToPay(e,void 0,t):this.threeDsProcessor?this.threeDsProcessor?.threeDSInvoke(this.container,!1,e=>{X(),this.log(`[threeDSInvoke], postAuthData`,e),this.tokenise({threeDSServerTransID:e.threeDSServerTransID,fraudCheckResult:t,externalThreeDsData:e.externalThreeDsData})}):this.tokenise({fraudCheckResult:t})}tokenise(e){if(this.log(`[cardProcessor]: tokenise`,e),!this.iframe)return;Wu();let t={status:Nl,threeDSServerTransID:e.threeDSServerTransID,fraudCheckResult:e.fraudCheckResult,externalThreeDsData:e.externalThreeDsData,createNetworkToken:this.tokenAuthenticationEnabled||this.createNetworkToken,vault:hc(this.vault),verifyCard:hc(this.verifyCard),email:this.getEmail()||void 0,phone:this.customer?.phoneNumber,billingAddress:this.billingAddress||void 0,geolocation:this.geolocation||void 0,metadata:this.metadata};e.clickToPayInfo&&(t.clickToPayInfo={tokenAuthenticationEnabled:this.tokenAuthenticationEnabled,...e.clickToPayInfo}),this.iframe.contentWindow?.postMessage(t,`*`)}tokeniseWithClickToPay(e,t,n){X(),this.clickToPayProcessor?.checkoutWithNewCard(e.cardNumber,e.expiryDate,e.ccv||``,!0,T(this,`[clickToPayProcessor]: checkoutWithNewCard`,r=>{this.log(`[clickToPayProcessor]: checkoutWithNewCard`,r),r.checkoutActionCode!==`CANCEL`&&(Wu(),this.tokenise({threeDSServerTransID:t,fraudCheckResult:n,clickToPayInfo:{correlationId:r.checkoutResponseData.srcCorrelationId,srcFlowId:r.headers[`x-src-cx-flow-id`],merchantTransactionId:r.headers[`merchant-transaction-id`],ccv:e.ccv||``,digitalCardId:r.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))}),T(this,`[clickToPayProcessor]: checkoutWithNewCard, error`,e=>{this.log(`[clickToPayProcessor]: checkoutWithNewCard, error`,e),X(),J(this.container,e.message)}))}checkoutWithSecureClickToPayCard(e){X(),this.clickToPayProcessor?.checkoutWithCard(e,T(this,`[clickToPayProcessor]: secure checkoutWithCard`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithCard`,e),e.checkoutActionCode!==`CANCEL`&&e.checkoutActionCode!==`CHANGE_CARD`&&(Wu(),this.tokenise({clickToPayInfo:{correlationId:e.checkoutResponseData.srcCorrelationId,srcFlowId:e.headers[`x-src-cx-flow-id`],merchantTransactionId:e.headers[`merchant-transaction-id`],digitalCardId:e.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))}),T(this,`[clickToPayProcessor]: secure checkoutWithCard, error`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithCard, error`,e),X()}))}checkoutWithSecureClickToPayNewCard(e){!e.encryptedCard||!e.cardBrand?(X(),this.showMessage(`Unable to process Click to Pay card`),this.failureCallback?.({error:`Unable to process Click to Pay card`})):(X(),this.clickToPayProcessor?.checkoutWithEncryptedNewCard(e.encryptedCard,e.cardBrand,T(this,`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard`,e),e.checkoutActionCode!==`CANCEL`&&(Wu(),this.tokenise({clickToPayInfo:{correlationId:e.checkoutResponseData.srcCorrelationId,srcFlowId:e.headers[`x-src-cx-flow-id`],merchantTransactionId:e.headers[`merchant-transaction-id`],digitalCardId:e.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/,``)}}))}),T(this,`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard, error`,e=>{this.log(`[clickToPayProcessor]: secure checkoutWithEncryptedNewCard, error`,e),X(),J(this.container,e.message)})))}setAmount(e){this.amount=e,this.clickToPayProcessor?.setAmount(e),this.isSecureFlowEnabled()&&this.postSecureMessage(Rl,{amount:e}),this.iframe&&this.iframe.contentWindow?.postMessage({status:Ul,amount:e},`*`)}setCurrency(e){this.currency=e,this.clickToPayProcessor?.setCurrency(e),this.isSecureFlowEnabled()&&this.postSecureMessage(Rl,{currency:e}),this.iframe&&this.iframe.contentWindow?.postMessage({status:Wl,currency:e},`*`)}setCustomerInfo(e){this.customer={...e},this.clickToPayProcessor?.setCustomerInfo(e);let t=this.getEmail();t&&(this.threeDsProcessor?.setEmail(t),this.secondaryThreeDsProcessor?.setEmail(t)),this.isSecureFlowEnabled()&&this.postSecureMessage(Rl,{customer:this.getCustomerWithEmail()}),this.iframe&&t&&this.iframe.contentWindow?.postMessage({status:Gl,email:t},this.getOriginFromUrl(this.url)||`*`)}setBillingAddress(e){this.billingAddress={...e},this.isSecureFlowEnabled()&&this.postSecureMessage(Rl,{billingAddress:e})}setOrderInfo(e){this.order={...e},this.isSecureFlowEnabled()&&this.postSecureMessage(Rl,{order:e})}setGeolocation(e){this.geolocation={...e},this.isSecureFlowEnabled()&&this.postSecureMessage(Rl,{geolocation:e})}tokeniseCard(e,t,n,r,i,a,o,s,c){uc(e)?nc(t)?ic(n)?lc(i)?this.httpInvoker?.invoke(Ku(this.apiUrl,e)[Gu.TOKENISE_CARD].url,Ku(this.apiUrl,e)[Gu.TOKENISE_CARD].method,JSON.stringify({paymentInformation:{cardNumber:t,expiryDate:n,ccv:i,cardholder:r,threeDSServerTransID:o||null},vaultCard:!0,vaultExpireSeconds:s?.vault?null:14400,metadata:a,verify:s?.verify,createNetworkToken:s?.createNetworkToken,fraudCheck:c||null,amount:this.amount,currency:this.currency,firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email}),(e,t)=>{this.log(`[tokeniseCardSuccessCallback]`,e,t),X();let n=JSON.parse(t);this.log(`[tokeniseCardSuccessCallback], data`,n);let r={token:n.tokenId};n.card&&(r.cardDetails={bin:n.card.cardIin,last4:String(n.card.cardNumber).slice(-4),expiryDate:n.card.expiryDate,cardholder:n.card.cardholder,scheme:n.card.iinData?.scheme},r.iinData=n.card.iinData),c&&(r.fraudCheckResult=c),this.successCallback?.(r)},(e,t)=>{this.log(`tokeniseCardFailureCallback`,e,t),X(),this.failureCallback?.({error:`Unable to tokenise payment information`,body:t})},{providerId:e}):(this.log(`wrong parameter: ccv`),this.failureCallback?.({error:`wrong parameter: ccv`})):(this.log(`wrong parameter: expiryDate`),this.failureCallback?.({error:`wrong parameter: expiryDate`})):(this.log(`wrong parameter: cardNumber`),this.failureCallback?.({error:`wrong parameter: cardNumber`})):(this.log(`missing parameter: providerId`),this.failureCallback?.({error:`missing parameter: providerId`}))}initTokenAuthenticationProcessor(e,t,n,r,i,a){this.log(`[initTokenAuthenticationProcessor]`,{token:e,networkTokenAuthenticateUrl:r,networkTokenOptions:a});let o=(i?.scheme||``).toLowerCase(),s=this.networkTokenProviders.find(e=>e.providerType.toLowerCase()===o);switch(String(s?.providerType).toLowerCase()){case`mastercard`:return new Uu(this.log.bind(this),{container:this.container,token:e,networkToken:t,networkTokenData:n,redirectUrl:r,networkTokenProvider:s,environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,networkTokenOptions:a});default:return this.log(`Unsupported network token provider`,o),null}}};d([w],qu.prototype,`cleanUp`,null),d([w],qu.prototype,`addCard`,null),d([w],qu.prototype,`messageHandler`,null),d([w],qu.prototype,`setCardDetailsPort`,null),d([w],qu.prototype,`closeCardDetailsPort`,null),d([w],qu.prototype,`postSecureMessage`,null),d([w],qu.prototype,`requestCardDetails`,null),d([w],qu.prototype,`handleCardDetailsMessage`,null),d([w],qu.prototype,`onSubmit`,null),d([w],qu.prototype,`tokenise`,null),d([w],qu.prototype,`tokeniseWithClickToPay`,null),d([w],qu.prototype,`checkoutWithSecureClickToPayCard`,null),d([w],qu.prototype,`checkoutWithSecureClickToPayNewCard`,null),d([w],qu.prototype,`setAmount`,null),d([w],qu.prototype,`setCurrency`,null),d([w],qu.prototype,`setCustomerInfo`,null),d([w],qu.prototype,`setBillingAddress`,null),d([w],qu.prototype,`setOrderInfo`,null),d([w],qu.prototype,`setGeolocation`,null),d([w],qu.prototype,`tokeniseCard`,null),d([w],qu.prototype,`initTokenAuthenticationProcessor`,null),G();var Ju=F(``);function Yu(){return{errorMessage:Ju,showErrorMessage:e=>{Ju.value=e},hideErrorMessage:()=>{Ju.value=``}}}G(),Dl(),yl(),vc(),Y();var Xu={id:`payfurl-payto-form`,class:`payfurl-form`},Zu={key:0,class:`error text-normal`},Qu={class:`row`},$u={class:`row`},ed={class:`row`},td=[`placeholder`],nd={key:0,class:`small`},rd={key:1,class:`error`},id=R({__name:`PayToForm`,props:{log:{type:Function},clickGate:{type:Function}},emits:[`submit`],setup(e,{emit:t}){let n=e,r=t,i=F({}),{isLoading:a}=xu(),o=F(``),s=F(`PHONE`),c=F(``),l=Wo(()=>s.value===`PHONE`?`0405123456 or 0212341234`:ml(s.value.toLowerCase())),u=F(!0),{errorMessage:d}=Yu();function f(){return i.value.payId=``,s.value===`PHONE`&&(sc(c.value)||(i.value.payId=`Invalid phone number`)),s.value===`EMAIL`&&(cc(c.value)||(i.value.payId=`Invalid email`)),s.value===`ABN`&&(pc(c.value.replace(/ /g,``))||(i.value.payId=`Invalid ABN`)),i.value.payId===``}function p(e){if(e?.data?.status){if(e.data.status===`submit-card-form`){if(n.log?.(`[PayTo]: message "${e.data.status}" received`,e.data),!u.value||(e.stopPropagation(),n.log&&n.log(`[PayTo]: form submit`,{payerName:o.value,payIdType:s.value,payId:c.value}),!f())||n.clickGate()?.()===!1)return;r(`submit`,{payerName:o.value,payIdType:s.value,payId:s.value===`PHONE`?oc(c.value):String(c.value).toLowerCase().replace(/ /g,``)})}e.data.status===`activate`&&e.data.component===`payto`&&(n.log?.(`[PayTo]: message "${e.data.status}" received`,e.data),d.value=``,u.value=!0),e.data.status===`deactivate`&&e.data.component===`payto`&&(n.log?.(`[PayTo]: message "${e.data.status}" received`,e.data),u.value=!1)}}return za(()=>{window.addEventListener(`message`,p),window.addEventListener(`keypress`,function(e){e.altKey&&e.code===`KeyP`&&(e.preventDefault(),o.value=`test`,s.value=`ABN`,c.value=`67384721620`)}),window.postMessage({status:Ol,paymentMethod:`payto`},`*`)}),Ua(()=>{window.removeEventListener(`message`,p)}),(e,t)=>(z(),B(`div`,Xu,[Dr(W(El,null,null,512),[[Es,I(a)]]),V(`div`,{class:`container-form`,style:Me(`visibility: ${I(a)?`hidden`:`visible`}`)},[I(d)?(z(),B(`div`,Zu,N(I(d)),1)):H(``,!0),V(`div`,Qu,[t[3]||=V(`label`,null,`Payer Name`,-1),V(`div`,null,[Dr(V(`input`,{type:`text`,maxlength:`100`,placeholder:`Payer Name`,"onUpdate:modelValue":t[0]||=e=>o.value=e},null,512),[[Ws,o.value]])])]),V(`div`,$u,[t[5]||=V(`label`,null,`Payer Id Type`,-1),V(`div`,null,[Dr(V(`select`,{"onUpdate:modelValue":t[1]||=e=>s.value=e},[...t[4]||=[V(`option`,{value:`PHONE`},`Phone`,-1),V(`option`,{value:`EMAIL`},`Email`,-1),V(`option`,{value:`ABN`},`Abn`,-1)]],512),[[Gs,s.value]])])]),V(`div`,ed,[t[6]||=V(`label`,null,` Pay Id `,-1),V(`div`,null,[Dr(V(`input`,{type:`text`,maxlength:`100`,placeholder:l.value,"onUpdate:modelValue":t[2]||=e=>c.value=e,onKeyup:f},null,40,td),[[Ws,c.value]]),s.value===`PHONE`?(z(),B(`div`,nd,`(mobile or landline with area code)`)):H(``,!0),i.value.payId?(z(),B(`p`,rd,N(i.value.payId),1)):H(``,!0)])])],4)]))}});q();var ad=K(id,[[`__scopeId`,`data-v-edac356c`]]);G(),Dl();var od={id:`payfurl-payto-agreement`,class:`payfurl-form`},sd=R({__name:`PayToAgreement`,props:{debug:{type:Boolean}},setup(e){return(e,t)=>(z(),B(`div`,od,[W(El),t[0]||=V(`div`,{class:`message`},`Approve the agreement in your banking app`,-1)]))}});q();var cd=K(sd,[[`__scopeId`,`data-v-f90fa6e7`]]);_e(),vc(),ec(),nl(),pl(),yl(),Y();var ld={TOKENISE:`TOKENISE`,TOKEN_STATUS:`TOKEN_STATUS`},ud=(e,t)=>({[ld.TOKENISE]:{url:e+`/token/payto`,method:`POST`},[ld.TOKEN_STATUS]:{url:e+`/token/`+t,method:`GET`}}),dd=class{container=null;log;apiUrl=``;options=null;providerId=``;tokenId=``;checkAgreementHandler=null;failureCallback=null;successCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){this.container?.id===e?.id&&this.destroy?.()}addPayTo(e,t,n,r){this.log(`[addPayTo]`,{amount:t,providerId:n,options:r}),this.container=e,this.providerId=n,this.options=r,this.options.metadata=ku(r?.metadata);let i=t=>{throw J(e,t),window.postMessage({status:kl,paymentMethod:`payto`,reason:`error`,message:t},`*`),TypeError(t)};dc(t)||i(`Invalid amount: `+t),String(r.description).trim()||i(`Invalid description`),r.maximumAmount||=1e3,(r.maximumAmount<0||r.maximumAmount>9999)&&i(`Invalid maximum amount: `+r.maximumAmount);let a=$s({el:this.container,component:ad,props:{el:this.container,log:this.log,clickGate:this.getOnValidate.bind(this)},on:{submit:T(this,`[PayTo]: submit`,e=>{this.log(`[PayTo]: submit payto form`,e),xu().startLoading(),setTimeout(()=>{this.tokenise(e)},500)})}});this.destroy=a.destroy}tokenise(e){let t={payerName:e.payerName,description:this.options?.description,maximumAmount:this.options?.maximumAmount,providerId:this.providerId,payerPayIdDetails:{payIdType:e.payIdType.toUpperCase(),payId:e.payId},metadata:this.options?.metadata};this.httpInvoker?.invoke(ud(this.apiUrl)[ld.TOKENISE].url,ud(this.apiUrl)[ld.TOKENISE].method,JSON.stringify(t),this.successPayToHandler.bind(this),this.failurePayToHandler.bind(this))}successPayToHandler=T(this,`[PayTo][tokenise][successPayToHandler]`,(e,t)=>{this.log(`successPayToHandler`,e,t);let n=JSON.parse(t);if(!n||!n?.tokenId)return this.failurePayToHandler(e,t);this.tokenId=n.tokenId,$s({el:this.container,component:cd,props:{el:this.container,log:this.log}}),this.checkAgreement()});failurePayToHandler=T(this,`[PayTo][tokenise][failurePayToHandler]`,(e,t)=>{this.log(`failurePayToHandler`,e,t),xu().stopLoading(),Yu().showErrorMessage(`Invalid payment details`),this.failureCallback?.({error:`Invalid payment details`,body:t})});failurePayToAgreementHandler=T(this,`[PayTo][tokenise][failurePayToAgreementHandler]`,(e,t)=>{xu().stopLoading(),this.log(`failurePayToAgreementHandler`,e,t),J(this.container,`Agreement has been canceled`),this.failureCallback?.({error:`Agreement has been canceled`,body:t})});successPayToAgreementHandler(){xu().stopLoading(),this.log(`success agreement`,this.tokenId),tl(this.container,`PayTo Agreement Approved`),this.successCallback?.({token:this.tokenId})}checkAgreement(){this.checkAgreementHandler||=setInterval(this.checkAgreement.bind(this),5e3),this.httpInvoker?.invoke(ud(this.apiUrl,this.tokenId)[ld.TOKEN_STATUS].url,ud(this.apiUrl,this.tokenId)[ld.TOKEN_STATUS].method,{},T(this,`[checkAgreement], success`,(e,t)=>{this.log(`checkAgreement`,e,t);let n=JSON.parse(t);if(!n)return clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(e,t);if(n.payToStatus!==`PENDING`)return n.payToStatus===`ACTIVE`?(clearInterval(this.checkAgreementHandler),this.successPayToAgreementHandler()):(clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(e,``))}),T(this,`[checkAgreement], failure`,(e,t)=>(this.log(`checkAgreement`,e,t),clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(e,t))))}};d([w],dd.prototype,`cleanUp`,null),d([w],dd.prototype,`addPayTo`,null),d([w],dd.prototype,`tokenise`,null),d([w],dd.prototype,`successPayToAgreementHandler`,null),d([w],dd.prototype,`checkAgreement`,null);var Z;(function(e){e.AZUPAY=`azupay`,e.SHIFT=`shift`,e.PAYGLOCAL=`payglocal`,e.PESAPAL=`pesapal`,e.ADDI=`addi`,e.AFFIRM=`affirm`,e.AFTERPAY=`afterpay`,e.ALMA=`alma`,e.APLAZAME=`aplazame`,e.APLAZO=`aplazo`,e.ATOME=`atome`,e.BILLEASE=`billease`,e.CASHEW=`cashew`,e.CASHPRESSO=`cashpresso`,e.CLEARPAY=`clearpay`,e.CLEO=`cleo`,e.DANA=`dana`,e.EASYPAISA=`easypaisa`,e.FINVERO=`finvero`,e.FUPAY=`fupay`,e.GCASG=`gcasg`,e.GRABPAY=`grabpay`,e.HUMM=`humm`,e.KAKAOPAY=`kakaopay`,e.KLARNA=`klarna`,e.KUESKIPAY=`kueskipay`,e.LARA=`lara`,e.LATITUDEPAY=`latitudepay`,e.LAYBUY=`laybuy`,e.LIMEPAY=`limepay`,e.PACE=`pace`,e.PAGALEVE=`pagaleve`,e.PARIBAS=`paribas`,e.PAYWITHFOUR=`paywithfour`,e.PAYJUSTNOW=`payjustnow`,e.PAYTM=`paytm`,e.PAYBRIGHT=`paybright`,e.PAYFLEX=`payflex`,e.PAYRIGHT=`payright`,e.POSTPAY=`postpay`,e.RATEPAY=`ratepay`,e.RIVERTY=`riverty`,e.SCALAPAY=`scalapay`,e.SEZZLE=`sezzle`,e.SHOPBACK=`shopback`,e.SMARTPAY=`smartpay`,e.SOFINCO=`sofinco`,e.SPLITIT=`splitit`,e.TABBY=`tabby`,e.TAMARA=`tamara`,e.TENDOPAY=`tendopay`,e.TOUCHNGO=`touchngo`,e.TRIPLEA=`triplea`,e.TRUEMONEY=`truemoney`,e.TWISTO=`twisto`,e.UPLIFT=`uplift`,e.VALU=`valu`,e.ZEST=`zest`,e.ZIP=`zip`,e.ZOODPAY=`zoodpay`,e.BKASH=`bkash`,e.ERATY=`eraty`,e.PAYBYACCOUNT=`pay_by_account`,e.UPI=`upi`})(Z||={});var fd={[Z.AZUPAY]:{name:`PayID`,description:``,buttonTitle:`Pay with PayID`,icon:`PayId`},[Z.SHIFT]:{name:`Shift`,description:``,buttonTitle:`Pay with Shift`,icon:`Shift`},[Z.PAYGLOCAL]:{name:`PayGLocal`,description:``,buttonTitle:`Pay with PayGLocal`,icon:`PayGLocal`},[Z.PESAPAL]:{name:`PesaPal`,description:``,buttonTitle:`Pay with PesaPal`,icon:`Pesapal`},[Z.PAYBYACCOUNT]:{name:`Pay By Account`,description:``,buttonTitle:`Pay with Pay By Account`,icon:`PayByAccount`},[Z.UPI]:{name:`UPI`,description:``,buttonTitle:`Pay with UPI`,icon:`Upi`},[Z.ADDI]:{name:`Addi`,description:``,buttonTitle:`Pay with Addi`,icon:`Addi`},[Z.AFFIRM]:{name:`Affirm`,description:``,buttonTitle:`Pay with Affirm`,icon:`Affirm`},[Z.AFTERPAY]:{name:`Afterpay`,description:``,buttonTitle:`Pay with Afterpay`,icon:`Afterpay`},[Z.ALMA]:{name:`Alma`,description:``,buttonTitle:`Pay with Alma`,icon:`Alma`},[Z.APLAZAME]:{name:`Aplazame`,description:``,buttonTitle:`Pay with Aplazame`,icon:`Aplazame`},[Z.APLAZO]:{name:`Aplazo`,description:``,buttonTitle:`Pay with Aplazo`,icon:`Aplazo`},[Z.ATOME]:{name:`Atome`,description:``,buttonTitle:`Pay with Atome`,icon:`Atome`},[Z.BILLEASE]:{name:`Billease`,description:``,buttonTitle:`Pay with Billease`,icon:`Billease`},[Z.CASHEW]:{name:`Cashew`,description:``,buttonTitle:`Pay with Cashew`,icon:`Cashew`},[Z.CASHPRESSO]:{name:`Cashpresso`,description:``,buttonTitle:`Pay with Cashpresso`,icon:`Cashpresso`},[Z.CLEARPAY]:{name:`Clearpay`,description:``,buttonTitle:`Pay with Clearpay`,icon:`Clearpay`},[Z.CLEO]:{name:`Cleo`,description:``,buttonTitle:`Pay with Cleo`,icon:`Cleo`},[Z.DANA]:{name:`Dana`,description:``,buttonTitle:`Pay with Dana`,icon:`Dana`},[Z.EASYPAISA]:{name:`Easypaisa`,description:``,buttonTitle:`Pay with Easypaisa`,icon:`Easypaisa`},[Z.FINVERO]:{name:`Finvero`,description:``,buttonTitle:`Pay with Finvero`,icon:`Finvero`},[Z.FUPAY]:{name:`FuPay`,description:``,buttonTitle:`Pay with FuPay`,icon:`Fupay`},[Z.GCASG]:{name:`GCasg`,description:``,buttonTitle:`Pay with GCasg`,icon:`Gcasg`},[Z.GRABPAY]:{name:`GrabPay`,description:``,buttonTitle:`Pay with GrabPay`,icon:`Grabpay`},[Z.HUMM]:{name:`Humm`,description:``,buttonTitle:`Pay with Humm`,icon:`Humm`},[Z.KAKAOPAY]:{name:`KakaoPay`,description:``,buttonTitle:`Pay with KakaoPay`,icon:`Kakaopay`},[Z.KLARNA]:{name:`Klarna`,description:``,buttonTitle:`Pay with Klarna`,icon:`Klarna`},[Z.KUESKIPAY]:{name:`KueskiPay`,description:``,buttonTitle:`Pay with KueskiPay`,icon:`Kueskipay`},[Z.LARA]:{name:`Lara`,description:``,buttonTitle:`Pay with Lara`,icon:`Lara`},[Z.LATITUDEPAY]:{name:`LatitudePay`,description:``,buttonTitle:`Pay with LatitudePay`,icon:`Latitudepay`},[Z.LAYBUY]:{name:`Laybuy`,description:``,buttonTitle:`Pay with Laybuy`,icon:`Laybuy`},[Z.LIMEPAY]:{name:`Limepay`,description:``,buttonTitle:`Pay with Limepay`,icon:`Limepay`},[Z.PACE]:{name:`Pace`,description:``,buttonTitle:`Pay with Pace`,icon:`Pace`},[Z.PAGALEVE]:{name:`Pagaleve`,description:``,buttonTitle:`Pay with Pagaleve`,icon:`Pagaleve`},[Z.PARIBAS]:{name:`BNP Paribas`,description:``,buttonTitle:`Pay with BNP Paribas`,icon:`Paribas`},[Z.PAYWITHFOUR]:{name:`Pay With Four`,description:``,buttonTitle:`Pay with Pay With Four`,icon:`Paywithfour`},[Z.PAYJUSTNOW]:{name:`PayJustNow`,description:``,buttonTitle:`Pay with PayJustNow`,icon:`Payjustnow`},[Z.PAYTM]:{name:`PayTM`,description:``,buttonTitle:`Pay with PayTM`,icon:`Paytm`},[Z.PAYBRIGHT]:{name:`Paybright`,description:``,buttonTitle:`Pay with Paybright`,icon:`Paybright`},[Z.PAYFLEX]:{name:`Payflex`,description:``,buttonTitle:`Pay with Payflex`,icon:`Payflex`},[Z.PAYRIGHT]:{name:`Payright`,description:``,buttonTitle:`Pay with Payright`,icon:`Payright`},[Z.POSTPAY]:{name:`Postpay`,description:``,buttonTitle:`Pay with Postpay`,icon:`Postpay`},[Z.RATEPAY]:{name:`Ratepay`,description:``,buttonTitle:`Pay with Ratepay`,icon:`Ratepay`},[Z.RIVERTY]:{name:`Riverty`,description:``,buttonTitle:`Pay with Riverty`,icon:`Riverty`},[Z.SCALAPAY]:{name:`Scalapay`,description:``,buttonTitle:`Pay with Scalapay`,icon:`Scalapay`},[Z.SEZZLE]:{name:`Sezzle`,description:``,buttonTitle:`Pay with Sezzle`,icon:`Sezzle`},[Z.SHOPBACK]:{name:`ShopBack`,description:``,buttonTitle:`Pay with ShopBack`,icon:`Shopback`},[Z.SMARTPAY]:{name:`Smartpay`,description:``,buttonTitle:`Pay with Smartpay`,icon:`Smartpay`},[Z.SOFINCO]:{name:`Sofinco`,description:``,buttonTitle:`Pay with Sofinco`,icon:`Sofinco`},[Z.SPLITIT]:{name:`Splitit`,description:``,buttonTitle:`Pay with Splitit`,icon:`Splitit`},[Z.TABBY]:{name:`Tabby`,description:``,buttonTitle:`Pay with Tabby`,icon:`Tabby`},[Z.TAMARA]:{name:`Tamara`,description:``,buttonTitle:`Pay with Tamara`,icon:`Tamara`},[Z.TENDOPAY]:{name:`Tendopay`,description:``,buttonTitle:`Pay with Tendopay`,icon:`Tendopay`},[Z.TOUCHNGO]:{name:`Touch'n Go`,description:``,buttonTitle:`Pay with Touch'n Go`,icon:`Touchngo`},[Z.TRIPLEA]:{name:`Triple-A`,description:``,buttonTitle:`Pay with Triple-A`,icon:`Triplea`},[Z.TRUEMONEY]:{name:`TrueMoney`,description:``,buttonTitle:`Pay with TrueMoney`,icon:`Truemoney`},[Z.TWISTO]:{name:`Twisto`,description:``,buttonTitle:`Pay with Twisto`,icon:`Twisto`},[Z.UPLIFT]:{name:`Uplift`,description:``,buttonTitle:`Pay with Uplift`,icon:`Uplift`},[Z.VALU]:{name:`ValU`,description:``,buttonTitle:`Pay with ValU`,icon:`Valu`},[Z.ZEST]:{name:`Zest Money`,description:``,buttonTitle:`Pay with Zest Money`,icon:`Zest`},[Z.ZIP]:{name:`Zip`,description:``,buttonTitle:`Pay with Zip`,icon:`Zip`},[Z.ZOODPAY]:{name:`Zoodpay`,description:``,buttonTitle:`Pay with Zoodpay`,icon:`Zoodpay`},[Z.BKASH]:{name:`bKash`,description:``,buttonTitle:`Pay with bKash`,icon:`Bkash`},[Z.ERATY]:{name:`eRaty`,description:``,buttonTitle:`Pay with eRaty`,icon:`Eraty`}},pd=o((()=>{}));function md(e,t){return z(),B(`svg`,gd,[...t[0]||=[V(`polygon`,{points:`39 10.44 37.56 9 24 22.56 10.44 9 9 10.44 22.56 24 9 37.56 10.44 39 24 25.44 37.56 39 39 37.56 25.44 24 39 10.44`},null,-1)]])}var hd,gd,_d,vd=o((()=>{G(),pd(),q(),hd={},gd={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 48 48`},_d=K(hd,[[`render`,md],[`__scopeId`,`data-v-d7e8386b`]])}));G(),vd();var yd={class:`modal-header`},bd={class:`main-title`},xd={class:`modal-body`},Sd={key:0,class:`modal-footer`},Cd=R({__name:`Modal`,props:{width:{},height:{},mode:{},backdrop:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t;function i(){r(`close`)}function a(){n.backdrop!==`static`&&i()}let o=ti(),s=Wo(()=>!!o.footer),c=Wo(()=>{let e=[];return n.width&&e.push(`width: ${n.width}`),n.height&&e.push(`height: ${n.height}`),e.join(`;`)}),l=Wo(()=>n.mode==`confirm`?`small`:``);return(e,t)=>(z(),B(`div`,{class:`modal-mask`,onMousedown:Js(a,[`self`])},[V(`div`,{class:Pe([`modal-wrapper`,l.value]),role:`document`,onClick:t[0]||=Js(()=>{},[`stop`])},[V(`div`,{class:`modal-content`,style:Me(c.value)},[V(`div`,yd,[V(`div`,{class:`close-icon`,onClick:Js(i,[`stop`])},[W(_d,{size:15})]),V(`div`,bd,[$r(e.$slots,`title`,{},void 0,!0)])]),V(`div`,xd,[$r(e.$slots,`body`,{},void 0,!0)]),s.value?(z(),B(`div`,Sd,[$r(e.$slots,`footer`,{},void 0,!0)])):H(``,!0),$r(e.$slots,`default`,{},void 0,!0)],4)],2)],32))}});q();var wd=K(Cd,[[`__scopeId`,`data-v-2b2c8fc7`]]);G();var Td=[`src`],Ed=R({__name:`CheckoutPopup`,props:{url:{},name:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=F(n.url);return jr(()=>n.url,e=>{i.value=e}),za(()=>{}),(t,n)=>(z(),Ji(wd,{width:`80vw`,height:`80vh`,backdrop:`static`,onClose:n[0]||=e=>r(`close`)},{title:Er(()=>[ea(N(e.name),1)]),body:Er(()=>[V(`iframe`,{src:i.value,sandbox:`allow-same-origin allow-scripts allow-popups allow-forms`},null,8,Td)]),_:1}))}});q();var Dd=K(Ed,[[`__scopeId`,`data-v-630d3092`]]),Od;(function(e){e.card=`card`,e.paypal=`paypal`,e.applepay=`applepay`,e.googlepay=`googlepay`,e.upi=`upi`,e.payto=`payto`,e.payid=`payid`,e.shift=`shift`,e.pesapal=`pesapal`,e.paybyaccount=`paybyaccount`,e.payglocal=`payglocal`,e.zip=`zip`,e.dlocal=`dlocal`})(Od||={});function kd(e){switch(e){case Z.AZUPAY:return Od.payid;case Z.SHIFT:return Od.shift;case Z.PESAPAL:return Od.pesapal;case Z.PAYBYACCOUNT:return Od.paybyaccount;case Z.PAYGLOCAL:return Od.payglocal;case Z.ZIP:return Od.zip}}function Ad(e){return e===Z.UPI?{paymentMethod:`upi`}:{paymentMethod:`checkout`,providerType:e}}G(),Dl(),Y(),vc();var jd=[`id`],Md={key:0,class:`error text-normal`},Nd={class:`row`},Pd={key:1,class:`error`},Fd=R({__name:`CheckoutForm`,props:{log:{type:Function},providerType:{},options:{},clickGate:{type:Function}},emits:[`activate`,`popup`,`popupClose`,`close`,`newWindow`,`newWindowClose`],setup(e,{emit:t}){let n=e,r=t,i=F(null),{isLoading:a}=xu(),o=F(!0),s=F(n.providerType),c=F(``),l=F(!!n.options.checkoutOptions?.newWindow),u=null,d=F(null),{errorMessage:f}=Yu(),p=Wo(()=>fd[s.value]?.buttonTitle||`Pay with ${s.value}`),m=Wo(()=>{let e=d.value?.gatewayTransactionData?.RedirectUrl||``;return!e||!gc(e)?``:l.value?e:`${e}${e.includes(`?`)?`&`:`?`}embedded=true`}),h=F(!1),g=F(!1),_=Wo(()=>m.value&&!h.value&&!g.value);function v(e){if(e?.data?.status){if(e.data.status===`activate`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),o.value=!0,r(`activate`,n.options)),e.data.status===`deactivate`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),o.value=!1),e.data.status===`checkout-ready`&&e.data.component===`checkout`&&e.data.providerType===s.value){n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),f.value=``,d.value=e.data.checkoutData,n.log?.(`[BNPL]: checkout`,d.value);let t=Ad(s.value);window.postMessage(m.value?{status:Ol,...t}:{status:kl,...t,reason:`error`,message:`The checkout has no payment page`},`*`)}if(e.data.status===`message`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),c.value=e.data.message,g.value=!1,h.value=!1),e.data.status===`error`&&e.data.component===`checkout`&&e.data.providerType===s.value&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),c.value=e.data.error,e.data.originalError)){let t=JSON.parse(e.data.originalError);t?.message&&(c.value=t.message)}e.data.status===`redirect`&&e.data.component===`checkout`&&(n.log?.(`[Checkout]: message "${e.data.status}" received`,e.data),h.value=!1,e.data.result===`failed`&&(c.value=`Payment has been canceled`,b())),e.data.component===`checkout`&&e.data.providerType===Z.PAYBYACCOUNT&&(e.data.status===`failure`?(n.log?.(`[BNPL][PayByAccount]: message received`,e.data),c.value=e.data.error,r(`newWindowClose`)):e.data.status===`success`&&(n.log?.(`[BNPL][PayByAccount]: message received`,e.data),f.value=``))}}function y(){if(c.value=``,n.clickGate()?.()!==!1){if(l.value){let e=`maxTouchPoints`in navigator&&navigator.maxTouchPoints>0?791:637,t=window.screenLeft===void 0?window.screenX:window.screenLeft,n=window.screenTop===void 0?window.screenY:window.screenTop,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,o=i/window.screen.availWidth,s=(i-400)/2/o+t,c=(a-e)/2/o+n;u=window.open(m.value,`_blank`,`popup=yes,
|
|
131
131
|
toolbar=no,
|
|
132
132
|
location=no,
|
|
133
133
|
status=no,
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
width=400,
|
|
138
138
|
height=${e},
|
|
139
139
|
top=${c},
|
|
140
|
-
left=${s}`),r(`newWindow`,d.value?.externalId)}else h.value=!0,g.value=!0,r(`popup`,d.value?.externalId);return!1}}function b(){h.value=!1,g.value=!1,u?.close(),r(`popupClose`)}return Ba(()=>{window.addEventListener(`message`,v),Oc(i.value,`payfurl-combined-container`)||(o.value=!0,r(`activate`,n.options))}),Wa(()=>{window.removeEventListener(`message`,v)}),(e,t)=>(R(),z(H,null,[Or(U(Tl,{"use-local":``},null,512),[[Ts,!m.value]]),g.value&&!h.value?(R(),Yi(Tl,{key:0,message:`Finalise the payment`})):V(``,!0),B(`div`,{id:`payfurl-${s.value}-form`,class:`payfurl-checkout-form`,ref_key:`root`,ref:i},[B(`div`,{class:`container-form`,style:Me(`visibility: ${F(a)?`hidden`:`visible`}`)},[F(f)?(R(),z(`div`,wd,M(F(f)),1)):V(``,!0),B(`div`,Td,[_.value?(R(),z(`button`,{key:0,onClick:y,type:`button`},M(p.value),1)):V(``,!0),c.value?(R(),z(`p`,Ed,M(c.value),1)):V(``,!0)])],4)],8,Cd),h.value?(R(),Yi(Sd,{key:1,onClose:b,url:m.value,name:p.value},null,8,[`url`,`name`])):V(``,!0)],64))}});K();var Od=G(Dd,[[`__scopeId`,`data-v-8fc4cc32`]]);_e(),$s(),tl(),fl(),vl(),au();var kd={CHECKOUT:`CHECKOUT`,CHECK_STATUS:`CHECK_STATUS`},Ad=(e,t)=>({[kd.CHECKOUT]:{url:e+`/payment_method/checkout`,method:`POST`},[kd.CHECK_STATUS]:{url:e+`/checkout/external/`+t,method:`GET`}}),jd=class{container=null;log;apiUrl=``;redirectUrl=``;checkStatusHandler=null;successCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.redirectUrl=t.redirectUrl,this.successCallback=t.onSuccess||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){this.container?.id===e?.id&&this.destroy?.()}addCheckout(e,t,n,r,i,a,o){this.log(`[addCheckout][${r}]`,{amount:t,providerId:i,providerType:r,options:a,checkoutOptions:o}),this.container=e;let s=!1,c,l=Qs({el:e,component:Od,props:{log:this.log,providerType:r,options:{providerId:i,amount:t,currency:n,checkoutOptions:o},clickGate:this.getOnValidate.bind(this)},on:{activate:T(this,"[sdk][checkoutProcessor][${providerType}]: activate checkout form",e=>{if(s)return;s=!0,this.log(`[sdk][checkoutProcessor][${r}]: activate checkout form`,e);let t=()=>{s=!1};this.checkout(e,r,a,t),c=this.getMessageHandler(e,r,a,t).bind(this),window.addEventListener(`message`,c)}),popup:T(this,"[sdk][checkoutProcessor][${providerType}]: popup open",t=>{this.log(`[sdk][checkoutProcessor][${r}]: popup open`,t),this.checkStatus(e,t,r,c)}),popupClose:T(this,"[sdk][checkoutProcessor][${providerType}]: popup close",()=>{this.log(`[sdk][checkoutProcessor][${r}]: popup close`),this.stopCheckingStatus(null)}),newWindow:T(this,"[sdk][checkoutProcessor][${providerType}]: new window open",t=>{this.log(`[sdk][checkoutProcessor][${r}]: new window open`,t),this.checkStatus(e,t,r,c)}),newWindowClose:T(this,"[sdk][checkoutProcessor][${providerType}]: new window close",()=>{this.log(`[sdk][checkoutProcessor][${r}]: new window close`),this.stopCheckingStatus(null)})}});this.destroy=l.destroy}checkout(e,t,n,r){this.httpInvoker?.invoke(Ad(this.apiUrl)[kd.CHECKOUT].url,Ad(this.apiUrl)[kd.CHECKOUT].method,JSON.stringify({providerId:e.providerId,amount:e.amount,currency:e.currency,shippingAmount:n.shippingAmount,customer:{firstName:n.customer?.firstName,lastName:n.customer?.lastName,email:n.customer?.email,phone:n.customer?.phoneNumber,billingAddress:{name:n.billingAddress?.firstName+` `+n.billingAddress?.lastName,addressLine1:n.billingAddress?.streetAddress,addressLine2:n.billingAddress?.streetAddress2,suburb:n.billingAddress?.region,state:n.billingAddress?.state,countryCode:n.billingAddress?.country,postcode:n.billingAddress?.postalCode}},items:n.orderItems?.map(e=>({name:e.name,reference:e.sku,quantity:e.quantity,amount:e.totalAmount})),options:{...e.checkoutOptions,redirectUrl:this.redirectUrl},metadata:J(n?.metadata)}),this.getSuccessCheckoutHandler(t).bind(this),T(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(e,n)=>{r?.(e,n),this.getFailureCheckoutHandler(t).bind(this)(e,n)}))}getSuccessCheckoutHandler(e){return T(this,"[sdk][checkoutProcessor][${providerType}]: successCheckoutHandler",(t,n)=>{this.log(`[sdk][checkoutProcessor][${e}]: successCheckoutHandler`,t,n);let r=JSON.parse(n),i=JSON.parse(window.atob(r.checkoutData));window.postMessage({status:kl,component:`checkout`,providerType:e,checkoutData:i},`*`)})}getFailureCheckoutHandler(e){return T(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(t,n)=>{this.log(`[sdk][checkoutProcessor][${e}]: failureCheckoutHandler`,t,n),vu().stopLoading(),window.postMessage({status:`error`,component:`checkout`,providerType:e,error:`Invalid payment details`,originalError:n},`*`)})}stopCheckingStatus(e){this.checkStatusHandler&&=(clearInterval(this.checkStatusHandler),null),e&&window.removeEventListener(`message`,e)}checkStatus(e,t,n,r){this.checkStatusHandler||(this.checkStatusHandler=setInterval(this.checkStatus.bind(this,e,t,n,r),5e3),this.log(`[sdk][checkoutProcessor][${n}]: Starting polling...`));let i=this,a=T(this,`[sdk][checkoutProcessor][${n}]: failureCheckStatusHandler`,(e,t)=>{vu().stopLoading(),i.log(`[sdk][checkoutProcessor][${n}]: failureCheckStatusHandler`,e,t),window.postMessage({status:`message`,component:`checkout`,providerType:n,message:`Checkout has been cancelled`},`*`)}),o=T(this,`[sdk][checkoutProcessor][${n}]: successCheckStatusHandler`,(t,r)=>{vu().stopLoading(),i.log(`[sdk][checkoutProcessor][${n}]: successCheckStatusHandler`,{transactionId:t,token:r}),el(e,`Transaction in progress. Please don't close the window or navigate away`);let a={};t&&(a.transactionId=t),r&&(a.token=r),i.successCallback?.(a)});this.httpInvoker?.invoke(Ad(this.apiUrl,t)[kd.CHECK_STATUS].url,Ad(this.apiUrl,t)[kd.CHECK_STATUS].method,{},T(this,`[sdk][checkoutProcessor][${n}]: checkStatus, success`,(e,t)=>{let n=JSON.parse(t);if(this.log(`checkoutStatus`,n),!n)return this.stopCheckingStatus(r),a(e,t);if(n.status==`SUCCESS`&&n.status===`SUCCESS`)return this.stopCheckingStatus(r),o(n.transactionId,n.tokenId)}),T(this,`[sdk][checkoutProcessor][${n}]: checkStatus, failure`,(e,t)=>(this.log(`[sdk][checkoutProcessor][${n}]: checkStatus`,{status:e,body:t}),this.stopCheckingStatus(r),a(e,t))))}getMessageHandler(e,t,n,r){return T(this,`[sdk][checkoutProcessor][${t}]: message received`,i=>{if(i?.data?.status){if(i.data.status===`set-amount`){if(Number(e.amount)==Number(i.data.amount))return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,i.data),e.amount=Number(i.data.amount),this.checkout(e,t,n,r)}else if(i.data.status===`set-currency`){if(e.currency==i.data.currency)return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,i.data),e.currency=i.data.currency,this.checkout(e,t,n,r)}}})}};d([w],jd.prototype,`cleanUp`,null),d([w],jd.prototype,`addCheckout`,null),d([w],jd.prototype,`checkout`,null),d([w],jd.prototype,`getSuccessCheckoutHandler`,null),d([w],jd.prototype,`getFailureCheckoutHandler`,null),d([w],jd.prototype,`stopCheckingStatus`,null),d([w],jd.prototype,`checkStatus`,null),d([w],jd.prototype,`getMessageHandler`,null),_e(),fl(),vl();var Md={CHECK_FRAUD:`CHECK_FRAUD`,RESOLVE_THREE_DS:`RESOLVE_THREE_DS`,CANCEL_THREE_DS:`CANCEL_THREE_DS`},Nd=e=>({[Md.CHECK_FRAUD]:{url:e+`/fraud_check`,method:`POST`},[Md.RESOLVE_THREE_DS]:{url:e+`/3ds/result`,method:`POST`},[Md.CANCEL_THREE_DS]:{url:e+`/3ds/cancel`,method:`POST`}});function Pd(e){try{return JSON.parse(e)}catch{return}}function Fd(e){return typeof e?.decision==`string`&&typeof e?.transactionId==`string`}var Id=class{providerId=``;stopPaymentOnFailure=!1;log;apiUrl=``;getFraudCheckData;metadata={};amount=0;currency=`AUD`;address=null;customer=null;order=null;paymentInformation=null;paypalInformation=null;paymentReference=null;walletInformation=null;httpInvoker=null;constructor(e,t){this.log=e,this.providerId=t.providerId,this.stopPaymentOnFailure=t.stopPaymentOnFailure,this.apiUrl=t.apiUrl,this.metadata=t.metadata,this.getFraudCheckData=t.getFraudCheckData;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}fraudCheck(e,t){if(!this.paymentInformation&&!this.paypalInformation&&!this.paymentReference&&!this.walletInformation)return t({error:`Payment information is required`});this.log(`[fraudCheck]`,{amount:this.amount,currency:this.currency,paymentInformation:this.paymentInformation,paypalInformation:this.paypalInformation,paymentReference:this.paymentReference,walletInformation:this.walletInformation,customer:this.customer,address:this.address,order:this.order,metadata:this.metadata}),this.httpInvoker?.invoke(Nd(this.apiUrl)[Md.CHECK_FRAUD].url,Nd(this.apiUrl)[Md.CHECK_FRAUD].method,this.getFraudCheckData(this.providerId,this.amount,this.currency,this.paymentInformation,this.paypalInformation,this.customer,this.address,this.order,this.metadata,this.paymentReference,this.walletInformation),T(this,`[fraudCheck], success`,(n,r)=>{this.log(`[fraudCheck], success`,n,r,this.stopPaymentOnFailure);let i=Pd(r);if(!Fd(i))return t({error:`Fraud Check Failed`,body:r});i.providerId=this.providerId,i.stopPaymentOnFailure=this.stopPaymentOnFailure,e(i)}),T(this,`[fraudCheck], failure`,(e,n)=>{this.log(`[fraudCheck], failure`,e,n),t({error:`Fraud Check Failed`,body:n})}))}resolveThreeDsResult(e,t,n){this.httpInvoker?.invoke(Nd(this.apiUrl)[Md.RESOLVE_THREE_DS].url,Nd(this.apiUrl)[Md.RESOLVE_THREE_DS].method,JSON.stringify({threeDSServerTransID:e}),T(this,`[resolveThreeDsResult], success`,(e,r)=>{this.log(`[resolveThreeDsResult], success`,e,r);let i=Pd(r);if(i==null)return n({error:`3DS result resolution failed`,body:r});t(i)}),T(this,`[resolveThreeDsResult], failure`,(e,t)=>{this.log(`[resolveThreeDsResult], failure`,e,t),n({error:`3DS result resolution failed`,body:t})}))}cancelThreeDsOrder(e,t,n){this.httpInvoker?.invoke(Nd(this.apiUrl)[Md.CANCEL_THREE_DS].url,Nd(this.apiUrl)[Md.CANCEL_THREE_DS].method,JSON.stringify({threeDSServerTransID:e}),T(this,`[cancelThreeDsOrder], success`,(e,n)=>{this.log(`[cancelThreeDsOrder], success`,e,n),t({})}),T(this,`[cancelThreeDsOrder], failure`,(e,t)=>{this.log(`[cancelThreeDsOrder], failure`,e,t),n({error:`3DS cancel notification failed`,body:t})}))}setAmount(e){this.amount=e}setCurrency(e){this.currency=e}setAddressInfo(e){this.address={...e}}setCustomerInfo(e){this.customer={...e}}setOrderInfo(e){this.order={...e}}setPaymentInfo(e){this.paymentInformation={...e},this.paypalInformation=null,this.paymentReference=null,this.walletInformation=null}setPaymentReference(e){this.paymentReference={...e},this.paymentInformation=null,this.paypalInformation=null,this.walletInformation=null}setPaypalInfo(e){this.paypalInformation={...e},this.paymentInformation=null,this.paymentReference=null,this.walletInformation=null}setWalletInfo(e){this.walletInformation={...e},this.paymentInformation=null,this.paypalInformation=null,this.paymentReference=null}getProviderId(){return this.providerId}};d([w],Id.prototype,`fraudCheck`,null),d([w],Id.prototype,`resolveThreeDsResult`,null),d([w],Id.prototype,`cancelThreeDsOrder`,null);var Ld=18e4,Rd=3e4,zd=`Payment couldn't be processed`;function Bd(e){return new Promise((t,n)=>{e.fraudCheck(e=>t(e),e=>n(Error(e?.error||`Fraud check failed`)))})}async function Vd(e,t,n,r={}){if(!e)return{};let i;try{i=await Bd(e)}catch(e){return r.log?.(`fraud check failed`,e),{error:e.message}}if(wu(i))return{error:zd};if(!i.managedOrderToken)return{fraudCheckResult:i};let a=await Hd(e,t,i,n,r);return a?{error:a}:{fraudCheckResult:i,threeDSServerTransID:i.threeDSServerTransID}}async function Hd(e,t,n,r,i={}){let{managedOrderToken:a,threeDSServerTransID:o}=n;if(!a)return`3DS challenge could not be started`;try{await Ud(t,a,r,i)}catch(e){return i.log?.(`manageOrder challenge failed`,e),`Unable to complete 3DS challenge`}let s;try{s=await Wd(e,o)}catch(e){return i.log?.(`3ds/result resolution failed`,e),`Unable to resolve 3DS result`}return s?.status===`success`?null:(i.log?.(`3ds/result not successful`,s),await Gd(e,o,i),`3DS authentication failed`)}function Ud(e,t,n,r){return new Promise((i,a)=>{if(!e){a(Error(`Forter managed-order challenge is not available`));return}let o=!1,s,c=e=>{o||(o=!0,clearTimeout(l),s?.(),r.onHide?.(),e())},l=setTimeout(()=>c(()=>a(Error(`3DS challenge timed out`))),Ld);r.onShow?.();let u=e=>c(()=>a(e instanceof Error?e:Error(String(e))));try{s=e(t,n,e=>{e?u(e):c(i)})}catch(e){u(e)}})}function Wd(e,t){return new Promise((n,r)=>{if(!t){r(Error(`threeDSServerTransID is missing`));return}let i=!1,a=e=>{i||(i=!0,clearTimeout(o),e())},o=setTimeout(()=>a(()=>r(Error(`3DS result timed out`))),Rd);e.resolveThreeDsResult(t,e=>a(()=>n(e)),e=>a(()=>r(Error(e?.error||`3DS result resolution failed`))))})}function Gd(e,t,n){return new Promise(r=>{t?e.cancelThreeDsOrder(t,()=>r(),e=>{n.log?.(`cancel notification failed`,e),r()}):r()})}function Kd(e){return e==null||typeof e==`string`?e:void 0}function qd(e){if(!e)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t==`object`&&t&&!Array.isArray(t)&&typeof t.code==`number`&&typeof t.isRetryable==`boolean`)return{code:t.code,isRetryable:t.isRetryable,message:Kd(t.message),gatewayCode:Kd(t.gatewayCode),gatewayMessage:Kd(t.gatewayMessage),type:Kd(t.type)}}function Jd(e,t){let n={onClick:e};if(!t)return n;for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}W(),El(),he(),au();var Yd={style:{position:`relative`}},Xd={key:0,class:`error text-normal`},Zd=`payfurl-googlepay-script`,Qd=L({__name:`GooglePayForm`,props:{log:{type:Function},el:{},environment:{},amount:{},currency:{},options:{},clickGate:{type:Function}},emits:[`complete`,`activate`,`close`,`error`],setup(e,{emit:t}){let n=e,r=t,i=P(null),a=P(n.amount),o=P(n.currency),s=P(!0),c=P(``),l=!1,{isLoading:u}=vu();function d(){if(l)return;if(l=!0,document.getElementById(Zd)){b();return}window.google=null;let e=document.createElement(`script`);e.src=`https://pay.google.com/gp/p/js/pay.js`,e.type=`text/javascript`,e.id=Zd,e.onload=b,document.body.appendChild(e)}let f=null;function p(){return f===null&&(f=new window.google.payments.api.PaymentsClient({environment:n.environment==C.PRODUCTION?`PRODUCTION`:`TEST`})),f}let m={type:`CARD`,parameters:{allowedAuthMethods:[`PAN_ONLY`,`CRYPTOGRAM_3DS`],allowedCardNetworks:[`AMEX`,`DISCOVER`,`INTERAC`,`JCB`,`MASTERCARD`,`VISA`]}};function h(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[m]}}function g(){let e=p().createButton(Jd(v,n.options.buttonOptions));n.el.appendChild(e)}function _(){return n.environment==C.PRODUCTION?{merchantName:n.options.googlePayMerchantName??`Example Merchant`,merchantId:n.options.googlePayMerchantId}:{merchantName:n.options.googlePayMerchantName??`Example Merchant`}}function v(){if(n.log(`[onGooglePaymentButtonClicked]`),n.clickGate()?.()===!1)return;let e=y(),t=p();n.log(`[paymentData], request`,e),t.loadPaymentData(e).then(function(e){n.log(`[paymentData], success`,e);let t=JSON.parse(e.paymentMethodData.tokenizationData.token);e.paymentMethodData.tokenizationData={...e.paymentMethodData.tokenizationData,...t},r(`complete`,e)}).catch(function(e){n.log(`[paymentData], error`,e),e?.statusCode!==`CANCELED`&&r(`error`,e?.statusMessage||e?.message||`Google Pay failed`)})}function y(){let e=n.options.billingDetailsRequired===!0;return{apiVersion:2,apiVersionMinor:0,...e?{emailRequired:!0}:{},allowedPaymentMethods:[{...m,parameters:{...m.parameters,...e?{billingAddressRequired:!0,billingAddressParameters:{format:`FULL`}}:{}},tokenizationSpecification:{type:`PAYMENT_GATEWAY`,parameters:{gateway:n.options.gateway,gatewayMerchantId:n.options.googlePayGatewayMerchantId}}}],transactionInfo:{totalPriceStatus:`FINAL`,countryCode:`AU`,currencyCode:o.value,totalPrice:Number(a.value).toFixed(2)},merchantInfo:_()}}function b(){p().isReadyToPay(h()).then(function(e){e.result&&(g(),window.postMessage({status:Dl},`*`))}).catch(function(e){console.error(`Load GooglePay error`,e)})}function ee(e){e?.data?.status&&(e.data.status===`activate`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),s.value=!0,r(`activate`),d()),e.data.status===`deactivate`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),s.value=!1),e.data.status===`message`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),c.value=e.data.message),e.data.status===`error`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),c.value=e.data.error),e.data.status===`set-amount`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),a.value=Number(e.data.amount)),e.data.status===`set-currency`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),o.value=e.data.currency))}return Wa(()=>{window.removeEventListener(`message`,ee)}),Ba(()=>{window.addEventListener(`message`,ee),Oc(i.value,`payfurl-combined-container`)||(s.value=!0,r(`activate`),d())}),(e,t)=>(R(),z(H,null,[B(`div`,Yd,[Or(U(Tl,null,null,512),[[Ts,F(u)]])]),B(`div`,{style:{position:`relative`},ref_key:`root`,ref:i},[c.value?(R(),z(`div`,Xd,M(c.value),1)):V(``,!0)],512)],64))}});fl(),vl(),_e(),tl(),_c(),$s();var $d={ADD_CHARGE_WITH_GOOGLE_PAY:`ADD_CHARGE_WITH_GOOGLE_PAY`},ef=e=>({[$d.ADD_CHARGE_WITH_GOOGLE_PAY]:{url:e+`/charge/token/google`,method:`POST`}}),tf=class{container=null;log;apiUrl=``;environment=``;failureCallback=null;successCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};amount=0;currency=``;billingAddress=null;customer=null;order=null;fraudProcessor=null;constructor(e,t){this.log=e,this.environment=t.environment,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setAmount(e){this.amount=e}setCurrency(e){this.currency=e}setCustomerInfo(e){this.customer={...e}}setBillingAddress(e){this.billingAddress={...e}}setOrderInfo(e){this.order={...e}}addFraudProcessor(e){this.fraudProcessor=e}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){e===this.container&&this.destroy?.()}addGooglePay(e,t,n,r,i){this.log(`[addGooglePay]`,{providerId:t,amount:n,currency:r,options:i});let a=this.fraudProcessor;this.validateOptions(e,n,r,i),this.setAmount(n),this.setCurrency(r);let o=!1;this.container=e;let s=Qs({el:e,component:Qd,props:{log:this.log,el:e,environment:this.environment,amount:this.amount,currency:this.currency,options:i,clickGate:this.getOnValidate.bind(this)},on:{activate:T(this,`[GooglePay]: activate`,()=>{o||(o=!0,this.log(`[GooglePay]: activate googlepay form`))}),complete:T(this,`[GooglePay]: complete`,n=>{this.log(`[GooglePay]: complete`,n);let r=n.paymentMethodData.info.billingAddress,[o,...s]=r?.name?.trim().split(/\s+/)??[],c=this.billingAddress?{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}:r&&{line1:r.address1,line2:r.address2,city:r.locality,country:r.countryCode,postalCode:r.postalCode,state:r.administrativeArea},l={amount:this.amount,currency:this.currency,paymentData:{paymentMethodData:{tokenizationData:{intermediateSigningKey:n.paymentMethodData.tokenizationData.intermediateSigningKey,protocolVersion:n.paymentMethodData.tokenizationData.protocolVersion,signature:n.paymentMethodData.tokenizationData.signature,signedMessage:n.paymentMethodData.tokenizationData.signedMessage}},paymentInfo:{cardDetails:n.paymentMethodData.info.cardDetails,cardNetwork:n.paymentMethodData.info.cardNetwork}},firstName:this.customer?.firstName||o,lastName:this.customer?.lastName||s.join(` `)||o,email:this.customer?.email||n.email,phone:this.customer?.phoneNumber,address:c||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(e=>({description:e.name,productCode:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice),unitOfMeasure:e.unitOfMeasure}))}||void 0,metadata:J(i?.metadata)};this.fraudCheckAndCharge(e,t,l,a)}),error:T(this,`[GooglePay]: error`,t=>{this.log(`[GooglePay]: error`,t),q(e,`Unable to pay with Google Pay`),this.failureCallback?.({error:`Unable to pay with Google Pay`,body:t})})}});this.destroy=s.destroy}fraudCheckAndCharge(e,t,n,r){let i=t=>{q(e,t),this.failureCallback?.({error:t})};r?.setAmount(this.amount),r?.setCurrency(this.currency),this.customer&&r?.setCustomerInfo(this.customer),this.billingAddress&&r?.setAddressInfo(this.billingAddress),this.order&&r?.setOrderInfo(this.order),r?.setWalletInfo({type:`GOOGLEPAY`,lastFourDigits:n.paymentData.paymentInfo.cardDetails}),Vd(r,null,e,{log:this.log}).then(r=>{if(`error`in r)return i(r.error);this.addChargeWithGooglePay(e,t,{...n,fraudCheck:r.fraudCheckResult})}).catch(()=>i(`Unable to pay with Google Pay`))}addChargeWithGooglePay(e,t,n){this.log(`[addChargeWithGooglePay]`,n),this.httpInvoker?.invoke(ef(this.apiUrl)[$d.ADD_CHARGE_WITH_GOOGLE_PAY].url,ef(this.apiUrl)[$d.ADD_CHARGE_WITH_GOOGLE_PAY].method,JSON.stringify(n),this.getSuccessAddChargeHandler(e).bind(this),this.getFailureAddChargeHandler(e).bind(this),{providerId:t})}getFailureAddChargeHandler(e){return T(this,`[GooglePay], failure`,(t,n)=>{this.log(`[GooglePay], failure`,n),q(e,`Unable to pay with Google Pay`),this.failureCallback?.({error:`Unable to pay with Google Pay`,body:n})})}getSuccessAddChargeHandler(e){return T(this,`[GooglePay], success`,(e,t)=>{let n=JSON.parse(t);this.log(`[GooglePay], success`,n),this.successCallback?.({transactionId:n.chargeId})})}validateOptions(e,t,n,r){if(!il(n))throw q(e,`Invalid currency: `+n),TypeError(`invalid currency: `+n);if(!uc(t))throw q(e,`Invalid amount: `+t),TypeError(`invalid amount: `+t);if(!r.gateway)throw q(e,`Invalid gateway parameter`),TypeError(`Invalid gateway parameter`);if(!r.googlePayGatewayMerchantId)throw q(e,`Invalid gateway merchant id parameter`),TypeError(`Invalid gateway merchant id parameter`)}};d([w],tf.prototype,`cleanUp`,null),d([w],tf.prototype,`addGooglePay`,null),d([w],tf.prototype,`addChargeWithGooglePay`,null),d([w],tf.prototype,`getFailureAddChargeHandler`,null),d([w],tf.prototype,`getSuccessAddChargeHandler`,null),d([w],tf.prototype,`validateOptions`,null);var nf=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},rf=[`supports3DS`],af=[`visa`,`masterCard`,`amex`,`discover`];function of(e){try{return typeof ApplePaySession<`u`&&ApplePaySession.supportsVersion(e)===!0}catch{return!1}}function sf(){for(let e=14;e>3;e--)if(of(e))return e;return 3}function cf(e){return e&&of(e)?e:sf()}function lf(e){return e?.length?[...new Set([`supports3DS`,...e])]:rf}function uf(e,t,n){let r={countryCode:e.countryCode||`AU`,currencyCode:t,merchantCapabilities:lf(e.merchantCapabilities),supportedNetworks:e.supportedNetworks?.length?e.supportedNetworks:af,total:{label:e.lineItemLabel||``,type:`final`,amount:Number(n).toFixed(2)}};return e.supportedCountries?.length&&(r.supportedCountries=e.supportedCountries),r}var df=`payfurl-applepay-script`,ff=`https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js`,pf=1e4,mf=null;function hf(){return!!window.ApplePaySession&&!!window.customElements?.get(`apple-pay-button`)}function gf(){return typeof window>`u`||typeof document>`u`||hf()?Promise.resolve():mf||(mf=new Promise(e=>{let t=document.createElement(`script`);t.id=df,t.src=ff,t.type=`text/javascript`,t.crossOrigin=`anonymous`;let n=setTimeout(()=>e(),pf),r=()=>{clearTimeout(n),e()};t.addEventListener(`load`,r,{once:!0}),t.addEventListener(`error`,r,{once:!0}),document.head.appendChild(t)}),mf)}W(),El(),au();var _f={style:{position:`relative`}},vf={key:0,class:`error text-normal`},yf=L({__name:`ApplePayForm`,props:{log:{type:Function},el:{},environment:{},amount:{},currency:{},options:{},clickGate:{type:Function}},emits:[`submit`,`validateMerchant`,`activate`,`close`,`error`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=P(null),a=P(n.amount),o=P(n.currency),s=P(!0),c=P(``),l=!1,{isLoading:u}=vu();function d(){if(n.log(`[onApplePayButtonClicked]`),!ApplePaySession||n.clickGate()?.()===!1)return;let e=uf(n.options,o.value,a.value),t=cf(n.options.applePayVersion);n.log(`[onApplePayButtonClicked], Create ApplePaySession`,e,t);let i=new ApplePaySession(t,e);i.onvalidatemerchant=e=>{let t=e.validationURL;r(`validateMerchant`,{validationUrl:t,domainName:window.location.hostname},i)},i.onpaymentauthorized=e=>{n.log(`[onpaymentauthorized]`,e),r(`submit`,e.payment,i)},i.oncancel=e=>{n.log(`[oncancel]`,e),r(`cancel`)},i.begin()}function f(){l||(l=!0,window.google=null,gf().then(()=>{let e=document.createElement(`apple-pay-button`);e.buttonstyle=`black`,e.locale=`en-US`,e.type=`buy`,e.onclick=d,i.value?.appendChild(e),window.postMessage({status:Dl},`*`)}))}function p(e){e?.data?.status&&(e.data.status===`activate`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),s.value=!0,r(`activate`),f()),e.data.status===`deactivate`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),s.value=!1),e.data.status===`message`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),c.value=e.data.message),e.data.status===`error`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),c.value=e.data.error),e.data.status===`set-amount`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),a.value=Number(e.data.amount)),e.data.status===`set-currency`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),o.value=e.data.currency))}return Wa(()=>{window.removeEventListener(`message`,p)}),Ba(()=>{window.addEventListener(`message`,p),Oc(i.value,`payfurl-combined-container`)||(s.value=!0,r(`activate`),f())}),(e,t)=>(R(),z(H,null,[B(`div`,_f,[Or(U(Tl,null,null,512),[[Ts,F(u)]])]),B(`div`,{style:{position:`relative`},ref_key:`root`,ref:i},[c.value?(R(),z(`div`,vf,M(c.value),1)):V(``,!0)],512)],64))}}),bf=c({}),xf=o((()=>{})),Sf=c({}),Cf=o((()=>{})),wf=c({PayWayAppleButton:()=>Df}),Tf,Ef,Df,Of=o((()=>{fl(),vl(),_e(),Tf={CHECKOUT:`CHECKOUT`,CHARGE:`CHARGE`},Ef=e=>({[Tf.CHECKOUT]:{url:e+`/payment_method/checkout`,method:`POST`},[Tf.CHARGE]:{url:e+`/charge/checkout`,method:`POST`}}),Df=class{log;container;button=null;validator=null;validationError=null;providerId;apiUrl;amount;currency;clientParameters;billingAddress=null;customer=null;order=null;buttonId=`apple-pay-payway-button`;validatorId=`apple-pay-payway-button-validator`;onLoad=()=>{};onSuccess;onFailure;userOnValidate;httpInvoker=null;constructor(e,t,n,r,i,a){this.log=e,this.apiUrl=a.apiUrl,this.container=t||document.body,this.clientParameters=a.clientParameters,this.providerId=a.providerId,this.amount=Number(r),this.currency=i,this.providerId=n,this.onSuccess=a.onSuccess||null,this.onFailure=a.onFailure||null,this.userOnValidate=a.onValidate;let o=new dl(a.environment,ml(a.publicKey));this.httpInvoker=new ge(a.publicKey,a.version,o),this.init(),setInterval(()=>{this.validator&&(this.userOnValidate?.()===!1?this.validator.style.display=`block`:(this.validator.style.display=`none`,this.validationError&&(this.validationError.style.display=`none`)))},1e3)}draw(){let e=()=>{this.onLoad=()=>{};let e={container:this.buttonId,publishableApiKey:this.clientParameters.PublishableApiKey,principalAmount:this.amount,currency:String(this.currency).toLowerCase(),buttonMode:`callback`};this.log(`[createPaymentRequestButton]`,e),window.payway.createPaymentRequestButton(e,(e,t)=>{this.log(`[createPaymentRequestButton]`,e,t),e?this.onFailure?.(e):this.checkout(t.singleUseTokenId)}),this.addValidator()};window.payway?e():this.onLoad=e}show(){this.button&&(this.button.style.display=`block`)}hide(){this.button&&(this.button.style.display=`none`)}init(){let e=document.createElement(`div`);e.id=this.buttonId,e.style.position=`relative`,this.container.appendChild(e),this.button=e,this.initScript()}addValidator(){if(document.getElementById(this.validatorId))return;let e=document.createElement(`div`);e.id=this.validatorId,e.style.width=`100%`,e.style.height=`100%`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.display=`none`,this.button?.appendChild(e),this.validator=e}initScript(){let e=document.createElement(`script`);e.src=`https://api.payway.com.au/rest/v1/payway.js`,e.onload=()=>{this.onLoad&&this.onLoad()},document.head.appendChild(e)}checkout(e){let t={providerId:this.providerId,amount:this.amount,currency:this.currency,reference:this.order?.orderNumber,options:{ProviderToken:e},customer:{firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email,phone:this.customer?.phoneNumber,billingAddress:this.billingAddress&&{name:`${this.billingAddress.firstName} ${this.billingAddress.lastName}`,addressLine1:this.billingAddress.streetAddress,addressLine2:this.billingAddress.streetAddress2,suburb:this.billingAddress.city,countryCode:this.billingAddress.country,postcode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0},items:this.order&&this.order.orderItems.map(e=>({name:e.name,reference:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice)}))||[]};this.log(`[PayWayAppleButton][checkout]`,t),this.httpInvoker?.invoke(Ef(this.apiUrl)[Tf.CHECKOUT].url,Ef(this.apiUrl)[Tf.CHECKOUT].method,JSON.stringify(t),(e,t)=>{this.log(`[PayWayAppleButton][checkout]: successCheckoutHandler`,e,t);let n=JSON.parse(t),r=JSON.parse(window.atob(n.checkoutData));this.log(`[PayWayAppleButton][checkout]: decodedData`,r),this.charge(r.checkoutId)},(e,t)=>{this.log(`[PayWayAppleButton][checkout]: failureCheckoutHandler`,e,t);let n=JSON.parse(t);this.onFailure?.({error:n.message})})}charge(e){this.log(`[PayWayAppleButton][charge]`,{checkoutId:e}),this.httpInvoker?.invoke(Ef(this.apiUrl)[Tf.CHARGE].url,Ef(this.apiUrl)[Tf.CHARGE].method,JSON.stringify({checkoutId:e}),(e,t)=>{this.log(`[PayWayAppleButton][charge]: successChargeHandler`,e,t);let n=JSON.parse(t);this.onSuccess?.({transactionId:n?.chargeId})},(e,t)=>{this.log(`[PayWayAppleButton][charge]: failureChargeHandler`,e,t);let n=JSON.parse(t);this.onFailure?.({error:n.message})})}redraw(){this.button&&(this.button.innerHTML=``,this.draw())}setAmount(e){this.log(`[PayWayAppleButton][setAmount]`,e),this.amount=e,this.redraw()}setCurrency(e){this.log(`[PayWayAppleButton][setCurrency]`,e),this.currency=e,this.redraw()}setCustomerInfo(e){this.log(`[PayWayAppleButton][setCustomerInfo]`,e),this.customer={...e}}setBillingAddress(e){this.log(`[PayWayAppleButton][setBillingAddress]`,e),this.billingAddress={...e}}setOrderInfo(e){this.log(`[PayWayAppleButton][setOrderInfo]`,e),this.order={...e}}}})),kf=c({default:()=>Af});function Af(e,t,n,r,i,a){return new Df(e,t,n,r,i,a)}var jf=o((()=>{Of()}));fl(),vl(),_e(),tl(),_c(),$s(),au();var Mf={VALIDATE_MERCHANT:`VALIDATE_MERCHANT`,ADD_CHARGE_WITH_APPLE_PAY:`ADD_CHARGE_WITH_APPLE_PAY`},Nf=e=>({[Mf.VALIDATE_MERCHANT]:{url:e+`/charge/token/apple/validate`,method:`POST`},[Mf.ADD_CHARGE_WITH_APPLE_PAY]:{url:e+`/charge/token/apple`,method:`POST`}}),Pf=class{container=null;log;apiUrl=``;environment=``;publicKey=``;version=``;applePayButton=null;failureCallback=null;successCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};amount=0;currency=``;billingAddress=null;customer=null;order=null;fraudProcessor=null;constructor(e,t){this.log=e,this.environment=t.environment,this.apiUrl=t.apiUrl,this.publicKey=t.publicKey,this.version=t.version,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setAmount(e){this.amount=e,this.applePayButton?.setAmount(e)}setCurrency(e){this.currency=e,this.applePayButton?.setCurrency(e)}setCustomerInfo(e){this.customer={...e},this.applePayButton?.setCustomerInfo(e)}setBillingAddress(e){this.billingAddress={...e},this.applePayButton?.setBillingAddress(e)}setOrderInfo(e){this.order={...e},this.applePayButton?.setOrderInfo(e)}addFraudProcessor(e){this.fraudProcessor=e}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){e?.id===this.container?.id&&this.destroy?.()}addApplePay(e,t,n,r,i){this.log(`[addApplePay]`,{providerId:t,amount:n,currency:r,options:i});let a=this.fraudProcessor;this.validateOptions(e,n,r,i),this.setAmount(n),this.setCurrency(r);let o=!1;this.container=e;let s=T(this,`[ApplePay][renderDefaultComponent]`,()=>{this.log(`[addApplePay], renderDefaultComponent`,{providerId:t,amount:n,currency:r,options:i});let s=Qs({el:e,component:yf,props:{log:this.log,el:e,environment:this.environment,amount:this.amount,currency:this.currency,options:i,clickGate:this.getOnValidate.bind(this)},on:{activate:()=>{o||(o=!0,this.log(`activate applepay form`))},validateMerchant:T(this,`[addApplePay], validateMerchant`,(n,r)=>{this.log(`[ApplePay]: validate`,n),this.validateMerchant(e,t,n,r)}),submit:T(this,`[addApplePay], submit`,(n,r)=>{this.log(`[ApplePay]: complete`,n);let o={amount:this.amount,currency:this.currency,token:n.token,firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email,phone:this.customer?.phoneNumber,address:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(e=>({description:e.name,productCode:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice)}))}||void 0,metadata:i.metadata};this.fraudCheckAndCharge(e,t,o,r,a)}),error:T(this,`[addApplePay], error`,(t,n)=>{this.log(`[ApplePay]: error`,t),q(e,`Unable to pay with ApplePay`),n.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:`unknown`,message:t}]}),this.failureCallback?.({error:`Unable to pay with ApplePay`,body:t})}),cancel:T(this,`[addApplePay], calcel`,()=>{this.log(`[ApplePay]: cancel`),q(e,`ApplePay canceled`),this.failureCallback?.({error:`ApplePay canceled`})})}});this.destroy=s.destroy}),c=T(this,`[ApplePay][renderCustomComponent]`,a=>{this.log(`[addApplePay], renderCustomComponent`,{providerId:t,amount:n,currency:r,options:i}),this.applePayButton=a.default(this.log.bind(this),e,i.providerId,n,r,{environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,version:this.version,options:i,clientParameters:i.clientParameters,onValidate:this.getOnValidate.bind(this),onSuccess:T(this,`[addApplePay], success`,e=>{this.log(`[addApplePay], success`,e),this.applePayButton?.hide();let t={token:e.token,transactionId:e.transactionId};e.clickToPayData&&(t.clickToPayData=e.clickToPayData),this.successCallback?.(t)}),onFailure:T(this,`[addApplePay], failure`,e=>{this.log(`[addApplePay], failure`,e),this.applePayButton?.redraw(),this.failureCallback?.({error:e.error})})}),this.billingAddress&&this.applePayButton?.setBillingAddress(this.billingAddress),this.customer&&this.applePayButton?.setCustomerInfo(this.customer),this.order&&this.applePayButton?.setOrderInfo(this.order),this.applePayButton?.draw(),window.postMessage({status:Dl},`*`)});nf(Object.assign({"./applepay/ApplePayButton.interface.ts":()=>Promise.resolve().then(()=>(xf(),bf)),"./applepay/ApplePayButtonOptions.type.ts":()=>Promise.resolve().then(()=>(Cf(),Sf)),"./applepay/PayWayAppleButton.ts":()=>Promise.resolve().then(()=>(Of(),wf)),"./applepay/payway_rest.ts":()=>Promise.resolve().then(()=>(jf(),kf))}),`./applepay/${i.providerType?.toLowerCase()}.ts`,3).then(T(this,`[localAddApplePay], then`,e=>{this.log(`Loading ${i.providerType}...`,e),c(e)})).catch(()=>{this.log(`Error loading ${i.providerType}`),s()})}validateMerchant(e,t,n,r){this.log(`[validateMerchant]`,n),this.httpInvoker?.invoke(Nf(this.apiUrl)[Mf.VALIDATE_MERCHANT].url,Nf(this.apiUrl)[Mf.VALIDATE_MERCHANT].method,JSON.stringify(n),T(this,`[validateMerchant], success`,(e,t)=>{try{let e=JSON.parse(t);this.log(`[validateMerchant], success`,e),r.completeMerchantValidation(e)}catch(e){this.log(`error parsing validateMerchant response`,e)}}),T(this,`[validateMerchant], failure`,(t,n)=>{this.log(`[validateMerchant], failure`,n),q(e,`Unable to pay with ApplePay`),this.failureCallback?.({error:`Unable to pay with ApplePay`,body:n})}),{providerId:t})}fraudCheckAndCharge(e,t,n,r,i){let a=t=>{q(e,t),r.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[]}),this.failureCallback?.({error:t})},o=n.token.paymentMethod?.displayName?.slice(-4);i?.setAmount(this.amount),i?.setCurrency(this.currency),this.customer&&i?.setCustomerInfo(this.customer),this.billingAddress&&i?.setAddressInfo(this.billingAddress),this.order&&i?.setOrderInfo(this.order),i?.setWalletInfo({type:`APPLEPAY`,lastFourDigits:/^\d{4}$/.test(o??``)?o:void 0}),Vd(i,null,e,{log:this.log}).then(i=>{if(`error`in i)return a(i.error);this.addChargeWithApplePay(e,t,{...n,fraudCheck:i.fraudCheckResult},r)}).catch(()=>a(`Unable to pay with ApplePay`))}addChargeWithApplePay(e,t,n,r){this.log(`[addChargeWithApplePay]`,n),this.httpInvoker?.invoke(Nf(this.apiUrl)[Mf.ADD_CHARGE_WITH_APPLE_PAY].url,Nf(this.apiUrl)[Mf.ADD_CHARGE_WITH_APPLE_PAY].method,JSON.stringify(n),this.getSuccessAddChargeHandler(e,r).bind(this),this.getFailureAddChargeHandler(e,r).bind(this),{providerId:t})}getFailureAddChargeHandler(e,t){return T(this,`[getFailureAddChargeHandler]`,(n,r)=>{this.log(`[ApplePay], failure`,r),q(e,`Unable to pay with ApplePay`),t.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:`unknown`,message:r}]}),this.failureCallback?.({error:`Unable to pay with ApplePay`,body:r})})}getSuccessAddChargeHandler(e,t){return T(this,`[getSuccessAddChargeHandler]`,(e,n)=>{let r=JSON.parse(n);this.log(`[ApplePay], success`,r);let i={status:ApplePaySession.STATUS_SUCCESS,paymentToken:r};t.completePayment(i),this.successCallback?.({transactionId:r.chargeId})})}validateOptions(e,t,n,r){if(!il(n))throw q(e,`Invalid currency: `+n),TypeError(`invalid currency: `+n);if(!uc(t))throw q(e,`Invalid amount: `+t),TypeError(`invalid amount: `+t);if(!r.lineItemLabel)throw q(e,`Invalid lineItemLabel parameter`),TypeError(`Invalid lineItemLabel parameter`)}};d([w],Pf.prototype,`cleanUp`,null),d([w],Pf.prototype,`addApplePay`,null),d([w],Pf.prototype,`validateMerchant`,null),d([w],Pf.prototype,`addChargeWithApplePay`,null),d([w],Pf.prototype,`getFailureAddChargeHandler`,null),d([w],Pf.prototype,`getSuccessAddChargeHandler`,null),d([w],Pf.prototype,`validateOptions`,null),W();var Ff=L({__name:`ApplePayIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=`--size: ${e.size}px`;return(e,n)=>(R(),z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 210.2`,"xml:space":`preserve`,style:t},[...n[0]||=[B(`path`,{id:`XMLID_34_`,d:`M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9
|
|
140
|
+
left=${s}`),r(`newWindow`,d.value?.externalId)}else h.value=!0,g.value=!0,r(`popup`,d.value?.externalId);return!1}}function b(){h.value=!1,g.value=!1,u?.close(),r(`popupClose`)}return za(()=>{window.addEventListener(`message`,v),kc(i.value,`payfurl-combined-container`)||(o.value=!0,r(`activate`,n.options))}),Ua(()=>{window.removeEventListener(`message`,v)}),(e,t)=>(z(),B(U,null,[Dr(W(El,{"use-local":``},null,512),[[Es,!m.value]]),g.value&&!h.value?(z(),Ji(El,{key:0,message:`Finalise the payment`})):H(``,!0),V(`div`,{id:`payfurl-${s.value}-form`,class:`payfurl-checkout-form`,ref_key:`root`,ref:i},[V(`div`,{class:`container-form`,style:Me(`visibility: ${I(a)?`hidden`:`visible`}`)},[I(f)?(z(),B(`div`,Md,N(I(f)),1)):H(``,!0),V(`div`,Nd,[_.value?(z(),B(`button`,{key:0,onClick:y,type:`button`},N(p.value),1)):H(``,!0),c.value?(z(),B(`p`,Pd,N(c.value),1)):H(``,!0)])],4)],8,jd),h.value?(z(),Ji(Dd,{key:1,onClose:b,url:m.value,name:p.value},null,8,[`url`,`name`])):H(``,!0)],64))}});q();var Id=K(Fd,[[`__scopeId`,`data-v-ae6f5b6e`]]);_e(),ec(),nl(),pl(),yl(),Y();var Ld={CHECKOUT:`CHECKOUT`,CHECK_STATUS:`CHECK_STATUS`},Rd=(e,t)=>({[Ld.CHECKOUT]:{url:e+`/payment_method/checkout`,method:`POST`},[Ld.CHECK_STATUS]:{url:e+`/checkout/external/`+t,method:`GET`}}),zd=class{container=null;log;apiUrl=``;redirectUrl=``;checkStatusHandler=null;statusSettled=!1;successCallback=null;failureCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};constructor(e,t){this.log=e,this.apiUrl=t.apiUrl,this.redirectUrl=t.redirectUrl,this.successCallback=t.onSuccess||null,this.failureCallback=t.onFailure||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){this.container?.id===e?.id&&this.destroy?.()}addCheckout(e,t,n,r,i,a,o){this.log(`[addCheckout][${r}]`,{amount:t,providerId:i,providerType:r,options:a,checkoutOptions:o}),this.container=e;let s=!1,c,l=$s({el:e,component:Id,props:{log:this.log,providerType:r,options:{providerId:i,amount:t,currency:n,checkoutOptions:o},clickGate:this.getOnValidate.bind(this)},on:{activate:T(this,"[sdk][checkoutProcessor][${providerType}]: activate checkout form",e=>{if(s)return;s=!0,this.log(`[sdk][checkoutProcessor][${r}]: activate checkout form`,e);let t=()=>{s=!1};this.checkout(e,r,a,t),c=this.getMessageHandler(e,r,a,t).bind(this),window.addEventListener(`message`,c)}),popup:T(this,"[sdk][checkoutProcessor][${providerType}]: popup open",t=>{this.log(`[sdk][checkoutProcessor][${r}]: popup open`,t),this.checkStatus(e,t,r,c)}),popupClose:T(this,"[sdk][checkoutProcessor][${providerType}]: popup close",()=>{this.log(`[sdk][checkoutProcessor][${r}]: popup close`),this.stopCheckingStatus(null)}),newWindow:T(this,"[sdk][checkoutProcessor][${providerType}]: new window open",t=>{this.log(`[sdk][checkoutProcessor][${r}]: new window open`,t),this.checkStatus(e,t,r,c)}),newWindowClose:T(this,"[sdk][checkoutProcessor][${providerType}]: new window close",()=>{this.log(`[sdk][checkoutProcessor][${r}]: new window close`),this.stopCheckingStatus(null)})}});this.destroy=l.destroy}checkout(e,t,n,r){this.httpInvoker?.invoke(Rd(this.apiUrl)[Ld.CHECKOUT].url,Rd(this.apiUrl)[Ld.CHECKOUT].method,JSON.stringify({providerId:e.providerId,amount:e.amount,currency:e.currency,shippingAmount:n.shippingAmount,customer:{firstName:n.customer?.firstName,lastName:n.customer?.lastName,email:n.customer?.email,phone:n.customer?.phoneNumber,billingAddress:{name:n.billingAddress?.firstName+` `+n.billingAddress?.lastName,addressLine1:n.billingAddress?.streetAddress,addressLine2:n.billingAddress?.streetAddress2,suburb:n.billingAddress?.region,state:n.billingAddress?.state,countryCode:n.billingAddress?.country,postcode:n.billingAddress?.postalCode}},items:n.orderItems?.map(e=>({name:e.name,reference:e.sku,quantity:e.quantity,amount:e.totalAmount})),options:{...e.checkoutOptions,redirectUrl:this.redirectUrl},metadata:ku(n?.metadata)}),this.getSuccessCheckoutHandler(t).bind(this),T(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(e,n)=>{r?.(e,n),this.getFailureCheckoutHandler(t).bind(this)(e,n)}))}getSuccessCheckoutHandler(e){return T(this,"[sdk][checkoutProcessor][${providerType}]: successCheckoutHandler",(t,n)=>{this.log(`[sdk][checkoutProcessor][${e}]: successCheckoutHandler`,t,n);let r=JSON.parse(n),i=JSON.parse(window.atob(r.checkoutData));window.postMessage({status:jl,component:`checkout`,providerType:e,checkoutData:i},`*`)})}getFailureCheckoutHandler(e){return T(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(t,n)=>{this.log(`[sdk][checkoutProcessor][${e}]: failureCheckoutHandler`,t,n),xu().stopLoading(),window.postMessage({status:`error`,component:`checkout`,providerType:e,error:`Invalid payment details`,originalError:n},`*`);let r=`Invalid payment details`;try{r=JSON.parse(n)?.message||r}catch{}window.postMessage({status:kl,...Ad(e),reason:`error`,message:r},`*`)})}stopCheckingStatus(e){this.checkStatusHandler&&=(clearInterval(this.checkStatusHandler),null),e&&window.removeEventListener(`message`,e)}checkStatus(e,t,n,r){this.checkStatusHandler||(this.checkStatusHandler=setInterval(this.checkStatus.bind(this,e,t,n,r),5e3),this.statusSettled=!1,this.log(`[sdk][checkoutProcessor][${n}]: Starting polling...`));let i=this,a=T(this,`[sdk][checkoutProcessor][${n}]: failureCheckStatusHandler`,(e,t)=>{i.statusSettled||(i.statusSettled=!0,xu().stopLoading(),i.log(`[sdk][checkoutProcessor][${n}]: failureCheckStatusHandler`,e,t),window.postMessage({status:`message`,component:`checkout`,providerType:n,message:`Checkout has been cancelled`},`*`),i.failureCallback?.({error:`Checkout has been cancelled`,body:t}))}),o=T(this,`[sdk][checkoutProcessor][${n}]: successCheckStatusHandler`,(t,r)=>{if(i.statusSettled)return;i.statusSettled=!0,xu().stopLoading(),i.log(`[sdk][checkoutProcessor][${n}]: successCheckStatusHandler`,{transactionId:t,token:r}),tl(e,`Transaction in progress. Please don't close the window or navigate away`);let a={};t&&(a.transactionId=t),r&&(a.token=r),i.successCallback?.(a)});this.httpInvoker?.invoke(Rd(this.apiUrl,t)[Ld.CHECK_STATUS].url,Rd(this.apiUrl,t)[Ld.CHECK_STATUS].method,{},T(this,`[sdk][checkoutProcessor][${n}]: checkStatus, success`,(e,t)=>{let n=JSON.parse(t);if(this.log(`checkoutStatus`,n),!n)return this.stopCheckingStatus(r),a(e,t);if(n.status==`SUCCESS`&&n.status===`SUCCESS`)return this.stopCheckingStatus(r),o(n.transactionId,n.tokenId)}),T(this,`[sdk][checkoutProcessor][${n}]: checkStatus, failure`,(e,t)=>(this.log(`[sdk][checkoutProcessor][${n}]: checkStatus`,{status:e,body:t}),this.stopCheckingStatus(r),a(e,t))))}getMessageHandler(e,t,n,r){return T(this,`[sdk][checkoutProcessor][${t}]: message received`,i=>{if(i?.data?.status){if(i.data.status===`set-amount`){if(Number(e.amount)==Number(i.data.amount))return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,i.data),e.amount=Number(i.data.amount),this.checkout(e,t,n,r)}else if(i.data.status===`set-currency`){if(e.currency==i.data.currency)return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,i.data),e.currency=i.data.currency,this.checkout(e,t,n,r)}}})}};d([w],zd.prototype,`cleanUp`,null),d([w],zd.prototype,`addCheckout`,null),d([w],zd.prototype,`checkout`,null),d([w],zd.prototype,`getSuccessCheckoutHandler`,null),d([w],zd.prototype,`getFailureCheckoutHandler`,null),d([w],zd.prototype,`stopCheckingStatus`,null),d([w],zd.prototype,`checkStatus`,null),d([w],zd.prototype,`getMessageHandler`,null),_e(),pl(),yl();var Bd={CHECK_FRAUD:`CHECK_FRAUD`,RESOLVE_THREE_DS:`RESOLVE_THREE_DS`,CANCEL_THREE_DS:`CANCEL_THREE_DS`},Vd=e=>({[Bd.CHECK_FRAUD]:{url:e+`/fraud_check`,method:`POST`},[Bd.RESOLVE_THREE_DS]:{url:e+`/3ds/result`,method:`POST`},[Bd.CANCEL_THREE_DS]:{url:e+`/3ds/cancel`,method:`POST`}});function Hd(e){try{return JSON.parse(e)}catch{return}}function Ud(e){return typeof e?.decision==`string`&&typeof e?.transactionId==`string`}var Wd=class{providerId=``;stopPaymentOnFailure=!1;log;apiUrl=``;getFraudCheckData;metadata={};amount=0;currency=`AUD`;address=null;customer=null;order=null;paymentInformation=null;paypalInformation=null;paymentReference=null;walletInformation=null;httpInvoker=null;constructor(e,t){this.log=e,this.providerId=t.providerId,this.stopPaymentOnFailure=t.stopPaymentOnFailure,this.apiUrl=t.apiUrl,this.metadata=t.metadata,this.getFraudCheckData=t.getFraudCheckData;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}fraudCheck(e,t){if(!this.paymentInformation&&!this.paypalInformation&&!this.paymentReference&&!this.walletInformation)return t({error:`Payment information is required`});this.log(`[fraudCheck]`,{amount:this.amount,currency:this.currency,paymentInformation:this.paymentInformation,paypalInformation:this.paypalInformation,paymentReference:this.paymentReference,walletInformation:this.walletInformation,customer:this.customer,address:this.address,order:this.order,metadata:this.metadata}),this.httpInvoker?.invoke(Vd(this.apiUrl)[Bd.CHECK_FRAUD].url,Vd(this.apiUrl)[Bd.CHECK_FRAUD].method,this.getFraudCheckData(this.providerId,this.amount,this.currency,this.paymentInformation,this.paypalInformation,this.customer,this.address,this.order,this.metadata,this.paymentReference,this.walletInformation),T(this,`[fraudCheck], success`,(n,r)=>{this.log(`[fraudCheck], success`,n,r,this.stopPaymentOnFailure);let i=Hd(r);if(!Ud(i))return t({error:`Fraud Check Failed`,body:r});i.providerId=this.providerId,i.stopPaymentOnFailure=this.stopPaymentOnFailure,e(i)}),T(this,`[fraudCheck], failure`,(e,n)=>{this.log(`[fraudCheck], failure`,e,n),t({error:`Fraud Check Failed`,body:n})}))}resolveThreeDsResult(e,t,n){this.httpInvoker?.invoke(Vd(this.apiUrl)[Bd.RESOLVE_THREE_DS].url,Vd(this.apiUrl)[Bd.RESOLVE_THREE_DS].method,JSON.stringify({threeDSServerTransID:e}),T(this,`[resolveThreeDsResult], success`,(e,r)=>{this.log(`[resolveThreeDsResult], success`,e,r);let i=Hd(r);if(i==null)return n({error:`3DS result resolution failed`,body:r});t(i)}),T(this,`[resolveThreeDsResult], failure`,(e,t)=>{this.log(`[resolveThreeDsResult], failure`,e,t),n({error:`3DS result resolution failed`,body:t})}))}cancelThreeDsOrder(e,t,n){this.httpInvoker?.invoke(Vd(this.apiUrl)[Bd.CANCEL_THREE_DS].url,Vd(this.apiUrl)[Bd.CANCEL_THREE_DS].method,JSON.stringify({threeDSServerTransID:e}),T(this,`[cancelThreeDsOrder], success`,(e,n)=>{this.log(`[cancelThreeDsOrder], success`,e,n),t({})}),T(this,`[cancelThreeDsOrder], failure`,(e,t)=>{this.log(`[cancelThreeDsOrder], failure`,e,t),n({error:`3DS cancel notification failed`,body:t})}))}setAmount(e){this.amount=e}setCurrency(e){this.currency=e}setAddressInfo(e){this.address={...e}}setCustomerInfo(e){this.customer={...e}}setOrderInfo(e){this.order={...e}}setPaymentInfo(e){this.paymentInformation={...e},this.paypalInformation=null,this.paymentReference=null,this.walletInformation=null}setPaymentReference(e){this.paymentReference={...e},this.paymentInformation=null,this.paypalInformation=null,this.walletInformation=null}setPaypalInfo(e){this.paypalInformation={...e},this.paymentInformation=null,this.paymentReference=null,this.walletInformation=null}setWalletInfo(e){this.walletInformation={...e},this.paymentInformation=null,this.paypalInformation=null,this.paymentReference=null}getProviderId(){return this.providerId}};d([w],Wd.prototype,`fraudCheck`,null),d([w],Wd.prototype,`resolveThreeDsResult`,null),d([w],Wd.prototype,`cancelThreeDsOrder`,null);function Gd(e,t){if(!e||typeof MutationObserver>`u`)return t(),()=>{};let n=new MutationObserver(e=>{e.some(e=>e.addedNodes.length)&&(n.disconnect(),t())});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()}var Kd=o((()=>{}));Y(),Kd();var qd=18e4,Jd=3e4,Yd=`Payment couldn't be processed`;function Xd(e){return new Promise((t,n)=>{e.fraudCheck(e=>t(e),e=>n(Error(e?.error||`Fraud check failed`)))})}async function Zd(e,t,n,r={}){if(!e)return{};let i;try{i=await Xd(e)}catch(e){return r.log?.(`fraud check failed`,e),{error:e.message}}if(Du(i))return{error:Yd};if(!i.managedOrderToken)return{fraudCheckResult:i};let a=await Qd(e,t,i,n,r);return a?{error:cu,reason:a}:{fraudCheckResult:i,threeDSServerTransID:i.threeDSServerTransID}}async function Qd(e,t,n,r,i={}){i.onProgress?.({step:`started`});let a=await $d(e,t,n,r,i);return i.onProgress?.(a?{step:`completed`,success:!1,error:a}:{step:`completed`,success:!0}),a}async function $d(e,t,n,r,i){let{managedOrderToken:a,threeDSServerTransID:o}=n;if(!a)return`3DS challenge could not be started`;try{await ef(t,a,r,i)}catch(e){return i.log?.(`manageOrder challenge failed`,e),`Unable to complete 3DS challenge`}let s;try{s=await tf(e,o)}catch(e){return i.log?.(`3ds/result resolution failed`,e),`Unable to resolve 3DS result`}return s?.status===`success`?null:(i.log?.(`3ds/result not successful`,s),await nf(e,o,i),`3DS authentication failed`)}function ef(e,t,n,r){return new Promise((i,a)=>{if(!e){a(Error(`Forter managed-order challenge is not available`));return}let o=!1,s=!1,c,l=e=>{o||(o=!0,clearTimeout(u),d(),c?.(),s&&r.onHide?.(),e())},u=setTimeout(()=>l(()=>a(Error(`3DS challenge timed out`))),qd),d=Gd(n,()=>{o||(s=!0,r.onShow?.(),r.onProgress?.({step:`challenge`}))}),f=e=>l(()=>a(e instanceof Error?e:Error(String(e))));try{c=e(t,n,e=>{e?f(e):l(i)})}catch(e){f(e)}})}function tf(e,t){return new Promise((n,r)=>{if(!t){r(Error(`threeDSServerTransID is missing`));return}let i=!1,a=e=>{i||(i=!0,clearTimeout(o),e())},o=setTimeout(()=>a(()=>r(Error(`3DS result timed out`))),Jd);e.resolveThreeDsResult(t,e=>a(()=>n(e)),e=>a(()=>r(Error(e?.error||`3DS result resolution failed`))))})}function nf(e,t,n){return new Promise(r=>{t?e.cancelThreeDsOrder(t,()=>r(),e=>{n.log?.(`cancel notification failed`,e),r()}):r()})}function rf(e){return e==null||typeof e==`string`?e:void 0}function af(e){if(!e)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t==`object`&&t&&!Array.isArray(t)&&typeof t.code==`number`&&typeof t.isRetryable==`boolean`)return{code:t.code,isRetryable:t.isRetryable,message:rf(t.message),gatewayCode:rf(t.gatewayCode),gatewayMessage:rf(t.gatewayMessage),type:rf(t.type)}}function of(e,t){let n={onClick:e};if(!t)return n;for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}G(),Dl(),he(),Y();var sf={style:{position:`relative`}},cf={key:0,class:`error text-normal`},lf=`payfurl-googlepay-script`,uf=R({__name:`GooglePayForm`,props:{log:{type:Function},el:{},environment:{},amount:{},currency:{},options:{},clickGate:{type:Function}},emits:[`complete`,`activate`,`close`,`error`],setup(e,{emit:t}){let n=e,r=t,i=F(null),a=F(n.amount),o=F(n.currency),s=F(!0),c=F(``),l=!1,{isLoading:u}=xu();function d(){if(l)return;if(l=!0,document.getElementById(lf)){b();return}window.google=null;let e=document.createElement(`script`);e.src=`https://pay.google.com/gp/p/js/pay.js`,e.type=`text/javascript`,e.id=lf,e.onload=b,e.onerror=()=>{e.remove(),ee(`error`,`Google Pay script failed to load`)},document.body.appendChild(e)}let f=null;function p(){return f===null&&(f=new window.google.payments.api.PaymentsClient({environment:n.environment==C.PRODUCTION?`PRODUCTION`:`TEST`})),f}let m={type:`CARD`,parameters:{allowedAuthMethods:[`PAN_ONLY`,`CRYPTOGRAM_3DS`],allowedCardNetworks:[`AMEX`,`DISCOVER`,`INTERAC`,`JCB`,`MASTERCARD`,`VISA`]}};function h(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[m]}}function g(){let e=p().createButton(of(v,n.options.buttonOptions));n.el.appendChild(e)}function _(){return n.environment==C.PRODUCTION?{merchantName:n.options.googlePayMerchantName??`Example Merchant`,merchantId:n.options.googlePayMerchantId}:{merchantName:n.options.googlePayMerchantName??`Example Merchant`}}function v(){if(n.log(`[onGooglePaymentButtonClicked]`),n.clickGate()?.()===!1)return;let e=y(),t=p();n.log(`[paymentData], request`,e),t.loadPaymentData(e).then(function(e){n.log(`[paymentData], success`,e);let t=JSON.parse(e.paymentMethodData.tokenizationData.token);e.paymentMethodData.tokenizationData={...e.paymentMethodData.tokenizationData,...t},r(`complete`,e)}).catch(function(e){n.log(`[paymentData], error`,e),e?.statusCode!==`CANCELED`&&r(`error`,e?.statusMessage||e?.message||`Google Pay failed`)})}function y(){let e=n.options.billingDetailsRequired===!0;return{apiVersion:2,apiVersionMinor:0,...e?{emailRequired:!0}:{},allowedPaymentMethods:[{...m,parameters:{...m.parameters,...e?{billingAddressRequired:!0,billingAddressParameters:{format:`FULL`}}:{}},tokenizationSpecification:{type:`PAYMENT_GATEWAY`,parameters:{gateway:n.options.gateway,gatewayMerchantId:n.options.googlePayGatewayMerchantId}}}],transactionInfo:{totalPriceStatus:`FINAL`,countryCode:`AU`,currencyCode:o.value,totalPrice:Number(a.value).toFixed(2)},merchantInfo:_()}}function b(){p().isReadyToPay(h()).then(function(e){e.result?(g(),window.postMessage({status:Ol,paymentMethod:`googlepay`},`*`)):ee(`unsupported`)}).catch(function(e){console.error(`Load GooglePay error`,e),ee(`error`,e?.statusMessage||e?.message||`Google Pay availability check failed`)})}function ee(e,t){window.postMessage({status:kl,paymentMethod:`googlepay`,reason:e,message:t},`*`)}function te(e){e?.data?.status&&(e.data.status===`activate`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),s.value=!0,r(`activate`),d()),e.data.status===`deactivate`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),s.value=!1),e.data.status===`message`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),c.value=e.data.message),e.data.status===`error`&&e.data.component===`googlepay`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),c.value=e.data.error),e.data.status===`set-amount`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),a.value=Number(e.data.amount)),e.data.status===`set-currency`&&(n.log?.(`[GooglePay]: message "${e.data.status}" received`,e.data),o.value=e.data.currency))}return Ua(()=>{window.removeEventListener(`message`,te)}),za(()=>{window.addEventListener(`message`,te),kc(i.value,`payfurl-combined-container`)||(s.value=!0,r(`activate`),d())}),(e,t)=>(z(),B(U,null,[V(`div`,sf,[Dr(W(El,null,null,512),[[Es,I(u)]])]),V(`div`,{style:{position:`relative`},ref_key:`root`,ref:i},[c.value?(z(),B(`div`,cf,N(c.value),1)):H(``,!0)],512)],64))}});pl(),yl(),_e(),nl(),vc(),ec();var df={ADD_CHARGE_WITH_GOOGLE_PAY:`ADD_CHARGE_WITH_GOOGLE_PAY`},ff=e=>({[df.ADD_CHARGE_WITH_GOOGLE_PAY]:{url:e+`/charge/token/google`,method:`POST`}}),pf=class{container=null;log;apiUrl=``;environment=``;failureCallback=null;successCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};amount=0;currency=``;billingAddress=null;customer=null;order=null;fraudProcessor=null;constructor(e,t){this.log=e,this.environment=t.environment,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setAmount(e){this.amount=e}setCurrency(e){this.currency=e}setCustomerInfo(e){this.customer={...e}}setBillingAddress(e){this.billingAddress={...e}}setOrderInfo(e){this.order={...e}}addFraudProcessor(e){this.fraudProcessor=e}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){e===this.container&&this.destroy?.()}addGooglePay(e,t,n,r,i){this.log(`[addGooglePay]`,{providerId:t,amount:n,currency:r,options:i});let a=this.fraudProcessor;this.validateOptions(e,n,r,i),this.setAmount(n),this.setCurrency(r);let o=!1;this.container=e;let s=$s({el:e,component:uf,props:{log:this.log,el:e,environment:this.environment,amount:this.amount,currency:this.currency,options:i,clickGate:this.getOnValidate.bind(this)},on:{activate:T(this,`[GooglePay]: activate`,()=>{o||(o=!0,this.log(`[GooglePay]: activate googlepay form`))}),complete:T(this,`[GooglePay]: complete`,n=>{this.log(`[GooglePay]: complete`,n);let r=n.paymentMethodData.info.billingAddress,[o,...s]=r?.name?.trim().split(/\s+/)??[],c=this.billingAddress?{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}:r&&{line1:r.address1,line2:r.address2,city:r.locality,country:r.countryCode,postalCode:r.postalCode,state:r.administrativeArea},l={amount:this.amount,currency:this.currency,paymentData:{paymentMethodData:{tokenizationData:{intermediateSigningKey:n.paymentMethodData.tokenizationData.intermediateSigningKey,protocolVersion:n.paymentMethodData.tokenizationData.protocolVersion,signature:n.paymentMethodData.tokenizationData.signature,signedMessage:n.paymentMethodData.tokenizationData.signedMessage}},paymentInfo:{cardDetails:n.paymentMethodData.info.cardDetails,cardNetwork:n.paymentMethodData.info.cardNetwork}},firstName:this.customer?.firstName||o,lastName:this.customer?.lastName||s.join(` `)||o,email:this.customer?.email||n.email,phone:this.customer?.phoneNumber,address:c||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(e=>({description:e.name,productCode:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice),unitOfMeasure:e.unitOfMeasure}))}||void 0,metadata:ku(i?.metadata)};this.fraudCheckAndCharge(e,t,l,a)}),error:T(this,`[GooglePay]: error`,t=>{this.log(`[GooglePay]: error`,t),J(e,`Unable to pay with Google Pay`),this.failureCallback?.({error:`Unable to pay with Google Pay`,body:t})})}});this.destroy=s.destroy}fraudCheckAndCharge(e,t,n,r){let i=(t,n)=>{J(e,t),this.failureCallback?.({error:t,...n&&{errorDetails:{reason:n}}})};r?.setAmount(this.amount),r?.setCurrency(this.currency),this.customer&&r?.setCustomerInfo(this.customer),this.billingAddress&&r?.setAddressInfo(this.billingAddress),this.order&&r?.setOrderInfo(this.order),r?.setWalletInfo({type:`GOOGLEPAY`,lastFourDigits:n.paymentData.paymentInfo.cardDetails}),Zd(r,null,e,{log:this.log}).then(r=>{if(`error`in r)return i(r.error,r.reason);this.addChargeWithGooglePay(e,t,{...n,fraudCheck:r.fraudCheckResult})}).catch(()=>i(`Unable to pay with Google Pay`))}addChargeWithGooglePay(e,t,n){this.log(`[addChargeWithGooglePay]`,n),this.httpInvoker?.invoke(ff(this.apiUrl)[df.ADD_CHARGE_WITH_GOOGLE_PAY].url,ff(this.apiUrl)[df.ADD_CHARGE_WITH_GOOGLE_PAY].method,JSON.stringify(n),this.getSuccessAddChargeHandler(e).bind(this),this.getFailureAddChargeHandler(e).bind(this),{providerId:t})}getFailureAddChargeHandler(e){return T(this,`[GooglePay], failure`,(t,n)=>{this.log(`[GooglePay], failure`,n),J(e,`Unable to pay with Google Pay`),this.failureCallback?.({error:`Unable to pay with Google Pay`,body:n})})}getSuccessAddChargeHandler(e){return T(this,`[GooglePay], success`,(e,t)=>{let n=JSON.parse(t);this.log(`[GooglePay], success`,n),this.successCallback?.({transactionId:n.chargeId})})}validateOptions(e,t,n,r){if(!al(n))throw J(e,`Invalid currency: `+n),TypeError(`invalid currency: `+n);if(!dc(t))throw J(e,`Invalid amount: `+t),TypeError(`invalid amount: `+t);if(!r.gateway)throw J(e,`Invalid gateway parameter`),TypeError(`Invalid gateway parameter`);if(!r.googlePayGatewayMerchantId)throw J(e,`Invalid gateway merchant id parameter`),TypeError(`Invalid gateway merchant id parameter`)}};d([w],pf.prototype,`cleanUp`,null),d([w],pf.prototype,`addGooglePay`,null),d([w],pf.prototype,`addChargeWithGooglePay`,null),d([w],pf.prototype,`getFailureAddChargeHandler`,null),d([w],pf.prototype,`getSuccessAddChargeHandler`,null),d([w],pf.prototype,`validateOptions`,null);var mf=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},hf=[`supports3DS`],gf=[`visa`,`masterCard`,`amex`,`discover`];function _f(e){try{return typeof ApplePaySession<`u`&&ApplePaySession.supportsVersion(e)===!0}catch{return!1}}function vf(){for(let e=14;e>3;e--)if(_f(e))return e;return 3}function yf(e){return e&&_f(e)?e:vf()}function bf(e){return e?.length?[...new Set([`supports3DS`,...e])]:hf}function xf(e,t,n){let r={countryCode:e.countryCode||`AU`,currencyCode:t,merchantCapabilities:bf(e.merchantCapabilities),supportedNetworks:e.supportedNetworks?.length?e.supportedNetworks:gf,total:{label:e.lineItemLabel||``,type:`final`,amount:Number(n).toFixed(2)}};return e.supportedCountries?.length&&(r.supportedCountries=e.supportedCountries),r}var Sf=`payfurl-applepay-script`,Cf=`https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js`,wf=1e4,Tf=null;function Ef(){return!!window.ApplePaySession&&!!window.customElements?.get(`apple-pay-button`)}function Df(){return typeof window>`u`||typeof document>`u`||Ef()?Promise.resolve():Tf||(Tf=new Promise(e=>{let t=setTimeout(()=>e(),wf),n=()=>{clearTimeout(t),e()};try{let e=document.createElement(`script`);e.id=Sf,e.src=Cf,e.type=`text/javascript`,e.crossOrigin=`anonymous`,e.addEventListener(`load`,n,{once:!0}),e.addEventListener(`error`,n,{once:!0}),document.head.appendChild(e)}catch{n()}}),Tf)}G(),Dl(),Y();var Of={style:{position:`relative`}},kf={key:0,class:`error text-normal`},Af=R({__name:`ApplePayForm`,props:{log:{type:Function},el:{},environment:{},amount:{},currency:{},options:{},clickGate:{type:Function}},emits:[`submit`,`validateMerchant`,`activate`,`close`,`error`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=F(null),a=F(n.amount),o=F(n.currency),s=F(!0),c=F(``),l=!1,{isLoading:u}=xu();function d(){if(n.log(`[onApplePayButtonClicked]`),!ApplePaySession||n.clickGate()?.()===!1)return;let e=xf(n.options,o.value,a.value),t=yf(n.options.applePayVersion);n.log(`[onApplePayButtonClicked], Create ApplePaySession`,e,t);let i=new ApplePaySession(t,e);i.onvalidatemerchant=e=>{let t=e.validationURL;r(`validateMerchant`,{validationUrl:t,domainName:window.location.hostname},i)},i.onpaymentauthorized=e=>{n.log(`[onpaymentauthorized]`,e),r(`submit`,e.payment,i)},i.oncancel=e=>{n.log(`[oncancel]`,e),r(`cancel`)},i.begin()}function f(){l||(l=!0,window.google=null,Df().then(()=>{let e=document.createElement(`apple-pay-button`);e.buttonstyle=`black`,e.locale=`en-US`,e.type=`buy`,e.onclick=d,i.value?.appendChild(e),window.postMessage({status:Ol,paymentMethod:`applepay`},`*`)}))}function p(e){e?.data?.status&&(e.data.status===`activate`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),s.value=!0,r(`activate`),f()),e.data.status===`deactivate`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),s.value=!1),e.data.status===`message`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),c.value=e.data.message),e.data.status===`error`&&e.data.component===`applepay`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),c.value=e.data.error),e.data.status===`set-amount`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),a.value=Number(e.data.amount)),e.data.status===`set-currency`&&(n.log?.(`[ApplePay]: message "${e.data.status}" received`,e.data),o.value=e.data.currency))}return Ua(()=>{window.removeEventListener(`message`,p)}),za(()=>{window.addEventListener(`message`,p),kc(i.value,`payfurl-combined-container`)||(s.value=!0,r(`activate`),f())}),(e,t)=>(z(),B(U,null,[V(`div`,Of,[Dr(W(El,null,null,512),[[Es,I(u)]])]),V(`div`,{style:{position:`relative`},ref_key:`root`,ref:i},[c.value?(z(),B(`div`,kf,N(c.value),1)):H(``,!0)],512)],64))}}),jf=c({}),Mf=o((()=>{})),Nf=c({}),Pf=o((()=>{})),Ff=c({PayWayAppleButton:()=>Rf}),If,Lf,Rf,zf=o((()=>{pl(),yl(),_e(),If={CHECKOUT:`CHECKOUT`,CHARGE:`CHARGE`},Lf=e=>({[If.CHECKOUT]:{url:e+`/payment_method/checkout`,method:`POST`},[If.CHARGE]:{url:e+`/charge/checkout`,method:`POST`}}),Rf=class{log;container;button=null;validator=null;validationError=null;providerId;apiUrl;amount;currency;clientParameters;billingAddress=null;customer=null;order=null;buttonId=`apple-pay-payway-button`;validatorId=`apple-pay-payway-button-validator`;onLoad=()=>{};onSuccess;onFailure;userOnValidate;httpInvoker=null;constructor(e,t,n,r,i,a){this.log=e,this.apiUrl=a.apiUrl,this.container=t||document.body,this.clientParameters=a.clientParameters,this.providerId=a.providerId,this.amount=Number(r),this.currency=i,this.providerId=n,this.onSuccess=a.onSuccess||null,this.onFailure=a.onFailure||null,this.userOnValidate=a.onValidate;let o=new fl(a.environment,hl(a.publicKey));this.httpInvoker=new ge(a.publicKey,a.version,o),this.init(),setInterval(()=>{this.validator&&(this.userOnValidate?.()===!1?this.validator.style.display=`block`:(this.validator.style.display=`none`,this.validationError&&(this.validationError.style.display=`none`)))},1e3)}draw(){let e=()=>{this.onLoad=()=>{};let e={container:this.buttonId,publishableApiKey:this.clientParameters.PublishableApiKey,principalAmount:this.amount,currency:String(this.currency).toLowerCase(),buttonMode:`callback`};this.log(`[createPaymentRequestButton]`,e),window.payway.createPaymentRequestButton(e,(e,t)=>{this.log(`[createPaymentRequestButton]`,e,t),e?this.onFailure?.(e):this.checkout(t.singleUseTokenId)}),this.addValidator()};window.payway?e():this.onLoad=e}show(){this.button&&(this.button.style.display=`block`)}hide(){this.button&&(this.button.style.display=`none`)}init(){let e=document.createElement(`div`);e.id=this.buttonId,e.style.position=`relative`,this.container.appendChild(e),this.button=e,this.initScript()}addValidator(){if(document.getElementById(this.validatorId))return;let e=document.createElement(`div`);e.id=this.validatorId,e.style.width=`100%`,e.style.height=`100%`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.display=`none`,this.button?.appendChild(e),this.validator=e}initScript(){let e=document.createElement(`script`);e.src=`https://api.payway.com.au/rest/v1/payway.js`,e.onload=()=>{this.onLoad&&this.onLoad()},document.head.appendChild(e)}checkout(e){let t={providerId:this.providerId,amount:this.amount,currency:this.currency,reference:this.order?.orderNumber,options:{ProviderToken:e},customer:{firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email,phone:this.customer?.phoneNumber,billingAddress:this.billingAddress&&{name:`${this.billingAddress.firstName} ${this.billingAddress.lastName}`,addressLine1:this.billingAddress.streetAddress,addressLine2:this.billingAddress.streetAddress2,suburb:this.billingAddress.city,countryCode:this.billingAddress.country,postcode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0},items:this.order&&this.order.orderItems.map(e=>({name:e.name,reference:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice)}))||[]};this.log(`[PayWayAppleButton][checkout]`,t),this.httpInvoker?.invoke(Lf(this.apiUrl)[If.CHECKOUT].url,Lf(this.apiUrl)[If.CHECKOUT].method,JSON.stringify(t),(e,t)=>{this.log(`[PayWayAppleButton][checkout]: successCheckoutHandler`,e,t);let n=JSON.parse(t),r=JSON.parse(window.atob(n.checkoutData));this.log(`[PayWayAppleButton][checkout]: decodedData`,r),this.charge(r.checkoutId)},(e,t)=>{this.log(`[PayWayAppleButton][checkout]: failureCheckoutHandler`,e,t);let n=JSON.parse(t);this.onFailure?.({error:n.message})})}charge(e){this.log(`[PayWayAppleButton][charge]`,{checkoutId:e}),this.httpInvoker?.invoke(Lf(this.apiUrl)[If.CHARGE].url,Lf(this.apiUrl)[If.CHARGE].method,JSON.stringify({checkoutId:e}),(e,t)=>{this.log(`[PayWayAppleButton][charge]: successChargeHandler`,e,t);let n=JSON.parse(t);this.onSuccess?.({transactionId:n?.chargeId})},(e,t)=>{this.log(`[PayWayAppleButton][charge]: failureChargeHandler`,e,t);let n=JSON.parse(t);this.onFailure?.({error:n.message})})}redraw(){this.button&&(this.button.innerHTML=``,this.draw())}setAmount(e){this.log(`[PayWayAppleButton][setAmount]`,e),this.amount=e,this.redraw()}setCurrency(e){this.log(`[PayWayAppleButton][setCurrency]`,e),this.currency=e,this.redraw()}setCustomerInfo(e){this.log(`[PayWayAppleButton][setCustomerInfo]`,e),this.customer={...e}}setBillingAddress(e){this.log(`[PayWayAppleButton][setBillingAddress]`,e),this.billingAddress={...e}}setOrderInfo(e){this.log(`[PayWayAppleButton][setOrderInfo]`,e),this.order={...e}}}})),Bf=c({default:()=>Vf});function Vf(e,t,n,r,i,a){return new Rf(e,t,n,r,i,a)}var Hf=o((()=>{zf()}));pl(),yl(),_e(),nl(),vc(),ec(),Y();var Uf={VALIDATE_MERCHANT:`VALIDATE_MERCHANT`,ADD_CHARGE_WITH_APPLE_PAY:`ADD_CHARGE_WITH_APPLE_PAY`},Wf=e=>({[Uf.VALIDATE_MERCHANT]:{url:e+`/charge/token/apple/validate`,method:`POST`},[Uf.ADD_CHARGE_WITH_APPLE_PAY]:{url:e+`/charge/token/apple`,method:`POST`}}),Gf=class{container=null;log;apiUrl=``;environment=``;publicKey=``;version=``;applePayButton=null;failureCallback=null;successCallback=null;userOnValidate;httpInvoker=null;destroy=()=>{};amount=0;currency=``;billingAddress=null;customer=null;order=null;fraudProcessor=null;constructor(e,t){this.log=e,this.environment=t.environment,this.apiUrl=t.apiUrl,this.publicKey=t.publicKey,this.version=t.version,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setAmount(e){this.amount=e,this.applePayButton?.setAmount(e)}setCurrency(e){this.currency=e,this.applePayButton?.setCurrency(e)}setCustomerInfo(e){this.customer={...e},this.applePayButton?.setCustomerInfo(e)}setBillingAddress(e){this.billingAddress={...e},this.applePayButton?.setBillingAddress(e)}setOrderInfo(e){this.order={...e},this.applePayButton?.setOrderInfo(e)}addFraudProcessor(e){this.fraudProcessor=e}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}cleanUp(e){e?.id===this.container?.id&&this.destroy?.()}addApplePay(e,t,n,r,i){this.log(`[addApplePay]`,{providerId:t,amount:n,currency:r,options:i});let a=this.fraudProcessor;this.validateOptions(e,n,r,i),this.setAmount(n),this.setCurrency(r);let o=!1;this.container=e;let s=T(this,`[ApplePay][renderDefaultComponent]`,()=>{this.log(`[addApplePay], renderDefaultComponent`,{providerId:t,amount:n,currency:r,options:i});let s=$s({el:e,component:Af,props:{log:this.log,el:e,environment:this.environment,amount:this.amount,currency:this.currency,options:i,clickGate:this.getOnValidate.bind(this)},on:{activate:()=>{o||(o=!0,this.log(`activate applepay form`))},validateMerchant:T(this,`[addApplePay], validateMerchant`,(n,r)=>{this.log(`[ApplePay]: validate`,n),this.validateMerchant(e,t,n,r)}),submit:T(this,`[addApplePay], submit`,(n,r)=>{this.log(`[ApplePay]: complete`,n);let o={amount:this.amount,currency:this.currency,token:n.token,firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email,phone:this.customer?.phoneNumber,address:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(e=>({description:e.name,productCode:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice)}))}||void 0,metadata:i.metadata};this.fraudCheckAndCharge(e,t,o,r,a)}),error:T(this,`[addApplePay], error`,(t,n)=>{this.log(`[ApplePay]: error`,t),J(e,`Unable to pay with ApplePay`),n.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:`unknown`,message:t}]}),this.failureCallback?.({error:`Unable to pay with ApplePay`,body:t})}),cancel:T(this,`[addApplePay], calcel`,()=>{this.log(`[ApplePay]: cancel`),J(e,`ApplePay canceled`),this.failureCallback?.({error:`ApplePay canceled`})})}});this.destroy=s.destroy}),c=T(this,`[ApplePay][renderCustomComponent]`,a=>{this.log(`[addApplePay], renderCustomComponent`,{providerId:t,amount:n,currency:r,options:i}),this.applePayButton=a.default(this.log.bind(this),e,i.providerId,n,r,{environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,version:this.version,options:i,clientParameters:i.clientParameters,onValidate:this.getOnValidate.bind(this),onSuccess:T(this,`[addApplePay], success`,e=>{this.log(`[addApplePay], success`,e),this.applePayButton?.hide();let t={token:e.token,transactionId:e.transactionId};e.clickToPayData&&(t.clickToPayData=e.clickToPayData),this.successCallback?.(t)}),onFailure:T(this,`[addApplePay], failure`,e=>{this.log(`[addApplePay], failure`,e),this.applePayButton?.redraw(),this.failureCallback?.({error:e.error})})}),this.billingAddress&&this.applePayButton?.setBillingAddress(this.billingAddress),this.customer&&this.applePayButton?.setCustomerInfo(this.customer),this.order&&this.applePayButton?.setOrderInfo(this.order),this.applePayButton?.draw(),window.postMessage({status:Ol,paymentMethod:`applepay`},`*`)});mf(Object.assign({"./applepay/ApplePayButton.interface.ts":()=>Promise.resolve().then(()=>(Mf(),jf)),"./applepay/ApplePayButtonOptions.type.ts":()=>Promise.resolve().then(()=>(Pf(),Nf)),"./applepay/PayWayAppleButton.ts":()=>Promise.resolve().then(()=>(zf(),Ff)),"./applepay/payway_rest.ts":()=>Promise.resolve().then(()=>(Hf(),Bf))}),`./applepay/${i.providerType?.toLowerCase()}.ts`,3).then(T(this,`[localAddApplePay], then`,e=>{this.log(`Loading ${i.providerType}...`,e),c(e)})).catch(()=>{this.log(`Error loading ${i.providerType}`),s()})}validateMerchant(e,t,n,r){this.log(`[validateMerchant]`,n),this.httpInvoker?.invoke(Wf(this.apiUrl)[Uf.VALIDATE_MERCHANT].url,Wf(this.apiUrl)[Uf.VALIDATE_MERCHANT].method,JSON.stringify(n),T(this,`[validateMerchant], success`,(e,t)=>{try{let e=JSON.parse(t);this.log(`[validateMerchant], success`,e),r.completeMerchantValidation(e)}catch(e){this.log(`error parsing validateMerchant response`,e)}}),T(this,`[validateMerchant], failure`,(t,n)=>{this.log(`[validateMerchant], failure`,n),J(e,`Unable to pay with ApplePay`),this.failureCallback?.({error:`Unable to pay with ApplePay`,body:n})}),{providerId:t})}fraudCheckAndCharge(e,t,n,r,i){let a=(t,n)=>{J(e,t),r.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[]}),this.failureCallback?.({error:t,...n&&{errorDetails:{reason:n}}})},o=n.token.paymentMethod?.displayName?.slice(-4);i?.setAmount(this.amount),i?.setCurrency(this.currency),this.customer&&i?.setCustomerInfo(this.customer),this.billingAddress&&i?.setAddressInfo(this.billingAddress),this.order&&i?.setOrderInfo(this.order),i?.setWalletInfo({type:`APPLEPAY`,lastFourDigits:/^\d{4}$/.test(o??``)?o:void 0}),Zd(i,null,e,{log:this.log}).then(i=>{if(`error`in i)return a(i.error,i.reason);this.addChargeWithApplePay(e,t,{...n,fraudCheck:i.fraudCheckResult},r)}).catch(()=>a(`Unable to pay with ApplePay`))}addChargeWithApplePay(e,t,n,r){this.log(`[addChargeWithApplePay]`,n),this.httpInvoker?.invoke(Wf(this.apiUrl)[Uf.ADD_CHARGE_WITH_APPLE_PAY].url,Wf(this.apiUrl)[Uf.ADD_CHARGE_WITH_APPLE_PAY].method,JSON.stringify(n),this.getSuccessAddChargeHandler(e,r).bind(this),this.getFailureAddChargeHandler(e,r).bind(this),{providerId:t})}getFailureAddChargeHandler(e,t){return T(this,`[getFailureAddChargeHandler]`,(n,r)=>{this.log(`[ApplePay], failure`,r),J(e,`Unable to pay with ApplePay`),t.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:`unknown`,message:r}]}),this.failureCallback?.({error:`Unable to pay with ApplePay`,body:r})})}getSuccessAddChargeHandler(e,t){return T(this,`[getSuccessAddChargeHandler]`,(e,n)=>{let r=JSON.parse(n);this.log(`[ApplePay], success`,r);let i={status:ApplePaySession.STATUS_SUCCESS,paymentToken:r};t.completePayment(i),this.successCallback?.({transactionId:r.chargeId})})}validateOptions(e,t,n,r){if(!al(n))throw J(e,`Invalid currency: `+n),TypeError(`invalid currency: `+n);if(!dc(t))throw J(e,`Invalid amount: `+t),TypeError(`invalid amount: `+t);if(!r.lineItemLabel)throw J(e,`Invalid lineItemLabel parameter`),TypeError(`Invalid lineItemLabel parameter`)}};d([w],Gf.prototype,`cleanUp`,null),d([w],Gf.prototype,`addApplePay`,null),d([w],Gf.prototype,`validateMerchant`,null),d([w],Gf.prototype,`addChargeWithApplePay`,null),d([w],Gf.prototype,`getFailureAddChargeHandler`,null),d([w],Gf.prototype,`getSuccessAddChargeHandler`,null),d([w],Gf.prototype,`validateOptions`,null),G();var Kf=R({__name:`ApplePayIcon`,props:{size:{},grayscale:{type:Boolean}},setup(e){let t=`--size: ${e.size}px`;return(e,n)=>(z(),B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 210.2`,"xml:space":`preserve`,style:t},[...n[0]||=[V(`path`,{id:`XMLID_34_`,d:`M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9
|
|
141
141
|
C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2
|
|
142
142
|
c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7
|
|
143
143
|
c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4
|
|
148
148
|
l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5
|
|
149
149
|
l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z
|
|
150
|
-
`},null,-1)]]))}});K();var If=G(Ff,[[`__scopeId`,`data-v-7d3fe743`]]),Lf;(function(e){e.mastercard=`mastercard`,e.maestro=`maestro`,e.visa=`visa`,e.amex=`amex`,e.discover=`discover`})(Lf||={});var Rf=[Lf.mastercard,Lf.maestro,Lf.visa,Lf.amex,Lf.discover],zf;(function(e){e.NONE=`NONE`,e.FULL=`FULL`,e.POSTAL_COUNTRY=`POSTAL_COUNTRY`})(zf||={});var Bf=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='28px'%20height='20px'%20viewBox='0%200%2028%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eMC%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3824.000000,%20-619.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='MC'%20transform='translate(34.000000,%200.000000)'%3e%3cg%20id='Group'%20transform='translate(0.000000,%200.500000)'%20fill-rule='nonzero'%3e%3cg%20id='mc_symbol'%3e%3crect%20id='Rectangle'%20fill='%23FF5F00'%20x='9.54692308'%20y='1.89561644'%20width='7.99846152'%20height='13.1831507'%3e%3c/rect%3e%3cpath%20d='M10.3707692,8.48835615%20C10.3687609,5.9162332%2011.5388328,3.4860197%2013.5438461,1.8979452%20C10.1376439,-0.803412601%205.24620091,-0.409936474%202.30709182,2.80184914%20C-0.632017274,6.01363474%20-0.632017274,10.9654063%202.30709182,14.1771919%20C5.24620091,17.3889776%2010.1376439,17.7824537%2013.5438461,15.0810959%20C11.5381947,13.4925171%2010.3680514,11.0612963%2010.3707692,8.48835615%20Z'%20id='Path'%20fill='%23EB001B'%3e%3c/path%3e%3cpolygon%20id='Path'%20fill='%23F79E1B'%20points='26.037982%2013.7760322%2026.037982%2013.4940046%2026.1523888%2013.4940046%2026.1523888%2013.447%2025.8778125%2013.447%2025.8778125%2013.4940046%2025.9922193%2013.4940046%2025.9922193%2013.7760322'%3e%3c/polygon%3e%3cpolygon%20id='Path'%20fill='%23F79E1B'%20points='26.5645392%2013.447%2026.4730138%2013.447%2026.3814883%2013.682023%2026.2899629%2013.447%2026.1984375%2013.447%2026.1984375%2013.7760322%2026.2670816%2013.7760322%2026.2670816%2013.5175069%2026.3431635%2013.7290277%2026.4272511%2013.7290277%2026.5008388%2013.5175069%2026.5008388%2013.7760322%2026.5645392%2013.7760322'%3e%3c/polygon%3e%3cpath%20d='M26.9861539,8.48835615%20C26.9861539,11.6981845%2025.1698664,14.6262062%2022.3088666,16.0288794%20C19.4478669,17.4315526%2016.0443669,17.0626193%2013.5438461,15.0787671%20C15.5479847,13.4893444%2016.7181446,11.059454%2016.7181446,8.48719178%20C16.7181446,5.9149296%2015.5479847,3.48503916%2013.5438461,1.89561644%20C16.0443669,-0.0882357813%2019.4478669,-0.45716899%2022.3088666,0.945504164%20C25.1698664,2.34817732%2026.9861539,5.27619909%2026.9861539,8.4860274%20L26.9861539,8.48835615%20Z'%20id='Path'%20fill='%23F79E1B'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='27'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,Vf=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='30px'%20height='19px'%20viewBox='0%200%2030%2019'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eVisa-dark%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3857.000000,%20-659.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='Visa-dark'%20transform='translate(67.000000,%2040.000000)'%3e%3cg%20id='Group'%20transform='translate(0.000000,%204.500000)'%20fill='%231A1F71'%20fill-rule='nonzero'%3e%3cg%20id='Visa-Brand-Mark-Blue'%3e%3cpath%20d='M10.9839171,0.218028169%20L7.20456221,8.77056338%20L4.73889401,8.77056338%20L2.87995392,1.94450704%20C2.76635945,1.52366197%202.66880184,1.37028169%202.32534562,1.1928169%20C1.76539171,0.903802817%200.839262673,0.633802817%200.0240552995,0.465211268%20L0.0801843318,0.216760563%20L4.04930876,0.216760563%20C4.55447005,0.216760563%205.01018433,0.536197183%205.12511521,1.08887324%20L6.10737327,6.03887324%20L8.53428571,0.218028169%20L10.9839171,0.218028169%20Z%20M20.6447926,5.97802817%20C20.6541475,3.72042254%2017.3532258,3.59619718%2017.3759447,2.5884507%20C17.3826267,2.28169014%2017.6913364,1.95591549%2018.3648848,1.87225352%20C18.6989862,1.83042254%2019.6197696,1.79873239%2020.6648387,2.25507042%20L21.0737788,0.441126761%20C20.5124885,0.247183099%2019.7908295,0.0621126761%2018.8914286,0.0621126761%20C16.586129,0.0621126761%2014.9637327,1.22450704%2014.9490323,2.89014085%20C14.9343318,4.12098592%2016.1076959,4.80802817%2016.9910599,5.21746479%20C17.8998157,5.63704225%2018.2045161,5.90577465%2018.2005069,6.27971831%20C18.1951613,6.85394366%2017.4761751,7.10619718%2016.8052995,7.11633803%20C15.6319355,7.13408451%2014.9517051,6.81591549%2014.4091244,6.57633803%20L13.9868203,8.44985915%20C14.5320737,8.68690141%2015.5370507,8.89352113%2016.5807834,8.90366197%20C19.034424,8.90366197%2020.6367742,7.75521127%2020.6447926,5.97802817%20L20.6447926,5.97802817%20Z%20M26.7321198,8.77056338%20L28.8890783,8.77056338%20L27.0060829,0.218028169%20L25.0148387,0.218028169%20C24.5671429,0.218028169%2024.1902765,0.465211268%2024.0218894,0.845492958%20L20.5231797,8.77056338%20L22.9728111,8.77056338%20L23.4592627,7.4928169%20L26.4514747,7.4928169%20L26.7321198,8.77056338%20Z%20M24.1301382,5.73971831%20L25.3582949,2.52760563%20L26.0652535,5.73971831%20L24.1301382,5.73971831%20Z%20M14.3169124,0.218028169%20L12.3884793,8.77056338%20L10.0564516,8.77056338%20L11.9862212,0.218028169%20L14.3169124,0.218028169%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='29'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,Hf=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='19px'%20height='19px'%20viewBox='0%200%2019%2019'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eAMEX%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3890.000000,%20-619.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='AMEX'%20transform='translate(100.000000,%200.000000)'%3e%3cg%20id='Group'%20fill-rule='nonzero'%3e%3cg%20id='Amex-500x500@1x'%3e%3crect%20id='Rectangle'%20fill='%23FFFFFF'%20x='0'%20y='0'%20width='18'%20height='18'%3e%3c/rect%3e%3cpath%20d='M0,0%20L0,18%20L18,18%20L18,15.147828%20L15.828444,15.147828%20L14.710428,13.911588%20L13.58676,15.147828%20L6.426972,15.147828%20L6.426972,9.386172%20L4.116096,9.386172%20L6.982488,2.89926%20L9.746856,2.89926%20L10.733652,5.121576%20L10.733652,2.89926%20L14.155416,2.89926%20L14.749524,4.573872%20L15.34752,2.89926%20L18,2.89926%20L18,0%20L0,0%20Z%20M15.884244,3.620664%20L14.754384,6.758172%20L13.631796,3.620664%20L11.480112,3.620664%20L11.480112,8.658072%20L12.840192,8.658072%20L12.840192,5.131872%20L14.135616,8.658072%20L15.344496,8.658072%20L16.639812,5.1246%20L16.639812,8.658072%20L18,8.658072%20L18,3.620664%20L15.884244,3.620664%20Z%20M7.486272,3.620664%20L5.262516,8.658072%20L6.77376,8.658072%20L7.191216,7.650576%20L9.508356,7.650576%20L9.93294,8.658072%20L11.480112,8.658072%20L9.256608,3.620664%20L7.486272,3.620664%20Z%20M8.349804,4.87278%20L9.03348,6.520716%20L7.666092,6.520716%20L8.349804,4.87278%20Z%20M16.222968,9.389052%20L14.747796,11.00106%20L13.286808,9.389052%20L11.480616,9.389052%20L13.855356,11.907792%20L11.480616,14.426496%20L13.236516,14.426496%20L14.71896,12.800088%20L16.19424,14.426496%20L18,14.426496%20L15.611328,11.893356%20L18,9.389052%20L16.222968,9.389052%20Z%20M7.191576,9.389052%20L7.191576,14.426496%20L11.480508,14.426496%20L11.480508,13.260672%20L8.566128,13.260672%20L8.566128,12.476268%20L11.40858,12.476268%20L11.40858,11.339172%20L8.566128,11.339172%20L8.566128,10.554912%20L11.480508,10.554912%20L11.480508,9.389052%20L7.191576,9.389052%20Z%20M16.6167,11.89548%20L18,13.367124%20L18,10.436112%20L16.6167,11.89548%20Z'%20id='500x500'%20fill='%23006FCF'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='18'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,Uf=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='28px'%20height='20px'%20viewBox='0%200%2028%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eDiscover%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3913.000000,%20-619.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='Discover'%20transform='translate(123.000000,%200.000000)'%3e%3cg%20id='Group'%20transform='translate(0.000000,%200.500000)'%20fill-rule='nonzero'%3e%3cg%20id='Discover_26x16'%3e%3crect%20id='Rectangle'%20fill='%23FFFFFF'%20x='0'%20y='0'%20width='27'%20height='17'%3e%3c/rect%3e%3cpath%20d='M26.8272,9.445625%20C26.8272,9.445625%2019.494,14.535%206.0696,16.80875%20L26.8272,16.80875%20L26.8272,9.445625%20Z'%20id='Path'%20fill='%23F68C1E'%3e%3c/path%3e%3cpath%20d='M26.9028389,0%20L0,0%20L0,17%20L27,17%20L27,0%20L26.9028389,0%20Z%20M26.8056777,0.19125%20L26.8056777,16.80875%20L0.194322271,16.80875%20C0.194322271,16.6175%200.194322271,0.3825%200.194322271,0.19125%20C0.388644542,0.19125%2026.6113555,0.19125%2026.8056777,0.19125'%20id='Shape'%20fill='%23000105'%3e%3c/path%3e%3cpath%20d='M2.3652,5.20625%20L1.242,5.20625%20L1.242,9.0525%20L2.3544,9.0525%20C2.9484,9.0525%203.3696,8.914375%203.7476,8.60625%20C4.1904,8.245%204.4604,7.6925%204.4604,7.129375%20C4.4604,5.9925%203.5964,5.20625%202.3652,5.20625%20M3.2508,8.09625%20C3.0132,8.30875%202.7,8.39375%202.214,8.39375%20L2.0088,8.39375%20L2.0088,5.854375%20L2.214,5.854375%20C2.7108,5.854375%203.0024,5.939375%203.2616,6.1625%20C3.5208,6.39625%203.672,6.7575%203.672,7.11875%20C3.672,7.490625%203.5208,7.8625%203.2508,8.09625'%20id='Shape'%20fill='%23000105'%3e%3c/path%3e%3crect%20id='Rectangle'%20fill='%23000105'%20x='4.8168'%20y='5.20625'%20width='1'%20height='3.84625'%3e%3c/rect%3e%3cpath%20d='M7.4412,6.6725%20C6.9768,6.513125%206.8472,6.39625%206.8472,6.194375%20C6.8472,5.95%207.0848,5.769375%207.4196,5.769375%20C7.6464,5.769375%207.8408,5.865%208.0352,6.0775%20L8.424,5.5675%20C8.1,5.280625%207.7004,5.1425%207.2792,5.1425%20C6.588,5.1425%206.0588,5.61%206.0588,6.2475%20C6.0588,6.77875%206.3072,7.044375%207.02,7.299375%20C7.3224,7.405625%207.4736,7.469375%207.5492,7.5225%20C7.7004,7.6075%207.776,7.745625%207.776,7.915625%20C7.776,8.22375%207.5276,8.4575%207.182,8.4575%20C6.8148,8.4575%206.5232,8.276875%206.3504,7.9475%20L5.8644,8.404375%20C6.21,8.914375%206.6312,9.1375%207.2144,9.1375%20C8.0028,9.1375%208.5644,8.616875%208.5644,7.873125%20C8.5644,7.2675%208.3052,6.99125%207.4412,6.6725'%20id='Path'%20fill='%23000105'%3e%3c/path%3e%3cpath%20d='M8.802,7.129375%20C8.802,8.255625%209.7092,9.1375%2010.8648,9.1375%20C11.1888,9.1375%2011.4696,9.07375%2011.826,8.914375%20L11.826,8.0325%20C11.5236,8.33%2011.2536,8.4575%2010.908,8.4575%20C10.1412,8.4575%209.5904,7.905%209.5904,7.129375%20C9.5904,6.385625%2010.152,5.811875%2010.8648,5.811875%20C11.232,5.811875%2011.502,5.939375%2011.826,6.2475%20L11.826,5.355%20C11.4912,5.185%2011.2212,5.12125%2010.8864,5.12125%20C9.7308,5.110625%208.802,6.01375%208.802,7.129375'%20id='Path'%20fill='%23000105'%3e%3c/path%3e%3cpolygon%20id='Path'%20fill='%23000105'%20points='17.874%207.788125%2016.8264%205.20625%2015.9948%205.20625%2017.658%209.148125%2018.0684%209.148125%2019.7532%205.20625%2018.9216%205.20625'%3e%3c/polygon%3e%3cpolygon%20id='Path'%20fill='%23000105'%20points='20.0988%209.0525%2022.2588%209.0525%2022.2588%208.39375%2020.8548%208.39375%2020.8548%207.363125%2022.2048%207.363125%2022.2048%206.704375%2020.8548%206.704375%2020.8548%205.854375%2022.2588%205.854375%2022.2588%205.20625%2020.0988%205.20625'%3e%3c/polygon%3e%3cpath%20d='M25.2828,6.3325%20C25.2828,5.61%2024.7752,5.195625%2023.9004,5.195625%20L22.7664,5.195625%20L22.7664,9.041875%20L23.5332,9.041875%20L23.5332,7.50125%20L23.6304,7.50125%20L24.6888,9.041875%20L25.6284,9.041875%20L24.3972,7.426875%20C24.9588,7.31%2025.2828,6.9275%2025.2828,6.3325%20M23.7492,6.97%20L23.5224,6.97%20L23.5224,5.80125%20L23.76,5.80125%20C24.2352,5.80125%2024.4944,5.9925%2024.4944,6.375%20C24.4944,6.768125%2024.2352,6.97%2023.7492,6.97'%20id='Shape'%20fill='%23000105'%3e%3c/path%3e%3cpath%20d='M16.2216,7.129375%20C16.2216,8.255625%2015.2928,9.169375%2014.148,9.169375%20C13.0032,9.169375%2012.0744,8.255625%2012.0744,7.129375%20C12.0744,6.003125%2013.0032,5.089375%2014.148,5.089375%20C15.2928,5.07875%2016.2216,6.003125%2016.2216,7.129375'%20id='Path'%20fill='%23F68C1E'%3e%3c/path%3e%3cpath%20d='M25.6824,5.282375%20C25.6824,5.217575%2025.6392,5.174375%2025.5528,5.174375%20L25.4448,5.174375%20L25.4448,5.519975%20L25.5312,5.519975%20L25.5312,5.379575%20L25.6284,5.509175%20L25.7256,5.509175%20L25.6176,5.368775%20C25.6608,5.357975%2025.6824,5.325575%2025.6824,5.282375'%20id='Shape'%20fill='%23231F20'%3e%3c/path%3e%3cpath%20d='M25.5744,5.046875%20C25.4124,5.046875%2025.272,5.176475%2025.272,5.349275%20C25.272,5.511275%2025.4016,5.651675%2025.5744,5.651675%20C25.7364,5.651675%2025.866,5.522075%2025.866,5.349275%20C25.866,5.187275%2025.7364,5.046875%2025.5744,5.046875%20M25.5744,5.597675%20C25.4448,5.597675%2025.3368,5.489675%2025.3368,5.349275%20C25.3368,5.208875%2025.4448,5.100875%2025.5744,5.100875%20C25.704,5.100875%2025.812,5.208875%2025.812,5.349275%20C25.812,5.478875%2025.704,5.597675%2025.5744,5.597675'%20id='Shape'%20fill='%23231F20'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='27'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`;W();var Wf={class:`click2pay-logo`},Gf={key:0,src:Bf,alt:`MasterCard`},Kf={key:1,src:Vf,alt:`Visa`},qf={key:2,src:Hf,alt:`American Express`},Jf={key:3,src:Uf,alt:`Discover`},Yf=L({__name:`ClickToPayLogo`,props:{options:{}},setup(e){let t=e,n=P(t.options.cardBrands||Rf);return Mr(()=>t,()=>{n.value=t.options.cardBrands||[]},{flush:`post`,deep:!0}),(e,t)=>(R(),z(`div`,Wf,[t[0]||=B(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20viewBox='0%204.1942%20233.76%20118.7958'%20width='233.76'%20height='118.7958'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23000000'%20d='%20M%200.00%20103.74%20L%200.00%2023.26%20Q%202.71%209.47%2014.47%205.49%20Q%2018.21%204.22%2025.63%204.29%20Q%2036.12%204.39%2046.57%204.28%20Q%2049.98%204.25%2051.32%204.95%20C%2054.47%206.62%2054.71%2012.27%2051.60%2014.18%20Q%2050.30%2014.99%2047.25%2015.02%20Q%2035.25%2015.14%2023.26%2015.04%20Q%2014.82%2014.97%2012.04%2021.22%20Q%2010.75%2024.12%2010.75%2032.47%20Q%2010.77%2064.65%2010.78%2096.84%20C%2010.79%20108.05%2013.62%20112.09%2024.83%20112.11%20Q%2044.80%20112.15%2064.75%20112.07%20C%2068.72%20112.05%2071.55%20109.52%2074.24%20106.26%20Q%2091.06%2085.85%20108.91%2064.44%20A%200.86%200.86%200.0%200%200%20108.91%2063.34%20Q%2088.54%2038.50%2067.91%2013.34%20C%2065.75%2010.71%2065.99%207.28%2068.57%205.40%20Q%2070.05%204.32%2073.59%204.32%20Q%2088.43%204.31%20103.25%204.33%20Q%20105.90%204.33%20107.17%205.80%20Q%20130.58%2032.79%20153.94%2059.81%20C%20156.70%2063.00%20155.25%2065.90%20152.73%2068.88%20Q%20134.57%2090.29%20116.24%20111.71%20A%200.35%200.35%200.0%200%200%20116.51%20112.29%20L%20132.44%20112.24%20A%201.43%201.43%200.0%200%200%20133.55%20111.71%20L%20172.96%2063.93%20A%200.83%200.83%200.0%200%200%20172.96%2062.87%20Q%20152.96%2038.50%20132.93%2014.07%20Q%20131.33%2012.10%20131.02%2010.69%20C%20130.23%207.08%20133.94%203.44%20137.37%204.33%20Q%20139.27%204.83%20141.51%207.48%20Q%20163.74%2033.77%20186.06%2059.98%20Q%20189.13%2063.58%20185.65%2067.66%20Q%20162.44%2094.91%20139.34%20121.71%20A%203.12%203.10%2020.2%200%201%20137.01%20122.78%20Q%20120.84%20122.82%20104.23%20122.76%20C%2097.72%20122.74%2097.24%20117.14%20100.66%20112.96%20Q%20120.69%2088.51%20140.71%2064.30%20A%200.99%200.99%200.0%200%200%20140.71%2063.04%20L%20101.46%2015.56%20A%201.23%201.23%200.0%200%200%20100.51%2015.11%20L%2084.28%2015.01%20A%200.39%200.39%200.0%200%200%2083.98%2015.65%20Q%20102.93%2037.75%20121.70%2059.56%20C%20125.42%2063.89%20122.26%2066.94%20118.90%2070.92%20Q%2099.67%2093.66%2080.30%20116.30%20Q%2077.34%20119.77%2072.30%20121.55%20Q%2068.93%20122.74%2063.06%20122.75%20Q%2042.72%20122.77%2022.39%20122.77%20C%2010.50%20122.77%202.31%20115.51%200.00%20103.74%20Z'%20transform='matrix(1,%200,%200,%201,%20-3.552713678800501e-15,%200)'/%3e%3crect%20fill='%23000000'%20x='228.78'%20y='4.23'%20width='4.98'%20height='118.76'%20rx='2.41'%20transform='matrix(1,%200,%200,%201,%20-3.552713678800501e-15,%200)'/%3e%3c/svg%3e`,alt:`Click To Pay`},null,-1),n.value.includes(F(Lf).mastercard)?(R(),z(`img`,Gf)):V(``,!0),n.value.includes(F(Lf).visa)?(R(),z(`img`,Kf)):V(``,!0),n.value.includes(F(Lf).amex)?(R(),z(`img`,qf)):V(``,!0),n.value.includes(F(Lf).discover)?(R(),z(`img`,Jf)):V(``,!0)]))}});K();var Xf=G(Yf,[[`__scopeId`,`data-v-c2abe5c3`]]);W(),_c();var Zf={style:{display:`flex`,gap:`20px`}},Qf={class:`payfurl-form`},$f={class:`container-form`},ep={class:`row`},tp={style:{width:`100%`}},np={key:0,class:`error`},rp={class:`row`},ip={style:{width:`100%`}},ap={key:0,class:`error`},op=L({__name:`LoginForm`,props:{log:{type:Function},options:{}},emits:[`close`,`submit`,`logout`],setup(e,{emit:t}){let n=e,r=t,i=P(``),a=P(``),o=P({});function s(){return o.value={},!a.value&&!sc(i.value)&&(o.value.email=`Please type valid email address`),a.value&&!oc(a.value)&&(o.value.phone=`Please type phone in international format`),Object.keys(o.value).length===0}function c(){s()&&r(`submit`,{email:i.value,phone:a.value})}function l(){r(`close`)}function u(){r(`logout`)}return(e,t)=>(R(),Yi(yd,{width:`350`,onClose:l},{title:Dr(()=>[B(`div`,Zf,[U(Xf,{options:n.options},null,8,[`options`]),t[2]||=ta(` Click To Pay Login `,-1)])]),body:Dr(()=>[B(`div`,Qf,[B(`div`,$f,[B(`div`,ep,[t[3]||=B(`label`,null,`Email Address`,-1),B(`div`,tp,[Or(B(`input`,{type:`text`,maxlength:`100`,placeholder:`Email Address`,name:`email`,"onUpdate:modelValue":t[0]||=e=>i.value=e},null,512),[[Us,i.value]]),o.value.email?(R(),z(`p`,np,M(o.value.email),1)):V(``,!0)])]),B(`div`,rp,[t[4]||=B(`label`,null,`Phone`,-1),B(`div`,ip,[Or(B(`input`,{type:`text`,maxlength:`100`,placeholder:`Phone`,name:`phone`,"onUpdate:modelValue":t[1]||=e=>a.value=e},null,512),[[Us,a.value]]),o.value.phone?(R(),z(`p`,ap,M(o.value.phone),1)):V(``,!0)])])])])]),footer:Dr(()=>[B(`div`,{class:`payfurl-form payfurl-form-footer`},[B(`button`,{onClick:u},`Continue as Guest`),B(`button`,{onClick:c},`Login`)])]),_:1}))}});K();var sp=G(op,[[`__scopeId`,`data-v-693ba623`]]);_c(),he();var cp=[`4761739001010010`,`4005520000000129`,`5413330089010640`,`5413330089600119`,`374245001721009`,`4035874000424977`,`5413330089010640`];function lp(e,t){if(t===C.PRODUCTION||!cp.includes(e))return null;switch(pc(e)){case`visa`:return{cardNumber:`4622943123103732`,expiryDate:`12/25`,ccv:`750`};case`mastercard`:return{cardNumber:`5204731620064595`,expiryDate:`12/28`};case`amex`:return{cardNumber:`373708623186001`,expiryDate:`12/28`,ccv:`7777`};default:return null}}vl(),$s(),au(),_c(),he();var up=`Click to Pay is unavailable. Please proceed with an alternative payment method`,dp={SANDBOX:{uiKit:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.esm.js`,uiKitCss:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.css`,sdk:`https://sandbox.src.mastercard.com/sdk/srcsdk.mastercard.js`,lib:`https://sandbox.src.mastercard.com/srci/integration/2/lib.js?srcDpaId={dpaId}&locale=en_AU`},PRODUCTION:{uiKit:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.esm.js`,uiKitCss:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.css`,sdk:`https://src.mastercard.com/sdk/srcsdk.mastercard.js`,lib:`https://src.mastercard.com/srci/integration/2/lib.js?srcDpaId={dpaId}&locale=en_AU`}},Q=class extends Nu{enabled=!0;initialized=!1;loaded=!1;container;environment;amount=0;currency=`AUD`;customer=null;options;srcOtpInput=null;srcLearnMore=null;srcLearnMoreElement=null;mcModal=null;mcFrame=null;modal=null;cards=[];tokenAuthenticationEnabled=!1;rememberMe=!0;localStartCallback=null;supportedValidationChannels=[];availableCardBrands=[];validationChannelsNetwork=`mastercard`;requestedValidationChannelId=``;attempts=0;startIsRunning=!1;readyCallbacks=[];constructor(e,t){super(e),this.options=t.options||{},this.container=t.container||document.body,this.environment=t.environment||C.DEVELOPMENT;let n=Pu(this.environment);this.options.networkTokenOptions={...n,...this.options.networkTokenOptions||{}},t.options?.tokenAuthenticationEnabled?this.enableTokenAuthentication():this.disableTokenAuthentication(),this.log(`[ClickToPayProcessor]`,t),window.addEventListener(`message`,this.messageHandler.bind(this))}setContainer(e){this.container=e||document.body,this.attachOtpInput()}setAmount(e){this.amount=e}getAmount(){return this.amount}setCurrency(e){this.currency=e}getCurrency(){return this.currency}setOptions(e){this.log(`[ClickToPayProcessor][setOptions]`,e),this.options=e,this.options?.tokenAuthenticationEnabled?this.enableTokenAuthentication():this.disableTokenAuthentication()}setCustomerInfo(e,t){this.log(`[ClickToPayProcessor][setCustomerInfo]`,e);let n=this.customer?.email||``,r=this.customer?.phoneNumber||``;if(this.customer={...e},!t&&(this.customer.email!==n||this.customer.phoneNumber!==r)){if(!this.initialized)return;this.cleanUp(this.container),this.start()}}getCustomerInfo(){return this.customer}getRememberMe(){return!!this.rememberMe}setRememberMe(e){this.rememberMe=e}enableTokenAuthentication(){this.tokenAuthenticationEnabled=!0}disableTokenAuthentication(){this.tokenAuthenticationEnabled=!1}getCards(){return this.cards}whenReady(e=6e4){return this.loaded?Promise.resolve():new Promise((t,n)=>{let r=()=>t();this.readyCallbacks.push(r),window.setTimeout(()=>{let e=this.readyCallbacks.indexOf(r);e<0||(this.readyCallbacks.splice(e,1),n(Error(`Click to Pay is not ready`)))},e)})}setCards(e){this.cards=e;let t=this.getCardFormFrame();if(t)try{t.contentWindow?.postMessage({status:Kl,cards:e},`*`)}catch(e){this.log(`[setCards] iframe error`,e)}else this.log(`[setCards] iframe not found`)}isSchemeSupported(e){return this.availableCardBrands.includes(pc(e))}messageHandler(e){e?.data?.status&&(e.data.status===`click2pay-remember-me`?(this.log(`[clickToPayProcessor]: message "${e.data.status}" received`,e.data),this.setRememberMe(!!e.data.message)):(e.data.status===`click2pay-change-user`&&(this.log(`[clickToPayProcessor]: message "${e.data.status}" received`,e.data),this.showChangeUserPopup()),e.data.status===`click2pay-show-learn-more`&&(this.log(`[clickToPayProcessor]: message "${e.data.status}" received`,e.data),this.mcShowLearnMore())))}init(){this.initialized||=(this.log(`[ClickToPayProcessor] - INIT`,this.getCustomerInfo()),this.startLoadingCardForm(),this.initCss(),this.createOtpInput(),this.createModalForm(),this.createLearnMore(),this.initScripts(),!0)}cleanUp(e){this.stopLoadingCardForm(),this.mcHideOtpInput(),this.hideModalForm(),this.setCards([])}isInitialized(){return this.initialized}start(){if(this.log(`[ClickToPayProcessor] - START`,this.startIsRunning,this.loaded,this.getCustomerInfo()),this.startIsRunning)return;this.startIsRunning=!0;let e=()=>{this.attachOtpInput(),this.runClickToPay(),this.startLoadingCardForm(),this.startIsRunning=!1};this.loaded?e():this.localStartCallback=e}initCheckoutServiceLib(){let e=this.getLibUrl(`lib`).replace(`{dpaId}`,this.options.dpaId);if(typeof window.requirejs==`function`){window.requirejs([e],e=>{window.MastercardCheckoutServices=e.MastercardCheckoutServices,this.mcInitClickToPay()});return}let t=document.createElement(`script`);t.src=e,t.onload=T(this,`[ClickToPayProcessor]: CheckoutServiceLib loaded`,()=>{this.log(`[ClickToPayProcessor]: CheckoutServiceLib loaded`),this.mcInitClickToPay()}),t.onerror=T(this,`[ClickToPayProcessor]: CheckoutServiceLib error`,t=>{this.log(`[ClickToPayProcessor]: CheckoutServiceLib error`,t),this.sendErrorNotification(`CheckoutServiceLib error`,[e,t]),this.stopUsing()}),document.head.appendChild(t)}initScripts(){let e=0,t=document.createElement(`script`);t.src=this.getLibUrl(`uiKit`),t.type=`module`,t.onload=()=>{this.log(`[ClickToPayProcessor]: src-ui-kit loaded`),e++,e>1&&this.initCheckoutServiceLib()},t.onerror=e=>{this.log(`[ClickToPayProcessor]: src-ui-kit loading error`,e),this.stopUsing()},document.head.appendChild(t);let n=document.createElement(`script`);n.src=this.getLibUrl(`sdk`),n.onload=()=>{this.log(`[ClickToPayProcessor]: srcsdk.mastercard.js loaded`),e++,e>1&&this.initCheckoutServiceLib()},n.onerror=t=>{this.log(`[ClickToPayProcessor]: srcsdk.mastercard.js loading error`,t),e++,e>1&&this.initCheckoutServiceLib()},document.head.appendChild(n);let r=document.createElement(`link`);r.href=this.getLibUrl(`uiKitCss`),r.rel=`stylesheet`,document.head.appendChild(r)}initCss(){let e=document.createElement(`style`);e.textContent=`
|
|
150
|
+
`},null,-1)]]))}});q();var qf=K(Kf,[[`__scopeId`,`data-v-7d3fe743`]]),Jf;(function(e){e.mastercard=`mastercard`,e.maestro=`maestro`,e.visa=`visa`,e.amex=`amex`,e.discover=`discover`})(Jf||={});var Yf=[Jf.mastercard,Jf.maestro,Jf.visa,Jf.amex,Jf.discover],Xf;(function(e){e.NONE=`NONE`,e.FULL=`FULL`,e.POSTAL_COUNTRY=`POSTAL_COUNTRY`})(Xf||={});var Zf=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='28px'%20height='20px'%20viewBox='0%200%2028%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eMC%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3824.000000,%20-619.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='MC'%20transform='translate(34.000000,%200.000000)'%3e%3cg%20id='Group'%20transform='translate(0.000000,%200.500000)'%20fill-rule='nonzero'%3e%3cg%20id='mc_symbol'%3e%3crect%20id='Rectangle'%20fill='%23FF5F00'%20x='9.54692308'%20y='1.89561644'%20width='7.99846152'%20height='13.1831507'%3e%3c/rect%3e%3cpath%20d='M10.3707692,8.48835615%20C10.3687609,5.9162332%2011.5388328,3.4860197%2013.5438461,1.8979452%20C10.1376439,-0.803412601%205.24620091,-0.409936474%202.30709182,2.80184914%20C-0.632017274,6.01363474%20-0.632017274,10.9654063%202.30709182,14.1771919%20C5.24620091,17.3889776%2010.1376439,17.7824537%2013.5438461,15.0810959%20C11.5381947,13.4925171%2010.3680514,11.0612963%2010.3707692,8.48835615%20Z'%20id='Path'%20fill='%23EB001B'%3e%3c/path%3e%3cpolygon%20id='Path'%20fill='%23F79E1B'%20points='26.037982%2013.7760322%2026.037982%2013.4940046%2026.1523888%2013.4940046%2026.1523888%2013.447%2025.8778125%2013.447%2025.8778125%2013.4940046%2025.9922193%2013.4940046%2025.9922193%2013.7760322'%3e%3c/polygon%3e%3cpolygon%20id='Path'%20fill='%23F79E1B'%20points='26.5645392%2013.447%2026.4730138%2013.447%2026.3814883%2013.682023%2026.2899629%2013.447%2026.1984375%2013.447%2026.1984375%2013.7760322%2026.2670816%2013.7760322%2026.2670816%2013.5175069%2026.3431635%2013.7290277%2026.4272511%2013.7290277%2026.5008388%2013.5175069%2026.5008388%2013.7760322%2026.5645392%2013.7760322'%3e%3c/polygon%3e%3cpath%20d='M26.9861539,8.48835615%20C26.9861539,11.6981845%2025.1698664,14.6262062%2022.3088666,16.0288794%20C19.4478669,17.4315526%2016.0443669,17.0626193%2013.5438461,15.0787671%20C15.5479847,13.4893444%2016.7181446,11.059454%2016.7181446,8.48719178%20C16.7181446,5.9149296%2015.5479847,3.48503916%2013.5438461,1.89561644%20C16.0443669,-0.0882357813%2019.4478669,-0.45716899%2022.3088666,0.945504164%20C25.1698664,2.34817732%2026.9861539,5.27619909%2026.9861539,8.4860274%20L26.9861539,8.48835615%20Z'%20id='Path'%20fill='%23F79E1B'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='27'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,Qf=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='30px'%20height='19px'%20viewBox='0%200%2030%2019'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eVisa-dark%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3857.000000,%20-659.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='Visa-dark'%20transform='translate(67.000000,%2040.000000)'%3e%3cg%20id='Group'%20transform='translate(0.000000,%204.500000)'%20fill='%231A1F71'%20fill-rule='nonzero'%3e%3cg%20id='Visa-Brand-Mark-Blue'%3e%3cpath%20d='M10.9839171,0.218028169%20L7.20456221,8.77056338%20L4.73889401,8.77056338%20L2.87995392,1.94450704%20C2.76635945,1.52366197%202.66880184,1.37028169%202.32534562,1.1928169%20C1.76539171,0.903802817%200.839262673,0.633802817%200.0240552995,0.465211268%20L0.0801843318,0.216760563%20L4.04930876,0.216760563%20C4.55447005,0.216760563%205.01018433,0.536197183%205.12511521,1.08887324%20L6.10737327,6.03887324%20L8.53428571,0.218028169%20L10.9839171,0.218028169%20Z%20M20.6447926,5.97802817%20C20.6541475,3.72042254%2017.3532258,3.59619718%2017.3759447,2.5884507%20C17.3826267,2.28169014%2017.6913364,1.95591549%2018.3648848,1.87225352%20C18.6989862,1.83042254%2019.6197696,1.79873239%2020.6648387,2.25507042%20L21.0737788,0.441126761%20C20.5124885,0.247183099%2019.7908295,0.0621126761%2018.8914286,0.0621126761%20C16.586129,0.0621126761%2014.9637327,1.22450704%2014.9490323,2.89014085%20C14.9343318,4.12098592%2016.1076959,4.80802817%2016.9910599,5.21746479%20C17.8998157,5.63704225%2018.2045161,5.90577465%2018.2005069,6.27971831%20C18.1951613,6.85394366%2017.4761751,7.10619718%2016.8052995,7.11633803%20C15.6319355,7.13408451%2014.9517051,6.81591549%2014.4091244,6.57633803%20L13.9868203,8.44985915%20C14.5320737,8.68690141%2015.5370507,8.89352113%2016.5807834,8.90366197%20C19.034424,8.90366197%2020.6367742,7.75521127%2020.6447926,5.97802817%20L20.6447926,5.97802817%20Z%20M26.7321198,8.77056338%20L28.8890783,8.77056338%20L27.0060829,0.218028169%20L25.0148387,0.218028169%20C24.5671429,0.218028169%2024.1902765,0.465211268%2024.0218894,0.845492958%20L20.5231797,8.77056338%20L22.9728111,8.77056338%20L23.4592627,7.4928169%20L26.4514747,7.4928169%20L26.7321198,8.77056338%20Z%20M24.1301382,5.73971831%20L25.3582949,2.52760563%20L26.0652535,5.73971831%20L24.1301382,5.73971831%20Z%20M14.3169124,0.218028169%20L12.3884793,8.77056338%20L10.0564516,8.77056338%20L11.9862212,0.218028169%20L14.3169124,0.218028169%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='29'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,$f=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='19px'%20height='19px'%20viewBox='0%200%2019%2019'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eAMEX%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3890.000000,%20-619.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='AMEX'%20transform='translate(100.000000,%200.000000)'%3e%3cg%20id='Group'%20fill-rule='nonzero'%3e%3cg%20id='Amex-500x500@1x'%3e%3crect%20id='Rectangle'%20fill='%23FFFFFF'%20x='0'%20y='0'%20width='18'%20height='18'%3e%3c/rect%3e%3cpath%20d='M0,0%20L0,18%20L18,18%20L18,15.147828%20L15.828444,15.147828%20L14.710428,13.911588%20L13.58676,15.147828%20L6.426972,15.147828%20L6.426972,9.386172%20L4.116096,9.386172%20L6.982488,2.89926%20L9.746856,2.89926%20L10.733652,5.121576%20L10.733652,2.89926%20L14.155416,2.89926%20L14.749524,4.573872%20L15.34752,2.89926%20L18,2.89926%20L18,0%20L0,0%20Z%20M15.884244,3.620664%20L14.754384,6.758172%20L13.631796,3.620664%20L11.480112,3.620664%20L11.480112,8.658072%20L12.840192,8.658072%20L12.840192,5.131872%20L14.135616,8.658072%20L15.344496,8.658072%20L16.639812,5.1246%20L16.639812,8.658072%20L18,8.658072%20L18,3.620664%20L15.884244,3.620664%20Z%20M7.486272,3.620664%20L5.262516,8.658072%20L6.77376,8.658072%20L7.191216,7.650576%20L9.508356,7.650576%20L9.93294,8.658072%20L11.480112,8.658072%20L9.256608,3.620664%20L7.486272,3.620664%20Z%20M8.349804,4.87278%20L9.03348,6.520716%20L7.666092,6.520716%20L8.349804,4.87278%20Z%20M16.222968,9.389052%20L14.747796,11.00106%20L13.286808,9.389052%20L11.480616,9.389052%20L13.855356,11.907792%20L11.480616,14.426496%20L13.236516,14.426496%20L14.71896,12.800088%20L16.19424,14.426496%20L18,14.426496%20L15.611328,11.893356%20L18,9.389052%20L16.222968,9.389052%20Z%20M7.191576,9.389052%20L7.191576,14.426496%20L11.480508,14.426496%20L11.480508,13.260672%20L8.566128,13.260672%20L8.566128,12.476268%20L11.40858,12.476268%20L11.40858,11.339172%20L8.566128,11.339172%20L8.566128,10.554912%20L11.480508,10.554912%20L11.480508,9.389052%20L7.191576,9.389052%20Z%20M16.6167,11.89548%20L18,13.367124%20L18,10.436112%20L16.6167,11.89548%20Z'%20id='500x500'%20fill='%23006FCF'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='18'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,ep=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='28px'%20height='20px'%20viewBox='0%200%2028%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eDiscover%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Click-to-Pay-Styles-for-UI-Display'%20transform='translate(-3913.000000,%20-619.000000)'%3e%3cg%20id='button_dark_v3.1_178x32'%20transform='translate(3776.000000,%20612.000000)'%3e%3cg%20id='v4_mark_light_S_15px'%20transform='translate(14.500000,%207.500000)'%3e%3cg%20id='Discover'%20transform='translate(123.000000,%200.000000)'%3e%3cg%20id='Group'%20transform='translate(0.000000,%200.500000)'%20fill-rule='nonzero'%3e%3cg%20id='Discover_26x16'%3e%3crect%20id='Rectangle'%20fill='%23FFFFFF'%20x='0'%20y='0'%20width='27'%20height='17'%3e%3c/rect%3e%3cpath%20d='M26.8272,9.445625%20C26.8272,9.445625%2019.494,14.535%206.0696,16.80875%20L26.8272,16.80875%20L26.8272,9.445625%20Z'%20id='Path'%20fill='%23F68C1E'%3e%3c/path%3e%3cpath%20d='M26.9028389,0%20L0,0%20L0,17%20L27,17%20L27,0%20L26.9028389,0%20Z%20M26.8056777,0.19125%20L26.8056777,16.80875%20L0.194322271,16.80875%20C0.194322271,16.6175%200.194322271,0.3825%200.194322271,0.19125%20C0.388644542,0.19125%2026.6113555,0.19125%2026.8056777,0.19125'%20id='Shape'%20fill='%23000105'%3e%3c/path%3e%3cpath%20d='M2.3652,5.20625%20L1.242,5.20625%20L1.242,9.0525%20L2.3544,9.0525%20C2.9484,9.0525%203.3696,8.914375%203.7476,8.60625%20C4.1904,8.245%204.4604,7.6925%204.4604,7.129375%20C4.4604,5.9925%203.5964,5.20625%202.3652,5.20625%20M3.2508,8.09625%20C3.0132,8.30875%202.7,8.39375%202.214,8.39375%20L2.0088,8.39375%20L2.0088,5.854375%20L2.214,5.854375%20C2.7108,5.854375%203.0024,5.939375%203.2616,6.1625%20C3.5208,6.39625%203.672,6.7575%203.672,7.11875%20C3.672,7.490625%203.5208,7.8625%203.2508,8.09625'%20id='Shape'%20fill='%23000105'%3e%3c/path%3e%3crect%20id='Rectangle'%20fill='%23000105'%20x='4.8168'%20y='5.20625'%20width='1'%20height='3.84625'%3e%3c/rect%3e%3cpath%20d='M7.4412,6.6725%20C6.9768,6.513125%206.8472,6.39625%206.8472,6.194375%20C6.8472,5.95%207.0848,5.769375%207.4196,5.769375%20C7.6464,5.769375%207.8408,5.865%208.0352,6.0775%20L8.424,5.5675%20C8.1,5.280625%207.7004,5.1425%207.2792,5.1425%20C6.588,5.1425%206.0588,5.61%206.0588,6.2475%20C6.0588,6.77875%206.3072,7.044375%207.02,7.299375%20C7.3224,7.405625%207.4736,7.469375%207.5492,7.5225%20C7.7004,7.6075%207.776,7.745625%207.776,7.915625%20C7.776,8.22375%207.5276,8.4575%207.182,8.4575%20C6.8148,8.4575%206.5232,8.276875%206.3504,7.9475%20L5.8644,8.404375%20C6.21,8.914375%206.6312,9.1375%207.2144,9.1375%20C8.0028,9.1375%208.5644,8.616875%208.5644,7.873125%20C8.5644,7.2675%208.3052,6.99125%207.4412,6.6725'%20id='Path'%20fill='%23000105'%3e%3c/path%3e%3cpath%20d='M8.802,7.129375%20C8.802,8.255625%209.7092,9.1375%2010.8648,9.1375%20C11.1888,9.1375%2011.4696,9.07375%2011.826,8.914375%20L11.826,8.0325%20C11.5236,8.33%2011.2536,8.4575%2010.908,8.4575%20C10.1412,8.4575%209.5904,7.905%209.5904,7.129375%20C9.5904,6.385625%2010.152,5.811875%2010.8648,5.811875%20C11.232,5.811875%2011.502,5.939375%2011.826,6.2475%20L11.826,5.355%20C11.4912,5.185%2011.2212,5.12125%2010.8864,5.12125%20C9.7308,5.110625%208.802,6.01375%208.802,7.129375'%20id='Path'%20fill='%23000105'%3e%3c/path%3e%3cpolygon%20id='Path'%20fill='%23000105'%20points='17.874%207.788125%2016.8264%205.20625%2015.9948%205.20625%2017.658%209.148125%2018.0684%209.148125%2019.7532%205.20625%2018.9216%205.20625'%3e%3c/polygon%3e%3cpolygon%20id='Path'%20fill='%23000105'%20points='20.0988%209.0525%2022.2588%209.0525%2022.2588%208.39375%2020.8548%208.39375%2020.8548%207.363125%2022.2048%207.363125%2022.2048%206.704375%2020.8548%206.704375%2020.8548%205.854375%2022.2588%205.854375%2022.2588%205.20625%2020.0988%205.20625'%3e%3c/polygon%3e%3cpath%20d='M25.2828,6.3325%20C25.2828,5.61%2024.7752,5.195625%2023.9004,5.195625%20L22.7664,5.195625%20L22.7664,9.041875%20L23.5332,9.041875%20L23.5332,7.50125%20L23.6304,7.50125%20L24.6888,9.041875%20L25.6284,9.041875%20L24.3972,7.426875%20C24.9588,7.31%2025.2828,6.9275%2025.2828,6.3325%20M23.7492,6.97%20L23.5224,6.97%20L23.5224,5.80125%20L23.76,5.80125%20C24.2352,5.80125%2024.4944,5.9925%2024.4944,6.375%20C24.4944,6.768125%2024.2352,6.97%2023.7492,6.97'%20id='Shape'%20fill='%23000105'%3e%3c/path%3e%3cpath%20d='M16.2216,7.129375%20C16.2216,8.255625%2015.2928,9.169375%2014.148,9.169375%20C13.0032,9.169375%2012.0744,8.255625%2012.0744,7.129375%20C12.0744,6.003125%2013.0032,5.089375%2014.148,5.089375%20C15.2928,5.07875%2016.2216,6.003125%2016.2216,7.129375'%20id='Path'%20fill='%23F68C1E'%3e%3c/path%3e%3cpath%20d='M25.6824,5.282375%20C25.6824,5.217575%2025.6392,5.174375%2025.5528,5.174375%20L25.4448,5.174375%20L25.4448,5.519975%20L25.5312,5.519975%20L25.5312,5.379575%20L25.6284,5.509175%20L25.7256,5.509175%20L25.6176,5.368775%20C25.6608,5.357975%2025.6824,5.325575%2025.6824,5.282375'%20id='Shape'%20fill='%23231F20'%3e%3c/path%3e%3cpath%20d='M25.5744,5.046875%20C25.4124,5.046875%2025.272,5.176475%2025.272,5.349275%20C25.272,5.511275%2025.4016,5.651675%2025.5744,5.651675%20C25.7364,5.651675%2025.866,5.522075%2025.866,5.349275%20C25.866,5.187275%2025.7364,5.046875%2025.5744,5.046875%20M25.5744,5.597675%20C25.4448,5.597675%2025.3368,5.489675%2025.3368,5.349275%20C25.3368,5.208875%2025.4448,5.100875%2025.5744,5.100875%20C25.704,5.100875%2025.812,5.208875%2025.812,5.349275%20C25.812,5.478875%2025.704,5.597675%2025.5744,5.597675'%20id='Shape'%20fill='%23231F20'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3crect%20id='Rectangle-export'%20x='0'%20y='0'%20width='27'%20height='18'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`;G();var tp={class:`click2pay-logo`},np={key:0,src:Zf,alt:`MasterCard`},rp={key:1,src:Qf,alt:`Visa`},ip={key:2,src:$f,alt:`American Express`},ap={key:3,src:ep,alt:`Discover`},op=R({__name:`ClickToPayLogo`,props:{options:{}},setup(e){let t=e,n=F(t.options.cardBrands||Yf);return jr(()=>t,()=>{n.value=t.options.cardBrands||[]},{flush:`post`,deep:!0}),(e,t)=>(z(),B(`div`,tp,[t[0]||=V(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20viewBox='0%204.1942%20233.76%20118.7958'%20width='233.76'%20height='118.7958'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23000000'%20d='%20M%200.00%20103.74%20L%200.00%2023.26%20Q%202.71%209.47%2014.47%205.49%20Q%2018.21%204.22%2025.63%204.29%20Q%2036.12%204.39%2046.57%204.28%20Q%2049.98%204.25%2051.32%204.95%20C%2054.47%206.62%2054.71%2012.27%2051.60%2014.18%20Q%2050.30%2014.99%2047.25%2015.02%20Q%2035.25%2015.14%2023.26%2015.04%20Q%2014.82%2014.97%2012.04%2021.22%20Q%2010.75%2024.12%2010.75%2032.47%20Q%2010.77%2064.65%2010.78%2096.84%20C%2010.79%20108.05%2013.62%20112.09%2024.83%20112.11%20Q%2044.80%20112.15%2064.75%20112.07%20C%2068.72%20112.05%2071.55%20109.52%2074.24%20106.26%20Q%2091.06%2085.85%20108.91%2064.44%20A%200.86%200.86%200.0%200%200%20108.91%2063.34%20Q%2088.54%2038.50%2067.91%2013.34%20C%2065.75%2010.71%2065.99%207.28%2068.57%205.40%20Q%2070.05%204.32%2073.59%204.32%20Q%2088.43%204.31%20103.25%204.33%20Q%20105.90%204.33%20107.17%205.80%20Q%20130.58%2032.79%20153.94%2059.81%20C%20156.70%2063.00%20155.25%2065.90%20152.73%2068.88%20Q%20134.57%2090.29%20116.24%20111.71%20A%200.35%200.35%200.0%200%200%20116.51%20112.29%20L%20132.44%20112.24%20A%201.43%201.43%200.0%200%200%20133.55%20111.71%20L%20172.96%2063.93%20A%200.83%200.83%200.0%200%200%20172.96%2062.87%20Q%20152.96%2038.50%20132.93%2014.07%20Q%20131.33%2012.10%20131.02%2010.69%20C%20130.23%207.08%20133.94%203.44%20137.37%204.33%20Q%20139.27%204.83%20141.51%207.48%20Q%20163.74%2033.77%20186.06%2059.98%20Q%20189.13%2063.58%20185.65%2067.66%20Q%20162.44%2094.91%20139.34%20121.71%20A%203.12%203.10%2020.2%200%201%20137.01%20122.78%20Q%20120.84%20122.82%20104.23%20122.76%20C%2097.72%20122.74%2097.24%20117.14%20100.66%20112.96%20Q%20120.69%2088.51%20140.71%2064.30%20A%200.99%200.99%200.0%200%200%20140.71%2063.04%20L%20101.46%2015.56%20A%201.23%201.23%200.0%200%200%20100.51%2015.11%20L%2084.28%2015.01%20A%200.39%200.39%200.0%200%200%2083.98%2015.65%20Q%20102.93%2037.75%20121.70%2059.56%20C%20125.42%2063.89%20122.26%2066.94%20118.90%2070.92%20Q%2099.67%2093.66%2080.30%20116.30%20Q%2077.34%20119.77%2072.30%20121.55%20Q%2068.93%20122.74%2063.06%20122.75%20Q%2042.72%20122.77%2022.39%20122.77%20C%2010.50%20122.77%202.31%20115.51%200.00%20103.74%20Z'%20transform='matrix(1,%200,%200,%201,%20-3.552713678800501e-15,%200)'/%3e%3crect%20fill='%23000000'%20x='228.78'%20y='4.23'%20width='4.98'%20height='118.76'%20rx='2.41'%20transform='matrix(1,%200,%200,%201,%20-3.552713678800501e-15,%200)'/%3e%3c/svg%3e`,alt:`Click To Pay`},null,-1),n.value.includes(I(Jf).mastercard)?(z(),B(`img`,np)):H(``,!0),n.value.includes(I(Jf).visa)?(z(),B(`img`,rp)):H(``,!0),n.value.includes(I(Jf).amex)?(z(),B(`img`,ip)):H(``,!0),n.value.includes(I(Jf).discover)?(z(),B(`img`,ap)):H(``,!0)]))}});q();var sp=K(op,[[`__scopeId`,`data-v-c2abe5c3`]]);G(),vc();var cp={style:{display:`flex`,gap:`20px`}},lp={class:`payfurl-form`},up={class:`container-form`},dp={class:`row`},fp={style:{width:`100%`}},pp={key:0,class:`error`},mp={class:`row`},hp={style:{width:`100%`}},gp={key:0,class:`error`},_p=R({__name:`LoginForm`,props:{log:{type:Function},options:{}},emits:[`close`,`submit`,`logout`],setup(e,{emit:t}){let n=e,r=t,i=F(``),a=F(``),o=F({});function s(){return o.value={},!a.value&&!cc(i.value)&&(o.value.email=`Please type valid email address`),a.value&&!sc(a.value)&&(o.value.phone=`Please type phone in international format`),Object.keys(o.value).length===0}function c(){s()&&r(`submit`,{email:i.value,phone:a.value})}function l(){r(`close`)}function u(){r(`logout`)}return(e,t)=>(z(),Ji(wd,{width:`350`,onClose:l},{title:Er(()=>[V(`div`,cp,[W(sp,{options:n.options},null,8,[`options`]),t[2]||=ea(` Click To Pay Login `,-1)])]),body:Er(()=>[V(`div`,lp,[V(`div`,up,[V(`div`,dp,[t[3]||=V(`label`,null,`Email Address`,-1),V(`div`,fp,[Dr(V(`input`,{type:`text`,maxlength:`100`,placeholder:`Email Address`,name:`email`,"onUpdate:modelValue":t[0]||=e=>i.value=e},null,512),[[Ws,i.value]]),o.value.email?(z(),B(`p`,pp,N(o.value.email),1)):H(``,!0)])]),V(`div`,mp,[t[4]||=V(`label`,null,`Phone`,-1),V(`div`,hp,[Dr(V(`input`,{type:`text`,maxlength:`100`,placeholder:`Phone`,name:`phone`,"onUpdate:modelValue":t[1]||=e=>a.value=e},null,512),[[Ws,a.value]]),o.value.phone?(z(),B(`p`,gp,N(o.value.phone),1)):H(``,!0)])])])])]),footer:Er(()=>[V(`div`,{class:`payfurl-form payfurl-form-footer`},[V(`button`,{onClick:u},`Continue as Guest`),V(`button`,{onClick:c},`Login`)])]),_:1}))}});q();var vp=K(_p,[[`__scopeId`,`data-v-693ba623`]]);vc(),he();var yp=[`4761739001010010`,`4005520000000129`,`5413330089010640`,`5413330089600119`,`374245001721009`,`4035874000424977`,`5413330089010640`];function bp(e,t){if(t===C.PRODUCTION||!yp.includes(e))return null;switch(mc(e)){case`visa`:return{cardNumber:`4622943123103732`,expiryDate:`12/25`,ccv:`750`};case`mastercard`:return{cardNumber:`5204731620064595`,expiryDate:`12/28`};case`amex`:return{cardNumber:`373708623186001`,expiryDate:`12/28`,ccv:`7777`};default:return null}}yl(),ec(),Y(),vc(),he();var xp=1e3,Sp=e=>`${(e?.email||``).trim().toLowerCase()}|${e?.phoneNumber||``}`,Cp=`Click to Pay is unavailable. Please proceed with an alternative payment method`,wp={SANDBOX:{uiKit:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.esm.js`,uiKitCss:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.css`,sdk:`https://sandbox.src.mastercard.com/sdk/srcsdk.mastercard.js`,lib:`https://sandbox.src.mastercard.com/srci/integration/2/lib.js?srcDpaId={dpaId}&locale=en_AU`},PRODUCTION:{uiKit:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.esm.js`,uiKitCss:`https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.css`,sdk:`https://src.mastercard.com/sdk/srcsdk.mastercard.js`,lib:`https://src.mastercard.com/srci/integration/2/lib.js?srcDpaId={dpaId}&locale=en_AU`}},Q=class extends Lu{enabled=!0;initialized=!1;loaded=!1;container;environment;amount=0;currency=`AUD`;customer=null;options;srcOtpInput=null;srcLearnMore=null;srcLearnMoreElement=null;mcModal=null;mcFrame=null;modal=null;cards=[];tokenAuthenticationEnabled=!1;rememberMe=!0;localStartCallback=null;supportedValidationChannels=[];availableCardBrands=[];validationChannelsNetwork=`mastercard`;requestedValidationChannelId=``;attempts=0;startIsRunning=!1;readyCallbacks=[];started=!1;run=0;lookedUp=new Set;restartTimer=null;visibilityObserver=null;constructor(e,t){super(e),this.options=t.options||{},this.container=t.container||document.body,this.environment=t.environment||C.DEVELOPMENT;let n=Ru(this.environment);this.options.networkTokenOptions={...n,...this.options.networkTokenOptions||{}},t.options?.tokenAuthenticationEnabled?this.enableTokenAuthentication():this.disableTokenAuthentication(),this.log(`[ClickToPayProcessor]`,t),window.addEventListener(`message`,this.messageHandler.bind(this))}setContainer(e){this.container=e||document.body,this.attachOtpInput()}setAmount(e){this.amount=e}getAmount(){return this.amount}setCurrency(e){this.currency=e}getCurrency(){return this.currency}setOptions(e){this.log(`[ClickToPayProcessor][setOptions]`,e),this.options=e,this.options?.tokenAuthenticationEnabled?this.enableTokenAuthentication():this.disableTokenAuthentication()}setCustomerInfo(e,t){this.log(`[ClickToPayProcessor][setCustomerInfo]`,e),this.customer={...e,email:e?.email||this.customer?.email||``},!t&&this.initialized&&this.started&&(this.cancelRestart(),(this.customer.email||this.customer.phoneNumber)&&(this.lookedUp.has(Sp(this.customer))||(this.restartTimer=window.setTimeout(()=>{this.restartTimer=null,this.cleanUp(this.container),this.start()},xp))))}cancelRestart(){this.restartTimer!==null&&(window.clearTimeout(this.restartTimer),this.restartTimer=null)}stopWaitingForVisibility(){this.visibilityObserver?.disconnect(),this.visibilityObserver=null}getCustomerInfo(){return this.customer}getRememberMe(){return!!this.rememberMe}setRememberMe(e){this.rememberMe=e}enableTokenAuthentication(){this.tokenAuthenticationEnabled=!0}disableTokenAuthentication(){this.tokenAuthenticationEnabled=!1}getCards(){return this.cards}whenReady(e=6e4){return this.loaded?Promise.resolve():new Promise((t,n)=>{let r=()=>t();this.readyCallbacks.push(r),window.setTimeout(()=>{let e=this.readyCallbacks.indexOf(r);e<0||(this.readyCallbacks.splice(e,1),n(Error(`Click to Pay is not ready`)))},e)})}setCards(e){this.cards=e;let t=this.getCardFormFrame();if(t)try{t.contentWindow?.postMessage({status:Yl,cards:e},`*`)}catch(e){this.log(`[setCards] iframe error`,e)}else this.log(`[setCards] iframe not found`)}isSchemeSupported(e){return this.availableCardBrands.includes(mc(e))}messageHandler(e){e?.data?.status&&(e.data.status===`click2pay-remember-me`?(this.log(`[clickToPayProcessor]: message "${e.data.status}" received`,e.data),this.setRememberMe(!!e.data.message)):(e.data.status===`click2pay-change-user`&&(this.log(`[clickToPayProcessor]: message "${e.data.status}" received`,e.data),this.showChangeUserPopup()),e.data.status===`click2pay-show-learn-more`&&(this.log(`[clickToPayProcessor]: message "${e.data.status}" received`,e.data),this.mcShowLearnMore())))}init(){this.initialized||=(this.log(`[ClickToPayProcessor] - INIT`,this.getCustomerInfo()),this.startLoadingCardForm(),this.initCss(),this.createOtpInput(),this.createModalForm(),this.createLearnMore(),this.initScripts(),!0)}cleanUp(e){this.stopWaitingForVisibility(),this.stopLoadingCardForm(),this.mcHideOtpInput(),this.hideModalForm(),this.setCards([])}isInitialized(){return this.initialized}start(){if(this.log(`[ClickToPayProcessor] - START`,this.startIsRunning,this.loaded,this.getCustomerInfo()),this.startIsRunning)return;this.startIsRunning=!0,this.started=!0,this.cancelRestart();let e=()=>{this.attachOtpInput(),this.runClickToPay(),this.startLoadingCardForm(),this.startIsRunning=!1};this.loaded?e():this.localStartCallback=e}initCheckoutServiceLib(){let e=this.getLibUrl(`lib`).replace(`{dpaId}`,this.options.dpaId);if(typeof window.requirejs==`function`){window.requirejs([e],e=>{window.MastercardCheckoutServices=e.MastercardCheckoutServices,this.mcInitClickToPay()});return}let t=document.createElement(`script`);t.src=e,t.onload=T(this,`[ClickToPayProcessor]: CheckoutServiceLib loaded`,()=>{this.log(`[ClickToPayProcessor]: CheckoutServiceLib loaded`),this.mcInitClickToPay()}),t.onerror=T(this,`[ClickToPayProcessor]: CheckoutServiceLib error`,t=>{this.log(`[ClickToPayProcessor]: CheckoutServiceLib error`,t),this.sendErrorNotification(`CheckoutServiceLib error`,[e,t]),this.stopUsing()}),document.head.appendChild(t)}initScripts(){let e=0,t=document.createElement(`script`);t.src=this.getLibUrl(`uiKit`),t.type=`module`,t.onload=()=>{this.log(`[ClickToPayProcessor]: src-ui-kit loaded`),e++,e>1&&this.initCheckoutServiceLib()},t.onerror=e=>{this.log(`[ClickToPayProcessor]: src-ui-kit loading error`,e),this.stopUsing()},document.head.appendChild(t);let n=document.createElement(`script`);n.src=this.getLibUrl(`sdk`),n.onload=()=>{this.log(`[ClickToPayProcessor]: srcsdk.mastercard.js loaded`),e++,e>1&&this.initCheckoutServiceLib()},n.onerror=t=>{this.log(`[ClickToPayProcessor]: srcsdk.mastercard.js loading error`,t),e++,e>1&&this.initCheckoutServiceLib()},document.head.appendChild(n);let r=document.createElement(`link`);r.href=this.getLibUrl(`uiKitCss`),r.rel=`stylesheet`,document.head.appendChild(r)}initCss(){let e=document.createElement(`style`);e.textContent=`
|
|
151
151
|
.click-to-pay-payfurl {
|
|
152
152
|
align-items: normal;
|
|
153
153
|
display: flex;
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
src-otp-input {
|
|
271
271
|
min-width: 250px;
|
|
272
272
|
}
|
|
273
|
-
`,document.head.appendChild(e),this.srcOtpInput=document.createElement(`src-otp-input`),this.srcOtpInput.setAttribute(`locale`,`en-US`),this.srcOtpInput.setAttribute(`display-cancel-option`,`true`),this.srcOtpInput.setAttribute(`otp-resend-loading`,`false`),this.srcOtpInput.setAttribute(`display-remember-me`,`true`),this.srcOtpInput.setAttribute(`style`,`display: none;margin-bottom: 20px;min-width: 250px;`);let t=``,n=this;this.srcOtpInput.addEventListener(`continue`,function(e){n.log(`OTP: continue`,e),n.mcHideOtpInput(),n.mcValidate(t)}),this.srcOtpInput.addEventListener(`otpChanged`,function(e){t=e.detail}),this.srcOtpInput.addEventListener(`resendOtp`,function(e){n.log(`OTP: resendOtp`,e),n.mcInitiateValidation(e.detail)}),this.srcOtpInput.addEventListener(`notYouRequested`,function(e){n.log(`OTP: notYouRequested`,e),n.mcHideOtpInput(),n.mcLogout(),n.showLoginForm()}),this.srcOtpInput.addEventListener(`clickSignOutLink`,function(e){n.log(`OTP: clickSignOutLink`,e),n.mcHideOtpInput(),n.mcLogout(),n.showLoginForm()}),this.srcOtpInput.addEventListener(`alternateRequested`,function(e){n.log(`OTP: alternateRequested`,e),n.mcInitiateValidation()}),this.srcOtpInput.addEventListener(`close`,function(e){n.log(`OTP: close`,e),n.mcHideOtpInput(),n.mcLogout(),n.setCards([]),n.stopLoadingCardForm()}),this.srcOtpInput.addEventListener(`rememberMe`,function(e){n.log(`OTP: rememberMe`,e),n.setRememberMe(e.detail?.rememberMe)})}attachOtpInput(){this.srcOtpInput&&!this.container.contains(this.srcOtpInput)&&this.container.appendChild(this.srcOtpInput)}createLearnMore(){let e=document.createElement(`div`);e.setAttribute(`class`,`click-to-pay-payfurl`),e.setAttribute(`style`,`display: none;margin:calc(100vh/2 - 225px) auto auto`);let t=document.createElement(`div`);t.setAttribute(`class`,`modal-wrapper`),e.appendChild(t);let n=document.createElement(`div`);n.setAttribute(`class`,`modal-content`),n.setAttribute(`style`,`width:375px; height:max-content;`);let r=document.createElement(`div`);r.setAttribute(`class`,`modal-body`),n.appendChild(r);let i=this,a=document.createElement(`src-learn-more`);a.setAttribute(`card-brands`,(this.options.cardBrands||
|
|
273
|
+
`,document.head.appendChild(e),this.srcOtpInput=document.createElement(`src-otp-input`),this.srcOtpInput.setAttribute(`locale`,`en-US`),this.srcOtpInput.setAttribute(`display-cancel-option`,`true`),this.srcOtpInput.setAttribute(`otp-resend-loading`,`false`),this.srcOtpInput.setAttribute(`display-remember-me`,`true`),this.srcOtpInput.setAttribute(`style`,`display: none;margin-bottom: 20px;min-width: 250px;`);let t=``,n=this;this.srcOtpInput.addEventListener(`continue`,function(e){n.log(`OTP: continue`,e),n.mcHideOtpInput(),n.mcValidate(t)}),this.srcOtpInput.addEventListener(`otpChanged`,function(e){t=e.detail}),this.srcOtpInput.addEventListener(`resendOtp`,function(e){n.log(`OTP: resendOtp`,e),n.mcInitiateValidation(e.detail)}),this.srcOtpInput.addEventListener(`notYouRequested`,function(e){n.log(`OTP: notYouRequested`,e),n.mcHideOtpInput(),n.mcLogout(),n.showLoginForm()}),this.srcOtpInput.addEventListener(`clickSignOutLink`,function(e){n.log(`OTP: clickSignOutLink`,e),n.mcHideOtpInput(),n.mcLogout(),n.showLoginForm()}),this.srcOtpInput.addEventListener(`alternateRequested`,function(e){n.log(`OTP: alternateRequested`,e),n.mcInitiateValidation()}),this.srcOtpInput.addEventListener(`close`,function(e){n.log(`OTP: close`,e),n.mcHideOtpInput(),n.mcLogout(),n.setCards([]),n.stopLoadingCardForm()}),this.srcOtpInput.addEventListener(`rememberMe`,function(e){n.log(`OTP: rememberMe`,e),n.setRememberMe(e.detail?.rememberMe)})}attachOtpInput(){this.srcOtpInput&&!this.container.contains(this.srcOtpInput)&&this.container.appendChild(this.srcOtpInput)}createLearnMore(){let e=document.createElement(`div`);e.setAttribute(`class`,`click-to-pay-payfurl`),e.setAttribute(`style`,`display: none;margin:calc(100vh/2 - 225px) auto auto`);let t=document.createElement(`div`);t.setAttribute(`class`,`modal-wrapper`),e.appendChild(t);let n=document.createElement(`div`);n.setAttribute(`class`,`modal-content`),n.setAttribute(`style`,`width:375px; height:max-content;`);let r=document.createElement(`div`);r.setAttribute(`class`,`modal-body`),n.appendChild(r);let i=this,a=document.createElement(`src-learn-more`);a.setAttribute(`card-brands`,(this.options.cardBrands||Yf).join(`,`)),a.addEventListener(`close`,function(e){i.log(`src-learn-more: close`,e),i.mcHideLearnMore()}),a.addEventListener(`ok`,function(e){i.log(`src-learn-more: ok`,e),i.mcHideLearnMore()}),r.appendChild(a),this.srcLearnMoreElement=a,t.appendChild(n),document.body.appendChild(e),this.srcLearnMore=e}createModalForm(){if(this.tokenAuthenticationEnabled)return;let e=`maxTouchPoints`in navigator&&navigator.maxTouchPoints>0,t=`380px`,n=e?`791px`:`637px`,r=e?`796px`:`642px`,i=document.createElement(`div`);i.setAttribute(`class`,`click-to-pay-payfurl`),i.setAttribute(`style`,`display: none;`);let a=document.createElement(`div`);a.setAttribute(`class`,`modal-wrapper`),i.appendChild(a);let o=document.createElement(`div`);o.setAttribute(`class`,`modal-content`),o.setAttribute(`style`,`width:${t};min-width:${t};height:${r};max-width:100vw;max-height:100vh;`);let s=document.createElement(`div`);s.setAttribute(`class`,`modal-body`),s.setAttribute(`style`,`background: #F7F7F7`),o.appendChild(s);let c=document.createElement(`iframe`);c.setAttribute(`style`,`width:375px;max-width:100vw;height:${n};max-height:99vh;border:0;overflow:hidden;`),c.id=`mcModalBody-`+Math.random().toString(36),s.appendChild(c),a.appendChild(o),document.body.appendChild(i),this.mcModal=i;for(let e=0;e<window.frames.length;e++)try{window.frames[e].frameElement?.id===c.id&&(this.mcFrame=window.frames[e])}catch{}}showModalForm(){if(!this.tokenAuthenticationEnabled){if(!this.mcModal)return;this.mcModal.style.display=`block`;return}if(this.modal)return;let e=`maxTouchPoints`in navigator&&navigator.maxTouchPoints>0?791:637,t=window.screenLeft===void 0?window.screenX:window.screenLeft,n=window.screenTop===void 0?window.screenY:window.screenTop,r=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=r/window.screen.availWidth,o=(r-375)/2/a+t,s=(i-e)/2/a+n;this.modal=window.open(``,`targetWindow`,`toolbar=no,
|
|
274
274
|
location=no,
|
|
275
275
|
status=no,
|
|
276
276
|
menubar=no,
|
|
@@ -279,4 +279,4 @@ src-otp-input {
|
|
|
279
279
|
width=375,
|
|
280
280
|
height=${e},
|
|
281
281
|
top=${s},
|
|
282
|
-
left=${o}`)}hideModalForm(){if(this.tokenAuthenticationEnabled)this.modal&&this.modal.close();else{if(!this.mcModal)return;this.mcModal.style.display=`none`}}mcHideOtpInput(){let e=this;customElements.whenDefined(`src-otp-input`).then(()=>{e.log(`[src-otp-input], mcHideOtpInput`,e.srcOtpInput),e.srcOtpInput.style.display=`none`}).catch(e=>{this.log(`[customElements.whenDefined]`,e),this.sendErrorNotification(`mcHideOtpInput.whenDefined error`,[e])}),this.unpauseLoadingCardForm()}mcShowOtpInput(e,t,n){this.log(`[mcShowOtpInput]`,this.requestedValidationChannelId,e,t,n);let r=this;customElements.whenDefined(`src-otp-input`).then(T(this,`[mcShowOtpInput], success`,()=>{let i=e.find(e=>e.identityType===`SMS`),a=e.find(e=>e.identityType===`EMAIL`),o=[];this.requestedValidationChannelId&&this.requestedValidationChannelId!==`EMAIL`||!a||this.requestedValidationChannelId!=`EMAIL`&&(this.requestedValidationChannelId||t!==`visa`)||o.push(a.maskedValidationChannel),(!this.requestedValidationChannelId||this.requestedValidationChannelId===`SMS`)&&i&&o.push(i.maskedValidationChannel),this.log(`[src-otp-input], mcShowOtpInput`,r.srcOtpInput,e,t,o,n),r.srcOtpInput.loadSupportedValidationChannels?.(e),r.srcOtpInput.setAttribute(`network-id`,t),r.srcOtpInput.setAttribute(`card-brands`,t),r.srcOtpInput.setAttribute(`masked-identity-value`,o.join(`,`)),n?r.srcOtpInput.setAttribute(`error-reason`,n):r.srcOtpInput.removeAttribute(`error-reason`),r.srcOtpInput.style.display=`block`,r.adjustRememberMeOnOtpInput(),r.pauseLoadingCardForm()})).catch(e=>{this.log(`[mcShowOtpInput.whenDefined]`,e),this.sendErrorNotification(`mcShowOtpInput.whenDefined error`,[e])})}adjustRememberMeOnOtpInput(){let e=this.srcOtpInput.shadowRoot.getElementById(`remember_me`);e&&(e.checked&&!this.getRememberMe()||!e.checked&&this.getRememberMe())&&e.dispatchEvent(new MouseEvent(`click`,{view:window,bubbles:!0,cancelable:!0}))}mcHideLearnMore(){this.log(`[src-learn-more], mcHideLearnMore`,this.srcLearnMore),this.srcLearnMore.style.display=`none`}mcShowLearnMore(){this.log(`[src-learn-more], mcShowLearnMore`,this.srcLearnMore);let e=this.availableCardBrands.length>0&&this.availableCardBrands||Rf;e.includes(Lf.mastercard)&&(e.splice(e.indexOf(Lf.mastercard),1),e.unshift(Lf.mastercard)),this.srcLearnMoreElement.setAttribute(`card-brands`,(this.availableCardBrands.length>0&&this.availableCardBrands||Rf).join(`,`)),this.srcLearnMore.style.display=`block`}showChangeUserPopup(){this.showLoginForm()}showLoginForm(){let{destroy:e}=Qs({el:document.body,component:sp,props:{log:this.log,options:this.options},on:{close:T(this,`[showLoginForm], onclose`,()=>{this.log(`[LoginForm.close]`),this.stopLoadingCardForm(),e()}),submit:T(this,`[showLoginForm], onsubmit`,({email:t,phone:n})=>{this.log(`[LoginForm.submit]`,t,n),e(),this.customer||this.setCustomerInfo({firstName:``,lastName:``,email:``,phoneNumber:``}),this.customer.email=t,this.customer.phoneNumber=n,!t&&!n?this.stopLoadingCardForm():(this.setCards([]),this.mcIdLookup())}),logout:T(this,`[showLoginForm], onlogout`,()=>{this.log(`[LoginForm.logout]`),e(),this.stopLoadingCardForm(),this.setCards([]),this.mcLogout()})}})}checkoutWithCard(e,t,n){this.log(`ClickToPayProcessor.checkoutWithExistingCard`,e);let r=this,i=T(this,`[checkoutWithCard.promiseResolvedHandler]`,e=>{r.log(`[checkoutWithCard.promiseResolvedHandler]`,e),r.hideModalForm(),t(e)}),a=T(this,`[checkoutWithCard.promiseRejectedHandler]`,t=>{r.log(`[checkoutWithCard.promiseRejectedHandler]`,t),r.stopUsing(),r.showInfoMessage(up),n(t),r.sendErrorNotification(`checkoutWithCard error`,[e,o,t])});this.showModalForm();let o={windowRef:this.tokenAuthenticationEnabled?this.modal:this.mcFrame,srcDigitalCardId:e.srcDigitalCardId,dpaTransactionOptions:this.generateDpaTransactionOptions(),recognitionTokenRequested:this.rememberMe};this.log(`[checkoutWithCard]`,o),window.mcCheckoutService.checkoutWithCard(o).then(i).catch(a)}checkoutWithNewCard(e,t,n,r,i,a){this.log(`ClickToPayProcessor.checkoutWithNewCard`,{cardNumber:gl(e),expiryDate:t,ccv:`***`,enrollCard:r}),this.tokenAuthenticationEnabled&&this.showModalForm(),this.encryptCard(e,t,n,T(this,`[mcEncryptCard], success`,(e,t)=>{this.checkoutWithEncryptedNewCard(e,t,e=>{i(e)},a)}),T(this,`[mcEncryptCard], error`,n=>{a(n),this.sendErrorNotification(`mcEncryptCard error`,[{cardNumber:e,expiryDate:t,enrollCard:r},n])}))}checkoutWithEncryptedNewCard(e,t,n,r){let i=this,a=T(this,`[checkoutWithNewCard.promiseResolvedHandler]`,e=>{i.log(`[checkoutWithNewCard.promiseResolvedHandler]`,e),i.hideModalForm(),e.checkoutActionCode===`SWITCH_CONSUMER`?i.showLoginForm():[`CHANGE_CARD`,`CANCEL`].includes(e.checkoutActionCode)||n(e)}),o=T(this,`[checkoutWithNewCard.promiseRejectedHandler]`,e=>{i.log(`[checkoutWithNewCard.promiseRejectedHandler]`,e),i.stopUsing(),i.showInfoMessage(up),r(e),i.sendErrorNotification(`checkoutWithNewCard error`,[s,e])});this.showModalForm();let s={windowRef:this.tokenAuthenticationEnabled?this.modal:this.mcFrame,encryptedCard:e,cardBrand:t,consumer:this.generateConsumerInfo(),dpaTransactionOptions:this.generateDpaTransactionOptions()};this.log(`checkoutWithNewCard`,s),window.mcCheckoutService.checkoutWithNewCard(s).then(a).catch(o)}encryptCard(e,t,n,r,i){let a=lp(e,this.environment);this.whenReady().then(()=>{this.mcEncryptCard(a?.cardNumber||e,a?.expiryDate||t,a?.ccv||n,r,i)}).catch(i)}mcLogout(){window.mcCheckoutService.signOut(),this.mcHideOtpInput()}mcInitClickToPay(){if(window.mcCheckoutService=new window.MastercardCheckoutServices,!window.mcCheckoutService){this.log(`[mcInitClickToPay] mcCheckoutService or sdk not found`,window.MastercardCheckoutServices,window.SRCSDK_MASTERCARD),this.stopUsing();return}let e=this,t=T(this,`[mcInitClickToPay.promiseResolvedHandler]`,t=>{e.log(`[mcInitClickToPay.promiseResolvedHandler]`,t),e.updateAvailableCardBrands(t.availableCardBrands),e.loaded=!0,e.resolveReadyCallbacks(),e.localStartCallback&&e.localStartCallback()}),n=T(this,`[mcInitClickToPay.promiseRejectedHandler]`,t=>{e.log(`[mcInitClickToPay.promiseRejectedHandler]`,t),e.loaded=!0,e.sendErrorNotification(`mcInitClickToPay error`,[r,t]),e.stopUsing()}),r={srcDpaId:this.options.dpaId,dpaData:{dpaName:this.options.dpaName||`TAS-${this.options.dpaId}`},dpaTransactionOptions:this.generateDpaTransactionOptions(),cardBrands:this.options?.cardBrands?.length?this.options?.cardBrands:Rf,checkoutExperience:`WITHIN_CHECKOUT`},i=this.getRecognitionToken();i&&(r.recognitionToken=i),this.log(`[mcInitClickToPay]`,r),window.mcCheckoutService.init(r).then(t).catch(n)}mcIdLookup(e=!1){if(this.log(`[mcIdLookup]`,this.customer,e),this.attempts=0,!this.customer?.phoneNumber&&!this.customer?.email){this.cleanUp(this.container);return}this.customer?.email||(e=!0);let t=this,n=T(this,`[mcIdLookup.promiseResolvedHandler]`,n=>{t.log(`[mcIdLookup.promiseResolvedHandler]`,n),n.consumerPresent?t.mcInitiateValidation():!n.consumerPresent&&!e&&t.customer?.phoneNumber?t.mcIdLookup(!0):t.stopLoadingCardForm()}),r=T(this,`[mcIdLookup.promiseRejectedHandler]`,e=>{t.log(`[mcIdLookup.promiseRejectedHandler]`,e),t.stopLoadingCardForm(),t.sendErrorNotification(`mcIdLookup error`,[a,e]),t.stopUsing()}),i=hl(this.customer?.phoneNumber||``),a=e?{mobileNumber:{phoneNumber:i[1]||``,countryCode:i[0]||`61`}}:{email:this.customer?.email};this.log(`[mcIdLookup]`,a),window.mcCheckoutService.idLookup(a).then(n).catch(r)}mcInitiateValidation(e){this.log(`[mcInitiateValidation]`,e);let t=this;this.requestedValidationChannelId=e||``;let n=T(this,`[mcInitiateValidation.promiseResolvedHandler]`,e=>{t.log(`[mcInitiateValidation.promiseResolvedHandler]`,e),t.supportedValidationChannels=e.supportedValidationChannels,t.validationChannelsNetwork=e.network,e.maskedValidationChannel&&(!t.supportedValidationChannels||t.supportedValidationChannels.length===0)&&(t.supportedValidationChannels=[],(e.maskedValidationChannel.split(`,`)||[]).forEach(e=>{t.supportedValidationChannels.push({maskedValidationChannel:e,identityType:e.includes(`@`)?`EMAIL`:`SMS`,validationChannelId:e.includes(`@`)?`EMAIL`:`SMS`})})),t.mcShowOtpInput(t.supportedValidationChannels,e.network)}),r=T(this,`[mcInitiateValidation.promiseRejectedHandler]`,n=>{t.log(`[mcInitiateValidation.promiseRejectedHandler]`,n),t.stopUsing(),t.sendErrorNotification(`mcInitiateValidation error`,[{requestedValidationChannelId:e},n])});this.log(`[mcInitiateValidation]`,e?{requestedValidationChannelId:e}:null),window.mcCheckoutService.initiateValidation(e?{requestedValidationChannelId:e}:void 0).then(n).catch(r)}mcValidate(e){try{let t=this,n=T(this,`[mcValidate.promiseResolvedHandler]`,e=>{t.log(`[mcValidate.promiseResolvedHandler]`,e),e.cards?(t.setCards(e.cards),t.stopLoadingCardForm()):t.mcGetCards(),t.saveRecognitionToken(e.recognitionToken)}),r=T(this,`[mcValidate.promiseRejectedHandler]`,e=>{t.log(`[mcValidate.promiseRejectedHandler]`,e),t.sendErrorNotification(`mcValidate error`,[{recognitionTokenRequested:i.recognitionTokenRequested},e]),t.attempts++,t.attempts>2||!e?.reason||e.reason==`REQUEST_TIMEOUT`?(t.stopLoadingCardForm(),t.showMessage(`Too many attempts to access your click to pay profile. Please check out as a guest.`)):e.reason===`CODE_INVALID`||e.reason===`RETRIES_EXCEEDED`||e.reason===`ACCT_INACCESSIBLE`||e.reason===`CODE_EXPIRED`?t.mcShowOtpInput(t.supportedValidationChannels,t.validationChannelsNetwork,e.reason):(t.stopUsing(),t.showInfoMessage(up))}),i={value:e,recognitionTokenRequested:this.getRememberMe()};this.log(`[mcValidate]`,{recognitionTokenRequested:i.recognitionTokenRequested}),this.startLoadingCardForm(),window.mcCheckoutService.completeValidation(i).then(n).catch(r)}catch(e){throw this.sendErrorNotification(`mcValidate exception`,[e]),console.warn(`[mcValidate], exception`,{error:e}),e}}runClickToPay(){let e=this,t=T(this,`[runClickToPay.promiseResolvedHandler]`,t=>{e.log(`[runClickToPay.promiseResolvedHandler]`,t),!t||!t.length?e.mcIdLookup():(e.setCards(t),e.stopLoadingCardForm())}),n=T(this,`[runClickToPay.promiseRejectedHandler]`,t=>{e.log(`[runClickToPay.promiseRejectedHandler]`,t),e.stopUsing(),e.stopLoadingCardForm(),e.sendErrorNotification(`mcCheckoutService.getCards error`,[t])});this.log(`[runClickToPay]`),window.mcCheckoutService.getCards().then(t).catch(n)}mcGetCards(){let e=this,t=T(this,`[getCards.promiseResolvedHandler]`,t=>{e.log(`[getCards.promiseResolvedHandler]`,t),e.setCards(t),e.stopLoadingCardForm()}),n=T(this,`[getCards.promiseRejectedHandler]`,t=>{e.log(`[getCards.promiseRejectedHandler]`,t),e.stopLoadingCardForm(),e.stopUsing(),e.sendErrorNotification(`getCards error`,[t])});this.log(`[getCards]`),window.mcCheckoutService.getCards().then(t).catch(n)}mcEncryptCard(e,t,n,r,i){let a=this,o=T(this,`[encryptCard.promiseResolvedHandler]`,e=>{a.log(`[encryptCard.promiseResolvedHandler]`,e),r(e.encryptedCard,e.cardBrand)}),s=T(this,`[encryptCard.promiseResolvedHandler]`,e=>{a.log(`[encryptCard.promiseResolvedHandler]`,e),i(e),a.sendErrorNotification(`encryptCard error`,[l,e])}),c=t.split(`/`),l={primaryAccountNumber:e,panExpirationMonth:c[0],panExpirationYear:c[1],cardSecurityCode:n};window.mcCheckoutService.encryptCard(l).then(o).catch(s)}resolveReadyCallbacks(){this.readyCallbacks.splice(0).forEach(e=>e())}stopUsing(){this.log(`[ClickToPayProcessor]: stop using Click To Pay`),this.enabled=!1,this.cleanUp(this.container);let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:Ql},`*`),e.contentWindow?.postMessage({status:ql},`*`)}catch(e){this.log(`[stopUsing] iframe error`,e)}}updateAvailableCardBrands(e){this.log(`[ClickToPayProcessor]: updateAvailableCardBrands`,e),this.availableCardBrands=e;let t=this.getCardFormFrame();if(t)try{t.contentWindow?.postMessage({status:$l,availableCardBrands:e},`*`)}catch(e){this.log(`[updateAvailableCardBrands] iframe error`,e)}}isEnabled(){return!!this.enabled}getLibUrl(e){return dp[this.environment===C.PRODUCTION?`PRODUCTION`:`SANDBOX`][e]||``}saveRecognitionToken(e){let t=new Date;t.setTime(t.getTime()+15552e6);let n=`expires=`+t.toUTCString();document.cookie=`recognitionToken=${e};${n};path=/`}getRecognitionToken(){let e=`; ${document.cookie}`.split(`; recognitionToken=`);return e.length===2&&e.pop().split(`;`).shift()||``}sendErrorNotification(e,t){ke(`[ClickToPayProcessor]`,e,t)}generateDpaTransactionOptions(){let e={dpaLocale:this.options.locale||`en_AU`,dpaBillingPreference:zf.NONE,dpaAcceptedBillingCountries:[],dpaAcceptedShippingCountries:[],dpaShippingPreference:`NONE`,threeDsPreference:`NONE`,confirmPayment:!1,transactionAmount:{transactionAmount:Number(this.amount),transactionCurrencyCode:this.currency}};return!this.tokenAuthenticationEnabled&&this.options.useFpan&&(e.paymentOptions=[{dynamicDataType:`NONE`}]),this.options.confirmPayment!==void 0&&(e.confirmPayment=!!this.options.confirmPayment),this.tokenAuthenticationEnabled&&(e.dpaBillingPreference=zf.NONE,e.merchantCountryCode=`AU`,e.authenticationPreferences={payloadRequested:`AUTHENTICATED`},e.paymentOptions=[{dpaDynamicDataTtlMinutes:15,dynamicDataType:`CARD_APPLICATION_CRYPTOGRAM_SHORT_FORM`}],this.options.networkTokenOptions?.acquirerMerchantId&&(e.acquirerMerchantId=this.options.networkTokenOptions.acquirerMerchantId),this.options.networkTokenOptions?.acquirerBIN&&(e.acquirerBIN=this.options.networkTokenOptions.acquirerBIN),this.options.networkTokenOptions?.merchantCategoryCode&&(e.merchantCategoryCode=this.options.networkTokenOptions.merchantCategoryCode)),e}generateConsumerInfo(){let e={};if(this.customer?.email&&(e.emailAddress=this.customer.email),this.customer?.phoneNumber){let t=hl(this.customer?.phoneNumber||``);e.mobileNumber={phoneNumber:t[1]||``,countryCode:t[0]||`61`}}return e}};d([w],Q.prototype,`setContainer`,null),d([w],Q.prototype,`setCustomerInfo`,null),d([w],Q.prototype,`setCards`,null),d([w],Q.prototype,`isSchemeSupported`,null),d([w],Q.prototype,`messageHandler`,null),d([w],Q.prototype,`init`,null),d([w],Q.prototype,`cleanUp`,null),d([w],Q.prototype,`start`,null),d([w],Q.prototype,`initCheckoutServiceLib`,null),d([w],Q.prototype,`initScripts`,null),d([w],Q.prototype,`initCss`,null),d([w],Q.prototype,`createOtpInput`,null),d([w],Q.prototype,`attachOtpInput`,null),d([w],Q.prototype,`createLearnMore`,null),d([w],Q.prototype,`createModalForm`,null),d([w],Q.prototype,`showModalForm`,null),d([w],Q.prototype,`hideModalForm`,null),d([w],Q.prototype,`mcHideOtpInput`,null),d([w],Q.prototype,`mcShowOtpInput`,null),d([w],Q.prototype,`adjustRememberMeOnOtpInput`,null),d([w],Q.prototype,`mcHideLearnMore`,null),d([w],Q.prototype,`mcShowLearnMore`,null),d([w],Q.prototype,`showChangeUserPopup`,null),d([w],Q.prototype,`showLoginForm`,null),d([w],Q.prototype,`checkoutWithCard`,null),d([w],Q.prototype,`checkoutWithNewCard`,null),d([w],Q.prototype,`checkoutWithEncryptedNewCard`,null),d([w],Q.prototype,`encryptCard`,null),d([w],Q.prototype,`mcLogout`,null),d([w],Q.prototype,`mcInitClickToPay`,null),d([w],Q.prototype,`mcIdLookup`,null),d([w],Q.prototype,`mcInitiateValidation`,null),d([w],Q.prototype,`runClickToPay`,null),d([w],Q.prototype,`mcGetCards`,null),d([w],Q.prototype,`mcEncryptCard`,null),d([w],Q.prototype,`stopUsing`,null),d([w],Q.prototype,`updateAvailableCardBrands`,null),d([w],Q.prototype,`getLibUrl`,null),d([w],Q.prototype,`saveRecognitionToken`,null),d([w],Q.prototype,`getRecognitionToken`,null),d([w],Q.prototype,`sendErrorNotification`,null),d([w],Q.prototype,`generateDpaTransactionOptions`,null),d([w],Q.prototype,`generateConsumerInfo`,null);var fp;(function(e){e.CARD=`CARD`,e.PAYPAL=`PAYPAL`,e.PAYTO=`PAYTO`,e.PAYID=`PAYID`,e.OPTTY=`OPTTY`,e.GOOGLEPAY=`GOOGLEPAY`,e.APPLEPAY=`APPLEPAY`,e.VIS=`VIS`,e.SHIFT=`SHIFT`,e.PESAPAL=`PESAPAL`,e.PAYBYACCOUNT=`PAYBYACCOUNT`,e.CLICK2PAY=`CLICK2PAY`,e.UPI=`UPI`,e.PAYGLOCAL=`PAYGLOCAL`,e.BANKPAYMENT=`BANKPAYMENT`,e.PAYMENT_METHOD=`PAYMENT_METHOD`})(fp||={}),W(),vl();var pp={key:0,class:`payment-method-info`},mp=[`src`,`alt`],hp={class:`payment-method-details`},gp={class:`payment-method-details-name`},_p={key:0},vp={key:1},yp={key:2},bp=L({__name:`PaymentMethod`,props:{log:{type:Function},cssUrl:{},paymentMethod:{}},setup(e){let t=e,n=P(t.paymentMethod);Mr(()=>t.paymentMethod,()=>{n.value=t.paymentMethod},{flush:`post`});function r(){switch(n.value.type){case`CARD`:return``;case`PAYPAL`:return n.value.email||`PayPal`;case`PAYTO`:return``;case`PAYID`:return`PayID`;case`OPTTY`:return`Optty`;case`GOOGLEPAY`:return`Google Pay`;case`APPLEPAY`:return`Apple Pay`;case`VIS`:return`Visa Installments`;case`SHIFT`:return`Shift`;case`PESAPAL`:return`Pesapal`;case`PAYBYACCOUNT`:return`Pay By Account`;case`CLICK2PAY`:return`Click To Pay`;case`UPI`:return`UPI`;case`PAYGLOCAL`:return`PayGlocal`;case`BANKPAYMENT`:return``;case`PAYMENT_METHOD`:return`Payment Method`;default:return`Unknown`}}function i(){switch(n.value.type){case`CARD`:return n.value.card?.scheme?`${t.cssUrl}icons/${pl(String(n.value.card?.scheme).toLowerCase())}.svg`:`${t.cssUrl}icons/Card.svg`;case`PAYPAL`:return`${t.cssUrl}icons/PayPal.svg`;case`PAYTO`:return`${t.cssUrl}icons/PayTo.svg`;case`PAYID`:return`${t.cssUrl}icons/PayID.svg`;case`GOOGLEPAY`:return`${t.cssUrl}icons/GooglePay.svg`;case`APPLEPAY`:return`${t.cssUrl}icons/ApplePay.svg`;case`VIS`:return`${t.cssUrl}icons/Visa.svg`;case`SHIFT`:return`${t.cssUrl}icons/Shift.svg`;case`PESAPAL`:return`${t.cssUrl}icons/Pesapal.svg`;case`PAYBYACCOUNT`:return`${t.cssUrl}icons/PayByAccount.svg`;case`CLICK2PAY`:return`${t.cssUrl}icons/ClickToPay.svg`;case`UPI`:return`${t.cssUrl}icons/UPI.svg`;case`PAYGLOCAL`:return`${t.cssUrl}icons/PayGLocal.svg`;case`BANKPAYMENT`:return`${t.cssUrl}icons/BankPayment.svg`;case`PAYMENT_METHOD`:return`${t.cssUrl}icons/Card.svg`;default:return`Unknown`}}return Mr(()=>t.paymentMethod,()=>{n.value=t.paymentMethod},{flush:`post`}),(e,t)=>n.value?(R(),z(`div`,pp,[B(`img`,{src:i(),alt:r()},null,8,mp),B(`div`,hp,[B(`div`,gp,M(r()),1),n.value.type===F(fp).CARD?(R(),z(`div`,_p,[ta(` Card: `+M(n.value.card?.cardNumber||`Unknown`),1),t[0]||=B(`br`,null,null,-1),ta(` Expire: `+M(n.value.card?.expiryDate||`Unknown`),1)])):V(``,!0),n.value.type===F(fp).BANKPAYMENT?(R(),z(`div`,vp,[ta(` Name: `+M(n.value.bankPayment?.accountName),1),t[1]||=B(`br`,null,null,-1),ta(` Acc No: `+M(n.value.bankPayment?.accountNumber),1)])):V(``,!0),n.value.type===F(fp).PAYTO?(R(),z(`div`,yp,[ta(` Name: `+M(n.value.payTo?.payerName),1),t[3]||=B(`br`,null,null,-1),n.value.payTo?.payerPayIdDetails?(R(),z(H,{key:0},[ta(M(n.value.payTo?.payerPayIdDetails?.payIdType)+`: `+M(n.value.payTo?.payerPayIdDetails?.payId),1)],64)):V(``,!0),n.value.payTo?.payerDirectDebitDetails?(R(),z(H,{key:1},[ta(` BSB: `+M(n.value.payTo?.payerDirectDebitDetails?.bsb),1),t[2]||=B(`br`,null,null,-1),ta(` Acc No: `+M(n.value.payTo?.payerDirectDebitDetails?.accountNumber),1)],64)):V(``,!0)])):V(``,!0)])])):V(``,!0)}});K();var xp=G(bp,[[`__scopeId`,`data-v-7894e1cd`]]);W(),au();var Sp={key:0,class:`saved-payment-methods`},Cp={key:0,class:`error`},wp=[`onClick`],Tp=[`id`,`checked`],Ep={key:0,class:`error`},Dp={key:1,class:`payment-method-container`},Op={key:1,class:`saved-payment-methods`},kp=L({__name:`PaymentMethodsForm`,props:{log:{type:Function},cssUrl:{},paymentMethods:{},clickGate:{type:Function}},emits:[`submit`,`select`],setup(e,{emit:t}){let n=e,r=t,i=P(!0),a=P(null),o=P(n.paymentMethods),s=P(!1),c=P({}),l=Uo(()=>s.value?o.value:a.value?[a.value]:[o.value[0]]);function u(e){if(e?.data?.status){if(e.data.status===`submit-card-form`){if(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),!i.value||(e.stopPropagation(),c.value={},n.clickGate()?.()===!1))return;r(`submit`,a.value)}e.data.status===`activate`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),i.value=!0),e.data.status===`deactivate`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),i.value=!1),e.data.status===`message`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),c.value=e.data.message),e.data.status===`error`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),c.value[e.data.paymentMethodId||`global`]=e.data.error)}}Mr(()=>n.paymentMethods,()=>{o.value=n.paymentMethods,f()},{flush:`post`});function d(e){n.log?.(`[PaymentMethods]: selected payment method`,e),c.value={},a.value=e,r(`select`,e?{...e}:null)}function f(){o.value.length>0?(d(o.value.find(e=>e.isDefault)||o.value[0]),window.postMessage({status:nu,message:{status:`success`,message:``}},`*`)):window.postMessage({status:nu,message:{status:`error`,message:`No saved payment methods found`}},`*`)}return Ba(()=>{window.addEventListener(`message`,u),window.postMessage({status:Dl},`*`),f()}),Wa(()=>{window.removeEventListener(`message`,u)}),(e,t)=>o.value.length>0?(R(),z(`div`,Sp,[c.value.global?(R(),z(`div`,Cp,M(c.value.global),1)):V(``,!0),(R(!0),z(H,null,$r(l.value,(e,t)=>(R(),z(`div`,{key:`paymentMethod${t}`,class:Pe([`payment-method-container`,`${a.value?.paymentMethodId===e?.paymentMethodId?`selected`:``} ${c.value[`${e?.paymentMethodId}`]?`error`:``}`]),onClick:t=>d(e)},[B(`input`,{type:`radio`,name:`paymentMethod`,id:`payment-method-${e?.paymentMethodId}`,checked:a.value?.paymentMethodId===e?.paymentMethodId},null,8,Tp),U(xp,{log:n.log,"css-url":n.cssUrl,"payment-method":e},null,8,[`log`,`css-url`,`payment-method`]),c.value[`${e?.paymentMethodId}`]?(R(),z(`div`,Ep,M(c.value[`${e?.paymentMethodId}`]),1)):V(``,!0)],10,wp))),128)),o.value.length>1?(R(),z(`div`,Dp,[t[2]||=B(`div`,{style:{width:`20px`}},null,-1),B(`div`,null,[s.value?(R(),z(`a`,{key:0,href:`#`,class:`black`,onClick:t[0]||=e=>s.value=!1},`Show less`)):(R(),z(`a`,{key:1,href:`#`,class:`black`,onClick:t[1]||=e=>s.value=!0},`Show all`))])])):V(``,!0)])):(R(),z(`div`,Op,[...t[3]||=[B(`div`,{class:`title`},`No saved payment methods found`,-1)]]))}});K();var Ap=G(kp,[[`__scopeId`,`data-v-d3f0944f`]]);fl(),vl(),_e(),au();var jp=class{log;debug=!1;container=null;httpInvoker=null;destroy=()=>{};apiUrl=``;environment=``;publicKey=``;version=``;failureCallback=null;successCallback=null;userOnValidate;amount=0;currency=``;billingAddress=null;customer=null;order=null;paymentInfo=null;geolocation=null;userSuccessMessage=ru;constructor(e,t){this.log=e,this.debug=t.debug,this.environment=t.environment,this.apiUrl=t.apiUrl,this.publicKey=t.publicKey,this.version=t.version,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new dl(t.environment,ml(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setAmount(e){this.amount=e}getAmount(){return this.amount}setCurrency(e){this.currency=e}getCurrency(){return this.currency}setCustomerInfo(e){this.customer=e?{...e}:null}getCustomerInfo(){return this.customer}setBillingAddress(e){this.billingAddress=e?{...e}:null}getBillingAddress(){return this.billingAddress}setOrderInfo(e){this.order=e?{...e}:null}getOrderInfo(){return this.order}setPaymentInfo(e){if(!e){this.paymentInfo=null;return}let t=e.expiryDate.split(`/`);this.paymentInfo={cardNumber:e.cardNumber,expiryDate:(t[1]||``)+(t[0]||``),cardholder:e.cardholder,ccv:e.ccv}}getPaymentInfo(){return this.paymentInfo}setGeolocation(e){this.geolocation=e?{...e}:null}getGeolocation(){return this.geolocation}cleanUp(e){e?.id===this.container?.id&&this.destroy?.()}setSuccessMessage(e){this.userSuccessMessage=e}getSuccessMessage(){return this.userSuccessMessage}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}createBaseApiRequest(){return{firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email,phone:this.customer?.phoneNumber,order:this.order&&{orderNumber:this.order.orderNumber,freightAmount:this.order.shippingAmount,dutyAmount:this.order.taxAmount,items:this.order.orderItems&&this.order.orderItems.map(e=>({productCode:e.sku,description:e.name,quantity:e.quantity,amount:e.unitPrice}))}||void 0,billingAddress:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,geolocation:this.geolocation||void 0}}};d([w],jp.prototype,`setPaymentInfo`,null),d([w],jp.prototype,`cleanUp`,null),_c(),tl(),$s(),du(),au();var{hideSpinner:Mp,showSpinner:Np}=lu(),Pp={CUSTOMER_INFO:`CUSTOMER_INFO`,PAYMENT_METHODS_INFO:`PAYMENT_METHODS_INFO`,TOKENISE:`TOKENISE`},Fp=(e,t)=>({[Pp.CUSTOMER_INFO]:{url:e+`/customer/`+t,method:`GET`},[Pp.PAYMENT_METHODS_INFO]:{url:e+`/customer/`+t+`/payment_method`,method:`GET`},[Pp.TOKENISE]:{url:e+`/token/payment_method`,method:`POST`}}),Ip=class extends jp{cssUrl=``;networkTokenProviders=[];validationStatusChangeCallback=null;fraudProcessor=null;fraudManageOrder=null;constructor(e,t){super(e,t),this.cssUrl=t.cssUrl,this.validationStatusChangeCallback=t.onValidationStatusChangeCallback||null,window.addEventListener(`message`,this.messageHandler.bind(this))}addFraudProcessor(e,t){this.fraudProcessor=e,this.fraudManageOrder=t}addPaymentMethods(e,t,n,r,i){if(this.log(`[addPaymentMethods]`,{amount:n,currency:r,customerId:t,options:i}),this.container=e,this.networkTokenProviders=i?.networkTokenProviders||[],this.networkTokenProviders=i?.networkTokenProviders||[],!uc(n))throw q(e,`Invalid amount: `+n),TypeError(`invalid amount: `+n);this.getCustomerData(t,a=>{this.log(`[addPaymentMethods], customerInfo`,a),this.getPaymentMethodsInfo(t,t=>{this.log(`[addPaymentMethods], paymentMethods`,t);let o=Qs({el:this.container,component:Ap,props:{el:e,log:this.log,cssUrl:this.cssUrl,clickGate:this.getOnValidate.bind(this),paymentMethods:t.filter(e=>!i?.tokenAuthenticationEnabled||i?.tokenAuthenticationEnabled&&e.networkToken?.schemeTokenId).map(e=>({paymentMethodId:e.paymentMethodId,customerId:e.customerId,type:e.type,card:e.card&&{cardNumber:e.card.cardNumber,cardholder:e.card.cardholder,expiryDate:e.card.expiryDate,scheme:e.card.type,cardType:e.card.cardType,bin:e.card.cardIin},bankPayment:e.bankPayment&&{bankCode:e.bankPayment.bankCode,accountNumber:e.bankPayment.accountNumber,accountName:e.bankPayment.accountName},payTo:e.payTo&&{payToId:e.payTo.payToId,status:e.payTo.status,payerName:e.payTo.payerName,payerPayIdDetails:e.payTo.payerPayIdDetails,payerDirectDebitDetails:e.payTo.payerDirectDebitDetails,providerId:e.payTo.providerId,providerType:e.payTo.providerType},providerId:e.providerId,providerType:e.providerType,dateAdded:e.dateAdded,dateRemoved:e.dateRemoved,isDefault:e.paymentMethodId===a.defaultPaymentMethod.paymentMethodId,email:e.email,networkTokenId:e.networkTokenId,networkToken:e.networkToken}))},on:{submit:T(this,`[PaymentMethods]: submit`,t=>{this.log(`[PaymentMethods]: submit`,t),t?.paymentMethodId&&(Np(),setTimeout(()=>{this.onSubmit(e,n,r,i,t)},500))})}});this.destroy=o.destroy},e=>{this.failureCallback?.({error:e.message}),this.sendError(``,e.message)})},e=>{this.failureCallback?.({error:e.message}),this.sendError(``,e.message)})}tokenise(e,t,n,r,i,a){this.log(`[PaymentMethodProcessor][tokenise]`,{paymentMethodId:t,amount:n,currency:r,fraud:i,authenticationData:a});let o=T(this,`[PaymentMethodProcessor][tokenise], success`,(t,n)=>{this.log(`[PaymentMethodProcessor][tokenise], success`,t,n),Mp();let r=JSON.parse(n),i={token:r.tokenId};r.card&&(i.cardDetails={bin:r.card.cardIin,last4:(r.card.cardNumber||``).slice(-4),expiryDate:r.card.expiryDate,cardholder:r.card.cardholder,cardType:r.card.cardType,scheme:r.card.type}),r.card?.iinData&&(i.iinData={scheme:r.card.iinData.scheme||``,country:r.card.iinData.country||``,issuer:r.card.iinData.issuer||``,countryCode:r.card.iinData.countryCode||``,cardType:r.card.iinData.cardType||``}),this.successCallback?.(i),el(e,this.getSuccessMessage())}),s=T(this,`[PaymentMethodProcessor][tokenise], failure`,(e,n)=>{this.log(`[PaymentMethodProcessor][tokenise], failure`,e,n),Mp();let r=JSON.parse(n);this.failureCallback?.({error:r.message}),this.sendError(t,r.message)}),c={paymentMethodId:t,amount:n,currency:r,authenticationData:a&&{VerificationType:a.verificationType,VerificationEntity:a.verificationEntity,VerificationMethod:a.verificationMethod,VerificationResults:a.verificationResults,VerificationTimestamp:a.verificationTimestamp,AdditionalData:a.additionalData,VerificationEvents:JSON.stringify(a.verificationEvents)},fraudCheck:i.fraudCheckResult,threeDSServerTransID:i.threeDSServerTransID,...this.createBaseApiRequest()};this.httpInvoker?.invoke(Fp(this.apiUrl)[Pp.TOKENISE].url,Fp(this.apiUrl)[Pp.TOKENISE].method,JSON.stringify(c),o,s)}getCustomerData(e,t,n){let r=T(this,`[getCustomerData], success`,(e,n)=>{this.log(`[getCustomerData], success`,e,n),t(JSON.parse(n))}),i=T(this,`[getCustomerData], failure`,(e,t)=>{this.log(`[getCustomerData], failure`,e,t),n(JSON.parse(t))});this.httpInvoker?.invoke(Fp(this.apiUrl,e)[Pp.CUSTOMER_INFO].url,Fp(this.apiUrl,e)[Pp.CUSTOMER_INFO].method,{},r,i)}getPaymentMethodsInfo(e,t,n){let r=T(this,`[getPaymentMethodsInfo], success`,(e,n)=>{this.log(`[getPaymentMethodsInfo], success`,e,n),t(JSON.parse(n))}),i=T(this,`[getPaymentMethodsInfo], failure`,(e,t)=>{this.log(`[getPaymentMethodsInfo], failure`,e,t),n(JSON.parse(t))});this.httpInvoker?.invoke(Fp(this.apiUrl,e)[Pp.PAYMENT_METHODS_INFO].url,Fp(this.apiUrl,e)[Pp.PAYMENT_METHODS_INFO].method,{},r,i)}onSubmit(e,t,n,r,i){if(!i?.paymentMethodId){this.failureCallback?.({error:`Invalid payment method`});return}let a=i.paymentMethodId;this.fraudProcessor?.setPaymentReference({paymentMethodId:a}),Vd(this.fraudProcessor,this.fraudManageOrder,e,{onShow:Mp,log:this.log}).then(T(this,`[PaymentMethodProcessor][fraudGate]`,o=>{`error`in o?(Mp(),q(e,o.error),this.failureCallback?.({error:o.error}),this.sendError(a,o.error)):this.onFraudGatePassed(e,t,n,o,r,i)}))}onFraudGatePassed(e,t,n,r,i,a){if(!i?.tokenAuthenticationEnabled||!a.networkToken?.schemeTokenId)this.tokenise(e,a.paymentMethodId,t,n,r);else if(i?.tokenAuthenticationEnabled&&a.networkToken?.schemeTokenId){let o={expiryDate:a.card?.expiryDate||``,cardholder:a.card?.cardholder||``,cardType:a.card?.cardType||``,scheme:a.card?.scheme||``},s=this.initTokenAuthenticationProcessor(``,a.networkToken?.schemeTokenId,a.networkToken?.schemeTokenData,a.networkToken?.authenticationMethod?.uriData.uri||``,o,i?.networkTokenOptions||{});if(!s){this.tokenise(e,a.paymentMethodId,t,n,r);return}s.invoke(this.amount,this.currency,T(this,`[sdk][paymentMethodProcessor], token authentication success`,i=>{this.log(`[sdk][paymentMethodProcessor], token authentication success`),this.tokenise(e,a.paymentMethodId,t,n,r,i.assuranceData?.verificationData?.[0])}),T(this,`[sdk][paymentMethodProcessor], token authentication error`,e=>{Mp(),this.log(`[sdk][paymentMethodProcessor], token authentication error`,e),this.failureCallback?.({error:`Token Authentication Error`})}))}}sendError(e,t){window.postMessage({status:`error`,component:`payment-methods`,paymentMethodId:e,error:t},`*`)}initTokenAuthenticationProcessor(e,t,n,r,i,a){this.log(`[initTokenAuthenticationProcessor]`,{token:e,networkTokenAuthenticateUrl:r,networkTokenOptions:a});let o=(i?.scheme||``).toLowerCase(),s=this.networkTokenProviders.find(e=>e.providerType.toLowerCase()===o);switch(String(s?.providerType).toLowerCase()){case`mastercard`:return new zu(this.log.bind(this),{container:this.container,token:e,networkToken:t,networkTokenData:n,redirectUrl:r,networkTokenProvider:s,environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,networkTokenOptions:a});default:return this.log(`Unsupported network token provider`,o),null}}messageHandler(e){e?.data?.status&&e.data.status===`card-form-validation-status-change`&&(this.log(`[sdk][paymentMethodProcessor]: message "${e.data.status}" received`,e.data),Mp(),this.validationStatusChangeCallback?.(e.data.message?.status,e.data.message?.message))}};d([w],Ip.prototype,`addPaymentMethods`,null),d([w],Ip.prototype,`tokenise`,null),d([w],Ip.prototype,`getCustomerData`,null),d([w],Ip.prototype,`getPaymentMethodsInfo`,null),d([w],Ip.prototype,`onSubmit`,null),d([w],Ip.prototype,`onFraudGatePassed`,null),d([w],Ip.prototype,`sendError`,null),d([w],Ip.prototype,`initTokenAuthenticationProcessor`,null),d([w],Ip.prototype,`messageHandler`,null);var Lp;(function(e){e.card=`card`,e.paypal=`paypal`,e.applepay=`applepay`,e.googlepay=`googlepay`,e.upi=`upi`,e.payto=`payto`,e.payid=`payid`,e.shift=`shift`,e.pesapal=`pesapal`,e.paybyaccount=`paybyaccount`,e.payglocal=`payglocal`,e.zip=`zip`,e.dlocal=`dlocal`})(Lp||={});function Rp(e){switch(e){case Z.AZUPAY:return Lp.payid;case Z.SHIFT:return Lp.shift;case Z.PESAPAL:return Lp.pesapal;case Z.PAYBYACCOUNT:return Lp.paybyaccount;case Z.PAYGLOCAL:case Z.ZIP:return Lp.zip}}var zp,Bp,Vp,Hp,Up,Wp,Gp=o((()=>{W(),pd(),_c(),zp={class:`mask`},Bp={class:`wrapper`},Vp={class:`container`},Hp=[`action`],Up=[`value`],Wp=L({__name:`ThreeDsChallenge`,props:{threeDSServerTransID:{},acsTransID:{},formAction:{}},emits:[`close`,`submit`],setup(e,{emit:t}){let n=e,r=t,i=Uo(()=>hc(n.formAction)?n.formAction:``),a=P(null),o=JSON.stringify({threeDSServerTransID:n.threeDSServerTransID,acsTransID:n.acsTransID,messageVersion:`2.2.0`,messageType:`CReq`,challengeWindowSize:`01`}),s=encodeURI(window.btoa(o).replace(/=*$/,``));return Ba(()=>{i.value&&a.value?.submit()}),(e,t)=>(R(),z(`div`,zp,[B(`div`,Bp,[B(`div`,Vp,[U(fd,{onClick:t[0]||=e=>r(`close`),id:`3ds-challenge-close`}),t[1]||=B(`iframe`,{name:`ThreeDsChallengeIFrame`},null,-1),B(`form`,{action:i.value,target:`ThreeDsChallengeIFrame`,method:`post`,ref_key:`form`,ref:a},[B(`input`,{type:`hidden`,name:`creq`,value:F(s)},null,8,Up)],8,Hp)])])]))}})})),Kp=o((()=>{})),qp=o((()=>{})),Jp,Yp=o((()=>{Gp(),Gp(),Kp(),qp(),K(),Jp=G(Wp,[[`__scopeId`,`data-v-07081e85`]])})),Xp,Zp=o((()=>{Xp=class{iframeId=`threeDsIframeMethod`;containerId=`payfurlContainerFormInvoker`;iframe=null;container=null;createIFrame(){this.iframe||(this.container=document.createElement(`div`),this.container.id=this.containerId,document.body.appendChild(this.container),this.iframe=document.createElement(`iframe`),this.iframe.name=this.iframeId,this.iframe.style.display=`none`,this.container.appendChild(this.iframe))}invoke(e,t,n,r,i){this.createIFrame();let a=document.createElement(`form`);a.action=e,a.target=this.iframeId,a.method=`post`,this.container?.appendChild(a);for(let e in n){let t=document.createElement(`input`);t.type=`hidden`,t.name=e,t.value=n[e],a.appendChild(t)}a.submit()}}})),Qp,$p,em,tm=o((()=>{au(),$s(),Yp(),Zp(),du(),{hideSpinner:Qp,showSpinner:$p}=lu(),em=class{log;container;options;threeDsProcessor=null;threeDSDestroy=()=>{};threeDSServerTransID=``;threeDSAuthURL=``;threeDSRequestorTransID=``;threeDSMonitorURL=``;internalMessageHandler=this.messageHandler.bind(this);constructor(e,t,n){this.log=e,this.container=t,this.options=n}getType(){return`Default`}getDomain(){return``}onPreAuth(){this.log(`[${this.getType()}][onPreAuth]`),this.threeDsProcessor&&($p(),this.threeDsProcessor.onPreAuth(this.onInitAuthSuccess,this.onError),window.addEventListener(`message`,this.internalMessageHandler))}onAuth(e,t){this.log(`[${this.getType()}][onAuth]`,{threeDSAuthURL:this.threeDSAuthURL,threeDSRequestorTransID:this.threeDSRequestorTransID,threeDSServerTransID:this.threeDSServerTransID,isMethodPerformed:e}),this.threeDsProcessor?.onAuth(this.threeDSAuthURL,this.threeDSRequestorTransID,this.threeDSServerTransID,e,t,this.onDoAuthSuccess,this.onError)}onPostAuth(){this.log(`[${this.getType()}][onPostAuth]`,{threeDSServerTransID:this.threeDSServerTransID}),this.threeDsProcessor?.onPostAuth({threeDSServerTransID:this.threeDSServerTransID},this.onSuccess,this.onError)}setThreeDsProcessor(e){this.log(`[${this.getType()}][setThreeDsProcessor]`),this.threeDsProcessor=e}messageHandler(e){e?.data?.status&&e?.data?.status!==`tokenise-card-failure`&&(e.data.status===`3ds_method_invocation_complete`?(e.stopPropagation(),this.invocationComplete(e)):e.data.status===`3ds_challenge_complete`&&(e.stopPropagation(),this.challengeComplete(e)))}invocationComplete(e){this.log(`[${this.getType()}]: 3Ds Method invocation complete`),this.onAuth(!0,``)}challengeComplete(e){this.log(`[${this.getType()}]: 3Ds Challenge complete`,e.data),this.closeChallenge();let t=JSON.parse(window.atob(e.data.cres));this.log(`[${this.getType()}]: cresData`,t),[`Y`,`A`].includes(t.transStatus)?this.onPostAuth():[`N`,`U`,`R`].includes(t.transStatus)&&(this.log(`[${this.getType()}]: Failed 3DS Challenge`,e.data),this.onError(400,`Failed 3DS Challenge`))}setChallengeFrameVisible(e){window.self!==window.top&&window.parent.postMessage({status:e?Ll:Rl},`*`)}doChallenge(e,t,n){this.log(`[${this.getType()}][doChallenge]`),Qp(),this.setChallengeFrameVisible(!0);let{destroy:r}=Qs({el:document.body,component:Jp,props:{threeDSServerTransID:this.threeDSServerTransID,acsTransID:t,formAction:e,authenticationValue:n},on:{close:()=>{r(),this.threeDSDestroy=()=>{},this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=r}closeChallenge(){this.threeDSDestroy?.(),this.setChallengeFrameVisible(!1),window.removeEventListener(`message`,this.internalMessageHandler)}onError=(e,t)=>{this.closeChallenge(),Qp(),e===404?this.threeDsProcessor?.onError({error:`This feature is only supported by ActiveServer v1.1.2+`}):this.threeDsProcessor?.onError({error:iu,body:t})};onSuccess=(e,t)=>{this.closeChallenge(),Qp();let n=JSON.parse(t);[`Y`,`A`].includes(n.transStatus)?this.threeDsProcessor?.onSuccess(n):(this.log(`[${this.getType()}]: ${iu}`,n),this.threeDsProcessor?.onError({error:iu}))};threeDsMethodInvoke(e,t){this.log(`[${this.getType()}][threeDsMethodInvoke]`,{threeDSServerTransID:e,threeDSMethodURL:t});let n={threeDSServerTransID:e,threeDSMethodNotificationURL:this.options.apiUrl+`/3ds/method_invocation`},r=encodeURI(window.btoa(JSON.stringify(n)).replace(/=*$/,``));new Xp().invoke(t,`POST`,{threeDSMethodData:r})}onInitAuthSuccess=(e,t)=>{let n=JSON.parse(t);this.log(`[${this.getType()}][onInitAuthSuccess]`,n),this.threeDSRequestorTransID=n.threeDSRequestorTransID,this.threeDSServerTransID=n.threeDSServerTransID,this.threeDSMonitorURL=n.threeDSMonitorURL,this.threeDSAuthURL=n.threeDSAuthURL,n.threeDSMethodURL?this.threeDsMethodInvoke(n.threeDSServerTransID,n.threeDSMethodURL):this.onAuth(!1,``)};onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);if(this.log(`[${this.getType()}][onDoAuthSuccess]`,n),!n.transStatus)this.onError(e,`No transStatus specified`);else switch(n.transStatus){case`C`:if(!n.acsURL){this.onError(e,`Invalid Challenge Url`);return}this.doChallenge(n.acsURL,n.acsTransID,n.authenticationValue);break;case`N`:this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`),this.onError(400,`3DS Verification failed, transaction denied`);break;case`U`:this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification`),this.onError(400,`Unable to perform 3DS verification`);break;case`R`:this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification, rejected at issuer`),this.onError(400,`Unable to perform 3DS verification, rejected at issuer`);break;default:this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`),this.threeDsProcessor?.onSuccess({threeDSServerTransID:n.threeDSServerTransID,threeDSRequestorTransID:``,acsRenderingType:n.acsRenderingType,acsTransID:n.acsTransID,authenticationType:n.authenticationType,authenticationValue:n.authenticationValue,challengeCancel:``,dsTransID:n.dsTransID,eci:n.eci,interactionCounter:``,messageCategory:``,messageExtension:n.messageExtension,messageType:n.messageType,messageVersion:n.messageVersion,transStatus:n.transStatus,transStatusReason:n.transStatusReason})}}}})),nm,rm,im,am,om=o((()=>{W(),pd(),nm={class:`mask`},rm={class:`wrapper`},im={class:`container`},am=L({__name:`MetricsGlobalThreeDsChallenge`,emits:[`close`,`submit`],setup(e,{emit:t}){let n=t,r=P(!1);function i(e){[`3DS_CHALLENGE_SHOW`,`3DS_CHALLENGE_CLOSE`].includes(e.data?.message)&&(r.value=e.data.message===`3DS_CHALLENGE_SHOW`)}return Ba(()=>{window.addEventListener(`message`,i)}),Wa(()=>{window.removeEventListener(`message`,i)}),(e,t)=>Or((R(),z(`div`,nm,[B(`div`,rm,[B(`div`,im,[U(fd,{onClick:t[0]||=e=>n(`close`),id:`3ds-challenge-close`}),t[1]||=B(`div`,{id:`ThreeDsChallengeIFrame`},null,-1)])])],512)),[[Ts,r.value]])}})})),sm=o((()=>{})),cm=o((()=>{})),lm,um=o((()=>{om(),om(),sm(),cm(),K(),lm=G(am,[[`__scopeId`,`data-v-8a0b6dcb`]])})),dm,fm,pm,mm,hm=o((()=>{tm(),$s(),um(),tl(),du(),ye(),{hideSpinner:dm,showSpinner:fm}=lu(),pm=5,mm=class extends em{gateway;threeDS;numAttempts=0;constructor(e,t,n){super(e,t,n),this.initScript(n.clientParameters?.PublicKey||``)}getType(){return`MetricsGlobal`}getDomain(){return`secure.metricsglobalgateway.com`}onPreAuth(){this.log(`[${this.getType()}]: onPreAuth`),!this.threeDS&&this.numAttempts>=pm?(dm(),q(this.container,`Error loading 3D Secure`)):!this.threeDS&&this.numAttempts<pm?(this.numAttempts++,this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`),setTimeout(()=>this.onPreAuth(),1e3)):this.threeDsProcessor?.getTokenId()?this.threeDsProcessor.getGatewayData(this.threeDsProcessor.getProviderId(),this.threeDsProcessor.getTokenId(),e=>this.startAuth(e),()=>this.threeDsProcessor?.onError({error:`Unable to get card information`})):this.startAuth()}onAuth(e,t){}onPostAuth(){}startAuth(e){this.log(`[${this.getType()}]: startAuth`);let t=this.threeDsProcessor?.getPaymentInfo();if(!t){dm(),q(this.container,`Payment information is missing`);return}fm();let n=this.threeDsProcessor?.getAddressInfo(),r=t.expiryDate.length===4?t.expiryDate.slice(2,4):``,i=t.expiryDate.length===4?t.expiryDate.slice(0,2):``,[a=``,o=``]=t.cardholder?.split(/\s+/)||[],s=this.threeDsProcessor?.getCurrency()||``,c=this.threeDsProcessor?.getAmount()||0;if(!e&&(!r||!i)){dm(),q(this.container,`Card expiry date is invalid`),this.threeDsProcessor?.onError({error:`Card expiry date is invalid`});return}let l=e?.gatewayMetadata?.billing_id,u={...e?{customerVaultId:e.gatewayTokenId,...l?{billingId:l}:{}}:{cardNumber:t.cardNumber,cardExpMonth:r,cardExpYear:String(parseInt(i,10)+2e3)},currency:s,amount:c.toFixed(2),email:this.threeDsProcessor?.getEmail(),phone:n?.phoneNumber,city:n?.city,state:n?.state,address1:n?.streetAddress,country:n?.country,firstName:n?.firstName||a||`payFURL`,lastName:n?.lastName||o||`payFURL`,postalCode:n?.postalCode,deviceChannel:`02`,browserJavascriptEnabled:!0,browserJavaEnabled:!1,browserLanguage:window.navigator.language,browserColorDepth:String(ve()),browserScreenHeight:String(screen.height),browserScreenWidth:String(screen.width),browserTimeZone:String(Math.round(new Date().getTimezoneOffset()/60)),userAgent:navigator.userAgent},d=this.threeDS.createUI(u);d.start(`#ThreeDsChallengeIFrame`),d.on(`challenge`,e=>{this.log(`[${this.getType()}][onChallenge]`,e),dm(),this.showChallenge()}),d.on(`complete`,e=>{this.log(`[${this.getType()}][onComplete]`,e),this.removeChallenge(),this.threeDsProcessor?.onSuccess({externalThreeDsData:e})}),d.on(`failure`,e=>{this.log(`[${this.getType()}][onFailure]`,e),dm(),this.closeChallenge(),this.threeDsProcessor?.onError({error:e.message})}),d.on(`error`,e=>{this.log(`[${this.getType()}][error]`,e),dm(),this.closeChallenge(),this.threeDsProcessor?.onError({error:e.message})})}initScript(e){let t=document.createElement(`script`);t.type=`text/javascript`,t.src=`https://${this.getDomain()}/js/v1/Gateway.js`,t.onload=()=>{this.initGateway(e),this.initChallenge()},document.head.appendChild(t)}initGateway(e){this.gateway=window.Gateway.create(e),this.threeDS=this.gateway.get3DSecure(),this.gateway.on(`error`,e=>{this.log(`[${this.getType()}]: gateway error`,e),this.threeDsProcessor?.onError({error:e.message}),this.threeDS=null,this.numAttempts=pm})}initChallenge(){let{destroy:e}=Qs({el:document.body,component:lm,on:{close:()=>{this.closeChallenge(),this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=e}showChallenge(){this.setChallengeFrameVisible(!0),window.postMessage({message:`3DS_CHALLENGE_SHOW`},`*`)}closeChallenge(){this.setChallengeFrameVisible(!1),window.postMessage({message:`3DS_CHALLENGE_CLOSE`},`*`)}removeChallenge(){this.threeDSDestroy?.()}}})),gm,_m=o((()=>{hm(),gm=class extends mm{getType(){return`CxPay`}getDomain(){return`cxpay.transactiongateway.com`}}})),vm=c({default:()=>ym});function ym(e,t,n){return new gm(e,t,n)}var bm=o((()=>{_m()})),xm=c({default:()=>Sm});function Sm(e,t,n){return new em(e,t,n)}var Cm=o((()=>{tm()})),wm,Tm,Em,Dm,Om,km,Am=o((()=>{W(),pd(),_c(),wm={class:`mask`},Tm={class:`wrapper`},Em={class:`container`},Dm=[`action`],Om=[`value`],km=L({__name:`ecentric`,props:{threeDSServerTransID:{},acsTransID:{},formAction:{},authenticationValue:{}},emits:[`close`,`submit`],setup(e,{emit:t}){let n=e,r=t,i=Uo(()=>hc(n.formAction)?n.formAction:``),a=P(null),o=n.authenticationValue;return Ba(()=>{i.value&&a.value?.submit()}),(e,t)=>(R(),z(`div`,wm,[B(`div`,Tm,[B(`div`,Em,[U(fd,{onClick:t[0]||=e=>r(`close`)}),t[1]||=B(`iframe`,{name:`ThreeDsChallengeIFrame`},null,-1),B(`form`,{action:i.value,target:`ThreeDsChallengeIFrame`,method:`post`,ref_key:`form`,ref:a},[B(`input`,{type:`hidden`,name:`PaReq`,value:F(o)},null,8,Om)],8,Dm)])])]))}})})),jm=o((()=>{})),Mm=o((()=>{})),Nm,Pm=o((()=>{Am(),Am(),jm(),Mm(),K(),Nm=G(km,[[`__scopeId`,`data-v-bdfafa40`]])})),Fm,Im=o((()=>{tm(),$s(),Pm(),Fm=class extends em{paResPayload=``;getType(){return`Ecentric`}onPostAuth(){this.log(`[${this.getType()}][onPostAuth]`,{threeDSServerTransID:this.threeDSServerTransID,authenticationValue:this.paResPayload}),this.threeDsProcessor?.onPostAuth({threeDSServerTransID:this.threeDSServerTransID,authenticationValue:this.paResPayload},this.onSuccess,this.onError)}doChallenge(e,t,n){this.log(`[${this.getType()}][doChallenge]`),this.setChallengeFrameVisible(!0);let{destroy:r}=Qs({el:document.body,component:Nm,props:{threeDSServerTransID:this.threeDSServerTransID,acsTransID:t,formAction:e,authenticationValue:n},on:{close:()=>{r(),this.setChallengeFrameVisible(!1),this.threeDSDestroy=()=>{},this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=r}challengeComplete(e){this.log(`[${this.getType()}]: 3Ds Challenge complete`,e.data),this.closeChallenge(),this.log(`[${this.getType()}]: cresData`,e.data.cres),e.data.cres?(this.paResPayload=e.data.cres,this.onPostAuth()):(this.log(`[${this.getType()}]: Failed 3DS Challenge`,e.data),this.onError(400,`Failed 3DS Challenge`))}}})),Lm=c({default:()=>Rm});function Rm(e,t,n){return new Fm(e,t,n)}var zm=o((()=>{Im()})),Bm,Vm=o((()=>{hm(),Bm=class extends mm{getType(){return`EPNA`}getDomain(){return`epna.transactiongateway.com`}}})),Hm=c({default:()=>Um});function Um(e,t,n){return new Bm(e,t,n)}var Wm=o((()=>{Vm()})),Gm,Km=o((()=>{hm(),Gm=class extends mm{getType(){return`FlashBanc`}getDomain(){return`flashbanc.transactiongateway.com`}}})),qm=c({default:()=>Jm});function Jm(e,t,n){return new Gm(e,t,n)}var Ym=o((()=>{Km()}));function Xm(){return typeof window.checkoutTools?.managedOrders?.manageOrder==`function`}function Zm(e){if(Xm())return Promise.resolve();let t=document.getElementById(`checkoutTools__script`)??Qm(e);return new Promise((e,n)=>{t.addEventListener(`load`,()=>e()),t.addEventListener(`error`,()=>{t.remove(),n(Error(`Forter managedOrders script failed to load`))})})}function Qm(e){let t=document.createElement(`script`);return t.type=`text/javascript`,t.id=rh,t.setAttribute(`data-site-id`,e),t.src=ih,t.addEventListener(`load`,()=>{t.dataset.loaded=`true`},{once:!0}),document.getElementsByTagName(`body`)[0].appendChild(t),t}function $m(e,t,n){let r=()=>{};if(Xm())return eh(e,t,n),r;let i=document.getElementById(rh);if(!i)return n(Error(`Forter managedOrders script is not loaded`)),r;if(i.dataset.loaded)return n(Error(`Forter managedOrders script loaded without checkoutTools.managedOrders`)),r;let a=()=>{s(),Xm()?eh(e,t,n):n(Error(`Forter managedOrders script loaded without checkoutTools.managedOrders`))},o=()=>{s(),n(Error(`Forter managedOrders script failed to load`))},s=()=>{i.removeEventListener(`load`,a),i.removeEventListener(`error`,o)};return i.addEventListener(`load`,a),i.addEventListener(`error`,o),s}function eh(e,t,n){window.checkoutTools.managedOrders.manageOrder(e,{challengeContainer:t??null},n)}var th,nh,rh,ih,ah=o((()=>{th=/^[A-Za-z0-9]+$/,nh=`v1.2`,rh=`checkoutTools__script`,ih=`https://sdk.checkouttools.com/${nh}/managedOrders.js`})),oh,sh,ch=o((()=>{tm(),ah(),du(),{hideSpinner:oh}=lu(),sh=class extends em{getType(){return`Forter`}onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);this.log(`[${this.getType()}][onDoAuthSuccess]`,n);let r=this.options.clientParameters?.SiteId||``,i=n.managedOrderToken;!i||!th.test(r)?this.onError(e,`3DS could not be started`):Zm(r).then(()=>{this.setChallengeFrameVisible(!0),oh(),$m(i,this.container,e=>{this.setChallengeFrameVisible(!1),e?(this.log(`[${this.getType()}]: manageOrder failed`,e),this.onError(400,`3DS failed`)):this.onPostAuth()})},e=>{this.log(`[${this.getType()}]: managedOrders.js failed to load`,e),this.onError(400,`3DS could not be started`)})}}})),lh=c({default:()=>uh});function uh(e,t,n){return new sh(e,t,n)}var dh=o((()=>{ch()})),fh,ph,mh,hh,gh=o((()=>{W(),_c(),fh={class:`mask`},ph={class:`wrapper`},mh=[`src`],hh=L({__name:`GPayments`,props:{url:{},width:{},height:{}},setup(e){let t=e,n=Uo(()=>hc(t.url)?t.url:``);function r(){return{width:`${t.width||650}px`,height:`${t.height||400}px`}}return(e,t)=>(R(),z(`div`,fh,[B(`div`,ph,[B(`div`,{class:`container`,style:Me([r(),{padding:`0`,margin:`0`}])},[B(`iframe`,{src:n.value,style:Me(r())},null,12,mh)],4)])]))}})})),_h=o((()=>{})),vh=o((()=>{})),yh,bh=o((()=>{gh(),gh(),_h(),vh(),K(),yh=G(hh,[[`__scopeId`,`data-v-cf5aa816`]])})),xh,Sh,Ch=o((()=>{tm(),$s(),bh(),_c(),du(),{hideSpinner:xh}=lu(),Sh=class extends em{getType(){return`GPayments`}doChallenge(e){this.log(`[${this.getType()}][doChallenge]`),xh(),this.setChallengeFrameVisible(!0);let{destroy:t}=Qs({el:document.body,component:yh,props:{url:e,width:390,height:400},on:{close:()=>{t(),this.threeDSDestroy=()=>{}}}});this.threeDSDestroy=t}challengeComplete(e){this.log(`[${this.getType()}]: 3Ds Challenge complete`,e.data),this.closeChallenge(),this.onPostAuth()}onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);if(this.log(`[${this.getType()}][onDoAuthSuccess]`,n),!n.transStatus)this.onError(e,`No transStatus specified`);else switch(n.transStatus){case`C`:if(!n.acsURL){this.onError(e,`Invalid Challenge Url`);return}this.doChallenge(n.acsURL);break;default:this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`),this.onPostAuth()}};onInitAuthSuccess=(e,t)=>{let n=JSON.parse(t);this.log(`[${this.getType()}][onInitAuthSuccess]`,n),n.threeDSAuthURL?(this.threeDSRequestorTransID=n.threeDSRequestorTransID,this.threeDSServerTransID=n.threeDSServerTransID,this.threeDSMonitorURL=n.threeDSMonitorURL,this.threeDSAuthURL=n.threeDSAuthURL,n.threeDsServerCallbackUrl?this.initFrame(n.threeDsServerCallbackUrl):this.onAuth(!1,``)):this.onError(e,`No AuthUrl specified`)};initFrame(e){if(this.log(`[${this.getType()}][init3DSFrame]`,e),!hc(e))return;let t=document.createElement(`iframe`);t.src=e,t.style.width=`1px`,t.style.height=`1px`,t.style.border=`0`,document.body.appendChild(t)}}})),wh=c({default:()=>Th});function Th(e,t,n){return new Sh(e,t,n)}var Eh=o((()=>{Ch()})),Dh=c({default:()=>Oh});function Oh(e,t,n){return new mm(e,t,n)}var kh=o((()=>{hm()})),Ah,jh=o((()=>{hm(),Ah=class extends mm{getType(){return`NMI`}getDomain(){return`secure.nmi.com`}}})),Mh=c({default:()=>Nh});function Nh(e,t,n){return new Ah(e,t,n)}var Ph=o((()=>{jh()})),Fh,Ih,Lh=o((()=>{W(),du(),Fh={class:`mask`},Ih=L({__name:`nuvei`,props:{threeDSServerTransID:{},sessionToken:{},env:{},merchantId:{},merchantSiteId:{},cardNumber:{},cardHolderName:{},expirationMonth:{},expirationYear:{},CVV:{},userPaymentOptionId:{},userTokenId:{},firstName:{},lastName:{},email:{},country:{}},setup(e){let{hideSpinner:t,showSpinner:n}=lu(),r=e;Ba(()=>{n();let e=document.createElement(`script`);e.type=`text/javascript`,e.src=`https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js`,e.onload=()=>{let e=new MutationObserver(function(){document.getElementsByClassName(`sfcModal-dialog`)[0]&&(t(),e.disconnect())}),n={childList:!0},r=document.querySelector(`body`);e.observe(r,n),i()},document.head.appendChild(e)});function i(){let e=window.SafeCharge({env:r.env,merchantId:r.merchantId,merchantSiteId:r.merchantSiteId});e.fields({fonts:[{cssUrl:`https://fonts.googleapis.com/css?family=Source+Code+Pro`}],locale:`en`});let t=r.userPaymentOptionId?{userPaymentOptionId:r.userPaymentOptionId,...r.CVV?{card:{CVV:r.CVV}}:{}}:{card:{cardNumber:r.cardNumber,cardHolderName:r.cardHolderName,expirationMonth:r.expirationMonth,expirationYear:r.expirationYear,CVV:r.CVV}};e.authenticate3d({sessionToken:r.sessionToken,...r.userTokenId?{userTokenId:r.userTokenId}:{},paymentOption:t,billingAddress:{firstName:r.firstName,lastName:r.lastName,email:r.email,country:r.country}},function(e){window.postMessage({status:`3ds_challenge_complete`,cres:e},`*`)})}return(e,t)=>(R(),z(`div`,Fh,[...t[0]||=[B(`div`,{class:`wrapper`},[B(`div`,{class:`container`})],-1)]]))}})})),Rh=o((()=>{})),zh=o((()=>{})),Bh,Vh=o((()=>{Lh(),Lh(),Rh(),zh(),K(),Bh=G(Ih,[[`__scopeId`,`data-v-299db412`]])})),Hh,Uh,Wh=o((()=>{$s(),Vh(),tm(),du(),au(),{hideSpinner:Hh}=lu(),Uh=class extends em{_paResPayload=null;getType(){return`Nuvei`}onPostAuth(){this.log(`[${this.getType()}][onAuth] Do Post Authentication for transId`,this.threeDSServerTransID,this._paResPayload),this.threeDsProcessor?.onPostAuth({threeDSServerTransID:this.threeDSServerTransID,authenticationValue:this._paResPayload.cavv,eci:this._paResPayload.eci,dsTransID:this._paResPayload.dsTransID,threeDsVersion:this._paResPayload.threeDVersion,xid:this._paResPayload.xid},this.onSuccess,this.onError)}doNuveiChallenge(e,t,n){let r=JSON.parse(e);if(r===null||!r.merchantId||!r.merchantSiteId){this.threeDsProcessor?.onError({error:iu});return}if(this.threeDsProcessor?.getTokenId()&&!r?.userPaymentOptionId){this.threeDsProcessor?.onError({error:`3D Secure with a token needs a token created on this Nuvei provider`});return}t&&(r.firstName=t.firstName,r.lastName=t.lastName,r.email=t.email,r.country=t.country),n&&(r.cardNumber=n.cardNumber,r.cardHolderName=n.cardholder||``,r.expirationMonth=n.expiryDate.substring(2,4),r.expirationYear=n.expiryDate.substring(0,2),r.CVV=n.ccv),this.setChallengeFrameVisible(!0);let{destroy:i}=Qs({el:document.body,component:Bh,props:r,on:{close:()=>{i(),this.setChallengeFrameVisible(!1),this.threeDSDestroy=()=>{},this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=i}onSuccess=(e,t)=>{this.closeChallenge(),Hh();let n=JSON.parse(t);n.authenticationValue?this.threeDsProcessor?.onSuccess(n):(this.log(`[${this.getType()}][_onSuccess] ${iu}`,n),this.threeDsProcessor?.onError({error:iu}))};onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);if(this.log(`[${this.getType()}][onDoAuthSuccess]`,n),!n.transStatus||!n.authenticationValue)this.onError(e,`No transStatus specified`);else switch(n.transStatus){case`C`:this.doNuveiChallenge(n.authenticationValue,this.threeDsProcessor?.getAddressInfo(),this.threeDsProcessor?.getPaymentInfo());break;default:this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: `+n.transStatus),this.threeDsProcessor?.onSuccess({threeDSServerTransID:n.threeDSServerTransID,threeDSRequestorTransID:``,acsRenderingType:n.acsRenderingType,acsTransID:n.acsTransID,authenticationType:n.authenticationType,authenticationValue:n.authenticationValue,challengeCancel:``,dsTransID:n.dsTransID,eci:n.eci,interactionCounter:``,messageCategory:``,messageExtension:n.messageExtension,messageType:n.messageType,messageVersion:n.messageVersion,transStatus:n.transStatus,transStatusReason:n.transStatusReason})}};messageHandler(e){e?.data?.status&&(e.data.status===`3ds_method_invocation_complete`?(this.log(`[${this.getType()}][messageHandler] 3Ds Method invocation complete`),e.stopPropagation(),this.onAuth(!0,``)):e.data.status===`3ds_challenge_complete`&&(this.log(`[${this.getType()}][messageHandler] 3Ds Challenge complete`,e.data),e.stopPropagation(),this.closeChallenge(),e.data.cres&&e.data.cres?.result===`APPROVED`&&e.data.cres?.errCode===`0`?(this._paResPayload=e.data.cres,this.onPostAuth()):(this.log(`[${this.getType()}][messageHandler] Failed 3DS Challenge`,e.data),this.onError(400,`Failed 3DS Challenge`))))}}})),Gh=c({default:()=>Kh});function Kh(e,t,n){return new Uh(e,t,n)}var qh=o((()=>{Wh()})),Jh,Yh=o((()=>{hm(),Jh=class extends mm{getType(){return`Payabli`}getDomain(){return`centavo.transactiongateway.com`}}})),Xh=c({default:()=>Zh});function Zh(e,t,n){return new Jh(e,t,n)}var Qh=o((()=>{Yh()}));function $h(e,...t){ng.value&&console.log(Ce(e),Ce(t))}function eg(e){e?.data?.status&&e.data.status===`init-card-form`&&(ng.value=!!e?.data?.debug)}function tg(){return Ba(()=>{window.addEventListener(`message`,eg)}),Wa(()=>{window.removeEventListener(`message`,eg)}),{debug:ng,logMessage:$h}}var ng,rg=o((()=>{W(),au(),Oe(),ng=P(!1)})),ig,ag,og,sg,cg=o((()=>{W(),rg(),_c(),ig={class:`modal-mask`},ag={class:`modal-wrapper`},og=[`src`],sg=L({__name:`PayGLocalThreeDsChallenge`,props:{url:{}},emits:[`close`],setup(e,{emit:t}){let{logMessage:n}=tg(),r=e,i=t,a=P(r.url),o=Uo(()=>hc(a.value)?a.value:``);Mr(()=>r.url,e=>{a.value=e}),Ba(()=>{window.addEventListener(`message`,s)}),Wa(()=>{window.removeEventListener(`message`,s)});function s(e){if(n(`PayGLocalThreeDsChallenge: Message received`,e.data),!e?.data?.[`payglocal-token`])return;let t=e.data[`payglocal-token`];n(`Token received`,t);let r=t.split(`.`)[1],a=window.atob(r),o=JSON.parse(a);i(`close`,o)}return(e,t)=>(R(),z(`div`,ig,[B(`div`,ag,[B(`iframe`,{src:o.value,sandbox:`allow-same-origin allow-scripts allow-popups allow-forms`},null,8,og)])]))}})})),lg=o((()=>{})),ug=o((()=>{})),dg,fg=o((()=>{cg(),cg(),lg(),ug(),K(),dg=G(sg,[[`__scopeId`,`data-v-9fa1282d`]])})),pg,mg=o((()=>{tm(),tl(),$s(),fg(),au(),pg=class extends em{getType(){return`PayGLocal`}onPreAuth(){this.log(`[${this.getType()}]: onPreAuth`),this.threeDsProcessor?.getTokenId()?this.threeDsProcessor.getGatewayData(this.threeDsProcessor.getProviderId(),this.threeDsProcessor.getTokenId(),e=>this.initChallenge(e.gatewayMetadata?.RedirectUrl||``),()=>this.threeDsProcessor?.onError({error:`Unable to get card information`})):this.threeDsProcessor?.tokeniseCard(this.threeDsProcessor.getProviderId(),e=>{this.log(`[${this.getType()}]: tokeniseCard`,e),this.initChallenge(e.gatewayTokenData.RedirectUrl)},e=>{q(this.container,e)})}onAuth(e,t){}onPostAuth(){}initChallenge(e){if(this.log(`[${this.getType()}]: initChallenge`,e),!e){q(this.container,`3D Secure URL is missing`);return}this.setChallengeFrameVisible(!0);let{destroy:t}=Qs({el:document.body,component:dg,props:{url:e},on:{close:e=>{this.closeChallenge(),this.log(`[${this.getType()}]: Challenge Results`,e),e.status===`AUTHORIZED`?this.threeDsProcessor?.onSuccess({acsRenderingType:{},acsTransID:``,authenticationType:``,authenticationValue:``,challengeCancel:``,dsTransID:``,eci:``,interactionCounter:``,messageCategory:``,messageExtension:[],messageType:``,messageVersion:``,threeDSRequestorTransID:``,threeDSServerTransID:``,transStatusReason:``,transStatus:`Y`}):e.status===`CUSTOMER_CANCELLED`?this.threeDsProcessor?.onError({error:`Challenge cancelled`}):this.threeDsProcessor?.onError({error:iu})}}});this.threeDSDestroy=t}}})),hg=c({default:()=>gg});function gg(e,t,n){return new pg(e,t,n)}var _g=o((()=>{mg()})),vg,yg=o((()=>{hm(),vg=class extends mm{getType(){return`SkyBank`}getDomain(){return`secure.skybankgateway.com`}}})),bg=c({default:()=>xg});function xg(e,t,n){return new vg(e,t,n)}var Sg=o((()=>{yg()})),Cg,wg=o((()=>{Cg=`ICAgIChmdW5jdGlvbiAoKSB7CiAgICAgICAgdmFyIG1lcmNoYW50Q29uZmlnID0gewogICAgICAgICAgICBjc3A6IGZhbHNlLAogICAgICAgIH07CgogICAgICAgIHZhciBzaXRlSWQgPSAnMmU2NTE1YWEwYjhlJzsKZnVuY3Rpb24gdCh0LGUpe2Zvcih2YXIgbj10LnNwbGl0KCIiKSxyPTA7cjxuLmxlbmd0aDsrK3IpbltyXT1TdHJpbmcuZnJvbUNoYXJDb2RlKG5bcl0uY2hhckNvZGVBdCgwKStlKTtyZXR1cm4gbi5qb2luKCIiKX1mdW5jdGlvbiBlKGUpe3JldHVybiB0KGUsLV8pLnJlcGxhY2UoLyVTTiUvZyxzaXRlSWQpfWZ1bmN0aW9uIG4odCl7dHJ5e2lmKCJudW1iZXIiPT10eXBlb2YgdCYmd2luZG93LmxvY2F0aW9uJiZ3aW5kb3cubG9jYXRpb24ucGF0aG5hbWUpe2Zvcih2YXIgZT13aW5kb3cubG9jYXRpb24ucGF0aG5hbWUuc3BsaXQoIi8iKSxuPVtdLHI9MDtyPD1NYXRoLm1pbihlLmxlbmd0aC0xLE1hdGguYWJzKHQpKTtyKyspbi5wdXNoKGVbcl0pO3JldHVybiBuLmpvaW4oIi8iKXx8Ii8ifX1jYXRjaCh0KXt9cmV0dXJuIi8ifWZ1bmN0aW9uIHIoKXt2YXIgdD0ibm8iKyJvcCIrImZuIixlPSJnIisiYSIsbj0ibiIrImFtZSI7cmV0dXJuIHdpbmRvd1tlXSYmd2luZG93W2VdW25dPT09dH1mdW5jdGlvbiBvKCl7cmV0dXJuISghbmF2aWdhdG9yLmJyYXZlfHwiZnVuY3Rpb24iIT10eXBlb2YgbmF2aWdhdG9yLmJyYXZlLmlzQnJhdmUpfWZ1bmN0aW9uIGkoKXtyZXR1cm4gZG9jdW1lbnQuY3VycmVudFNjcmlwdCYmZG9jdW1lbnQuY3VycmVudFNjcmlwdC5zcmN9ZnVuY3Rpb24gYSh0KXt0cnl7JC5leD10LHIoKSYmLTE9PT0kLmV4LmluZGV4T2Yoei51QikmJigkLmV4Kz16LnVCKSxvKCkmJi0xPT09JC5leC5pbmRleE9mKHoudUJyKSYmKCQuZXgrPXoudUJyKSxpKCkmJi0xPT09JC5leC5pbmRleE9mKHoubklMKSYmKCQuZXgrPXoubklMKSx3aW5kb3cuZnRyX19zbnBfY3djfHwoJC5leCs9ei5zKSxIKCQpfWNhdGNoKHQpe319ZnVuY3Rpb24gYyh0LGUpe2Z1bmN0aW9uIG4oaSl7dHJ5e2kuYmxvY2tlZFVSST09PXQmJmkuZGlzcG9zaXRpb249PT1vJiYoZSgpLGRvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIocixuKSl9Y2F0Y2godCl7ZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcihyLG4pfX12YXIgcj0ic2VjdXJpdHlwb2xpY3l2aW9sYXRpb24iLG89ImVuZm9yY2UiO2RvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIocixuKSxzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7ZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcihyLG4pfSwyKjYwKjFlMyl9ZnVuY3Rpb24gZih0LGUsbixyKXt2YXIgbz0hMTt0PSJodHRwczovLyIrdCxjKHQsZnVuY3Rpb24oKXtyKCEwKSxvPSEwfSk7dmFyIGk9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgic2NyaXB0Iik7aWYoaS5vbmVycm9yPWZ1bmN0aW9uKCl7aWYoIW8pdHJ5e3IoITEpLG89ITB9Y2F0Y2godCl7fX0saS5vbmxvYWQ9bixpLnR5cGU9InRleHQvamF2YXNjcmlwdCIsaS5pZD0iZnRyX19zY3JpcHQiLGkuYXN5bmM9ITAsaS5zcmM9dCx3aW5kb3cuZnRyX19jb25maWcmJndpbmRvdy5mdHJfX2NvbmZpZy5tJiYhMD09PXdpbmRvdy5mdHJfX2NvbmZpZy5tLnB0YiYmZG9jdW1lbnQuYm9keSlkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGkpO2Vsc2V7dmFyIGE9ZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoInNjcmlwdCIpWzBdO2EucGFyZW50Tm9kZS5pbnNlcnRCZWZvcmUoaSxhKX19ZnVuY3Rpb24gdSgpe3NldFRpbWVvdXQobCxCLHoudURGKX1mdW5jdGlvbiBzKHQsZSxuLHIpe3ZhciBvPSExLGk9bmV3IFhNTEh0dHBSZXF1ZXN0O2lmKGMoImh0dHBzOiIrdCxmdW5jdGlvbigpe24obmV3IEVycm9yKCJDU1AgVmlvbGF0aW9uIiksITApLG89ITB9KSwiLy8iPT09dC5zbGljZSgwLDIpJiYodD0iaHR0cHM6Iit0KSwid2l0aENyZWRlbnRpYWxzImluIGkpaS5vcGVuKCJHRVQiLHQsITApO2Vsc2V7aWYoInVuZGVmaW5lZCI9PXR5cGVvZiBYRG9tYWluUmVxdWVzdClyZXR1cm47aT1uZXcgWERvbWFpblJlcXVlc3QsaS5vcGVuKCJHRVQiLHQpfU9iamVjdC5rZXlzKHIpLmZvckVhY2goZnVuY3Rpb24odCl7aS5zZXRSZXF1ZXN0SGVhZGVyKHQsclt0XSl9KSxpLm9ubG9hZD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiBlJiZlKGkpfSxpLm9uZXJyb3I9ZnVuY3Rpb24odCl7aWYoImZ1bmN0aW9uIj09dHlwZW9mIG4mJiFvKXRyeXtuKHQsITEpLG89ITB9Y2F0Y2godCl7fX0saS5vbnByb2dyZXNzPWZ1bmN0aW9uKCl7fSxpLm9udGltZW91dD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiBuJiZuKCJ0aW0iKyJlbyIrInV0IiwhMSl9LHNldFRpbWVvdXQoZnVuY3Rpb24oKXtpLnNlbmQoKX0sMCl9ZnVuY3Rpb24gZCh0LHNpdGVJZCxlKXtmdW5jdGlvbiBuKHQpe3ZhciBlPXQudG9TdHJpbmcoMTYpO3JldHVybiBlLmxlbmd0aCUyPyIwIitlOmV9ZnVuY3Rpb24gcih0KXtpZih0PD0wKXJldHVybiIiO2Zvcih2YXIgZT0iMDEyMzQ1Njc4OWFiY2RlZiIsbj0iIixyPTA7cjx0O3IrKyluKz1lW01hdGguZmxvb3IoTWF0aC5yYW5kb20oKSplLmxlbmd0aCldO3JldHVybiBufWZ1bmN0aW9uIG8odCl7Zm9yKHZhciBlPSIiLHI9MDtyPHQubGVuZ3RoO3IrKyllKz1uKHQuY2hhckNvZGVBdChyKSk7cmV0dXJuIGV9ZnVuY3Rpb24gaSh0KXtmb3IodmFyIGU9dC5zcGxpdCgiIiksbj0wO248ZS5sZW5ndGg7KytuKWVbbl09U3RyaW5nLmZyb21DaGFyQ29kZSgyNTVeZVtuXS5jaGFyQ29kZUF0KDApKTtyZXR1cm4gZS5qb2luKCIiKX1lPWU/IjEiOiIwIjt2YXIgYT1bXTtyZXR1cm4gYS5wdXNoKHQpLGEucHVzaChzaXRlSWQpLGEucHVzaChlKSxmdW5jdGlvbih0KXt2YXIgZT00MCxuPSIiO3JldHVybiB0Lmxlbmd0aDxlLzImJihuPSIsIityKGUvMi10Lmxlbmd0aC0xKSksbyhpKHQrbikpfShhLmpvaW4oIiwiKSl9ZnVuY3Rpb24gaCgpe2Z1bmN0aW9uIHQoKXtNJiZzZXRUaW1lb3V0KGwsQix6LmRVQUwpfWZ1bmN0aW9uIGUodCxlKXtNPWU/IkYiKyJUIisiUiIrIkEiKyJVIisiQyI6IkYiKyJUIisiUiIrIkEiKyJVIixzZXRUaW1lb3V0KGwsQix6LnVBUyl9d2luZG93LmZ0cl9fZmRhZCh0LGUpfWZ1bmN0aW9uIHcoKXtmdW5jdGlvbiB0KCl7TSYmc2V0VGltZW91dChsLEIsei51REFEKX1mdW5jdGlvbiBlKHQsZSl7TT1lPyJGIisiVCIrIlIiKyJBIisiVSIrIkMiOiJGIisiVCIrIlIiKyJBIisiVSIsc2V0VGltZW91dChsLEIsei51RFMpfXdpbmRvdy5mdHJfX3JhZGQodCxlKX1mdW5jdGlvbiBsKHQpe2Z1bmN0aW9uIGUoKXtmb3IodmFyIHQ9MDt0PD16LnRtb3NTZWNzLmxlbmd0aDt0KyspY2xlYXJUaW1lb3V0KGV0W3RdKX1mdW5jdGlvbiBuKCl7dHJ5e2UoKSxhKHQrei51Uyl9Y2F0Y2godCl7fX1mdW5jdGlvbiByKG4pe3RyeXtlKCksJC50ZD0xKm5ldyBEYXRlLSQudHMsYShuP3Qrei51Rit6LmNQOnQrei51RiksdD09PXoudUZQJiZ1KCksdD09PXoudURGJiYoaj93KCk6aCgpKSx0IT09ei51QVMmJnQhPT16LmRVQUx8fGp8fHcoKSx0IT09ei51RFMmJnQhPT16LnVEQUR8fGomJmgoKX1jYXRjaCh0KXthKHouZVVvZSl9fXRyeXshZnVuY3Rpb24odCl7Zm9yKHZhciBlPTA7ZTw9ei50bW9zU2Vjcy5sZW5ndGg7ZSsrKWU9PT16LnRtb3NTZWNzLmxlbmd0aD9ldFtlXT1zZXRUaW1lb3V0KHIsMWUzKnoudG1vc1NlY3NbZS0xXSsxZTMpOmV0W2VdPXNldFRpbWVvdXQoYSwxZTMqei50bW9zU2Vjc1tlXSx0K3oudG1vc1tlXSl9KHQpO3ZhciBvO3N3aXRjaCh0KXtjYXNlIHoudUZQOm89TjticmVhaztjYXNlIHoudURGOm89STticmVhaztkZWZhdWx0Om89TX1pZighbylyZXR1cm47aWYobz09PSJGIisiVCIrIlIiKyJBIisiVSIrIkMiKXJldHVybiB2b2lkIHIoITApO2lmKG89PT0iRiIrIlQiKyJSIisiQSIrIlUiKXJldHVybiB2b2lkIHIoITEpO2Yobyx2b2lkIDAsbixyKX1jYXRjaChlKXthKHQrei5lVGx1KX19dmFyIGc9IjIyZzVpejZ2OnVpaHN2fXcxZm9yeGdpdXJxdzFxaHcydndkd3h2Iix2PSJmb3J0IixwPSJlclRvIixtPSJrZW4iLF89Mzt3aW5kb3cuZnRyX19jb25maWc9e206bWVyY2hhbnRDb25maWcsczoiMzEiLHNpOnNpdGVJZH07dmFyIHk9ITEsVT0hMSxULHgsQT12K3ArbSxTPTQwMCoyNCo2MCxELEM9MTA7RD17d3JpdGU6ZnVuY3Rpb24odCxlLHIsbyl7dm9pZCAwPT09byYmKG89ITApO3ZhciBpPTA7d2luZG93LmZ0cl9fY29uZmlnJiZ3aW5kb3cuZnRyX19jb25maWcubSYmd2luZG93LmZ0cl9fY29uZmlnLm0uY2tEZXB0aCYmKGk9d2luZG93LmZ0cl9fY29uZmlnLm0uY2tEZXB0aCk7dmFyIGEsYyxmPW4oaSk7aWYocj8oYT1uZXcgRGF0ZSxhLnNldFRpbWUoYS5nZXRUaW1lKCkrNjAqcioxZTMpLGM9IjsgZXhwaXJlcz0iK2EudG9HTVRTdHJpbmcoKSk6Yz0iIiwhbylyZXR1cm4gdm9pZChkb2N1bWVudC5jb29raWU9ZXNjYXBlKHQpKyI9Iitlc2NhcGUoZSkrYysiOyBwYXRoPSIrZik7Zm9yKHZhciB1PTEscz1kb2N1bWVudC5kb21haW4uc3BsaXQoIi4iKSxkPUMsaD0hMDtoJiZzLmxlbmd0aD49dSYmZD4wOyl7dmFyIHc9cy5zbGljZSgtdSkuam9pbigiLiIpO2RvY3VtZW50LmNvb2tpZT1lc2NhcGUodCkrIj0iK2VzY2FwZShlKStjKyI7IHBhdGg9IitmKyI7IGRvbWFpbj0iK3c7dmFyIGw9RC5yZWFkKHQpO251bGwhPWwmJmw9PWV8fCh3PSIuIit3LGRvY3VtZW50LmNvb2tpZT1lc2NhcGUodCkrIj0iK2VzY2FwZShlKStjKyI7IHBhdGg9IitmKyI7IGRvbWFpbj0iK3cpLGg9LTE9PT1kb2N1bWVudC5jb29raWUuaW5kZXhPZih0KyI9IitlKSx1KyssZC0tfX0scmVhZDpmdW5jdGlvbih0KXt2YXIgZT1udWxsO3RyeXtmb3IodmFyIG49ZXNjYXBlKHQpKyI9IixyPWRvY3VtZW50LmNvb2tpZS5zcGxpdCgiOyIpLG89MzIsaT0wO2k8ci5sZW5ndGg7aSsrKXtmb3IodmFyIGE9cltpXTthLmNoYXJDb2RlQXQoMCk9PT1vOylhPWEuc3Vic3RyaW5nKDEsYS5sZW5ndGgpOzA9PT1hLmluZGV4T2YobikmJihlPXVuZXNjYXBlKGEuc3Vic3RyaW5nKG4ubGVuZ3RoLGEubGVuZ3RoKSkpfX1maW5hbGx5e3JldHVybiBlfX19O3ZhciBSPXdpbmRvdy5mdHJfX2NvbmZpZy5zO1IrPSJjayI7dmFyIEw9ZnVuY3Rpb24odCl7dmFyIGU9ITEsbj1udWxsLHI9ZnVuY3Rpb24oKXt0cnl7aWYoIW58fCFlKXJldHVybjtuLnJlbW92ZSYmImZ1bmN0aW9uIj09dHlwZW9mIG4ucmVtb3ZlP24ucmVtb3ZlKCk6ZG9jdW1lbnQuaGVhZC5yZW1vdmVDaGlsZChuKSxlPSExfWNhdGNoKHQpe319O2RvY3VtZW50LmhlYWQmJighZnVuY3Rpb24oKXtuPWRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImxpbmsiKSxuLnNldEF0dHJpYnV0ZSgicmVsIiwicHJlIisiY29uIisibmVjdCIpLG4uc2V0QXR0cmlidXRlKCJjcm9zIisic29yaSIrImdpbiIsImFub255bW91cyIpLG4ub25sb2FkPXIsbi5vbmVycm9yPXIsbi5zZXRBdHRyaWJ1dGUoImhyZWYiLHQpLGRvY3VtZW50LmhlYWQuYXBwZW5kQ2hpbGQobiksZT0hMH0oKSxzZXRUaW1lb3V0KHIsM2UzKSl9LEU9ZShnfHwiMjJnNWl6NnY6dWloc3Z9dzFmb3J4Z2l1cnF3MXFodzJ2d2R3eHYiKSxxPXQoIlswVWh0eGh2dzBMRyIsLV8pLGI9dCgiWzBGcnV1aG9kd2xycTBMRyIsLV8pLFA9dCgiTGkwUXJxaDBQZHdmayIsLV8pLGs9ZSgiZHNzMXZsd2hzaHVpcnVwZHFmaHdodncxcWh3IiksRj1lKCIyMjQxNDE0MTQyZ3F2MHR4aHV8IiksTSxPPSJmZ3E3MWlydXdodTFmcnAiLEksVjtJPWUoIihWUSgxIitPKyIydnEyKFZRKDJ2ZnVsc3cxbXYiKSxWPWUoIihWUSgxIitPKyIydnFWMihWUSgydmZ1bHN3MW12Iik7dmFyIE47d2luZG93LmZ0cl9fY29uZmlnJiZ3aW5kb3cuZnRyX19jb25maWcubSYmd2luZG93LmZ0cl9fY29uZmlnLm0uZnBpJiYoTj1lKCJmZ3E3MSIpK3dpbmRvdy5mdHJfX2NvbmZpZy5tLmZwaStlKCIydnEyKFZRKDJ2ZnVsc3cxbXYiKSk7dmFyIGo9ITE7aj0hMTt2YXIgQj0xMDt3aW5kb3cuZnRyX19zdGFydFNjcmlwdExvYWQ9MSpuZXcgRGF0ZTt2YXIgRz1mdW5jdGlvbih0KXt2YXIgZT0iZnQiKyJyOnRvayIrImVuUiIrImVhZHkiO3dpbmRvdy5mdHJfX3R0JiZjbGVhclRpbWVvdXQod2luZG93LmZ0cl9fdHQpLHdpbmRvdy5mdHJfX3R0PXNldFRpbWVvdXQoZnVuY3Rpb24oKXt0cnl7ZGVsZXRlIHdpbmRvdy5mdHJfX3R0LHQrPSJfdHQiO3ZhciBuPWRvY3VtZW50LmNyZWF0ZUV2ZW50KCJFdmVudCIpO24uaW5pdEV2ZW50KGUsITEsITEpLG4uZGV0YWlsPXQsZG9jdW1lbnQuZGlzcGF0Y2hFdmVudChuKX1jYXRjaCh0KXt9fSwxZTMpfSxIPWZ1bmN0aW9uKHQpe3ZhciBlPWZ1bmN0aW9uKHQpe3JldHVybiB0fHwiIn0sbj1lKHQuaWQpKyJfIitlKHQudHMpKyJfIitlKHQudGQpKyJfIitlKHQuZXgpKyJfIitlKFIpLHI9UzshaXNOYU4od2luZG93LmZ0cl9fY29uZmlnLm0uY2tUVEwpJiZ3aW5kb3cuZnRyX19jb25maWcubS5ja1RUTCYmKHI9d2luZG93LmZ0cl9fY29uZmlnLm0uY2tUVEwpLEQud3JpdGUoQSxuLHIsITApLEcobiksd2luZG93LmZ0cl9fZ3Q9bn0sWD1mdW5jdGlvbigpe3ZhciB0PUQucmVhZChBKXx8IiIsZT10LnNwbGl0KCJfIiksbj1mdW5jdGlvbih0KXtyZXR1cm4gZVt0XXx8dm9pZCAwfTtyZXR1cm57aWQ6bigwKSx0czpuKDEpLHRkOm4oMiksZXg6bigzKSx2cjpuKDQpfX0sUT1mdW5jdGlvbigpe2Zvcih2YXIgdD17fSxlPSJmZ3UiLG49W10scj0wO3I8MjU2O3IrKyluW3JdPShyPDE2PyIwIjoiIikrci50b1N0cmluZygxNik7dmFyIG89ZnVuY3Rpb24odCxlLHIsbyxpKXt2YXIgYT1pPyItIjoiIjtyZXR1cm4gblsyNTUmdF0rblt0Pj44JjI1NV0rblt0Pj4xNiYyNTVdK25bdD4+MjQmMjU1XSthK25bMjU1JmVdK25bZT4+OCYyNTVdK2ErbltlPj4xNiYxNXw2NF0rbltlPj4yNCYyNTVdK2Erbls2MyZyfDEyOF0rbltyPj44JjI1NV0rYStuW3I+PjE2JjI1NV0rbltyPj4yNCYyNTVdK25bMjU1Jm9dK25bbz4+OCYyNTVdK25bbz4+MTYmMjU1XStuW28+PjI0JjI1NV19LGk9ZnVuY3Rpb24oKXtpZih3aW5kb3cuVWludDMyQXJyYXkmJndpbmRvdy5jcnlwdG8mJndpbmRvdy5jcnlwdG8uZ2V0UmFuZG9tVmFsdWVzKXt2YXIgdD1uZXcgd2luZG93LlVpbnQzMkFycmF5KDQpO3JldHVybiB3aW5kb3cuY3J5cHRvLmdldFJhbmRvbVZhbHVlcyh0KSx7ZDA6dFswXSxkMTp0WzFdLGQyOnRbMl0sZDM6dFszXX19cmV0dXJue2QwOjQyOTQ5NjcyOTYqTWF0aC5yYW5kb20oKT4+PjAsZDE6NDI5NDk2NzI5NipNYXRoLnJhbmRvbSgpPj4+MCxkMjo0Mjk0OTY3Mjk2Kk1hdGgucmFuZG9tKCk+Pj4wLGQzOjQyOTQ5NjcyOTYqTWF0aC5yYW5kb20oKT4+PjB9fSxhPWZ1bmN0aW9uKCl7dmFyIHQ9IiIsZT1mdW5jdGlvbih0LGUpe2Zvcih2YXIgbj0iIixyPXQ7cj4wOy0tciluKz1lLmNoYXJBdCgxZTMqTWF0aC5yYW5kb20oKSVlLmxlbmd0aCk7cmV0dXJuIG59O3JldHVybiB0Kz1lKDIsIjAxMjM0NTY3ODkiKSx0Kz1lKDEsIjEyMzQ1Njc4OSIpLHQrPWUoOCwiMDEyMzQ1Njc4OSIpfTtyZXR1cm4gdC5zYWZlR2VuZXJhdGVOb0Rhc2g9ZnVuY3Rpb24oKXt0cnl7dmFyIHQ9aSgpO3JldHVybiBvKHQuZDAsdC5kMSx0LmQyLHQuZDMsITEpfWNhdGNoKHQpe3RyeXtyZXR1cm4gZSthKCl9Y2F0Y2godCl7fX19LHQuaXNWYWxpZE51bWVyaWNhbFRva2VuPWZ1bmN0aW9uKHQpe3JldHVybiB0JiZ0LnRvU3RyaW5nKCkubGVuZ3RoPD0xMSYmdC5sZW5ndGg+PTkmJnBhcnNlSW50KHQsMTApLnRvU3RyaW5nKCkubGVuZ3RoPD0xMSYmcGFyc2VJbnQodCwxMCkudG9TdHJpbmcoKS5sZW5ndGg+PTl9LHQuaXNWYWxpZFVVSURUb2tlbj1mdW5jdGlvbih0KXtyZXR1cm4gdCYmMzI9PT10LnRvU3RyaW5nKCkubGVuZ3RoJiYvXlthLXowLTldKyQvLnRlc3QodCl9LHQuaXNWYWxpZEZHVVRva2VuPWZ1bmN0aW9uKHQpe3JldHVybiAwPT10LmluZGV4T2YoZSkmJnQubGVuZ3RoPj0xMn0sdH0oKSx6PXt1REY6IlVERiIsZFVBTDoiZFVBTCIsdUFTOiJVQVMiLHVEUzoiVURTIix1REFEOiJVREFEIix1RlA6IlVGUCIsbUxkOiIxIixlVGx1OiIyIixlVW9lOiIzIix1UzoiNCIsdUY6IjkiLHRtb3M6WyJUNSIsIlQxMCIsIlQxNSJdLHRtb3NTZWNzOls1LDEwLDE1XSxiSVI6IjQzIix1QjoidSIsdUJyOiJiIixjUDoiYyIsbklMOiJpIixzOiJzIn07dHJ5e3ZhciAkPVgoKTt0cnl7JC5pZCYmKFEuaXNWYWxpZE51bWVyaWNhbFRva2VuKCQuaWQpfHxRLmlzVmFsaWRVVUlEVG9rZW4oJC5pZCl8fFEuaXNWYWxpZEZHVVRva2VuKCQuaWQpKT93aW5kb3cuZnRyX19uY2Q9ITE6KCQuaWQ9US5zYWZlR2VuZXJhdGVOb0Rhc2goKSx3aW5kb3cuZnRyX19uY2Q9ITApLCQudHM9d2luZG93LmZ0cl9fc3RhcnRTY3JpcHRMb2FkLEgoJCksd2luZG93LmZ0cl9fc25wX2N3Yz0hIUQucmVhZChBKSx3aW5kb3cuZnRyX19zbnBfY3djfHwoST1WKTtmb3IodmFyIEo9ImZvciIrInRlciIrIi5jbyIrIm0iLEs9Imh0IisidHBzOi8vYyIrImRuOS4iK0osVz0iaHQiKyJ0cHM6Ly8iKyQuaWQrIi0iK3NpdGVJZCsiLmNkIisibi4iK0osWT0iaHR0cCIrInM6Ly9jZCIrIm4zLiIrSixaPVtLLFcsWV0sdHQ9MDt0dDxaLmxlbmd0aDt0dCsrKUwoWlt0dF0pO3ZhciBldD1uZXcgQXJyYXkoei50bW9zU2Vjcy5sZW5ndGgpO3dpbmRvdy5mdHJfX2ZkYWQ9ZnVuY3Rpb24oZSxuKXtpZih5KXJldHVybiB3aW5kb3cuZnRyX19hbHRkMj14LHZvaWQgZSgpO3k9ITA7dmFyIHI9e307cltQXT1kKHdpbmRvdy5mdHJfX2NvbmZpZy5zLHNpdGVJZCx3aW5kb3cuZnRyX19jb25maWcubS5jc3ApLHMoRSxmdW5jdGlvbihuKXt0cnl7dmFyIHI9bi5nZXRBbGxSZXNwb25zZUhlYWRlcnMoKS50b0xvd2VyQ2FzZSgpO2lmKHIuaW5kZXhPZihiLnRvTG93ZXJDYXNlKCkpPj0wKXt2YXIgbz1uLmdldFJlc3BvbnNlSGVhZGVyKGIpO3g9d2luZG93LmZ0cl9fYWx0ZDI9dChhdG9iKG8pLC1fLTEpfWlmKHIuaW5kZXhPZihxLnRvTG93ZXJDYXNlKCkpPDApcmV0dXJuO3ZhciBpPW4uZ2V0UmVzcG9uc2VIZWFkZXIocSksYT10KGF0b2IoaSksLV8tMSk7aWYoYSl7dmFyIGM9YS5zcGxpdCgiOiIpO2lmKGMmJjI9PT1jLmxlbmd0aCl7Zm9yKHZhciBmPWNbMF0sdT1jWzFdLHM9IiIsZD0wLGg9MDtkPDIwOysrZClzKz1kJTM+MCYmaDwxMj9zaXRlSWQuY2hhckF0KGgrKyk6JC5pZC5jaGFyQXQoZCk7dmFyIHc9dS5zcGxpdCgiLCIpO2lmKHcubGVuZ3RoPjEpe3ZhciBsPXdbMF0sZz13WzFdO009ZisiLyIrbCsiLiIrcysiLiIrZ319fWUoKX1jYXRjaCh0KXt9fSxmdW5jdGlvbih0LGUpe24mJm4odCxlKX0scil9LHdpbmRvdy5mdHJfX3JhZGQ9ZnVuY3Rpb24odCxlKXtmdW5jdGlvbiBuKGUpe3RyeXt2YXIgbj1lLnJlc3BvbnNlLHI9ZnVuY3Rpb24odCl7ZnVuY3Rpb24gZSh0LG4saSl7dHJ5e2lmKGk+PXIpcmV0dXJue25hbWU6IiIsbmV4dE9mZnNldFRvUHJvY2VzczpuLGVycm9yOiJNYXggcG9pbnRlciBkZXJlZmVyZW5jZSBkZXB0aCBleGNlZWRlZCJ9O2Zvcih2YXIgYT1bXSxjPW4sZj10LmdldFVpbnQ4KGMpLHU9MDt1PG87KXtpZih1KyssMTkyPT0oMTkyJmYpKXt2YXIgcz0oNjMmZik8PDh8dC5nZXRVaW50OChjKzEpLGQ9ZSh0LHMsaSsxKTtpZihkLmVycm9yKXJldHVybiBkO3ZhciBoPWQubmFtZTtyZXR1cm4gYS5wdXNoKGgpLHtuYW1lOmEuam9pbigiLiIpLG5leHRPZmZzZXRUb1Byb2Nlc3M6YysyfX1pZighKGY+MCkpe2lmKDAhPT1mKXJldHVybntuYW1lOiIiLG5leHRPZmZzZXRUb1Byb2Nlc3M6YyxlcnJvcjoiVW5leHBlY3RlZCBsZW5ndGggYXQgdGhlIGVuZCBvZiBuYW1lOiAiK2YudG9TdHJpbmcoKX07cmV0dXJue25hbWU6YS5qb2luKCIuIiksbmV4dE9mZnNldFRvUHJvY2VzczpjKzF9fWZvcih2YXIgdz0iIixsPTE7bDw9ZjtsKyspdys9U3RyaW5nLmZyb21DaGFyQ29kZSh0LmdldFVpbnQ4KGMrbCkpO2EucHVzaCh3KSxjKz1mKzEsZj10LmdldFVpbnQ4KGMpfXJldHVybntuYW1lOiIiLG5leHRPZmZzZXRUb1Byb2Nlc3M6YyxlcnJvcjoiTWF4IGl0ZXJhdGlvbnMgZXhjZWVkZWQifX1jYXRjaCh0KXtyZXR1cm57bmFtZToiIixuZXh0T2Zmc2V0VG9Qcm9jZXNzOm4sZXJyb3I6IlVuZXhwZWN0ZWQgZXJyb3Igd2hpbGUgcGFyc2luZyByZXNwb25zZTogIit0LnRvU3RyaW5nKCl9fX12YXIgbixyPTQsbz0xMDAsaT0xNixhPW5ldyBEYXRhVmlldyh0KSxjPWEuZ2V0VWludDE2KDApLGY9YS5nZXRVaW50MTYoMiksdT1hLmdldFVpbnQxNig0KSxzPWEuZ2V0VWludDE2KDYpLGQ9YS5nZXRVaW50MTYoOCksaD1hLmdldFVpbnQxNigxMCksdz0xMixsPVtdLGc9MDtmb3IoZz0wO2c8dTtnKyspe2lmKG49ZShhLHcsMCksbi5lcnJvcil0aHJvdyBuZXcgRXJyb3Iobi5lcnJvcik7aWYodz1uLm5leHRPZmZzZXRUb1Byb2Nlc3MsIU51bWJlci5pc0ludGVnZXIodykpdGhyb3cgbmV3IEVycm9yKCJpbnZhbGlkIHJldHVybmVkIG9mZnNldCIpO3ZhciB2PW4ubmFtZSxwPWEuZ2V0VWludDE2KHcpO3crPTI7dmFyIG09YS5nZXRVaW50MTYodyk7dys9MixsLnB1c2goe3FuYW1lOnYscXR5cGU6cCxxY2xhc3M6bX0pfXZhciBfPVtdO2ZvcihnPTA7ZzxzO2crKyl7aWYobj1lKGEsdywwKSxuLmVycm9yKXRocm93IG5ldyBFcnJvcihuLmVycm9yKTtpZih3PW4ubmV4dE9mZnNldFRvUHJvY2VzcywhTnVtYmVyLmlzSW50ZWdlcih3KSl0aHJvdyBuZXcgRXJyb3IoImludmFsaWQgcmV0dXJuZWQgb2Zmc2V0Iik7dmFyIHk9bi5uYW1lLFU9YS5nZXRVaW50MTYodyk7aWYoVSE9PWkpdGhyb3cgbmV3IEVycm9yKCJVbmV4cGVjdGVkIHJlY29yZCB0eXBlOiAiK1UudG9TdHJpbmcoKSk7dys9Mjt2YXIgVD1hLmdldFVpbnQxNih3KTt3Kz0yO3ZhciB4PWEuZ2V0VWludDMyKHcpO3crPTQ7dmFyIEE9YS5nZXRVaW50MTYodyk7dys9Mjtmb3IodmFyIFM9IiIsRD13LEM9MDtEPHcrQSYmQzxvOyl7QysrO3ZhciBSPWEuZ2V0VWludDgoRCk7RCs9MTtTKz0obmV3IFRleHREZWNvZGVyKS5kZWNvZGUodC5zbGljZShELEQrUikpLEQrPVJ9aWYoQz49byl0aHJvdyBuZXcgRXJyb3IoIk1heCBpdGVyYXRpb25zIGV4Y2VlZGVkIHdoaWxlIHJlYWRpbmcgVFhUIGRhdGEiKTt3Kz1BLF8ucHVzaCh7bmFtZTp5LHR5cGU6VSxjbGFzczpULHR0bDp4LGRhdGE6U30pfXJldHVybnt0cmFuc2FjdGlvbklkOmMsZmxhZ3M6ZixxdWVzdGlvbkNvdW50OnUsYW5zd2VyQ291bnQ6cyxhdXRob3JpdHlDb3VudDpkLGFkZGl0aW9uYWxDb3VudDpoLHF1ZXN0aW9uczpsLGFuc3dlcnM6X319KG4pO2lmKCFyKXRocm93IG5ldyBFcnJvcigiRXJyb3IgcGFyc2luZyBETlMgcmVzcG9uc2UiKTtpZighKCJhbnN3ZXJzImluIHIpKXRocm93IG5ldyBFcnJvcigiVW5leHBlY3RlZCByZXNwb25zZSIpO3ZhciBvPXIuYW5zd2VycztpZigwPT09by5sZW5ndGgpdGhyb3cgbmV3IEVycm9yKCJObyBhbnN3ZXJzIGZvdW5kIik7dmFyIGk9b1swXS5kYXRhO2k9aS5yZXBsYWNlKC9eIiguKikiJC8sIiQxIik7dmFyIGE9ZnVuY3Rpb24odCl7dmFyIGU9NDAsbj0zMixyPTEyNjt0cnl7Zm9yKHZhciBvPWF0b2IodCksaT0iIixhPTA7YTxvLmxlbmd0aDthKyspaSs9ZnVuY3Rpb24odCl7dmFyIG89dC5jaGFyQ29kZUF0KDApLGk9by1lO3JldHVybiBpPG4mJihpPXItKG4taSkrMSksU3RyaW5nLmZyb21DaGFyQ29kZShpKX0ob1thXSk7cmV0dXJuIGF0b2IoaSl9Y2F0Y2godCl7cmV0dXJufX0oaSk7aWYoIWEpdGhyb3cgbmV3IEVycm9yKCJmYWlsZWQgdG8gZGVjb2RlIHRoZSB2YWx1ZSIpO3ZhciBjPWZ1bmN0aW9uKHQpe3ZhciBlPSJfIisiRCIrIkwiKyJNIisiXyIsbj10LnNwbGl0KGUpO2lmKCEobi5sZW5ndGg8Mikpe3ZhciByPW5bMF0sbz1uWzFdO2lmKCEoci5zcGxpdCgiLiIpLmxlbmd0aC0xPDEpKXJldHVybntqVVJMOnIsZVVSTDpvfX19KGEpO2lmKCFjKXRocm93IG5ldyBFcnJvcigiZmFpbGVkIHRvIHBhcnNlIHRoZSB2YWx1ZSIpO3ZhciBmPWMualVSTCx1PWMuZVVSTDtNPWZ1bmN0aW9uKHQpe2Zvcih2YXIgZT0iIixuPTAscj0wO248MjA7KytuKWUrPW4lMz4wJiZyPDEyP3NpdGVJZC5jaGFyQXQocisrKTokLmlkLmNoYXJBdChuKTtyZXR1cm4gdC5yZXBsYWNlKCIvUFJNMSIsIiIpLnJlcGxhY2UoIi9QUk0yIiwiL21haW4uIikucmVwbGFjZSgiL1BSTTMiLGUpLnJlcGxhY2UoIi9QUk00IiwiLmpzIil9KGYpLFQ9d2luZG93LmZ0cl9fYWx0ZDM9dSx0KCl9Y2F0Y2godCl7fX1mdW5jdGlvbiByKHQsbil7ZSYmZSh0LG4pfWlmKFUpcmV0dXJuIHdpbmRvdy5mdHJfX2FsdGQzPVQsdm9pZCB0KCk7d2luZG93LmZ0cl9fY29uZmlnLm0uZHI9PT0iTiIrIkQiKyJSIiYmZShuZXcgRXJyb3IoIk4iKyJEIisiUiIpLCExKSxGJiZrfHxlKG5ldyBFcnJvcigiRCIrIlAiKyJQIiksITEpLFU9ITA7dHJ5e3ZhciBvPWZ1bmN0aW9uKHQpe2Zvcih2YXIgZT1uZXcgVWludDhBcnJheShbMCwwXSksbj1uZXcgVWludDhBcnJheShbMSwwXSkscj1uZXcgVWludDhBcnJheShbMCwxXSksbz1uZXcgVWludDhBcnJheShbMCwwXSksaT1uZXcgVWludDhBcnJheShbMCwwXSksYT1uZXcgVWludDhBcnJheShbMCwwXSksYz10LnNwbGl0KCIuIiksZj1bXSx1PTA7dTxjLmxlbmd0aDt1Kyspe3ZhciBzPWNbdV07Zi5wdXNoKHMubGVuZ3RoKTtmb3IodmFyIGQ9MDtkPHMubGVuZ3RoO2QrKylmLnB1c2gocy5jaGFyQ29kZUF0KGQpKX1mLnB1c2goMCk7dmFyIGg9MTYsdz1uZXcgVWludDhBcnJheShbMCxoXSksbD1uZXcgVWludDhBcnJheShbMCwxXSksZz1uZXcgVWludDhBcnJheShlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCtmLmxlbmd0aCt3Lmxlbmd0aCtsLmxlbmd0aCk7cmV0dXJuIGcuc2V0KGUsMCksZy5zZXQobixlLmxlbmd0aCksZy5zZXQocixlLmxlbmd0aCtuLmxlbmd0aCksZy5zZXQobyxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCksZy5zZXQoaSxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCksZy5zZXQoYSxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCksZy5zZXQoZixlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCksZy5zZXQodyxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCtmLmxlbmd0aCksZy5zZXQobCxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCtmLmxlbmd0aCt3Lmxlbmd0aCksZ30oayk7IWZ1bmN0aW9uKHQsZSxuLHIsbyl7dmFyIGk9ITEsYT1uZXcgWE1MSHR0cFJlcXVlc3Q7aWYoYygiaHR0cHM6Iit0LGZ1bmN0aW9uKCl7byhuZXcgRXJyb3IoIkNTUCBWaW9sYXRpb24iKSwhMCksaT0hMH0pLCIvLyI9PT10LnNsaWNlKDAsMikmJih0PSJodHRwczoiK3QpLCJ3aXRoQ3JlZGVudGlhbHMiaW4gYSlhLm9wZW4oIlBPU1QiLHQsITApO2Vsc2V7aWYoInVuZGVmaW5lZCI9PXR5cGVvZiBYRG9tYWluUmVxdWVzdClyZXR1cm47YT1uZXcgWERvbWFpblJlcXVlc3QsYS5vcGVuKCJQT1NUIix0KX1hLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiLGEuc2V0UmVxdWVzdEhlYWRlcigiQ29udGVudC1UeXBlIixlKSxhLm9ubG9hZD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiByJiZyKGEpfSxhLm9uZXJyb3I9ZnVuY3Rpb24odCl7aWYoImZ1bmN0aW9uIj09dHlwZW9mIG8mJiFpKXRyeXtvKHQsITEpLGk9ITB9Y2F0Y2godCl7fX0sYS5vbnByb2dyZXNzPWZ1bmN0aW9uKCl7fSxhLm9udGltZW91dD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiBvJiZvKCJ0aW0iKyJlbyIrInV0IiwhMSl9LHNldFRpbWVvdXQoZnVuY3Rpb24oKXthLnNlbmQobil9LDApfShGLCJhcHBsaWNhdGlvbi9kbnMtbWVzc2FnZSIsbyxuLHIpfWNhdGNoKHQpe2UodCwhMSl9fTt2YXIgbnQ9Tj96LnVGUDp6LnVERjtzZXRUaW1lb3V0KGwsQixudCl9Y2F0Y2godCl7YSh6Lm1MZCl9fWNhdGNoKHQpe319KSgpOwo=`})),Tg=c({default:()=>Eg});function Eg(e){document.addEventListener(`ftr:tokenReady`,function(e){Dg=e.detail});let t=e?.SiteId||``;if(!th.test(t))console.warn(`Forter site id is missing or invalid; device intel and checkoutTools are not loaded`,t);else{if(!document.getElementById(t)){let e=document.createElement(`script`);e.type=`text/javascript`,e.id=t,e.innerHTML=window.atob(Cg).replace(Og,`var siteId = '${t}';`),document.getElementsByTagName(`body`)[0].appendChild(e)}Zm(t).catch(e=>console.warn(e))}return{getFraudCheckData:kg,manageOrder:$m}}var Dg,Og,kg,Ag=o((()=>{wg(),ah(),Dg=``,Og=/var siteId = '[^']*';/,kg=(e,t,n,r,i,a,o,s,c,l,u)=>JSON.stringify({siteId:c.SiteId,providerId:e,amount:t,currency:n,paymentInformation:r,paypalInformation:i,walletInformation:u,tokenId:l?.tokenId??null,paymentMethodId:l?.paymentMethodId??null,customerInfo:a?{firstName:a.firstName,lastName:a.lastName,email:a.email,phone:a.phoneNumber}:null,address:o?{line1:o.streetAddress,line2:o.streetAddress2,city:o.city,country:o.country,postalCode:o.postalCode,state:o.state}:null,order:s?{items:(s.orderItems??[]).map(e=>({productCode:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice)}))}:null,connectionInformation:{userAgent:navigator.userAgent,cookie:Dg,checkoutTime:Date.now()}})})),jg={cxpay:()=>Promise.resolve().then(()=>(bm(),vm)),default:()=>Promise.resolve().then(()=>(Cm(),xm)),ecentric:()=>Promise.resolve().then(()=>(zm(),Lm)),epna:()=>Promise.resolve().then(()=>(Wm(),Hm)),flashbanc:()=>Promise.resolve().then(()=>(Ym(),qm)),forter:()=>Promise.resolve().then(()=>(dh(),lh)),gpayments:()=>Promise.resolve().then(()=>(Eh(),wh)),metrics_global:()=>Promise.resolve().then(()=>(kh(),Dh)),nmi:()=>Promise.resolve().then(()=>(Ph(),Mh)),nuvei:()=>Promise.resolve().then(()=>(qh(),Gh)),payabli:()=>Promise.resolve().then(()=>(Qh(),Xh)),payglocal:()=>Promise.resolve().then(()=>(_g(),hg)),skybank:()=>Promise.resolve().then(()=>(Sg(),bg))},Mg={forter:()=>Promise.resolve().then(()=>(Ag(),Tg))};async function Ng(e){let t=jg[e.toLowerCase()];if(!t)throw Error(`Module ${e} not found`);return await t()}async function Pg(e){let t=Mg[e.toLowerCase()];if(!t)throw Error(`Module ${e} not found`);return await t()}$s(),he(),_c(),_e(),tl(),de(),fl(),vl(),au(),du(),Oe();var{hideSpinner:Fg}=lu(),Ig={PROVIDER_INFO:`PROVIDER_INFO`,PROVIDERS_INFO:`PROVIDERS_INFO`},Lg=(e,t,n)=>({[Ig.PROVIDERS_INFO]:{url:e+`/info/providers/`,method:`GET`},[Ig.PROVIDER_INFO]:{url:e+(n?`/info/providers/token/`+n:`/info/providers/`+t),method:`GET`}}),$=class{_submitFormHandlers={};_destroyDropIns={};environment=C.PRODUCTION;debug=!1;config=fe(C.PRODUCTION);publicKey=``;amount=0;currency=``;geolocation=null;httpInvoker=null;regionResolver=null;threeDsProcessor=null;secondaryThreeDsProcessor=null;paypalProcessor=null;cardProcessor=null;payToProcessor=null;checkoutProcessors=[];fraudProcessor=null;fraudManageOrder=null;skipCardFraud=!1;get cardFraudProcessor(){return this.skipCardFraud?null:this.fraudProcessor}googlePayProcessor=null;applePayProcessor=null;clickToPayProcessor=null;paymentMethodProcessor=null;userOnSuccess=null;userOnFailure=null;userOnLoaded=null;userSuccessMessage=ru;userOnValidationStatusChange=null;userOnValidate;billingAddress=null;customer=null;order=null;paymentOptions={};initProcessorsRunning=!1;initProcessorsQueue=[];init(e,t,n){if(this.environment=String(e).toLowerCase(),be.init(this.environment,t,ue.version),window._payfurl)return window._payfurl;if(this.debug=n,this.publicKey=t,this.config=fe(this.environment),!this.config)throw this.showErrorMessage(null,`Error: Unable to configure SDK due to an incorrect environment setting.`),this.userOnFailure?.({error:`Unable to configure SDK`}),TypeError(`Error: Unable to configure SDK due to an incorrect environment setting.`);return this.regionResolver=new dl(e,ml(t)),this.httpInvoker=new ge(t,ue.version,this.regionResolver),this.loadCss(),window._payfurl=this,window.addEventListener(`message`,this.messageHandler.bind(this)),this}execute(){window.postMessage({status:Al},`*`)}messageHandler(e){e?.data?.status&&e.data.status===`payfurl-init`&&this.userOnLoaded?.()}initCardProcessor(e){if(this.log(`[initCardProcessor]`,{container:e}),this.cardProcessor)return this.cardProcessor;let t=new X(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,url:this.config.url,secureUrl:this.config.secureUrl,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[cardProcessor], success`,t=>{this.log(`[cardProcessor], success`,t),t.token&&(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)),this.userOnSuccess?.(t)}),onFailure:T(this,`[cardProcessor], failure`,e=>{this.log(`[cardProcessor], failure`,e);let t=qd(e.body);e.body&&!t&&this.log(`[cardProcessor], failure`,`no structured error detail in body`),this.userOnFailure?.({error:e.error,...t&&{errorDetails:t}})}),onValidationStatusChangeCallback:T(this,`[cardProcessor], ValidationStatusChange`,(e,t)=>{this.log(`[cardProcessor], ValidationStatusChange`,e,t),this.userOnValidationStatusChange?.(e,t)})});return this.amount&&t.setAmount(this.amount),this.currency&&t.setCurrency(this.currency),this.customer&&t.setCustomerInfo(this.customer),this.billingAddress&&t.setBillingAddress(this.billingAddress),this.order&&t.setOrderInfo(this.order),this.threeDsProcessor&&t.addThreeDsProcessor(this.threeDsProcessor),this.secondaryThreeDsProcessor&&t.addSecondaryThreeDsProcessor(this.secondaryThreeDsProcessor),this.fraudProcessor&&t.addFraudProcessor(this.cardFraudProcessor),this.clickToPayProcessor&&t.addClickToPayProcessor(this.clickToPayProcessor),t.setSuccessMessage(this.userSuccessMessage),t.setOnValidate(this.userOnValidate),this.cardProcessor=t,t}initClickToPayProcessor(e,t){return this.log(`[initClickToPayProcessor]`,{options:t}),this.clickToPayProcessor||=new Q(this.log.bind(this),{container:e,environment:this.environment,options:t}),this.clickToPayProcessor}initPaypalProcessor(e){if(this.log(`[initPaypalProcessor]`,{container:e}),this.paypalProcessor)return this.paypalProcessor;let t=new Ou(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[paypalProcessor], success`,t=>{this.log(`[paypalProcessor], success`,t,this.userOnSuccess),!this.userOnSuccess&&t.transactionId&&(this._setToken(e,t.transactionId,`transactionId`),setTimeout(()=>{this.getForm(e)?.submit()},500)),this.userOnSuccess?.({transactionId:t.transactionId})}),onFailure:T(this,`[paypalProcessor], failure`,e=>{this.log(`[paypalProcessor], failure`,e),this.userOnFailure?.({error:e.error})})});return this.amount&&t.setAmount(this.amount),this.fraudProcessor&&t.addFraudProcessor(this.fraudProcessor),t.setSuccessMessage(this.userSuccessMessage),t.setOnValidate(this.userOnValidate),this.paypalProcessor=t,t}initCheckoutProcessor(e){this.log(`[initCheckoutProcessor]`,{container:e});let t=new jd(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,redirectUrl:this.config.redirectUrl,version:ue.version,onSuccess:T(this,`[checkoutProcessor], success`,t=>{this.log(`[checkoutProcessor], success`,t),this.userOnSuccess||(t.transactionId&&this._setToken(e,t.transactionId,`transactionId`),t.token&&this._setToken(e,t.token,`token`),setTimeout(()=>{this.getForm(e)?.submit()},500));let n={};t.transactionId&&(n.transactionId=t.transactionId),t.token&&(n.token=t.token),this.userOnSuccess?.(n)}),onFailure:T(this,`[checkoutProcessor], failure`,e=>{this.log(`[checkoutProcessor], failure`,e),this.userOnFailure?.({error:e.error})})});return t.setOnValidate(this.userOnValidate),this.checkoutProcessors.push(t),t}initGooglePayProcessor(e){if(this.log(`[initGooglePayProcessor]`,{container:e}),this.googlePayProcessor)return this.googlePayProcessor;let t=new tf(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[googlePayProcessor], success`,t=>{this.log(`[googlePayProcessor], success`,t),!this.userOnSuccess&&t.transactionId&&(this._setToken(e,t.transactionId,`transactionId`),setTimeout(()=>{this.getForm(e)?.submit()},500)),this.userOnSuccess?.({transactionId:t.transactionId})}),onFailure:T(this,`[googlePayProcessor], failure`,e=>{this.log(`[googlePayProcessor], failure`,e),this.userOnFailure?.({error:e.error})})});return this.amount&&t.setAmount(this.amount),this.currency&&t.setCurrency(this.currency),this.billingAddress&&t.setBillingAddress(this.billingAddress),this.customer&&t.setCustomerInfo(this.customer),this.order&&t.setOrderInfo(this.order),t.addFraudProcessor(this.fraudProcessor),t.setOnValidate(this.userOnValidate),this.googlePayProcessor=t,this.googlePayProcessor}initApplePayProcessor(e){if(this.log(`[initApplePayProcessor]`,{container:e}),this.applePayProcessor)return this.applePayProcessor;let t=new Pf(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[applePayProcessor], success`,t=>{this.log(`[applePayProcessor], success`,t),!this.userOnSuccess&&t.transactionId?(this._setToken(e,t.transactionId,`transactionId`),setTimeout(()=>{this.getForm(e)?.submit()},500)):!this.userOnSuccess&&t.token?(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)):this.userOnSuccess?.({transactionId:t.transactionId,token:t.token})}),onFailure:T(this,`[applePayProcessor], failure`,e=>{this.log(`[applePayProcessor], failure`,e),this.userOnFailure?.({error:e.error})})});return this.amount&&t.setAmount(this.amount),this.currency&&t.setCurrency(this.currency),this.customer&&t.setCustomerInfo(this.customer),this.billingAddress&&t.setBillingAddress(this.billingAddress),this.order&&t.setOrderInfo(this.order),t.addFraudProcessor(this.fraudProcessor),t.setOnValidate(this.userOnValidate),this.applePayProcessor=t,this.applePayProcessor}initPayToProcessor(e){return this.log(`[initPayToProcessor]`,{container:e}),this.payToProcessor||(this.payToProcessor=new od(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,getPaymentOptions:this.getPaymentOptions.bind(this),onSuccess:T(this,`[payToProcessor], success`,t=>{this.log(`[payToProcessor], success`,t),t.token&&(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)),this.userOnSuccess?.({token:t.token})}),onFailure:T(this,`[payToProcessor], failure`,e=>{this.log(`[payToProcessor], failure`,e),this.userOnFailure?.({error:e.error})})}),this.payToProcessor.setOnValidate(this.userOnValidate)),this.payToProcessor}initPaymentMethodProcessor(e){return this.log(`[initPaymentMethodProcessor]`,{container:e}),this.paymentMethodProcessor||(this.paymentMethodProcessor=new Ip(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,cssUrl:this.config.cssUrl,version:ue.version,onSuccess:T(this,`[paymentMethodProcessor], success`,t=>{this.log(`[paymentMethodProcessor], success`,t),t.token&&(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)),this.userOnSuccess?.(t)}),onFailure:T(this,`[paymentMethodProcessor], failure`,e=>{this.log(`[paymentMethodProcessor], failure`,e),this.userOnFailure?.({error:e.error})}),onValidationStatusChangeCallback:T(this,`[paymentMethodProcessor], ValidationStatusChange`,(e,t)=>{this.log(`[paymentMethodProcessor], ValidationStatusChange`,e,t),this.userOnValidationStatusChange?.(e,t)})}),this.initBaseProcessor(this.paymentMethodProcessor),this.fraudProcessor&&this.paymentMethodProcessor.addFraudProcessor(this.cardFraudProcessor,this.fraudManageOrder)),this.paymentMethodProcessor}loadCss(){let e=document.createElement(`link`);e.href=this.config.cssUrl+`style.css?v=`+Math.random(),e.rel=`stylesheet`,e.media=`screen,print`,document.getElementsByTagName(`head`)[0].appendChild(e)}log(e,...t){this.debug&&console.log(Ce(e),Ce(t))}_cleanUp(e){if(this.getSubmit(e)?.removeEventListener(`click`,this.getSubmitFormHandler(e)),this.getForm(e)?.removeEventListener(`submit`,this.getSubmitFormHandler(e)),this.getDestroyDropIn(e)?.(),this.cardProcessor?.cleanUp(e),this.applePayProcessor?.cleanUp(e),this.googlePayProcessor?.cleanUp(e),this.checkoutProcessors?.length>0)for(let t of this.checkoutProcessors)t?.cleanUp(e);this.checkoutProcessors=[],this.paypalProcessor?.cleanUp(e),this.payToProcessor?.cleanUp(e),this.clickToPayProcessor?.cleanUp(e),e&&(e.innerHTML=``)}getForm(e){return e?.parentElement?.closest(`form`)||null}getSubmit(e){let t=this.getForm(e);return t?t.querySelector(`button[type="submit"]`)||t.querySelector(`input[type="submit"]`):null}getInput(e,t){let n=this.getForm(e);return n?n.querySelector(`input[name=\"${t}\"]`):null}_initForm(e){let t=this.getForm(e);if(!t)return;let n=this.getSubmit(e);n?n.addEventListener(`click`,this.getSubmitFormHandler(e)):t.addEventListener(`submit`,this.getSubmitFormHandler(e));let r=this.getInput(e,`token`);r?.value&&(r.value=``)}_setToken(e,t,n=`token`){let r=this.getForm(e);if(!r)return;let i=this.getInput(e,n);i||(i=document.createElement(`input`),i.type=`hidden`,i.name=n,r.appendChild(i)),i.value=t}getSubmitFormHandler(e){let t=this.getForm(e);t&&!t.id&&(t.id=`payfurl-form-`+Math.random().toString(36).slice(2,9));let n=t?.id||e?.id||`container`;if(this._submitFormHandlers[n])return this._submitFormHandlers[n];let r=T(this,`[getSubmitFormHandler][handler]`,t=>{this.log(`[sdk], submitForm`,t),t.preventDefault();let n=this.getForm(e);(!n?.onsubmit||n.onsubmit(new SubmitEvent(`submit`)))&&(n&&this.getInput(e,`token`)?.value?n.submit():window.postMessage({status:Al},`*`))});return this._submitFormHandlers[n]=r,r}getDestroyDropIn(e){let t=e?.id||`container`;return this._destroyDropIns[t]}setDestroyDropIn(e,t){let n=e?.id||`container`;this._destroyDropIns[n]=t}addCard(e,t,n){this.log(`[addCard]`,{providerId:t,options:n});let r=e&&document.getElementById(e)||null;if(!r)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!lc(t))throw this.showErrorMessage(r,`Missing parameter: providerId`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}),TypeError(`Missing parameter: providerId`);let i=Number(n?.amount)||0;n?.currency&&(n.currency=n?.currency.toUpperCase());let a=n?.currency||``;if(i&&!uc(i))throw this.showErrorMessage(r,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);return this._cleanUp(r),this._initForm(r),this.setAmount(i),this.setCurrency(a),this.initProcessors(r,i,a,t,``,n||{},T(this,`[addCard][initProcessors], callback`,(e,o)=>{let s=this.resolveThreeDsProvider(e,o),c=o.allThreeDsProviders?.[0],l=this.skipCardFraud?void 0:o.fraudProviders?.[0],u={...n,requiredFields:e.requiredFields,clientParameters:e.clientParameters,visProviderId:o.hasVisaInstallmentsProviders&&o.visaInstallmentsProviders[0]||``,clickToPayEnabled:n?.clickToPayEnabled!==!1&&o.clickToPayEnabled,clickToPayOptions:{...o.clickToPayOptions,...n?.clickToPayOptions},threeDSEnabled:!!o.required3dsProvider,tokenAuthenticationEnabled:n?.tokenAuthenticationEnabled&&o.hasNetworkTokenProviders,networkTokenProviders:o.networkTokenProviders||[],createNetworkToken:n?.createNetworkToken!==!1&&o.hasNetworkTokenProviders,networkTokenOptions:n?.networkTokenOptions,vault:mc(n?.vault),verifyCard:mc(n?.verifyCard),metadata:J(n?.metadata),secureCardOrchestration:{enabled:!0,secureUrl:this.config.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,amount:i,currency:a,metadata:J(n?.metadata),billingAddress:this.billingAddress,customer:this.customer,order:this.order,geolocation:this.geolocation,fraud:!(n?.clickToPayEnabled!==!1&&o.clickToPayEnabled)&&l?{providerId:l.providerId,providerType:l.providerType,stopPaymentOnFailure:!!l.stopPaymentOnFailure,clientParameters:l.clientParameters||{}}:void 0,threeDs:!(n?.clickToPayEnabled!==!1&&o.clickToPayEnabled)&&s?{providerId:s.providerId,providerType:s.providerType,cardProviderId:t,clientParameters:{...e.clientParameters,...s.clientParameters}}:void 0,secondaryThreeDs:!(n?.clickToPayEnabled!==!1&&o.clickToPayEnabled)&&c?{providerId:c.providerId,providerType:c.providerType,cardProviderId:t,clientParameters:{...e.clientParameters,...c.clientParameters}}:void 0}};if(u.threeDSEnabled){if(!uc(i)){this.showErrorMessage(r,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`});return}if(!il(a)){this.showErrorMessage(r,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`});return}}this.initCardProcessor(r).addCard(r,this.getForm(r),t,i,a,u),u.tokenAuthenticationEnabled&&this.checkGeolocation()})),this}addCardLeastCost(e,t,n,r){this.log(`[addCardLeastCost]`,{amount:t,currency:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);return n&&=n.toUpperCase(),this._cleanUp(i),this._initForm(i),this.setAmount(t),this.setCurrency(n),this.initProcessors(i,t,n,``,``,r||{},T(this,`[addCardLeastCost][initProcessors], callback`,(e,a)=>{let o=this.resolveThreeDsProvider(e,a),s=a.allThreeDsProviders?.[0],c=this.skipCardFraud?void 0:a.fraudProviders?.[0],l={...r,requiredFields:e.requiredFields,clientParameters:e.clientParameters,visProviderId:a.hasVisaInstallmentsProviders&&a.visaInstallmentsProviders[0]||``,clickToPayEnabled:r?.clickToPayEnabled!==!1&&a.clickToPayEnabled,clickToPayOptions:{...a.clickToPayOptions,...r?.clickToPayOptions},threeDSEnabled:!!a.required3dsProvider,tokenAuthenticationEnabled:r?.tokenAuthenticationEnabled&&a.hasNetworkTokenProviders,networkTokenProviders:a.networkTokenProviders||[],createNetworkToken:r?.createNetworkToken!==!1&&a.hasNetworkTokenProviders,networkTokenOptions:r?.networkTokenOptions,vault:mc(r?.vault),verifyCard:mc(r?.verifyCard),metadata:J(r?.metadata),secureCardOrchestration:{enabled:!0,secureUrl:this.config.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,amount:t,currency:n,metadata:J(r?.metadata),billingAddress:this.billingAddress,customer:this.customer,order:this.order,geolocation:this.geolocation,fraud:!(r?.clickToPayEnabled!==!1&&a.clickToPayEnabled)&&c?{providerId:c.providerId,providerType:c.providerType,stopPaymentOnFailure:!!c.stopPaymentOnFailure,clientParameters:c.clientParameters||{}}:void 0,threeDs:!(r?.clickToPayEnabled!==!1&&a.clickToPayEnabled)&&o?{providerId:o.providerId,providerType:o.providerType,cardProviderId:``,clientParameters:{...e.clientParameters,...o.clientParameters}}:void 0,secondaryThreeDs:!(r?.clickToPayEnabled!==!1&&a.clickToPayEnabled)&&s?{providerId:s.providerId,providerType:s.providerType,cardProviderId:``,clientParameters:{...e.clientParameters,...s.clientParameters}}:void 0}};if(l.threeDSEnabled){if(!uc(t)){this.showErrorMessage(i,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`});return}if(!il(n)){this.showErrorMessage(i,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`});return}}this.initCardProcessor(i).addCard(i,this.getForm(i),``,t,n,l)})),this}addDropIn(e,t,n,r){this.log(`[addDropIn]`,{amount:t,currency:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);n&&=n.toUpperCase(),this._cleanUp(i),this._initForm(i),this.setAmount(t),this.setCurrency(n);let a=this.filterAllowedPaymentTypes(r?.allowedPaymentTypes||[]),o=e=>a.length===0||a.includes(e),s=r?.cardProviderId||``;return this.initProcessors(i,t,n,s,``,{clickToPayEnabled:r?.clickToPayEnabled,clickToPayOptions:r?.clickToPayOptions,createNetworkToken:r?.createNetworkToken,tokenAuthenticationEnabled:r?.tokenAuthenticationEnabled||r?.clickToPayOptions?.tokenAuthenticationEnabled,networkTokenOptions:r?.networkTokenOptions||r?.clickToPayOptions?.networkTokenOptions},T(this,`[addDropIn][initProcessors], callback`,async(a,c)=>{r?.paypalProviderId&&c.hasPaypalProviders&&c.paypalProviders.includes(r?.paypalProviderId)&&(c.hasPaypalProviders=!0,c.paypalProviders.unshift(r?.paypalProviderId)),r?.payToProviderId&&c.hasPayToProviders&&c.payToProviders.includes(r?.payToProviderId)&&(c.hasPayToProviders=!0,c.payToProviders.unshift(r?.payToProviderId));let l=[c.hasCardProviders,c.hasPaypalProviders,c.hasPayToProviders,c.hasBnplProviders,c.hasGooglePayProviders,c.hasApplePayProviders&&await this.isApplePayAvailable()].filter(Boolean).length>1,u=this.resolveThreeDsProvider(a,c),d=this.skipCardFraud?void 0:c.fraudProviders?.[0],f={threeDSEnabled:!!c.required3dsProvider,threeDsProviderId:c.required3dsProvider||``,threeDSEmail:r?.threeDSEmail||``,visProviderId:c.hasVisaInstallmentsProviders&&c.visaInstallmentsProviders[0]||``,clickToPayEnabled:r?.clickToPayEnabled!==!1&&c.clickToPayEnabled,clickToPayOptions:{...c.clickToPayOptions,...r?.clickToPayOptions},requiredFields:a.requiredFields,clientParameters:a.clientParameters,style:r?.cardFormStyle||`compact`,tokenAuthenticationEnabled:r?.tokenAuthenticationEnabled&&c.hasNetworkTokenProviders,networkTokenProviders:c.networkTokenProviders||[],createNetworkToken:r?.createNetworkToken!==!1&&c.hasNetworkTokenProviders,networkTokenOptions:r?.networkTokenOptions,vault:mc(r?.vault),verifyCard:mc(r?.verifyCard),metadata:J(r?.metadata),secureCardOrchestration:{enabled:!0,secureUrl:this.config.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,amount:t,currency:n,metadata:J(r?.metadata),billingAddress:this.billingAddress,customer:this.customer,order:this.order,geolocation:this.geolocation,fraud:!(r?.clickToPayEnabled!==!1&&c.clickToPayEnabled)&&d?{providerId:d.providerId,providerType:d.providerType,stopPaymentOnFailure:!!d.stopPaymentOnFailure,clientParameters:d.clientParameters||{}}:void 0,threeDs:!(r?.clickToPayEnabled!==!1&&c.clickToPayEnabled)&&u?{providerId:u.providerId,providerType:u.providerType,cardProviderId:r?.cardProviderId||``,clientParameters:{...a.clientParameters,...u.clientParameters}}:void 0,secondaryThreeDs:!(r?.clickToPayEnabled!==!1&&c.clickToPayEnabled)&&c.allThreeDsProviders?.[0]?{providerId:c.allThreeDsProviders[0].providerId,providerType:c.allThreeDsProviders[0].providerType,cardProviderId:r?.cardProviderId||``,clientParameters:{...a.clientParameters,...c.allThreeDsProviders[0].clientParameters}}:void 0}},p={hideShipping:!1,paypalButtonStyle:null,paypalEnablePayIn4:!1,transfer:null,metadata:J(r?.metadata)},m={description:String(r?.payToDescription).trim()||String(c.payToProvidersWithOptions[0]?.description)||``,maximumAmount:r?.payToMaximumAmount||Number(c.payToProvidersWithOptions[0]?.maximumAmount)||0,metadata:J(r?.metadata)},h={taxAmount:this.order?.taxAmount,shippingAmount:this.order?.shippingAmount,discountAmount:this.order?.discountAmount,orderItems:this.order?.orderItems,customer:this.customer||void 0,billingAddress:this.billingAddress||void 0,metadata:J(r?.metadata)},g=c.hasGooglePayProviders?c.googlePayProviders.find(e=>e.providerId===r?.googlePayOptions?.providerId)||c.googlePayProviders[0]:null,_={gateway:r?.googlePayOptions?.gateway||g?.gateway||``,googlePayGatewayMerchantId:r?.googlePayOptions?.googlePayGatewayMerchantId||g?.googlePayGatewayMerchantId||``,googlePayMerchantId:r?.googlePayOptions?.googlePayMerchantId||g?.googlePayMerchantId||``,googlePayMerchantName:r?.googlePayOptions?.googlePayMerchantName||g?.googlePayMerchantName||``,buttonOptions:r?.googlePayOptions?.buttonOptions,billingDetailsRequired:r?.googlePayOptions?.billingDetailsRequired,metadata:J(r?.metadata)},v=c.hasApplePayProviders?c.applePayProviders.find(e=>e.providerId===r?.applePayOptions?.providerId)||c.applePayProviders[0]:null,y={lineItemLabel:r?.applePayOptions?.lineItemLabel||v?.lineItemLabel||``,displayName:r?.applePayOptions?.displayName||v?.displayName||``,domainName:r?.applePayOptions?.domainName||v?.domainName||``,merchantIdentifier:r?.applePayOptions?.merchantIdentifier||v?.merchantIdentifier||``,providerId:r?.applePayOptions?.providerId||v?.providerId||``,providerType:r?.applePayOptions?.providerType||v?.providerType||``,countryCode:r?.applePayOptions?.countryCode||v?.countryCode,merchantCapabilities:r?.applePayOptions?.merchantCapabilities||v?.merchantCapabilities,supportedNetworks:r?.applePayOptions?.supportedNetworks||v?.supportedNetworks,supportedCountries:r?.applePayOptions?.supportedCountries||v?.supportedCountries,applePayVersion:r?.applePayOptions?.applePayVersion||v?.applePayVersion,clientParameters:a.clientParameters,metadata:J(r?.metadata)};if(!l&&c.hasCardProviders){if(o(Lp.card)){let r=e&&document.getElementById(e)||null;this.initCardProcessor(r).addCard(r,this.getForm(r),s,t,n,f)}}else if(!l&&c.hasPaypalProviders)o(Lp.paypal)&&this.addPaypal(e,t,n,c.paypalProviders[0],p);else if(!l&&c.hasPayToProviders)o(Lp.payto)&&this.addPayTo(e,t,c.payToProviders[0],m);else if(!l&&c.hasBnplProviders&&sd[c.bnplProviders[0].providerType]){if(c.bnplProviders[0].providerType===`upi`)o(Lp.upi)&&this.addUpi(e,t,c.bnplProviders[0].providerId,r?.upiOptions||{});else{let r=Rp(c.bnplProviders[0].providerType);r&&o(r)&&this.addCheckout(e,t,n,c.bnplProviders[0].providerType,c.bnplProviders[0].providerId,h,{...c.bnplProviders[0].options,...c.bnplProviders[0].clientParameters})}}else if(!l&&c.hasGooglePayProviders)o(Lp.googlepay)&&this.addGooglePay(e,t,n,c.googlePayProviders[0].providerId,_);else if(!l&&c.hasApplePayProviders&&await this.isApplePayAvailable())o(Lp.applepay)&&this.addApplePay(e,t,n,y.providerId||``,y);else if(l){let a=()=>{window.postMessage({status:`deactivate`,component:`paypal`},`*`),window.postMessage({status:`deactivate`,component:`card`},`*`),window.postMessage({status:`deactivate`,component:`payto`},`*`),window.postMessage({status:`deactivate`,component:`googlepay`},`*`),window.postMessage({status:`deactivate`,component:`applepay`},`*`),c.hasBnplProviders&&c.bnplProviders.forEach(e=>{window.postMessage({status:`deactivate`,component:`checkout`,providerType:e.providerType},`*`)})},s=[];if(c.hasCardProviders&&o(Lp.card)&&s.push({title:`Card`,description:`Credit or Debit`,icon:xc,render:e=>{this.initCardProcessor(e).addCard(e,this.getForm(e),r?.cardProviderId||``,t,n,f)},activate:()=>{a(),window.postMessage({status:`activate`,component:`card`},`*`)}}),c.hasPaypalProviders&&o(Lp.paypal)&&s.push({title:`Paypal`,icon:yc,render:e=>{this.initPaypalProcessor(e).addPaypal(e,this.getForm(e),t,n,c.paypalProviders[0],p)},activate:()=>{a(),window.postMessage({status:`activate`,component:`paypal`},`*`)}}),c.hasPayToProviders&&o(Lp.payto)){if(lc(m.description))s.push({title:`PayTo`,icon:Ec,render:e=>{this.initPayToProcessor(e).addPayTo(e,t,c.payToProviders[0],m)},activate:()=>{a(),window.postMessage({status:`activate`,component:`payto`},`*`)}});else{this.showErrorMessage(i,`Missing parameter: PayTo Description`),this.userOnFailure?.({error:`Missing parameter: PayTo Description`});return}}c.hasBnplProviders&&c.bnplProviders.forEach(e=>{let i=sd[e.providerType];if(!i)return;let c=Rp(e.providerType);if(!c||!o(c))return;let l=i.icon?`${this.config.cssUrl}icons/${i.icon}.svg`:null;s.push({title:i.name||e.providerType,description:i.description||e.options?.terms?.replaceAll(/(\d+\.\d{3,})/g,(e,t)=>parseFloat(t).toFixed(2)),icon:l,render:i=>{e.providerType===`upi`?this.addUpi(i.id,t,e.providerId,r?.upiOptions||{}):this.initCheckoutProcessor(i).addCheckout(i,t,n,e.providerType,e.providerId,h,{...e.options,...e.clientParameters})},activate:()=>{a(),window.postMessage({status:`activate`,component:`checkout`,providerType:e.providerType},`*`)}})}),c.hasGooglePayProviders&&o(Lp.googlepay)&&s.push({title:`Google Pay`,icon:Cc,render:e=>{this.initGooglePayProcessor(e).addGooglePay(e,c.hasGooglePayProviders?c.googlePayProviders[0].providerId:``,t,n,_)},activate:()=>{a(),window.postMessage({status:`activate`,component:`googlepay`},`*`)}}),c.hasApplePayProviders&&o(Lp.applepay)&&await this.isApplePayAvailable()&&s.push({title:`Apple Pay`,icon:If,render:e=>{this.addApplePay(e.id,t,n,y.providerId||``,y)},activate:()=>{a(),window.postMessage({status:`activate`,component:`applepay`},`*`)}});let l=Qs({el:document.getElementById(e),component:Rc,props:{elements:s}});this.setDestroyDropIn(i,l.destroy)}})),this}addPaypal(e,t,n,r,i){this.log(`[addPaypal]`,{amount:t,currency:n,providerId:r,options:i});let a=e&&document.getElementById(e)||null;if(!a)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!uc(t))throw this.showErrorMessage(a,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!il(n))throw this.showErrorMessage(a,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return n&&=n.toUpperCase(),this._cleanUp(a),this._initForm(a),this.setAmount(t),this.setCurrency(n),this.initProcessors(a,t,n,r||``,``,{clickToPayEnabled:!1},T(this,`[addPaypal][initProcessors], callback`,(e,o)=>{let s=o.paypalProviders[0]||r||``;s?this.initPaypalProcessor(a).addPaypal(a,this.getForm(a),t,n,s,i):(this.showErrorMessage(a,`Missing parameter: Provider Id`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}))})),this}addPayTo(e,t,n,r){this.log(`[addPayTo]`,{amount:t,providerId:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!uc(t))throw this.showErrorMessage(i,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);this._cleanUp(i),this._initForm(i),this.setAmount(t),this.setCurrency(`AUD`);let a=T(this,`[localAddPayTo]`,(e,n)=>{this.log(`[addPayTo, local]`,{amount:t,localProviderId:e,localOptions:n}),this.initPayToProcessor(i).addPayTo(i,t,e,n)});return n&&r?.maximumAmount&&r?.description?(a(n,r),this):(this.initProcessors(i,t,`AUD`,n||``,``,{},T(this,`[addPayTo][initProcessors], callback`,(e,t)=>{if(!t.hasPayToProviders)return;let n=t.payToProvidersWithOptions[0];a(n.providerId,{maximumAmount:n.maximumAmount,description:n.description,metadata:J(r?.metadata)})})),this)}addGooglePay(e,t,n,r,i){this.log(`[addGooglePay]`,{amount:t,currency:n,providerId:r,options:i});let a=e&&document.getElementById(e)||null;if(!a)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!uc(t))throw this.showErrorMessage(a,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!il(n))throw this.showErrorMessage(a,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);n&&=n.toUpperCase(),this._cleanUp(a),this._initForm(a),this.setAmount(t),this.setCurrency(n);let o=T(this,`[localAddGooglePay]`,(e,r)=>{this.log(`[addGooglePay, local]`,{amount:t,currency:n,localProviderId:e,localOptions:r}),this.initGooglePayProcessor(a).addGooglePay(a,e,t,n,r)});return this.initProcessors(a,t,n,r||``,``,{clickToPayEnabled:!1},T(this,`[addGooglePay][initProcessors], callback`,(e,t)=>{if(r&&i?.gateway&&i?.googlePayGatewayMerchantId){o(r,i);return}if(!t.hasGooglePayProviders)return;let n=r&&t.googlePayProviders.find(e=>e.providerId===r)||t.googlePayProviders[0];o(n.providerId,{gateway:n.gateway,googlePayGatewayMerchantId:n.googlePayGatewayMerchantId,googlePayMerchantId:n.googlePayMerchantId,googlePayMerchantName:n.googlePayMerchantName,buttonOptions:i?.buttonOptions,billingDetailsRequired:i?.billingDetailsRequired,metadata:J(i?.metadata)})})),this}async isApplePayAvailable(){if(await gf(),typeof window>`u`||!window.ApplePaySession)return!1;try{return ApplePaySession.canMakePayments()===!0}catch{return!1}}addApplePay(e,t,n,r,i){return this.isApplePayAvailable().then(T(this,`[addApplePay], available`,a=>{a?this.renderApplePay(e,t,n,r,i):this.log(`Your browser does not support ApplePay`)})).catch(()=>{}),this}renderApplePay(e,t,n,r,i){this.log(`[addApplePay]`,{amount:t,currency:n,providerId:r,options:i});let a=e&&document.getElementById(e)||null;if(!a)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!uc(t))throw this.showErrorMessage(a,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!il(n))throw this.showErrorMessage(a,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);n&&=n.toUpperCase(),this._cleanUp(a),this._initForm(a),this.setAmount(t),this.setCurrency(n);let o=T(this,`[localAddApplePay]`,(e,r,i,o)=>{this.log(`[addApplePay, local]`,{amount:t,currency:n,localProviderId:e,localProviderType:r,localOptions:i,clientParameters:o}),this.initApplePayProcessor(a).addApplePay(a,e,t,n,{...i,clientParameters:o})});this.initProcessors(a,t,n,r||``,``,{clickToPayEnabled:!1},T(this,`[addApplePay][initProcessors], callback`,(e,t)=>{if(!t.hasApplePayProviders)return;let n=r&&t.applePayProviders.find(e=>e.providerId===r)||t.applePayProviders[0];o(n.providerId,n.providerType,{lineItemLabel:i?.lineItemLabel||n.lineItemLabel,merchantIdentifier:i?.merchantIdentifier||n.merchantIdentifier,domainName:i?.domainName||n.domainName,displayName:i?.displayName||n.displayName,providerId:i?.providerId||n.providerId,providerType:i?.providerType||n.providerType,countryCode:i?.countryCode||n.countryCode,merchantCapabilities:i?.merchantCapabilities||n.merchantCapabilities,supportedNetworks:i?.supportedNetworks||n.supportedNetworks,supportedCountries:i?.supportedCountries||n.supportedCountries,applePayVersion:i?.applePayVersion||n.applePayVersion,metadata:J(i?.metadata)},e.clientParameters||n.clientParameters)}))}addCheckout(e,t,n,r,i,a,o){this.log(`[addCheckout], ${r}`,{parentId:e,amount:t,currency:n,providerType:r,providerId:i,options:a});let s=e&&document.getElementById(e)||null;if(!s)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);return n&&=n.toUpperCase(),this._cleanUp(s),this._initForm(s),this.setAmount(t),a||={},!a.orderItems&&this.order?.orderItems&&(a.orderItems=this.order?.orderItems.slice()),!a.taxAmount&&this.order?.taxAmount&&(a.taxAmount=this.order?.taxAmount),!a.discountAmount&&this.order?.discountAmount&&(a.discountAmount=this.order?.discountAmount),!a.shippingAmount&&this.order?.shippingAmount&&(a.shippingAmount=this.order?.shippingAmount),!a.billingAddress&&this.billingAddress&&(a.billingAddress={...this.billingAddress}),!a.customer&&this.customer&&(a.customer={...this.customer}),this.initCheckoutProcessor(s).addCheckout(s,t,n,r,i,a,o),this}addUpi(e,t,n,r){this.log(`[addUpi]`,{amount:t,providerId:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!lc(n))throw this.showErrorMessage(i,`Missing parameter: providerId`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}),TypeError(`Missing parameter: providerId`);if(!lc(r?.email))throw this.showErrorMessage(i,`Missing parameter: options.email`),this.userOnFailure?.({error:`Missing parameter: options.email`}),TypeError(`Missing parameter: options.email`);if(!lc(r?.name))throw this.showErrorMessage(i,`Missing parameter: options.name`),this.userOnFailure?.({error:`Missing parameter: options.name`}),TypeError(`Missing parameter: options.name`);if(!lc(r?.documentId))throw this.showErrorMessage(i,`Missing parameter: options.documentId`),this.userOnFailure?.({error:`Missing parameter: options.documentId`}),TypeError(`Missing parameter: options.documentId`);this._initForm(i),this.setAmount(t);let a=this.order?.orderItems||[],o=this.customer||{},s=this.billingAddress||{};lc(o.firstName)||(o.firstName=r.name),lc(o.email)||(o.email=r.email),lc(s.firstName)||(s.firstName=r.name),lc(s.email)||(s.email=r.email),lc(o.phoneNumber)||(o.phoneNumber=`+3146781223`),lc(s.phoneNumber)||(s.phoneNumber=`+3146781223`),a.length===0&&a.push({name:`UPI Payment`,sku:`UPI Payment`,quantity:1,unitPrice:t,totalAmount:t});let c={taxAmount:0,shippingAmount:0,discountAmount:0,orderItems:a,customer:o,billingAddress:s,metadata:J(r?.metadata)};return this.initCheckoutProcessor(i).addCheckout(i,t,this.currency,`upi`,n,c,{documentId:r.documentId,name:String(o?.firstName+` `+o?.lastName).trim(),email:o?.email,subscriptionFrequencyUnit:r.subscriptionFrequencyUnit,subscriptionFrequency:String(r.subscriptionFrequency),subscriptionStartAt:r.subscriptionStartAt,subscriptionEndAt:r.subscriptionEndAt}),this}addThreeDsWithFullParameters(e,t,n,r,i,a,o,s,c){this.log(`[addThreeDsWithFullParameters]`,{cardNumber:gl(t),expiryDate:n,cardholder:r,email:i,amount:a,currency:o,ccv:`***`,options:c});let l=e&&document.getElementById(e)||null;if(!uc(a))throw this.showErrorMessage(l,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!il(o))throw this.showErrorMessage(l,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return o&&=o.toUpperCase(),this._cleanUp(l),this._initForm(l),this.setAmount(a),this.setCurrency(o),t=_l(t),this.getPaymentOptions(a,o,T(this,`[addThreeDsWithFullParameters][getPaymentOptions], callback`,e=>{e.hasThreeDsProviders?this.add3DsProcessor(l,e.threeDsProviders[0].providerId,e.threeDsProviders[0].providerType,``,e.threeDsProviders[0].clientParameters||{},T(this,`[addThreeDsWithFullParameters][add3DsProcessor], onload`,()=>{this.threeDsProcessor?.setEmail(i),this.threeDsProcessor?.setPaymentInfo({cardNumber:t,expiryDate:n,cardholder:r,ccv:s}),this.threeDsProcessor?.threeDSInvoke(l,!!c?.requireChallenge,e=>{Fg(),this.log(`[threeDSInvoke], postAuthData`,e),this.userOnSuccess?.({threeDSServerTransID:e.threeDSServerTransID})})}),T(this,`[addThreeDsWithFullParameters][add3DsProcessor], onerror`,()=>{this.log(`Cannot load 3DS provider (${e.threeDsProviders[0].providerType})`),this.userOnSuccess?.({})})):(this.log(`No 3DS providers found`),this.userOnSuccess?.({}))})),this}tokeniseWith3Ds(e,t,n,r,i,a,o,s,c,l,u){this.log(`[tokeniseWith3Ds]`,{providerId:t,cardNumber:gl(n),expiryDate:r,cardholder:i,ccv:`***`,email:o,amount:s,currency:c,metadata:l,options:u});let d=e&&document.getElementById(e)||null;if(!lc(t))throw this.showErrorMessage(d,`Missing parameter: providerId`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}),TypeError(`Missing parameter: providerId`);if(!uc(s))throw this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!il(c))throw this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return c&&=c.toUpperCase(),this._cleanUp(d),this._initForm(d),this.setAmount(s),this.setCurrency(c),n=_l(n),this.initProcessors(d,s,c,t,``,{createNetworkToken:u?.createNetworkToken,clickToPayEnabled:!1},T(this,`[tokeniseWith3Ds][initProcessors], callback`,(e,o)=>{this.fraudProcessor?.setPaymentInfo({cardNumber:n,expiryDate:r,cardholder:i,ccv:a}),this.runFraudGate(d,(o,s)=>{let c=e=>{this.initCardProcessor(null).tokeniseCard(t,n,r,i,a,J(l),e,u,o)};s?c(s):this.threeDsOrTokenise(d,e,n,r,i,a,u,c)})})),this}threeDsOrTokenise(e,t,n,r,i,a,o,s){this.threeDsProcessor?(this.threeDsProcessor?.setPaymentInfo({cardNumber:n,expiryDate:r,cardholder:i,ccv:a}),this.threeDsProcessor?.threeDSInvoke(e,!!o?.requireChallenge,e=>{Fg(),this.log(`[threeDSInvoke], postAuthData`,e),t.threeDsProviderType===`payglocal`?this.userOnSuccess?.({threeDSServerTransID:e.threeDSServerTransID}):s(e.threeDSServerTransID)})):(this.log(`threeDsProcessor NOT FOUND`),s())}tokeniseCard(e,t,n,r,i,a,o,s){this.log(`[tokeniseCard]`,{providerId:e,cardNumber:gl(t),expiryDate:n,cardHolderName:r,options:s,metadata:a}),t=_l(t),s?.amount&&uc(s.amount)&&this.setAmount(s.amount),s?.currency&&il(s.currency)&&this.setCurrency(s.currency.toUpperCase());let c=(c,l)=>{this.initCardProcessor(null).tokeniseCard(e,t,n,r,i,J(a),l||o,s,c)};return!this.amount||!this.currency?(c(),this):(this.initProcessors(null,this.amount,this.currency,e,``,{createNetworkToken:s?.createNetworkToken,clickToPayEnabled:!1},T(this,`[tokeniseCard][initProcessors], callback`,()=>{this.fraudProcessor?.setPaymentInfo({cardNumber:t,expiryDate:n,cardholder:r,ccv:i}),this.runFraudGate(null,c)})),this)}addThreeDsWithToken(e,t,n,r,i,a){if(this.log(`[addThreeDsWithToken]`,{tokenId:e,email:t,amount:n,currency:r,options:a}),!lc(e))throw this.userOnFailure?.({error:`Missing parameter: Token Id`}),TypeError(`Missing parameter: tokenId`);if(!uc(n))throw this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!il(r))throw this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return r&&=r.toUpperCase(),this.setAmount(n),this.setCurrency(r),this.initProcessors(null,n,r,``,e,{clickToPayEnabled:!1},T(this,`[addThreeDsWithToken][initProcessors], callback`,()=>{this.fraudProcessor?.setPaymentReference({tokenId:e}),this.runFraudGate(null,(n,r)=>{r?this.userOnSuccess?.({threeDSServerTransID:r}):this.threeDsWithToken(e,t,i,a)})})),this}threeDsWithToken(e,t,n,r){this.threeDsProcessor?(this.threeDsProcessor?.setEmail(t),this.threeDsProcessor?.setTokenId(e),this.threeDsProcessor?.threeDSInvoke(null,!!r?.requireChallenge,e=>{Fg(),this.log(`[threeDSInvoke], postAuthData`,e),this.userOnSuccess?.({threeDSServerTransID:e.threeDSServerTransID}),this.threeDsProcessor?.updateTokenExternal3dsData(e.externalThreeDsData)}),this.threeDsProcessor?.setPaymentInfo({cardNumber:``,expiryDate:``,cardholder:``,ccv:n})):this.userOnFailure?.({error:`Cannot load 3DS provider`})}runFraudGate(e,t){Vd(this.cardFraudProcessor,this.fraudManageOrder,e,{onShow:Fg,log:this.log.bind(this)}).then(T(this,`[runFraudGate]`,n=>{`error`in n?(Fg(),this.showErrorMessage(e,n.error),this.userOnFailure?.({error:n.error})):t(n.fraudCheckResult,n.threeDSServerTransID)}))}getPaymentOptions(e,t,n,r){this.log(`[getPaymentOptions], request`,{amount:e,currency:t}),t&&=t.toUpperCase();let i=`${e}${t}`;if(this.paymentOptions[i]){n?.(this.paymentOptions[i]);return}let a=T(this,`[getPaymentOptions], failure`,(e,t)=>{this.log(`[getPaymentOptions], failure`,t),r?.(),this.showErrorMessage(null,`Unable to configure SDK`),this.userOnFailure?.({error:`Unable to configure SDK`})}),o=T(this,`[getPaymentOptions], success`,(e,t)=>{let r=JSON.parse(t);this.log(`[getPaymentOptions], success`,r),this.paymentOptions[i]=r,n?.(r)});this.httpInvoker?.invoke(Lg(this.config.apiUrl)[Ig.PROVIDERS_INFO].url+`?amount=${e}¤cy=${t}`,Lg(this.config.apiUrl)[Ig.PROVIDERS_INFO].method,{},o,a)}getProviderInfo(e,t,n,r,i,a){this.log(`[getProviderInfo], request`,{providerId:e,amount:t,currency:n,token:r});let o=`${e}-${t}${n}-${r}`;if(this.paymentOptions[o]){i?.(this.paymentOptions[o]);return}let s=T(this,`[getProviderInfo], error`,(e,t)=>{this.log(`[getProviderInfo], error`,e,t),a({error:`Unable to get provider information`})}),c=T(this,`[getProviderInfo], success`,(e,t)=>{this.log(`[getProviderInfo], success`,e,t);let n=JSON.parse(t);this.log(`[getProviderInfo], data`,n),this.paymentOptions[o]=n,i(n)});this.httpInvoker?.invoke(Lg(this.config.apiUrl,e,r)[Ig.PROVIDER_INFO].url+`?amount=${t}¤cy=${n}`,Lg(this.config.apiUrl,e,r)[Ig.PROVIDER_INFO].method,{},c,s)}setAmount(e){return Number(e)===Number(this.amount)||Number(e)<0||(this.log(`[setAmount]`,Number(e)),this.amount=Number(e),this.cardProcessor?.setAmount(this.amount),this.threeDsProcessor?.setAmount(this.amount),this.secondaryThreeDsProcessor?.setAmount(this.amount),this.paypalProcessor?.setAmount(this.amount),this.fraudProcessor?.setAmount(this.amount),this.googlePayProcessor?.setAmount(this.amount),this.applePayProcessor?.setAmount(this.amount),this.paymentMethodProcessor?.setAmount(this.amount),window.postMessage({status:Vl,amount:this.amount},`*`)),this}setCurrency(e){return e===this.currency||(e&&=e.toUpperCase(),this.log(`[setCurrency]`,e),this.currency=e,this.cardProcessor?.setCurrency(e),this.threeDsProcessor?.setCurrency(e),this.secondaryThreeDsProcessor?.setCurrency(e),this.googlePayProcessor?.setCurrency(e),this.applePayProcessor?.setCurrency(e),this.paymentMethodProcessor?.setCurrency(e),window.postMessage({status:Hl,currency:e},`*`)),this}onSuccess(e){return this.log(`[onSuccess]`),this.userOnSuccess=e,this}onFailure(e){return this.log(`[onFailure]`),this.userOnFailure=e,this}successMessage(e){return this.userSuccessMessage=e,this.cardProcessor?.setSuccessMessage(e),this.paypalProcessor?.setSuccessMessage(e),this}onLoaded(e){return this.log(`[onLoaded]`),this.userOnLoaded=e,this}onValidationStatusChange(e){return this.log(`[onValidationStatusChange]`),this.userOnValidationStatusChange=e,this}onValidate(e){if(this.log(`[onValidate]`,e),this.userOnValidate=e,this.cardProcessor?.setOnValidate(e),this.applePayProcessor?.setOnValidate(e),this.googlePayProcessor?.setOnValidate(e),this.paypalProcessor?.setOnValidate(e),this.payToProcessor?.setOnValidate(e),this.paymentMethodProcessor?.setOnValidate(e),this.checkoutProcessors?.length>0)for(let t of this.checkoutProcessors)t?.setOnValidate(e);return this}showErrorMessage(e,t){this.log(t),q(e,t)}setBillingAddress(e){return this.log(`[setBillingAddress]`,e),this.billingAddress={...e},this.cardProcessor?.setBillingAddress(this.billingAddress),this.googlePayProcessor?.setBillingAddress(this.billingAddress),this.applePayProcessor?.setBillingAddress(this.billingAddress),this.threeDsProcessor?.setAddressInfo(this.billingAddress),this.fraudProcessor?.setAddressInfo(this.billingAddress),this.paymentMethodProcessor?.setBillingAddress(this.billingAddress),window.postMessage({status:Ul,address:e},`*`),this}setCustomerInfo(e){return this.log(`[setCustomerInfo]`,e),e?.phoneNumber&&(e.phoneNumber=e.phoneNumber.replace(/[^0-9+]/g,``)),this.customer={...e},this.cardProcessor?.setCustomerInfo(this.customer),this.googlePayProcessor?.setCustomerInfo(this.customer),this.applePayProcessor?.setCustomerInfo(this.customer),this.fraudProcessor?.setCustomerInfo(this.customer),this.paymentMethodProcessor?.setCustomerInfo(this.customer),window.postMessage({status:Wl,customer:e},`*`),this}setOrderInfo(e){return this.log(`[setOrderInfo]`,e),this.order={...e},this.cardProcessor?.setOrderInfo(this.order),this.googlePayProcessor?.setOrderInfo(this.order),this.applePayProcessor?.setOrderInfo(this.order),this.fraudProcessor?.setOrderInfo(this.order),this.paymentMethodProcessor?.setOrderInfo(this.order),window.postMessage({status:Gl,order:e},`*`),this}setGeolocation(e){return this.log(`[setGeolocation]`,e),this.geolocation={...e},this.cardProcessor?.setGeolocation(this.geolocation),this.paymentMethodProcessor?.setGeolocation(this.geolocation),this}checkGeolocation(){this.log(`[checkGeolocation]`),`geolocation`in navigator&&navigator.geolocation.getCurrentPosition(e=>{let{latitude:t,longitude:n}=e.coords;this.setGeolocation({latitude:t,longitude:n})},e=>{this.log(`Geolocation error:`,e)})}initProcessors(e,t,n,r,i,a,o){if(this.log(`[initProcessors]`,{amount:t,currency:n,cardProviderId:r,token:i,cardOptions:a}),this.initProcessorsRunning){this.initProcessorsQueue.push(()=>this.initProcessors(e,t,n,r,i,a,o));return}this.initProcessorsRunning=!0;let s=()=>{this.initProcessorsRunning=!1,this.initProcessorsQueue.shift()?.()},c={},l=``,u=``,d=!1,f={},p=``,m=``,h={},g=``,_=``,v={},y=!1,b=!1,ee=e=>{this.getProviderInfo(r,t,n,i||``,T(this,`[getProviderInfo], success`,t=>{c={...t},!y&&t.threeDsProviderId&&(p=t.threeDsProviderId,m=t.threeDsProviderType,h=t.threeDsClientParameters||{}),e()}),T(this,`[getProviderInfo], error`,t=>{this.log(`Unable to get provider information`,t),e()}))},te=T(this,`[initFraudProcessor]`,(e,t,n,r,i)=>{this.fraudProcessor=null,this.fraudManageOrder=null,this.skipCardFraud=Tu(m),this.cardProcessor?.addFraudProcessor(null),this.paypalProcessor?.addFraudProcessor(null),this.googlePayProcessor?.addFraudProcessor(null),this.applePayProcessor?.addFraudProcessor(null),this.paymentMethodProcessor?.addFraudProcessor(null,null),!e||!t?i():this.addFraudProcessor(e,t,n,r,{},T(this,`[addFraudProcessor], success`,()=>{i()}),T(this,`[addFraudProcessor], error`,()=>{this.log(`Error loading fraud provider`,t),i()}))}),ne=T(this,`[initThreeDsProcessor]`,(t,n,i)=>{!t||!n?i():this.add3DsProcessor(e,t,n,r,{...c.clientParameters,...h},T(this,`[add3DsProcessor], success`,()=>{i()}),T(this,`[add3DsProcessor], error`,()=>{this.log(`Error loading 3ds provider`,n),i()}))}),x=T(this,`[initSecondaryThreeDsProcessor]`,(t,n,i)=>{!t||!n?i():this.addSecondary3DsProcessor(e,t,n,r,{...c.clientParameters,...v},T(this,`[addSecondary3DsProcessor], success`,()=>{i()}),T(this,`[addSecondary3DsProcessor], error`,()=>{this.log(`Error loading 3ds provider`,n),i()}))}),S=T(this,`[callCallback]`,(e,t)=>{try{o(e,t)}finally{s()}});this.getPaymentOptions(t,n,T(this,`[getPaymentOptions], callback`,t=>{a?.createNetworkToken&&!a?.tokenAuthenticationEnabled&&(t.clickToPayEnabled=!1),t?.clickToPayEnabled&&a?.clickToPayEnabled!==!1&&(y=!0,b=!0),t?.hasNetworkTokenProviders&&a?.tokenAuthenticationEnabled&&(y=!0),!y&&t.hasThreeDsProviders&&(p=t.threeDsProviders[0].providerId,m=t.threeDsProviders[0].providerType,h=t.threeDsProviders[0].clientParameters||{}),!y&&t.allThreeDsProviders?.[0]?.providerId&&(g=t.allThreeDsProviders[0].providerId,_=t.allThreeDsProviders[0].providerType,v=t.allThreeDsProviders[0].clientParameters||{}),!b&&t.hasFraudProviders&&(l=t.fraudProviders[0].providerId,u=t.fraudProviders[0].providerType,d=t.fraudProviders[0].stopPaymentOnFailure,f=t.fraudProviders[0].clientParameters||{}),t.clickToPayEnabled&&a?.clickToPayEnabled!==!1&&this.initClickToPayProcessor(e,{...t.clickToPayOptions,...a?.clickToPayOptions,tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,networkTokenOptions:a?.networkTokenOptions}),!r&&!i?te(l,u,d,f,()=>{ne(p,m,()=>{x(g,_,()=>{S(c,t)})})}):ee(()=>{te(l,u,d,f,()=>{ne(p,m,()=>{x(g,_,()=>{S(c,t)})})})})}),s)}addFraudProcessor(e,t,n,r,i,a,o){this.log(`[addFraudProcessor]`,e,t,i),!this.amount||!this.currency?(this.log(`[addFraudProcessor], NOT loaded`,{amount:this.amount,currency:this.currency,billingAddress:this.billingAddress,customer:this.customer,order:this.order}),a?.()):Pg(t).then(T(this,`[addFraudProcessor], onload`,o=>{this.log(`Loading ${t}...`,o);let s=o.default(r);s?.getFraudCheckData&&(this.fraudProcessor=new Id(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,providerId:e,stopPaymentOnFailure:n,metadata:i,getFraudCheckData:s.getFraudCheckData,onSuccess:e=>{this.log(`[fraudProcessor], success`,e)},onFailure:e=>{this.log(`[fraudProcessor], failure`,e)}}),this.amount&&this.fraudProcessor.setAmount(this.amount),this.currency&&this.fraudProcessor.setCurrency(this.currency),this.billingAddress&&this.fraudProcessor.setAddressInfo(this.billingAddress),this.customer&&this.fraudProcessor.setCustomerInfo(this.customer),this.order&&this.fraudProcessor.setOrderInfo(this.order),this.fraudManageOrder=typeof s.manageOrder==`function`?s.manageOrder:null,this.cardProcessor?.addFraudProcessor(this.cardFraudProcessor),this.paypalProcessor?.addFraudProcessor(this.fraudProcessor),this.googlePayProcessor?.addFraudProcessor(this.fraudProcessor),this.applePayProcessor?.addFraudProcessor(this.fraudProcessor),this.paymentMethodProcessor?.addFraudProcessor(this.cardFraudProcessor,this.fraudManageOrder),a?.())})).catch(T(this,`[addFraudProcessor], onerror`,e=>{this.log(`Error loading ${t}`,e),o?.()}))}resolveThreeDsProvider(e,t){return e?.threeDsProviderId&&e?.threeDsProviderType?{providerId:e.threeDsProviderId,providerType:e.threeDsProviderType,clientParameters:e.threeDsClientParameters}:t.threeDsProviders?.find(e=>e.providerId===t.required3dsProvider)||t.threeDsProviders?.[0]}add3DsProcessor(e,t,n,r,i,a,o){this.log(`[add3DsProcessor]`,t,n),Ng(n).then(T(this,`[add3DsProcessor], onload`,o=>{this.log(`Loading ${n}...`,o);let s=o.default(this.log.bind(this),e,{environment:this.environment,apiUrl:this.config.apiUrl,clientParameters:i});s?.setThreeDsProcessor&&(this.threeDsProcessor=new gu(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,providerId:t,cardProviderId:r,threeDsInvoker:{onPreAuth:s.onPreAuth.bind(s),onAuth:s.onAuth.bind(s),onPostAuth:s.onPostAuth.bind(s)},onSuccess:e=>{this.log(`[threeDsProcessor], success`,e),this.userOnSuccess?.(e)},onFailure:e=>{this.log(`[threeDsProcessor], failure`,e),this.userOnFailure?.({error:e.error})}}),this.amount&&this.threeDsProcessor.setAmount(this.amount),this.currency&&this.threeDsProcessor.setCurrency(this.currency),this.billingAddress&&this.threeDsProcessor.setAddressInfo(this.billingAddress),this.cardProcessor?.addThreeDsProcessor(this.threeDsProcessor),s.setThreeDsProcessor(this.threeDsProcessor),a?.())})).catch(T(this,`[add3DsProcessor], onerror`,s=>{this.log(`Error loading ${n}`,s),n==="default"?o?.():this.add3DsProcessor(e,t,`default`,r,i,a,o)}))}addSecondary3DsProcessor(e,t,n,r,i,a,o){this.log(`[addSecondary3DsProcessor]`,t,n),Ng(n).then(T(this,`[addSecondary3DsProcessor], onload`,o=>{this.log(`Loading ${n}...`,o);let s=o.default(this.log.bind(this),e,{environment:this.environment,apiUrl:this.config.apiUrl,clientParameters:i});s?.setThreeDsProcessor&&(this.secondaryThreeDsProcessor=new gu(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,providerId:t,cardProviderId:r,threeDsInvoker:{onPreAuth:s.onPreAuth.bind(s),onAuth:s.onAuth.bind(s),onPostAuth:s.onPostAuth.bind(s)},onSuccess:e=>{this.log(`[secondaryThreeDsProcessor], success`,e),this.userOnSuccess?.(e)},onFailure:e=>{this.log(`[secondaryThreeDsProcessor], failure`,e),this.userOnFailure?.({error:e.error})}}),this.amount&&this.secondaryThreeDsProcessor.setAmount(this.amount),this.currency&&this.secondaryThreeDsProcessor.setCurrency(this.currency),this.billingAddress&&this.secondaryThreeDsProcessor.setAddressInfo(this.billingAddress),this.cardProcessor?.addSecondaryThreeDsProcessor(this.secondaryThreeDsProcessor),s.setThreeDsProcessor(this.secondaryThreeDsProcessor),a?.())})).catch(T(this,`[addSecondary3DsProcessor], onerror`,s=>{this.log(`Error loading ${n}`,s),n==="default"?o?.():this.addSecondary3DsProcessor(e,t,`default`,r,i,a,o)}))}preloadClickToPay(e){return this.log(`[preloadClickToPay]`,e),this.initProcessors(null,0,`AUD`,``,``,{clickToPayOptions:e,tokenAuthenticationEnabled:e?.tokenAuthenticationEnabled,networkTokenOptions:e?.networkTokenOptions},T(this,`[preloadClickToPay], callback`,(t,n)=>{n.clickToPayEnabled&&this.initClickToPayProcessor(null,{...n.clickToPayOptions,...e}).init()})),this}addSavedPaymentMethods(e,t,n){this.log(`[addSavedPaymentMethods]`,{customerId:t,options:n});let r=e&&document.getElementById(e)||null;if(!r)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!lc(t))throw this.showErrorMessage(r,`Missing parameter: customerId`),this.userOnFailure?.({error:`Missing parameter: Customer Id`}),TypeError(`Missing parameter: customerId`);let i=Number(n?.amount)||0,a=n?.currency||``;if(i&&!uc(i))throw this.showErrorMessage(r,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);return this._cleanUp(r),this._initForm(r),this.setAmount(i),this.setCurrency(a),this.initProcessors(r,i,a,``,``,{clickToPayEnabled:!1,tokenAuthenticationEnabled:n?.tokenAuthenticationEnabled},T(this,`[addSavedPaymentMethods][initProcessors], callback`,(e,o)=>{let s={...n,tokenAuthenticationEnabled:n?.tokenAuthenticationEnabled&&o.hasNetworkTokenProviders,networkTokenProviders:o.networkTokenProviders||[]};this.initPaymentMethodProcessor(r).addPaymentMethods(r,t,i,a,s),s.tokenAuthenticationEnabled&&this.checkGeolocation()})),this}initBaseProcessor(e){e.setAmount(this.amount),e.setCurrency(this.currency),e.setCustomerInfo(this.customer),e.setBillingAddress(this.billingAddress),e.setOrderInfo(this.order),e.setGeolocation(this.geolocation),e.setOnValidate(this.userOnValidate)}filterAllowedPaymentTypes(e){let t=[],n=Object.values(Lp);return Array.isArray(e)||(e=[e]),(e||[]).forEach(e=>{let r=String(e).toLowerCase().replace(/[^a-z]/g,``);n.includes(r)&&t.push(r)}),t}};return d([w],$.prototype,`init`,null),d([w],$.prototype,`execute`,null),d([w],$.prototype,`messageHandler`,null),d([w],$.prototype,`initCardProcessor`,null),d([w],$.prototype,`initClickToPayProcessor`,null),d([w],$.prototype,`initPaypalProcessor`,null),d([w],$.prototype,`initCheckoutProcessor`,null),d([w],$.prototype,`initGooglePayProcessor`,null),d([w],$.prototype,`initApplePayProcessor`,null),d([w],$.prototype,`initPayToProcessor`,null),d([w],$.prototype,`loadCss`,null),d([w],$.prototype,`_cleanUp`,null),d([w],$.prototype,`getForm`,null),d([w],$.prototype,`getSubmit`,null),d([w],$.prototype,`getInput`,null),d([w],$.prototype,`_initForm`,null),d([w],$.prototype,`_setToken`,null),d([w],$.prototype,`getSubmitFormHandler`,null),d([w],$.prototype,`getDestroyDropIn`,null),d([w],$.prototype,`setDestroyDropIn`,null),d([w],$.prototype,`addCard`,null),d([w],$.prototype,`addCardLeastCost`,null),d([w],$.prototype,`addDropIn`,null),d([w],$.prototype,`addPaypal`,null),d([w],$.prototype,`addPayTo`,null),d([w],$.prototype,`addGooglePay`,null),d([w],$.prototype,`addApplePay`,null),d([w],$.prototype,`addCheckout`,null),d([w],$.prototype,`addUpi`,null),d([w],$.prototype,`addThreeDsWithFullParameters`,null),d([w],$.prototype,`tokeniseWith3Ds`,null),d([w],$.prototype,`threeDsOrTokenise`,null),d([w],$.prototype,`tokeniseCard`,null),d([w],$.prototype,`addThreeDsWithToken`,null),d([w],$.prototype,`threeDsWithToken`,null),d([w],$.prototype,`getPaymentOptions`,null),d([w],$.prototype,`getProviderInfo`,null),d([w],$.prototype,`setAmount`,null),d([w],$.prototype,`setCurrency`,null),d([w],$.prototype,`onSuccess`,null),d([w],$.prototype,`onFailure`,null),d([w],$.prototype,`onLoaded`,null),d([w],$.prototype,`onValidationStatusChange`,null),d([w],$.prototype,`onValidate`,null),d([w],$.prototype,`showErrorMessage`,null),d([w],$.prototype,`setBillingAddress`,null),d([w],$.prototype,`setCustomerInfo`,null),d([w],$.prototype,`setOrderInfo`,null),d([w],$.prototype,`setGeolocation`,null),d([w],$.prototype,`checkGeolocation`,null),d([w],$.prototype,`initProcessors`,null),d([w],$.prototype,`addFraudProcessor`,null),d([w],$.prototype,`resolveThreeDsProvider`,null),d([w],$.prototype,`add3DsProcessor`,null),d([w],$.prototype,`addSecondary3DsProcessor`,null),d([w],$.prototype,`preloadClickToPay`,null),d([w],$.prototype,`addSavedPaymentMethods`,null),new $});
|
|
282
|
+
left=${o}`)}hideModalForm(){if(this.tokenAuthenticationEnabled)this.modal&&this.modal.close();else{if(!this.mcModal)return;this.mcModal.style.display=`none`}}mcHideOtpInput(){let e=this;customElements.whenDefined(`src-otp-input`).then(()=>{e.log(`[src-otp-input], mcHideOtpInput`,e.srcOtpInput),e.srcOtpInput.style.display=`none`}).catch(e=>{this.log(`[customElements.whenDefined]`,e),this.sendErrorNotification(`mcHideOtpInput.whenDefined error`,[e])}),this.unpauseLoadingCardForm()}mcShowOtpInput(e,t,n){this.log(`[mcShowOtpInput]`,this.requestedValidationChannelId,e,t,n);let r=this;customElements.whenDefined(`src-otp-input`).then(T(this,`[mcShowOtpInput], success`,()=>{let i=e.find(e=>e.identityType===`SMS`),a=e.find(e=>e.identityType===`EMAIL`),o=[];this.requestedValidationChannelId&&this.requestedValidationChannelId!==`EMAIL`||!a||this.requestedValidationChannelId!=`EMAIL`&&(this.requestedValidationChannelId||t!==`visa`)||o.push(a.maskedValidationChannel),(!this.requestedValidationChannelId||this.requestedValidationChannelId===`SMS`)&&i&&o.push(i.maskedValidationChannel),this.log(`[src-otp-input], mcShowOtpInput`,r.srcOtpInput,e,t,o,n),r.srcOtpInput.loadSupportedValidationChannels?.(e),r.srcOtpInput.setAttribute(`network-id`,t),r.srcOtpInput.setAttribute(`card-brands`,t),r.srcOtpInput.setAttribute(`masked-identity-value`,o.join(`,`)),n?r.srcOtpInput.setAttribute(`error-reason`,n):r.srcOtpInput.removeAttribute(`error-reason`),r.srcOtpInput.style.display=`block`,r.adjustRememberMeOnOtpInput(),r.pauseLoadingCardForm()})).catch(e=>{this.log(`[mcShowOtpInput.whenDefined]`,e),this.sendErrorNotification(`mcShowOtpInput.whenDefined error`,[e])})}adjustRememberMeOnOtpInput(){let e=this.srcOtpInput.shadowRoot.getElementById(`remember_me`);e&&(e.checked&&!this.getRememberMe()||!e.checked&&this.getRememberMe())&&e.dispatchEvent(new MouseEvent(`click`,{view:window,bubbles:!0,cancelable:!0}))}mcHideLearnMore(){this.log(`[src-learn-more], mcHideLearnMore`,this.srcLearnMore),this.srcLearnMore.style.display=`none`}mcShowLearnMore(){this.log(`[src-learn-more], mcShowLearnMore`,this.srcLearnMore);let e=this.availableCardBrands.length>0&&this.availableCardBrands||Yf;e.includes(Jf.mastercard)&&(e.splice(e.indexOf(Jf.mastercard),1),e.unshift(Jf.mastercard)),this.srcLearnMoreElement.setAttribute(`card-brands`,(this.availableCardBrands.length>0&&this.availableCardBrands||Yf).join(`,`)),this.srcLearnMore.style.display=`block`}showChangeUserPopup(){this.showLoginForm()}showLoginForm(){let{destroy:e}=$s({el:document.body,component:vp,props:{log:this.log,options:this.options},on:{close:T(this,`[showLoginForm], onclose`,()=>{this.log(`[LoginForm.close]`),this.stopLoadingCardForm(),e()}),submit:T(this,`[showLoginForm], onsubmit`,({email:t,phone:n})=>{this.log(`[LoginForm.submit]`,t,n),e(),this.customer||this.setCustomerInfo({firstName:``,lastName:``,email:``,phoneNumber:``}),this.customer.email=t,this.customer.phoneNumber=n,!t&&!n?this.stopLoadingCardForm():(this.setCards([]),this.mcIdLookup(!1,++this.run))}),logout:T(this,`[showLoginForm], onlogout`,()=>{this.log(`[LoginForm.logout]`),e(),this.stopLoadingCardForm(),this.setCards([]),this.mcLogout()})}})}checkoutWithCard(e,t,n){this.log(`ClickToPayProcessor.checkoutWithExistingCard`,e);let r=this,i=T(this,`[checkoutWithCard.promiseResolvedHandler]`,e=>{r.log(`[checkoutWithCard.promiseResolvedHandler]`,e),r.hideModalForm(),t(e)}),a=T(this,`[checkoutWithCard.promiseRejectedHandler]`,t=>{r.log(`[checkoutWithCard.promiseRejectedHandler]`,t),r.stopUsing(),r.showInfoMessage(Cp),n(t),r.sendErrorNotification(`checkoutWithCard error`,[e,o,t])});this.showModalForm();let o={windowRef:this.tokenAuthenticationEnabled?this.modal:this.mcFrame,srcDigitalCardId:e.srcDigitalCardId,dpaTransactionOptions:this.generateDpaTransactionOptions(),recognitionTokenRequested:this.rememberMe};this.log(`[checkoutWithCard]`,o),window.mcCheckoutService.checkoutWithCard(o).then(i).catch(a)}checkoutWithNewCard(e,t,n,r,i,a){this.log(`ClickToPayProcessor.checkoutWithNewCard`,{cardNumber:_l(e),expiryDate:t,ccv:`***`,enrollCard:r}),this.tokenAuthenticationEnabled&&this.showModalForm(),this.encryptCard(e,t,n,T(this,`[mcEncryptCard], success`,(e,t)=>{this.checkoutWithEncryptedNewCard(e,t,e=>{i(e)},a)}),T(this,`[mcEncryptCard], error`,n=>{a(n),this.sendErrorNotification(`mcEncryptCard error`,[{cardNumber:e,expiryDate:t,enrollCard:r},n])}))}checkoutWithEncryptedNewCard(e,t,n,r){let i=this,a=T(this,`[checkoutWithNewCard.promiseResolvedHandler]`,e=>{i.log(`[checkoutWithNewCard.promiseResolvedHandler]`,e),i.hideModalForm(),e.checkoutActionCode===`SWITCH_CONSUMER`?i.showLoginForm():[`CHANGE_CARD`,`CANCEL`].includes(e.checkoutActionCode)||n(e)}),o=T(this,`[checkoutWithNewCard.promiseRejectedHandler]`,e=>{i.log(`[checkoutWithNewCard.promiseRejectedHandler]`,e),i.stopUsing(),i.showInfoMessage(Cp),r(e),i.sendErrorNotification(`checkoutWithNewCard error`,[s,e])});this.showModalForm();let s={windowRef:this.tokenAuthenticationEnabled?this.modal:this.mcFrame,encryptedCard:e,cardBrand:t,consumer:this.generateConsumerInfo(),dpaTransactionOptions:this.generateDpaTransactionOptions()};this.log(`checkoutWithNewCard`,s),window.mcCheckoutService.checkoutWithNewCard(s).then(a).catch(o)}encryptCard(e,t,n,r,i){let a=bp(e,this.environment);this.whenReady().then(()=>{this.mcEncryptCard(a?.cardNumber||e,a?.expiryDate||t,a?.ccv||n,r,i)}).catch(i)}mcLogout(){window.mcCheckoutService.signOut(),this.mcHideOtpInput()}mcInitClickToPay(){if(window.mcCheckoutService=new window.MastercardCheckoutServices,!window.mcCheckoutService){this.log(`[mcInitClickToPay] mcCheckoutService or sdk not found`,window.MastercardCheckoutServices,window.SRCSDK_MASTERCARD),this.stopUsing();return}let e=this,t=T(this,`[mcInitClickToPay.promiseResolvedHandler]`,t=>{e.log(`[mcInitClickToPay.promiseResolvedHandler]`,t),e.updateAvailableCardBrands(t.availableCardBrands),e.loaded=!0,e.resolveReadyCallbacks(),e.localStartCallback&&e.localStartCallback()}),n=T(this,`[mcInitClickToPay.promiseRejectedHandler]`,t=>{e.log(`[mcInitClickToPay.promiseRejectedHandler]`,t),e.loaded=!0,e.sendErrorNotification(`mcInitClickToPay error`,[r,t]),e.stopUsing()}),r={srcDpaId:this.options.dpaId,dpaData:{dpaName:this.options.dpaName||`TAS-${this.options.dpaId}`},dpaTransactionOptions:this.generateDpaTransactionOptions(),cardBrands:this.options?.cardBrands?.length?this.options?.cardBrands:Yf,checkoutExperience:`WITHIN_CHECKOUT`},i=this.getRecognitionToken();i&&(r.recognitionToken=i),this.log(`[mcInitClickToPay]`,r),window.mcCheckoutService.init(r).then(t).catch(n)}mcIdLookup(e=!1,t=this.run){if(this.log(`[mcIdLookup]`,this.customer,e),this.attempts=0,this.stopWaitingForVisibility(),!this.customer?.phoneNumber&&!this.customer?.email){this.cleanUp(this.container);return}this.customer?.email||(e=!0);let n=this,r=T(this,`[mcIdLookup.promiseResolvedHandler]`,r=>{n.log(`[mcIdLookup.promiseResolvedHandler]`,r),t===n.run&&(r.consumerPresent?n.initiateValidationWhenVisible(t):!r.consumerPresent&&!e&&n.customer?.phoneNumber?n.mcIdLookup(!0,t):n.stopLoadingCardForm())}),i=T(this,`[mcIdLookup.promiseRejectedHandler]`,e=>{n.log(`[mcIdLookup.promiseRejectedHandler]`,e),n.stopLoadingCardForm(),n.sendErrorNotification(`mcIdLookup error`,[o,e]),n.stopUsing()}),a=gl(this.customer?.phoneNumber||``),o=e?{mobileNumber:{phoneNumber:a[1]||``,countryCode:a[0]||`61`}}:{email:this.customer?.email};this.log(`[mcIdLookup]`,o),window.mcCheckoutService.idLookup(o).then(r).catch(i)}initiateValidationWhenVisible(e){let t=this.container;t.getClientRects().length>0||typeof IntersectionObserver>`u`?this.mcInitiateValidation():(this.stopWaitingForVisibility(),this.visibilityObserver=new IntersectionObserver(T(this,`[initiateValidationWhenVisible]`,t=>{t.some(e=>e.isIntersecting)&&(this.stopWaitingForVisibility(),e===this.run&&this.mcInitiateValidation())})),this.visibilityObserver.observe(t))}mcInitiateValidation(e){this.log(`[mcInitiateValidation]`,e);let t=this;this.requestedValidationChannelId=e||``;let n=T(this,`[mcInitiateValidation.promiseResolvedHandler]`,e=>{t.log(`[mcInitiateValidation.promiseResolvedHandler]`,e),t.supportedValidationChannels=e.supportedValidationChannels,t.validationChannelsNetwork=e.network,e.maskedValidationChannel&&(!t.supportedValidationChannels||t.supportedValidationChannels.length===0)&&(t.supportedValidationChannels=[],(e.maskedValidationChannel.split(`,`)||[]).forEach(e=>{t.supportedValidationChannels.push({maskedValidationChannel:e,identityType:e.includes(`@`)?`EMAIL`:`SMS`,validationChannelId:e.includes(`@`)?`EMAIL`:`SMS`})})),t.mcShowOtpInput(t.supportedValidationChannels,e.network)}),r=T(this,`[mcInitiateValidation.promiseRejectedHandler]`,n=>{t.log(`[mcInitiateValidation.promiseRejectedHandler]`,n),t.stopUsing(),t.sendErrorNotification(`mcInitiateValidation error`,[{requestedValidationChannelId:e},n])});this.log(`[mcInitiateValidation]`,e?{requestedValidationChannelId:e}:null),window.mcCheckoutService.initiateValidation(e?{requestedValidationChannelId:e}:void 0).then(n).catch(r)}mcValidate(e){try{let t=this,n=T(this,`[mcValidate.promiseResolvedHandler]`,e=>{t.log(`[mcValidate.promiseResolvedHandler]`,e),e.cards?(t.setCards(e.cards),t.stopLoadingCardForm()):t.mcGetCards(),t.saveRecognitionToken(e.recognitionToken)}),r=T(this,`[mcValidate.promiseRejectedHandler]`,e=>{t.log(`[mcValidate.promiseRejectedHandler]`,e),t.sendErrorNotification(`mcValidate error`,[{recognitionTokenRequested:i.recognitionTokenRequested},e]),t.attempts++,t.attempts>2||!e?.reason||e.reason==`REQUEST_TIMEOUT`?(t.stopLoadingCardForm(),t.showMessage(`Too many attempts to access your click to pay profile. Please check out as a guest.`)):e.reason===`CODE_INVALID`||e.reason===`RETRIES_EXCEEDED`||e.reason===`ACCT_INACCESSIBLE`||e.reason===`CODE_EXPIRED`?t.mcShowOtpInput(t.supportedValidationChannels,t.validationChannelsNetwork,e.reason):(t.stopUsing(),t.showInfoMessage(Cp))}),i={value:e,recognitionTokenRequested:this.getRememberMe()};this.log(`[mcValidate]`,{recognitionTokenRequested:i.recognitionTokenRequested}),this.startLoadingCardForm(),window.mcCheckoutService.completeValidation(i).then(n).catch(r)}catch(e){throw this.sendErrorNotification(`mcValidate exception`,[e]),console.warn(`[mcValidate], exception`,{error:e}),e}}runClickToPay(){let e=this,t=++this.run;this.lookedUp.add(Sp(this.customer));let n=T(this,`[runClickToPay.promiseResolvedHandler]`,n=>{e.log(`[runClickToPay.promiseResolvedHandler]`,n),t===e.run&&(!n||!n.length?e.mcIdLookup(!1,t):(e.setCards(n),e.stopLoadingCardForm()))}),r=T(this,`[runClickToPay.promiseRejectedHandler]`,t=>{e.log(`[runClickToPay.promiseRejectedHandler]`,t),e.stopUsing(),e.stopLoadingCardForm(),e.sendErrorNotification(`mcCheckoutService.getCards error`,[t])});this.log(`[runClickToPay]`),window.mcCheckoutService.getCards().then(n).catch(r)}mcGetCards(){let e=this,t=T(this,`[getCards.promiseResolvedHandler]`,t=>{e.log(`[getCards.promiseResolvedHandler]`,t),e.setCards(t),e.stopLoadingCardForm()}),n=T(this,`[getCards.promiseRejectedHandler]`,t=>{e.log(`[getCards.promiseRejectedHandler]`,t),e.stopLoadingCardForm(),e.stopUsing(),e.sendErrorNotification(`getCards error`,[t])});this.log(`[getCards]`),window.mcCheckoutService.getCards().then(t).catch(n)}mcEncryptCard(e,t,n,r,i){let a=this,o=T(this,`[encryptCard.promiseResolvedHandler]`,e=>{a.log(`[encryptCard.promiseResolvedHandler]`,e),r(e.encryptedCard,e.cardBrand)}),s=T(this,`[encryptCard.promiseResolvedHandler]`,e=>{a.log(`[encryptCard.promiseResolvedHandler]`,e),i(e),a.sendErrorNotification(`encryptCard error`,[l,e])}),c=t.split(`/`),l={primaryAccountNumber:e,panExpirationMonth:c[0],panExpirationYear:c[1],cardSecurityCode:n};window.mcCheckoutService.encryptCard(l).then(o).catch(s)}resolveReadyCallbacks(){this.readyCallbacks.splice(0).forEach(e=>e())}stopUsing(){this.log(`[ClickToPayProcessor]: stop using Click To Pay`),this.enabled=!1,this.cleanUp(this.container);let e=this.getCardFormFrame();if(e)try{e.contentWindow?.postMessage({status:tu},`*`),e.contentWindow?.postMessage({status:Xl},`*`)}catch(e){this.log(`[stopUsing] iframe error`,e)}}updateAvailableCardBrands(e){this.log(`[ClickToPayProcessor]: updateAvailableCardBrands`,e),this.availableCardBrands=e;let t=this.getCardFormFrame();if(t)try{t.contentWindow?.postMessage({status:nu,availableCardBrands:e},`*`)}catch(e){this.log(`[updateAvailableCardBrands] iframe error`,e)}}isEnabled(){return!!this.enabled}getLibUrl(e){return wp[this.environment===C.PRODUCTION?`PRODUCTION`:`SANDBOX`][e]||``}saveRecognitionToken(e){let t=new Date;t.setTime(t.getTime()+15552e6);let n=`expires=`+t.toUTCString();document.cookie=`recognitionToken=${e};${n};path=/`}getRecognitionToken(){let e=`; ${document.cookie}`.split(`; recognitionToken=`);return e.length===2&&e.pop().split(`;`).shift()||``}sendErrorNotification(e,t){ke(`[ClickToPayProcessor]`,e,t)}generateDpaTransactionOptions(){let e={dpaLocale:this.options.locale||`en_AU`,dpaBillingPreference:Xf.NONE,dpaAcceptedBillingCountries:[],dpaAcceptedShippingCountries:[],dpaShippingPreference:`NONE`,threeDsPreference:`NONE`,confirmPayment:!1,transactionAmount:{transactionAmount:Number(this.amount),transactionCurrencyCode:this.currency}};return!this.tokenAuthenticationEnabled&&this.options.useFpan&&(e.paymentOptions=[{dynamicDataType:`NONE`}]),this.options.confirmPayment!==void 0&&(e.confirmPayment=!!this.options.confirmPayment),this.tokenAuthenticationEnabled&&(e.dpaBillingPreference=Xf.NONE,e.merchantCountryCode=`AU`,e.authenticationPreferences={payloadRequested:`AUTHENTICATED`},e.paymentOptions=[{dpaDynamicDataTtlMinutes:15,dynamicDataType:`CARD_APPLICATION_CRYPTOGRAM_SHORT_FORM`}],this.options.networkTokenOptions?.acquirerMerchantId&&(e.acquirerMerchantId=this.options.networkTokenOptions.acquirerMerchantId),this.options.networkTokenOptions?.acquirerBIN&&(e.acquirerBIN=this.options.networkTokenOptions.acquirerBIN),this.options.networkTokenOptions?.merchantCategoryCode&&(e.merchantCategoryCode=this.options.networkTokenOptions.merchantCategoryCode)),e}generateConsumerInfo(){let e={};if(this.customer?.email&&(e.emailAddress=this.customer.email),this.customer?.phoneNumber){let t=gl(this.customer?.phoneNumber||``);e.mobileNumber={phoneNumber:t[1]||``,countryCode:t[0]||`61`}}return e}};d([w],Q.prototype,`setContainer`,null),d([w],Q.prototype,`setCustomerInfo`,null),d([w],Q.prototype,`setCards`,null),d([w],Q.prototype,`isSchemeSupported`,null),d([w],Q.prototype,`messageHandler`,null),d([w],Q.prototype,`init`,null),d([w],Q.prototype,`cleanUp`,null),d([w],Q.prototype,`start`,null),d([w],Q.prototype,`initCheckoutServiceLib`,null),d([w],Q.prototype,`initScripts`,null),d([w],Q.prototype,`initCss`,null),d([w],Q.prototype,`createOtpInput`,null),d([w],Q.prototype,`attachOtpInput`,null),d([w],Q.prototype,`createLearnMore`,null),d([w],Q.prototype,`createModalForm`,null),d([w],Q.prototype,`showModalForm`,null),d([w],Q.prototype,`hideModalForm`,null),d([w],Q.prototype,`mcHideOtpInput`,null),d([w],Q.prototype,`mcShowOtpInput`,null),d([w],Q.prototype,`adjustRememberMeOnOtpInput`,null),d([w],Q.prototype,`mcHideLearnMore`,null),d([w],Q.prototype,`mcShowLearnMore`,null),d([w],Q.prototype,`showChangeUserPopup`,null),d([w],Q.prototype,`showLoginForm`,null),d([w],Q.prototype,`checkoutWithCard`,null),d([w],Q.prototype,`checkoutWithNewCard`,null),d([w],Q.prototype,`checkoutWithEncryptedNewCard`,null),d([w],Q.prototype,`encryptCard`,null),d([w],Q.prototype,`mcLogout`,null),d([w],Q.prototype,`mcInitClickToPay`,null),d([w],Q.prototype,`mcIdLookup`,null),d([w],Q.prototype,`mcInitiateValidation`,null),d([w],Q.prototype,`runClickToPay`,null),d([w],Q.prototype,`mcGetCards`,null),d([w],Q.prototype,`mcEncryptCard`,null),d([w],Q.prototype,`stopUsing`,null),d([w],Q.prototype,`updateAvailableCardBrands`,null),d([w],Q.prototype,`getLibUrl`,null),d([w],Q.prototype,`saveRecognitionToken`,null),d([w],Q.prototype,`getRecognitionToken`,null),d([w],Q.prototype,`sendErrorNotification`,null),d([w],Q.prototype,`generateDpaTransactionOptions`,null),d([w],Q.prototype,`generateConsumerInfo`,null);var Tp;(function(e){e.CARD=`CARD`,e.PAYPAL=`PAYPAL`,e.PAYTO=`PAYTO`,e.PAYID=`PAYID`,e.OPTTY=`OPTTY`,e.GOOGLEPAY=`GOOGLEPAY`,e.APPLEPAY=`APPLEPAY`,e.VIS=`VIS`,e.SHIFT=`SHIFT`,e.PESAPAL=`PESAPAL`,e.PAYBYACCOUNT=`PAYBYACCOUNT`,e.CLICK2PAY=`CLICK2PAY`,e.UPI=`UPI`,e.PAYGLOCAL=`PAYGLOCAL`,e.BANKPAYMENT=`BANKPAYMENT`,e.PAYMENT_METHOD=`PAYMENT_METHOD`})(Tp||={}),G(),yl();var Ep={key:0,class:`payment-method-info`},Dp=[`src`,`alt`],Op={class:`payment-method-details`},kp={class:`payment-method-details-name`},Ap={key:0},jp={key:1},Mp={key:2},Np=R({__name:`PaymentMethod`,props:{log:{type:Function},cssUrl:{},paymentMethod:{}},setup(e){let t=e,n=F(t.paymentMethod);jr(()=>t.paymentMethod,()=>{n.value=t.paymentMethod},{flush:`post`});function r(){switch(n.value.type){case`CARD`:return``;case`PAYPAL`:return n.value.email||`PayPal`;case`PAYTO`:return``;case`PAYID`:return`PayID`;case`OPTTY`:return`Optty`;case`GOOGLEPAY`:return`Google Pay`;case`APPLEPAY`:return`Apple Pay`;case`VIS`:return`Visa Installments`;case`SHIFT`:return`Shift`;case`PESAPAL`:return`Pesapal`;case`PAYBYACCOUNT`:return`Pay By Account`;case`CLICK2PAY`:return`Click To Pay`;case`UPI`:return`UPI`;case`PAYGLOCAL`:return`PayGlocal`;case`BANKPAYMENT`:return``;case`PAYMENT_METHOD`:return`Payment Method`;default:return`Unknown`}}function i(){switch(n.value.type){case`CARD`:return n.value.card?.scheme?`${t.cssUrl}icons/${ml(String(n.value.card?.scheme).toLowerCase())}.svg`:`${t.cssUrl}icons/Card.svg`;case`PAYPAL`:return`${t.cssUrl}icons/PayPal.svg`;case`PAYTO`:return`${t.cssUrl}icons/PayTo.svg`;case`PAYID`:return`${t.cssUrl}icons/PayID.svg`;case`GOOGLEPAY`:return`${t.cssUrl}icons/GooglePay.svg`;case`APPLEPAY`:return`${t.cssUrl}icons/ApplePay.svg`;case`VIS`:return`${t.cssUrl}icons/Visa.svg`;case`SHIFT`:return`${t.cssUrl}icons/Shift.svg`;case`PESAPAL`:return`${t.cssUrl}icons/Pesapal.svg`;case`PAYBYACCOUNT`:return`${t.cssUrl}icons/PayByAccount.svg`;case`CLICK2PAY`:return`${t.cssUrl}icons/ClickToPay.svg`;case`UPI`:return`${t.cssUrl}icons/UPI.svg`;case`PAYGLOCAL`:return`${t.cssUrl}icons/PayGLocal.svg`;case`BANKPAYMENT`:return`${t.cssUrl}icons/BankPayment.svg`;case`PAYMENT_METHOD`:return`${t.cssUrl}icons/Card.svg`;default:return`Unknown`}}return jr(()=>t.paymentMethod,()=>{n.value=t.paymentMethod},{flush:`post`}),(e,t)=>n.value?(z(),B(`div`,Ep,[V(`img`,{src:i(),alt:r()},null,8,Dp),V(`div`,Op,[V(`div`,kp,N(r()),1),n.value.type===I(Tp).CARD?(z(),B(`div`,Ap,[ea(` Card: `+N(n.value.card?.cardNumber||`Unknown`),1),t[0]||=V(`br`,null,null,-1),ea(` Expire: `+N(n.value.card?.expiryDate||`Unknown`),1)])):H(``,!0),n.value.type===I(Tp).BANKPAYMENT?(z(),B(`div`,jp,[ea(` Name: `+N(n.value.bankPayment?.accountName),1),t[1]||=V(`br`,null,null,-1),ea(` Acc No: `+N(n.value.bankPayment?.accountNumber),1)])):H(``,!0),n.value.type===I(Tp).PAYTO?(z(),B(`div`,Mp,[ea(` Name: `+N(n.value.payTo?.payerName),1),t[3]||=V(`br`,null,null,-1),n.value.payTo?.payerPayIdDetails?(z(),B(U,{key:0},[ea(N(n.value.payTo?.payerPayIdDetails?.payIdType)+`: `+N(n.value.payTo?.payerPayIdDetails?.payId),1)],64)):H(``,!0),n.value.payTo?.payerDirectDebitDetails?(z(),B(U,{key:1},[ea(` BSB: `+N(n.value.payTo?.payerDirectDebitDetails?.bsb),1),t[2]||=V(`br`,null,null,-1),ea(` Acc No: `+N(n.value.payTo?.payerDirectDebitDetails?.accountNumber),1)],64)):H(``,!0)])):H(``,!0)])])):H(``,!0)}});q();var Pp=K(Np,[[`__scopeId`,`data-v-7894e1cd`]]);G(),Y();var Fp={key:0,class:`saved-payment-methods`},Ip={key:0,class:`error`},Lp=[`onClick`],Rp=[`id`,`checked`],zp={key:0,class:`error`},Bp={key:1,class:`payment-method-container`},Vp={key:1,class:`saved-payment-methods`},Hp=R({__name:`PaymentMethodsForm`,props:{log:{type:Function},cssUrl:{},paymentMethods:{},clickGate:{type:Function}},emits:[`submit`,`select`],setup(e,{emit:t}){let n=e,r=t,i=F(!0),a=F(null),o=F(n.paymentMethods),s=F(!1),c=F({}),l=Wo(()=>s.value?o.value:a.value?[a.value]:[o.value[0]]);function u(e){if(e?.data?.status){if(e.data.status===`submit-card-form`){if(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),!i.value||(e.stopPropagation(),c.value={},n.clickGate()?.()===!1))return;r(`submit`,a.value)}e.data.status===`activate`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),i.value=!0),e.data.status===`deactivate`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),i.value=!1),e.data.status===`message`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),c.value=e.data.message),e.data.status===`error`&&e.data.component===`payment-methods`&&(n.log?.(`[PaymentMethods]: message "${e.data.status}" received`,e.data),c.value[e.data.paymentMethodId||`global`]=e.data.error)}}jr(()=>n.paymentMethods,()=>{o.value=n.paymentMethods,f()},{flush:`post`});function d(e){n.log?.(`[PaymentMethods]: selected payment method`,e),c.value={},a.value=e,r(`select`,e?{...e}:null)}function f(){o.value.length>0?(d(o.value.find(e=>e.isDefault)||o.value[0]),window.postMessage({status:au,message:{status:`success`,message:``}},`*`)):window.postMessage({status:au,message:{status:`error`,message:`No saved payment methods found`}},`*`)}return za(()=>{window.addEventListener(`message`,u),window.postMessage({status:Ol},`*`),f()}),Ua(()=>{window.removeEventListener(`message`,u)}),(e,t)=>o.value.length>0?(z(),B(`div`,Fp,[c.value.global?(z(),B(`div`,Ip,N(c.value.global),1)):H(``,!0),(z(!0),B(U,null,Qr(l.value,(e,t)=>(z(),B(`div`,{key:`paymentMethod${t}`,class:Pe([`payment-method-container`,`${a.value?.paymentMethodId===e?.paymentMethodId?`selected`:``} ${c.value[`${e?.paymentMethodId}`]?`error`:``}`]),onClick:t=>d(e)},[V(`input`,{type:`radio`,name:`paymentMethod`,id:`payment-method-${e?.paymentMethodId}`,checked:a.value?.paymentMethodId===e?.paymentMethodId},null,8,Rp),W(Pp,{log:n.log,"css-url":n.cssUrl,"payment-method":e},null,8,[`log`,`css-url`,`payment-method`]),c.value[`${e?.paymentMethodId}`]?(z(),B(`div`,zp,N(c.value[`${e?.paymentMethodId}`]),1)):H(``,!0)],10,Lp))),128)),o.value.length>1?(z(),B(`div`,Bp,[t[2]||=V(`div`,{style:{width:`20px`}},null,-1),V(`div`,null,[s.value?(z(),B(`a`,{key:0,href:`#`,class:`black`,onClick:t[0]||=e=>s.value=!1},`Show less`)):(z(),B(`a`,{key:1,href:`#`,class:`black`,onClick:t[1]||=e=>s.value=!0},`Show all`))])])):H(``,!0)])):(z(),B(`div`,Vp,[...t[3]||=[V(`div`,{class:`title`},`No saved payment methods found`,-1)]]))}});q();var Up=K(Hp,[[`__scopeId`,`data-v-d3f0944f`]]);pl(),yl(),_e(),Y();var Wp=class{log;debug=!1;container=null;httpInvoker=null;destroy=()=>{};apiUrl=``;environment=``;publicKey=``;version=``;failureCallback=null;successCallback=null;userOnValidate;amount=0;currency=``;billingAddress=null;customer=null;order=null;paymentInfo=null;geolocation=null;userSuccessMessage=ou;constructor(e,t){this.log=e,this.debug=t.debug,this.environment=t.environment,this.apiUrl=t.apiUrl,this.publicKey=t.publicKey,this.version=t.version,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;let n=new fl(t.environment,hl(t.publicKey));this.httpInvoker=new ge(t.publicKey,t.version,n)}setAmount(e){this.amount=e}getAmount(){return this.amount}setCurrency(e){this.currency=e}getCurrency(){return this.currency}setCustomerInfo(e){this.customer=e?{...e}:null}getCustomerInfo(){return this.customer}setBillingAddress(e){this.billingAddress=e?{...e}:null}getBillingAddress(){return this.billingAddress}setOrderInfo(e){this.order=e?{...e}:null}getOrderInfo(){return this.order}setPaymentInfo(e){if(!e){this.paymentInfo=null;return}let t=e.expiryDate.split(`/`);this.paymentInfo={cardNumber:e.cardNumber,expiryDate:(t[1]||``)+(t[0]||``),cardholder:e.cardholder,ccv:e.ccv}}getPaymentInfo(){return this.paymentInfo}setGeolocation(e){this.geolocation=e?{...e}:null}getGeolocation(){return this.geolocation}cleanUp(e){e?.id===this.container?.id&&this.destroy?.()}setSuccessMessage(e){this.userSuccessMessage=e}getSuccessMessage(){return this.userSuccessMessage}setOnValidate(e){this.userOnValidate=e}getOnValidate(){return this.userOnValidate}createBaseApiRequest(){return{firstName:this.customer?.firstName,lastName:this.customer?.lastName,email:this.customer?.email,phone:this.customer?.phoneNumber,order:this.order&&{orderNumber:this.order.orderNumber,freightAmount:this.order.shippingAmount,dutyAmount:this.order.taxAmount,items:this.order.orderItems&&this.order.orderItems.map(e=>({productCode:e.sku,description:e.name,quantity:e.quantity,amount:e.unitPrice}))}||void 0,billingAddress:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,geolocation:this.geolocation||void 0}}};d([w],Wp.prototype,`setPaymentInfo`,null),d([w],Wp.prototype,`cleanUp`,null),vc(),nl(),ec(),mu(),Y();var{hideSpinner:Gp,showSpinner:Kp}=fu(),qp={CUSTOMER_INFO:`CUSTOMER_INFO`,PAYMENT_METHODS_INFO:`PAYMENT_METHODS_INFO`,TOKENISE:`TOKENISE`},Jp=(e,t)=>({[qp.CUSTOMER_INFO]:{url:e+`/customer/`+t,method:`GET`},[qp.PAYMENT_METHODS_INFO]:{url:e+`/customer/`+t+`/payment_method`,method:`GET`},[qp.TOKENISE]:{url:e+`/token/payment_method`,method:`POST`}}),Yp=class extends Wp{cssUrl=``;networkTokenProviders=[];validationStatusChangeCallback=null;threeDsProgressCallback;fraudProcessor=null;fraudManageOrder=null;constructor(e,t){super(e,t),this.cssUrl=t.cssUrl,this.validationStatusChangeCallback=t.onValidationStatusChangeCallback||null,this.threeDsProgressCallback=t.onThreeDsProgress,window.addEventListener(`message`,this.messageHandler.bind(this))}addFraudProcessor(e,t){this.fraudProcessor=e,this.fraudManageOrder=t}addPaymentMethods(e,t,n,r,i){if(this.log(`[addPaymentMethods]`,{amount:n,currency:r,customerId:t,options:i}),this.container=e,this.networkTokenProviders=i?.networkTokenProviders||[],this.networkTokenProviders=i?.networkTokenProviders||[],!dc(n))throw J(e,`Invalid amount: `+n),TypeError(`invalid amount: `+n);this.getCustomerData(t,a=>{this.log(`[addPaymentMethods], customerInfo`,a),this.getPaymentMethodsInfo(t,t=>{this.log(`[addPaymentMethods], paymentMethods`,t);let o=$s({el:this.container,component:Up,props:{el:e,log:this.log,cssUrl:this.cssUrl,clickGate:this.getOnValidate.bind(this),paymentMethods:t.filter(e=>!i?.tokenAuthenticationEnabled||i?.tokenAuthenticationEnabled&&e.networkToken?.schemeTokenId).map(e=>({paymentMethodId:e.paymentMethodId,customerId:e.customerId,type:e.type,card:e.card&&{cardNumber:e.card.cardNumber,cardholder:e.card.cardholder,expiryDate:e.card.expiryDate,scheme:e.card.type,cardType:e.card.cardType,bin:e.card.cardIin},bankPayment:e.bankPayment&&{bankCode:e.bankPayment.bankCode,accountNumber:e.bankPayment.accountNumber,accountName:e.bankPayment.accountName},payTo:e.payTo&&{payToId:e.payTo.payToId,status:e.payTo.status,payerName:e.payTo.payerName,payerPayIdDetails:e.payTo.payerPayIdDetails,payerDirectDebitDetails:e.payTo.payerDirectDebitDetails,providerId:e.payTo.providerId,providerType:e.payTo.providerType},providerId:e.providerId,providerType:e.providerType,dateAdded:e.dateAdded,dateRemoved:e.dateRemoved,isDefault:e.paymentMethodId===a.defaultPaymentMethod.paymentMethodId,email:e.email,networkTokenId:e.networkTokenId,networkToken:e.networkToken}))},on:{submit:T(this,`[PaymentMethods]: submit`,t=>{this.log(`[PaymentMethods]: submit`,t),t?.paymentMethodId&&(Kp(),setTimeout(()=>{this.onSubmit(e,n,r,i,t)},500))})}});this.destroy=o.destroy},e=>{this.failureCallback?.({error:e.message}),this.sendError(``,e.message)})},e=>{this.failureCallback?.({error:e.message}),this.sendError(``,e.message)})}tokenise(e,t,n,r,i,a){this.log(`[PaymentMethodProcessor][tokenise]`,{paymentMethodId:t,amount:n,currency:r,fraud:i,authenticationData:a});let o=T(this,`[PaymentMethodProcessor][tokenise], success`,(t,n)=>{this.log(`[PaymentMethodProcessor][tokenise], success`,t,n),Gp();let r=JSON.parse(n),i={token:r.tokenId};r.card&&(i.cardDetails={bin:r.card.cardIin,last4:(r.card.cardNumber||``).slice(-4),expiryDate:r.card.expiryDate,cardholder:r.card.cardholder,cardType:r.card.cardType,scheme:r.card.type}),r.card?.iinData&&(i.iinData={scheme:r.card.iinData.scheme||``,country:r.card.iinData.country||``,issuer:r.card.iinData.issuer||``,countryCode:r.card.iinData.countryCode||``,cardType:r.card.iinData.cardType||``}),this.successCallback?.(i),tl(e,this.getSuccessMessage())}),s=T(this,`[PaymentMethodProcessor][tokenise], failure`,(e,n)=>{this.log(`[PaymentMethodProcessor][tokenise], failure`,e,n),Gp();let r=JSON.parse(n);this.failureCallback?.({error:r.message}),this.sendError(t,r.message)}),c={paymentMethodId:t,amount:n,currency:r,authenticationData:a&&{VerificationType:a.verificationType,VerificationEntity:a.verificationEntity,VerificationMethod:a.verificationMethod,VerificationResults:a.verificationResults,VerificationTimestamp:a.verificationTimestamp,AdditionalData:a.additionalData,VerificationEvents:JSON.stringify(a.verificationEvents)},fraudCheck:i.fraudCheckResult,threeDSServerTransID:i.threeDSServerTransID,...this.createBaseApiRequest()};this.httpInvoker?.invoke(Jp(this.apiUrl)[qp.TOKENISE].url,Jp(this.apiUrl)[qp.TOKENISE].method,JSON.stringify(c),o,s)}getCustomerData(e,t,n){let r=T(this,`[getCustomerData], success`,(e,n)=>{this.log(`[getCustomerData], success`,e,n),t(JSON.parse(n))}),i=T(this,`[getCustomerData], failure`,(e,t)=>{this.log(`[getCustomerData], failure`,e,t),n(JSON.parse(t))});this.httpInvoker?.invoke(Jp(this.apiUrl,e)[qp.CUSTOMER_INFO].url,Jp(this.apiUrl,e)[qp.CUSTOMER_INFO].method,{},r,i)}getPaymentMethodsInfo(e,t,n){let r=T(this,`[getPaymentMethodsInfo], success`,(e,n)=>{this.log(`[getPaymentMethodsInfo], success`,e,n),t(JSON.parse(n))}),i=T(this,`[getPaymentMethodsInfo], failure`,(e,t)=>{this.log(`[getPaymentMethodsInfo], failure`,e,t),n(JSON.parse(t))});this.httpInvoker?.invoke(Jp(this.apiUrl,e)[qp.PAYMENT_METHODS_INFO].url,Jp(this.apiUrl,e)[qp.PAYMENT_METHODS_INFO].method,{},r,i)}onSubmit(e,t,n,r,i){if(!i?.paymentMethodId){this.failureCallback?.({error:`Invalid payment method`});return}let a=i.paymentMethodId;this.fraudProcessor?.setPaymentReference({paymentMethodId:a}),Zd(this.fraudProcessor,this.fraudManageOrder,e,{onShow:Gp,onProgress:this.threeDsProgressCallback,log:this.log}).then(T(this,`[PaymentMethodProcessor][fraudGate]`,o=>{`error`in o?(Gp(),J(e,o.error),this.failureCallback?.({error:o.error,...o.reason&&{errorDetails:{reason:o.reason}}}),this.sendError(a,o.reason||o.error)):this.onFraudGatePassed(e,t,n,o,r,i)}))}onFraudGatePassed(e,t,n,r,i,a){if(!i?.tokenAuthenticationEnabled||!a.networkToken?.schemeTokenId)this.tokenise(e,a.paymentMethodId,t,n,r);else if(i?.tokenAuthenticationEnabled&&a.networkToken?.schemeTokenId){let o={expiryDate:a.card?.expiryDate||``,cardholder:a.card?.cardholder||``,cardType:a.card?.cardType||``,scheme:a.card?.scheme||``},s=this.initTokenAuthenticationProcessor(``,a.networkToken?.schemeTokenId,a.networkToken?.schemeTokenData,a.networkToken?.authenticationMethod?.uriData.uri||``,o,i?.networkTokenOptions||{});if(!s){this.tokenise(e,a.paymentMethodId,t,n,r);return}s.invoke(this.amount,this.currency,T(this,`[sdk][paymentMethodProcessor], token authentication success`,i=>{this.log(`[sdk][paymentMethodProcessor], token authentication success`),this.tokenise(e,a.paymentMethodId,t,n,r,i.assuranceData?.verificationData?.[0])}),T(this,`[sdk][paymentMethodProcessor], token authentication error`,e=>{Gp(),this.log(`[sdk][paymentMethodProcessor], token authentication error`,e),this.failureCallback?.({error:`Token Authentication Error`})}))}}sendError(e,t){window.postMessage({status:`error`,component:`payment-methods`,paymentMethodId:e,error:t},`*`)}initTokenAuthenticationProcessor(e,t,n,r,i,a){this.log(`[initTokenAuthenticationProcessor]`,{token:e,networkTokenAuthenticateUrl:r,networkTokenOptions:a});let o=(i?.scheme||``).toLowerCase(),s=this.networkTokenProviders.find(e=>e.providerType.toLowerCase()===o);switch(String(s?.providerType).toLowerCase()){case`mastercard`:return new Uu(this.log.bind(this),{container:this.container,token:e,networkToken:t,networkTokenData:n,redirectUrl:r,networkTokenProvider:s,environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,networkTokenOptions:a});default:return this.log(`Unsupported network token provider`,o),null}}messageHandler(e){e?.data?.status&&e.data.status===`card-form-validation-status-change`&&(this.log(`[sdk][paymentMethodProcessor]: message "${e.data.status}" received`,e.data),Gp(),this.validationStatusChangeCallback?.(e.data.message?.status,e.data.message?.message))}};d([w],Yp.prototype,`addPaymentMethods`,null),d([w],Yp.prototype,`tokenise`,null),d([w],Yp.prototype,`getCustomerData`,null),d([w],Yp.prototype,`getPaymentMethodsInfo`,null),d([w],Yp.prototype,`onSubmit`,null),d([w],Yp.prototype,`onFraudGatePassed`,null),d([w],Yp.prototype,`sendError`,null),d([w],Yp.prototype,`initTokenAuthenticationProcessor`,null),d([w],Yp.prototype,`messageHandler`,null);var Xp,Zp,Qp,$p,em,tm,nm=o((()=>{G(),vd(),vc(),Xp={class:`mask`},Zp={class:`wrapper`},Qp={class:`container`},$p=[`action`],em=[`value`],tm=R({__name:`ThreeDsChallenge`,props:{threeDSServerTransID:{},acsTransID:{},formAction:{}},emits:[`close`,`submit`],setup(e,{emit:t}){let n=e,r=t,i=Wo(()=>gc(n.formAction)?n.formAction:``),a=F(null),o=JSON.stringify({threeDSServerTransID:n.threeDSServerTransID,acsTransID:n.acsTransID,messageVersion:`2.2.0`,messageType:`CReq`,challengeWindowSize:`01`}),s=encodeURI(window.btoa(o).replace(/=*$/,``));return za(()=>{i.value&&a.value?.submit()}),(e,t)=>(z(),B(`div`,Xp,[V(`div`,Zp,[V(`div`,Qp,[W(_d,{onClick:t[0]||=e=>r(`close`),id:`3ds-challenge-close`}),t[1]||=V(`iframe`,{name:`ThreeDsChallengeIFrame`},null,-1),V(`form`,{action:i.value,target:`ThreeDsChallengeIFrame`,method:`post`,ref_key:`form`,ref:a},[V(`input`,{type:`hidden`,name:`creq`,value:I(s)},null,8,em)],8,$p)])])]))}})})),rm=o((()=>{})),im=o((()=>{})),am,om=o((()=>{nm(),nm(),rm(),im(),q(),am=K(tm,[[`__scopeId`,`data-v-07081e85`]])})),sm,cm=o((()=>{sm=class{iframeId=`threeDsIframeMethod`;containerId=`payfurlContainerFormInvoker`;iframe=null;container=null;createIFrame(){this.iframe||(this.container=document.createElement(`div`),this.container.id=this.containerId,document.body.appendChild(this.container),this.iframe=document.createElement(`iframe`),this.iframe.name=this.iframeId,this.iframe.style.display=`none`,this.container.appendChild(this.iframe))}invoke(e,t,n,r,i){this.createIFrame();let a=document.createElement(`form`);a.action=e,a.target=this.iframeId,a.method=`post`,this.container?.appendChild(a);for(let e in n){let t=document.createElement(`input`);t.type=`hidden`,t.name=e,t.value=n[e],a.appendChild(t)}a.submit()}}})),lm,um,dm,fm=o((()=>{Y(),ec(),om(),cm(),mu(),{hideSpinner:lm,showSpinner:um}=fu(),dm=class{log;container;options;threeDsProcessor=null;threeDSDestroy=()=>{};threeDSServerTransID=``;threeDSAuthURL=``;threeDSRequestorTransID=``;threeDSMonitorURL=``;internalMessageHandler=this.messageHandler.bind(this);constructor(e,t,n){this.log=e,this.container=t,this.options=n}getType(){return`Default`}getDomain(){return``}onPreAuth(){this.log(`[${this.getType()}][onPreAuth]`),this.threeDsProcessor&&(um(),this.threeDsProcessor.onPreAuth(this.onInitAuthSuccess,this.onError),window.addEventListener(`message`,this.internalMessageHandler))}onAuth(e,t){this.log(`[${this.getType()}][onAuth]`,{threeDSAuthURL:this.threeDSAuthURL,threeDSRequestorTransID:this.threeDSRequestorTransID,threeDSServerTransID:this.threeDSServerTransID,isMethodPerformed:e}),this.threeDsProcessor?.onAuth(this.threeDSAuthURL,this.threeDSRequestorTransID,this.threeDSServerTransID,e,t,this.onDoAuthSuccess,this.onError)}onPostAuth(){this.log(`[${this.getType()}][onPostAuth]`,{threeDSServerTransID:this.threeDSServerTransID}),this.threeDsProcessor?.onPostAuth({threeDSServerTransID:this.threeDSServerTransID},this.onSuccess,this.onError)}setThreeDsProcessor(e){this.log(`[${this.getType()}][setThreeDsProcessor]`),this.threeDsProcessor=e}messageHandler(e){e?.data?.status&&e?.data?.status!==`tokenise-card-failure`&&(e.data.status===`3ds_method_invocation_complete`?(e.stopPropagation(),this.invocationComplete(e)):e.data.status===`3ds_challenge_complete`&&(e.stopPropagation(),this.challengeComplete(e)))}invocationComplete(e){this.log(`[${this.getType()}]: 3Ds Method invocation complete`),this.onAuth(!0,``)}challengeComplete(e){this.log(`[${this.getType()}]: 3Ds Challenge complete`,e.data),this.closeChallenge();let t=JSON.parse(window.atob(e.data.cres));this.log(`[${this.getType()}]: cresData`,t),[`Y`,`A`].includes(t.transStatus)?this.onPostAuth():[`N`,`U`,`R`].includes(t.transStatus)&&(this.log(`[${this.getType()}]: Failed 3DS Challenge`,e.data),this.onError(400,`Failed 3DS Challenge`))}setChallengeFrameVisible(e){e&&this.threeDsProcessor?.challengeShown(),window.self!==window.top&&window.parent.postMessage({status:e?zl:Bl},`*`)}doChallenge(e,t,n){this.log(`[${this.getType()}][doChallenge]`),lm(),this.setChallengeFrameVisible(!0);let{destroy:r}=$s({el:document.body,component:am,props:{threeDSServerTransID:this.threeDSServerTransID,acsTransID:t,formAction:e,authenticationValue:n},on:{close:()=>{r(),this.threeDSDestroy=()=>{},this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=r}closeChallenge(){this.threeDSDestroy?.(),this.setChallengeFrameVisible(!1),window.removeEventListener(`message`,this.internalMessageHandler)}onError=(e,t)=>{this.closeChallenge(),lm(),e===404?this.threeDsProcessor?.onError({error:`This feature is only supported by ActiveServer v1.1.2+`}):this.threeDsProcessor?.onError({error:su,body:t})};onSuccess=(e,t)=>{this.closeChallenge(),lm();let n=JSON.parse(t);[`Y`,`A`].includes(n.transStatus)?this.threeDsProcessor?.onSuccess(n):(this.log(`[${this.getType()}]: ${su}`,n),this.threeDsProcessor?.onError({error:su}))};threeDsMethodInvoke(e,t){this.log(`[${this.getType()}][threeDsMethodInvoke]`,{threeDSServerTransID:e,threeDSMethodURL:t});let n={threeDSServerTransID:e,threeDSMethodNotificationURL:this.options.apiUrl+`/3ds/method_invocation`},r=encodeURI(window.btoa(JSON.stringify(n)).replace(/=*$/,``));new sm().invoke(t,`POST`,{threeDSMethodData:r})}onInitAuthSuccess=(e,t)=>{let n=JSON.parse(t);this.log(`[${this.getType()}][onInitAuthSuccess]`,n),this.threeDSRequestorTransID=n.threeDSRequestorTransID,this.threeDSServerTransID=n.threeDSServerTransID,this.threeDSMonitorURL=n.threeDSMonitorURL,this.threeDSAuthURL=n.threeDSAuthURL,n.threeDSMethodURL?this.threeDsMethodInvoke(n.threeDSServerTransID,n.threeDSMethodURL):this.onAuth(!1,``)};onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);if(this.log(`[${this.getType()}][onDoAuthSuccess]`,n),!n.transStatus)this.onError(e,`No transStatus specified`);else switch(n.transStatus){case`C`:if(!n.acsURL){this.onError(e,`Invalid Challenge Url`);return}this.doChallenge(n.acsURL,n.acsTransID,n.authenticationValue);break;case`N`:this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`),this.onError(400,`3DS Verification failed, transaction denied`);break;case`U`:this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification`),this.onError(400,`Unable to perform 3DS verification`);break;case`R`:this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification, rejected at issuer`),this.onError(400,`Unable to perform 3DS verification, rejected at issuer`);break;default:this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`),this.threeDsProcessor?.onSuccess({threeDSServerTransID:n.threeDSServerTransID,threeDSRequestorTransID:``,acsRenderingType:n.acsRenderingType,acsTransID:n.acsTransID,authenticationType:n.authenticationType,authenticationValue:n.authenticationValue,challengeCancel:``,dsTransID:n.dsTransID,eci:n.eci,interactionCounter:``,messageCategory:``,messageExtension:n.messageExtension,messageType:n.messageType,messageVersion:n.messageVersion,transStatus:n.transStatus,transStatusReason:n.transStatusReason})}}}})),pm,mm,hm,gm,_m=o((()=>{G(),vd(),pm={class:`mask`},mm={class:`wrapper`},hm={class:`container`},gm=R({__name:`MetricsGlobalThreeDsChallenge`,emits:[`close`,`submit`],setup(e,{emit:t}){let n=t,r=F(!1);function i(e){[`3DS_CHALLENGE_SHOW`,`3DS_CHALLENGE_CLOSE`].includes(e.data?.message)&&(r.value=e.data.message===`3DS_CHALLENGE_SHOW`)}return za(()=>{window.addEventListener(`message`,i)}),Ua(()=>{window.removeEventListener(`message`,i)}),(e,t)=>Dr((z(),B(`div`,pm,[V(`div`,mm,[V(`div`,hm,[W(_d,{onClick:t[0]||=e=>n(`close`),id:`3ds-challenge-close`}),t[1]||=V(`div`,{id:`ThreeDsChallengeIFrame`},null,-1)])])],512)),[[Es,r.value]])}})})),vm=o((()=>{})),ym=o((()=>{})),bm,xm=o((()=>{_m(),_m(),vm(),ym(),q(),bm=K(gm,[[`__scopeId`,`data-v-8a0b6dcb`]])})),Sm,Cm,wm,Tm,Em=o((()=>{fm(),ec(),xm(),nl(),mu(),ye(),{hideSpinner:Sm,showSpinner:Cm}=fu(),wm=5,Tm=class extends dm{gateway;threeDS;numAttempts=0;constructor(e,t,n){super(e,t,n),this.initScript(n.clientParameters?.PublicKey||``)}getType(){return`MetricsGlobal`}getDomain(){return`secure.metricsglobalgateway.com`}onPreAuth(){this.log(`[${this.getType()}]: onPreAuth`),!this.threeDS&&this.numAttempts>=wm?(Sm(),J(this.container,`Error loading 3D Secure`)):!this.threeDS&&this.numAttempts<wm?(this.numAttempts++,this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`),setTimeout(()=>this.onPreAuth(),1e3)):this.threeDsProcessor?.getTokenId()?this.threeDsProcessor.getGatewayData(this.threeDsProcessor.getProviderId(),this.threeDsProcessor.getTokenId(),e=>this.startAuth(e),()=>this.threeDsProcessor?.onError({error:`Unable to get card information`})):this.startAuth()}onAuth(e,t){}onPostAuth(){}startAuth(e){this.log(`[${this.getType()}]: startAuth`);let t=this.threeDsProcessor?.getPaymentInfo();if(!t){Sm(),J(this.container,`Payment information is missing`);return}Cm();let n=this.threeDsProcessor?.getAddressInfo(),r=t.expiryDate.length===4?t.expiryDate.slice(2,4):``,i=t.expiryDate.length===4?t.expiryDate.slice(0,2):``,[a=``,o=``]=t.cardholder?.split(/\s+/)||[],s=this.threeDsProcessor?.getCurrency()||``,c=this.threeDsProcessor?.getAmount()||0;if(!e&&(!r||!i)){Sm(),J(this.container,`Card expiry date is invalid`),this.threeDsProcessor?.onError({error:`Card expiry date is invalid`});return}let l=e?.gatewayMetadata?.billing_id,u={...e?{customerVaultId:e.gatewayTokenId,...l?{billingId:l}:{}}:{cardNumber:t.cardNumber,cardExpMonth:r,cardExpYear:String(parseInt(i,10)+2e3)},currency:s,amount:c.toFixed(2),email:this.threeDsProcessor?.getEmail(),phone:n?.phoneNumber,city:n?.city,state:n?.state,address1:n?.streetAddress,country:n?.country,firstName:n?.firstName||a||`payFURL`,lastName:n?.lastName||o||`payFURL`,postalCode:n?.postalCode,deviceChannel:`02`,browserJavascriptEnabled:!0,browserJavaEnabled:!1,browserLanguage:window.navigator.language,browserColorDepth:String(ve()),browserScreenHeight:String(screen.height),browserScreenWidth:String(screen.width),browserTimeZone:String(Math.round(new Date().getTimezoneOffset()/60)),userAgent:navigator.userAgent},d=this.threeDS.createUI(u);d.start(`#ThreeDsChallengeIFrame`),d.on(`challenge`,e=>{this.log(`[${this.getType()}][onChallenge]`,e),Sm(),this.showChallenge()}),d.on(`complete`,e=>{this.log(`[${this.getType()}][onComplete]`,e),this.removeChallenge(),this.threeDsProcessor?.onSuccess({externalThreeDsData:e})}),d.on(`failure`,e=>{this.log(`[${this.getType()}][onFailure]`,e),Sm(),this.closeChallenge(),this.threeDsProcessor?.onError({error:e.message})}),d.on(`error`,e=>{this.log(`[${this.getType()}][error]`,e),Sm(),this.closeChallenge(),this.threeDsProcessor?.onError({error:e.message})})}initScript(e){let t=document.createElement(`script`);t.type=`text/javascript`,t.src=`https://${this.getDomain()}/js/v1/Gateway.js`,t.onload=()=>{this.initGateway(e),this.initChallenge()},document.head.appendChild(t)}initGateway(e){this.gateway=window.Gateway.create(e),this.threeDS=this.gateway.get3DSecure(),this.gateway.on(`error`,e=>{this.log(`[${this.getType()}]: gateway error`,e),this.threeDsProcessor?.onError({error:e.message}),this.threeDS=null,this.numAttempts=wm})}initChallenge(){let{destroy:e}=$s({el:document.body,component:bm,on:{close:()=>{this.closeChallenge(),this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=e}showChallenge(){this.setChallengeFrameVisible(!0),window.postMessage({message:`3DS_CHALLENGE_SHOW`},`*`)}closeChallenge(){this.setChallengeFrameVisible(!1),window.postMessage({message:`3DS_CHALLENGE_CLOSE`},`*`)}removeChallenge(){this.threeDSDestroy?.()}}})),Dm,Om=o((()=>{Em(),Dm=class extends Tm{getType(){return`CxPay`}getDomain(){return`cxpay.transactiongateway.com`}}})),km=c({default:()=>Am});function Am(e,t,n){return new Dm(e,t,n)}var jm=o((()=>{Om()})),Mm=c({default:()=>Nm});function Nm(e,t,n){return new dm(e,t,n)}var Pm=o((()=>{fm()})),Fm,Im,Lm,Rm,zm,Bm,Vm=o((()=>{G(),vd(),vc(),Fm={class:`mask`},Im={class:`wrapper`},Lm={class:`container`},Rm=[`action`],zm=[`value`],Bm=R({__name:`ecentric`,props:{threeDSServerTransID:{},acsTransID:{},formAction:{},authenticationValue:{}},emits:[`close`,`submit`],setup(e,{emit:t}){let n=e,r=t,i=Wo(()=>gc(n.formAction)?n.formAction:``),a=F(null),o=n.authenticationValue;return za(()=>{i.value&&a.value?.submit()}),(e,t)=>(z(),B(`div`,Fm,[V(`div`,Im,[V(`div`,Lm,[W(_d,{onClick:t[0]||=e=>r(`close`)}),t[1]||=V(`iframe`,{name:`ThreeDsChallengeIFrame`},null,-1),V(`form`,{action:i.value,target:`ThreeDsChallengeIFrame`,method:`post`,ref_key:`form`,ref:a},[V(`input`,{type:`hidden`,name:`PaReq`,value:I(o)},null,8,zm)],8,Rm)])])]))}})})),Hm=o((()=>{})),Um=o((()=>{})),Wm,Gm=o((()=>{Vm(),Vm(),Hm(),Um(),q(),Wm=K(Bm,[[`__scopeId`,`data-v-bdfafa40`]])})),Km,qm=o((()=>{fm(),ec(),Gm(),Km=class extends dm{paResPayload=``;getType(){return`Ecentric`}onPostAuth(){this.log(`[${this.getType()}][onPostAuth]`,{threeDSServerTransID:this.threeDSServerTransID,authenticationValue:this.paResPayload}),this.threeDsProcessor?.onPostAuth({threeDSServerTransID:this.threeDSServerTransID,authenticationValue:this.paResPayload},this.onSuccess,this.onError)}doChallenge(e,t,n){this.log(`[${this.getType()}][doChallenge]`),this.setChallengeFrameVisible(!0);let{destroy:r}=$s({el:document.body,component:Wm,props:{threeDSServerTransID:this.threeDSServerTransID,acsTransID:t,formAction:e,authenticationValue:n},on:{close:()=>{r(),this.setChallengeFrameVisible(!1),this.threeDSDestroy=()=>{},this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=r}challengeComplete(e){this.log(`[${this.getType()}]: 3Ds Challenge complete`,e.data),this.closeChallenge(),this.log(`[${this.getType()}]: cresData`,e.data.cres),e.data.cres?(this.paResPayload=e.data.cres,this.onPostAuth()):(this.log(`[${this.getType()}]: Failed 3DS Challenge`,e.data),this.onError(400,`Failed 3DS Challenge`))}}})),Jm=c({default:()=>Ym});function Ym(e,t,n){return new Km(e,t,n)}var Xm=o((()=>{qm()})),Zm,Qm=o((()=>{Em(),Zm=class extends Tm{getType(){return`EPNA`}getDomain(){return`epna.transactiongateway.com`}}})),$m=c({default:()=>eh});function eh(e,t,n){return new Zm(e,t,n)}var th=o((()=>{Qm()})),nh,rh=o((()=>{Em(),nh=class extends Tm{getType(){return`FlashBanc`}getDomain(){return`flashbanc.transactiongateway.com`}}})),ih=c({default:()=>ah});function ah(e,t,n){return new nh(e,t,n)}var oh=o((()=>{rh()}));function sh(){return typeof window.checkoutTools?.managedOrders?.manageOrder==`function`}function ch(e){if(sh())return Promise.resolve();let t=document.getElementById(`checkoutTools__script`)??lh(e);return new Promise((e,n)=>{t.addEventListener(`load`,()=>e()),t.addEventListener(`error`,()=>{t.remove(),n(Error(`Forter managedOrders script failed to load`))})})}function lh(e){let t=document.createElement(`script`);return t.type=`text/javascript`,t.id=mh,t.setAttribute(`data-site-id`,e),t.src=hh,t.addEventListener(`load`,()=>{t.dataset.loaded=`true`},{once:!0}),document.getElementsByTagName(`body`)[0].appendChild(t),t}function uh(e,t,n){let r=()=>{};if(sh())return dh(e,t,n),r;let i=document.getElementById(mh);if(!i)return n(Error(`Forter managedOrders script is not loaded`)),r;if(i.dataset.loaded)return n(Error(`Forter managedOrders script loaded without checkoutTools.managedOrders`)),r;let a=()=>{s(),sh()?dh(e,t,n):n(Error(`Forter managedOrders script loaded without checkoutTools.managedOrders`))},o=()=>{s(),n(Error(`Forter managedOrders script failed to load`))},s=()=>{i.removeEventListener(`load`,a),i.removeEventListener(`error`,o)};return i.addEventListener(`load`,a),i.addEventListener(`error`,o),s}function dh(e,t,n){window.checkoutTools.managedOrders.manageOrder(e,{challengeContainer:t??null},n)}var fh,ph,mh,hh,gh=o((()=>{fh=/^[A-Za-z0-9]+$/,ph=`v1.2`,mh=`checkoutTools__script`,hh=`https://sdk.checkouttools.com/${ph}/managedOrders.js`})),_h,vh,yh=o((()=>{fm(),gh(),mu(),Kd(),{hideSpinner:_h}=fu(),vh=class extends dm{getType(){return`Forter`}onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);this.log(`[${this.getType()}][onDoAuthSuccess]`,n);let r=this.options.clientParameters?.SiteId||``,i=n.managedOrderToken;!i||!fh.test(r)?this.onError(e,`3DS could not be started`):ch(r).then(()=>{let e=!1,t=Gd(this.container,()=>{e=!0,this.setChallengeFrameVisible(!0),_h()});uh(i,this.container,n=>{t(),e&&this.setChallengeFrameVisible(!1),n?(this.log(`[${this.getType()}]: manageOrder failed`,n),this.onError(400,`3DS failed`)):this.onPostAuth()})},e=>{this.log(`[${this.getType()}]: managedOrders.js failed to load`,e),this.onError(400,`3DS could not be started`)})}}})),bh=c({default:()=>xh});function xh(e,t,n){return new vh(e,t,n)}var Sh=o((()=>{yh()})),Ch,wh,Th,Eh,Dh=o((()=>{G(),vc(),Ch={class:`mask`},wh={class:`wrapper`},Th=[`src`],Eh=R({__name:`GPayments`,props:{url:{},width:{},height:{}},setup(e){let t=e,n=Wo(()=>gc(t.url)?t.url:``);function r(){return{width:`${t.width||650}px`,height:`${t.height||400}px`}}return(e,t)=>(z(),B(`div`,Ch,[V(`div`,wh,[V(`div`,{class:`container`,style:Me([r(),{padding:`0`,margin:`0`}])},[V(`iframe`,{src:n.value,style:Me(r())},null,12,Th)],4)])]))}})})),Oh=o((()=>{})),kh=o((()=>{})),Ah,jh=o((()=>{Dh(),Dh(),Oh(),kh(),q(),Ah=K(Eh,[[`__scopeId`,`data-v-cf5aa816`]])})),Mh,Nh,Ph=o((()=>{fm(),ec(),jh(),vc(),mu(),{hideSpinner:Mh}=fu(),Nh=class extends dm{getType(){return`GPayments`}doChallenge(e){this.log(`[${this.getType()}][doChallenge]`),Mh(),this.setChallengeFrameVisible(!0);let{destroy:t}=$s({el:document.body,component:Ah,props:{url:e,width:390,height:400},on:{close:()=>{t(),this.threeDSDestroy=()=>{}}}});this.threeDSDestroy=t}challengeComplete(e){this.log(`[${this.getType()}]: 3Ds Challenge complete`,e.data),this.closeChallenge(),this.onPostAuth()}onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);if(this.log(`[${this.getType()}][onDoAuthSuccess]`,n),!n.transStatus)this.onError(e,`No transStatus specified`);else switch(n.transStatus){case`C`:if(!n.acsURL){this.onError(e,`Invalid Challenge Url`);return}this.doChallenge(n.acsURL);break;default:this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`),this.onPostAuth()}};onInitAuthSuccess=(e,t)=>{let n=JSON.parse(t);this.log(`[${this.getType()}][onInitAuthSuccess]`,n),n.threeDSAuthURL?(this.threeDSRequestorTransID=n.threeDSRequestorTransID,this.threeDSServerTransID=n.threeDSServerTransID,this.threeDSMonitorURL=n.threeDSMonitorURL,this.threeDSAuthURL=n.threeDSAuthURL,n.threeDsServerCallbackUrl?this.initFrame(n.threeDsServerCallbackUrl):this.onAuth(!1,``)):this.onError(e,`No AuthUrl specified`)};initFrame(e){if(this.log(`[${this.getType()}][init3DSFrame]`,e),!gc(e))return;let t=document.createElement(`iframe`);t.src=e,t.style.width=`1px`,t.style.height=`1px`,t.style.border=`0`,document.body.appendChild(t)}}})),Fh=c({default:()=>Ih});function Ih(e,t,n){return new Nh(e,t,n)}var Lh=o((()=>{Ph()})),Rh=c({default:()=>zh});function zh(e,t,n){return new Tm(e,t,n)}var Bh=o((()=>{Em()})),Vh,Hh=o((()=>{Em(),Vh=class extends Tm{getType(){return`NMI`}getDomain(){return`secure.nmi.com`}}})),Uh=c({default:()=>Wh});function Wh(e,t,n){return new Vh(e,t,n)}var Gh=o((()=>{Hh()})),Kh,qh,Jh=o((()=>{G(),mu(),Kh={class:`mask`},qh=R({__name:`nuvei`,props:{threeDSServerTransID:{},sessionToken:{},env:{},merchantId:{},merchantSiteId:{},cardNumber:{},cardHolderName:{},expirationMonth:{},expirationYear:{},CVV:{},userPaymentOptionId:{},userTokenId:{},firstName:{},lastName:{},email:{},country:{}},setup(e){let{hideSpinner:t,showSpinner:n}=fu(),r=e;za(()=>{n();let e=document.createElement(`script`);e.type=`text/javascript`,e.src=`https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js`,e.onload=()=>{let e=new MutationObserver(function(){document.getElementsByClassName(`sfcModal-dialog`)[0]&&(t(),e.disconnect())}),n={childList:!0},r=document.querySelector(`body`);e.observe(r,n),i()},document.head.appendChild(e)});function i(){let e=window.SafeCharge({env:r.env,merchantId:r.merchantId,merchantSiteId:r.merchantSiteId});e.fields({fonts:[{cssUrl:`https://fonts.googleapis.com/css?family=Source+Code+Pro`}],locale:`en`});let t=r.userPaymentOptionId?{userPaymentOptionId:r.userPaymentOptionId,...r.CVV?{card:{CVV:r.CVV}}:{}}:{card:{cardNumber:r.cardNumber,cardHolderName:r.cardHolderName,expirationMonth:r.expirationMonth,expirationYear:r.expirationYear,CVV:r.CVV}};e.authenticate3d({sessionToken:r.sessionToken,...r.userTokenId?{userTokenId:r.userTokenId}:{},paymentOption:t,billingAddress:{firstName:r.firstName,lastName:r.lastName,email:r.email,country:r.country}},function(e){window.postMessage({status:`3ds_challenge_complete`,cres:e},`*`)})}return(e,t)=>(z(),B(`div`,Kh,[...t[0]||=[V(`div`,{class:`wrapper`},[V(`div`,{class:`container`})],-1)]]))}})})),Yh=o((()=>{})),Xh=o((()=>{})),Zh,Qh=o((()=>{Jh(),Jh(),Yh(),Xh(),q(),Zh=K(qh,[[`__scopeId`,`data-v-299db412`]])})),$h,eg,tg=o((()=>{ec(),Qh(),fm(),mu(),Y(),{hideSpinner:$h}=fu(),eg=class extends dm{_paResPayload=null;getType(){return`Nuvei`}onPostAuth(){this.log(`[${this.getType()}][onAuth] Do Post Authentication for transId`,this.threeDSServerTransID,this._paResPayload),this.threeDsProcessor?.onPostAuth({threeDSServerTransID:this.threeDSServerTransID,authenticationValue:this._paResPayload.cavv,eci:this._paResPayload.eci,dsTransID:this._paResPayload.dsTransID,threeDsVersion:this._paResPayload.threeDVersion,xid:this._paResPayload.xid},this.onSuccess,this.onError)}doNuveiChallenge(e,t,n){let r=JSON.parse(e);if(r===null||!r.merchantId||!r.merchantSiteId){this.threeDsProcessor?.onError({error:su});return}if(this.threeDsProcessor?.getTokenId()&&!r?.userPaymentOptionId){this.threeDsProcessor?.onError({error:`3D Secure with a token needs a token created on this Nuvei provider`});return}t&&(r.firstName=t.firstName,r.lastName=t.lastName,r.email=t.email,r.country=t.country),n&&(r.cardNumber=n.cardNumber,r.cardHolderName=n.cardholder||``,r.expirationMonth=n.expiryDate.substring(2,4),r.expirationYear=n.expiryDate.substring(0,2),r.CVV=n.ccv),this.setChallengeFrameVisible(!0);let{destroy:i}=$s({el:document.body,component:Zh,props:r,on:{close:()=>{i(),this.setChallengeFrameVisible(!1),this.threeDSDestroy=()=>{},this.threeDsProcessor?.onError({error:`Challenge cancelled`})}}});this.threeDSDestroy=i}onSuccess=(e,t)=>{this.closeChallenge(),$h();let n=JSON.parse(t);n.authenticationValue?this.threeDsProcessor?.onSuccess(n):(this.log(`[${this.getType()}][_onSuccess] ${su}`,n),this.threeDsProcessor?.onError({error:su}))};onDoAuthSuccess=(e,t)=>{let n=JSON.parse(t);if(this.log(`[${this.getType()}][onDoAuthSuccess]`,n),!n.transStatus||!n.authenticationValue)this.onError(e,`No transStatus specified`);else switch(n.transStatus){case`C`:this.doNuveiChallenge(n.authenticationValue,this.threeDsProcessor?.getAddressInfo(),this.threeDsProcessor?.getPaymentInfo());break;default:this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: `+n.transStatus),this.threeDsProcessor?.onSuccess({threeDSServerTransID:n.threeDSServerTransID,threeDSRequestorTransID:``,acsRenderingType:n.acsRenderingType,acsTransID:n.acsTransID,authenticationType:n.authenticationType,authenticationValue:n.authenticationValue,challengeCancel:``,dsTransID:n.dsTransID,eci:n.eci,interactionCounter:``,messageCategory:``,messageExtension:n.messageExtension,messageType:n.messageType,messageVersion:n.messageVersion,transStatus:n.transStatus,transStatusReason:n.transStatusReason})}};messageHandler(e){e?.data?.status&&(e.data.status===`3ds_method_invocation_complete`?(this.log(`[${this.getType()}][messageHandler] 3Ds Method invocation complete`),e.stopPropagation(),this.onAuth(!0,``)):e.data.status===`3ds_challenge_complete`&&(this.log(`[${this.getType()}][messageHandler] 3Ds Challenge complete`,e.data),e.stopPropagation(),this.closeChallenge(),e.data.cres&&e.data.cres?.result===`APPROVED`&&e.data.cres?.errCode===`0`?(this._paResPayload=e.data.cres,this.onPostAuth()):(this.log(`[${this.getType()}][messageHandler] Failed 3DS Challenge`,e.data),this.onError(400,`Failed 3DS Challenge`))))}}})),ng=c({default:()=>rg});function rg(e,t,n){return new eg(e,t,n)}var ig=o((()=>{tg()})),ag,og=o((()=>{Em(),ag=class extends Tm{getType(){return`Payabli`}getDomain(){return`centavo.transactiongateway.com`}}})),sg=c({default:()=>cg});function cg(e,t,n){return new ag(e,t,n)}var lg=o((()=>{og()}));function ug(e,...t){pg.value&&console.log(Ce(e),Ce(t))}function dg(e){e?.data?.status&&e.data.status===`init-card-form`&&(pg.value=!!e?.data?.debug)}function fg(){return za(()=>{window.addEventListener(`message`,dg)}),Ua(()=>{window.removeEventListener(`message`,dg)}),{debug:pg,logMessage:ug}}var pg,mg=o((()=>{G(),Y(),Oe(),pg=F(!1)})),hg,gg,_g,vg,yg=o((()=>{G(),mg(),vc(),hg={class:`modal-mask`},gg={class:`modal-wrapper`},_g=[`src`],vg=R({__name:`PayGLocalThreeDsChallenge`,props:{url:{}},emits:[`close`],setup(e,{emit:t}){let{logMessage:n}=fg(),r=e,i=t,a=F(r.url),o=Wo(()=>gc(a.value)?a.value:``);jr(()=>r.url,e=>{a.value=e}),za(()=>{window.addEventListener(`message`,s)}),Ua(()=>{window.removeEventListener(`message`,s)});function s(e){if(n(`PayGLocalThreeDsChallenge: Message received`,e.data),!e?.data?.[`payglocal-token`])return;let t=e.data[`payglocal-token`];n(`Token received`,t);let r=t.split(`.`)[1],a=window.atob(r),o=JSON.parse(a);i(`close`,o)}return(e,t)=>(z(),B(`div`,hg,[V(`div`,gg,[V(`iframe`,{src:o.value,sandbox:`allow-same-origin allow-scripts allow-popups allow-forms`},null,8,_g)])]))}})})),bg=o((()=>{})),xg=o((()=>{})),Sg,Cg=o((()=>{yg(),yg(),bg(),xg(),q(),Sg=K(vg,[[`__scopeId`,`data-v-9fa1282d`]])})),wg,Tg=o((()=>{fm(),nl(),ec(),Cg(),Y(),wg=class extends dm{getType(){return`PayGLocal`}onPreAuth(){this.log(`[${this.getType()}]: onPreAuth`),this.threeDsProcessor?.getTokenId()?this.threeDsProcessor.getGatewayData(this.threeDsProcessor.getProviderId(),this.threeDsProcessor.getTokenId(),e=>this.initChallenge(e.gatewayMetadata?.RedirectUrl||``),()=>this.threeDsProcessor?.onError({error:`Unable to get card information`})):this.threeDsProcessor?.tokeniseCard(this.threeDsProcessor.getProviderId(),e=>{this.log(`[${this.getType()}]: tokeniseCard`,e),this.initChallenge(e.gatewayTokenData.RedirectUrl)},e=>{J(this.container,e)})}onAuth(e,t){}onPostAuth(){}initChallenge(e){if(this.log(`[${this.getType()}]: initChallenge`,e),!e){J(this.container,`3D Secure URL is missing`);return}this.setChallengeFrameVisible(!0);let{destroy:t}=$s({el:document.body,component:Sg,props:{url:e},on:{close:e=>{this.closeChallenge(),this.log(`[${this.getType()}]: Challenge Results`,e),e.status===`AUTHORIZED`?this.threeDsProcessor?.onSuccess({acsRenderingType:{},acsTransID:``,authenticationType:``,authenticationValue:``,challengeCancel:``,dsTransID:``,eci:``,interactionCounter:``,messageCategory:``,messageExtension:[],messageType:``,messageVersion:``,threeDSRequestorTransID:``,threeDSServerTransID:``,transStatusReason:``,transStatus:`Y`}):e.status===`CUSTOMER_CANCELLED`?this.threeDsProcessor?.onError({error:`Challenge cancelled`}):this.threeDsProcessor?.onError({error:su})}}});this.threeDSDestroy=t}}})),Eg=c({default:()=>Dg});function Dg(e,t,n){return new wg(e,t,n)}var Og=o((()=>{Tg()})),kg,Ag=o((()=>{Em(),kg=class extends Tm{getType(){return`SkyBank`}getDomain(){return`secure.skybankgateway.com`}}})),jg=c({default:()=>Mg});function Mg(e,t,n){return new kg(e,t,n)}var Ng=o((()=>{Ag()})),Pg,Fg=o((()=>{Pg=`ICAgIChmdW5jdGlvbiAoKSB7CiAgICAgICAgdmFyIG1lcmNoYW50Q29uZmlnID0gewogICAgICAgICAgICBjc3A6IGZhbHNlLAogICAgICAgIH07CgogICAgICAgIHZhciBzaXRlSWQgPSAnMmU2NTE1YWEwYjhlJzsKZnVuY3Rpb24gdCh0LGUpe2Zvcih2YXIgbj10LnNwbGl0KCIiKSxyPTA7cjxuLmxlbmd0aDsrK3IpbltyXT1TdHJpbmcuZnJvbUNoYXJDb2RlKG5bcl0uY2hhckNvZGVBdCgwKStlKTtyZXR1cm4gbi5qb2luKCIiKX1mdW5jdGlvbiBlKGUpe3JldHVybiB0KGUsLV8pLnJlcGxhY2UoLyVTTiUvZyxzaXRlSWQpfWZ1bmN0aW9uIG4odCl7dHJ5e2lmKCJudW1iZXIiPT10eXBlb2YgdCYmd2luZG93LmxvY2F0aW9uJiZ3aW5kb3cubG9jYXRpb24ucGF0aG5hbWUpe2Zvcih2YXIgZT13aW5kb3cubG9jYXRpb24ucGF0aG5hbWUuc3BsaXQoIi8iKSxuPVtdLHI9MDtyPD1NYXRoLm1pbihlLmxlbmd0aC0xLE1hdGguYWJzKHQpKTtyKyspbi5wdXNoKGVbcl0pO3JldHVybiBuLmpvaW4oIi8iKXx8Ii8ifX1jYXRjaCh0KXt9cmV0dXJuIi8ifWZ1bmN0aW9uIHIoKXt2YXIgdD0ibm8iKyJvcCIrImZuIixlPSJnIisiYSIsbj0ibiIrImFtZSI7cmV0dXJuIHdpbmRvd1tlXSYmd2luZG93W2VdW25dPT09dH1mdW5jdGlvbiBvKCl7cmV0dXJuISghbmF2aWdhdG9yLmJyYXZlfHwiZnVuY3Rpb24iIT10eXBlb2YgbmF2aWdhdG9yLmJyYXZlLmlzQnJhdmUpfWZ1bmN0aW9uIGkoKXtyZXR1cm4gZG9jdW1lbnQuY3VycmVudFNjcmlwdCYmZG9jdW1lbnQuY3VycmVudFNjcmlwdC5zcmN9ZnVuY3Rpb24gYSh0KXt0cnl7JC5leD10LHIoKSYmLTE9PT0kLmV4LmluZGV4T2Yoei51QikmJigkLmV4Kz16LnVCKSxvKCkmJi0xPT09JC5leC5pbmRleE9mKHoudUJyKSYmKCQuZXgrPXoudUJyKSxpKCkmJi0xPT09JC5leC5pbmRleE9mKHoubklMKSYmKCQuZXgrPXoubklMKSx3aW5kb3cuZnRyX19zbnBfY3djfHwoJC5leCs9ei5zKSxIKCQpfWNhdGNoKHQpe319ZnVuY3Rpb24gYyh0LGUpe2Z1bmN0aW9uIG4oaSl7dHJ5e2kuYmxvY2tlZFVSST09PXQmJmkuZGlzcG9zaXRpb249PT1vJiYoZSgpLGRvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIocixuKSl9Y2F0Y2godCl7ZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcihyLG4pfX12YXIgcj0ic2VjdXJpdHlwb2xpY3l2aW9sYXRpb24iLG89ImVuZm9yY2UiO2RvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIocixuKSxzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7ZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcihyLG4pfSwyKjYwKjFlMyl9ZnVuY3Rpb24gZih0LGUsbixyKXt2YXIgbz0hMTt0PSJodHRwczovLyIrdCxjKHQsZnVuY3Rpb24oKXtyKCEwKSxvPSEwfSk7dmFyIGk9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgic2NyaXB0Iik7aWYoaS5vbmVycm9yPWZ1bmN0aW9uKCl7aWYoIW8pdHJ5e3IoITEpLG89ITB9Y2F0Y2godCl7fX0saS5vbmxvYWQ9bixpLnR5cGU9InRleHQvamF2YXNjcmlwdCIsaS5pZD0iZnRyX19zY3JpcHQiLGkuYXN5bmM9ITAsaS5zcmM9dCx3aW5kb3cuZnRyX19jb25maWcmJndpbmRvdy5mdHJfX2NvbmZpZy5tJiYhMD09PXdpbmRvdy5mdHJfX2NvbmZpZy5tLnB0YiYmZG9jdW1lbnQuYm9keSlkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGkpO2Vsc2V7dmFyIGE9ZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoInNjcmlwdCIpWzBdO2EucGFyZW50Tm9kZS5pbnNlcnRCZWZvcmUoaSxhKX19ZnVuY3Rpb24gdSgpe3NldFRpbWVvdXQobCxCLHoudURGKX1mdW5jdGlvbiBzKHQsZSxuLHIpe3ZhciBvPSExLGk9bmV3IFhNTEh0dHBSZXF1ZXN0O2lmKGMoImh0dHBzOiIrdCxmdW5jdGlvbigpe24obmV3IEVycm9yKCJDU1AgVmlvbGF0aW9uIiksITApLG89ITB9KSwiLy8iPT09dC5zbGljZSgwLDIpJiYodD0iaHR0cHM6Iit0KSwid2l0aENyZWRlbnRpYWxzImluIGkpaS5vcGVuKCJHRVQiLHQsITApO2Vsc2V7aWYoInVuZGVmaW5lZCI9PXR5cGVvZiBYRG9tYWluUmVxdWVzdClyZXR1cm47aT1uZXcgWERvbWFpblJlcXVlc3QsaS5vcGVuKCJHRVQiLHQpfU9iamVjdC5rZXlzKHIpLmZvckVhY2goZnVuY3Rpb24odCl7aS5zZXRSZXF1ZXN0SGVhZGVyKHQsclt0XSl9KSxpLm9ubG9hZD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiBlJiZlKGkpfSxpLm9uZXJyb3I9ZnVuY3Rpb24odCl7aWYoImZ1bmN0aW9uIj09dHlwZW9mIG4mJiFvKXRyeXtuKHQsITEpLG89ITB9Y2F0Y2godCl7fX0saS5vbnByb2dyZXNzPWZ1bmN0aW9uKCl7fSxpLm9udGltZW91dD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiBuJiZuKCJ0aW0iKyJlbyIrInV0IiwhMSl9LHNldFRpbWVvdXQoZnVuY3Rpb24oKXtpLnNlbmQoKX0sMCl9ZnVuY3Rpb24gZCh0LHNpdGVJZCxlKXtmdW5jdGlvbiBuKHQpe3ZhciBlPXQudG9TdHJpbmcoMTYpO3JldHVybiBlLmxlbmd0aCUyPyIwIitlOmV9ZnVuY3Rpb24gcih0KXtpZih0PD0wKXJldHVybiIiO2Zvcih2YXIgZT0iMDEyMzQ1Njc4OWFiY2RlZiIsbj0iIixyPTA7cjx0O3IrKyluKz1lW01hdGguZmxvb3IoTWF0aC5yYW5kb20oKSplLmxlbmd0aCldO3JldHVybiBufWZ1bmN0aW9uIG8odCl7Zm9yKHZhciBlPSIiLHI9MDtyPHQubGVuZ3RoO3IrKyllKz1uKHQuY2hhckNvZGVBdChyKSk7cmV0dXJuIGV9ZnVuY3Rpb24gaSh0KXtmb3IodmFyIGU9dC5zcGxpdCgiIiksbj0wO248ZS5sZW5ndGg7KytuKWVbbl09U3RyaW5nLmZyb21DaGFyQ29kZSgyNTVeZVtuXS5jaGFyQ29kZUF0KDApKTtyZXR1cm4gZS5qb2luKCIiKX1lPWU/IjEiOiIwIjt2YXIgYT1bXTtyZXR1cm4gYS5wdXNoKHQpLGEucHVzaChzaXRlSWQpLGEucHVzaChlKSxmdW5jdGlvbih0KXt2YXIgZT00MCxuPSIiO3JldHVybiB0Lmxlbmd0aDxlLzImJihuPSIsIityKGUvMi10Lmxlbmd0aC0xKSksbyhpKHQrbikpfShhLmpvaW4oIiwiKSl9ZnVuY3Rpb24gaCgpe2Z1bmN0aW9uIHQoKXtNJiZzZXRUaW1lb3V0KGwsQix6LmRVQUwpfWZ1bmN0aW9uIGUodCxlKXtNPWU/IkYiKyJUIisiUiIrIkEiKyJVIisiQyI6IkYiKyJUIisiUiIrIkEiKyJVIixzZXRUaW1lb3V0KGwsQix6LnVBUyl9d2luZG93LmZ0cl9fZmRhZCh0LGUpfWZ1bmN0aW9uIHcoKXtmdW5jdGlvbiB0KCl7TSYmc2V0VGltZW91dChsLEIsei51REFEKX1mdW5jdGlvbiBlKHQsZSl7TT1lPyJGIisiVCIrIlIiKyJBIisiVSIrIkMiOiJGIisiVCIrIlIiKyJBIisiVSIsc2V0VGltZW91dChsLEIsei51RFMpfXdpbmRvdy5mdHJfX3JhZGQodCxlKX1mdW5jdGlvbiBsKHQpe2Z1bmN0aW9uIGUoKXtmb3IodmFyIHQ9MDt0PD16LnRtb3NTZWNzLmxlbmd0aDt0KyspY2xlYXJUaW1lb3V0KGV0W3RdKX1mdW5jdGlvbiBuKCl7dHJ5e2UoKSxhKHQrei51Uyl9Y2F0Y2godCl7fX1mdW5jdGlvbiByKG4pe3RyeXtlKCksJC50ZD0xKm5ldyBEYXRlLSQudHMsYShuP3Qrei51Rit6LmNQOnQrei51RiksdD09PXoudUZQJiZ1KCksdD09PXoudURGJiYoaj93KCk6aCgpKSx0IT09ei51QVMmJnQhPT16LmRVQUx8fGp8fHcoKSx0IT09ei51RFMmJnQhPT16LnVEQUR8fGomJmgoKX1jYXRjaCh0KXthKHouZVVvZSl9fXRyeXshZnVuY3Rpb24odCl7Zm9yKHZhciBlPTA7ZTw9ei50bW9zU2Vjcy5sZW5ndGg7ZSsrKWU9PT16LnRtb3NTZWNzLmxlbmd0aD9ldFtlXT1zZXRUaW1lb3V0KHIsMWUzKnoudG1vc1NlY3NbZS0xXSsxZTMpOmV0W2VdPXNldFRpbWVvdXQoYSwxZTMqei50bW9zU2Vjc1tlXSx0K3oudG1vc1tlXSl9KHQpO3ZhciBvO3N3aXRjaCh0KXtjYXNlIHoudUZQOm89TjticmVhaztjYXNlIHoudURGOm89STticmVhaztkZWZhdWx0Om89TX1pZighbylyZXR1cm47aWYobz09PSJGIisiVCIrIlIiKyJBIisiVSIrIkMiKXJldHVybiB2b2lkIHIoITApO2lmKG89PT0iRiIrIlQiKyJSIisiQSIrIlUiKXJldHVybiB2b2lkIHIoITEpO2Yobyx2b2lkIDAsbixyKX1jYXRjaChlKXthKHQrei5lVGx1KX19dmFyIGc9IjIyZzVpejZ2OnVpaHN2fXcxZm9yeGdpdXJxdzFxaHcydndkd3h2Iix2PSJmb3J0IixwPSJlclRvIixtPSJrZW4iLF89Mzt3aW5kb3cuZnRyX19jb25maWc9e206bWVyY2hhbnRDb25maWcsczoiMzEiLHNpOnNpdGVJZH07dmFyIHk9ITEsVT0hMSxULHgsQT12K3ArbSxTPTQwMCoyNCo2MCxELEM9MTA7RD17d3JpdGU6ZnVuY3Rpb24odCxlLHIsbyl7dm9pZCAwPT09byYmKG89ITApO3ZhciBpPTA7d2luZG93LmZ0cl9fY29uZmlnJiZ3aW5kb3cuZnRyX19jb25maWcubSYmd2luZG93LmZ0cl9fY29uZmlnLm0uY2tEZXB0aCYmKGk9d2luZG93LmZ0cl9fY29uZmlnLm0uY2tEZXB0aCk7dmFyIGEsYyxmPW4oaSk7aWYocj8oYT1uZXcgRGF0ZSxhLnNldFRpbWUoYS5nZXRUaW1lKCkrNjAqcioxZTMpLGM9IjsgZXhwaXJlcz0iK2EudG9HTVRTdHJpbmcoKSk6Yz0iIiwhbylyZXR1cm4gdm9pZChkb2N1bWVudC5jb29raWU9ZXNjYXBlKHQpKyI9Iitlc2NhcGUoZSkrYysiOyBwYXRoPSIrZik7Zm9yKHZhciB1PTEscz1kb2N1bWVudC5kb21haW4uc3BsaXQoIi4iKSxkPUMsaD0hMDtoJiZzLmxlbmd0aD49dSYmZD4wOyl7dmFyIHc9cy5zbGljZSgtdSkuam9pbigiLiIpO2RvY3VtZW50LmNvb2tpZT1lc2NhcGUodCkrIj0iK2VzY2FwZShlKStjKyI7IHBhdGg9IitmKyI7IGRvbWFpbj0iK3c7dmFyIGw9RC5yZWFkKHQpO251bGwhPWwmJmw9PWV8fCh3PSIuIit3LGRvY3VtZW50LmNvb2tpZT1lc2NhcGUodCkrIj0iK2VzY2FwZShlKStjKyI7IHBhdGg9IitmKyI7IGRvbWFpbj0iK3cpLGg9LTE9PT1kb2N1bWVudC5jb29raWUuaW5kZXhPZih0KyI9IitlKSx1KyssZC0tfX0scmVhZDpmdW5jdGlvbih0KXt2YXIgZT1udWxsO3RyeXtmb3IodmFyIG49ZXNjYXBlKHQpKyI9IixyPWRvY3VtZW50LmNvb2tpZS5zcGxpdCgiOyIpLG89MzIsaT0wO2k8ci5sZW5ndGg7aSsrKXtmb3IodmFyIGE9cltpXTthLmNoYXJDb2RlQXQoMCk9PT1vOylhPWEuc3Vic3RyaW5nKDEsYS5sZW5ndGgpOzA9PT1hLmluZGV4T2YobikmJihlPXVuZXNjYXBlKGEuc3Vic3RyaW5nKG4ubGVuZ3RoLGEubGVuZ3RoKSkpfX1maW5hbGx5e3JldHVybiBlfX19O3ZhciBSPXdpbmRvdy5mdHJfX2NvbmZpZy5zO1IrPSJjayI7dmFyIEw9ZnVuY3Rpb24odCl7dmFyIGU9ITEsbj1udWxsLHI9ZnVuY3Rpb24oKXt0cnl7aWYoIW58fCFlKXJldHVybjtuLnJlbW92ZSYmImZ1bmN0aW9uIj09dHlwZW9mIG4ucmVtb3ZlP24ucmVtb3ZlKCk6ZG9jdW1lbnQuaGVhZC5yZW1vdmVDaGlsZChuKSxlPSExfWNhdGNoKHQpe319O2RvY3VtZW50LmhlYWQmJighZnVuY3Rpb24oKXtuPWRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImxpbmsiKSxuLnNldEF0dHJpYnV0ZSgicmVsIiwicHJlIisiY29uIisibmVjdCIpLG4uc2V0QXR0cmlidXRlKCJjcm9zIisic29yaSIrImdpbiIsImFub255bW91cyIpLG4ub25sb2FkPXIsbi5vbmVycm9yPXIsbi5zZXRBdHRyaWJ1dGUoImhyZWYiLHQpLGRvY3VtZW50LmhlYWQuYXBwZW5kQ2hpbGQobiksZT0hMH0oKSxzZXRUaW1lb3V0KHIsM2UzKSl9LEU9ZShnfHwiMjJnNWl6NnY6dWloc3Z9dzFmb3J4Z2l1cnF3MXFodzJ2d2R3eHYiKSxxPXQoIlswVWh0eGh2dzBMRyIsLV8pLGI9dCgiWzBGcnV1aG9kd2xycTBMRyIsLV8pLFA9dCgiTGkwUXJxaDBQZHdmayIsLV8pLGs9ZSgiZHNzMXZsd2hzaHVpcnVwZHFmaHdodncxcWh3IiksRj1lKCIyMjQxNDE0MTQyZ3F2MHR4aHV8IiksTSxPPSJmZ3E3MWlydXdodTFmcnAiLEksVjtJPWUoIihWUSgxIitPKyIydnEyKFZRKDJ2ZnVsc3cxbXYiKSxWPWUoIihWUSgxIitPKyIydnFWMihWUSgydmZ1bHN3MW12Iik7dmFyIE47d2luZG93LmZ0cl9fY29uZmlnJiZ3aW5kb3cuZnRyX19jb25maWcubSYmd2luZG93LmZ0cl9fY29uZmlnLm0uZnBpJiYoTj1lKCJmZ3E3MSIpK3dpbmRvdy5mdHJfX2NvbmZpZy5tLmZwaStlKCIydnEyKFZRKDJ2ZnVsc3cxbXYiKSk7dmFyIGo9ITE7aj0hMTt2YXIgQj0xMDt3aW5kb3cuZnRyX19zdGFydFNjcmlwdExvYWQ9MSpuZXcgRGF0ZTt2YXIgRz1mdW5jdGlvbih0KXt2YXIgZT0iZnQiKyJyOnRvayIrImVuUiIrImVhZHkiO3dpbmRvdy5mdHJfX3R0JiZjbGVhclRpbWVvdXQod2luZG93LmZ0cl9fdHQpLHdpbmRvdy5mdHJfX3R0PXNldFRpbWVvdXQoZnVuY3Rpb24oKXt0cnl7ZGVsZXRlIHdpbmRvdy5mdHJfX3R0LHQrPSJfdHQiO3ZhciBuPWRvY3VtZW50LmNyZWF0ZUV2ZW50KCJFdmVudCIpO24uaW5pdEV2ZW50KGUsITEsITEpLG4uZGV0YWlsPXQsZG9jdW1lbnQuZGlzcGF0Y2hFdmVudChuKX1jYXRjaCh0KXt9fSwxZTMpfSxIPWZ1bmN0aW9uKHQpe3ZhciBlPWZ1bmN0aW9uKHQpe3JldHVybiB0fHwiIn0sbj1lKHQuaWQpKyJfIitlKHQudHMpKyJfIitlKHQudGQpKyJfIitlKHQuZXgpKyJfIitlKFIpLHI9UzshaXNOYU4od2luZG93LmZ0cl9fY29uZmlnLm0uY2tUVEwpJiZ3aW5kb3cuZnRyX19jb25maWcubS5ja1RUTCYmKHI9d2luZG93LmZ0cl9fY29uZmlnLm0uY2tUVEwpLEQud3JpdGUoQSxuLHIsITApLEcobiksd2luZG93LmZ0cl9fZ3Q9bn0sWD1mdW5jdGlvbigpe3ZhciB0PUQucmVhZChBKXx8IiIsZT10LnNwbGl0KCJfIiksbj1mdW5jdGlvbih0KXtyZXR1cm4gZVt0XXx8dm9pZCAwfTtyZXR1cm57aWQ6bigwKSx0czpuKDEpLHRkOm4oMiksZXg6bigzKSx2cjpuKDQpfX0sUT1mdW5jdGlvbigpe2Zvcih2YXIgdD17fSxlPSJmZ3UiLG49W10scj0wO3I8MjU2O3IrKyluW3JdPShyPDE2PyIwIjoiIikrci50b1N0cmluZygxNik7dmFyIG89ZnVuY3Rpb24odCxlLHIsbyxpKXt2YXIgYT1pPyItIjoiIjtyZXR1cm4gblsyNTUmdF0rblt0Pj44JjI1NV0rblt0Pj4xNiYyNTVdK25bdD4+MjQmMjU1XSthK25bMjU1JmVdK25bZT4+OCYyNTVdK2ErbltlPj4xNiYxNXw2NF0rbltlPj4yNCYyNTVdK2Erbls2MyZyfDEyOF0rbltyPj44JjI1NV0rYStuW3I+PjE2JjI1NV0rbltyPj4yNCYyNTVdK25bMjU1Jm9dK25bbz4+OCYyNTVdK25bbz4+MTYmMjU1XStuW28+PjI0JjI1NV19LGk9ZnVuY3Rpb24oKXtpZih3aW5kb3cuVWludDMyQXJyYXkmJndpbmRvdy5jcnlwdG8mJndpbmRvdy5jcnlwdG8uZ2V0UmFuZG9tVmFsdWVzKXt2YXIgdD1uZXcgd2luZG93LlVpbnQzMkFycmF5KDQpO3JldHVybiB3aW5kb3cuY3J5cHRvLmdldFJhbmRvbVZhbHVlcyh0KSx7ZDA6dFswXSxkMTp0WzFdLGQyOnRbMl0sZDM6dFszXX19cmV0dXJue2QwOjQyOTQ5NjcyOTYqTWF0aC5yYW5kb20oKT4+PjAsZDE6NDI5NDk2NzI5NipNYXRoLnJhbmRvbSgpPj4+MCxkMjo0Mjk0OTY3Mjk2Kk1hdGgucmFuZG9tKCk+Pj4wLGQzOjQyOTQ5NjcyOTYqTWF0aC5yYW5kb20oKT4+PjB9fSxhPWZ1bmN0aW9uKCl7dmFyIHQ9IiIsZT1mdW5jdGlvbih0LGUpe2Zvcih2YXIgbj0iIixyPXQ7cj4wOy0tciluKz1lLmNoYXJBdCgxZTMqTWF0aC5yYW5kb20oKSVlLmxlbmd0aCk7cmV0dXJuIG59O3JldHVybiB0Kz1lKDIsIjAxMjM0NTY3ODkiKSx0Kz1lKDEsIjEyMzQ1Njc4OSIpLHQrPWUoOCwiMDEyMzQ1Njc4OSIpfTtyZXR1cm4gdC5zYWZlR2VuZXJhdGVOb0Rhc2g9ZnVuY3Rpb24oKXt0cnl7dmFyIHQ9aSgpO3JldHVybiBvKHQuZDAsdC5kMSx0LmQyLHQuZDMsITEpfWNhdGNoKHQpe3RyeXtyZXR1cm4gZSthKCl9Y2F0Y2godCl7fX19LHQuaXNWYWxpZE51bWVyaWNhbFRva2VuPWZ1bmN0aW9uKHQpe3JldHVybiB0JiZ0LnRvU3RyaW5nKCkubGVuZ3RoPD0xMSYmdC5sZW5ndGg+PTkmJnBhcnNlSW50KHQsMTApLnRvU3RyaW5nKCkubGVuZ3RoPD0xMSYmcGFyc2VJbnQodCwxMCkudG9TdHJpbmcoKS5sZW5ndGg+PTl9LHQuaXNWYWxpZFVVSURUb2tlbj1mdW5jdGlvbih0KXtyZXR1cm4gdCYmMzI9PT10LnRvU3RyaW5nKCkubGVuZ3RoJiYvXlthLXowLTldKyQvLnRlc3QodCl9LHQuaXNWYWxpZEZHVVRva2VuPWZ1bmN0aW9uKHQpe3JldHVybiAwPT10LmluZGV4T2YoZSkmJnQubGVuZ3RoPj0xMn0sdH0oKSx6PXt1REY6IlVERiIsZFVBTDoiZFVBTCIsdUFTOiJVQVMiLHVEUzoiVURTIix1REFEOiJVREFEIix1RlA6IlVGUCIsbUxkOiIxIixlVGx1OiIyIixlVW9lOiIzIix1UzoiNCIsdUY6IjkiLHRtb3M6WyJUNSIsIlQxMCIsIlQxNSJdLHRtb3NTZWNzOls1LDEwLDE1XSxiSVI6IjQzIix1QjoidSIsdUJyOiJiIixjUDoiYyIsbklMOiJpIixzOiJzIn07dHJ5e3ZhciAkPVgoKTt0cnl7JC5pZCYmKFEuaXNWYWxpZE51bWVyaWNhbFRva2VuKCQuaWQpfHxRLmlzVmFsaWRVVUlEVG9rZW4oJC5pZCl8fFEuaXNWYWxpZEZHVVRva2VuKCQuaWQpKT93aW5kb3cuZnRyX19uY2Q9ITE6KCQuaWQ9US5zYWZlR2VuZXJhdGVOb0Rhc2goKSx3aW5kb3cuZnRyX19uY2Q9ITApLCQudHM9d2luZG93LmZ0cl9fc3RhcnRTY3JpcHRMb2FkLEgoJCksd2luZG93LmZ0cl9fc25wX2N3Yz0hIUQucmVhZChBKSx3aW5kb3cuZnRyX19zbnBfY3djfHwoST1WKTtmb3IodmFyIEo9ImZvciIrInRlciIrIi5jbyIrIm0iLEs9Imh0IisidHBzOi8vYyIrImRuOS4iK0osVz0iaHQiKyJ0cHM6Ly8iKyQuaWQrIi0iK3NpdGVJZCsiLmNkIisibi4iK0osWT0iaHR0cCIrInM6Ly9jZCIrIm4zLiIrSixaPVtLLFcsWV0sdHQ9MDt0dDxaLmxlbmd0aDt0dCsrKUwoWlt0dF0pO3ZhciBldD1uZXcgQXJyYXkoei50bW9zU2Vjcy5sZW5ndGgpO3dpbmRvdy5mdHJfX2ZkYWQ9ZnVuY3Rpb24oZSxuKXtpZih5KXJldHVybiB3aW5kb3cuZnRyX19hbHRkMj14LHZvaWQgZSgpO3k9ITA7dmFyIHI9e307cltQXT1kKHdpbmRvdy5mdHJfX2NvbmZpZy5zLHNpdGVJZCx3aW5kb3cuZnRyX19jb25maWcubS5jc3ApLHMoRSxmdW5jdGlvbihuKXt0cnl7dmFyIHI9bi5nZXRBbGxSZXNwb25zZUhlYWRlcnMoKS50b0xvd2VyQ2FzZSgpO2lmKHIuaW5kZXhPZihiLnRvTG93ZXJDYXNlKCkpPj0wKXt2YXIgbz1uLmdldFJlc3BvbnNlSGVhZGVyKGIpO3g9d2luZG93LmZ0cl9fYWx0ZDI9dChhdG9iKG8pLC1fLTEpfWlmKHIuaW5kZXhPZihxLnRvTG93ZXJDYXNlKCkpPDApcmV0dXJuO3ZhciBpPW4uZ2V0UmVzcG9uc2VIZWFkZXIocSksYT10KGF0b2IoaSksLV8tMSk7aWYoYSl7dmFyIGM9YS5zcGxpdCgiOiIpO2lmKGMmJjI9PT1jLmxlbmd0aCl7Zm9yKHZhciBmPWNbMF0sdT1jWzFdLHM9IiIsZD0wLGg9MDtkPDIwOysrZClzKz1kJTM+MCYmaDwxMj9zaXRlSWQuY2hhckF0KGgrKyk6JC5pZC5jaGFyQXQoZCk7dmFyIHc9dS5zcGxpdCgiLCIpO2lmKHcubGVuZ3RoPjEpe3ZhciBsPXdbMF0sZz13WzFdO009ZisiLyIrbCsiLiIrcysiLiIrZ319fWUoKX1jYXRjaCh0KXt9fSxmdW5jdGlvbih0LGUpe24mJm4odCxlKX0scil9LHdpbmRvdy5mdHJfX3JhZGQ9ZnVuY3Rpb24odCxlKXtmdW5jdGlvbiBuKGUpe3RyeXt2YXIgbj1lLnJlc3BvbnNlLHI9ZnVuY3Rpb24odCl7ZnVuY3Rpb24gZSh0LG4saSl7dHJ5e2lmKGk+PXIpcmV0dXJue25hbWU6IiIsbmV4dE9mZnNldFRvUHJvY2VzczpuLGVycm9yOiJNYXggcG9pbnRlciBkZXJlZmVyZW5jZSBkZXB0aCBleGNlZWRlZCJ9O2Zvcih2YXIgYT1bXSxjPW4sZj10LmdldFVpbnQ4KGMpLHU9MDt1PG87KXtpZih1KyssMTkyPT0oMTkyJmYpKXt2YXIgcz0oNjMmZik8PDh8dC5nZXRVaW50OChjKzEpLGQ9ZSh0LHMsaSsxKTtpZihkLmVycm9yKXJldHVybiBkO3ZhciBoPWQubmFtZTtyZXR1cm4gYS5wdXNoKGgpLHtuYW1lOmEuam9pbigiLiIpLG5leHRPZmZzZXRUb1Byb2Nlc3M6YysyfX1pZighKGY+MCkpe2lmKDAhPT1mKXJldHVybntuYW1lOiIiLG5leHRPZmZzZXRUb1Byb2Nlc3M6YyxlcnJvcjoiVW5leHBlY3RlZCBsZW5ndGggYXQgdGhlIGVuZCBvZiBuYW1lOiAiK2YudG9TdHJpbmcoKX07cmV0dXJue25hbWU6YS5qb2luKCIuIiksbmV4dE9mZnNldFRvUHJvY2VzczpjKzF9fWZvcih2YXIgdz0iIixsPTE7bDw9ZjtsKyspdys9U3RyaW5nLmZyb21DaGFyQ29kZSh0LmdldFVpbnQ4KGMrbCkpO2EucHVzaCh3KSxjKz1mKzEsZj10LmdldFVpbnQ4KGMpfXJldHVybntuYW1lOiIiLG5leHRPZmZzZXRUb1Byb2Nlc3M6YyxlcnJvcjoiTWF4IGl0ZXJhdGlvbnMgZXhjZWVkZWQifX1jYXRjaCh0KXtyZXR1cm57bmFtZToiIixuZXh0T2Zmc2V0VG9Qcm9jZXNzOm4sZXJyb3I6IlVuZXhwZWN0ZWQgZXJyb3Igd2hpbGUgcGFyc2luZyByZXNwb25zZTogIit0LnRvU3RyaW5nKCl9fX12YXIgbixyPTQsbz0xMDAsaT0xNixhPW5ldyBEYXRhVmlldyh0KSxjPWEuZ2V0VWludDE2KDApLGY9YS5nZXRVaW50MTYoMiksdT1hLmdldFVpbnQxNig0KSxzPWEuZ2V0VWludDE2KDYpLGQ9YS5nZXRVaW50MTYoOCksaD1hLmdldFVpbnQxNigxMCksdz0xMixsPVtdLGc9MDtmb3IoZz0wO2c8dTtnKyspe2lmKG49ZShhLHcsMCksbi5lcnJvcil0aHJvdyBuZXcgRXJyb3Iobi5lcnJvcik7aWYodz1uLm5leHRPZmZzZXRUb1Byb2Nlc3MsIU51bWJlci5pc0ludGVnZXIodykpdGhyb3cgbmV3IEVycm9yKCJpbnZhbGlkIHJldHVybmVkIG9mZnNldCIpO3ZhciB2PW4ubmFtZSxwPWEuZ2V0VWludDE2KHcpO3crPTI7dmFyIG09YS5nZXRVaW50MTYodyk7dys9MixsLnB1c2goe3FuYW1lOnYscXR5cGU6cCxxY2xhc3M6bX0pfXZhciBfPVtdO2ZvcihnPTA7ZzxzO2crKyl7aWYobj1lKGEsdywwKSxuLmVycm9yKXRocm93IG5ldyBFcnJvcihuLmVycm9yKTtpZih3PW4ubmV4dE9mZnNldFRvUHJvY2VzcywhTnVtYmVyLmlzSW50ZWdlcih3KSl0aHJvdyBuZXcgRXJyb3IoImludmFsaWQgcmV0dXJuZWQgb2Zmc2V0Iik7dmFyIHk9bi5uYW1lLFU9YS5nZXRVaW50MTYodyk7aWYoVSE9PWkpdGhyb3cgbmV3IEVycm9yKCJVbmV4cGVjdGVkIHJlY29yZCB0eXBlOiAiK1UudG9TdHJpbmcoKSk7dys9Mjt2YXIgVD1hLmdldFVpbnQxNih3KTt3Kz0yO3ZhciB4PWEuZ2V0VWludDMyKHcpO3crPTQ7dmFyIEE9YS5nZXRVaW50MTYodyk7dys9Mjtmb3IodmFyIFM9IiIsRD13LEM9MDtEPHcrQSYmQzxvOyl7QysrO3ZhciBSPWEuZ2V0VWludDgoRCk7RCs9MTtTKz0obmV3IFRleHREZWNvZGVyKS5kZWNvZGUodC5zbGljZShELEQrUikpLEQrPVJ9aWYoQz49byl0aHJvdyBuZXcgRXJyb3IoIk1heCBpdGVyYXRpb25zIGV4Y2VlZGVkIHdoaWxlIHJlYWRpbmcgVFhUIGRhdGEiKTt3Kz1BLF8ucHVzaCh7bmFtZTp5LHR5cGU6VSxjbGFzczpULHR0bDp4LGRhdGE6U30pfXJldHVybnt0cmFuc2FjdGlvbklkOmMsZmxhZ3M6ZixxdWVzdGlvbkNvdW50OnUsYW5zd2VyQ291bnQ6cyxhdXRob3JpdHlDb3VudDpkLGFkZGl0aW9uYWxDb3VudDpoLHF1ZXN0aW9uczpsLGFuc3dlcnM6X319KG4pO2lmKCFyKXRocm93IG5ldyBFcnJvcigiRXJyb3IgcGFyc2luZyBETlMgcmVzcG9uc2UiKTtpZighKCJhbnN3ZXJzImluIHIpKXRocm93IG5ldyBFcnJvcigiVW5leHBlY3RlZCByZXNwb25zZSIpO3ZhciBvPXIuYW5zd2VycztpZigwPT09by5sZW5ndGgpdGhyb3cgbmV3IEVycm9yKCJObyBhbnN3ZXJzIGZvdW5kIik7dmFyIGk9b1swXS5kYXRhO2k9aS5yZXBsYWNlKC9eIiguKikiJC8sIiQxIik7dmFyIGE9ZnVuY3Rpb24odCl7dmFyIGU9NDAsbj0zMixyPTEyNjt0cnl7Zm9yKHZhciBvPWF0b2IodCksaT0iIixhPTA7YTxvLmxlbmd0aDthKyspaSs9ZnVuY3Rpb24odCl7dmFyIG89dC5jaGFyQ29kZUF0KDApLGk9by1lO3JldHVybiBpPG4mJihpPXItKG4taSkrMSksU3RyaW5nLmZyb21DaGFyQ29kZShpKX0ob1thXSk7cmV0dXJuIGF0b2IoaSl9Y2F0Y2godCl7cmV0dXJufX0oaSk7aWYoIWEpdGhyb3cgbmV3IEVycm9yKCJmYWlsZWQgdG8gZGVjb2RlIHRoZSB2YWx1ZSIpO3ZhciBjPWZ1bmN0aW9uKHQpe3ZhciBlPSJfIisiRCIrIkwiKyJNIisiXyIsbj10LnNwbGl0KGUpO2lmKCEobi5sZW5ndGg8Mikpe3ZhciByPW5bMF0sbz1uWzFdO2lmKCEoci5zcGxpdCgiLiIpLmxlbmd0aC0xPDEpKXJldHVybntqVVJMOnIsZVVSTDpvfX19KGEpO2lmKCFjKXRocm93IG5ldyBFcnJvcigiZmFpbGVkIHRvIHBhcnNlIHRoZSB2YWx1ZSIpO3ZhciBmPWMualVSTCx1PWMuZVVSTDtNPWZ1bmN0aW9uKHQpe2Zvcih2YXIgZT0iIixuPTAscj0wO248MjA7KytuKWUrPW4lMz4wJiZyPDEyP3NpdGVJZC5jaGFyQXQocisrKTokLmlkLmNoYXJBdChuKTtyZXR1cm4gdC5yZXBsYWNlKCIvUFJNMSIsIiIpLnJlcGxhY2UoIi9QUk0yIiwiL21haW4uIikucmVwbGFjZSgiL1BSTTMiLGUpLnJlcGxhY2UoIi9QUk00IiwiLmpzIil9KGYpLFQ9d2luZG93LmZ0cl9fYWx0ZDM9dSx0KCl9Y2F0Y2godCl7fX1mdW5jdGlvbiByKHQsbil7ZSYmZSh0LG4pfWlmKFUpcmV0dXJuIHdpbmRvdy5mdHJfX2FsdGQzPVQsdm9pZCB0KCk7d2luZG93LmZ0cl9fY29uZmlnLm0uZHI9PT0iTiIrIkQiKyJSIiYmZShuZXcgRXJyb3IoIk4iKyJEIisiUiIpLCExKSxGJiZrfHxlKG5ldyBFcnJvcigiRCIrIlAiKyJQIiksITEpLFU9ITA7dHJ5e3ZhciBvPWZ1bmN0aW9uKHQpe2Zvcih2YXIgZT1uZXcgVWludDhBcnJheShbMCwwXSksbj1uZXcgVWludDhBcnJheShbMSwwXSkscj1uZXcgVWludDhBcnJheShbMCwxXSksbz1uZXcgVWludDhBcnJheShbMCwwXSksaT1uZXcgVWludDhBcnJheShbMCwwXSksYT1uZXcgVWludDhBcnJheShbMCwwXSksYz10LnNwbGl0KCIuIiksZj1bXSx1PTA7dTxjLmxlbmd0aDt1Kyspe3ZhciBzPWNbdV07Zi5wdXNoKHMubGVuZ3RoKTtmb3IodmFyIGQ9MDtkPHMubGVuZ3RoO2QrKylmLnB1c2gocy5jaGFyQ29kZUF0KGQpKX1mLnB1c2goMCk7dmFyIGg9MTYsdz1uZXcgVWludDhBcnJheShbMCxoXSksbD1uZXcgVWludDhBcnJheShbMCwxXSksZz1uZXcgVWludDhBcnJheShlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCtmLmxlbmd0aCt3Lmxlbmd0aCtsLmxlbmd0aCk7cmV0dXJuIGcuc2V0KGUsMCksZy5zZXQobixlLmxlbmd0aCksZy5zZXQocixlLmxlbmd0aCtuLmxlbmd0aCksZy5zZXQobyxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCksZy5zZXQoaSxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCksZy5zZXQoYSxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCksZy5zZXQoZixlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCksZy5zZXQodyxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCtmLmxlbmd0aCksZy5zZXQobCxlLmxlbmd0aCtuLmxlbmd0aCtyLmxlbmd0aCtvLmxlbmd0aCtpLmxlbmd0aCthLmxlbmd0aCtmLmxlbmd0aCt3Lmxlbmd0aCksZ30oayk7IWZ1bmN0aW9uKHQsZSxuLHIsbyl7dmFyIGk9ITEsYT1uZXcgWE1MSHR0cFJlcXVlc3Q7aWYoYygiaHR0cHM6Iit0LGZ1bmN0aW9uKCl7byhuZXcgRXJyb3IoIkNTUCBWaW9sYXRpb24iKSwhMCksaT0hMH0pLCIvLyI9PT10LnNsaWNlKDAsMikmJih0PSJodHRwczoiK3QpLCJ3aXRoQ3JlZGVudGlhbHMiaW4gYSlhLm9wZW4oIlBPU1QiLHQsITApO2Vsc2V7aWYoInVuZGVmaW5lZCI9PXR5cGVvZiBYRG9tYWluUmVxdWVzdClyZXR1cm47YT1uZXcgWERvbWFpblJlcXVlc3QsYS5vcGVuKCJQT1NUIix0KX1hLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiLGEuc2V0UmVxdWVzdEhlYWRlcigiQ29udGVudC1UeXBlIixlKSxhLm9ubG9hZD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiByJiZyKGEpfSxhLm9uZXJyb3I9ZnVuY3Rpb24odCl7aWYoImZ1bmN0aW9uIj09dHlwZW9mIG8mJiFpKXRyeXtvKHQsITEpLGk9ITB9Y2F0Y2godCl7fX0sYS5vbnByb2dyZXNzPWZ1bmN0aW9uKCl7fSxhLm9udGltZW91dD1mdW5jdGlvbigpeyJmdW5jdGlvbiI9PXR5cGVvZiBvJiZvKCJ0aW0iKyJlbyIrInV0IiwhMSl9LHNldFRpbWVvdXQoZnVuY3Rpb24oKXthLnNlbmQobil9LDApfShGLCJhcHBsaWNhdGlvbi9kbnMtbWVzc2FnZSIsbyxuLHIpfWNhdGNoKHQpe2UodCwhMSl9fTt2YXIgbnQ9Tj96LnVGUDp6LnVERjtzZXRUaW1lb3V0KGwsQixudCl9Y2F0Y2godCl7YSh6Lm1MZCl9fWNhdGNoKHQpe319KSgpOwo=`})),Ig=c({default:()=>Lg});function Lg(e){document.addEventListener(`ftr:tokenReady`,function(e){Rg=e.detail});let t=e?.SiteId||``;if(!fh.test(t))console.warn(`Forter site id is missing or invalid; device intel and checkoutTools are not loaded`,t);else{if(!document.getElementById(t)){let e=document.createElement(`script`);e.type=`text/javascript`,e.id=t,e.innerHTML=window.atob(Pg).replace(zg,`var siteId = '${t}';`),document.getElementsByTagName(`body`)[0].appendChild(e)}ch(t).catch(e=>console.warn(e))}return{getFraudCheckData:Bg,manageOrder:uh}}var Rg,zg,Bg,Vg=o((()=>{Fg(),gh(),Rg=``,zg=/var siteId = '[^']*';/,Bg=(e,t,n,r,i,a,o,s,c,l,u)=>JSON.stringify({siteId:c.SiteId,providerId:e,amount:t,currency:n,paymentInformation:r,paypalInformation:i,walletInformation:u,tokenId:l?.tokenId??null,paymentMethodId:l?.paymentMethodId??null,customerInfo:a?{firstName:a.firstName,lastName:a.lastName,email:a.email,phone:a.phoneNumber}:null,address:o?{line1:o.streetAddress,line2:o.streetAddress2,city:o.city,country:o.country,postalCode:o.postalCode,state:o.state}:null,order:s?{items:(s.orderItems??[]).map(e=>({productCode:e.sku,quantity:Number(e.quantity),amount:Number(e.unitPrice)}))}:null,connectionInformation:{userAgent:navigator.userAgent,cookie:Rg,checkoutTime:Date.now()}})})),Hg={cxpay:()=>Promise.resolve().then(()=>(jm(),km)),default:()=>Promise.resolve().then(()=>(Pm(),Mm)),ecentric:()=>Promise.resolve().then(()=>(Xm(),Jm)),epna:()=>Promise.resolve().then(()=>(th(),$m)),flashbanc:()=>Promise.resolve().then(()=>(oh(),ih)),forter:()=>Promise.resolve().then(()=>(Sh(),bh)),gpayments:()=>Promise.resolve().then(()=>(Lh(),Fh)),metrics_global:()=>Promise.resolve().then(()=>(Bh(),Rh)),nmi:()=>Promise.resolve().then(()=>(Gh(),Uh)),nuvei:()=>Promise.resolve().then(()=>(ig(),ng)),payabli:()=>Promise.resolve().then(()=>(lg(),sg)),payglocal:()=>Promise.resolve().then(()=>(Og(),Eg)),skybank:()=>Promise.resolve().then(()=>(Ng(),jg))},Ug={forter:()=>Promise.resolve().then(()=>(Vg(),Ig))};async function Wg(e){let t=Hg[e.toLowerCase()];if(!t)throw Error(`Module ${e} not found`);return await t()}async function Gg(e){let t=Ug[e.toLowerCase()];if(!t)throw Error(`Module ${e} not found`);return await t()}ec(),he(),vc(),_e(),nl(),de(),pl(),yl(),Y(),mu(),Oe();var{hideSpinner:Kg}=fu(),qg={PROVIDER_INFO:`PROVIDER_INFO`,PROVIDERS_INFO:`PROVIDERS_INFO`},Jg=(e,t,n)=>({[qg.PROVIDERS_INFO]:{url:e+`/info/providers/`,method:`GET`},[qg.PROVIDER_INFO]:{url:e+(n?`/info/providers/token/`+n:`/info/providers/`+t),method:`GET`}}),$=class{_submitFormHandlers={};_destroyDropIns={};environment=C.PRODUCTION;debug=!1;config=fe(C.PRODUCTION);publicKey=``;amount=0;currency=``;geolocation=null;httpInvoker=null;regionResolver=null;threeDsProcessor=null;secondaryThreeDsProcessor=null;paypalProcessor=null;cardProcessor=null;payToProcessor=null;checkoutProcessors=[];fraudProcessor=null;fraudManageOrder=null;skipCardFraud=!1;get cardFraudProcessor(){return this.skipCardFraud?null:this.fraudProcessor}googlePayProcessor=null;applePayProcessor=null;clickToPayProcessor=null;paymentMethodProcessor=null;userOnSuccess=null;userOnFailure=null;userOnLoaded=null;userOnPaymentMethodStatus=null;userOnThreeDsProgress=null;userSuccessMessage=ou;userOnValidationStatusChange=null;userOnValidate;billingAddress=null;customer=null;order=null;paymentOptions={};initProcessorsRunning=!1;initProcessorsQueue=[];init(e,t,n){if(this.environment=String(e).toLowerCase(),be.init(this.environment,t,ue.version),window._payfurl)return window._payfurl;if(this.debug=n,this.publicKey=t,this.config=fe(this.environment),!this.config)throw this.showErrorMessage(null,`Error: Unable to configure SDK due to an incorrect environment setting.`),this.userOnFailure?.({error:`Unable to configure SDK`}),TypeError(`Error: Unable to configure SDK due to an incorrect environment setting.`);return this.regionResolver=new fl(e,hl(t)),this.httpInvoker=new ge(t,ue.version,this.regionResolver),this.loadCss(),window._payfurl=this,window.addEventListener(`message`,this.messageHandler.bind(this)),this}execute(){window.postMessage({status:Ml},`*`)}messageHandler(e){if(!e?.data?.status||(e.data.status===`payfurl-init`&&this.userOnLoaded?.(),e.source!==window))return;let{paymentMethod:t,providerType:n}=e.data;e.data.status===`payfurl-init`&&t&&this.paymentMethodStatus({paymentMethod:t,...n&&{providerType:n},status:`rendered`}),e.data.status===`payfurl-payment-method-unavailable`&&this.paymentMethodStatus({paymentMethod:t,...n&&{providerType:n},status:`unavailable`,reason:e.data.reason,message:e.data.message})}paymentMethodStatus(e){this.log(`[paymentMethodStatus]`,e);try{this.userOnPaymentMethodStatus?.(e)}catch(e){console.error(`[payfurl] onPaymentMethodStatus handler threw`,Ce(e))}}threeDsProgress(e){this.log(`[threeDsProgress]`,e);try{this.userOnThreeDsProgress?.(e)}catch(e){console.error(`[payfurl] onThreeDsProgress handler threw`,Ce(e))}}initCardProcessor(e){if(this.log(`[initCardProcessor]`,{container:e}),this.cardProcessor)return this.cardProcessor;let t=new qu(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,url:this.config.url,secureUrl:this.config.secureUrl,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[cardProcessor], success`,t=>{this.log(`[cardProcessor], success`,t),t.token&&(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)),this.userOnSuccess?.(t)}),onFailure:T(this,`[cardProcessor], failure`,e=>{this.log(`[cardProcessor], failure`,e);let t=af(e.body)||e.errorDetails;e.body&&!t&&this.log(`[cardProcessor], failure`,`no structured error detail in body`),this.userOnFailure?.({error:e.error,...t&&{errorDetails:t}})}),onValidationStatusChangeCallback:T(this,`[cardProcessor], ValidationStatusChange`,(e,t)=>{this.log(`[cardProcessor], ValidationStatusChange`,e,t),this.userOnValidationStatusChange?.(e,t)}),onThreeDsProgress:this.threeDsProgress.bind(this)});return this.amount&&t.setAmount(this.amount),this.currency&&t.setCurrency(this.currency),this.customer&&t.setCustomerInfo(this.customer),this.billingAddress&&t.setBillingAddress(this.billingAddress),this.order&&t.setOrderInfo(this.order),this.threeDsProcessor&&t.addThreeDsProcessor(this.threeDsProcessor),this.secondaryThreeDsProcessor&&t.addSecondaryThreeDsProcessor(this.secondaryThreeDsProcessor),this.fraudProcessor&&t.addFraudProcessor(this.cardFraudProcessor),this.clickToPayProcessor&&t.addClickToPayProcessor(this.clickToPayProcessor),t.setSuccessMessage(this.userSuccessMessage),t.setOnValidate(this.userOnValidate),this.cardProcessor=t,t}initClickToPayProcessor(e,t){return this.log(`[initClickToPayProcessor]`,{options:t}),this.clickToPayProcessor||=new Q(this.log.bind(this),{container:e,environment:this.environment,options:t}),this.clickToPayProcessor}initPaypalProcessor(e){if(this.log(`[initPaypalProcessor]`,{container:e}),this.paypalProcessor)return this.paypalProcessor;let t=new Mu(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[paypalProcessor], success`,t=>{this.log(`[paypalProcessor], success`,t,this.userOnSuccess),!this.userOnSuccess&&t.transactionId&&(this._setToken(e,t.transactionId,`transactionId`),setTimeout(()=>{this.getForm(e)?.submit()},500)),this.userOnSuccess?.({transactionId:t.transactionId})}),onFailure:T(this,`[paypalProcessor], failure`,e=>{this.log(`[paypalProcessor], failure`,e),this.userOnFailure?.({error:e.error})})});return this.amount&&t.setAmount(this.amount),this.fraudProcessor&&t.addFraudProcessor(this.fraudProcessor),t.setSuccessMessage(this.userSuccessMessage),t.setOnValidate(this.userOnValidate),this.paypalProcessor=t,t}initCheckoutProcessor(e){this.log(`[initCheckoutProcessor]`,{container:e});let t=new zd(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,redirectUrl:this.config.redirectUrl,version:ue.version,onSuccess:T(this,`[checkoutProcessor], success`,t=>{this.log(`[checkoutProcessor], success`,t),this.userOnSuccess||(t.transactionId&&this._setToken(e,t.transactionId,`transactionId`),t.token&&this._setToken(e,t.token,`token`),setTimeout(()=>{this.getForm(e)?.submit()},500));let n={};t.transactionId&&(n.transactionId=t.transactionId),t.token&&(n.token=t.token),this.userOnSuccess?.(n)}),onFailure:T(this,`[checkoutProcessor], failure`,e=>{this.log(`[checkoutProcessor], failure`,e);let t=af(e.body);this.userOnFailure?.({error:e.error,...t&&{errorDetails:t}})})});return t.setOnValidate(this.userOnValidate),this.checkoutProcessors.push(t),t}initGooglePayProcessor(e){if(this.log(`[initGooglePayProcessor]`,{container:e}),this.googlePayProcessor)return this.googlePayProcessor;let t=new pf(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[googlePayProcessor], success`,t=>{this.log(`[googlePayProcessor], success`,t),!this.userOnSuccess&&t.transactionId&&(this._setToken(e,t.transactionId,`transactionId`),setTimeout(()=>{this.getForm(e)?.submit()},500)),this.userOnSuccess?.({transactionId:t.transactionId})}),onFailure:T(this,`[googlePayProcessor], failure`,e=>{this.log(`[googlePayProcessor], failure`,e),this.userOnFailure?.({error:e.error,...e.errorDetails&&{errorDetails:e.errorDetails}})})});return this.amount&&t.setAmount(this.amount),this.currency&&t.setCurrency(this.currency),this.billingAddress&&t.setBillingAddress(this.billingAddress),this.customer&&t.setCustomerInfo(this.customer),this.order&&t.setOrderInfo(this.order),t.addFraudProcessor(this.fraudProcessor),t.setOnValidate(this.userOnValidate),this.googlePayProcessor=t,this.googlePayProcessor}initApplePayProcessor(e){if(this.log(`[initApplePayProcessor]`,{container:e}),this.applePayProcessor)return this.applePayProcessor;let t=new Gf(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,onSuccess:T(this,`[applePayProcessor], success`,t=>{this.log(`[applePayProcessor], success`,t),!this.userOnSuccess&&t.transactionId?(this._setToken(e,t.transactionId,`transactionId`),setTimeout(()=>{this.getForm(e)?.submit()},500)):!this.userOnSuccess&&t.token?(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)):this.userOnSuccess?.({transactionId:t.transactionId,token:t.token})}),onFailure:T(this,`[applePayProcessor], failure`,e=>{this.log(`[applePayProcessor], failure`,e),this.userOnFailure?.({error:e.error,...e.errorDetails&&{errorDetails:e.errorDetails}})})});return this.amount&&t.setAmount(this.amount),this.currency&&t.setCurrency(this.currency),this.customer&&t.setCustomerInfo(this.customer),this.billingAddress&&t.setBillingAddress(this.billingAddress),this.order&&t.setOrderInfo(this.order),t.addFraudProcessor(this.fraudProcessor),t.setOnValidate(this.userOnValidate),this.applePayProcessor=t,this.applePayProcessor}initPayToProcessor(e){return this.log(`[initPayToProcessor]`,{container:e}),this.payToProcessor||(this.payToProcessor=new dd(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,getPaymentOptions:this.getPaymentOptions.bind(this),onSuccess:T(this,`[payToProcessor], success`,t=>{this.log(`[payToProcessor], success`,t),t.token&&(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)),this.userOnSuccess?.({token:t.token})}),onFailure:T(this,`[payToProcessor], failure`,e=>{this.log(`[payToProcessor], failure`,e);let t=af(e.body);this.userOnFailure?.({error:e.error,...t&&{errorDetails:t}})})}),this.payToProcessor.setOnValidate(this.userOnValidate)),this.payToProcessor}initPaymentMethodProcessor(e){return this.log(`[initPaymentMethodProcessor]`,{container:e}),this.paymentMethodProcessor||(this.paymentMethodProcessor=new Yp(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,cssUrl:this.config.cssUrl,version:ue.version,onSuccess:T(this,`[paymentMethodProcessor], success`,t=>{this.log(`[paymentMethodProcessor], success`,t),t.token&&(this._setToken(e,t.token),setTimeout(()=>{this.userOnSuccess||this.getForm(e)?.submit()},500)),this.userOnSuccess?.(t)}),onFailure:T(this,`[paymentMethodProcessor], failure`,e=>{this.log(`[paymentMethodProcessor], failure`,e),this.userOnFailure?.({error:e.error,...e.errorDetails&&{errorDetails:e.errorDetails}})}),onValidationStatusChangeCallback:T(this,`[paymentMethodProcessor], ValidationStatusChange`,(e,t)=>{this.log(`[paymentMethodProcessor], ValidationStatusChange`,e,t),this.userOnValidationStatusChange?.(e,t)}),onThreeDsProgress:this.threeDsProgress.bind(this)}),this.initBaseProcessor(this.paymentMethodProcessor),this.fraudProcessor&&this.paymentMethodProcessor.addFraudProcessor(this.cardFraudProcessor,this.fraudManageOrder)),this.paymentMethodProcessor}loadCss(){let e=document.createElement(`link`);e.href=this.config.cssUrl+`style.css?v=`+Math.random(),e.rel=`stylesheet`,e.media=`screen,print`,document.getElementsByTagName(`head`)[0].appendChild(e)}log(e,...t){this.debug&&console.log(Ce(e),Ce(t))}_cleanUp(e){if(this.getSubmit(e)?.removeEventListener(`click`,this.getSubmitFormHandler(e)),this.getForm(e)?.removeEventListener(`submit`,this.getSubmitFormHandler(e)),this.getDestroyDropIn(e)?.(),this.cardProcessor?.cleanUp(e),this.applePayProcessor?.cleanUp(e),this.googlePayProcessor?.cleanUp(e),this.checkoutProcessors?.length>0)for(let t of this.checkoutProcessors)t?.cleanUp(e);this.checkoutProcessors=[],this.paypalProcessor?.cleanUp(e),this.payToProcessor?.cleanUp(e),this.clickToPayProcessor?.cleanUp(e),e&&(e.innerHTML=``)}getForm(e){return e?.parentElement?.closest(`form`)||null}getSubmit(e){let t=this.getForm(e);return t?t.querySelector(`button[type="submit"]`)||t.querySelector(`input[type="submit"]`):null}getInput(e,t){let n=this.getForm(e);return n?n.querySelector(`input[name=\"${t}\"]`):null}_initForm(e){let t=this.getForm(e);if(!t)return;let n=this.getSubmit(e);n?n.addEventListener(`click`,this.getSubmitFormHandler(e)):t.addEventListener(`submit`,this.getSubmitFormHandler(e));let r=this.getInput(e,`token`);r?.value&&(r.value=``)}_setToken(e,t,n=`token`){let r=this.getForm(e);if(!r)return;let i=this.getInput(e,n);i||(i=document.createElement(`input`),i.type=`hidden`,i.name=n,r.appendChild(i)),i.value=t}getSubmitFormHandler(e){let t=this.getForm(e);t&&!t.id&&(t.id=`payfurl-form-`+Math.random().toString(36).slice(2,9));let n=t?.id||e?.id||`container`;if(this._submitFormHandlers[n])return this._submitFormHandlers[n];let r=T(this,`[getSubmitFormHandler][handler]`,t=>{this.log(`[sdk], submitForm`,t),t.preventDefault();let n=this.getForm(e);(!n?.onsubmit||n.onsubmit(new SubmitEvent(`submit`)))&&(n&&this.getInput(e,`token`)?.value?n.submit():window.postMessage({status:Ml},`*`))});return this._submitFormHandlers[n]=r,r}getDestroyDropIn(e){let t=e?.id||`container`;return this._destroyDropIns[t]}setDestroyDropIn(e,t){let n=e?.id||`container`;this._destroyDropIns[n]=t}addCard(e,t,n){this.log(`[addCard]`,{providerId:t,options:n});let r=e&&document.getElementById(e)||null;if(!r)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!uc(t))throw this.showErrorMessage(r,`Missing parameter: providerId`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}),TypeError(`Missing parameter: providerId`);let i=Number(n?.amount)||0;n?.currency&&(n.currency=n?.currency.toUpperCase());let a=n?.currency||``;if(i&&!dc(i))throw this.showErrorMessage(r,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);return this._cleanUp(r),this._initForm(r),this.setAmount(i),this.setCurrency(a),this.initProcessors(r,i,a,t,``,n||{},T(this,`[addCard][initProcessors], callback`,(e,o)=>{let s=this.resolveThreeDsProvider(e,o),c=o.allThreeDsProviders?.[0],l=this.skipCardFraud?void 0:o.fraudProviders?.[0],u={...n,requiredFields:e.requiredFields,clientParameters:e.clientParameters,visProviderId:o.hasVisaInstallmentsProviders&&o.visaInstallmentsProviders[0]||``,clickToPayEnabled:n?.clickToPayEnabled!==!1&&o.clickToPayEnabled,clickToPayOptions:{...o.clickToPayOptions,...n?.clickToPayOptions},threeDSEnabled:!!o.required3dsProvider,tokenAuthenticationEnabled:n?.tokenAuthenticationEnabled&&o.hasNetworkTokenProviders,networkTokenProviders:o.networkTokenProviders||[],createNetworkToken:n?.createNetworkToken!==!1&&o.hasNetworkTokenProviders,networkTokenOptions:n?.networkTokenOptions,vault:hc(n?.vault),verifyCard:hc(n?.verifyCard),metadata:ku(n?.metadata),secureCardOrchestration:{enabled:!0,secureUrl:this.config.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,amount:i,currency:a,metadata:ku(n?.metadata),billingAddress:this.billingAddress,customer:this.customer,order:this.order,geolocation:this.geolocation,fraud:!(n?.clickToPayEnabled!==!1&&o.clickToPayEnabled)&&l?{providerId:l.providerId,providerType:l.providerType,stopPaymentOnFailure:!!l.stopPaymentOnFailure,clientParameters:l.clientParameters||{}}:void 0,threeDs:!(n?.clickToPayEnabled!==!1&&o.clickToPayEnabled)&&s?{providerId:s.providerId,providerType:s.providerType,cardProviderId:t,clientParameters:{...e.clientParameters,...s.clientParameters}}:void 0,secondaryThreeDs:!(n?.clickToPayEnabled!==!1&&o.clickToPayEnabled)&&c?{providerId:c.providerId,providerType:c.providerType,cardProviderId:t,clientParameters:{...e.clientParameters,...c.clientParameters}}:void 0}};if(u.threeDSEnabled){if(!dc(i)){this.showErrorMessage(r,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`});return}if(!al(a)){this.showErrorMessage(r,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`});return}}this.initCardProcessor(r).addCard(r,this.getForm(r),t,i,a,u),u.tokenAuthenticationEnabled&&this.checkGeolocation()})),this}addCardLeastCost(e,t,n,r){this.log(`[addCardLeastCost]`,{amount:t,currency:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);return n&&=n.toUpperCase(),this._cleanUp(i),this._initForm(i),this.setAmount(t),this.setCurrency(n),this.initProcessors(i,t,n,``,``,r||{},T(this,`[addCardLeastCost][initProcessors], callback`,(e,a)=>{let o=this.resolveThreeDsProvider(e,a),s=a.allThreeDsProviders?.[0],c=this.skipCardFraud?void 0:a.fraudProviders?.[0],l={...r,requiredFields:e.requiredFields,clientParameters:e.clientParameters,visProviderId:a.hasVisaInstallmentsProviders&&a.visaInstallmentsProviders[0]||``,clickToPayEnabled:r?.clickToPayEnabled!==!1&&a.clickToPayEnabled,clickToPayOptions:{...a.clickToPayOptions,...r?.clickToPayOptions},threeDSEnabled:!!a.required3dsProvider,tokenAuthenticationEnabled:r?.tokenAuthenticationEnabled&&a.hasNetworkTokenProviders,networkTokenProviders:a.networkTokenProviders||[],createNetworkToken:r?.createNetworkToken!==!1&&a.hasNetworkTokenProviders,networkTokenOptions:r?.networkTokenOptions,vault:hc(r?.vault),verifyCard:hc(r?.verifyCard),metadata:ku(r?.metadata),secureCardOrchestration:{enabled:!0,secureUrl:this.config.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,amount:t,currency:n,metadata:ku(r?.metadata),billingAddress:this.billingAddress,customer:this.customer,order:this.order,geolocation:this.geolocation,fraud:!(r?.clickToPayEnabled!==!1&&a.clickToPayEnabled)&&c?{providerId:c.providerId,providerType:c.providerType,stopPaymentOnFailure:!!c.stopPaymentOnFailure,clientParameters:c.clientParameters||{}}:void 0,threeDs:!(r?.clickToPayEnabled!==!1&&a.clickToPayEnabled)&&o?{providerId:o.providerId,providerType:o.providerType,cardProviderId:``,clientParameters:{...e.clientParameters,...o.clientParameters}}:void 0,secondaryThreeDs:!(r?.clickToPayEnabled!==!1&&a.clickToPayEnabled)&&s?{providerId:s.providerId,providerType:s.providerType,cardProviderId:``,clientParameters:{...e.clientParameters,...s.clientParameters}}:void 0}};if(l.threeDSEnabled){if(!dc(t)){this.showErrorMessage(i,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`});return}if(!al(n)){this.showErrorMessage(i,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`});return}}this.initCardProcessor(i).addCard(i,this.getForm(i),``,t,n,l)})),this}addDropIn(e,t,n,r){this.log(`[addDropIn]`,{amount:t,currency:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);n&&=n.toUpperCase(),this._cleanUp(i),this._initForm(i),this.setAmount(t),this.setCurrency(n);let a=this.filterAllowedPaymentTypes(r?.allowedPaymentTypes||[]),o=e=>a.length===0||a.includes(e),s=r?.cardProviderId||``;return this.initProcessors(i,t,n,s,``,{clickToPayEnabled:r?.clickToPayEnabled,clickToPayOptions:r?.clickToPayOptions,createNetworkToken:r?.createNetworkToken,tokenAuthenticationEnabled:r?.tokenAuthenticationEnabled||r?.clickToPayOptions?.tokenAuthenticationEnabled,networkTokenOptions:r?.networkTokenOptions||r?.clickToPayOptions?.networkTokenOptions},T(this,`[addDropIn][initProcessors], callback`,async(a,c)=>{let l=c.hasApplePayProviders&&await this.isApplePayAvailable();c.hasApplePayProviders&&!l&&o(Od.applepay)&&this.paymentMethodStatus({paymentMethod:`applepay`,status:`unavailable`,reason:`unsupported`}),r?.paypalProviderId&&c.hasPaypalProviders&&c.paypalProviders.includes(r?.paypalProviderId)&&(c.hasPaypalProviders=!0,c.paypalProviders.unshift(r?.paypalProviderId)),r?.payToProviderId&&c.hasPayToProviders&&c.payToProviders.includes(r?.payToProviderId)&&(c.hasPayToProviders=!0,c.payToProviders.unshift(r?.payToProviderId));let u=[c.hasCardProviders,c.hasPaypalProviders,c.hasPayToProviders,c.hasBnplProviders,c.hasGooglePayProviders,l].filter(Boolean).length>1,d=this.resolveThreeDsProvider(a,c),f=this.skipCardFraud?void 0:c.fraudProviders?.[0],p={threeDSEnabled:!!c.required3dsProvider,threeDsProviderId:c.required3dsProvider||``,threeDSEmail:r?.threeDSEmail||``,visProviderId:c.hasVisaInstallmentsProviders&&c.visaInstallmentsProviders[0]||``,clickToPayEnabled:r?.clickToPayEnabled!==!1&&c.clickToPayEnabled,clickToPayOptions:{...c.clickToPayOptions,...r?.clickToPayOptions},requiredFields:a.requiredFields,clientParameters:a.clientParameters,style:r?.cardFormStyle||`compact`,tokenAuthenticationEnabled:r?.tokenAuthenticationEnabled&&c.hasNetworkTokenProviders,networkTokenProviders:c.networkTokenProviders||[],createNetworkToken:r?.createNetworkToken!==!1&&c.hasNetworkTokenProviders,networkTokenOptions:r?.networkTokenOptions,vault:hc(r?.vault),verifyCard:hc(r?.verifyCard),metadata:ku(r?.metadata),secureCardOrchestration:{enabled:!0,secureUrl:this.config.secureUrl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,amount:t,currency:n,metadata:ku(r?.metadata),billingAddress:this.billingAddress,customer:this.customer,order:this.order,geolocation:this.geolocation,fraud:!(r?.clickToPayEnabled!==!1&&c.clickToPayEnabled)&&f?{providerId:f.providerId,providerType:f.providerType,stopPaymentOnFailure:!!f.stopPaymentOnFailure,clientParameters:f.clientParameters||{}}:void 0,threeDs:!(r?.clickToPayEnabled!==!1&&c.clickToPayEnabled)&&d?{providerId:d.providerId,providerType:d.providerType,cardProviderId:r?.cardProviderId||``,clientParameters:{...a.clientParameters,...d.clientParameters}}:void 0,secondaryThreeDs:!(r?.clickToPayEnabled!==!1&&c.clickToPayEnabled)&&c.allThreeDsProviders?.[0]?{providerId:c.allThreeDsProviders[0].providerId,providerType:c.allThreeDsProviders[0].providerType,cardProviderId:r?.cardProviderId||``,clientParameters:{...a.clientParameters,...c.allThreeDsProviders[0].clientParameters}}:void 0}},m={hideShipping:!!r?.paypalHideShipping,paypalButtonStyle:r?.paypalButtonStyle,paypalEnablePayIn4:!!r?.paypalEnablePayIn4,transfer:null,metadata:ku(r?.metadata)},h={description:String(r?.payToDescription).trim()||String(c.payToProvidersWithOptions[0]?.description)||``,maximumAmount:r?.payToMaximumAmount||Number(c.payToProvidersWithOptions[0]?.maximumAmount)||0,metadata:ku(r?.metadata)},g={taxAmount:this.order?.taxAmount,shippingAmount:this.order?.shippingAmount,discountAmount:this.order?.discountAmount,orderItems:this.order?.orderItems,customer:this.customer||void 0,billingAddress:this.billingAddress||void 0,metadata:ku(r?.metadata)},_=c.hasGooglePayProviders?c.googlePayProviders.find(e=>e.providerId===r?.googlePayOptions?.providerId)||c.googlePayProviders[0]:null,v={gateway:r?.googlePayOptions?.gateway||_?.gateway||``,googlePayGatewayMerchantId:r?.googlePayOptions?.googlePayGatewayMerchantId||_?.googlePayGatewayMerchantId||``,googlePayMerchantId:r?.googlePayOptions?.googlePayMerchantId||_?.googlePayMerchantId||``,googlePayMerchantName:r?.googlePayOptions?.googlePayMerchantName||_?.googlePayMerchantName||``,buttonOptions:r?.googlePayOptions?.buttonOptions,billingDetailsRequired:r?.googlePayOptions?.billingDetailsRequired,metadata:ku(r?.metadata)},y=c.hasApplePayProviders?c.applePayProviders.find(e=>e.providerId===r?.applePayOptions?.providerId)||c.applePayProviders[0]:null,b={lineItemLabel:r?.applePayOptions?.lineItemLabel||y?.lineItemLabel||``,displayName:r?.applePayOptions?.displayName||y?.displayName||``,domainName:r?.applePayOptions?.domainName||y?.domainName||``,merchantIdentifier:r?.applePayOptions?.merchantIdentifier||y?.merchantIdentifier||``,providerId:r?.applePayOptions?.providerId||y?.providerId||``,providerType:r?.applePayOptions?.providerType||y?.providerType||``,countryCode:r?.applePayOptions?.countryCode||y?.countryCode,merchantCapabilities:r?.applePayOptions?.merchantCapabilities||y?.merchantCapabilities,supportedNetworks:r?.applePayOptions?.supportedNetworks||y?.supportedNetworks,supportedCountries:r?.applePayOptions?.supportedCountries||y?.supportedCountries,applePayVersion:r?.applePayOptions?.applePayVersion||y?.applePayVersion,clientParameters:a.clientParameters,metadata:ku(r?.metadata)};if(!u&&c.hasCardProviders){if(o(Od.card)){let r=e&&document.getElementById(e)||null;this.initCardProcessor(r).addCard(r,this.getForm(r),s,t,n,p)}}else if(!u&&c.hasPaypalProviders)o(Od.paypal)&&this.addPaypal(e,t,n,c.paypalProviders[0],m);else if(!u&&c.hasPayToProviders)o(Od.payto)&&this.addPayTo(e,t,c.payToProviders[0],h);else if(!u&&c.hasBnplProviders&&fd[c.bnplProviders[0].providerType]){if(c.bnplProviders[0].providerType===`upi`)o(Od.upi)&&this.addUpi(e,t,c.bnplProviders[0].providerId,r?.upiOptions||{});else{let r=kd(c.bnplProviders[0].providerType);r&&o(r)&&this.addCheckout(e,t,n,c.bnplProviders[0].providerType,c.bnplProviders[0].providerId,g,{...c.bnplProviders[0].options,...c.bnplProviders[0].clientParameters})}}else if(!u&&c.hasGooglePayProviders)o(Od.googlepay)&&this.addGooglePay(e,t,n,c.googlePayProviders[0].providerId,v);else if(!u&&l)o(Od.applepay)&&this.addApplePay(e,t,n,b.providerId||``,b);else if(u){let a=()=>{window.postMessage({status:`deactivate`,component:`paypal`},`*`),window.postMessage({status:`deactivate`,component:`card`},`*`),window.postMessage({status:`deactivate`,component:`payto`},`*`),window.postMessage({status:`deactivate`,component:`googlepay`},`*`),window.postMessage({status:`deactivate`,component:`applepay`},`*`),c.hasBnplProviders&&c.bnplProviders.forEach(e=>{window.postMessage({status:`deactivate`,component:`checkout`,providerType:e.providerType},`*`)})},s=[];if(c.hasCardProviders&&o(Od.card)&&s.push({title:`Card`,description:`Credit or Debit`,icon:Sc,render:e=>{this.initCardProcessor(e).addCard(e,this.getForm(e),r?.cardProviderId||``,t,n,p)},activate:()=>{a(),window.postMessage({status:`activate`,component:`card`},`*`)}}),c.hasPaypalProviders&&o(Od.paypal)&&s.push({title:`Paypal`,icon:bc,render:e=>{this.initPaypalProcessor(e).addPaypal(e,this.getForm(e),t,n,c.paypalProviders[0],m)},activate:()=>{a(),window.postMessage({status:`activate`,component:`paypal`},`*`)}}),c.hasPayToProviders&&o(Od.payto)){if(uc(h.description))s.push({title:`PayTo`,icon:Dc,render:e=>{this.initPayToProcessor(e).addPayTo(e,t,c.payToProviders[0],h)},activate:()=>{a(),window.postMessage({status:`activate`,component:`payto`},`*`)}});else{this.showErrorMessage(i,`Missing parameter: PayTo Description`),this.userOnFailure?.({error:`Missing parameter: PayTo Description`});return}}c.hasBnplProviders&&c.bnplProviders.forEach(e=>{let i=fd[e.providerType];if(!i)return;let c=kd(e.providerType);if(!c||!o(c))return;let l=i.icon?`${this.config.cssUrl}icons/${i.icon}.svg`:null;s.push({title:i.name||e.providerType,description:i.description||e.options?.terms?.replaceAll(/(\d+\.\d{3,})/g,(e,t)=>parseFloat(t).toFixed(2)),icon:l,render:i=>{e.providerType===`upi`?this.addUpi(i.id,t,e.providerId,r?.upiOptions||{}):this.initCheckoutProcessor(i).addCheckout(i,t,n,e.providerType,e.providerId,g,{...e.options,...e.clientParameters})},activate:()=>{a(),window.postMessage({status:`activate`,component:`checkout`,providerType:e.providerType},`*`)}})}),c.hasGooglePayProviders&&o(Od.googlepay)&&s.push({title:`Google Pay`,icon:wc,render:e=>{this.initGooglePayProcessor(e).addGooglePay(e,c.hasGooglePayProviders?c.googlePayProviders[0].providerId:``,t,n,v)},activate:()=>{a(),window.postMessage({status:`activate`,component:`googlepay`},`*`)}}),l&&o(Od.applepay)&&s.push({title:`Apple Pay`,icon:qf,render:e=>{this.addApplePay(e.id,t,n,b.providerId||``,b)},activate:()=>{a(),window.postMessage({status:`activate`,component:`applepay`},`*`)}});let u=$s({el:document.getElementById(e),component:zc,props:{elements:s}});this.setDestroyDropIn(i,u.destroy)}})),this}addPaypal(e,t,n,r,i){this.log(`[addPaypal]`,{amount:t,currency:n,providerId:r,options:i});let a=e&&document.getElementById(e)||null;if(!a)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!dc(t))throw this.showErrorMessage(a,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!al(n))throw this.showErrorMessage(a,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return n&&=n.toUpperCase(),this._cleanUp(a),this._initForm(a),this.setAmount(t),this.setCurrency(n),this.initProcessors(a,t,n,r||``,``,{clickToPayEnabled:!1},T(this,`[addPaypal][initProcessors], callback`,(e,o)=>{let s=o.paypalProviders[0]||r||``;s?this.initPaypalProcessor(a).addPaypal(a,this.getForm(a),t,n,s,i):(this.paymentMethodStatus({paymentMethod:`paypal`,status:`unavailable`,reason:`no_provider`}),this.showErrorMessage(a,`Missing parameter: Provider Id`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}))})),this}addPayTo(e,t,n,r){this.log(`[addPayTo]`,{amount:t,providerId:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!dc(t))throw this.showErrorMessage(i,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);this._cleanUp(i),this._initForm(i),this.setAmount(t),this.setCurrency(`AUD`);let a=T(this,`[localAddPayTo]`,(e,n)=>{this.log(`[addPayTo, local]`,{amount:t,localProviderId:e,localOptions:n}),this.initPayToProcessor(i).addPayTo(i,t,e,n)});return n&&r?.maximumAmount&&r?.description?(a(n,r),this):(this.initProcessors(i,t,`AUD`,n||``,``,{},T(this,`[addPayTo][initProcessors], callback`,(e,t)=>{if(!t.hasPayToProviders){this.paymentMethodStatus({paymentMethod:`payto`,status:`unavailable`,reason:`no_provider`});return}let n=t.payToProvidersWithOptions[0];a(n.providerId,{maximumAmount:n.maximumAmount,description:n.description,metadata:ku(r?.metadata)})})),this)}addGooglePay(e,t,n,r,i){this.log(`[addGooglePay]`,{amount:t,currency:n,providerId:r,options:i});let a=e&&document.getElementById(e)||null;if(!a)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!dc(t))throw this.showErrorMessage(a,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!al(n))throw this.showErrorMessage(a,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);n&&=n.toUpperCase(),this._cleanUp(a),this._initForm(a),this.setAmount(t),this.setCurrency(n);let o=T(this,`[localAddGooglePay]`,(e,r)=>{this.log(`[addGooglePay, local]`,{amount:t,currency:n,localProviderId:e,localOptions:r}),this.initGooglePayProcessor(a).addGooglePay(a,e,t,n,r)});return this.initProcessors(a,t,n,r||``,``,{clickToPayEnabled:!1},T(this,`[addGooglePay][initProcessors], callback`,(e,t)=>{if(r&&i?.gateway&&i?.googlePayGatewayMerchantId){o(r,i);return}if(!t.hasGooglePayProviders){this.paymentMethodStatus({paymentMethod:`googlepay`,status:`unavailable`,reason:`no_provider`});return}let n=r&&t.googlePayProviders.find(e=>e.providerId===r)||t.googlePayProviders[0];o(n.providerId,{gateway:n.gateway,googlePayGatewayMerchantId:n.googlePayGatewayMerchantId,googlePayMerchantId:n.googlePayMerchantId,googlePayMerchantName:n.googlePayMerchantName,buttonOptions:i?.buttonOptions,billingDetailsRequired:i?.billingDetailsRequired,metadata:ku(i?.metadata)})})),this}async isApplePayAvailable(){if(await Df(),typeof window>`u`||!window.ApplePaySession)return!1;try{return ApplePaySession.canMakePayments()===!0}catch{return!1}}addApplePay(e,t,n,r,i){return this.isApplePayAvailable().then(T(this,`[addApplePay], available`,a=>{a?this.renderApplePay(e,t,n,r,i):(this.log(`Your browser does not support ApplePay`),this.paymentMethodStatus({paymentMethod:`applepay`,status:`unavailable`,reason:`unsupported`}))})).catch(()=>{}),this}renderApplePay(e,t,n,r,i){this.log(`[addApplePay]`,{amount:t,currency:n,providerId:r,options:i});let a=e&&document.getElementById(e)||null;if(!a)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!dc(t))throw this.showErrorMessage(a,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!al(n))throw this.showErrorMessage(a,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);n&&=n.toUpperCase(),this._cleanUp(a),this._initForm(a),this.setAmount(t),this.setCurrency(n);let o=T(this,`[localAddApplePay]`,(e,r,i,o)=>{this.log(`[addApplePay, local]`,{amount:t,currency:n,localProviderId:e,localProviderType:r,localOptions:i,clientParameters:o}),this.initApplePayProcessor(a).addApplePay(a,e,t,n,{...i,clientParameters:o})});this.initProcessors(a,t,n,r||``,``,{clickToPayEnabled:!1},T(this,`[addApplePay][initProcessors], callback`,(e,t)=>{if(!t.hasApplePayProviders){this.paymentMethodStatus({paymentMethod:`applepay`,status:`unavailable`,reason:`no_provider`});return}let n=r&&t.applePayProviders.find(e=>e.providerId===r)||t.applePayProviders[0];o(n.providerId,n.providerType,{lineItemLabel:i?.lineItemLabel||n.lineItemLabel,merchantIdentifier:i?.merchantIdentifier||n.merchantIdentifier,domainName:i?.domainName||n.domainName,displayName:i?.displayName||n.displayName,providerId:i?.providerId||n.providerId,providerType:i?.providerType||n.providerType,countryCode:i?.countryCode||n.countryCode,merchantCapabilities:i?.merchantCapabilities||n.merchantCapabilities,supportedNetworks:i?.supportedNetworks||n.supportedNetworks,supportedCountries:i?.supportedCountries||n.supportedCountries,applePayVersion:i?.applePayVersion||n.applePayVersion,metadata:ku(i?.metadata)},e.clientParameters||n.clientParameters)}))}addCheckout(e,t,n,r,i,a,o){this.log(`[addCheckout], ${r}`,{parentId:e,amount:t,currency:n,providerType:r,providerId:i,options:a});let s=e&&document.getElementById(e)||null;if(!s)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);return n&&=n.toUpperCase(),this._cleanUp(s),this._initForm(s),this.setAmount(t),a||={},!a.orderItems&&this.order?.orderItems&&(a.orderItems=this.order?.orderItems.slice()),!a.taxAmount&&this.order?.taxAmount&&(a.taxAmount=this.order?.taxAmount),!a.discountAmount&&this.order?.discountAmount&&(a.discountAmount=this.order?.discountAmount),!a.shippingAmount&&this.order?.shippingAmount&&(a.shippingAmount=this.order?.shippingAmount),!a.billingAddress&&this.billingAddress&&(a.billingAddress={...this.billingAddress}),!a.customer&&this.customer&&(a.customer={...this.customer}),this.initCheckoutProcessor(s).addCheckout(s,t,n,r,i,a,o),this}addUpi(e,t,n,r){this.log(`[addUpi]`,{amount:t,providerId:n,options:r});let i=e&&document.getElementById(e)||null;if(!i)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!uc(n))throw this.showErrorMessage(i,`Missing parameter: providerId`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}),TypeError(`Missing parameter: providerId`);if(!uc(r?.email))throw this.showErrorMessage(i,`Missing parameter: options.email`),this.userOnFailure?.({error:`Missing parameter: options.email`}),TypeError(`Missing parameter: options.email`);if(!uc(r?.name))throw this.showErrorMessage(i,`Missing parameter: options.name`),this.userOnFailure?.({error:`Missing parameter: options.name`}),TypeError(`Missing parameter: options.name`);if(!uc(r?.documentId))throw this.showErrorMessage(i,`Missing parameter: options.documentId`),this.userOnFailure?.({error:`Missing parameter: options.documentId`}),TypeError(`Missing parameter: options.documentId`);this._initForm(i),this.setAmount(t);let a=this.order?.orderItems||[],o=this.customer||{},s=this.billingAddress||{};uc(o.firstName)||(o.firstName=r.name),uc(o.email)||(o.email=r.email),uc(s.firstName)||(s.firstName=r.name),uc(s.email)||(s.email=r.email),uc(o.phoneNumber)||(o.phoneNumber=`+3146781223`),uc(s.phoneNumber)||(s.phoneNumber=`+3146781223`),a.length===0&&a.push({name:`UPI Payment`,sku:`UPI Payment`,quantity:1,unitPrice:t,totalAmount:t});let c={taxAmount:0,shippingAmount:0,discountAmount:0,orderItems:a,customer:o,billingAddress:s,metadata:ku(r?.metadata)};return this.initCheckoutProcessor(i).addCheckout(i,t,this.currency,`upi`,n,c,{documentId:r.documentId,name:String(o?.firstName+` `+o?.lastName).trim(),email:o?.email,subscriptionFrequencyUnit:r.subscriptionFrequencyUnit,subscriptionFrequency:String(r.subscriptionFrequency),subscriptionStartAt:r.subscriptionStartAt,subscriptionEndAt:r.subscriptionEndAt}),this}addThreeDsWithFullParameters(e,t,n,r,i,a,o,s,c){this.log(`[addThreeDsWithFullParameters]`,{cardNumber:_l(t),expiryDate:n,cardholder:r,email:i,amount:a,currency:o,ccv:`***`,options:c});let l=e&&document.getElementById(e)||null;if(!dc(a))throw this.showErrorMessage(l,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!al(o))throw this.showErrorMessage(l,`Missing parameter: currency`),this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return o&&=o.toUpperCase(),this._cleanUp(l),this._initForm(l),this.setAmount(a),this.setCurrency(o),t=vl(t),this.getPaymentOptions(a,o,T(this,`[addThreeDsWithFullParameters][getPaymentOptions], callback`,e=>{e.hasThreeDsProviders?this.add3DsProcessor(l,e.threeDsProviders[0].providerId,e.threeDsProviders[0].providerType,``,e.threeDsProviders[0].clientParameters||{},T(this,`[addThreeDsWithFullParameters][add3DsProcessor], onload`,()=>{this.threeDsProcessor?.setEmail(i),this.threeDsProcessor?.setPaymentInfo({cardNumber:t,expiryDate:n,cardholder:r,ccv:s}),this.threeDsProcessor?.threeDSInvoke(l,!!c?.requireChallenge,e=>{Kg(),this.log(`[threeDSInvoke], postAuthData`,e),this.userOnSuccess?.({threeDSServerTransID:e.threeDSServerTransID})})}),T(this,`[addThreeDsWithFullParameters][add3DsProcessor], onerror`,()=>{this.log(`Cannot load 3DS provider (${e.threeDsProviders[0].providerType})`),this.userOnSuccess?.({})})):(this.log(`No 3DS providers found`),this.userOnSuccess?.({}))})),this}tokeniseWith3Ds(e,t,n,r,i,a,o,s,c,l,u){this.log(`[tokeniseWith3Ds]`,{providerId:t,cardNumber:_l(n),expiryDate:r,cardholder:i,ccv:`***`,email:o,amount:s,currency:c,metadata:l,options:u});let d=e&&document.getElementById(e)||null;if(!uc(t))throw this.showErrorMessage(d,`Missing parameter: providerId`),this.userOnFailure?.({error:`Missing parameter: Provider Id`}),TypeError(`Missing parameter: providerId`);if(!dc(s))throw this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!al(c))throw this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return c&&=c.toUpperCase(),this._cleanUp(d),this._initForm(d),this.setAmount(s),this.setCurrency(c),n=vl(n),this.initProcessors(d,s,c,t,``,{createNetworkToken:u?.createNetworkToken,clickToPayEnabled:!1},T(this,`[tokeniseWith3Ds][initProcessors], callback`,(e,o)=>{this.fraudProcessor?.setPaymentInfo({cardNumber:n,expiryDate:r,cardholder:i,ccv:a}),this.runFraudGate(d,(o,s)=>{let c=e=>{this.initCardProcessor(null).tokeniseCard(t,n,r,i,a,ku(l),e,u,o)};s?c(s):this.threeDsOrTokenise(d,e,n,r,i,a,u,c)})})),this}threeDsOrTokenise(e,t,n,r,i,a,o,s){this.threeDsProcessor?(this.threeDsProcessor?.setPaymentInfo({cardNumber:n,expiryDate:r,cardholder:i,ccv:a}),this.threeDsProcessor?.threeDSInvoke(e,!!o?.requireChallenge,e=>{Kg(),this.log(`[threeDSInvoke], postAuthData`,e),t.threeDsProviderType===`payglocal`?this.userOnSuccess?.({threeDSServerTransID:e.threeDSServerTransID}):s(e.threeDSServerTransID)})):(this.log(`threeDsProcessor NOT FOUND`),s())}tokeniseCard(e,t,n,r,i,a,o,s){this.log(`[tokeniseCard]`,{providerId:e,cardNumber:_l(t),expiryDate:n,cardHolderName:r,options:s,metadata:a}),t=vl(t),s?.amount&&dc(s.amount)&&this.setAmount(s.amount),s?.currency&&al(s.currency)&&this.setCurrency(s.currency.toUpperCase());let c=(c,l)=>{this.initCardProcessor(null).tokeniseCard(e,t,n,r,i,ku(a),l||o,s,c)};return!this.amount||!this.currency?(c(),this):(this.initProcessors(null,this.amount,this.currency,e,``,{createNetworkToken:s?.createNetworkToken,clickToPayEnabled:!1},T(this,`[tokeniseCard][initProcessors], callback`,()=>{this.fraudProcessor?.setPaymentInfo({cardNumber:t,expiryDate:n,cardholder:r,ccv:i}),this.runFraudGate(null,c)})),this)}addThreeDsWithToken(e,t,n,r,i,a){if(this.log(`[addThreeDsWithToken]`,{tokenId:e,email:t,amount:n,currency:r,options:a}),!uc(e))throw this.userOnFailure?.({error:`Missing parameter: Token Id`}),TypeError(`Missing parameter: tokenId`);if(!dc(n))throw this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);if(!al(r))throw this.userOnFailure?.({error:`Missing parameter: currency`}),TypeError(`Missing parameter: currency`);return r&&=r.toUpperCase(),this.setAmount(n),this.setCurrency(r),this.initProcessors(null,n,r,``,e,{clickToPayEnabled:!1},T(this,`[addThreeDsWithToken][initProcessors], callback`,()=>{this.fraudProcessor?.setPaymentReference({tokenId:e}),this.runFraudGate(null,(n,r)=>{r?this.userOnSuccess?.({threeDSServerTransID:r}):this.threeDsWithToken(e,t,i,a)})})),this}threeDsWithToken(e,t,n,r){this.threeDsProcessor?(this.threeDsProcessor?.setEmail(t),this.threeDsProcessor?.setTokenId(e),this.threeDsProcessor?.threeDSInvoke(null,!!r?.requireChallenge,e=>{Kg(),this.log(`[threeDSInvoke], postAuthData`,e),this.userOnSuccess?.({threeDSServerTransID:e.threeDSServerTransID}),this.threeDsProcessor?.updateTokenExternal3dsData(e.externalThreeDsData)}),this.threeDsProcessor?.setPaymentInfo({cardNumber:``,expiryDate:``,cardholder:``,ccv:n})):this.userOnFailure?.({error:`Cannot load 3DS provider`})}runFraudGate(e,t){Zd(this.cardFraudProcessor,this.fraudManageOrder,e,{onShow:Kg,onProgress:this.threeDsProgress.bind(this),log:this.log.bind(this)}).then(T(this,`[runFraudGate]`,n=>{`error`in n?(Kg(),this.log(`[runFraudGate], failure`,n),this.showErrorMessage(e,n.error),this.userOnFailure?.({error:n.error,...n.reason&&{errorDetails:{reason:n.reason}}})):t(n.fraudCheckResult,n.threeDSServerTransID)}))}getPaymentOptions(e,t,n,r){this.log(`[getPaymentOptions], request`,{amount:e,currency:t}),t&&=t.toUpperCase();let i=`${e}${t}`;if(this.paymentOptions[i]){n?.(this.paymentOptions[i]);return}let a=T(this,`[getPaymentOptions], failure`,(e,t)=>{this.log(`[getPaymentOptions], failure`,t),r?.(),this.showErrorMessage(null,`Unable to configure SDK`),this.userOnFailure?.({error:`Unable to configure SDK`})}),o=T(this,`[getPaymentOptions], success`,(e,t)=>{let r=JSON.parse(t);this.log(`[getPaymentOptions], success`,r),this.paymentOptions[i]=r,n?.(r)});this.httpInvoker?.invoke(Jg(this.config.apiUrl)[qg.PROVIDERS_INFO].url+`?amount=${e}¤cy=${t}`,Jg(this.config.apiUrl)[qg.PROVIDERS_INFO].method,{},o,a)}getProviderInfo(e,t,n,r,i,a){this.log(`[getProviderInfo], request`,{providerId:e,amount:t,currency:n,token:r});let o=`${e}-${t}${n}-${r}`;if(this.paymentOptions[o]){i?.(this.paymentOptions[o]);return}let s=T(this,`[getProviderInfo], error`,(e,t)=>{this.log(`[getProviderInfo], error`,e,t),a({error:`Unable to get provider information`})}),c=T(this,`[getProviderInfo], success`,(e,t)=>{this.log(`[getProviderInfo], success`,e,t);let n=JSON.parse(t);this.log(`[getProviderInfo], data`,n),this.paymentOptions[o]=n,i(n)});this.httpInvoker?.invoke(Jg(this.config.apiUrl,e,r)[qg.PROVIDER_INFO].url+`?amount=${t}¤cy=${n}`,Jg(this.config.apiUrl,e,r)[qg.PROVIDER_INFO].method,{},c,s)}setAmount(e){return Number(e)===Number(this.amount)||Number(e)<0||(this.log(`[setAmount]`,Number(e)),this.amount=Number(e),this.cardProcessor?.setAmount(this.amount),this.threeDsProcessor?.setAmount(this.amount),this.secondaryThreeDsProcessor?.setAmount(this.amount),this.paypalProcessor?.setAmount(this.amount),this.fraudProcessor?.setAmount(this.amount),this.googlePayProcessor?.setAmount(this.amount),this.applePayProcessor?.setAmount(this.amount),this.paymentMethodProcessor?.setAmount(this.amount),window.postMessage({status:Ul,amount:this.amount},`*`)),this}setCurrency(e){return e===this.currency||(e&&=e.toUpperCase(),this.log(`[setCurrency]`,e),this.currency=e,this.cardProcessor?.setCurrency(e),this.threeDsProcessor?.setCurrency(e),this.secondaryThreeDsProcessor?.setCurrency(e),this.googlePayProcessor?.setCurrency(e),this.applePayProcessor?.setCurrency(e),this.paymentMethodProcessor?.setCurrency(e),window.postMessage({status:Wl,currency:e},`*`)),this}onSuccess(e){return this.log(`[onSuccess]`),this.userOnSuccess=e,this}onFailure(e){return this.log(`[onFailure]`),this.userOnFailure=e,this}successMessage(e){return this.userSuccessMessage=e,this.cardProcessor?.setSuccessMessage(e),this.paypalProcessor?.setSuccessMessage(e),this}onLoaded(e){return this.log(`[onLoaded]`),this.userOnLoaded=e,this}onPaymentMethodStatus(e){return this.log(`[onPaymentMethodStatus]`),this.userOnPaymentMethodStatus=e,this}onThreeDsProgress(e){return this.log(`[onThreeDsProgress]`),this.userOnThreeDsProgress=e,this}onValidationStatusChange(e){return this.log(`[onValidationStatusChange]`),this.userOnValidationStatusChange=e,this}onValidate(e){if(this.log(`[onValidate]`,e),this.userOnValidate=e,this.cardProcessor?.setOnValidate(e),this.applePayProcessor?.setOnValidate(e),this.googlePayProcessor?.setOnValidate(e),this.paypalProcessor?.setOnValidate(e),this.payToProcessor?.setOnValidate(e),this.paymentMethodProcessor?.setOnValidate(e),this.checkoutProcessors?.length>0)for(let t of this.checkoutProcessors)t?.setOnValidate(e);return this}showErrorMessage(e,t){this.log(t),J(e,t)}setBillingAddress(e){return this.log(`[setBillingAddress]`,e),this.billingAddress={...e},this.cardProcessor?.setBillingAddress(this.billingAddress),this.googlePayProcessor?.setBillingAddress(this.billingAddress),this.applePayProcessor?.setBillingAddress(this.billingAddress),this.threeDsProcessor?.setAddressInfo(this.billingAddress),this.fraudProcessor?.setAddressInfo(this.billingAddress),this.paymentMethodProcessor?.setBillingAddress(this.billingAddress),window.postMessage({status:Kl,address:e},`*`),this}setCustomerInfo(e){return this.log(`[setCustomerInfo]`,e),e?.phoneNumber&&(e.phoneNumber=e.phoneNumber.replace(/[^0-9+]/g,``)),this.customer={...e},this.cardProcessor?.setCustomerInfo(this.customer),this.googlePayProcessor?.setCustomerInfo(this.customer),this.applePayProcessor?.setCustomerInfo(this.customer),this.fraudProcessor?.setCustomerInfo(this.customer),this.paymentMethodProcessor?.setCustomerInfo(this.customer),window.postMessage({status:ql,customer:e},`*`),this}setOrderInfo(e){return this.log(`[setOrderInfo]`,e),this.order={...e},this.cardProcessor?.setOrderInfo(this.order),this.googlePayProcessor?.setOrderInfo(this.order),this.applePayProcessor?.setOrderInfo(this.order),this.fraudProcessor?.setOrderInfo(this.order),this.paymentMethodProcessor?.setOrderInfo(this.order),window.postMessage({status:Jl,order:e},`*`),this}setGeolocation(e){return this.log(`[setGeolocation]`,e),this.geolocation={...e},this.cardProcessor?.setGeolocation(this.geolocation),this.paymentMethodProcessor?.setGeolocation(this.geolocation),this}checkGeolocation(){this.log(`[checkGeolocation]`),`geolocation`in navigator&&navigator.geolocation.getCurrentPosition(e=>{let{latitude:t,longitude:n}=e.coords;this.setGeolocation({latitude:t,longitude:n})},e=>{this.log(`Geolocation error:`,e)})}initProcessors(e,t,n,r,i,a,o){if(this.log(`[initProcessors]`,{amount:t,currency:n,cardProviderId:r,token:i,cardOptions:a}),this.initProcessorsRunning){this.initProcessorsQueue.push(()=>this.initProcessors(e,t,n,r,i,a,o));return}this.initProcessorsRunning=!0;let s=()=>{this.initProcessorsRunning=!1,this.initProcessorsQueue.shift()?.()},c={},l=``,u=``,d=!1,f={},p=``,m=``,h={},g=``,_=``,v={},y=!1,b=!1,ee=e=>{this.getProviderInfo(r,t,n,i||``,T(this,`[getProviderInfo], success`,t=>{c={...t},!y&&t.threeDsProviderId&&(p=t.threeDsProviderId,m=t.threeDsProviderType,h=t.threeDsClientParameters||{}),e()}),T(this,`[getProviderInfo], error`,t=>{this.log(`Unable to get provider information`,t),e()}))},te=T(this,`[initFraudProcessor]`,(e,t,n,r,i)=>{this.fraudProcessor=null,this.fraudManageOrder=null,this.skipCardFraud=Ou(m),this.cardProcessor?.addFraudProcessor(null),this.paypalProcessor?.addFraudProcessor(null),this.googlePayProcessor?.addFraudProcessor(null),this.applePayProcessor?.addFraudProcessor(null),this.paymentMethodProcessor?.addFraudProcessor(null,null),!e||!t?i():this.addFraudProcessor(e,t,n,r,{},T(this,`[addFraudProcessor], success`,()=>{i()}),T(this,`[addFraudProcessor], error`,()=>{this.log(`Error loading fraud provider`,t),i()}))}),ne=T(this,`[initThreeDsProcessor]`,(t,n,i)=>{!t||!n?i():this.add3DsProcessor(e,t,n,r,{...c.clientParameters,...h},T(this,`[add3DsProcessor], success`,()=>{i()}),T(this,`[add3DsProcessor], error`,()=>{this.log(`Error loading 3ds provider`,n),i()}))}),x=T(this,`[initSecondaryThreeDsProcessor]`,(t,n,i)=>{!t||!n?i():this.addSecondary3DsProcessor(e,t,n,r,{...c.clientParameters,...v},T(this,`[addSecondary3DsProcessor], success`,()=>{i()}),T(this,`[addSecondary3DsProcessor], error`,()=>{this.log(`Error loading 3ds provider`,n),i()}))}),S=T(this,`[callCallback]`,(e,t)=>{try{o(e,t)}finally{s()}});this.getPaymentOptions(t,n,T(this,`[getPaymentOptions], callback`,t=>{a?.createNetworkToken&&!a?.tokenAuthenticationEnabled&&(t.clickToPayEnabled=!1),t?.clickToPayEnabled&&a?.clickToPayEnabled!==!1&&(y=!0,b=!0),t?.hasNetworkTokenProviders&&a?.tokenAuthenticationEnabled&&(y=!0),!y&&t.hasThreeDsProviders&&(p=t.threeDsProviders[0].providerId,m=t.threeDsProviders[0].providerType,h=t.threeDsProviders[0].clientParameters||{}),!y&&t.allThreeDsProviders?.[0]?.providerId&&(g=t.allThreeDsProviders[0].providerId,_=t.allThreeDsProviders[0].providerType,v=t.allThreeDsProviders[0].clientParameters||{}),!b&&t.hasFraudProviders&&(l=t.fraudProviders[0].providerId,u=t.fraudProviders[0].providerType,d=t.fraudProviders[0].stopPaymentOnFailure,f=t.fraudProviders[0].clientParameters||{}),t.clickToPayEnabled&&a?.clickToPayEnabled!==!1&&this.initClickToPayProcessor(e,{...t.clickToPayOptions,...a?.clickToPayOptions,tokenAuthenticationEnabled:!!a?.tokenAuthenticationEnabled,networkTokenOptions:a?.networkTokenOptions}),!r&&!i?te(l,u,d,f,()=>{ne(p,m,()=>{x(g,_,()=>{S(c,t)})})}):ee(()=>{te(l,u,d,f,()=>{ne(p,m,()=>{x(g,_,()=>{S(c,t)})})})})}),s)}addFraudProcessor(e,t,n,r,i,a,o){this.log(`[addFraudProcessor]`,e,t,i),!this.amount||!this.currency?(this.log(`[addFraudProcessor], NOT loaded`,{amount:this.amount,currency:this.currency,billingAddress:this.billingAddress,customer:this.customer,order:this.order}),a?.()):Gg(t).then(T(this,`[addFraudProcessor], onload`,o=>{this.log(`Loading ${t}...`,o);let s=o.default(r);s?.getFraudCheckData&&(this.fraudProcessor=new Wd(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,providerId:e,stopPaymentOnFailure:n,metadata:i,getFraudCheckData:s.getFraudCheckData,onSuccess:e=>{this.log(`[fraudProcessor], success`,e)},onFailure:e=>{this.log(`[fraudProcessor], failure`,e)}}),this.amount&&this.fraudProcessor.setAmount(this.amount),this.currency&&this.fraudProcessor.setCurrency(this.currency),this.billingAddress&&this.fraudProcessor.setAddressInfo(this.billingAddress),this.customer&&this.fraudProcessor.setCustomerInfo(this.customer),this.order&&this.fraudProcessor.setOrderInfo(this.order),this.fraudManageOrder=typeof s.manageOrder==`function`?s.manageOrder:null,this.cardProcessor?.addFraudProcessor(this.cardFraudProcessor),this.paypalProcessor?.addFraudProcessor(this.fraudProcessor),this.googlePayProcessor?.addFraudProcessor(this.fraudProcessor),this.applePayProcessor?.addFraudProcessor(this.fraudProcessor),this.paymentMethodProcessor?.addFraudProcessor(this.cardFraudProcessor,this.fraudManageOrder),a?.())})).catch(T(this,`[addFraudProcessor], onerror`,e=>{this.log(`Error loading ${t}`,e),o?.()}))}resolveThreeDsProvider(e,t){return e?.threeDsProviderId&&e?.threeDsProviderType?{providerId:e.threeDsProviderId,providerType:e.threeDsProviderType,clientParameters:e.threeDsClientParameters}:t.threeDsProviders?.find(e=>e.providerId===t.required3dsProvider)||t.threeDsProviders?.[0]}add3DsProcessor(e,t,n,r,i,a,o){this.log(`[add3DsProcessor]`,t,n),Wg(n).then(T(this,`[add3DsProcessor], onload`,o=>{this.log(`Loading ${n}...`,o);let s=o.default(this.log.bind(this),e,{environment:this.environment,apiUrl:this.config.apiUrl,clientParameters:i});s?.setThreeDsProcessor&&(this.threeDsProcessor=new yu(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,providerId:t,cardProviderId:r,threeDsInvoker:{onPreAuth:s.onPreAuth.bind(s),onAuth:s.onAuth.bind(s),onPostAuth:s.onPostAuth.bind(s)},onSuccess:e=>{this.log(`[threeDsProcessor], success`,e),this.userOnSuccess?.(e)},onFailure:e=>{this.log(`[threeDsProcessor], failure`,e),this.userOnFailure?.({error:cu,errorDetails:{reason:e.error}})},onProgress:this.threeDsProgress.bind(this)}),this.amount&&this.threeDsProcessor.setAmount(this.amount),this.currency&&this.threeDsProcessor.setCurrency(this.currency),this.billingAddress&&this.threeDsProcessor.setAddressInfo(this.billingAddress),this.cardProcessor?.addThreeDsProcessor(this.threeDsProcessor),s.setThreeDsProcessor(this.threeDsProcessor),a?.())})).catch(T(this,`[add3DsProcessor], onerror`,s=>{this.log(`Error loading ${n}`,s),n==="default"?o?.():this.add3DsProcessor(e,t,`default`,r,i,a,o)}))}addSecondary3DsProcessor(e,t,n,r,i,a,o){this.log(`[addSecondary3DsProcessor]`,t,n),Wg(n).then(T(this,`[addSecondary3DsProcessor], onload`,o=>{this.log(`Loading ${n}...`,o);let s=o.default(this.log.bind(this),e,{environment:this.environment,apiUrl:this.config.apiUrl,clientParameters:i});s?.setThreeDsProcessor&&(this.secondaryThreeDsProcessor=new yu(this.log.bind(this),{debug:this.debug,environment:this.environment,publicKey:this.publicKey,apiUrl:this.config.apiUrl,version:ue.version,providerId:t,cardProviderId:r,threeDsInvoker:{onPreAuth:s.onPreAuth.bind(s),onAuth:s.onAuth.bind(s),onPostAuth:s.onPostAuth.bind(s)},onSuccess:e=>{this.log(`[secondaryThreeDsProcessor], success`,e),this.userOnSuccess?.(e)},onFailure:e=>{this.log(`[secondaryThreeDsProcessor], failure`,e),this.userOnFailure?.({error:cu,errorDetails:{reason:e.error}})},onProgress:this.threeDsProgress.bind(this)}),this.amount&&this.secondaryThreeDsProcessor.setAmount(this.amount),this.currency&&this.secondaryThreeDsProcessor.setCurrency(this.currency),this.billingAddress&&this.secondaryThreeDsProcessor.setAddressInfo(this.billingAddress),this.cardProcessor?.addSecondaryThreeDsProcessor(this.secondaryThreeDsProcessor),s.setThreeDsProcessor(this.secondaryThreeDsProcessor),a?.())})).catch(T(this,`[addSecondary3DsProcessor], onerror`,s=>{this.log(`Error loading ${n}`,s),n==="default"?o?.():this.addSecondary3DsProcessor(e,t,`default`,r,i,a,o)}))}preloadClickToPay(e){return this.log(`[preloadClickToPay]`,e),this.initProcessors(null,0,`AUD`,``,``,{clickToPayOptions:e,tokenAuthenticationEnabled:e?.tokenAuthenticationEnabled,networkTokenOptions:e?.networkTokenOptions},T(this,`[preloadClickToPay], callback`,(t,n)=>{n.clickToPayEnabled&&this.initClickToPayProcessor(null,{...n.clickToPayOptions,...e}).init()})),this}addSavedPaymentMethods(e,t,n){this.log(`[addSavedPaymentMethods]`,{customerId:t,options:n});let r=e&&document.getElementById(e)||null;if(!r)throw this.userOnFailure?.({error:`Container is not available`}),TypeError(`Container is not available`);if(!uc(t))throw this.showErrorMessage(r,`Missing parameter: customerId`),this.userOnFailure?.({error:`Missing parameter: Customer Id`}),TypeError(`Missing parameter: customerId`);let i=Number(n?.amount)||0,a=n?.currency||``;if(i&&!dc(i))throw this.showErrorMessage(r,`Missing parameter: amount`),this.userOnFailure?.({error:`Missing parameter: amount`}),TypeError(`Missing parameter: amount`);return this._cleanUp(r),this._initForm(r),this.setAmount(i),this.setCurrency(a),this.initProcessors(r,i,a,``,``,{clickToPayEnabled:!1,tokenAuthenticationEnabled:n?.tokenAuthenticationEnabled},T(this,`[addSavedPaymentMethods][initProcessors], callback`,(e,o)=>{let s={...n,tokenAuthenticationEnabled:n?.tokenAuthenticationEnabled&&o.hasNetworkTokenProviders,networkTokenProviders:o.networkTokenProviders||[]};this.initPaymentMethodProcessor(r).addPaymentMethods(r,t,i,a,s),s.tokenAuthenticationEnabled&&this.checkGeolocation()})),this}initBaseProcessor(e){e.setAmount(this.amount),e.setCurrency(this.currency),e.setCustomerInfo(this.customer),e.setBillingAddress(this.billingAddress),e.setOrderInfo(this.order),e.setGeolocation(this.geolocation),e.setOnValidate(this.userOnValidate)}filterAllowedPaymentTypes(e){let t=[],n=Object.values(Od);return Array.isArray(e)||(e=[e]),(e||[]).forEach(e=>{let r=String(e).toLowerCase().replace(/[^a-z]/g,``);n.includes(r)&&t.push(r)}),t}};return d([w],$.prototype,`init`,null),d([w],$.prototype,`execute`,null),d([w],$.prototype,`messageHandler`,null),d([w],$.prototype,`initCardProcessor`,null),d([w],$.prototype,`initClickToPayProcessor`,null),d([w],$.prototype,`initPaypalProcessor`,null),d([w],$.prototype,`initCheckoutProcessor`,null),d([w],$.prototype,`initGooglePayProcessor`,null),d([w],$.prototype,`initApplePayProcessor`,null),d([w],$.prototype,`initPayToProcessor`,null),d([w],$.prototype,`loadCss`,null),d([w],$.prototype,`_cleanUp`,null),d([w],$.prototype,`getForm`,null),d([w],$.prototype,`getSubmit`,null),d([w],$.prototype,`getInput`,null),d([w],$.prototype,`_initForm`,null),d([w],$.prototype,`_setToken`,null),d([w],$.prototype,`getSubmitFormHandler`,null),d([w],$.prototype,`getDestroyDropIn`,null),d([w],$.prototype,`setDestroyDropIn`,null),d([w],$.prototype,`addCard`,null),d([w],$.prototype,`addCardLeastCost`,null),d([w],$.prototype,`addDropIn`,null),d([w],$.prototype,`addPaypal`,null),d([w],$.prototype,`addPayTo`,null),d([w],$.prototype,`addGooglePay`,null),d([w],$.prototype,`addApplePay`,null),d([w],$.prototype,`addCheckout`,null),d([w],$.prototype,`addUpi`,null),d([w],$.prototype,`addThreeDsWithFullParameters`,null),d([w],$.prototype,`tokeniseWith3Ds`,null),d([w],$.prototype,`threeDsOrTokenise`,null),d([w],$.prototype,`tokeniseCard`,null),d([w],$.prototype,`addThreeDsWithToken`,null),d([w],$.prototype,`threeDsWithToken`,null),d([w],$.prototype,`getPaymentOptions`,null),d([w],$.prototype,`getProviderInfo`,null),d([w],$.prototype,`setAmount`,null),d([w],$.prototype,`setCurrency`,null),d([w],$.prototype,`onSuccess`,null),d([w],$.prototype,`onFailure`,null),d([w],$.prototype,`onLoaded`,null),d([w],$.prototype,`onPaymentMethodStatus`,null),d([w],$.prototype,`onThreeDsProgress`,null),d([w],$.prototype,`onValidationStatusChange`,null),d([w],$.prototype,`onValidate`,null),d([w],$.prototype,`showErrorMessage`,null),d([w],$.prototype,`setBillingAddress`,null),d([w],$.prototype,`setCustomerInfo`,null),d([w],$.prototype,`setOrderInfo`,null),d([w],$.prototype,`setGeolocation`,null),d([w],$.prototype,`checkGeolocation`,null),d([w],$.prototype,`initProcessors`,null),d([w],$.prototype,`addFraudProcessor`,null),d([w],$.prototype,`resolveThreeDsProvider`,null),d([w],$.prototype,`add3DsProcessor`,null),d([w],$.prototype,`addSecondary3DsProcessor`,null),d([w],$.prototype,`preloadClickToPay`,null),d([w],$.prototype,`addSavedPaymentMethods`,null),new $});
|