@finyxpay/ui 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/allowedMethods.d.ts +3 -0
- package/dist/api/allowedMethods.d.ts.map +1 -0
- package/dist/api/client.d.ts +7 -26
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/createClient.d.ts +3 -0
- package/dist/api/createClient.d.ts.map +1 -0
- package/dist/api/http.d.ts +3 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/v2Client.d.ts +18 -0
- package/dist/api/v2Client.d.ts.map +1 -0
- package/dist/api/v2Methods.d.ts +6 -0
- package/dist/api/v2Methods.d.ts.map +1 -0
- package/dist/components/core/Checkout.d.ts.map +1 -1
- package/dist/components/core/PaymentMethodList.d.ts.map +1 -1
- package/dist/components/core/methodElements.d.ts.map +1 -1
- package/dist/components/core/payUi.d.ts +10 -2
- package/dist/components/core/payUi.d.ts.map +1 -1
- package/dist/core/BaseElement.d.ts +3 -1
- package/dist/core/BaseElement.d.ts.map +1 -1
- package/dist/core/Finyx.d.ts +6 -2
- package/dist/core/Finyx.d.ts.map +1 -1
- package/dist/finyx.css +1 -1
- package/dist/finyx.umd.cjs +18 -18
- package/dist/finyx.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2668 -2269
- package/dist/index.js.map +1 -1
- package/dist/providers/adyen.d.ts +2 -3
- package/dist/providers/adyen.d.ts.map +1 -1
- package/dist/providers/adyenV2.d.ts +12 -0
- package/dist/providers/adyenV2.d.ts.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -2
package/dist/finyx.umd.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(ze,pn){typeof exports=="object"&&typeof module<"u"?pn(exports):typeof define=="function"&&define.amd?define(["exports"],pn):(ze=typeof globalThis<"u"?globalThis:ze||self,pn(ze.Finyx={}))})(this,(function(ze){"use strict";const pn=new Map,Hr=new Map;class $o{constructor(t,n){this.apiKey=t,this.apiBase=n}headers(){return{"Content-Type":"application/json","x-api-key":this.apiKey}}methodsKey(){return`${this.apiBase}\0${this.apiKey}`}async getPaymentMethods(){const t=this.methodsKey(),n=pn.get(t);if(n)return n;const o=Hr.get(t);if(o)return o;const r=this.fetchPaymentMethods().then(i=>(pn.set(t,i),i)).finally(()=>{Hr.delete(t)});return Hr.set(t,r),r}async fetchPaymentMethods(){const t=await fetch(`${this.apiBase}/api/v4/payment-methods`,{headers:this.headers()}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error(Kr(n)||`Failed to load payment methods (${t.status})`);return Array.isArray(n)?n:Array.isArray(n?.data)?n.data:[]}async createPayment(t){try{const n=await fetch(`${this.apiBase}/api/v4/payments`,{method:"POST",headers:this.headers(),body:JSON.stringify({...t,iframe3ds:!0,autoCapture:t.autoCapture??!0,metadata:t.metadata??{source:"finyx-js",version:"0.1.0"}})}),o=await n.json().catch(()=>null);return n.ok?{ok:!0,data:o}:{ok:!1,message:Kr(o)||"Checkout failed"}}catch(n){return{ok:!1,message:n instanceof Error?n.message:"Checkout failed"}}}async confirmPayment(t,n){try{const o=await fetch(`${this.apiBase}/api/v4/payments/${t}/confirm`,{method:"POST",headers:this.headers(),body:JSON.stringify(n)}),r=await o.json().catch(()=>null);return o.ok?{ok:!0,data:r}:{ok:!1,message:Kr(r)||"Confirm failed"}}catch(o){return{ok:!1,message:o instanceof Error?o.message:"Confirm failed"}}}async getPayment(t){try{const n=await fetch(`${this.apiBase}/api/v4/payments/${t}`,{headers:this.headers()});return n.ok?await n.json():null}catch{return null}}}function Kr(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.message=="string"&&t.message.trim()?t.message:typeof t.error=="string"&&t.error.trim()?t.error:null}const cu={dev:"http://localhost:32022",test:"https://awx-api-pay-demo.koomi.app",playground:"https://awx-api-pay-demo.koomi.app",sandbox:"https://api-sandbox.koomipay.com",live:"https://api.koomipay.com"};function jr(e,t){const n=t?.trim();if(n)return n.replace(/\/$/,"");const[o]=e.split("."),r=o?cu[o]:void 0;if(!r)throw new Error("[@finyxpay/ui] Invalid API Key. Expected a prefix of dev, test, playground, sandbox, or live — or pass apiBase.");return r}function du(e){try{if(new URL(e).hostname==="api.koomipay.com")return"prod"}catch{}return"demo"}const uu={colorPrimary:"--fy-color-primary",colorBackground:"--fy-color-bg",colorText:"--fy-color-text",colorMuted:"--fy-color-muted",colorDanger:"--fy-color-danger",borderRadius:"--fy-radius",fontFamily:"--fy-font"};function hu(e,t){const n=t?.theme??"default";e.dataset.fyTheme=n;const o=t?.variables;if(o)for(const[r,i]of Object.entries(o)){const a=uu[r];a&&i&&e.style.setProperty(a,i)}}function Fo(...e){return e.filter(Boolean).join(" ")}function P(e,t={},n=[]){const o=document.createElement(e);for(const[r,i]of Object.entries(t))i===void 0||i===!1||(r==="class"?o.className=String(i):r==="text"?o.textContent=String(i):i===!0?o.setAttribute(r,""):o.setAttribute(r,String(i)));for(const r of n)r&&o.append(typeof r=="string"?document.createTextNode(r):r);return o}function pu(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ln(e,t){try{return new Intl.NumberFormat("en-SG",{style:"currency",currency:t}).format(e)}catch{return`${t} ${e.toFixed(2)}`}}function zr(e){if(e)try{const t=new URL(e);if(t.protocol==="http:"||t.protocol==="https:")return t.href}catch{}}function mu(e="fy"){return`${e}-${Math.random().toString(36).slice(2,10)}`}class Mo{constructor(t,n,o){this.container=null,this.root=null,this.listeners=new Map,this.type=t,this.options={...n},this.ctx=o}mount(t){if(this.container)return console.warn(`[@finyxpay/ui] Element "${this.type}" is already mounted.`),this;const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error(`[@finyxpay/ui] Cannot mount "${this.type}": container not found.`);return this.container=n,this.root=document.createElement("div"),this.root.className="fy",hu(this.root,this.ctx.appearance),n.appendChild(this.root),this.render(),this.emit("ready",void 0),this}unmount(){return!this.container||!this.root?this:(this.onUnmount(),this.container.removeChild(this.root),this.root=null,this.container=null,this)}destroy(){this.unmount(),this.listeners.clear()}update(t){return this.options={...this.options,...t},this.root&&this.render(),this}on(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),this}off(t,n){return this.listeners.get(t)?.delete(n),this}emit(t,n){this.listeners.get(t)?.forEach(o=>{o(n)})}get showWordmark(){return this.ctx.appearance.showWordmark!==!1}onUnmount(){this.root&&pu(this.root)}}function fu(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return/iPad|iPhone|iPod/.test(e)||t}function qr(){if(typeof window>"u"||typeof ApplePaySession>"u")return!1;try{return ApplePaySession.canMakePayments()&&ApplePaySession.supportsVersion(4)}catch{return!1}}function Wr(){return typeof window>"u"||fu()||!window.isSecureContext?!1:typeof window.PaymentRequest=="function"}function yu(e){return e==="applepay"?qr():e==="googlepay"?Wr():!0}function Gr(e){return e.filter(t=>yu(t.type))}const gu=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="Card">
|
|
1
|
+
(function(ze,mn){typeof exports=="object"&&typeof module<"u"?mn(exports):typeof define=="function"&&define.amd?define(["exports"],mn):(ze=typeof globalThis<"u"?globalThis:ze||self,mn(ze.Finyx={}))})(this,(function(ze){"use strict";function mn(e){return{"Content-Type":"application/json","x-api-key":e}}function zt(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.message=="string"&&t.message.trim()?t.message:typeof t.error=="string"&&t.error.trim()?t.error:null}const ds=new Map,Wo=new Map;class vu{constructor(t,n){this.apiKey=t,this.apiBase=n,this.apiVersion="v4"}headers(){return mn(this.apiKey)}methodsKey(){return`${this.apiBase}\0${this.apiKey}\0v4`}async getClientConfig(){throw new Error("Adyen client config is returned from createPayment on API v4.")}async getPaymentMethods(t){const n=this.methodsKey(),r=ds.get(n);if(r)return r;const o=Wo.get(n);if(o)return o;const i=this.fetchPaymentMethods().then(a=>(ds.set(n,a),a)).finally(()=>{Wo.delete(n)});return Wo.set(n,i),i}async fetchPaymentMethods(){const t=await fetch(`${this.apiBase}/api/v4/payment-methods`,{headers:this.headers()}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error(zt(n)||`Failed to load payment methods (${t.status})`);return Array.isArray(n)?n:Array.isArray(n?.data)?n.data:[]}async createPayment(t){try{const n=await fetch(`${this.apiBase}/api/v4/payments`,{method:"POST",headers:this.headers(),body:JSON.stringify({amount:t.amount,currency:t.currency,orderId:t.orderId,paymentMethod:t.paymentMethod,items:t.items,returnUrl:t.returnUrl,iframe3ds:!0,autoCapture:t.autoCapture??!0,metadata:t.metadata??{source:"finyx-js",version:"0.1.0"},...t.existingPaymentId?{paymentId:t.existingPaymentId}:{}})}),r=await n.json().catch(()=>null);return n.ok?{ok:!0,data:r}:{ok:!1,message:zt(r)||"Checkout failed"}}catch(n){return{ok:!1,message:n instanceof Error?n.message:"Checkout failed"}}}async confirmPayment(t,n){try{const r=await fetch(`${this.apiBase}/api/v4/payments/${t}/confirm`,{method:"POST",headers:this.headers(),body:JSON.stringify(n)}),o=await r.json().catch(()=>null);return r.ok?{ok:!0,data:o}:{ok:!1,message:zt(o)||"Confirm failed"}}catch(r){return{ok:!1,message:r instanceof Error?r.message:"Confirm failed"}}}async getPayment(t){try{const n=await fetch(`${this.apiBase}/api/v4/payments/${t}`,{headers:this.headers()});return n.ok?await n.json():null}catch{return null}}}const Cu={SGD:"SG",USD:"US",HKD:"HK",AUD:"AU",GBP:"GB",EUR:"DE",CNY:"CN",JPY:"JP"};function Fr(e){return Cu[e.toUpperCase()]??"SG"}const _u=new Set(["card","googlepay","applepay","paynow","wechatpay","alipay"]),wu={scheme:"card",card:"card",googlepay:"googlepay",applepay:"applepay",paynow:"paynow",wechatpay:"wechatpay",wechatpayqr:"wechatpay",alipay:"alipay"},Su=new Set(["wechatpayminiprogram","wechatpayweb","wechatpaysdk","alipay_wap"]),ku={card:"Credit Card",googlepay:"Google Pay",applepay:"Apple Pay",paynow:"PayNow",wechatpay:"WeChat Pay",alipay:"Alipay"};function Eu(e){const t=e.toLowerCase();return Su.has(t)?null:wu[t]??null}function xu(e){return _u.has(e)}function us(e){return e==="card"?"scheme":e}function Pu(e){const t=Array.isArray(e)?e:e&&typeof e=="object"&&Array.isArray(e.paymentMethods)?e.paymentMethods:[],n=new Set,r=[];for(const o of t){if(!o||typeof o!="object")continue;const i=o;if(typeof i.type!="string")continue;const a=Eu(i.type);if(!a||!xu(a)||n.has(a))continue;n.add(a);const s=Array.isArray(i.brands)?i.brands.filter(l=>typeof l=="string"):void 0;r.push({type:a,name:typeof i.name=="string"&&i.name.trim()?i.name:ku[a]??a,...s?.length?{brands:s}:{}})}return r}const hs=new Map,Go=new Map;class Tu{constructor(t,n){this.apiKey=t,this.apiBase=n,this.apiVersion="v2"}headers(){return mn(this.apiKey)}async getClientConfig(){const t=await fetch(`${this.apiBase}/v2/koomipay/payment-config`,{method:"POST",headers:this.headers(),body:JSON.stringify({})}),n=await t.json().catch(()=>null);if(!Lr(n))throw new Error(zt(n)||`Failed to load payment config (${t.status})`);const r=n.data||{},o=typeof r.clientKey=="string"?r.clientKey:"";if(!o)throw new Error("Adyen client key is missing.");return{clientKey:o,environment:typeof r.environment=="string"?r.environment:"test",locale:typeof r.locale=="string"?r.locale:"en-US"}}async getPaymentMethods(t){const n=t?.amount,r=t?.currency,o=`${this.apiBase}\0${this.apiKey}\0v2\0${n??""}\0${r??""}`,i=hs.get(o);if(i)return i;const a=Go.get(o);if(a)return a;const s=this.fetchPaymentMethods(n,r).then(l=>(hs.set(o,l),l)).finally(()=>{Go.delete(o)});return Go.set(o,s),s}async fetchPaymentMethods(t,n){const r=await fetch(`${this.apiBase}/v2/koomipay/payment-methods`,{method:"POST",headers:this.headers(),body:JSON.stringify({countryCode:Fr(n||"SGD"),amount:{currency:n||"SGD",price:t??0},merchantOrigin:typeof window<"u"?window.location.origin:void 0})}),o=await r.json().catch(()=>null);if(!Lr(o)&&!Array.isArray(o?.paymentMethods))throw new Error(zt(o)||`Failed to load payment methods (${r.status})`);return Pu(o)}async createPayment(t){try{const n=t.encryptedPaymentMethod||{type:us(t.paymentMethod.type)};if(t.existingOrderId)return this.postCheckout(`${this.apiBase}/api/v2/paymentLinkCheckout`,{data:{orderId:t.existingOrderId,paymentMethod:n,browserInfo:t.browserInfo||{}}});const r=t.autoCapture===!0?"/v2/koomipay/instant-checkout":"/v2/koomipay/checkout";return this.postCheckout(`${this.apiBase}${r}`,{orderID:t.orderId,amount:{currency:t.currency,price:t.amount},paymentMethod:n,browserInfo:t.browserInfo||{},items:t.items,returnUrl:t.returnUrl,autoCapture:t.autoCapture??!1,metadata:t.metadata??{source:"finyx-js",version:"0.1.0"}})}catch(n){return{ok:!1,message:n instanceof Error?n.message:"Checkout failed"}}}async confirmPayment(t,n){try{const o=await(await fetch(`${this.apiBase}/v2/koomipay/payment-details`,{method:"POST",headers:this.headers(),body:JSON.stringify({data:{details:n.details,paymentData:n.paymentData,paymentMethod:n.paymentMethod,browserInfo:n.browserInfo}})})).json().catch(()=>null);return Lr(o)?{ok:!0,data:ps(o,t)}:{ok:!1,message:zt(o)||"Confirm failed"}}catch(r){return{ok:!1,message:r instanceof Error?r.message:"Confirm failed"}}}async getPayment(t){try{const n=await fetch(`${this.apiBase}/api/v2/checkout/payments/${t}/status`,{headers:this.headers()});if(!n.ok)return null;const o=(await n.json().catch(()=>null))?.data?.payment;if(!o)return null;const i=String(o.id??t),a=typeof o.transactionStatus=="string"?o.transactionStatus:void 0;return{payment:{id:i,transactionStatus:a,platform:"ADYEN"}}}catch{return null}}async postCheckout(t,n){const o=await(await fetch(t,{method:"POST",headers:this.headers(),body:JSON.stringify(n)})).json().catch(()=>null);return Lr(o)?{ok:!0,data:ps(o)}:{ok:!1,message:zt(o)||"Checkout failed"}}}function ps(e,t=""){const n=e&&typeof e=="object"?e:{},r=n.data&&typeof n.data=="object"?n.data:n,o=r.action&&typeof r.action=="object"?{...r.action}:void 0,i=String(r.paymentID||r.paymentId||t||""),a=typeof r.resultCode=="string"?r.resultCode:void 0,s=typeof r.redirectUrl=="string"?r.redirectUrl:void 0;return o&&s&&!o.url&&(o.type==="redirect"||a==="RedirectShopper")&&(o.url=s),{provider:"ADYEN",paymentData:{action:o,resultCode:a},payment:{id:i,transactionStatus:typeof r.paymentStatus=="string"?r.paymentStatus:a,platform:"ADYEN"}}}function Lr(e){return!e||typeof e!="object"?!1:e.success!==!1}function Du(e,t,n){return n==="v2"?new Tu(e,t):new vu(e,t)}const Au={dev:"http://localhost:32022",test:"https://awx-api-pay-demo.koomi.app",playground:"https://awx-api-pay-demo.koomi.app",sandbox:"https://api-sandbox.koomipay.com",live:"https://api.koomipay.com"};function Yo(e,t){const n=t?.trim();if(n)return n.replace(/\/$/,"");const[r]=e.split("."),o=r?Au[r]:void 0;if(!o)throw new Error("[@finyxpay/ui] Invalid API Key. Expected a prefix of dev, test, playground, sandbox, or live — or pass apiBase.");return o}function Nu(e){try{if(new URL(e).hostname==="api.koomipay.com")return"prod"}catch{}return"demo"}const Iu={colorPrimary:"--fy-color-primary",colorBackground:"--fy-color-bg",colorText:"--fy-color-text",colorMuted:"--fy-color-muted",colorDanger:"--fy-color-danger",borderRadius:"--fy-radius",fontFamily:"--fy-font"};function Ru(e,t){const n=t?.theme??"default";e.dataset.fyTheme=n;const r=t?.variables;if(r)for(const[o,i]of Object.entries(r)){const a=Iu[o];a&&i&&e.style.setProperty(a,i)}}function Or(...e){return e.filter(Boolean).join(" ")}function k(e,t={},n=[]){const r=document.createElement(e);for(const[o,i]of Object.entries(t))i===void 0||i===!1||(o==="class"?r.className=String(i):o==="text"?r.textContent=String(i):i===!0?r.setAttribute(o,""):r.setAttribute(o,String(i)));for(const o of n)o&&r.append(typeof o=="string"?document.createTextNode(o):o);return r}function $u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function fn(e,t){try{return new Intl.NumberFormat("en-SG",{style:"currency",currency:t}).format(e)}catch{return`${t} ${e.toFixed(2)}`}}function Br(e){if(e)try{const t=new URL(e);if(t.protocol==="http:"||t.protocol==="https:")return t.href}catch{}}function Mu(e="fy"){return`${e}-${Math.random().toString(36).slice(2,10)}`}class Vr{constructor(t,n,r){this.container=null,this.root=null,this.listeners=new Map,this.type=t,this.options={...n},this.ctx=r}mount(t){if(this.container)return console.warn(`[@finyxpay/ui] Element "${this.type}" is already mounted.`),this;const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error(`[@finyxpay/ui] Cannot mount "${this.type}": container not found.`);return this.container=n,this.root=document.createElement("div"),this.root.className="fy",Ru(this.root,this.ctx.appearance),n.appendChild(this.root),this.render(),this.emit("ready",void 0),this}unmount(){return!this.container||!this.root?this:(this.onUnmount(),this.container.removeChild(this.root),this.root=null,this.container=null,this)}destroy(){this.unmount(),this.listeners.clear()}update(t){return this.options={...this.options,...t},this.root&&this.render(),this}on(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),this}off(t,n){return this.listeners.get(t)?.delete(n),this}emit(t,n){this.listeners.get(t)?.forEach(r=>{r(n)})}get showWordmark(){return this.ctx.appearance.showWordmark!==!1}onUnmount(){this.root&&$u(this.root)}}function Fu(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return/iPad|iPhone|iPod/.test(e)||t}function Zo(){if(typeof window>"u"||typeof ApplePaySession>"u")return!1;try{return ApplePaySession.canMakePayments()&&ApplePaySession.supportsVersion(4)}catch{return!1}}function Qo(){return typeof window>"u"||Fu()||!window.isSecureContext?!1:typeof window.PaymentRequest=="function"}function Lu(e){return e==="applepay"?Zo():e==="googlepay"?Qo():!0}function Jo(e){return e.filter(t=>Lu(t.type))}function ms(e,t){if(!t?.length)return e;const n=new Set(t.map(r=>r.toLowerCase()));return e.filter(r=>n.has(r.type.toLowerCase())?!0:!!r.brands?.some(o=>n.has(o.toLowerCase()))).map(r=>{if(!r.brands?.length||n.has(r.type.toLowerCase())&&!r.brands.some(i=>n.has(i.toLowerCase())))return r;const o=r.brands.filter(i=>n.has(i.toLowerCase()));return o.length?{...r,brands:o}:r})}const Ou=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="Card">
|
|
2
2
|
<rect x="1" y="4" width="22" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="1.5"/>
|
|
3
3
|
<rect x="1" y="8" width="22" height="3" fill="currentColor"/>
|
|
4
4
|
<rect x="3" y="14" width="6" height="1.5" rx="0.5" fill="currentColor" opacity="0.6"/>
|
|
5
5
|
</svg>
|
|
6
|
-
`,
|
|
6
|
+
`,Bu=`<svg width="70" height="48" viewBox="0 0 70 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
7
|
<g clip-path="url(#clip0_2881_6359)">
|
|
8
8
|
<path d="M63.729 2H6.2686C6.02929 2 5.78955 2 5.55066 2.0014C5.34873 2.00283 5.14726 2.00507 4.9458 2.01057C4.50641 2.02246 4.06326 2.04838 3.62938 2.12636C3.18855 2.20569 2.77835 2.3351 2.37817 2.53885C1.98475 2.73892 1.62457 3.0006 1.31244 3.31287C1.00017 3.62513 0.738486 3.98472 0.538458 4.37856C0.334667 4.77874 0.205177 5.18907 0.126392 5.63023C0.0479923 6.06425 0.0218957 6.50731 0.0100547 6.94623C0.00464166 7.1477 0.00231999 7.34916 0.00100479 7.55059C-0.000390752 7.78998 7.4429e-05 8.02921 7.4429e-05 8.26904V40.5432C7.4429e-05 40.7831 -0.000390752 41.0219 0.00100479 41.2617C0.00231999 41.4632 0.00464166 41.6646 0.0100547 41.8661C0.0218957 42.3046 0.0479923 42.7477 0.126392 43.1816C0.205177 43.6229 0.334667 44.0331 0.538458 44.4333C0.738486 44.8271 1.00017 45.1872 1.31244 45.499C1.62457 45.8117 1.98475 46.0734 2.37817 46.273C2.77835 46.4773 3.18855 46.6067 3.62938 46.686C4.06326 46.7635 4.50641 46.7899 4.9458 46.8017C5.14726 46.8063 5.34873 46.809 5.55066 46.8099C5.78955 46.8118 6.02929 46.8118 6.2686 46.8118H63.729C63.9679 46.8118 64.2076 46.8118 64.4465 46.8099C64.648 46.809 64.8494 46.8063 65.0518 46.8017C65.4903 46.7899 65.9333 46.7635 66.3683 46.686C66.8085 46.6067 67.2188 46.4773 67.619 46.273C68.0129 46.0734 68.372 45.8117 68.6848 45.499C68.9965 45.1872 69.2582 44.8271 69.4587 44.4333C69.663 44.0331 69.7924 43.6229 69.8708 43.1816C69.9492 42.7477 69.9747 42.3046 69.9865 41.8661C69.992 41.6646 69.9948 41.4632 69.9957 41.2617C69.9975 41.0219 69.9975 40.7831 69.9975 40.5432V8.26904C69.9975 8.02921 69.9975 7.78998 69.9957 7.55059C69.9948 7.34916 69.992 7.1477 69.9865 6.94623C69.9747 6.50731 69.9492 6.06425 69.8708 5.63023C69.7924 5.18907 69.663 4.77874 69.4587 4.37856C69.2582 3.98472 68.9965 3.62513 68.6848 3.31287C68.372 3.0006 68.0129 2.73892 67.619 2.53885C67.2188 2.3351 66.8085 2.20569 66.3683 2.12636C65.9333 2.04838 65.4903 2.02246 65.0518 2.01057C64.8494 2.00507 64.648 2.00283 64.4465 2.0014C64.2076 2 63.9679 2 63.729 2Z" fill="black"/>
|
|
9
9
|
<path d="M63.7295 3.4931L64.4364 3.49446C64.6279 3.49581 64.8194 3.49788 65.0119 3.50313C65.3469 3.51218 65.7387 3.53032 66.1039 3.59578C66.4213 3.65296 66.6876 3.7399 66.9431 3.86998C67.1953 3.99816 67.4265 4.16614 67.6283 4.36764C67.8308 4.57051 67.999 4.802 68.1289 5.05704C68.2582 5.31057 68.3446 5.57555 68.4015 5.89534C68.4668 6.25658 68.4848 6.64944 68.494 6.98644C68.4992 7.17666 68.5017 7.36688 68.5026 7.56162C68.5044 7.79713 68.5044 8.03251 68.5044 8.26848V40.5427C68.5044 40.7787 68.5044 41.0136 68.5026 41.2542C68.5017 41.4443 68.4992 41.6345 68.494 41.8251C68.4848 42.1616 68.4668 42.5542 68.4007 42.9198C68.3446 43.2351 68.2583 43.5002 68.1282 43.755C67.9987 44.0094 67.8308 44.2406 67.6291 44.4422C67.4262 44.6452 67.1958 44.8127 66.9406 44.942C66.687 45.0715 66.4212 45.1583 66.1068 45.2149C65.7342 45.2813 65.326 45.2996 65.0186 45.3079C64.8251 45.3123 64.6326 45.3149 64.4354 45.3158C64.2004 45.3176 63.9646 45.3176 63.7295 45.3176H6.26912C6.26599 45.3176 6.26294 45.3176 6.25977 45.3176C6.02744 45.3176 5.79463 45.3176 5.55807 45.3158C5.36519 45.3149 5.17273 45.3123 4.98666 45.3081C4.67219 45.2996 4.26372 45.2814 3.89416 45.2153C3.57712 45.1583 3.31133 45.0715 3.05438 44.9403C2.80153 44.8121 2.57135 44.6448 2.36832 44.4414C2.16685 44.2403 1.99943 44.0098 1.86998 43.755C1.74041 43.5005 1.65372 43.2346 1.59672 42.9155C1.53082 42.5507 1.51272 42.1596 1.50368 41.8254C1.49852 41.634 1.49636 41.4427 1.49513 41.2525L1.4942 40.6909L1.49424 40.5427V8.26848L1.4942 8.12022L1.49509 7.55984C1.49636 7.36849 1.49852 7.17717 1.50368 6.98598C1.51272 6.65143 1.53082 6.26017 1.59726 5.89234C1.65376 5.57606 1.74041 5.31023 1.87066 5.05442C1.99909 4.80157 2.16681 4.57076 2.36934 4.36828C2.57106 4.16647 2.802 3.99871 3.05645 3.86931C3.31065 3.73986 3.57695 3.65296 3.89399 3.59591C4.25928 3.53028 4.65135 3.51218 4.98712 3.50308C5.17852 3.49788 5.36992 3.49581 5.55989 3.4945L6.26912 3.4931H63.7295Z" fill="white"/>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</clipPath>
|
|
20
20
|
</defs>
|
|
21
21
|
</svg>
|
|
22
|
-
`,
|
|
22
|
+
`,Vu=`<svg width="70" height="48" viewBox="0 0 70 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
23
23
|
<g clip-path="url(#clip0_2881_7564)">
|
|
24
24
|
<path d="M51.3812 6H18.6164C8.37737 6 0 14.321 0 24.4912C0 34.6613 8.37737 42.9824 18.6164 42.9824H51.3812C61.6202 42.9824 69.9975 34.6613 69.9975 24.4912C69.9975 14.321 61.6202 6 51.3812 6Z" fill="white"/>
|
|
25
25
|
<path d="M51.3812 7.49779C53.6803 7.49779 55.9143 7.95082 58.0179 8.8384C60.0564 9.69824 61.8808 10.9279 63.4632 12.4904C65.0363 14.0529 66.2743 15.8743 67.1399 17.8991C68.0335 19.9886 68.4896 22.2075 68.4896 24.4912C68.4896 26.7748 68.0335 28.9938 67.1399 31.0833C66.2743 33.1081 65.0363 34.9202 63.4632 36.492C61.8901 38.0545 60.0564 39.2841 58.0179 40.144C55.9143 41.0315 53.6803 41.4846 51.3812 41.4846H18.6164C16.3172 41.4846 14.0833 41.0315 11.9796 40.144C9.94114 39.2841 8.11674 38.0545 6.53434 36.492C4.96126 34.9295 3.72327 33.1081 2.85761 31.0833C1.96403 28.9938 1.50793 26.7748 1.50793 24.4912C1.50793 22.2075 1.96403 19.9886 2.85761 17.8991C3.72327 15.8743 4.96126 14.0622 6.53434 12.4904C8.10743 10.9279 9.94114 9.69824 11.9796 8.8384C14.0833 7.95082 16.3172 7.49779 18.6164 7.49779H51.3812ZM51.3812 6H18.6164C8.37737 6 0 14.321 0 24.4912C0 34.6613 8.37737 42.9824 18.6164 42.9824H51.3812C61.6202 42.9824 69.9975 34.6613 69.9975 24.4912C69.9975 14.321 61.6202 6 51.3812 6Z" fill="#3C4043"/>
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
</clipPath>
|
|
38
38
|
</defs>
|
|
39
39
|
</svg>
|
|
40
|
-
`,
|
|
40
|
+
`,Uu=`<svg width="70" height="48" viewBox="0 0 70 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
41
41
|
<rect width="70" height="48" rx="6.5" fill="#00A0E9"/>
|
|
42
42
|
<path d="M23.3525 36.9587C16.3335 36.9587 14.2584 31.3828 17.7272 28.3321C18.8847 27.3011 20.9999 26.7978 22.1276 26.6848C26.2971 26.2693 30.1567 27.8735 34.7115 30.1157C31.5099 34.3278 27.432 36.9587 23.3525 36.9587ZM48.3079 30.5385C46.5026 29.9286 44.0801 28.9961 41.3818 28.0116C43.0022 25.1705 44.2966 21.9353 45.1473 18.4192H36.2539V15.1886H47.1483V13.3854H36.2539V8H31.8078C31.0279 8 31.0279 8.77652 31.0279 8.77652V13.3854H20.0094V15.1886H31.0279V18.4192H21.9307V20.222H39.5743C38.9287 22.4655 38.0618 24.5717 37.0329 26.4854C31.3079 24.5803 25.1988 23.0362 21.3609 23.9866C18.9064 24.5965 17.3257 25.685 16.397 26.8255C12.1346 32.0557 15.1917 40 24.1934 40C29.5157 40 34.6428 37.0073 38.6167 32.0753C44.5438 34.9487 56.2786 39.8824 56.2786 39.8824V32.851C56.2786 32.851 54.8049 32.7325 48.3079 30.5385Z" fill="white"/>
|
|
43
43
|
</svg>
|
|
44
|
-
`,
|
|
44
|
+
`,Hu=`<svg width="70" height="48" viewBox="0 0 70 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
45
45
|
<rect x="1" y="1" width="68" height="46" rx="5.5" fill="white"/>
|
|
46
46
|
<rect x="1" y="1" width="68" height="46" rx="5.5" stroke="#F6F7F8" stroke-width="2"/>
|
|
47
47
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7255 20.7423L12.6702 24.872H8.70309L10.7255 20.7423ZM13.7398 27.2011H16.1123L11.659 17.6303H11.095C10.9996 17.6036 10.8987 17.6036 10.8033 17.6303C10.708 17.6824 10.6327 17.7651 10.5894 17.8652L6 27.2011H7.59463L8.39194 25.6353H13.0397L13.7398 27.2011Z" fill="#373530"/>
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.3464 18.0414C23.3096 18.3292 23.1698 18.5937 22.9533 18.7853C22.7367 18.977 22.4583 19.0827 22.1699 19.0827C21.8815 19.0827 21.6031 18.977 21.3865 18.7853C21.17 18.5937 21.0302 18.3292 20.9934 18.0414C21.0302 17.7535 21.17 17.489 21.3865 17.2974C21.6031 17.1057 21.8815 17 22.1699 17C22.4583 17 22.7367 17.1057 22.9533 17.2974C23.1698 17.489 23.3096 17.7535 23.3464 18.0414Z" fill="#00AEEF"/>
|
|
54
54
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M63.7565 27.2794H62.1619C62.1404 27.2886 62.1172 27.2933 62.0939 27.2933C62.0705 27.2933 62.0473 27.2886 62.0258 27.2794L60.1784 24.05L59.206 25.1656V27.2794H57.9226C57.8845 27.2797 57.8476 27.2659 57.8189 27.2407C57.7902 27.2154 57.7717 27.1805 57.767 27.1424V20.1747C57.7717 20.1367 57.7902 20.1017 57.8189 20.0765C57.8476 20.0512 57.8845 20.0374 57.9226 20.0377H59.206V22.9931L61.6369 20.0573C61.6746 20.0439 61.7158 20.0439 61.7535 20.0573H63.601L61.1312 22.9148L63.7565 27.2794ZM55.9779 27.2794H54.6555C54.6174 27.2797 54.5805 27.2659 54.5518 27.2407C54.5232 27.2154 54.5047 27.1805 54.4999 27.1424V24.4023C54.5039 24.3714 54.4987 24.34 54.4848 24.3121C54.471 24.2842 54.4491 24.2611 54.4222 24.2457H52.0302V27.2794H50.7078C50.6697 27.2797 50.6329 27.2659 50.6042 27.2407C50.5755 27.2154 50.557 27.1805 50.5523 27.1424V20.1747C50.557 20.1367 50.5755 20.1017 50.6042 20.0765C50.6329 20.0512 50.6697 20.0374 50.7078 20.0377H52.0302V22.9931H54.4222C54.44 22.9931 54.4577 22.9896 54.4743 22.9827C54.4908 22.9758 54.5058 22.9657 54.5184 22.953C54.5311 22.9403 54.5411 22.9252 54.5479 22.9085C54.5548 22.8919 54.5583 22.8741 54.5583 22.8561V20.1747C54.563 20.1367 54.5815 20.1017 54.6102 20.0765C54.6389 20.0512 54.6758 20.0374 54.7139 20.0377H56.0362L55.9779 27.2794Z" fill="#00AEEF"/>
|
|
55
55
|
</svg>
|
|
56
|
-
`,
|
|
56
|
+
`,Ku=`<svg width="70" height="48" viewBox="0 0 70 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
57
57
|
<rect width="70" height="48" rx="6.5" fill="#00A0E9"/>
|
|
58
58
|
<path d="M23.3525 36.9587C16.3335 36.9587 14.2584 31.3828 17.7272 28.3321C18.8847 27.3011 20.9999 26.7978 22.1276 26.6848C26.2971 26.2693 30.1567 27.8735 34.7115 30.1157C31.5099 34.3278 27.432 36.9587 23.3525 36.9587ZM48.3079 30.5385C46.5026 29.9286 44.0801 28.9961 41.3818 28.0116C43.0022 25.1705 44.2966 21.9353 45.1473 18.4192H36.2539V15.1886H47.1483V13.3854H36.2539V8H31.8078C31.0279 8 31.0279 8.77652 31.0279 8.77652V13.3854H20.0094V15.1886H31.0279V18.4192H21.9307V20.222H39.5743C38.9287 22.4655 38.0618 24.5717 37.0329 26.4854C31.3079 24.5803 25.1988 23.0362 21.3609 23.9866C18.9064 24.5965 17.3257 25.685 16.397 26.8255C12.1346 32.0557 15.1917 40 24.1934 40C29.5157 40 34.6428 37.0073 38.6167 32.0753C44.5438 34.9487 56.2786 39.8824 56.2786 39.8824V32.851C56.2786 32.851 54.8049 32.7325 48.3079 30.5385Z" fill="white"/>
|
|
59
59
|
</svg>
|
|
60
|
-
`,
|
|
60
|
+
`,ju=`<svg width="70" height="48" viewBox="0 0 70 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
61
|
<g clip-path="url(#clip0_2881_8937)">
|
|
62
62
|
<rect width="70" height="48" rx="6.5" fill="#00C250"/>
|
|
63
63
|
<path d="M30.6325 27.8714C30.1238 28.1309 29.501 27.9406 29.2244 27.441L29.1556 27.289L26.2467 20.8919C26.2348 20.8151 26.2348 20.7368 26.2467 20.6599C26.2462 20.5186 26.3029 20.3832 26.4039 20.2843C26.5048 20.1855 26.6415 20.1317 26.7827 20.1351C26.8964 20.1327 27.0073 20.1701 27.0963 20.2407L30.5845 22.684C30.8431 22.857 31.1469 22.95 31.4581 22.9512C31.6457 22.9522 31.8316 22.9164 32.0053 22.8456L48.0811 15.6453C44.7452 11.9609 39.9763 9.90302 35.007 10.0035C26.1651 10.0035 19 15.9718 19 23.3928C19.1051 27.4492 21.1683 31.2035 24.5362 33.4668C24.8982 33.7337 25.0522 34.2001 24.9202 34.6301L24.2002 37.3518C24.1564 37.4757 24.129 37.6048 24.1186 37.7358C24.1155 37.8785 24.1708 38.0162 24.2717 38.1171C24.3726 38.218 24.5104 38.2733 24.653 38.2702C24.7604 38.2644 24.8647 38.2326 24.957 38.1774L28.4452 36.1533C28.7012 35.9965 28.994 35.9117 29.2948 35.9101C29.4532 35.9101 29.61 35.9325 29.7588 35.9789C31.4597 36.459 33.2166 36.7022 34.983 36.699C43.8234 36.699 50.9997 30.7323 50.9997 23.3704C51.0164 21.1748 50.4076 19.0197 49.2444 17.1574L30.7605 27.801L30.6325 27.8714Z" fill="white"/>
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
</clipPath>
|
|
69
69
|
</defs>
|
|
70
70
|
</svg>
|
|
71
|
-
`,
|
|
71
|
+
`,zu=`<svg width="70" height="48" viewBox="0 0 70 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
72
72
|
<g clip-path="url(#clip0_2881_8157)">
|
|
73
73
|
<rect x="1" y="1" width="68" height="46" rx="5.5" fill="white"/>
|
|
74
74
|
<rect x="1" y="1" width="68" height="46" rx="5.5" stroke="#F6F7F8" stroke-width="2"/>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
</clipPath>
|
|
95
95
|
</defs>
|
|
96
96
|
</svg>
|
|
97
|
-
`,Eu='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 40 26"><path fill="#fff" d="M0 0h40v26H0z"/><path fill="#1434CB" d="m15.9 7.7-4.43 10.6h-2.9l-2.2-8.47c-.13-.52-.25-.71-.65-.93C5.05 8.55 3.96 8.2 3 8l.07-.32h4.67c.6 0 1.13.4 1.27 1.09l1.15 6.14 2.86-7.23h2.89Zm11.39 7.15c0-2.8-3.88-2.96-3.85-4.21 0-.38.37-.79 1.16-.9a5.2 5.2 0 0 1 2.71.48l.48-2.25a7.4 7.4 0 0 0-2.57-.47c-2.71 0-4.62 1.44-4.64 3.51-.02 1.53 1.36 2.38 2.4 2.9 1.08.51 1.44.85 1.43 1.31 0 .71-.85 1.03-1.64 1.04-1.39.02-2.19-.37-2.82-.67l-.5 2.33c.64.29 1.82.55 3.05.56 2.89 0 4.78-1.42 4.79-3.63Zm7.17 3.46H37L34.78 7.7h-2.34c-.53 0-.98.3-1.17.78l-4.12 9.84h2.88l.57-1.58h3.53l.33 1.58Zm-3.07-3.76 1.45-3.99.83 4H31.4ZM19.83 7.7l-2.27 10.62h-2.74L17.09 7.7h2.74Z"/></svg>',ss='<svg enable-background="new 0 0 780 500" viewBox="0 0 780 500" xmlns="http://www.w3.org/2000/svg"><path d="m449.01 250c0 99.143-80.371 179.5-179.51 179.5s-179.5-80.361-179.5-179.5c0-99.133 80.362-179.5 179.5-179.5 99.137 0 179.51 80.371 179.51 179.5" fill="#d9222a"/><path d="m510.49 70.496c-46.379 0-88.643 17.596-120.5 46.467-6.49 5.889-12.548 12.237-18.125 18.996h36.267c4.965 6.037 9.536 12.387 13.685 19.012h-63.635c-3.827 6.122-7.281 12.469-10.342 19.008h84.313c2.894 6.185 5.431 12.53 7.601 19.004h-99.513c-2.09 6.234-3.832 12.58-5.217 19.008h109.94c2.689 12.49 4.045 25.231 4.042 38.008 0 19.935-3.254 39.112-9.254 57.021h-99.513c2.164 6.477 4.7 12.824 7.596 19.008h84.316c-3.063 6.541-6.519 12.889-10.347 19.013h-63.625c4.147 6.62 8.719 12.966 13.685 18.996h36.259c-5.57 6.772-11.63 13.127-18.13 19.013 31.857 28.866 74.117 46.454 120.5 46.454 99.139 0 179.51-80.361 179.51-179.5 0-99.129-80.371-179.5-179.51-179.5" fill="#ee9f2d"/><path d="m666.07 350.06c0-3.199 2.592-5.801 5.796-5.801s5.796 2.602 5.796 5.801-2.592 5.801-5.796 5.801-5.796-2.602-5.796-5.801zm5.796 4.408c2.434-.001 4.407-1.974 4.408-4.408 0-2.432-1.971-4.402-4.402-4.404h-.006c-2.429-.003-4.4 1.963-4.404 4.391v.014c-.002 2.433 1.968 4.406 4.4 4.408.001-.001.003-.001.004-.001zm-.783-1.86h-1.187v-5.096h2.149c.45 0 .908 0 1.305.254.413.279.646.771.646 1.279 0 .571-.338 1.104-.884 1.312l.938 2.25h-1.315l-.779-2.017h-.871zm0-2.89h.658c.246 0 .505.021.726-.1.195-.125.296-.359.296-.584-.005-.209-.112-.402-.288-.518-.207-.129-.536-.101-.758-.101h-.634zm-443.5-80.063c-2.046-.238-2.945-.301-4.35-.301-11.046 0-16.638 3.787-16.638 11.268 0 4.611 2.729 7.545 6.987 7.545 7.939 0 13.659-7.559 14.001-18.512zm14.171 32.996h-16.146l.371-7.676c-4.926 6.065-11.496 8.949-20.426 8.949-10.563 0-17.804-8.25-17.804-20.229 0-18.024 12.596-28.541 34.217-28.541 2.208 0 5.042.199 7.941.57.604-2.441.763-3.488.763-4.801 0-4.908-3.396-6.737-12.5-6.737-9.533-.108-17.396 2.271-20.625 3.333.204-1.229 2.7-16.659 2.7-16.659 9.712-2.846 16.116-3.917 23.325-3.917 16.732 0 25.596 7.513 25.579 21.712.033 3.805-.597 8.5-1.579 14.671-1.691 10.734-5.32 33.721-5.816 39.325zm-62.158 0h-19.487l11.162-69.997-24.925 69.997h-13.279l-1.642-69.597-11.733 69.597h-18.242l15.237-91.056h28.021l1.7 50.968 17.092-50.968h31.167zm354.97-32.996c-2.037-.238-2.941-.301-4.342-.301-11.041 0-16.634 3.787-16.634 11.268 0 4.611 2.726 7.545 6.983 7.545 7.94 0 13.664-7.559 13.993-18.512zm14.184 32.996h-16.146l.366-7.676c-4.926 6.065-11.5 8.949-20.422 8.949-10.565 0-17.8-8.25-17.8-20.229 0-18.024 12.588-28.541 34.213-28.541 2.208 0 5.037.199 7.934.57.604-2.441.763-3.488.763-4.801 0-4.908-3.392-6.737-12.496-6.737-9.533-.108-17.387 2.271-20.629 3.333.204-1.229 2.709-16.659 2.709-16.659 9.712-2.846 16.112-3.917 23.313-3.917 16.74 0 25.604 7.513 25.587 21.712.032 3.805-.597 8.5-1.579 14.671-1.684 10.734-5.321 33.721-5.813 39.325zm-220.39-1.125c-5.333 1.679-9.491 2.398-14 2.398-9.962 0-15.399-5.725-15.399-16.267-.142-3.271 1.433-11.88 2.671-19.737 1.125-6.917 8.449-50.529 8.449-50.529h19.371l-2.263 11.208h11.699l-2.642 17.796h-11.742c-2.25 14.083-5.454 31.625-5.491 33.95 0 3.816 2.037 5.483 6.671 5.483 2.221 0 3.94-.227 5.254-.7zm59.392-.6c-6.654 2.034-13.075 3.017-19.879 3-21.684-.021-32.987-11.346-32.987-33.032 0-25.313 14.38-43.947 33.899-43.947 15.971 0 26.171 10.433 26.171 26.796 0 5.429-.7 10.729-2.388 18.212h-38.574c-1.305 10.741 5.57 15.217 16.837 15.217 6.935 0 13.188-1.429 20.142-4.663zm-10.888-43.9c.107-1.543 2.055-13.217-9.013-13.217-6.171 0-10.583 4.704-12.38 13.217zm-123.42-5.017c0 9.367 4.542 15.826 14.842 20.676 7.892 3.709 9.112 4.81 9.112 8.17 0 4.617-3.479 6.701-11.191 6.701-5.813 0-11.221-.908-17.458-2.922 0 0-2.563 16.321-2.68 17.102 4.43.967 8.38 1.861 20.279 2.19 20.563 0 30.059-7.829 30.059-24.75 0-10.175-3.976-16.146-13.737-20.634-8.171-3.75-9.108-4.587-9.108-8.045 0-4.004 3.237-6.046 9.537-6.046 3.825 0 9.05.408 14 1.112l2.775-17.175c-5.046-.8-12.696-1.442-17.15-1.442-21.801.001-29.347 11.388-29.28 25.063m229.09-23.116c5.412 0 10.458 1.421 17.412 4.921l3.188-19.763c-2.854-1.121-12.904-7.7-21.417-7.7-13.041 0-24.065 6.471-31.82 17.15-11.309-3.746-15.958 3.825-21.657 11.367l-5.063 1.179c.383-2.483.729-4.95.612-7.446h-17.896c-2.445 22.917-6.778 46.128-10.171 69.075l-.884 4.976h19.496c3.254-21.143 5.037-34.68 6.121-43.842l7.341-4.084c1.097-4.078 4.529-5.458 11.417-5.291-.926 5.008-1.389 10.091-1.383 15.184 0 24.225 13.07 39.308 34.05 39.308 5.404 0 10.041-.712 17.221-2.658l3.43-20.759c-6.458 3.181-11.759 4.677-16.559 4.677-11.329 0-18.184-8.363-18.184-22.185 0-20.051 10.196-34.109 24.746-34.109"/><path d="m185.21 297.24h-19.491l11.171-69.988-24.926 69.988h-13.283l-1.642-69.588-11.733 69.588h-18.241l15.237-91.042h28.021l.788 56.362 18.904-56.362h30.267z" fill="#fff"/><path d="m647.52 211.6-4.321 26.309c-5.329-7.013-11.054-12.088-18.612-12.088-9.833 0-18.783 7.455-24.642 18.425-8.158-1.692-16.597-4.563-16.597-4.563l-.004.067c.658-6.134.921-9.875.862-11.146h-17.9c-2.438 22.917-6.771 46.128-10.157 69.075l-.893 4.976h19.492c2.633-17.096 4.648-31.291 6.133-42.551 6.658-6.016 9.992-11.266 16.721-10.916-2.979 7.205-4.725 15.503-4.725 24.017 0 18.513 9.366 30.725 23.533 30.725 7.142 0 12.621-2.462 17.967-8.171l-.913 6.884h18.435l14.842-91.042zm-24.371 73.941c-6.634 0-9.983-4.908-9.983-14.596 0-14.555 6.271-24.875 15.112-24.875 6.695 0 10.32 5.104 10.32 14.509.001 14.679-6.37 24.962-15.449 24.962z"/><path d="m233.19 264.26c-2.042-.236-2.946-.299-4.346-.299-11.046 0-16.634 3.787-16.634 11.266 0 4.604 2.729 7.547 6.979 7.547 7.947-.001 13.668-7.559 14.001-18.514zm14.178 32.984h-16.146l.367-7.663c-4.921 6.054-11.5 8.95-20.421 8.95-10.567 0-17.805-8.25-17.805-20.229 0-18.032 12.592-28.542 34.217-28.542 2.208 0 5.042.2 7.938.571.604-2.441.763-3.487.763-4.808 0-4.909-3.392-6.729-12.496-6.729-9.537-.108-17.396 2.271-20.629 3.321.204-1.225 2.7-16.637 2.7-16.637 9.708-2.858 16.12-3.929 23.32-3.929 16.737 0 25.604 7.517 25.588 21.704.029 3.821-.604 8.513-1.584 14.675-1.687 10.724-5.319 33.724-5.812 39.316zm261.38-88.592-3.191 19.767c-6.95-3.496-12-4.92-17.407-4.92-14.551 0-24.75 14.058-24.75 34.106 0 13.821 6.857 22.181 18.184 22.181 4.8 0 10.096-1.492 16.554-4.675l-3.421 20.75c-7.184 1.957-11.816 2.67-17.225 2.67-20.977 0-34.051-15.084-34.051-39.309 0-32.55 18.059-55.3 43.888-55.3 8.507.001 18.561 3.609 21.419 4.73m31.443 55.608c-2.041-.236-2.941-.299-4.347-.299-11.041 0-16.633 3.787-16.633 11.266 0 4.604 2.729 7.547 6.983 7.547 7.938-.001 13.663-7.559 13.997-18.514zm14.178 32.984h-16.15l.371-7.663c-4.925 6.054-11.5 8.95-20.421 8.95-10.563 0-17.804-8.25-17.804-20.229 0-18.032 12.596-28.542 34.212-28.542 2.213 0 5.042.2 7.941.571.601-2.441.763-3.487.763-4.808 0-4.909-3.393-6.729-12.495-6.729-9.533-.108-17.396 2.271-20.63 3.321.204-1.225 2.704-16.637 2.704-16.637 9.709-2.858 16.116-3.929 23.316-3.929 16.741 0 25.604 7.517 25.583 21.704.033 3.821-.596 8.513-1.579 14.675-1.682 10.724-5.323 33.724-5.811 39.316zm-220.39-1.121c-5.338 1.679-9.496 2.408-14 2.408-9.962 0-15.399-5.726-15.399-16.268-.138-3.279 1.438-11.88 2.675-19.736 1.12-6.926 8.445-50.534 8.445-50.534h19.368l-2.26 11.212h9.941l-2.646 17.788h-9.975c-2.25 14.092-5.463 31.62-5.496 33.95 0 3.83 2.041 5.482 6.671 5.482 2.221 0 3.938-.216 5.254-.691zm59.391-.592c-6.65 2.033-13.079 3.012-19.879 3-21.685-.021-32.987-11.346-32.987-33.033 0-25.321 14.379-43.95 33.899-43.95 15.971 0 26.171 10.429 26.171 26.8 0 5.434-.7 10.733-2.384 18.212h-38.574c-1.306 10.741 5.569 15.222 16.837 15.222 6.93 0 13.188-1.435 20.138-4.677zm-10.891-43.912c.116-1.538 2.06-13.217-9.013-13.217-6.167 0-10.579 4.717-12.375 13.217zm-123.42-5.005c0 9.367 4.542 15.818 14.842 20.675 7.892 3.709 9.112 4.812 9.112 8.172 0 4.616-3.483 6.699-11.188 6.699-5.816 0-11.225-.908-17.467-2.921 0 0-2.554 16.321-2.671 17.101 4.421.967 8.375 1.85 20.275 2.191 20.566 0 30.059-7.829 30.059-24.746 0-10.18-3.971-16.15-13.737-20.637-8.167-3.759-9.113-4.584-9.113-8.046 0-4 3.246-6.059 9.542-6.059 3.821 0 9.046.421 14.004 1.125l2.771-17.179c-5.042-.8-12.692-1.441-17.146-1.441-21.804 0-29.346 11.379-29.283 25.066m398.45 50.63h-18.438l.917-6.893c-5.347 5.717-10.825 8.18-17.968 8.18-14.166 0-23.528-12.213-23.528-30.726 0-24.63 14.521-45.392 31.708-45.392 7.559 0 13.279 3.087 18.604 10.096l4.325-26.308h19.221zm-28.746-17.109c9.075 0 15.45-10.283 15.45-24.953 0-9.405-3.629-14.509-10.325-14.509-8.837 0-15.115 10.315-15.115 24.875-.001 9.686 3.357 14.587 9.99 14.587zm-56.842-56.929c-2.441 22.917-6.773 46.13-10.162 69.063l-.892 4.976h19.491c6.972-45.275 8.658-54.117 19.588-53.009 1.742-9.267 4.982-17.383 7.399-21.479-8.163-1.7-12.721 2.913-18.688 11.675.471-3.788 1.333-7.467 1.162-11.225zm-160.42 0c-2.446 22.917-6.779 46.13-10.167 69.063l-.888 4.976h19.5c6.963-45.275 8.646-54.117 19.57-53.009 1.75-9.267 4.991-17.383 7.399-21.479-8.154-1.7-12.717 2.913-18.679 11.675.471-3.788 1.324-7.467 1.162-11.225zm254.57 68.241c-.004-3.199 2.586-5.795 5.784-5.799h.012c3.197-.004 5.793 2.586 5.796 5.783v.016c-.001 3.201-2.595 5.795-5.796 5.797-3.201-.002-5.795-2.596-5.796-5.797zm5.796 4.405c2.431.002 4.402-1.969 4.403-4.399v-.004c.003-2.433-1.968-4.406-4.399-4.408h-.004c-2.435.001-4.407 1.974-4.408 4.408.002 2.432 1.975 4.403 4.408 4.403zm-.784-1.871h-1.188v-5.082h2.153c.446 0 .909.009 1.296.254.417.283.654.767.654 1.274 0 .575-.337 1.112-.888 1.317l.941 2.236h-1.32l-.779-2.009h-.87zm0-2.879h.653c.246 0 .513.019.729-.1.196-.125.296-.361.296-.588-.009-.21-.114-.404-.287-.523-.204-.117-.542-.084-.763-.084h-.629z" fill="#fff"/></svg>',xu='<svg enable-background="new 0 0 780 500" viewBox="0 0 780 500" xmlns="http://www.w3.org/2000/svg"><path d="m40 .001h700c22.092 0 40 17.909 40 40v420c0 22.092-17.908 40-40 40h-700c-22.091 0-40-17.908-40-40v-420c0-22.091 17.909-40 40-40z" fill="#2557d6"/><path d="m.253 235.69h37.441l8.442-19.51h18.9l8.42 19.51h73.668v-14.915l6.576 14.98h38.243l6.576-15.202v15.138h183.08l-.085-32.026h3.542c2.479.083 3.204.302 3.204 4.226v27.8h94.689v-7.455c7.639 3.92 19.518 7.455 35.148 7.455h39.836l8.525-19.51h18.9l8.337 19.51h76.765v-18.532l11.626 18.532h61.515v-122.51h-60.88v14.468l-8.522-14.468h-62.471v14.468l-7.828-14.468h-84.38c-14.123 0-26.539 1.889-36.569 7.153v-7.153h-58.229v7.153c-6.383-5.426-15.079-7.153-24.75-7.153h-212.74l-14.274 31.641-14.659-31.641h-67.005v14.468l-7.362-14.468h-57.145l-26.539 58.246v64.261h.003zm236.34-17.67h-22.464l-.083-68.794-31.775 68.793h-19.24l-31.858-68.854v68.854h-44.57l-8.42-19.592h-45.627l-8.505 19.592h-23.801l39.241-87.837h32.559l37.269 83.164v-83.164h35.766l28.678 59.587 26.344-59.587h36.485zm-165.9-37.823-14.998-35.017-14.915 35.017zm255.3 37.821h-73.203v-87.837h73.203v18.291h-51.289v15.833h50.06v18.005h-50.061v17.542h51.289zm103.16-64.18c0 14.004-9.755 21.24-15.439 23.412 4.794 1.748 8.891 4.838 10.84 7.397 3.094 4.369 3.628 8.271 3.628 16.116v17.255h-22.104l-.083-11.077c0-5.285.528-12.886-3.458-17.112-3.202-3.09-8.083-3.76-15.973-3.76h-23.523v31.95h-21.914v-87.838h50.401c11.199 0 19.451.283 26.535 4.207 6.933 3.924 11.09 9.652 11.09 19.45zm-27.699 13.042c-3.013 1.752-6.573 1.81-10.841 1.81h-26.62v-19.51h26.982c3.818 0 7.804.164 10.393 1.584 2.842 1.28 4.601 4.003 4.601 7.765 0 3.84-1.674 6.929-4.515 8.351zm62.844 51.138h-22.358v-87.837h22.358zm259.56 0h-31.053l-41.535-65.927v65.927h-44.628l-8.527-19.592h-45.521l-8.271 19.592h-25.648c-10.649 0-24.138-2.257-31.773-9.715-7.701-7.458-11.708-17.56-11.708-33.533 0-13.027 2.395-24.936 11.812-34.347 7.085-7.01 18.18-10.242 33.28-10.242h21.215v18.821h-20.771c-7.997 0-12.514 1.14-16.862 5.203-3.735 3.699-6.298 10.69-6.298 19.897 0 9.41 1.951 16.196 6.023 20.628 3.373 3.476 9.506 4.53 15.272 4.53h9.842l30.884-69.076h32.835l37.102 83.081v-83.08h33.366l38.519 61.174v-61.174h22.445zm-133.2-37.82-15.165-35.017-15.081 35.017zm189.04 178.08c-5.322 7.457-15.694 11.238-29.736 11.238h-42.319v-18.84h42.147c4.181 0 7.106-.527 8.868-2.175 1.665-1.474 2.605-3.554 2.591-5.729 0-2.561-1.064-4.593-2.677-5.811-1.59-1.342-3.904-1.95-7.722-1.95-20.574-.67-46.244.608-46.244-27.194 0-12.742 8.443-26.156 31.439-26.156h43.649v-17.479h-40.557c-12.237 0-21.129 2.81-27.425 7.174v-7.175h-59.985c-9.595 0-20.854 2.279-26.179 7.175v-7.175h-107.12v7.175c-8.524-5.892-22.908-7.175-29.549-7.175h-70.656v7.175c-6.745-6.258-21.742-7.175-30.886-7.175h-79.077l-18.094 18.764-16.949-18.764h-118.13v122.59h115.9l18.646-19.062 17.565 19.062 71.442.061v-28.838h7.021c9.479.14 20.66-.228 30.523-4.312v33.085h58.928v-31.952h2.842c3.628 0 3.985.144 3.985 3.615v28.333h179.01c11.364 0 23.244-2.786 29.824-7.845v7.845h56.78c11.815 0 23.354-1.587 32.134-5.649l.002-22.84zm-354.94-47.155c0 24.406-19.005 29.445-38.159 29.445h-27.343v29.469h-42.591l-26.984-29.086-28.042 29.086h-86.802v-87.859h88.135l26.961 28.799 27.875-28.799h70.021c17.389 0 36.929 4.613 36.929 28.945zm-174.22 40.434h-53.878v-17.48h48.11v-17.926h-48.11v-15.974h54.939l23.969 25.604zm86.81 10.06-33.644-35.789 33.644-34.65zm49.757-39.066h-28.318v-22.374h28.572c7.912 0 13.404 3.09 13.404 10.772 0 7.599-5.238 11.602-13.658 11.602zm148.36-40.373h73.138v18.17h-51.315v15.973h50.062v17.926h-50.062v17.48l51.314.08v18.23h-73.139zm-28.119 47.029c4.878 1.725 8.865 4.816 10.734 7.375 3.095 4.291 3.542 8.294 3.631 16.037v17.418h-22.002v-10.992c0-5.286.531-13.112-3.542-17.198-3.201-3.147-8.083-3.899-16.076-3.899h-23.42v32.09h-22.02v-87.859h50.594c11.093 0 19.173.47 26.366 4.146 6.915 4.004 11.266 9.487 11.266 19.511-.001 14.022-9.764 21.178-15.531 23.371zm-12.385-11.107c-2.932 1.667-6.556 1.811-10.818 1.811h-26.622v-19.732h26.982c3.902 0 7.807.08 10.458 1.587 2.84 1.423 4.538 4.146 4.538 7.903 0 3.758-1.699 6.786-4.538 8.431zm197.82 5.597c4.27 4.229 6.554 9.571 6.554 18.613 0 18.9-12.322 27.723-34.425 27.723h-42.68v-18.84h42.51c4.157 0 7.104-.525 8.95-2.175 1.508-1.358 2.589-3.333 2.589-5.729 0-2.561-1.17-4.592-2.675-5.811-1.675-1.34-3.986-1.949-7.803-1.949-20.493-.67-46.157.609-46.157-27.192 0-12.744 8.355-26.158 31.33-26.158h43.932v18.7h-40.198c-3.984 0-6.575.145-8.779 1.587-2.4 1.422-3.29 3.534-3.29 6.319 0 3.314 2.037 5.57 4.795 6.546 2.311.77 4.795.995 8.526.995l11.797.306c11.895.276 20.061 2.248 25.024 7.065zm86.955-23.52h-39.938c-3.986 0-6.638.144-8.867 1.587-2.312 1.423-3.202 3.534-3.202 6.322 0 3.314 1.951 5.568 4.791 6.544 2.312.771 4.795.996 8.444.996l11.878.304c11.983.284 19.982 2.258 24.86 7.072.891.67 1.422 1.422 2.033 2.175v-25z" fill="#fff"/></svg>',Pu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 26"><path fill="#fff" d="M0 0h40v26H0z"/><path fill="#55b147" d="M28.38 13.41h2.44l.04.01h.04l.03.01h.03l.01.01.04.01.04.01.04.02.04.01.04.02.03.02.04.02.04.02.04.02.04.03.04.03.03.04c.02 0 .03.02.04.03l.04.04.04.05.04.05.04.06.04.08.03.09a1.05 1.05 0 0 1 .04.13 1.13 1.13 0 0 1 0 .49 1.05 1.05 0 0 1-.04.13l-.03.09-.04.07-.04.06-.04.06-.04.04-.04.04c0 .02-.02.03-.04.04l-.03.03-.04.03-.04.03-.04.03-.04.02-.04.02-.03.02-.04.02-.04.01-.04.01-.04.01-.04.01h-.01l-.03.01h-.03l-.04.01h-.04l-.04.01h-2.4v-2.1zm3.1-2.38a1.07 1.07 0 0 1 0 .45.96.96 0 0 1-.05.13.93.93 0 0 1-.03.09l-.04.07-.04.06-.04.05-.04.04-.04.04-.03.03-.04.03-.04.03-.04.02-.04.03-.04.02-.04.02-.03.01-.04.02h-.04l-.04.02h-.04l-.04.02h-.07l-.04.01h-2.22V10.3h2.31l.02.01h.01l.04.01.04.01.04.01.04.01.04.02.03.01.04.02.04.02.04.03.04.02.04.03.04.03.03.03.04.04.04.05.04.04.04.06.04.07a.93.93 0 0 1 .03.1.96.96 0 0 1 .04.12zM36.23.97h.02V20.9c0 .12 0 .23-.02.35l-.04.3-.03.2-.04.17-.04.13a4.12 4.12 0 0 1-.08.23l-.04.1-.03.1-.04.08-.04.08-.04.08-.04.07-.04.07-.04.07-.03.06-.04.06-.04.06-.04.06-.04.05-.04.05-.03.05-.04.05-.04.05-.04.05-.04.04-.04.05-.04.04-.03.04-.04.04-.04.04-.04.04-.04.03-.04.04-.03.03-.04.04-.04.03-.04.03-.04.04-.04.03-.04.03-.03.03-.04.02-.04.03-.04.03-.04.03-.04.02-.03.03-.04.02-.04.03-.04.02-.04.02-.04.02-.04.03-.03.02-.04.02-.04.02-.04.02-.04.02-.04.01-.03.02-.04.02-.04.02-.04.01-.04.02-.04.01-.04.02-.03.01-.04.02-.04.01-.04.01-.04.02-.04.01-.04.01-.03.01-.04.01-.04.01-.04.01-.04.01-.04.01-.03.01-.04.01-.04.01h-.04l-.04.02h-.08l-.03.02h-.08l-.04.01h-.04l-.04.01h-.07l-.04.01h-.12l-.04.01h-6v-8.12h6.39l.04-.01h.12l.04-.01h.04l.04-.01h.04l.04-.01h.03l.04-.01.04-.01h.04l.04-.02h.04l.04-.01.03-.01.04-.01.04-.01.04-.01.04-.02h.04l.03-.02.04-.01.04-.02.04-.01.04-.02.04-.01.04-.02.03-.02.04-.02.04-.01.04-.02.04-.02.04-.03.03-.02.04-.02.04-.03.04-.02.04-.03.04-.03.04-.03.03-.03.04-.03.04-.03.04-.04.04-.04.04-.04.03-.04.04-.04.04-.05a1.87 1.87 0 0 0 .08-.11l.04-.06.04-.07.03-.07.04-.1.04-.1.04-.13a1.8 1.8 0 0 0 .04-.2 1.93 1.93 0 0 0 .01-.25 1.8 1.8 0 0 0-.01-.25 1.7 1.7 0 0 0-.04-.2l-.04-.12-.04-.1-.04-.09-.03-.07-.04-.07-.04-.05a1.7 1.7 0 0 0-.08-.1l-.04-.06-.04-.04-.03-.04-.04-.04-.04-.03-.04-.04-.04-.03-.04-.03-.03-.03-.04-.03-.04-.03-.04-.02-.04-.03-.04-.02-.04-.03-.03-.02-.04-.02-.04-.02-.04-.02-.04-.02-.04-.01-.03-.02-.04-.02-.04-.01-.04-.02-.04-.01-.04-.01-.04-.02h-.03l-.04-.02-.04-.01-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01h-.04l-.04-.02h-.04l-.04-.01h-.04l-.03-.01h-.04l-.04-.01h-.04l-.04-.01h-.04l-.04-.01h-.07v-.05h.04l.03-.01.04-.01h.04l.04-.02h.04l.04-.01.04-.01.03-.01.04-.01.04-.02h.04l.04-.02.04-.01.04-.02.03-.01.04-.02.04-.01.04-.02.04-.02.04-.02.03-.02.04-.02.04-.02.04-.02.04-.03.04-.02.04-.03.03-.03.04-.03.04-.03.04-.03.04-.04.04-.03.03-.04.04-.05.04-.04.04-.05.04-.05.04-.05.04-.07.03-.06.04-.08.04-.09.04-.1.04-.14a1.75 1.75 0 0 0 .04-.23 1.82 1.82 0 0 0 0-.18v-.2a1.77 1.77 0 0 0-.04-.23l-.04-.13-.04-.1-.04-.1-.04-.07-.03-.07-.04-.06-.04-.05-.04-.05a1.66 1.66 0 0 0-.04-.05l-.04-.04-.04-.04-.03-.04-.04-.03-.04-.04-.04-.03-.04-.03-.04-.03-.03-.03-.04-.02-.04-.03-.04-.02-.04-.02-.04-.02-.04-.02-.03-.02-.04-.02-.04-.02-.04-.01-.04-.02-.04-.02-.03-.01-.04-.01-.04-.02-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01-.04-.01-.04-.01-.04-.01-.04-.01h-.04l-.04-.02h-.07l-.04-.01-.04-.01h-.04l-.04-.01h-.07l-.04-.01h-.12l-.01-.01h-.18l-.04-.01h-5.81V4.95a4 4 0 0 1 .08-.82l.04-.16.04-.14.04-.13.03-.11.04-.1.04-.1.04-.08.04-.09.04-.07.04-.08.03-.07.04-.07.04-.06.04-.06.04-.06.04-.06.03-.05.04-.06.04-.05.04-.05.04-.05.04-.04.04-.05.03-.04.04-.04.04-.05.04-.04.04-.03.04-.04.03-.04.04-.04.04-.03.04-.04.04-.03.04-.03.04-.03.03-.03.04-.03.04-.03.04-.03.04-.03.04-.03.03-.03.04-.02.04-.03.04-.02.04-.03.04-.02.04-.02.03-.02.04-.03.04-.02.04-.02.04-.02.04-.02.03-.02.04-.02.04-.01.04-.02.04-.02.04-.01.04-.02.03-.02.04-.01.04-.02.04-.01.04-.01.04-.02.03-.01.04-.01.04-.01.04-.02h.04l.04-.02h.04l.03-.02h.04l.04-.02h.04l.04-.01.04-.01.04-.01h.03l.04-.01.04-.01h.04l.04-.01h.04l.03-.01h.04l.04-.01h.08l.04-.01h.23l.04-.01h5.84z"/><path fill="#0d6db5" d="M4.38 14.8V4.96a4 4 0 0 1 .08-.81l.04-.17.03-.14.04-.13a3.87 3.87 0 0 1 .08-.21l.04-.1.04-.08.03-.09.04-.07.04-.08.04-.07.04-.06.04-.07.04-.06.03-.06.04-.06.04-.05.04-.05.04-.06.04-.05.03-.04.04-.05.04-.05.04-.04.04-.04.04-.04.03-.04.04-.04.04-.04.04-.04.04-.03.04-.04.03-.03.04-.04.04-.03.04-.03.04-.03.04-.03.04-.03.03-.03.04-.03.04-.03.04-.02.04-.03.04-.02.03-.03.04-.02.04-.03.04-.02.04-.02.04-.02.03-.03.04-.02.04-.02.04-.02.04-.01.04-.02.03-.02.04-.02.04-.02.04-.01.04-.02.04-.01.04-.02.03-.01L7 1.2l.04-.01.04-.02h.04l.04-.02.03-.01.04-.01.04-.02h.04l.04-.02h.04l.03-.02h.04l.04-.01.04-.01.04-.01h.04l.03-.02h.08L7.76 1h.19L8 .98h.08L8.1.97h.2l.04-.01h5.87V20.9a4.03 4.03 0 0 1-.04.51c0 .08-.02.16-.04.24l-.03.18-.04.15-.04.12-.04.12-.04.1-.04.1-.03.09-.04.08-.04.08-.04.08-.04.07-.04.07-.03.06a3.9 3.9 0 0 1-.04.07l-.04.06-.04.05-.04.06-.04.05-.04.05-.03.05-.04.05-.04.05-.04.05-.04.04-.04.04-.03.04-.04.05-.04.03-.04.04-.04.04-.04.04-.03.03-.04.04-.04.03-.04.03-.04.04-.04.03-.03.03-.04.03-.04.03-.04.02-.04.03-.04.03-.04.03-.03.02-.04.03-.04.02-.04.02-.04.03-.04.02-.03.02-.04.02-.04.02-.04.02-.04.02-.04.02-.03.02-.04.02-.04.02-.04.01-.04.02-.04.02-.03.01-.04.02-.04.01-.04.02-.04.01-.04.02h-.04l-.03.02-.04.01-.04.02h-.04l-.04.02h-.04l-.03.02h-.04l-.04.02h-.04l-.04.01-.04.01-.03.01h-.04l-.04.01-.04.01h-.04l-.04.01h-.03l-.04.01h-.04l-.04.01h-.08l-.04.01h-.11l-.04.01H4.38v-8.4l.08.03h.04l.03.01.04.01.04.01.04.01.04.01h.04l.03.02h.04l.04.01.04.01.04.01h.04l.04.02h.03l.04.01.04.01h.04l.04.01.04.01h.03l.04.02h.04l.04.01h.04l.04.01.03.01h.04l.04.01.04.01h.04l.04.01h.03l.04.01.04.01h.04l.04.01h.04l.04.01h.03l.04.01.04.01h.04l.04.01h.04l.03.01h.04l.04.01h.04l.04.01h.07l.04.01h.04l.04.01h.04l.04.01h.07l.04.01h.04l.04.01h.08l.03.01h.08l.04.01h.08l.03.01h.12l.04.01h.11l.04.01h.15l.04.01h.2l.03.01h1.27l.04-.01h.11l.04-.01h.08l.04-.01h.07l.04-.01h.08l.04-.01h.08l.03-.01h.04l.04-.01h.04l.04-.01h.04l.03-.01h.04l.04-.01.04-.01h.04l.04-.01.03-.01h.04l.04-.01.04-.01h.04l.04-.02h.03l.04-.01h.04l.04-.02h.04l.04-.02h.04l.03-.01.04-.01.04-.01.04-.01.04-.01.04-.01.03-.02h.04l.04-.02.04-.01.04-.01.04-.02h.03l.04-.02.04-.02.04-.01.04-.01.04-.02.03-.01.04-.02.04-.02.04-.01.04-.02.04-.02.04-.01.03-.02.04-.02.04-.02.04-.02.04-.02.04-.02.03-.02.04-.03.04-.02.04-.02.04-.03.04-.02.03-.03.04-.03.04-.02.04-.03.04-.03.04-.03.03-.04.04-.03.04-.03.04-.04.04-.04.04-.04.04-.04.03-.04.04-.04.04-.05.04-.05a2.63 2.63 0 0 0 .08-.1l.03-.06.04-.06.04-.07.04-.07.04-.08.04-.08.03-.1.04-.1.04-.12.04-.14.04-.18.04-.27.02-.4V9.09h-3.4l-.03 4.63-.01.21a2.21 2.21 0 0 1-.04.26l-.04.16-.04.11-.03.1-.04.09a1.77 1.77 0 0 1-.08.14l-.04.06-.04.05a1.7 1.7 0 0 1-.07.1l-.04.05-.04.04-.04.04-.04.03-.04.04-.03.03-.04.03-.04.03-.04.03-.04.02-.04.03-.03.02-.04.02-.04.02-.04.02-.04.02-.04.02-.03.02-.04.01-.04.02-.04.01-.04.01-.04.02H8.6l-.03.02h-.04l-.04.02h-.04l-.04.02h-.04l-.03.01H8.3l-.04.01h-.04l-.04.01h-.04l-.03.01h-.12l-.04.01h-.5l-.04-.01h-.07l-.04-.01h-.08l-.04-.01h-.07l-.04-.01h-.04l-.04-.01h-.04l-.03-.01-.04-.01h-.04l-.04-.01h-.04l-.04-.02h-.04l-.03-.01H6.6l-.04-.01-.04-.01-.04-.01h-.04l-.03-.02h-.04l-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01-.04-.01-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01-.04-.02h-.04l-.04-.02-.04-.01-.04-.01-.04-.01-.03-.02-.04-.01-.04-.01-.04-.02h-.04l-.04-.02-.03-.02h-.04l-.04-.02-.04-.02-.04-.01-.04-.02-.03-.01-.04-.02-.04-.01-.04-.02-.04-.01-.04-.02-.03-.01-.04-.02-.04-.01-.04-.02-.04-.02L4.8 15l-.04-.02-.03-.02-.04-.01-.04-.02-.04-.02-.04-.02-.04-.02-.03-.01-.04-.02z"/><path fill="#e01d3b" d="m15.48 10.1-.08.07V4.96a4 4 0 0 1 .08-.81l.04-.17.04-.14.04-.13.04-.1.04-.11.03-.1.04-.08.04-.08.04-.08.04-.08.04-.07.03-.06.04-.07.04-.06.04-.06.04-.06.04-.05.04-.05.03-.06.04-.05.04-.04.04-.05.04-.04.04-.05.03-.04.04-.04.04-.04.04-.04.04-.04.04-.04.03-.03.04-.04.04-.03.04-.04.04-.03.04-.03.03-.03.04-.03.04-.03.04-.03.04-.03.04-.03.04-.02.03-.03.04-.02.04-.03.04-.02.04-.03.04-.02.03-.02.04-.02.04-.03.04-.02.04-.02.04-.02.03-.01.04-.02.04-.02.04-.02.04-.02.04-.01.03-.02.04-.01.04-.02.04-.01.04-.02.04-.01.04-.02h.03l.04-.02.04-.01.04-.01.04-.02h.04l.03-.02h.04l.04-.02h.04l.04-.01.04-.01.03-.01h.04l.04-.02h.08l.04-.01.04-.01h.03L18.9 1h.08l.04-.01h.07l.04-.01h.19l.04-.01h5.87V20.9a4.02 4.02 0 0 1-.03.5l-.04.25-.04.18-.04.15-.03.12-.04.12-.04.1-.04.1-.04.09-.04.08-.03.08-.04.08-.04.07-.04.07-.04.06-.04.07-.03.06-.04.05-.04.06-.04.05-.04.05-.04.05-.03.05-.04.05-.04.05-.04.04-.04.04-.04.04-.04.05-.03.03-.04.04-.04.04-.04.04-.04.03-.04.04-.03.03-.04.03-.04.04-.04.03-.04.03-.04.03-.03.03-.04.02-.04.03-.04.03-.04.03-.04.02-.04.03-.03.02-.04.02-.04.03-.04.02-.04.02-.04.02-.03.02-.04.02-.04.02-.04.02-.04.02-.04.02-.03.02-.04.01-.04.02-.04.02-.04.01-.04.02-.03.01-.04.02-.04.01-.04.02h-.04l-.04.02-.04.01-.03.01-.04.02h-.04l-.04.02h-.04l-.04.02h-.03l-.04.02h-.04l-.04.01-.04.01h-.04l-.03.01-.04.01h-.04l-.04.01h-.04l-.04.01h-.03l-.04.01h-.08l-.04.01h-.11l-.04.01h-6v-9.2l.08.07.04.03.04.03.04.03.04.03.04.03.03.02.04.03.04.02.04.03.04.02.04.03.03.02.04.02.04.03.04.02.04.02.04.02.04.02.03.02.04.02.04.02.04.02.04.02.04.01.03.02.04.02.04.01.04.02.04.02.04.01.03.02.04.01.04.02.04.01.04.02.04.01.03.01.04.02.04.01.04.01.04.02h.04l.04.02.03.01.04.01.04.01.04.01.04.02h.04l.03.02h.04l.04.02h.04l.04.01.04.01.03.01.04.01.04.01h.04l.04.02h.04l.03.01.04.01h.04l.04.02h.08l.04.02h.07l.04.02h.08l.04.01h.03l.04.01.04.01h.04l.04.01h.07l.04.01h.04l.04.01h.04l.04.01h.07l.04.01h.08l.04.01h.07l.04.01h.08l.04.01h.15l.04.01h.19l.04.01h.46l.04.01h.58l.03-.01H21l.02-.01h.16l.04-.01h.1l.04-.01h.08l.03-.01h.08l.04-.01h.08l.04-.01h.03l.04-.01h.04l.04-.01h.08l.03-.01h.04l.04-.01h.04l.04-.01h.04l.03-.01h.04l.04-.01h.04l.04-.01.04-.01h.03l.04-.01h.04l.04-.01h.04l.04-.02h.07l.04-.01.04-.01h.04l.04-.01.04-.01h.03l.04-.01.04-.01h.04l.04-.01.04-.01h.03l.04-.02h.04l.04-.01h.04l.04-.02h.04l.03-.01h.04l.04-.02h.04l.04-.01.04-.01.03-.01h.04l.04-.02h.04l.04-.01.04-.01.03-.01h.04l.04-.02h.04l.04-.02h.04l.03-.01v-1.7l-.03.03-.04.02-.04.02-.04.01-.04.02-.04.02-.03.02-.04.02-.04.01-.04.02-.04.02-.04.02-.03.01-.04.02-.04.02-.04.01-.04.02-.04.02-.04.01-.03.02-.04.01-.04.02-.04.01-.04.02-.04.01-.03.02h-.04l-.04.02-.04.02-.04.01-.04.01-.03.02h-.04l-.04.02-.04.01-.04.02h-.04l-.03.02-.04.01-.04.01-.04.01-.04.01-.04.01-.04.01-.03.01-.04.01-.04.01-.04.01-.04.01-.04.01-.03.01h-.04l-.04.02h-.04l-.04.01-.04.01h-.03l-.04.02h-.08l-.04.02h-.07l-.04.01-.04.01h-.04l-.04.01h-.04l-.04.01h-.03l-.04.01h-.08l-.04.01h-.04l-.03.01h-.1l-.02.01h-.15l-.04.01h-.58l-.04-.01h-.07l-.04-.01h-.04l-.04-.01h-.04l-.03-.01h-.04l-.04-.01-.04-.01h-.04l-.04-.01-.03-.01-.04-.01h-.04l-.04-.02h-.04l-.04-.02h-.04l-.03-.02-.04-.01-.04-.01-.04-.02h-.04l-.04-.02-.03-.02-.04-.01-.04-.02-.04-.01-.04-.02-.04-.02-.03-.02-.04-.01-.04-.02-.04-.02-.04-.03-.04-.02-.03-.02-.04-.03-.04-.02-.04-.03-.04-.02-.04-.03-.04-.03-.03-.03-.04-.03-.04-.04-.04-.03-.04-.04-.04-.04-.03-.04-.04-.04-.04-.05-.04-.04-.04-.05a2.28 2.28 0 0 1-.04-.06l-.03-.05-.04-.06-.04-.07-.04-.06-.04-.08-.04-.08a2.58 2.58 0 0 1-.07-.2l-.04-.11-.04-.14-.04-.19-.04-.28-.01-.34.01-.35.04-.28.04-.18.04-.14.04-.12a2.63 2.63 0 0 1 .07-.2l.04-.08.04-.07.04-.07.04-.06.04-.06.03-.06.04-.05.04-.05.04-.05.04-.04.04-.05.03-.04.04-.04.04-.03.04-.04.04-.03.04-.03.03-.03.04-.03.04-.03.04-.03.04-.03.04-.02.04-.02.03-.03.04-.02.04-.02.04-.02.04-.02.04-.02.03-.02.04-.02.04-.01.04-.02.04-.01.04-.02.03-.01.04-.02.04-.01.04-.01.04-.02h.04l.03-.02h.04l.04-.02h.04l.04-.02h.04l.04-.01.03-.01h.04l.04-.02h.08l.04-.02h.07l.04-.01h.08l.04-.01h.07l.04-.01h.15l.04-.01h.46l.04.01h.08l.04.01h.07l.04.01h.08l.04.01h.04l.03.01h.04l.04.01h.04l.04.01h.04l.04.01.03.01h.04l.04.01.04.01h.04l.04.01.03.01h.04l.04.02h.04l.04.01.04.01.03.01.04.01h.04l.04.02h.04l.04.02h.03l.04.02h.04l.04.02.04.01.04.01.04.01.03.01.04.02h.04l.04.02.04.01.04.02h.03l.04.02.04.01.04.02.04.01.04.02.03.01.04.02.04.01.04.01.04.02.04.02.03.01.04.02.04.01.04.02.04.02.04.01.04.02.03.02.04.01.04.02.04.02.04.02.04.01.03.02.04.02.04.02.04.02.04.02.04.02.03.02v-1.7h-.03l-.04-.01H24l-.04-.02h-.04l-.04-.02h-.03l-.04-.01-.04-.01-.04-.01h-.04l-.04-.02h-.03l-.04-.01-.04-.01h-.04l-.04-.02h-.04l-.04-.01-.03-.01h-.04l-.04-.01-.04-.01-.04-.01h-.04l-.03-.01-.04-.01h-.04L23 9.12h-.08l-.03-.02h-.08l-.04-.02h-.08l-.03-.01-.04-.01h-.04l-.04-.01h-.04l-.04-.01-.04-.01h-.03l-.04-.01h-.04l-.04-.01h-.04L22.2 9h-.11l-.04-.01h-.04l-.04-.01h-.03l-.04-.01h-.04l-.04-.01h-.08l-.03-.01h-.04l-.04-.01h-.08l-.04-.01h-.07l-.04-.01h-.08l-.04-.01h-.11l-.04-.01h-.19l-.04-.01h-.27l-.04-.01h-1.04l-.03.01h-.16l-.04.01h-.11l-.04.01h-.11l-.04.01h-.08l-.04.01h-.04l-.03.01h-.08l-.04.01h-.04l-.04.01h-.04l-.03.01h-.04l-.04.01h-.04L18.4 9h-.04l-.03.01h-.04l-.04.01h-.04l-.04.02h-.07l-.04.02h-.08l-.04.02h-.04l-.04.01-.03.01h-.04l-.04.02h-.04l-.04.01-.04.01-.03.01-.04.01h-.04l-.04.02h-.04l-.04.02h-.03l-.04.02-.04.01-.04.01-.04.01-.04.01-.03.02h-.04l-.04.02-.04.01-.04.01-.04.02-.04.01-.03.01-.04.02-.04.01-.04.02-.04.01-.04.02-.03.01-.04.02-.04.01-.04.02-.04.02-.04.01-.03.02-.04.02-.04.02-.04.02-.04.02-.04.01-.03.02-.04.03-.04.02-.04.02-.04.02-.04.02-.04.02-.03.03-.04.02-.04.03-.04.02-.04.03-.04.02-.03.03-.04.03-.04.03-.04.02-.04.03-.04.04z"/></svg>',ls='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 26"><rect width="45.3" height="27" x="-3.3" y="-.79" fill="#fff" rx="2.82"/><path fill="#01798a" d="M27.27-.79a4.06 4.06 0 0 0-3.6 2.8l-4.96 23.42a2.14 2.14 0 0 0 2 2.8h18.35a2.81 2.81 0 0 0 2.8-2.82V1.15A2.25 2.25 0 0 0 40-.8"/><rect width="20.38" height="29.02" x="-4" y="-.79" fill="#dc1f2b" rx="2.82"/><path fill="#1a4580" d="M24.37 2.02a3.98 3.98 0 0 1 3.48-2.8H14.18a3.97 3.97 0 0 0-3.5 2.8l-4.85 23.4a2.13 2.13 0 0 0 1.94 2.81h13.7a2.13 2.13 0 0 1-1.94-2.8z"/><path fill="#fff" d="M16.63 15.04h.18a.32.32 0 0 0 .32-.17l.46-.7h1.24l-.26.47h1.49l-.2.7H18.1a.82.82 0 0 1-.75.44h-.92zm-.2 1h3.25l-.21.77h-1.3l-.2.74h1.27l-.21.77h-1.27l-.3 1.09c-.07.18.02.26.29.24h1.03l-.19.71H16.6q-.57 0-.39-.65l.38-1.4h-.81l.2-.76h.82l.2-.74h-.78l.2-.76zm5.19-1.87-.06.45a2.37 2.37 0 0 1 1.18-.47h2.05l-.78 2.88q-.1.5-.84.5h-2.34l-.54 2.01c-.03.11.01.17.13.17h.46l-.17.62h-1.17q-.67 0-.56-.4l1.54-5.76zm1.74.81h-1.84l-.22.78a1.52 1.52 0 0 1 .82-.23h1.1zm-.67 1.8c.14.02.22-.03.22-.16l.12-.4h-1.84l-.16.57zm-1.24.93h1.06l-.02.47h.29c.14 0 .2-.05.2-.14l.1-.3h.87l-.11.44a.76.76 0 0 1-.8.57h-.56v.8c-.01.12.1.18.33.18h.53l-.17.63H21.9c-.36.02-.53-.15-.53-.52zM8.6 10.34a2.62 2.62 0 0 1-1 1.64 3.24 3.24 0 0 1-1.98.58 2.16 2.16 0 0 1-1.68-.59 1.54 1.54 0 0 1-.37-1.06 2.86 2.86 0 0 1 .06-.57l.87-4.2h1.3l-.85 4.15a1.35 1.35 0 0 0-.04.32.82.82 0 0 0 .16.52.89.89 0 0 0 .75.3 1.56 1.56 0 0 0 1-.3 1.37 1.37 0 0 0 .5-.84l.84-4.15h1.3zm5.47-1.65h1.02l-.8 3.74h-1.02zm.32-1.37h1.03l-.2.91H14.2l.19-.9M16 12.15a1.39 1.39 0 0 1-.41-1.05 2.45 2.45 0 0 1 .01-.25l.04-.27a2.55 2.55 0 0 1 .78-1.45 2.07 2.07 0 0 1 1.43-.54 1.5 1.5 0 0 1 1.1.39 1.4 1.4 0 0 1 .4 1.06 2.59 2.59 0 0 1-.02.26l-.05.28a2.48 2.48 0 0 1-.77 1.42 2.08 2.08 0 0 1-1.43.53 1.5 1.5 0 0 1-1.09-.38m1.95-.74a1.84 1.84 0 0 0 .38-.9.58.58 0 0 0 .03-.19 1.74 1.74 0 0 0 .01-.17.76.76 0 0 0-.17-.54.64.64 0 0 0-.5-.2.89.89 0 0 0-.7.3 1.9 1.9 0 0 0-.38.92l-.03.18a1.36 1.36 0 0 0-.01.17.75.75 0 0 0 .17.54.64.64 0 0 0 .5.18.9.9 0 0 0 .7-.3m8.02 3.67.25-.87h1.24l-.05.32a3.1 3.1 0 0 1 1.09-.32h1.54l-.25.87h-.24l-1.16 4.12h.24l-.23.82h-.24l-.1.36h-1.2l.1-.36h-2.38l.23-.82h.24l1.16-4.12zm1.34 0L27 16.2a5.13 5.13 0 0 1 1-.27c.1-.4.24-.85.24-.85zm-.46 1.64-.32 1.17a3.44 3.44 0 0 1 1.01-.33l.24-.84zm.23 2.48.24-.84h-.93l-.24.84zm3.01-5.05h1.17l.05.44c0 .11.06.16.2.16h.2l-.2.74h-.87c-.32.02-.5-.1-.5-.38zm-.34 1.59h3.79l-.23.79h-1.2l-.2.74h1.2l-.23.79h-1.34l-.3.46h.65l.16.93c.01.09.1.13.23.13h.2l-.2.77h-.73c-.37.02-.57-.1-.58-.38l-.18-.85-.6.9a.65.65 0 0 1-.65.36h-1.1l.22-.77h.34a.46.46 0 0 0 .36-.19l.94-1.36h-1.2l.22-.8h1.3l.21-.73h-1.3l.22-.8zM9.8 8.69h.92l-.1.54.12-.16a1.43 1.43 0 0 1 1.1-.48 1 1 0 0 1 .83.34 1.15 1.15 0 0 1 .14.95l-.5 2.56h-.95l.46-2.32a.74.74 0 0 0-.04-.53.44.44 0 0 0-.4-.17.88.88 0 0 0-.62.23 1.14 1.14 0 0 0-.34.63L10 12.44h-.94zm10.55 0h.92l-.1.54.13-.16a1.43 1.43 0 0 1 1.08-.48.99.99 0 0 1 .85.34 1.14 1.14 0 0 1 .13.95l-.5 2.56h-.95l.46-2.32a.75.75 0 0 0-.04-.53.45.45 0 0 0-.4-.17.89.89 0 0 0-.62.23 1.12 1.12 0 0 0-.33.63l-.43 2.16h-.94zm4.55-2.33h2.67a1.8 1.8 0 0 1 1.19.35 1.25 1.25 0 0 1 .4 1v.02a3.77 3.77 0 0 1-.06.59 2.38 2.38 0 0 1-.81 1.4 2.29 2.29 0 0 1-1.5.52h-1.44l-.44 2.2h-1.24zm.67 2.82h1.19a1.14 1.14 0 0 0 .73-.21 1.14 1.14 0 0 0 .36-.67l.03-.15v-.13a.52.52 0 0 0-.22-.47 1.35 1.35 0 0 0-.72-.15h-1zm9.15 3.98a5.91 5.91 0 0 1-.98 1.56 1.99 1.99 0 0 1-1.7.71l.08-.64c.89-.27 1.36-1.51 1.64-2.06l-.33-4.03.68-.01h.58l.06 2.53 1.07-2.53h1.09zM31.68 9l-.43.3a1.35 1.35 0 0 0-1.66-.21c-1.08.5-1.98 4.4 1 3.11l.17.2 1.17.04.77-3.54zm-.66 1.92c-.2.56-.61.94-.94.83-.33-.1-.45-.64-.26-1.2.19-.57.61-.94.94-.83.33.1.45.64.26 1.2"/></svg>',Tu={card:gu,applepay:bu,googlepay:vu,alipay:wu,alipaycn:Cu,alipayhk:_u,wechatpay:Su,paynow:ku},Du={visa:Eu,mastercard:ss,amex:xu,jcb:Pu,cup:ls,unionpay:ls,mc:ss};function Nu(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function Yr(e,t){const n=Tu[e.toLowerCase()];if(!n)return P("span",{class:"inline-flex size-10 shrink-0 items-center justify-center rounded-lg bg-zinc-100 text-[10px] font-semibold uppercase text-zinc-600",text:Nu(t)});const o=P("span",{class:"inline-flex size-12 shrink-0 items-center justify-center overflow-hidden rounded-lg"});o.innerHTML=n;const r=o.firstElementChild;return r&&(r.setAttribute("width","48"),r.setAttribute("height","48"),r.classList.add("size-12","object-contain")),o}function cs(e){if(!e?.length)return null;const t=P("span",{class:"mt-1 flex flex-wrap items-center gap-1.5"});for(const n of e){const o=n.toLowerCase(),r=Du[o];if(!r){t.append(P("span",{class:"rounded bg-zinc-100 px-1.5 py-0.5 text-[10px] font-medium uppercase text-zinc-600",text:n}));continue}const i=P("span",{class:Fo("inline-flex h-6 w-10 items-center justify-center")});i.innerHTML=r;const a=i.firstElementChild;a&&(a.setAttribute("width","40"),a.setAttribute("height","24"),a.classList.add("h-6","w-10","object-contain")),t.append(i)}return t}const ds=`<?xml version="1.0" standalone="no"?>
|
|
97
|
+
`,qu='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 40 26"><path fill="#fff" d="M0 0h40v26H0z"/><path fill="#1434CB" d="m15.9 7.7-4.43 10.6h-2.9l-2.2-8.47c-.13-.52-.25-.71-.65-.93C5.05 8.55 3.96 8.2 3 8l.07-.32h4.67c.6 0 1.13.4 1.27 1.09l1.15 6.14 2.86-7.23h2.89Zm11.39 7.15c0-2.8-3.88-2.96-3.85-4.21 0-.38.37-.79 1.16-.9a5.2 5.2 0 0 1 2.71.48l.48-2.25a7.4 7.4 0 0 0-2.57-.47c-2.71 0-4.62 1.44-4.64 3.51-.02 1.53 1.36 2.38 2.4 2.9 1.08.51 1.44.85 1.43 1.31 0 .71-.85 1.03-1.64 1.04-1.39.02-2.19-.37-2.82-.67l-.5 2.33c.64.29 1.82.55 3.05.56 2.89 0 4.78-1.42 4.79-3.63Zm7.17 3.46H37L34.78 7.7h-2.34c-.53 0-.98.3-1.17.78l-4.12 9.84h2.88l.57-1.58h3.53l.33 1.58Zm-3.07-3.76 1.45-3.99.83 4H31.4ZM19.83 7.7l-2.27 10.62h-2.74L17.09 7.7h2.74Z"/></svg>',fs='<svg enable-background="new 0 0 780 500" viewBox="0 0 780 500" xmlns="http://www.w3.org/2000/svg"><path d="m449.01 250c0 99.143-80.371 179.5-179.51 179.5s-179.5-80.361-179.5-179.5c0-99.133 80.362-179.5 179.5-179.5 99.137 0 179.51 80.371 179.51 179.5" fill="#d9222a"/><path d="m510.49 70.496c-46.379 0-88.643 17.596-120.5 46.467-6.49 5.889-12.548 12.237-18.125 18.996h36.267c4.965 6.037 9.536 12.387 13.685 19.012h-63.635c-3.827 6.122-7.281 12.469-10.342 19.008h84.313c2.894 6.185 5.431 12.53 7.601 19.004h-99.513c-2.09 6.234-3.832 12.58-5.217 19.008h109.94c2.689 12.49 4.045 25.231 4.042 38.008 0 19.935-3.254 39.112-9.254 57.021h-99.513c2.164 6.477 4.7 12.824 7.596 19.008h84.316c-3.063 6.541-6.519 12.889-10.347 19.013h-63.625c4.147 6.62 8.719 12.966 13.685 18.996h36.259c-5.57 6.772-11.63 13.127-18.13 19.013 31.857 28.866 74.117 46.454 120.5 46.454 99.139 0 179.51-80.361 179.51-179.5 0-99.129-80.371-179.5-179.51-179.5" fill="#ee9f2d"/><path d="m666.07 350.06c0-3.199 2.592-5.801 5.796-5.801s5.796 2.602 5.796 5.801-2.592 5.801-5.796 5.801-5.796-2.602-5.796-5.801zm5.796 4.408c2.434-.001 4.407-1.974 4.408-4.408 0-2.432-1.971-4.402-4.402-4.404h-.006c-2.429-.003-4.4 1.963-4.404 4.391v.014c-.002 2.433 1.968 4.406 4.4 4.408.001-.001.003-.001.004-.001zm-.783-1.86h-1.187v-5.096h2.149c.45 0 .908 0 1.305.254.413.279.646.771.646 1.279 0 .571-.338 1.104-.884 1.312l.938 2.25h-1.315l-.779-2.017h-.871zm0-2.89h.658c.246 0 .505.021.726-.1.195-.125.296-.359.296-.584-.005-.209-.112-.402-.288-.518-.207-.129-.536-.101-.758-.101h-.634zm-443.5-80.063c-2.046-.238-2.945-.301-4.35-.301-11.046 0-16.638 3.787-16.638 11.268 0 4.611 2.729 7.545 6.987 7.545 7.939 0 13.659-7.559 14.001-18.512zm14.171 32.996h-16.146l.371-7.676c-4.926 6.065-11.496 8.949-20.426 8.949-10.563 0-17.804-8.25-17.804-20.229 0-18.024 12.596-28.541 34.217-28.541 2.208 0 5.042.199 7.941.57.604-2.441.763-3.488.763-4.801 0-4.908-3.396-6.737-12.5-6.737-9.533-.108-17.396 2.271-20.625 3.333.204-1.229 2.7-16.659 2.7-16.659 9.712-2.846 16.116-3.917 23.325-3.917 16.732 0 25.596 7.513 25.579 21.712.033 3.805-.597 8.5-1.579 14.671-1.691 10.734-5.32 33.721-5.816 39.325zm-62.158 0h-19.487l11.162-69.997-24.925 69.997h-13.279l-1.642-69.597-11.733 69.597h-18.242l15.237-91.056h28.021l1.7 50.968 17.092-50.968h31.167zm354.97-32.996c-2.037-.238-2.941-.301-4.342-.301-11.041 0-16.634 3.787-16.634 11.268 0 4.611 2.726 7.545 6.983 7.545 7.94 0 13.664-7.559 13.993-18.512zm14.184 32.996h-16.146l.366-7.676c-4.926 6.065-11.5 8.949-20.422 8.949-10.565 0-17.8-8.25-17.8-20.229 0-18.024 12.588-28.541 34.213-28.541 2.208 0 5.037.199 7.934.57.604-2.441.763-3.488.763-4.801 0-4.908-3.392-6.737-12.496-6.737-9.533-.108-17.387 2.271-20.629 3.333.204-1.229 2.709-16.659 2.709-16.659 9.712-2.846 16.112-3.917 23.313-3.917 16.74 0 25.604 7.513 25.587 21.712.032 3.805-.597 8.5-1.579 14.671-1.684 10.734-5.321 33.721-5.813 39.325zm-220.39-1.125c-5.333 1.679-9.491 2.398-14 2.398-9.962 0-15.399-5.725-15.399-16.267-.142-3.271 1.433-11.88 2.671-19.737 1.125-6.917 8.449-50.529 8.449-50.529h19.371l-2.263 11.208h11.699l-2.642 17.796h-11.742c-2.25 14.083-5.454 31.625-5.491 33.95 0 3.816 2.037 5.483 6.671 5.483 2.221 0 3.94-.227 5.254-.7zm59.392-.6c-6.654 2.034-13.075 3.017-19.879 3-21.684-.021-32.987-11.346-32.987-33.032 0-25.313 14.38-43.947 33.899-43.947 15.971 0 26.171 10.433 26.171 26.796 0 5.429-.7 10.729-2.388 18.212h-38.574c-1.305 10.741 5.57 15.217 16.837 15.217 6.935 0 13.188-1.429 20.142-4.663zm-10.888-43.9c.107-1.543 2.055-13.217-9.013-13.217-6.171 0-10.583 4.704-12.38 13.217zm-123.42-5.017c0 9.367 4.542 15.826 14.842 20.676 7.892 3.709 9.112 4.81 9.112 8.17 0 4.617-3.479 6.701-11.191 6.701-5.813 0-11.221-.908-17.458-2.922 0 0-2.563 16.321-2.68 17.102 4.43.967 8.38 1.861 20.279 2.19 20.563 0 30.059-7.829 30.059-24.75 0-10.175-3.976-16.146-13.737-20.634-8.171-3.75-9.108-4.587-9.108-8.045 0-4.004 3.237-6.046 9.537-6.046 3.825 0 9.05.408 14 1.112l2.775-17.175c-5.046-.8-12.696-1.442-17.15-1.442-21.801.001-29.347 11.388-29.28 25.063m229.09-23.116c5.412 0 10.458 1.421 17.412 4.921l3.188-19.763c-2.854-1.121-12.904-7.7-21.417-7.7-13.041 0-24.065 6.471-31.82 17.15-11.309-3.746-15.958 3.825-21.657 11.367l-5.063 1.179c.383-2.483.729-4.95.612-7.446h-17.896c-2.445 22.917-6.778 46.128-10.171 69.075l-.884 4.976h19.496c3.254-21.143 5.037-34.68 6.121-43.842l7.341-4.084c1.097-4.078 4.529-5.458 11.417-5.291-.926 5.008-1.389 10.091-1.383 15.184 0 24.225 13.07 39.308 34.05 39.308 5.404 0 10.041-.712 17.221-2.658l3.43-20.759c-6.458 3.181-11.759 4.677-16.559 4.677-11.329 0-18.184-8.363-18.184-22.185 0-20.051 10.196-34.109 24.746-34.109"/><path d="m185.21 297.24h-19.491l11.171-69.988-24.926 69.988h-13.283l-1.642-69.588-11.733 69.588h-18.241l15.237-91.042h28.021l.788 56.362 18.904-56.362h30.267z" fill="#fff"/><path d="m647.52 211.6-4.321 26.309c-5.329-7.013-11.054-12.088-18.612-12.088-9.833 0-18.783 7.455-24.642 18.425-8.158-1.692-16.597-4.563-16.597-4.563l-.004.067c.658-6.134.921-9.875.862-11.146h-17.9c-2.438 22.917-6.771 46.128-10.157 69.075l-.893 4.976h19.492c2.633-17.096 4.648-31.291 6.133-42.551 6.658-6.016 9.992-11.266 16.721-10.916-2.979 7.205-4.725 15.503-4.725 24.017 0 18.513 9.366 30.725 23.533 30.725 7.142 0 12.621-2.462 17.967-8.171l-.913 6.884h18.435l14.842-91.042zm-24.371 73.941c-6.634 0-9.983-4.908-9.983-14.596 0-14.555 6.271-24.875 15.112-24.875 6.695 0 10.32 5.104 10.32 14.509.001 14.679-6.37 24.962-15.449 24.962z"/><path d="m233.19 264.26c-2.042-.236-2.946-.299-4.346-.299-11.046 0-16.634 3.787-16.634 11.266 0 4.604 2.729 7.547 6.979 7.547 7.947-.001 13.668-7.559 14.001-18.514zm14.178 32.984h-16.146l.367-7.663c-4.921 6.054-11.5 8.95-20.421 8.95-10.567 0-17.805-8.25-17.805-20.229 0-18.032 12.592-28.542 34.217-28.542 2.208 0 5.042.2 7.938.571.604-2.441.763-3.487.763-4.808 0-4.909-3.392-6.729-12.496-6.729-9.537-.108-17.396 2.271-20.629 3.321.204-1.225 2.7-16.637 2.7-16.637 9.708-2.858 16.12-3.929 23.32-3.929 16.737 0 25.604 7.517 25.588 21.704.029 3.821-.604 8.513-1.584 14.675-1.687 10.724-5.319 33.724-5.812 39.316zm261.38-88.592-3.191 19.767c-6.95-3.496-12-4.92-17.407-4.92-14.551 0-24.75 14.058-24.75 34.106 0 13.821 6.857 22.181 18.184 22.181 4.8 0 10.096-1.492 16.554-4.675l-3.421 20.75c-7.184 1.957-11.816 2.67-17.225 2.67-20.977 0-34.051-15.084-34.051-39.309 0-32.55 18.059-55.3 43.888-55.3 8.507.001 18.561 3.609 21.419 4.73m31.443 55.608c-2.041-.236-2.941-.299-4.347-.299-11.041 0-16.633 3.787-16.633 11.266 0 4.604 2.729 7.547 6.983 7.547 7.938-.001 13.663-7.559 13.997-18.514zm14.178 32.984h-16.15l.371-7.663c-4.925 6.054-11.5 8.95-20.421 8.95-10.563 0-17.804-8.25-17.804-20.229 0-18.032 12.596-28.542 34.212-28.542 2.213 0 5.042.2 7.941.571.601-2.441.763-3.487.763-4.808 0-4.909-3.393-6.729-12.495-6.729-9.533-.108-17.396 2.271-20.63 3.321.204-1.225 2.704-16.637 2.704-16.637 9.709-2.858 16.116-3.929 23.316-3.929 16.741 0 25.604 7.517 25.583 21.704.033 3.821-.596 8.513-1.579 14.675-1.682 10.724-5.323 33.724-5.811 39.316zm-220.39-1.121c-5.338 1.679-9.496 2.408-14 2.408-9.962 0-15.399-5.726-15.399-16.268-.138-3.279 1.438-11.88 2.675-19.736 1.12-6.926 8.445-50.534 8.445-50.534h19.368l-2.26 11.212h9.941l-2.646 17.788h-9.975c-2.25 14.092-5.463 31.62-5.496 33.95 0 3.83 2.041 5.482 6.671 5.482 2.221 0 3.938-.216 5.254-.691zm59.391-.592c-6.65 2.033-13.079 3.012-19.879 3-21.685-.021-32.987-11.346-32.987-33.033 0-25.321 14.379-43.95 33.899-43.95 15.971 0 26.171 10.429 26.171 26.8 0 5.434-.7 10.733-2.384 18.212h-38.574c-1.306 10.741 5.569 15.222 16.837 15.222 6.93 0 13.188-1.435 20.138-4.677zm-10.891-43.912c.116-1.538 2.06-13.217-9.013-13.217-6.167 0-10.579 4.717-12.375 13.217zm-123.42-5.005c0 9.367 4.542 15.818 14.842 20.675 7.892 3.709 9.112 4.812 9.112 8.172 0 4.616-3.483 6.699-11.188 6.699-5.816 0-11.225-.908-17.467-2.921 0 0-2.554 16.321-2.671 17.101 4.421.967 8.375 1.85 20.275 2.191 20.566 0 30.059-7.829 30.059-24.746 0-10.18-3.971-16.15-13.737-20.637-8.167-3.759-9.113-4.584-9.113-8.046 0-4 3.246-6.059 9.542-6.059 3.821 0 9.046.421 14.004 1.125l2.771-17.179c-5.042-.8-12.692-1.441-17.146-1.441-21.804 0-29.346 11.379-29.283 25.066m398.45 50.63h-18.438l.917-6.893c-5.347 5.717-10.825 8.18-17.968 8.18-14.166 0-23.528-12.213-23.528-30.726 0-24.63 14.521-45.392 31.708-45.392 7.559 0 13.279 3.087 18.604 10.096l4.325-26.308h19.221zm-28.746-17.109c9.075 0 15.45-10.283 15.45-24.953 0-9.405-3.629-14.509-10.325-14.509-8.837 0-15.115 10.315-15.115 24.875-.001 9.686 3.357 14.587 9.99 14.587zm-56.842-56.929c-2.441 22.917-6.773 46.13-10.162 69.063l-.892 4.976h19.491c6.972-45.275 8.658-54.117 19.588-53.009 1.742-9.267 4.982-17.383 7.399-21.479-8.163-1.7-12.721 2.913-18.688 11.675.471-3.788 1.333-7.467 1.162-11.225zm-160.42 0c-2.446 22.917-6.779 46.13-10.167 69.063l-.888 4.976h19.5c6.963-45.275 8.646-54.117 19.57-53.009 1.75-9.267 4.991-17.383 7.399-21.479-8.154-1.7-12.717 2.913-18.679 11.675.471-3.788 1.324-7.467 1.162-11.225zm254.57 68.241c-.004-3.199 2.586-5.795 5.784-5.799h.012c3.197-.004 5.793 2.586 5.796 5.783v.016c-.001 3.201-2.595 5.795-5.796 5.797-3.201-.002-5.795-2.596-5.796-5.797zm5.796 4.405c2.431.002 4.402-1.969 4.403-4.399v-.004c.003-2.433-1.968-4.406-4.399-4.408h-.004c-2.435.001-4.407 1.974-4.408 4.408.002 2.432 1.975 4.403 4.408 4.403zm-.784-1.871h-1.188v-5.082h2.153c.446 0 .909.009 1.296.254.417.283.654.767.654 1.274 0 .575-.337 1.112-.888 1.317l.941 2.236h-1.32l-.779-2.009h-.87zm0-2.879h.653c.246 0 .513.019.729-.1.196-.125.296-.361.296-.588-.009-.21-.114-.404-.287-.523-.204-.117-.542-.084-.763-.084h-.629z" fill="#fff"/></svg>',Wu='<svg enable-background="new 0 0 780 500" viewBox="0 0 780 500" xmlns="http://www.w3.org/2000/svg"><path d="m40 .001h700c22.092 0 40 17.909 40 40v420c0 22.092-17.908 40-40 40h-700c-22.091 0-40-17.908-40-40v-420c0-22.091 17.909-40 40-40z" fill="#2557d6"/><path d="m.253 235.69h37.441l8.442-19.51h18.9l8.42 19.51h73.668v-14.915l6.576 14.98h38.243l6.576-15.202v15.138h183.08l-.085-32.026h3.542c2.479.083 3.204.302 3.204 4.226v27.8h94.689v-7.455c7.639 3.92 19.518 7.455 35.148 7.455h39.836l8.525-19.51h18.9l8.337 19.51h76.765v-18.532l11.626 18.532h61.515v-122.51h-60.88v14.468l-8.522-14.468h-62.471v14.468l-7.828-14.468h-84.38c-14.123 0-26.539 1.889-36.569 7.153v-7.153h-58.229v7.153c-6.383-5.426-15.079-7.153-24.75-7.153h-212.74l-14.274 31.641-14.659-31.641h-67.005v14.468l-7.362-14.468h-57.145l-26.539 58.246v64.261h.003zm236.34-17.67h-22.464l-.083-68.794-31.775 68.793h-19.24l-31.858-68.854v68.854h-44.57l-8.42-19.592h-45.627l-8.505 19.592h-23.801l39.241-87.837h32.559l37.269 83.164v-83.164h35.766l28.678 59.587 26.344-59.587h36.485zm-165.9-37.823-14.998-35.017-14.915 35.017zm255.3 37.821h-73.203v-87.837h73.203v18.291h-51.289v15.833h50.06v18.005h-50.061v17.542h51.289zm103.16-64.18c0 14.004-9.755 21.24-15.439 23.412 4.794 1.748 8.891 4.838 10.84 7.397 3.094 4.369 3.628 8.271 3.628 16.116v17.255h-22.104l-.083-11.077c0-5.285.528-12.886-3.458-17.112-3.202-3.09-8.083-3.76-15.973-3.76h-23.523v31.95h-21.914v-87.838h50.401c11.199 0 19.451.283 26.535 4.207 6.933 3.924 11.09 9.652 11.09 19.45zm-27.699 13.042c-3.013 1.752-6.573 1.81-10.841 1.81h-26.62v-19.51h26.982c3.818 0 7.804.164 10.393 1.584 2.842 1.28 4.601 4.003 4.601 7.765 0 3.84-1.674 6.929-4.515 8.351zm62.844 51.138h-22.358v-87.837h22.358zm259.56 0h-31.053l-41.535-65.927v65.927h-44.628l-8.527-19.592h-45.521l-8.271 19.592h-25.648c-10.649 0-24.138-2.257-31.773-9.715-7.701-7.458-11.708-17.56-11.708-33.533 0-13.027 2.395-24.936 11.812-34.347 7.085-7.01 18.18-10.242 33.28-10.242h21.215v18.821h-20.771c-7.997 0-12.514 1.14-16.862 5.203-3.735 3.699-6.298 10.69-6.298 19.897 0 9.41 1.951 16.196 6.023 20.628 3.373 3.476 9.506 4.53 15.272 4.53h9.842l30.884-69.076h32.835l37.102 83.081v-83.08h33.366l38.519 61.174v-61.174h22.445zm-133.2-37.82-15.165-35.017-15.081 35.017zm189.04 178.08c-5.322 7.457-15.694 11.238-29.736 11.238h-42.319v-18.84h42.147c4.181 0 7.106-.527 8.868-2.175 1.665-1.474 2.605-3.554 2.591-5.729 0-2.561-1.064-4.593-2.677-5.811-1.59-1.342-3.904-1.95-7.722-1.95-20.574-.67-46.244.608-46.244-27.194 0-12.742 8.443-26.156 31.439-26.156h43.649v-17.479h-40.557c-12.237 0-21.129 2.81-27.425 7.174v-7.175h-59.985c-9.595 0-20.854 2.279-26.179 7.175v-7.175h-107.12v7.175c-8.524-5.892-22.908-7.175-29.549-7.175h-70.656v7.175c-6.745-6.258-21.742-7.175-30.886-7.175h-79.077l-18.094 18.764-16.949-18.764h-118.13v122.59h115.9l18.646-19.062 17.565 19.062 71.442.061v-28.838h7.021c9.479.14 20.66-.228 30.523-4.312v33.085h58.928v-31.952h2.842c3.628 0 3.985.144 3.985 3.615v28.333h179.01c11.364 0 23.244-2.786 29.824-7.845v7.845h56.78c11.815 0 23.354-1.587 32.134-5.649l.002-22.84zm-354.94-47.155c0 24.406-19.005 29.445-38.159 29.445h-27.343v29.469h-42.591l-26.984-29.086-28.042 29.086h-86.802v-87.859h88.135l26.961 28.799 27.875-28.799h70.021c17.389 0 36.929 4.613 36.929 28.945zm-174.22 40.434h-53.878v-17.48h48.11v-17.926h-48.11v-15.974h54.939l23.969 25.604zm86.81 10.06-33.644-35.789 33.644-34.65zm49.757-39.066h-28.318v-22.374h28.572c7.912 0 13.404 3.09 13.404 10.772 0 7.599-5.238 11.602-13.658 11.602zm148.36-40.373h73.138v18.17h-51.315v15.973h50.062v17.926h-50.062v17.48l51.314.08v18.23h-73.139zm-28.119 47.029c4.878 1.725 8.865 4.816 10.734 7.375 3.095 4.291 3.542 8.294 3.631 16.037v17.418h-22.002v-10.992c0-5.286.531-13.112-3.542-17.198-3.201-3.147-8.083-3.899-16.076-3.899h-23.42v32.09h-22.02v-87.859h50.594c11.093 0 19.173.47 26.366 4.146 6.915 4.004 11.266 9.487 11.266 19.511-.001 14.022-9.764 21.178-15.531 23.371zm-12.385-11.107c-2.932 1.667-6.556 1.811-10.818 1.811h-26.622v-19.732h26.982c3.902 0 7.807.08 10.458 1.587 2.84 1.423 4.538 4.146 4.538 7.903 0 3.758-1.699 6.786-4.538 8.431zm197.82 5.597c4.27 4.229 6.554 9.571 6.554 18.613 0 18.9-12.322 27.723-34.425 27.723h-42.68v-18.84h42.51c4.157 0 7.104-.525 8.95-2.175 1.508-1.358 2.589-3.333 2.589-5.729 0-2.561-1.17-4.592-2.675-5.811-1.675-1.34-3.986-1.949-7.803-1.949-20.493-.67-46.157.609-46.157-27.192 0-12.744 8.355-26.158 31.33-26.158h43.932v18.7h-40.198c-3.984 0-6.575.145-8.779 1.587-2.4 1.422-3.29 3.534-3.29 6.319 0 3.314 2.037 5.57 4.795 6.546 2.311.77 4.795.995 8.526.995l11.797.306c11.895.276 20.061 2.248 25.024 7.065zm86.955-23.52h-39.938c-3.986 0-6.638.144-8.867 1.587-2.312 1.423-3.202 3.534-3.202 6.322 0 3.314 1.951 5.568 4.791 6.544 2.312.771 4.795.996 8.444.996l11.878.304c11.983.284 19.982 2.258 24.86 7.072.891.67 1.422 1.422 2.033 2.175v-25z" fill="#fff"/></svg>',Gu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 26"><path fill="#fff" d="M0 0h40v26H0z"/><path fill="#55b147" d="M28.38 13.41h2.44l.04.01h.04l.03.01h.03l.01.01.04.01.04.01.04.02.04.01.04.02.03.02.04.02.04.02.04.02.04.03.04.03.03.04c.02 0 .03.02.04.03l.04.04.04.05.04.05.04.06.04.08.03.09a1.05 1.05 0 0 1 .04.13 1.13 1.13 0 0 1 0 .49 1.05 1.05 0 0 1-.04.13l-.03.09-.04.07-.04.06-.04.06-.04.04-.04.04c0 .02-.02.03-.04.04l-.03.03-.04.03-.04.03-.04.03-.04.02-.04.02-.03.02-.04.02-.04.01-.04.01-.04.01-.04.01h-.01l-.03.01h-.03l-.04.01h-.04l-.04.01h-2.4v-2.1zm3.1-2.38a1.07 1.07 0 0 1 0 .45.96.96 0 0 1-.05.13.93.93 0 0 1-.03.09l-.04.07-.04.06-.04.05-.04.04-.04.04-.03.03-.04.03-.04.03-.04.02-.04.03-.04.02-.04.02-.03.01-.04.02h-.04l-.04.02h-.04l-.04.02h-.07l-.04.01h-2.22V10.3h2.31l.02.01h.01l.04.01.04.01.04.01.04.01.04.02.03.01.04.02.04.02.04.03.04.02.04.03.04.03.03.03.04.04.04.05.04.04.04.06.04.07a.93.93 0 0 1 .03.1.96.96 0 0 1 .04.12zM36.23.97h.02V20.9c0 .12 0 .23-.02.35l-.04.3-.03.2-.04.17-.04.13a4.12 4.12 0 0 1-.08.23l-.04.1-.03.1-.04.08-.04.08-.04.08-.04.07-.04.07-.04.07-.03.06-.04.06-.04.06-.04.06-.04.05-.04.05-.03.05-.04.05-.04.05-.04.05-.04.04-.04.05-.04.04-.03.04-.04.04-.04.04-.04.04-.04.03-.04.04-.03.03-.04.04-.04.03-.04.03-.04.04-.04.03-.04.03-.03.03-.04.02-.04.03-.04.03-.04.03-.04.02-.03.03-.04.02-.04.03-.04.02-.04.02-.04.02-.04.03-.03.02-.04.02-.04.02-.04.02-.04.02-.04.01-.03.02-.04.02-.04.02-.04.01-.04.02-.04.01-.04.02-.03.01-.04.02-.04.01-.04.01-.04.02-.04.01-.04.01-.03.01-.04.01-.04.01-.04.01-.04.01-.04.01-.03.01-.04.01-.04.01h-.04l-.04.02h-.08l-.03.02h-.08l-.04.01h-.04l-.04.01h-.07l-.04.01h-.12l-.04.01h-6v-8.12h6.39l.04-.01h.12l.04-.01h.04l.04-.01h.04l.04-.01h.03l.04-.01.04-.01h.04l.04-.02h.04l.04-.01.03-.01.04-.01.04-.01.04-.01.04-.02h.04l.03-.02.04-.01.04-.02.04-.01.04-.02.04-.01.04-.02.03-.02.04-.02.04-.01.04-.02.04-.02.04-.03.03-.02.04-.02.04-.03.04-.02.04-.03.04-.03.04-.03.03-.03.04-.03.04-.03.04-.04.04-.04.04-.04.03-.04.04-.04.04-.05a1.87 1.87 0 0 0 .08-.11l.04-.06.04-.07.03-.07.04-.1.04-.1.04-.13a1.8 1.8 0 0 0 .04-.2 1.93 1.93 0 0 0 .01-.25 1.8 1.8 0 0 0-.01-.25 1.7 1.7 0 0 0-.04-.2l-.04-.12-.04-.1-.04-.09-.03-.07-.04-.07-.04-.05a1.7 1.7 0 0 0-.08-.1l-.04-.06-.04-.04-.03-.04-.04-.04-.04-.03-.04-.04-.04-.03-.04-.03-.03-.03-.04-.03-.04-.03-.04-.02-.04-.03-.04-.02-.04-.03-.03-.02-.04-.02-.04-.02-.04-.02-.04-.02-.04-.01-.03-.02-.04-.02-.04-.01-.04-.02-.04-.01-.04-.01-.04-.02h-.03l-.04-.02-.04-.01-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01h-.04l-.04-.02h-.04l-.04-.01h-.04l-.03-.01h-.04l-.04-.01h-.04l-.04-.01h-.04l-.04-.01h-.07v-.05h.04l.03-.01.04-.01h.04l.04-.02h.04l.04-.01.04-.01.03-.01.04-.01.04-.02h.04l.04-.02.04-.01.04-.02.03-.01.04-.02.04-.01.04-.02.04-.02.04-.02.03-.02.04-.02.04-.02.04-.02.04-.03.04-.02.04-.03.03-.03.04-.03.04-.03.04-.03.04-.04.04-.03.03-.04.04-.05.04-.04.04-.05.04-.05.04-.05.04-.07.03-.06.04-.08.04-.09.04-.1.04-.14a1.75 1.75 0 0 0 .04-.23 1.82 1.82 0 0 0 0-.18v-.2a1.77 1.77 0 0 0-.04-.23l-.04-.13-.04-.1-.04-.1-.04-.07-.03-.07-.04-.06-.04-.05-.04-.05a1.66 1.66 0 0 0-.04-.05l-.04-.04-.04-.04-.03-.04-.04-.03-.04-.04-.04-.03-.04-.03-.04-.03-.03-.03-.04-.02-.04-.03-.04-.02-.04-.02-.04-.02-.04-.02-.03-.02-.04-.02-.04-.02-.04-.01-.04-.02-.04-.02-.03-.01-.04-.01-.04-.02-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01-.04-.01-.04-.01-.04-.01-.04-.01h-.04l-.04-.02h-.07l-.04-.01-.04-.01h-.04l-.04-.01h-.07l-.04-.01h-.12l-.01-.01h-.18l-.04-.01h-5.81V4.95a4 4 0 0 1 .08-.82l.04-.16.04-.14.04-.13.03-.11.04-.1.04-.1.04-.08.04-.09.04-.07.04-.08.03-.07.04-.07.04-.06.04-.06.04-.06.04-.06.03-.05.04-.06.04-.05.04-.05.04-.05.04-.04.04-.05.03-.04.04-.04.04-.05.04-.04.04-.03.04-.04.03-.04.04-.04.04-.03.04-.04.04-.03.04-.03.04-.03.03-.03.04-.03.04-.03.04-.03.04-.03.04-.03.03-.03.04-.02.04-.03.04-.02.04-.03.04-.02.04-.02.03-.02.04-.03.04-.02.04-.02.04-.02.04-.02.03-.02.04-.02.04-.01.04-.02.04-.02.04-.01.04-.02.03-.02.04-.01.04-.02.04-.01.04-.01.04-.02.03-.01.04-.01.04-.01.04-.02h.04l.04-.02h.04l.03-.02h.04l.04-.02h.04l.04-.01.04-.01.04-.01h.03l.04-.01.04-.01h.04l.04-.01h.04l.03-.01h.04l.04-.01h.08l.04-.01h.23l.04-.01h5.84z"/><path fill="#0d6db5" d="M4.38 14.8V4.96a4 4 0 0 1 .08-.81l.04-.17.03-.14.04-.13a3.87 3.87 0 0 1 .08-.21l.04-.1.04-.08.03-.09.04-.07.04-.08.04-.07.04-.06.04-.07.04-.06.03-.06.04-.06.04-.05.04-.05.04-.06.04-.05.03-.04.04-.05.04-.05.04-.04.04-.04.04-.04.03-.04.04-.04.04-.04.04-.04.04-.03.04-.04.03-.03.04-.04.04-.03.04-.03.04-.03.04-.03.04-.03.03-.03.04-.03.04-.03.04-.02.04-.03.04-.02.03-.03.04-.02.04-.03.04-.02.04-.02.04-.02.03-.03.04-.02.04-.02.04-.02.04-.01.04-.02.03-.02.04-.02.04-.02.04-.01.04-.02.04-.01.04-.02.03-.01L7 1.2l.04-.01.04-.02h.04l.04-.02.03-.01.04-.01.04-.02h.04l.04-.02h.04l.03-.02h.04l.04-.01.04-.01.04-.01h.04l.03-.02h.08L7.76 1h.19L8 .98h.08L8.1.97h.2l.04-.01h5.87V20.9a4.03 4.03 0 0 1-.04.51c0 .08-.02.16-.04.24l-.03.18-.04.15-.04.12-.04.12-.04.1-.04.1-.03.09-.04.08-.04.08-.04.08-.04.07-.04.07-.03.06a3.9 3.9 0 0 1-.04.07l-.04.06-.04.05-.04.06-.04.05-.04.05-.03.05-.04.05-.04.05-.04.05-.04.04-.04.04-.03.04-.04.05-.04.03-.04.04-.04.04-.04.04-.03.03-.04.04-.04.03-.04.03-.04.04-.04.03-.03.03-.04.03-.04.03-.04.02-.04.03-.04.03-.04.03-.03.02-.04.03-.04.02-.04.02-.04.03-.04.02-.03.02-.04.02-.04.02-.04.02-.04.02-.04.02-.03.02-.04.02-.04.02-.04.01-.04.02-.04.02-.03.01-.04.02-.04.01-.04.02-.04.01-.04.02h-.04l-.03.02-.04.01-.04.02h-.04l-.04.02h-.04l-.03.02h-.04l-.04.02h-.04l-.04.01-.04.01-.03.01h-.04l-.04.01-.04.01h-.04l-.04.01h-.03l-.04.01h-.04l-.04.01h-.08l-.04.01h-.11l-.04.01H4.38v-8.4l.08.03h.04l.03.01.04.01.04.01.04.01.04.01h.04l.03.02h.04l.04.01.04.01.04.01h.04l.04.02h.03l.04.01.04.01h.04l.04.01.04.01h.03l.04.02h.04l.04.01h.04l.04.01.03.01h.04l.04.01.04.01h.04l.04.01h.03l.04.01.04.01h.04l.04.01h.04l.04.01h.03l.04.01.04.01h.04l.04.01h.04l.03.01h.04l.04.01h.04l.04.01h.07l.04.01h.04l.04.01h.04l.04.01h.07l.04.01h.04l.04.01h.08l.03.01h.08l.04.01h.08l.03.01h.12l.04.01h.11l.04.01h.15l.04.01h.2l.03.01h1.27l.04-.01h.11l.04-.01h.08l.04-.01h.07l.04-.01h.08l.04-.01h.08l.03-.01h.04l.04-.01h.04l.04-.01h.04l.03-.01h.04l.04-.01.04-.01h.04l.04-.01.03-.01h.04l.04-.01.04-.01h.04l.04-.02h.03l.04-.01h.04l.04-.02h.04l.04-.02h.04l.03-.01.04-.01.04-.01.04-.01.04-.01.04-.01.03-.02h.04l.04-.02.04-.01.04-.01.04-.02h.03l.04-.02.04-.02.04-.01.04-.01.04-.02.03-.01.04-.02.04-.02.04-.01.04-.02.04-.02.04-.01.03-.02.04-.02.04-.02.04-.02.04-.02.04-.02.03-.02.04-.03.04-.02.04-.02.04-.03.04-.02.03-.03.04-.03.04-.02.04-.03.04-.03.04-.03.03-.04.04-.03.04-.03.04-.04.04-.04.04-.04.04-.04.03-.04.04-.04.04-.05.04-.05a2.63 2.63 0 0 0 .08-.1l.03-.06.04-.06.04-.07.04-.07.04-.08.04-.08.03-.1.04-.1.04-.12.04-.14.04-.18.04-.27.02-.4V9.09h-3.4l-.03 4.63-.01.21a2.21 2.21 0 0 1-.04.26l-.04.16-.04.11-.03.1-.04.09a1.77 1.77 0 0 1-.08.14l-.04.06-.04.05a1.7 1.7 0 0 1-.07.1l-.04.05-.04.04-.04.04-.04.03-.04.04-.03.03-.04.03-.04.03-.04.03-.04.02-.04.03-.03.02-.04.02-.04.02-.04.02-.04.02-.04.02-.03.02-.04.01-.04.02-.04.01-.04.01-.04.02H8.6l-.03.02h-.04l-.04.02h-.04l-.04.02h-.04l-.03.01H8.3l-.04.01h-.04l-.04.01h-.04l-.03.01h-.12l-.04.01h-.5l-.04-.01h-.07l-.04-.01h-.08l-.04-.01h-.07l-.04-.01h-.04l-.04-.01h-.04l-.03-.01-.04-.01h-.04l-.04-.01h-.04l-.04-.02h-.04l-.03-.01H6.6l-.04-.01-.04-.01-.04-.01h-.04l-.03-.02h-.04l-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01-.04-.01-.04-.01-.04-.01-.04-.01-.04-.01-.03-.01-.04-.02h-.04l-.04-.02-.04-.01-.04-.01-.04-.01-.03-.02-.04-.01-.04-.01-.04-.02h-.04l-.04-.02-.03-.02h-.04l-.04-.02-.04-.02-.04-.01-.04-.02-.03-.01-.04-.02-.04-.01-.04-.02-.04-.01-.04-.02-.03-.01-.04-.02-.04-.01-.04-.02-.04-.02L4.8 15l-.04-.02-.03-.02-.04-.01-.04-.02-.04-.02-.04-.02-.04-.02-.03-.01-.04-.02z"/><path fill="#e01d3b" d="m15.48 10.1-.08.07V4.96a4 4 0 0 1 .08-.81l.04-.17.04-.14.04-.13.04-.1.04-.11.03-.1.04-.08.04-.08.04-.08.04-.08.04-.07.03-.06.04-.07.04-.06.04-.06.04-.06.04-.05.04-.05.03-.06.04-.05.04-.04.04-.05.04-.04.04-.05.03-.04.04-.04.04-.04.04-.04.04-.04.04-.04.03-.03.04-.04.04-.03.04-.04.04-.03.04-.03.03-.03.04-.03.04-.03.04-.03.04-.03.04-.03.04-.02.03-.03.04-.02.04-.03.04-.02.04-.03.04-.02.03-.02.04-.02.04-.03.04-.02.04-.02.04-.02.03-.01.04-.02.04-.02.04-.02.04-.02.04-.01.03-.02.04-.01.04-.02.04-.01.04-.02.04-.01.04-.02h.03l.04-.02.04-.01.04-.01.04-.02h.04l.03-.02h.04l.04-.02h.04l.04-.01.04-.01.03-.01h.04l.04-.02h.08l.04-.01.04-.01h.03L18.9 1h.08l.04-.01h.07l.04-.01h.19l.04-.01h5.87V20.9a4.02 4.02 0 0 1-.03.5l-.04.25-.04.18-.04.15-.03.12-.04.12-.04.1-.04.1-.04.09-.04.08-.03.08-.04.08-.04.07-.04.07-.04.06-.04.07-.03.06-.04.05-.04.06-.04.05-.04.05-.04.05-.03.05-.04.05-.04.05-.04.04-.04.04-.04.04-.04.05-.03.03-.04.04-.04.04-.04.04-.04.03-.04.04-.03.03-.04.03-.04.04-.04.03-.04.03-.04.03-.03.03-.04.02-.04.03-.04.03-.04.03-.04.02-.04.03-.03.02-.04.02-.04.03-.04.02-.04.02-.04.02-.03.02-.04.02-.04.02-.04.02-.04.02-.04.02-.03.02-.04.01-.04.02-.04.02-.04.01-.04.02-.03.01-.04.02-.04.01-.04.02h-.04l-.04.02-.04.01-.03.01-.04.02h-.04l-.04.02h-.04l-.04.02h-.03l-.04.02h-.04l-.04.01-.04.01h-.04l-.03.01-.04.01h-.04l-.04.01h-.04l-.04.01h-.03l-.04.01h-.08l-.04.01h-.11l-.04.01h-6v-9.2l.08.07.04.03.04.03.04.03.04.03.04.03.03.02.04.03.04.02.04.03.04.02.04.03.03.02.04.02.04.03.04.02.04.02.04.02.04.02.03.02.04.02.04.02.04.02.04.02.04.01.03.02.04.02.04.01.04.02.04.02.04.01.03.02.04.01.04.02.04.01.04.02.04.01.03.01.04.02.04.01.04.01.04.02h.04l.04.02.03.01.04.01.04.01.04.01.04.02h.04l.03.02h.04l.04.02h.04l.04.01.04.01.03.01.04.01.04.01h.04l.04.02h.04l.03.01.04.01h.04l.04.02h.08l.04.02h.07l.04.02h.08l.04.01h.03l.04.01.04.01h.04l.04.01h.07l.04.01h.04l.04.01h.04l.04.01h.07l.04.01h.08l.04.01h.07l.04.01h.08l.04.01h.15l.04.01h.19l.04.01h.46l.04.01h.58l.03-.01H21l.02-.01h.16l.04-.01h.1l.04-.01h.08l.03-.01h.08l.04-.01h.08l.04-.01h.03l.04-.01h.04l.04-.01h.08l.03-.01h.04l.04-.01h.04l.04-.01h.04l.03-.01h.04l.04-.01h.04l.04-.01.04-.01h.03l.04-.01h.04l.04-.01h.04l.04-.02h.07l.04-.01.04-.01h.04l.04-.01.04-.01h.03l.04-.01.04-.01h.04l.04-.01.04-.01h.03l.04-.02h.04l.04-.01h.04l.04-.02h.04l.03-.01h.04l.04-.02h.04l.04-.01.04-.01.03-.01h.04l.04-.02h.04l.04-.01.04-.01.03-.01h.04l.04-.02h.04l.04-.02h.04l.03-.01v-1.7l-.03.03-.04.02-.04.02-.04.01-.04.02-.04.02-.03.02-.04.02-.04.01-.04.02-.04.02-.04.02-.03.01-.04.02-.04.02-.04.01-.04.02-.04.02-.04.01-.03.02-.04.01-.04.02-.04.01-.04.02-.04.01-.03.02h-.04l-.04.02-.04.02-.04.01-.04.01-.03.02h-.04l-.04.02-.04.01-.04.02h-.04l-.03.02-.04.01-.04.01-.04.01-.04.01-.04.01-.04.01-.03.01-.04.01-.04.01-.04.01-.04.01-.04.01-.03.01h-.04l-.04.02h-.04l-.04.01-.04.01h-.03l-.04.02h-.08l-.04.02h-.07l-.04.01-.04.01h-.04l-.04.01h-.04l-.04.01h-.03l-.04.01h-.08l-.04.01h-.04l-.03.01h-.1l-.02.01h-.15l-.04.01h-.58l-.04-.01h-.07l-.04-.01h-.04l-.04-.01h-.04l-.03-.01h-.04l-.04-.01-.04-.01h-.04l-.04-.01-.03-.01-.04-.01h-.04l-.04-.02h-.04l-.04-.02h-.04l-.03-.02-.04-.01-.04-.01-.04-.02h-.04l-.04-.02-.03-.02-.04-.01-.04-.02-.04-.01-.04-.02-.04-.02-.03-.02-.04-.01-.04-.02-.04-.02-.04-.03-.04-.02-.03-.02-.04-.03-.04-.02-.04-.03-.04-.02-.04-.03-.04-.03-.03-.03-.04-.03-.04-.04-.04-.03-.04-.04-.04-.04-.03-.04-.04-.04-.04-.05-.04-.04-.04-.05a2.28 2.28 0 0 1-.04-.06l-.03-.05-.04-.06-.04-.07-.04-.06-.04-.08-.04-.08a2.58 2.58 0 0 1-.07-.2l-.04-.11-.04-.14-.04-.19-.04-.28-.01-.34.01-.35.04-.28.04-.18.04-.14.04-.12a2.63 2.63 0 0 1 .07-.2l.04-.08.04-.07.04-.07.04-.06.04-.06.03-.06.04-.05.04-.05.04-.05.04-.04.04-.05.03-.04.04-.04.04-.03.04-.04.04-.03.04-.03.03-.03.04-.03.04-.03.04-.03.04-.03.04-.02.04-.02.03-.03.04-.02.04-.02.04-.02.04-.02.04-.02.03-.02.04-.02.04-.01.04-.02.04-.01.04-.02.03-.01.04-.02.04-.01.04-.01.04-.02h.04l.03-.02h.04l.04-.02h.04l.04-.02h.04l.04-.01.03-.01h.04l.04-.02h.08l.04-.02h.07l.04-.01h.08l.04-.01h.07l.04-.01h.15l.04-.01h.46l.04.01h.08l.04.01h.07l.04.01h.08l.04.01h.04l.03.01h.04l.04.01h.04l.04.01h.04l.04.01.03.01h.04l.04.01.04.01h.04l.04.01.03.01h.04l.04.02h.04l.04.01.04.01.03.01.04.01h.04l.04.02h.04l.04.02h.03l.04.02h.04l.04.02.04.01.04.01.04.01.03.01.04.02h.04l.04.02.04.01.04.02h.03l.04.02.04.01.04.02.04.01.04.02.03.01.04.02.04.01.04.01.04.02.04.02.03.01.04.02.04.01.04.02.04.02.04.01.04.02.03.02.04.01.04.02.04.02.04.02.04.01.03.02.04.02.04.02.04.02.04.02.04.02.03.02v-1.7h-.03l-.04-.01H24l-.04-.02h-.04l-.04-.02h-.03l-.04-.01-.04-.01-.04-.01h-.04l-.04-.02h-.03l-.04-.01-.04-.01h-.04l-.04-.02h-.04l-.04-.01-.03-.01h-.04l-.04-.01-.04-.01-.04-.01h-.04l-.03-.01-.04-.01h-.04L23 9.12h-.08l-.03-.02h-.08l-.04-.02h-.08l-.03-.01-.04-.01h-.04l-.04-.01h-.04l-.04-.01-.04-.01h-.03l-.04-.01h-.04l-.04-.01h-.04L22.2 9h-.11l-.04-.01h-.04l-.04-.01h-.03l-.04-.01h-.04l-.04-.01h-.08l-.03-.01h-.04l-.04-.01h-.08l-.04-.01h-.07l-.04-.01h-.08l-.04-.01h-.11l-.04-.01h-.19l-.04-.01h-.27l-.04-.01h-1.04l-.03.01h-.16l-.04.01h-.11l-.04.01h-.11l-.04.01h-.08l-.04.01h-.04l-.03.01h-.08l-.04.01h-.04l-.04.01h-.04l-.03.01h-.04l-.04.01h-.04L18.4 9h-.04l-.03.01h-.04l-.04.01h-.04l-.04.02h-.07l-.04.02h-.08l-.04.02h-.04l-.04.01-.03.01h-.04l-.04.02h-.04l-.04.01-.04.01-.03.01-.04.01h-.04l-.04.02h-.04l-.04.02h-.03l-.04.02-.04.01-.04.01-.04.01-.04.01-.03.02h-.04l-.04.02-.04.01-.04.01-.04.02-.04.01-.03.01-.04.02-.04.01-.04.02-.04.01-.04.02-.03.01-.04.02-.04.01-.04.02-.04.02-.04.01-.03.02-.04.02-.04.02-.04.02-.04.02-.04.01-.03.02-.04.03-.04.02-.04.02-.04.02-.04.02-.04.02-.03.03-.04.02-.04.03-.04.02-.04.03-.04.02-.03.03-.04.03-.04.03-.04.02-.04.03-.04.04z"/></svg>',ys='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 26"><rect width="45.3" height="27" x="-3.3" y="-.79" fill="#fff" rx="2.82"/><path fill="#01798a" d="M27.27-.79a4.06 4.06 0 0 0-3.6 2.8l-4.96 23.42a2.14 2.14 0 0 0 2 2.8h18.35a2.81 2.81 0 0 0 2.8-2.82V1.15A2.25 2.25 0 0 0 40-.8"/><rect width="20.38" height="29.02" x="-4" y="-.79" fill="#dc1f2b" rx="2.82"/><path fill="#1a4580" d="M24.37 2.02a3.98 3.98 0 0 1 3.48-2.8H14.18a3.97 3.97 0 0 0-3.5 2.8l-4.85 23.4a2.13 2.13 0 0 0 1.94 2.81h13.7a2.13 2.13 0 0 1-1.94-2.8z"/><path fill="#fff" d="M16.63 15.04h.18a.32.32 0 0 0 .32-.17l.46-.7h1.24l-.26.47h1.49l-.2.7H18.1a.82.82 0 0 1-.75.44h-.92zm-.2 1h3.25l-.21.77h-1.3l-.2.74h1.27l-.21.77h-1.27l-.3 1.09c-.07.18.02.26.29.24h1.03l-.19.71H16.6q-.57 0-.39-.65l.38-1.4h-.81l.2-.76h.82l.2-.74h-.78l.2-.76zm5.19-1.87-.06.45a2.37 2.37 0 0 1 1.18-.47h2.05l-.78 2.88q-.1.5-.84.5h-2.34l-.54 2.01c-.03.11.01.17.13.17h.46l-.17.62h-1.17q-.67 0-.56-.4l1.54-5.76zm1.74.81h-1.84l-.22.78a1.52 1.52 0 0 1 .82-.23h1.1zm-.67 1.8c.14.02.22-.03.22-.16l.12-.4h-1.84l-.16.57zm-1.24.93h1.06l-.02.47h.29c.14 0 .2-.05.2-.14l.1-.3h.87l-.11.44a.76.76 0 0 1-.8.57h-.56v.8c-.01.12.1.18.33.18h.53l-.17.63H21.9c-.36.02-.53-.15-.53-.52zM8.6 10.34a2.62 2.62 0 0 1-1 1.64 3.24 3.24 0 0 1-1.98.58 2.16 2.16 0 0 1-1.68-.59 1.54 1.54 0 0 1-.37-1.06 2.86 2.86 0 0 1 .06-.57l.87-4.2h1.3l-.85 4.15a1.35 1.35 0 0 0-.04.32.82.82 0 0 0 .16.52.89.89 0 0 0 .75.3 1.56 1.56 0 0 0 1-.3 1.37 1.37 0 0 0 .5-.84l.84-4.15h1.3zm5.47-1.65h1.02l-.8 3.74h-1.02zm.32-1.37h1.03l-.2.91H14.2l.19-.9M16 12.15a1.39 1.39 0 0 1-.41-1.05 2.45 2.45 0 0 1 .01-.25l.04-.27a2.55 2.55 0 0 1 .78-1.45 2.07 2.07 0 0 1 1.43-.54 1.5 1.5 0 0 1 1.1.39 1.4 1.4 0 0 1 .4 1.06 2.59 2.59 0 0 1-.02.26l-.05.28a2.48 2.48 0 0 1-.77 1.42 2.08 2.08 0 0 1-1.43.53 1.5 1.5 0 0 1-1.09-.38m1.95-.74a1.84 1.84 0 0 0 .38-.9.58.58 0 0 0 .03-.19 1.74 1.74 0 0 0 .01-.17.76.76 0 0 0-.17-.54.64.64 0 0 0-.5-.2.89.89 0 0 0-.7.3 1.9 1.9 0 0 0-.38.92l-.03.18a1.36 1.36 0 0 0-.01.17.75.75 0 0 0 .17.54.64.64 0 0 0 .5.18.9.9 0 0 0 .7-.3m8.02 3.67.25-.87h1.24l-.05.32a3.1 3.1 0 0 1 1.09-.32h1.54l-.25.87h-.24l-1.16 4.12h.24l-.23.82h-.24l-.1.36h-1.2l.1-.36h-2.38l.23-.82h.24l1.16-4.12zm1.34 0L27 16.2a5.13 5.13 0 0 1 1-.27c.1-.4.24-.85.24-.85zm-.46 1.64-.32 1.17a3.44 3.44 0 0 1 1.01-.33l.24-.84zm.23 2.48.24-.84h-.93l-.24.84zm3.01-5.05h1.17l.05.44c0 .11.06.16.2.16h.2l-.2.74h-.87c-.32.02-.5-.1-.5-.38zm-.34 1.59h3.79l-.23.79h-1.2l-.2.74h1.2l-.23.79h-1.34l-.3.46h.65l.16.93c.01.09.1.13.23.13h.2l-.2.77h-.73c-.37.02-.57-.1-.58-.38l-.18-.85-.6.9a.65.65 0 0 1-.65.36h-1.1l.22-.77h.34a.46.46 0 0 0 .36-.19l.94-1.36h-1.2l.22-.8h1.3l.21-.73h-1.3l.22-.8zM9.8 8.69h.92l-.1.54.12-.16a1.43 1.43 0 0 1 1.1-.48 1 1 0 0 1 .83.34 1.15 1.15 0 0 1 .14.95l-.5 2.56h-.95l.46-2.32a.74.74 0 0 0-.04-.53.44.44 0 0 0-.4-.17.88.88 0 0 0-.62.23 1.14 1.14 0 0 0-.34.63L10 12.44h-.94zm10.55 0h.92l-.1.54.13-.16a1.43 1.43 0 0 1 1.08-.48.99.99 0 0 1 .85.34 1.14 1.14 0 0 1 .13.95l-.5 2.56h-.95l.46-2.32a.75.75 0 0 0-.04-.53.45.45 0 0 0-.4-.17.89.89 0 0 0-.62.23 1.12 1.12 0 0 0-.33.63l-.43 2.16h-.94zm4.55-2.33h2.67a1.8 1.8 0 0 1 1.19.35 1.25 1.25 0 0 1 .4 1v.02a3.77 3.77 0 0 1-.06.59 2.38 2.38 0 0 1-.81 1.4 2.29 2.29 0 0 1-1.5.52h-1.44l-.44 2.2h-1.24zm.67 2.82h1.19a1.14 1.14 0 0 0 .73-.21 1.14 1.14 0 0 0 .36-.67l.03-.15v-.13a.52.52 0 0 0-.22-.47 1.35 1.35 0 0 0-.72-.15h-1zm9.15 3.98a5.91 5.91 0 0 1-.98 1.56 1.99 1.99 0 0 1-1.7.71l.08-.64c.89-.27 1.36-1.51 1.64-2.06l-.33-4.03.68-.01h.58l.06 2.53 1.07-2.53h1.09zM31.68 9l-.43.3a1.35 1.35 0 0 0-1.66-.21c-1.08.5-1.98 4.4 1 3.11l.17.2 1.17.04.77-3.54zm-.66 1.92c-.2.56-.61.94-.94.83-.33-.1-.45-.64-.26-1.2.19-.57.61-.94.94-.83.33.1.45.64.26 1.2"/></svg>',Yu={card:Ou,applepay:Bu,googlepay:Vu,alipay:Ku,alipaycn:Uu,alipayhk:Hu,wechatpay:ju,paynow:zu},Zu={visa:qu,mastercard:fs,amex:Wu,jcb:Gu,cup:ys,unionpay:ys,mc:fs};function Qu(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function Xo(e,t){const n=Yu[e.toLowerCase()];if(!n)return k("span",{class:"inline-flex size-10 shrink-0 items-center justify-center rounded-lg bg-zinc-100 text-[10px] font-semibold uppercase text-zinc-600",text:Qu(t)});const r=k("span",{class:"inline-flex size-12 shrink-0 items-center justify-center overflow-hidden rounded-lg"});r.innerHTML=n;const o=r.firstElementChild;return o&&(o.setAttribute("width","48"),o.setAttribute("height","48"),o.classList.add("size-12","object-contain")),r}function gs(e){if(!e?.length)return null;const t=k("span",{class:"mt-1 flex flex-wrap items-center gap-1.5"});for(const n of e){const r=n.toLowerCase(),o=Zu[r];if(!o){t.append(k("span",{class:"rounded bg-zinc-100 px-1.5 py-0.5 text-[10px] font-medium uppercase text-zinc-600",text:n}));continue}const i=k("span",{class:Or("inline-flex h-6 w-10 items-center justify-center")});i.innerHTML=o;const a=i.firstElementChild;a&&(a.setAttribute("width","40"),a.setAttribute("height","24"),a.classList.add("h-6","w-10","object-contain")),t.append(i)}return t}const bs=`<?xml version="1.0" standalone="no"?>
|
|
98
98
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
99
99
|
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
100
100
|
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
@@ -128,15 +128,15 @@ c-13 -27 -34 -60 -47 -72 -13 -11 -140 -97 -281 -190 -510 -333 -858 -561
|
|
|
128
128
|
805 527 338 222 632 416 653 433 88 68 205 84 293 39z"/>
|
|
129
129
|
</g>
|
|
130
130
|
</svg>
|
|
131
|
-
`;function On(){const e=P("span",{class:"inline-flex items-center gap-1.5 text-xs text-zinc-500"}),t=P("span",{class:"inline-flex size-4 shrink-0 overflow-hidden"}),n=ds.match(/<svg[\s\S]*<\/svg>/i)?.[0]??ds;t.innerHTML=n;const o=t.querySelector("svg");o&&(o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("aria-hidden","true"),o.classList.add("size-4","block"));const r=P("span");return r.append(document.createTextNode("Powered by "),P("strong",{class:"font-semibold text-zinc-700",text:"Finyx"})),e.append(t,r),e}function Zr(e,t={}){const n=t.variant??"primary",o=P("button",{type:"button",class:Fo("inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium transition",n==="primary"&&"bg-[var(--fy-color-primary)] text-white hover:opacity-90 disabled:opacity-50",n==="ghost"&&"text-blue-600 hover:underline")});return o.textContent=e,o.disabled=!!t.disabled,t.onClick&&o.addEventListener("click",t.onClick),o}function Bn(e="Loading…"){const t=P("div",{class:"flex items-center gap-2 py-4 text-sm text-zinc-500"});return t.innerHTML='<svg class="h-5 w-5 animate-spin text-zinc-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>',t.append(P("span",{text:e})),t}function Oe(e){return P("p",{class:"mt-3 text-sm text-red-600",text:e})}const Vn={newline:10,reset:27};function Au(e){if(!Number.isSafeInteger(e))throw new Error(`integer expected: ${e}`)}function Iu(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw new Error(`Invalid version=${e}. Expected number [1..40]`)}function jt(e,t){return e.toString(2).padStart(t,"0")}function us(e,t){const n=e%t;return n>=0?n:t+n}function vt(e,t){return new Array(e).fill(t)}function Qr(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function hs(e){let t=0,n=0;for(const i of e)t=Math.max(t,i.length),n+=i.length;const o=new Uint8Array(n);let r=0;for(let i=0;i<t;i++)for(const a of e)i<a.length&&(o[r++]=a[i]);return o}function Ru(){let e,t=1/0;return{add(n,o){n>=t||(e=o,t=n)},get:()=>e,score:()=>t}}function ps(e){return{has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const o=e.indexOf(n);if(o===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return o})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(Au(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}}}function ms(e){if(e.length!==32)throw new Error("expects 32 element matrix");const t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){const o=t[n]>>>0,r=1<<n,i=r<<1;for(let a=0;a<32;a+=i)for(let s=0;s<r;s++){const l=a+s,c=l+r,d=e[l]>>>0,p=e[c]>>>0,h=(d>>>r^p)&o;e[l]=(d^h<<r)>>>0,e[c]=(p^h)>>>0}}}const Un=e=>1<<(e&31)>>>0,zt=(e,t)=>t===0?0:t===32?4294967295:(1<<t)-1<<e>>>0;class Ne{static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){t=t.replace(/^\n+/g,"").replace(/\n+$/g,"");const n=t.split(String.fromCharCode(Vn.newline)),o=n.length;let r;const i=[];for(const a of n){const s=a.split("").map(l=>{if(l==="X")return!0;if(l===" ")return!1;if(l!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${l}`)});if(r!==void 0&&s.length!==r)throw new Error(`Bitmap.fromString different row sizes: width=${r} cur=${s.length}`);r=s.length,i.push(s)}return r===void 0&&(r=0),new Ne({height:o,width:r},i)}defined;value;tailMask;words;fullWords;height;width;constructor(t,n){const{height:o,width:r}=Ne.size(t);if(this.height=o,this.width=r,this.tailMask=zt(0,r&31||32),this.words=Math.ceil(r/32)|0,this.fullWords=Math.floor(r/32)|0,this.value=new Uint32Array(this.words*o),this.defined=new Uint32Array(this.value.length),n){if(n.length!==o)throw new Error(`Bitmap: data height mismatch: exp=${o} got=${n.length}`);for(let i=0;i<o;i++){const a=n[i];if(!a||a.length!==r)throw new Error(`Bitmap: data width mismatch at y=${i}: exp=${r} got=${a?.length}`);for(let s=0;s<r;s++)this.set(s,i,a[s])}}}point(t){return this.get(t.x,t.y)}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:o}=this.xy(t);return{height:this.height-o,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=us(t.x,this.width),t.y=us(t.y,this.height),t}wordIndex(t,n){return n*this.words+(t>>>5)}bitIndex(t,n){return{word:this.wordIndex(t,n),bit:t&31}}isDefined(t,n){const o=this.wordIndex(t,n),r=Un(t);return(this.defined[o]&r)!==0}get(t,n){const o=this.wordIndex(t,n),r=Un(t);return(this.value[o]&r)!==0}maskWord(t,n,o){const{defined:r,value:i}=this;r[t]|=n,i[t]=i[t]&~n|-o&n}set(t,n,o){o!==void 0&&this.maskWord(this.wordIndex(t,n),Un(t),o)}fillRectConst(t,n,o,r,i){if(o<=0||r<=0||i===void 0)return;const{value:a,defined:s,words:l}=this,c=t>>>5,d=t+o-1>>>5,p=t&31,h=t+o-1&31;for(let m=0;m<r;m++){const f=(n+m)*l;if(c===d){const y=zt(p,h-p+1);this.maskWord(f+c,y,i);continue}this.maskWord(f+c,zt(p,32-p),i);for(let y=c+1;y<d;y++)s[f+y]=4294967295,a[f+y]=i?4294967295:0;this.maskWord(f+d,zt(0,h+1),i)}}rectWords(t,n,o,r,i){for(let a=0;a<r;a++){const s=n+a;for(let l=0;l<o;){const c=t+l,{bit:d,word:p}=this.bitIndex(c,s),h=Math.min(32-d,o-l);i(p,c,l,a,h),l+=h}}}rect(t,n,o){const{x:r,y:i}=this.xy(t),{height:a,width:s}=Ne.size(n,this.size({x:r,y:i}));if(typeof o!="function")return this.fillRectConst(r,i,s,a,o),this;const{defined:l,value:c}=this;return this.rectWords(r,i,s,a,(d,p,h,m,f)=>{let y=0,b=c[d];for(let v=0;v<f;v++){const C=Un(p+v),_=o({x:h+v,y:m},(b&C)!==0);_!==void 0&&(y|=C,b=b&~C|-_&C)}l[d]|=y,c[d]=b}),this}rectRead(t,n,o){const{x:r,y:i}=this.xy(t),{height:a,width:s}=Ne.size(n,this.size({x:r,y:i})),{value:l}=this;return this.rectWords(r,i,s,a,(c,d,p,h,m)=>{const f=l[c];for(let y=0;y<m;y++){const b=Un(d+y);o({x:p+y,y:h},(f&b)!==0)}}),this}hLine(t,n,o){return this.rect(t,{width:n,height:1},o)}vLine(t,n,o){return this.rect(t,{width:1,height:n},o)}border(t=2,n){const o=this.height+2*t,r=this.width+2*t,i=new Ne({height:o,width:r});return i.rect(0,1/0,n),i.embed({x:t,y:t},this),i}embed(t,n){const{x:o,y:r}=this.xy(t),{height:i,width:a}=Ne.size(n.size(),this.size({x:o,y:r}));if(a<=0||i<=0)return this;const{value:s,defined:l}=this,{words:c,value:d}=n;for(let p=0;p<i;p++){const h=p*c;for(let m=0;m<a;){const f=o+m,{word:y,bit:b}=this.bitIndex(f,r+p),{word:v,bit:C}=n.bitIndex(m,p),_=Math.min(32-b,a-m),S=d[v],E=C&&v+1<h+c?d[v+1]:0,k=C?(S>>>C|E<<32-C)>>>0:S,A=zt(b,_),$=(k&zt(0,_))<<b>>>0;l[y]|=A,s[y]=s[y]&~A|$,m+=_}}return this}rectSlice(t,n=this.size()){const{x:o,y:r}=this.xy(t),{height:i,width:a}=Ne.size(n,this.size({x:o,y:r})),s=new Ne({height:i,width:a});return this.rectRead({x:o,y:r},{height:i,width:a},(l,c)=>{this.isDefined(o+l.x,r+l.y)&&s.set(l.x,l.y,c)}),s}transpose(){const{height:t,width:n,value:o,defined:r,words:i}=this,a=new Ne({height:n,width:t}),{words:s,value:l,defined:c,tailMask:d}=a,p=new Uint32Array(32),h=new Uint32Array(32);for(let m=0;m<t;m+=32)for(let f=0;f<i;f++){const y=Math.min(32,t-m);for(let b=0;b<y;b++){const v=this.wordIndex(32*f,m+b);p[b]=o[v],h[b]=r[v]}p.fill(0,y),h.fill(0,y),ms(p),ms(h);for(let b=0;b<32;b++){const v=f*32+b;if(v>=n)break;const C=a.wordIndex(m,v),_=m>>>5===s-1?d:4294967295;l[C]=p[b]&_,c[C]=h[b]&_}}return a}negate(){const t=this.defined.length;for(let n=0;n<t;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:n,width:o}=this;return new Ne({height:t*n,width:t*o}).rect({x:0,y:0},1/0,({x:i,y:a})=>this.get(i/t|0,a/t|0))}clone(){const t=new Ne(this.size());return t.defined.set(this.defined),t.value.set(this.value),t}assertDrawn(){const{height:t,width:n,defined:o,tailMask:r,fullWords:i,words:a}=this;if(!(!t||!n))for(let s=0;s<t;s++){const l=s*a;for(let c=0;c<i;c++)if(o[l+c]!==4294967295)throw new Error("Invalid color type=undefined");if(a!==i&&(o[l+i]&r)!==r)throw new Error("Invalid color type=undefined")}}countPatternInRow(t,n,...o){if(n<=0||n>=32)throw new Error("wrong patternLen");const r=(1<<n)-1,{width:i,value:a,words:s}=this;let l=0;const c=this.wordIndex(0,t);for(let d=0,p=0;d<s;d++){const h=a[c+d],m=d===s-1&&i&31||32;for(let f=0;f<m;f++)if(p=(p<<1|h>>>f&1)&r,!(d*32+f+1<n)){for(const y of o)if(p===y){l++;break}}}return l}getRuns(t,n){const{width:o,value:r,words:i}=this;if(o===0)return;let a=0,s;const l=this.wordIndex(0,t);for(let c=0;c<i;c++){const d=r[l+c],p=c===i-1&&o&31||32;for(let h=0;h<p;h++){const m=(d&1<<h)!==0;if(m===s){a++;continue}s!==void 0&&n(a,s),s=m,a=1}}s!==void 0&&n(a,s)}popcnt(){const{height:t,width:n,words:o,fullWords:r,tailMask:i}=this;if(!t||!n)return 0;let a=0;for(let s=0;s<t;s++){const l=s*o;for(let c=0;c<r;c++)a+=Qr(this.value[l+c]);o!==r&&(a+=Qr(this.value[l+r]&i))}return a}countBoxes2x2(t){const{width:n,words:o}=this;if(n<2||(t|0)<0||t+1>=this.height)return 0;const r=this.wordIndex(0,t)|0,i=this.wordIndex(0,t+1)|0,s=(n&31)===0?2147483647:zt(0,n-1&31);let l=0;for(let c=0;c<o;c++){const d=this.value[r+c],p=this.value[i+c],h=~(d^p)>>>0,m=c+1<o?this.value[r+c+1]>>>0:0,f=~(d^(d>>>1|(m&1)<<31)>>>0)>>>0,y=c+1<o?this.value[i+c+1]>>>0:0,b=~(p^(p>>>1|(y&1)<<31)>>>0)>>>0;let v=(h&f&b)>>>0;c===o-1&&(v&=s),l+=Qr(v)}return l}toString(){const t=String.fromCharCode(Vn.newline);let n="";for(let o=0;o<this.height;o++){let r="";for(let i=0;i<this.width;i++){const a=this.get(i,o);r+=this.isDefined(i,o)?a?"X":" ":"?"}n+=r+(o+1===this.height?"":t)}return n}toRaw(){const t=Array.from({length:this.height},()=>new Array(this.width));for(let n=0;n<this.height;n++){const o=t[n];for(let r=0;r<this.width;r++)o[r]=this.get(r,n)}return t}toASCII(){const{height:t,width:n}=this;let o="";for(let r=0;r<t;r+=2){for(let i=0;i<n;i++){const a=this.get(i,r),s=r+1>=t?!0:this.get(i,r+1);!a&&!s?o+="█":!a&&s?o+="▀":a&&!s?o+="▄":a&&s&&(o+=" ")}o+=String.fromCharCode(Vn.newline)}return o}toTerm(){const t=String.fromCharCode(Vn.reset),n=t+"[0m",o=t+"[1;47m "+n,r=t+"[40m "+n,i=String.fromCharCode(Vn.newline);let a="";for(let s=0;s<this.height;s++){for(let l=0;l<this.width;l++){const c=this.get(l,s);a+=c?r:o}a+=i}return a}toSVG(t=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,o="",r;return this.rectRead(0,1/0,(i,a)=>{if(!a)return;const{x:s,y:l}=i;if(!t){n+=`<rect x="${s}" y="${l}" width="1" height="1" />`;return}let c=`M${s} ${l}`;if(r){const p=`m${s-r.x} ${l-r.y}`;p.length<=c.length&&(c=p)}const d=s<10?`H${s}`:"h-1";o+=`${c}h1v1${d}Z`,r=i}),t&&(n+=`<path d="${o}"/>`),n+="</svg>",n}toGIF(){const t=s=>[s&255,s>>>8&255],n=[...t(this.width),...t(this.height)],o=[];this.rectRead(0,1/0,(s,l)=>o.push(+(l===!0)));const r=126,i=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...vt(381,0),44,0,0,0,0,...n,0,7],a=Math.floor(o.length/r);for(let s=0;s<a;s++)i.push(r+1,128,...o.slice(r*s,r*(s+1)).map(l=>+l));return i.push(o.length%r+1,128,...o.slice(a*r).map(s=>+s)),i.push(1,129,0,59),new Uint8Array(i)}toImage(t=!1){const{height:n,width:o}=this.size(),r=new Uint8Array(n*o*(t?3:4));let i=0;for(let a=0;a<n;a++)for(let s=0;s<o;s++){const l=this.get(s,a)?0:255;r[i++]=l,r[i++]=l,r[i++]=l,t||(r[i++]=255)}return{height:n,width:o,data:r}}}const fs=["low","medium","quartile","high"],ys=["numeric","alphanumeric","byte","kanji","eci"],$u=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],Fu={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},Mu={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},xe={size:{encode:e=>21+4*(e-1),decode:e=>(e-17)/4},sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=6,n=xe.size.encode(e)-t-1,o=n-t,r=Math.ceil(o/28);let i=Math.floor(o/r);i%2?i+=1:o%r*2>=r&&(i+=2);const a=[t];for(let s=1;s<r;s++)a.push(n-(r-s)*i);return a.push(n),a},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(e,t){const n=xe.ECCode[e]<<3|t;let o=n;for(let r=0;r<10;r++)o=o<<1^(o>>9)*1335;return(n<<10|o)^xe.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^(t>>11)*7973;return e<<12|t},alphabet:{numeric:ps("0123456789"),alphanumerc:ps("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits(e,t){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[t][xe.sizeType(e)]},modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(e,t){const n=$u[e-1],o=Fu[t][e-1],r=Mu[t][e-1],i=Math.floor(n/r)-o,a=r-n%r;return{words:o,numBlocks:r,shortBlocks:a,blockLen:i,capacity:(n-o*r)*8,total:(o+i)*r+r-a}}},Jr=[(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0],x={tables:(e=>{const t=vt(256,0),n=vt(256,0);for(let o=0,r=1;o<256;o++)t[o]=r,n[r]=o,r<<=1,r&256&&(r^=e);return{exp:t,log:n}})(285),exp:e=>x.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: invalid arg=${e}`);return x.tables.log[e]%255},mul(e,t){return e===0||t===0?0:x.tables.exp[(x.tables.log[e]+x.tables.log[t])%255]},add:(e,t)=>e^t,pow:(e,t)=>x.tables.exp[x.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: invalid arg=${e}`);return x.tables.exp[255-x.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: invalid length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: invalid degree=${e}`);if(t==0)return[0];let n=vt(e+1,0);return n[0]=t,x.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[x.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=vt(e.length+t.length-1,0);for(let o=0;o<e.length;o++)for(let r=0;r<t.length;r++)n[o+r]=x.add(n[o+r],x.mul(e[o],t[r]));return x.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=vt(e.length,0);for(let o=0;o<e.length;o++)n[o]=x.mul(e[o],t);return x.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(n==0)return[0];const o=vt(e.length+t,0);for(let r=0;r<e.length;r++)o[r]=x.mul(e[r],n);return x.polynomial(o)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,o=t;n.length>o.length&&([n,o]=[o,n]);let r=vt(o.length,0),i=o.length-n.length,a=o.slice(0,i);for(let s=0;s<a.length;s++)r[s]=a[s];for(let s=i;s<o.length;s++)r[s]=x.add(n[s-i],o[s]);return x.polynomial(r)},remainderPoly(e,t){const n=Array.from(e);for(let o=0;o<e.length-t.length+1;o++){const r=n[o];if(r!==0)for(let i=1;i<t.length;i++)t[i]!==0&&(n[o+i]=x.add(n[o+i],x.mul(t[i],r)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=x.mulPoly(t,[1,x.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return x.coefficient(e,0);let n=e[0];for(let o=1;o<e.length;o++)n=x.add(x.mul(t,n),e[o]);return n},euclidian(e,t,n){x.degree(e)<x.degree(t)&&([e,t]=[t,e]);let o=e,r=t,i=[0],a=[1];for(;2*x.degree(r)>=n;){let c=o,d=i;if(o=r,i=a,o[0]===0)throw new Error("rLast[0] === 0");r=c;let p=[0];const h=x.inv(o[0]);for(;x.degree(r)>=x.degree(o)&&r[0]!==0;){const m=x.degree(r)-x.degree(o),f=x.mul(r[0],h);p=x.addPoly(p,x.monomial(m,f)),r=x.addPoly(r,x.mulPolyMonomial(o,m,f))}if(p=x.mulPoly(p,i),a=x.addPoly(p,d),x.degree(r)>=x.degree(o))throw new Error(`Division failed r: ${r}, rLast: ${o}`)}const s=x.coefficient(a,0);if(s==0)throw new Error("sigmaTilde(0) was zero");const l=x.inv(s);return[x.mulPolyScalar(a,l),x.mulPolyScalar(r,l)]}};function Lu(e){return{encode(t){const n=x.divisorPoly(e),o=Array.from(t);return o.push(...n.slice(0,-1).fill(0)),Uint8Array.from(x.remainderPoly(o,n))},decode(t){const n=t.slice(),o=x.polynomial(Array.from(t));let r=vt(e,0),i=!1;for(let p=0;p<e;p++){const h=x.evalPoly(o,x.exp(p));r[r.length-1-p]=h,h!==0&&(i=!0)}if(!i)return n;r=x.polynomial(r);const a=x.monomial(e,1),[s,l]=x.euclidian(a,r,e),c=vt(x.degree(s),0);let d=0;for(let p=1;p<256&&d<c.length;p++)x.evalPoly(s,p)===0&&(c[d++]=x.inv(p));if(d!==c.length)throw new Error("RS.decode: invalid errors number");for(let p=0;p<c.length;p++){const h=n.length-1-x.log(c[p]);if(h<0)throw new Error("RS.decode: invalid error location");const m=x.inv(c[p]);let f=1;for(let y=0;y<c.length;y++)p!==y&&(f=x.mul(f,x.add(1,x.mul(c[y],m))));n[h]=x.add(n[h],x.mul(x.evalPoly(l,m),x.inv(f)))}return n}}}function Ou(e,t){const{words:n,shortBlocks:o,numBlocks:r,blockLen:i,total:a}=xe.capacity(e,t),s=Lu(n);return{encode(l){const c=[],d=[];for(let f=0;f<r;f++){const y=f<o,b=i+(y?0:1);c.push(l.subarray(0,b)),d.push(s.encode(l.subarray(0,b))),l=l.subarray(b)}const p=hs(c),h=hs(d),m=new Uint8Array(p.length+h.length);return m.set(p),m.set(h,p.length),m},decode(l){if(l.length!==a)throw new Error(`interleave.decode: len(data)=${l.length}, total=${a}`);const c=[];for(let h=0;h<r;h++){const m=h<o;c.push(new Uint8Array(n+i+(m?0:1)))}let d=0;for(let h=0;h<i;h++)for(let m=0;m<r;m++)c[m][h]=l[d++];for(let h=o;h<r;h++)c[h][i]=l[d++];for(let h=i;h<i+n;h++)for(let m=0;m<r;m++){const f=m<o;c[m][h+(f?0:1)]=l[d++]}const p=[];for(const h of c)p.push(...Array.from(s.decode(h)).slice(0,-n));return Uint8Array.from(p)}}}function Bu(e,t,n,o=!1){const r=xe.size.encode(e);let i=new Ne(r+2);const a=new Ne(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);i=i.embed(0,a).embed({x:-a.width,y:0},a).embed({x:0,y:-a.height},a),i=i.rectSlice(1,r);const s=new Ne(1).rect(0,1,!0).border(1,!1).border(1,!0),l=xe.alignmentPatterns(e);for(const c of l)for(const d of l)i.isDefined(d,c)||i.embed({x:d-2,y:c-2},s);i=i.hLine({x:0,y:6},1/0,({x:c})=>i.isDefined(c,6)?void 0:c%2==0).vLine({x:6,y:0},1/0,({y:c})=>i.isDefined(6,c)?void 0:c%2==0);{const c=xe.formatBits(t,n),d=p=>!o&&(c>>p&1)==1;for(let p=0;p<6;p++)i.set(8,p,d(p));for(let p=6;p<8;p++)i.set(8,p+1,d(p));for(let p=8;p<15;p++)i.set(8,r-15+p,d(p));for(let p=0;p<8;p++)i.set(r-p-1,8,d(p));for(let p=8;p<9;p++)i.set(15-p-1+1,8,d(p));for(let p=9;p<15;p++)i.set(15-p-1,8,d(p));i.set(8,r-8,!o)}if(e>=7){const c=xe.versionBits(e);for(let d=0;d<18;d+=1){const p=!o&&(c>>d&1)==1,h=Math.floor(d/3),m=d%3+r-8-3;i.set(m,h,p),i.set(h,m,p)}}return i}function Vu(e,t,n){const o=e.height,r=Jr[t];let i=-1,a=o-1;for(let s=o-1;s>0;s-=2){for(s==6&&(s=5);;a+=i){for(let l=0;l<2;l+=1){const c=s-l;e.isDefined(c,a)||n(c,a,r(c,a))}if(a+i<0||a+i>=o)break}i=-i}}function Uu(e){let t="numeric";for(let n of e)if(!xe.alphabet.numeric.has(n)&&(t="alphanumeric",!xe.alphabet.alphanumerc.has(n)))return"byte";return t}function Hu(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function gs(e,t,n,o,r=Hu){let i="",a=n.length;if(o==="numeric"){const h=xe.alphabet.numeric.decode(n.split("")),m=h.length;for(let f=0;f<m-2;f+=3)i+=jt(h[f]*100+h[f+1]*10+h[f+2],10);m%3===1?i+=jt(h[m-1],4):m%3===2&&(i+=jt(h[m-2]*10+h[m-1],7))}else if(o==="alphanumeric"){const h=xe.alphabet.alphanumerc.decode(n.split("")),m=h.length;for(let f=0;f<m-1;f+=2)i+=jt(h[f]*45+h[f+1],11);m%2==1&&(i+=jt(h[m-1],6))}else if(o==="byte"){const h=r(n);a=h.length,i=Array.from(h).map(m=>jt(m,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:s}=xe.capacity(e,t),l=jt(a,xe.lengthBits(e,o));let c=xe.modeBits[o]+l+i;if(c.length>s)throw new Error("Capacity overflow");c+="0".repeat(Math.min(4,Math.max(0,s-c.length))),c.length%8&&(c+="0".repeat(8-c.length%8));const d="1110110000010001";for(let h=0;c.length!==s;h++)c+=d[h%d.length];const p=Uint8Array.from(c.match(/(.{8})/g).map(h=>+`0b${h}`));return Ou(e,t).encode(p)}function bs(e,t,n,o,r=!1){const i=Bu(e,t,o,r);let a=0;const s=8*n.length;if(Vu(i,o,(l,c,d)=>{let p=!1;a<s&&(p=(n[a>>>3]>>(7-a&7)&1)!==0,a++),i.set(l,c,p!==d)}),a!==s)throw new Error("QR: bytes left after draw");return i}const vs=e=>{const t=e.map(n=>n?"1":"0").join("");return{len:t.length,n:+`0b${t}`}},Cs=[!0,!1,!0,!0,!0,!1,!0],_s=[!1,!1,!1,!1],Lo=vs([...Cs,..._s]),ws=vs([..._s,...Cs]);function Ku(e){const{width:t,height:n}=e,o=e.transpose();let r=0;for(let d=0;d<n;d++)e.getRuns(d,p=>{p>=5&&(r+=3+(p-5))});for(let d=0;d<t;d++)o.getRuns(d,p=>{p>=5&&(r+=3+(p-5))});let i=0;for(let d=0;d<n-1;d++)i+=3*e.countBoxes2x2(d);let a=0;for(let d=0;d<n;d++)a+=40*e.countPatternInRow(d,Lo.len,Lo.n,ws.n);for(let d=0;d<t;d++)a+=40*o.countPatternInRow(d,Lo.len,Lo.n,ws.n);let s=0;s=e.popcnt();const l=s/(n*t)*100,c=10*Math.floor(Math.abs(l-50)/5);return r+i+a+c}function ju(e,t,n,o){if(o===void 0){const r=Ru();for(let i=0;i<Jr.length;i++)r.add(Ku(bs(e,t,n,i,!0)),i);o=r.get()}if(o===void 0)throw new Error("Cannot find mask");return bs(e,t,n,o)}function zu(e){if(!fs.includes(e))throw new Error(`Invalid error correction mode=${e}. Expected: ${fs}`)}function qu(e){if(!ys.includes(e))throw new Error(`Encoding: invalid mode=${e}. Expected: ${ys}`);if(e==="kanji"||e==="eci")throw new Error(`Encoding: ${e} is not supported (yet?).`)}function Wu(e){if(![0,1,2,3,4,5,6,7].includes(e)||!Jr[e])throw new Error(`Invalid mask=${e}. Expected number [0..7]`)}function Gu(e,t="raw",n={}){const o=n.ecc!==void 0?n.ecc:"medium";zu(o);const r=n.encoding!==void 0?n.encoding:Uu(e);qu(r),n.mask!==void 0&&Wu(n.mask);let i=n.version,a,s=new Error("Unknown error");if(i!==void 0)Iu(i),a=gs(i,o,e,r,n.textEncoder);else for(let d=1;d<=40;d++)try{a=gs(d,o,e,r,n.textEncoder),i=d;break}catch(p){s=p}if(!i||!a)throw s;let l=ju(i,o,a,n.mask);l.assertDrawn();const c=n.border===void 0?2:n.border;if(!Number.isSafeInteger(c))throw new Error(`invalid border type=${typeof c}`);if(l=l.border(c,!1),n.scale!==void 0&&(l=l.scale(n.scale)),t==="raw")return l.toRaw();if(t==="ascii")return l.toASCII();if(t==="svg")return l.toSVG(n.optimize);if(t==="gif")return l.toGIF();if(t==="term")return l.toTerm();throw new Error(`Unknown output: ${t}`)}const Yu=new Set(["Authorised","Scheduled","Processing Settlement","Settled","Paid Out"]),Ss=new Set(["Cancelled","Failed"]),Zu=new Set(["SUCCEEDED","REQUIRES_CAPTURE"]),Qu=new Set(["CANCELLED"]),Ju=new Set(["AUTHORIZED","CAPTURED","SETTLED"]),ks=new Set(["FAILED","CANCELLED","EXPIRED","AUTHENTICATION_FAILED"]);function Xu(e){const t=e.payment?.transactionStatus,n=e.paymentIntent?.status,o=e.paymentAttempt?.status;return t&&Yu.has(t)||n&&Zu.has(n)||typeof o=="string"&&Ju.has(o)?"success":t&&Ss.has(t)||n&&Qu.has(n)||typeof o=="string"&&ks.has(o)?"failed":"pending"}function eh(e){const t=e.payment?.transactionStatus,n=e.paymentAttempt?.status;return t&&Ss.has(t)?t:typeof n=="string"&&ks.has(n)?n:"Failed"}const th={card:"card",paynow:"qr",wechatpay:"qr",applepay:"wallet",googlepay:"wallet",alipay:"alipay",alipaycn:"alipay",alipayhk:"alipay"};function Es(e){return th[e.toLowerCase()]??"redirect"}function nh(e){return e==="applepay"||e==="googlepay"}function oh(e){return e==="paynow"||e==="wechatpay"}function xs(e){return e==="alipay"||e==="alipaycn"||e==="alipayhk"}var Hn,ee,Ps,Rt,Ts,Ds,Ns,Xr,Oo,Kn,As,ei,ti,ni,Is,Bo={},Vo=[],rh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,jn=Array.isArray;function Ct(e,t){for(var n in t)e[n]=t[n];return e}function oi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function u(e,t,n){var o,r,i,a={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?Hn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return zn(e,a,o,r,null)}function zn(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Ps,__i:-1,__u:0};return r==null&&ee.vnode!=null&&ee.vnode(i),i}function ih(){return{current:null}}function G(e){return e.children}function Ae(e,t){this.props=e,this.context=t}function mn(e,t){if(t==null)return e.__?mn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?mn(e):null}function ah(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],r=[],i=Ct({},t);i.__v=t.__v+1,ee.vnode&&ee.vnode(i),ii(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??mn(t),!!(32&t.__u),r),i.__v=t.__v,i.__.__k[i.__i]=i,Bs(o,i,r),t.__e=t.__=null,i.__e!=n&&Rs(i)}}function Rs(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Rs(e)}function ri(e){(!e.__d&&(e.__d=!0)&&Rt.push(e)&&!Uo.__r++||Ts!=ee.debounceRendering)&&((Ts=ee.debounceRendering)||Ds)(Uo)}function Uo(){try{for(var e,t=1;Rt.length;)Rt.length>t&&Rt.sort(Ns),e=Rt.shift(),t=Rt.length,ah(e)}finally{Rt.length=Uo.__r=0}}function $s(e,t,n,o,r,i,a,s,l,c,d){var p,h,m,f,y,b,v,C=o&&o.__k||Vo,_=t.length;for(l=sh(n,t,C,l,_),p=0;p<_;p++)(m=n.__k[p])!=null&&(h=m.__i!=-1&&C[m.__i]||Bo,m.__i=p,b=ii(e,m,h,r,i,a,s,l,c,d),f=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&ai(h.ref,null,m),d.push(m.ref,m.__c||f,m)),y==null&&f!=null&&(y=f),(v=!!(4&m.__u))||h.__k===m.__k?(l=Fs(m,l,e,v),v&&h.__e&&(h.__e=null)):typeof m.type=="function"&&b!==void 0?l=b:f&&(l=f.nextSibling),m.__u&=-7);return n.__e=y,l}function sh(e,t,n,o,r){var i,a,s,l,c,d=n.length,p=d,h=0;for(e.__k=new Array(r),i=0;i<r;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=zn(null,a,null,null,null):jn(a)?a=e.__k[i]=zn(G,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=zn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+h,a.__=e,a.__b=e.__b+1,s=null,(c=a.__i=lh(a,n,l,p))!=-1&&(p--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(r>d?h--:r<d&&h++),typeof a.type!="function"&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<d;i++)(s=n[i])!=null&&!(2&s.__u)&&(s.__e==o&&(o=mn(s)),Us(s,s));return o}function Fs(e,t,n,o){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Fs(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=mn(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ho(e,t){return t=t||[],e==null||typeof e=="boolean"||(jn(e)?e.some(function(n){Ho(n,t)}):t.push(e)),t}function lh(e,t,n,o){var r,i,a,s=e.key,l=e.type,c=t[n],d=c!=null&&!(2&c.__u);if(c===null&&s==null||d&&s==c.key&&l==c.type)return n;if(o>(d?1:0)){for(r=n-1,i=n+1;r>=0||i<t.length;)if((c=t[a=r>=0?r--:i++])!=null&&!(2&c.__u)&&s==c.key&&l==c.type)return a}return-1}function Ms(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||rh.test(t)?n:n+"px"}function Ko(e,t,n,o,r){var i,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Ms(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ms(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(As,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[Kn]=o[Kn]:(n[Kn]=ei,e.addEventListener(t,i?ni:ti,i)):e.removeEventListener(t,i?ni:ti,i);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ls(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Oo]==null)t[Oo]=ei++;else if(t[Oo]<n[Kn])return;return n(ee.event?ee.event(t):t)}}}function ii(e,t,n,o,r,i,a,s,l,c){var d,p,h,m,f,y,b,v,C,_,S,E,k,A,$,N,L=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(d=ee.__b)&&d(t);e:if(typeof L=="function"){p=a.length;try{if(C=t.props,_=L.prototype&&L.prototype.render,S=(d=L.contextType)&&o[d.__c],E=d?S?S.props.value:d.__:o,n.__c?v=(h=t.__c=n.__c).__=h.__E:(_?t.__c=h=new L(C,E):(t.__c=h=new Ae(C,E),h.constructor=L,h.render=dh),S&&S.sub(h),h.state||(h.state={}),h.__n=o,m=h.__d=!0,h.__h=[],h._sb=[]),_&&h.__s==null&&(h.__s=h.state),_&&L.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ct({},h.__s)),Ct(h.__s,L.getDerivedStateFromProps(C,h.__s))),f=h.props,y=h.state,h.__v=t,m)_&&L.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),_&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(_&&L.getDerivedStateFromProps==null&&C!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(C,E),t.__v==n.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(C,h.__s,E)===!1){t.__v!=n.__v&&(h.props=C,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t)}),Vo.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(C,h.__s,E),_&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,y,b)})}if(h.context=E,h.props=C,h.__P=e,h.__e=!1,k=ee.__r,A=0,_)h.state=h.__s,h.__d=!1,k&&k(t),d=h.render(h.props,h.state,h.context),Vo.push.apply(h.__h,h._sb),h._sb=[];else do h.__d=!1,k&&k(t),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++A<25);h.state=h.__s,h.getChildContext!=null&&(o=Ct(Ct({},o),h.getChildContext())),_&&!m&&h.getSnapshotBeforeUpdate!=null&&(b=h.getSnapshotBeforeUpdate(f,y)),$=d!=null&&d.type===G&&d.key==null?Vs(d.props.children):d,s=$s(e,jn($)?$:[$],t,n,o,r,i,a,s,l,c),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),v&&(h.__E=h.__=null)}catch(U){if(a.length=p,t.__v=null,l||i!=null){if(U.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else if(i!=null)for(N=i.length;N--;)oi(i[N])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),U.then||Os(t),ee.__e(U,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ch(n.__e,t,n,o,r,i,a,l,c);return(d=ee.diffed)&&d(t),128&t.__u?void 0:s}function Os(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Os))}function Bs(e,t,n){for(var o=0;o<n.length;o++)ai(n[o],n[++o],n[++o]);ee.__c&&ee.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){ee.__e(i,r.__v)}})}function Vs(e){return typeof e!="object"||e==null||e.__b>0?e:jn(e)?e.map(Vs):e.constructor!==void 0?null:Ct({},e)}function ch(e,t,n,o,r,i,a,s,l){var c,d,p,h,m,f,y,b=n.props||Bo,v=t.props,C=t.type;if(C=="svg"?r="http://www.w3.org/2000/svg":C=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((m=i[c])&&"setAttribute"in m==!!C&&(C?m.localName==C:m.nodeType==3)){e=m,i[c]=null;break}}if(e==null){if(C==null)return document.createTextNode(v);e=document.createElementNS(r,C,v.is&&v),s&&(ee.__m&&ee.__m(t,i),s=!1),i=null}if(C==null)b===v||s&&e.data==v||(e.data=v);else{if(i=C=="textarea"&&v.defaultValue!=null?null:i&&Hn.call(e.childNodes),!s&&i!=null)for(b={},c=0;c<e.attributes.length;c++)b[(m=e.attributes[c]).name]=m.value;for(c in b)m=b[c],c=="dangerouslySetInnerHTML"?p=m:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||Ko(e,c,null,m,r);for(c in v)m=v[c],c=="children"?h=m:c=="dangerouslySetInnerHTML"?d=m:c=="value"?f=m:c=="checked"?y=m:s&&typeof m!="function"||b[c]===m||Ko(e,c,m,b[c],r);if(d)s||p&&(d.__html==p.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),$s(t.type=="template"?e.content:e,jn(h)?h:[h],t,n,o,C=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&mn(n,0),s,l),i!=null)for(c=i.length;c--;)oi(i[c]);s&&C!="textarea"||(c="value",C=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[c]||C=="progress"&&!f||C=="option"&&f!=b[c])&&Ko(e,c,f,b[c],r),c="checked",y!=null&&y!=e[c]&&Ko(e,c,y,b[c],r))}return e}function ai(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){ee.__e(r,n)}}function Us(e,t,n){var o,r;if(ee.unmount&&ee.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||ai(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){ee.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&Us(o[r],t,n||typeof e.type!="function");n||oi(e.__e),e.__c=e.__=e.__e=void 0}function dh(e,t,n){return this.constructor(e,n)}function Hs(e,t,n){var o,r,i;t==document&&(t=document.documentElement),ee.__&&ee.__(e,t),o=t.__k,r=[],i=[],ii(t,e=t.__k=u(G,null,[e]),o||Bo,Bo,t.namespaceURI,o?null:t.firstChild?Hn.call(t.childNodes):null,r,o?o.__e:t.firstChild,!1,i),Bs(r,e,i),e.props.children=null}function uh(e,t,n){var o,r,i,a,s=Ct({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?o=t[i]:i=="ref"?r=t[i]:s[i]=t[i]===void 0&&a!=null?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?Hn.call(arguments,2):n),zn(e.type,s,o||e.key,r||e.ref,null)}function jo(e){function t(n){var o,r;return this.getChildContext||(o=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&o.forEach(function(a){a.__e=!0,ri(a)})},this.sub=function(i){o.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){o&&o.delete(i),a&&a.call(i)}}),n.children}return t.__c="__cC"+Is++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,o){return n.children(o)}).contextType=t,t}Hn=Vo.slice,ee={__e:function(e,t,n,o){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),a=r.__d),a)return r.__E=r}catch(s){e=s}throw e}},Ps=0,Ae.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ct({},this.state),typeof e=="function"&&(e=e(Ct({},n),this.props)),e&&Ct(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ri(this))},Ae.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ri(this))},Ae.prototype.render=G,Rt=[],Ds=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ns=function(e,t){return e.__v.__b-t.__v.__b},Uo.__r=0,Xr=Math.random().toString(8),Oo="__d"+Xr,Kn="__a"+Xr,As=/(PointerCapture)$|Capture$/i,ei=0,ti=Ls(!1),ni=Ls(!0),Is=0;var qt,oe,si,Ks,fn=0,js=[],he=ee,zs=he.__b,qs=he.__r,Ws=he.diffed,Gs=he.__c,Ys=he.unmount,Zs=he.__;function qn(e,t){he.__h&&he.__h(oe,e,fn||t),fn=0;var n=oe.__H||(oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function w(e){return fn=1,Qs(Xs,e)}function Qs(e,t,n){var o=qn(qt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Xs(void 0,t),function(s){var l=o.__N?o.__N[0]:o.__[0],c=o.t(l,s);l!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=oe,!oe.__f)){var r=function(s,l,c){if(!o.__c.__H)return!0;var d=!1,p=o.__c.props!==s;if(o.__c.__H.__.some(function(m){if(m.__N){d=!0;var f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(p=!0)}}),i){var h=i.call(this,s,l,c);return d?h||p:h}return!d||p};oe.__f=!0;var i=oe.shouldComponentUpdate,a=oe.componentWillUpdate;oe.componentWillUpdate=function(s,l,c){if(this.__e){var d=i;i=void 0,r(s,l,c),i=d}a&&a.call(this,s,l,c)},oe.shouldComponentUpdate=r}return o.__N||o.__}function R(e,t){var n=qn(qt++,3);!he.__s&&di(n.__H,t)&&(n.__=e,n.u=t,oe.__H.__h.push(n))}function li(e,t){var n=qn(qt++,4);!he.__s&&di(n.__H,t)&&(n.__=e,n.u=t,oe.__h.push(n))}function W(e){return fn=5,te(function(){return{current:e}},[])}function hh(e,t,n){fn=6,li(function(){if(typeof e=="function"){var o=e(t());return function(){e(null),o&&typeof o=="function"&&o()}}if(e)return e.current=t(),function(){return e.current=null}},n)}function te(e,t){var n=qn(qt++,7);return di(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function T(e,t){return fn=8,te(function(){return e},t)}function Wt(e){var t=oe.context[e.__c],n=qn(qt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(oe)),t.props.value):e.__}function ph(){for(var e;e=js.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(zo),t.__h.some(ci),t.__h=[]}catch(n){t.__h=[],he.__e(n,e.__v)}}}he.__b=function(e){oe=null,zs&&zs(e)},he.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Zs&&Zs(e,t)},he.__r=function(e){qs&&qs(e),qt=0;var t=(oe=e.__c).__H;t&&(si===oe?(t.__h=[],oe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(zo),t.__h.some(ci),t.__h=[],qt=0)),si=oe},he.diffed=function(e){Ws&&Ws(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(js.push(t)!==1&&Ks===he.requestAnimationFrame||((Ks=he.requestAnimationFrame)||mh)(ph)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),si=oe=null},he.__c=function(e,t){t.some(function(n){try{n.__h.some(zo),n.__h=n.__h.filter(function(o){return!o.__||ci(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],he.__e(o,n.__v)}}),Gs&&Gs(e,t)},he.unmount=function(e){Ys&&Ys(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{zo(o)}catch(r){t=r}}),n.__H=void 0,t&&he.__e(t,n.__v))};var Js=typeof requestAnimationFrame=="function";function mh(e){var t,n=function(){clearTimeout(o),Js&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Js&&(t=requestAnimationFrame(n))}function zo(e){var t=oe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),oe=t}function ci(e){var t=oe;e.__c=e.__(),oe=t}function di(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Xs(e,t){return typeof t=="function"?t(e):t}const fh="encrypted",H="encryptedCardNumber",z="encryptedExpiryDate",X="encryptedExpiryMonth",Z="encryptedExpiryYear",j="encryptedSecurityCode",et="encryptedPassword",ui="encryptedSecurityCode3digits",hi="encryptedSecurityCode4digits",pi="giftcard",yh="6.3.0",Wn=["amex","mc","visa"],gh=[pi],bh=[H,z,X,Z,j,et],vh=bh,Ch=["bcmc"],el="required",mi="optional",fi="hidden",$t=el,Gn=mi,qo=fi,Pt=el,Yn=mi,yn=fi,tl="data-cse",nl="data-info",ol="data-uid",rl=["accel","pulse","star","nyce"],_h={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},Wo={[H]:"cardNumber",[z]:"expiryDate",[j]:"securityCode",[X]:"expiryMonth",[Z]:"expiryYear",[et]:"password",[ui]:"securityCodeThreeDigits",[hi]:"securityCodeFourDigits"},wh=6e3,Sh="bin-lookup",Go="-ariaError",Yo="-ariaContext",il="focusField",al="notValidating:blurScenario",tt="field.error.required",kh="field.error.invalid",yi="invalid.format.expects",gi="creditCard.holderName.invalid",bi="creditCard.taxNumber.invalid",sl="boleto.socialSecurityNumber.invalid";var gn=(function(e){return e.CC_NUM="cc.num",e.CC_DAT="cc.dat",e.CC_MTH="cc.mth",e.CC_YR="cc.yr",e.CC_CVC="cc.cvc",e.KCP_PWD="kcp.pwd",e})({}),Ft=(function(e){return e.ERROR_MSG_INCOMPLETE_FIELD="err.gen.9100",e.ERROR_MSG_INVALID_FIELD="err.gen.9101",e.ERROR_MSG_LUHN_CHECK_FAILED="cc.num.902",e.ERROR_MSG_EMPTY_PAN="cc.num.900",e.ERROR_MSG_UNSUPPORTED_CARD_ENTERED="cc.num.903",e.ERROR_MSG_INCORRECTLY_FILLED_PAN="cc.num.901",e.ERROR_MSG_CARD_TOO_OLD="cc.dat.912",e.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE="cc.dat.913",e.ERROR_MSG_CARD_EXPIRES_TOO_SOON="cc.dat.914",e.ERROR_MSG_EMPTY_DATE="cc.dat.910",e.ERROR_MSG_INCORRECTLY_FILLED__DATE="cc.dat.911",e.ERROR_MSG_EMPTY_YEAR="cc.yr.917",e.ERROR_MSG_INCORRECTLY_FILLED_YEAR="cc.yr.918",e.ERROR_MSG_EMPTY_MONTH="cc.mth.915",e.ERROR_MSG_EMPTY_CVC="cc.cvc.920",e.ERROR_MSG_INCORRECTLY_FILLED_CVC="cc.cvc.921",e.ERROR_MSG_EMPTY_CVC_AMEX="cc.cvc.920.amex",e.ERROR_MSG_INCORRECTLY_FILLED_CVC_AMEX="cc.cvc.921.amex",e.ERROR_MSG_EMPTY_KCP_PWD="kcp.pwd.940",e.ERROR_MSG_INCORRECTLY_FILLED_KCP_PWD="kcp.pwd.941",e})({});const Eh={[H]:"cc.num.900",[z]:"cc.dat.910",[X]:"cc.mth.915",[Z]:"cc.yr.917",[j]:"cc.cvc.920",[et]:"kcp.pwd.940"},xh=e=>e?Array.prototype.slice.call(e.querySelectorAll('[data-cse*="encrypted"]')).map(t=>t.getAttribute("data-cse")):[],Ph=(e,t)=>(t===z?(e[X]=!1,e[Z]=!1):e[t]=!1,e),Th=(e,t)=>(n,o)=>{let r=t.valid[o]!==!0?((i,a)=>a!==1||i!==X&&i!==Z?i:z)(o,e):null;return r=((i,a,s)=>{const{isFieldOfType:l,fieldIsValid:c}=s.reduce((m,f)=>(m.isFieldOfType||(m.isFieldOfType=i===f,m.fieldIsValid=!a.errors?.[f]),m),{isFieldOfType:!1,fieldIsValid:!1}),d=i===j?"cvcPolicy":"expiryDatePolicy",p=d==="cvcPolicy"?Gn:Yn,h=d==="cvcPolicy"?qo:yn;return(a[d]===p||a[d]===h)&&c&&l?null:i})(r,t,[j,z,X,Z]),r&&!n.includes(r)&&n.push(r),n},Dh=(e,t,n)=>({rootNode:t,fieldType:e,error:n.errors?.[e]||Eh[e],type:"card"});function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Nh=class{constructor(t){K(this,"callbacks",void 0),K(this,"config",void 0),K(this,"props",void 0),K(this,"state",void 0),K(this,"validateForm",void 0),K(this,"handleBrandFromBinLookup",void 0),K(this,"callbacksHandler",void 0),K(this,"configHandler",void 0),K(this,"createCardSecuredFields",void 0),K(this,"createNonCardSecuredFields",void 0),K(this,"createSecuredFields",void 0),K(this,"destroySecuredFields",void 0),K(this,"handleIOSTouchEvents",void 0),K(this,"destroyTouchendListener",void 0),K(this,"destroyTouchstartListener",void 0),K(this,"handleBinValue",void 0),K(this,"handleEncryption",void 0),K(this,"handleFocus",void 0),K(this,"handleIframeConfigFeedback",void 0),K(this,"handleValidation",void 0),K(this,"handleSFShiftTab",void 0),K(this,"handleShiftTab",void 0),K(this,"isConfigured",void 0),K(this,"postMessageToAllIframes",void 0),K(this,"processAutoComplete",void 0),K(this,"processBrand",void 0),K(this,"sendBrandToCardSF",void 0),K(this,"sendExpiryDatePolicyToSF",void 0),K(this,"setFocusOnFrame",void 0),K(this,"setupSecuredField",void 0),K(this,"touchendListener",void 0),K(this,"touchstartListener",void 0),K(this,"hasGenuineTouchEvents",void 0),K(this,"encryptedAttrName",void 0),K(this,"hasRedundantCVCField",void 0),K(this,"isSingleBrandedCard",void 0),K(this,"securityCode",void 0),this.props=t,this.state={},this.config={},this.callbacks={}}};const ll=Object.prototype.toString;function Zo(e){return typeof e=="object"&&e!==null&&Object.prototype.toString.call(e)==="[object Array]"}function Tt(e){return e!=null}function Qo(e){return e!==!1&&Tt(e)}function vi(e){return!!e&&typeof e=="object"}function cl(e){return!Qo(e)||!(!(typeof(t=e)=="number"||vi(t)&&ll.call(t)==="[object Number]")||e!==0&&!Number.isNaN(e))||!(!Zo(e)&&!(function(n){return typeof n=="string"||vi(n)&&ll.call(n)==="[object String]"})(e)||e.length!==0)||!(!vi(e)||Object.keys(e).length!==0);var t}function Ah(e){return!cl(e)}function Ci(...e){const t=Zo(e[0])?e[0]:e;return{from:n=>t.map(o=>o in n?{[o]:n[o]}:{}).reduce((o,r)=>({...o,...r}),{})}}function _i(...e){const t=Zo(e[0])?e[0]:e;return{from:n=>Ci(...Object.keys(n).filter(o=>!t.includes(o))).from(n)}}const Ih=e=>Zo(e)&&e.length?e:Wn;let wi=typeof window<"u"&&window.console&&window.console.error&&window.console.error.bind(window.console);typeof window<"u"&&window.console&&window.console.info&&window.console.info.bind(window.console);let Si=typeof window<"u"&&window.console&&window.console.log&&window.console.log.bind(window.console),Gt=typeof window<"u"&&window.console&&window.console.warn&&window.console.warn.bind(window.console);function Rh(e){this.config.cardGroupTypes=Ih(e.cardGroupTypes);const t=e.loadingContext;if(!t)return void Gt("WARNING Config :: no loadingContext has been specified!");var n;this.config.loadingContext=(n=t).charAt(n.length-1)==="/"?t:`${t}/`,this.config.isCreditCardType=gh.includes(e.type)===!1,this.config.iframeUIConfig=e.iframeUIConfig??{},this.config.autoFocus=!(e.autoFocus===!1||e.autoFocus==="false"),this.config.showWarnings=e.showWarnings===!0||e.showWarnings==="true",this.config.trimTrailingSeparator=!(e.trimTrailingSeparator===!1||e.trimTrailingSeparator==="false"),this.config.keypadFix=!(e.keypadFix===!1||e.keypadFix==="false"),this.config.legacyInputMode=e.legacyInputMode||null,this.config.minimumExpiryDate=e.minimumExpiryDate||null,this.config.sfLogAtStart=window._b$dl===!0;const o=this.config.isCreditCardType?"card":e.type,r=btoa(window.location.origin),i=`${o}${!this.config.loadingContext.includes("live")&&e.forceCompat?"Compat":""}`;this.config.iframeSrc=`${this.config.loadingContext}securedfields/${e.clientKey}/${yh}/securedFields.html?type=${i}&d=${r}`}const qe=()=>{};function $h(e={}){this.callbacks.onLoad=e.onLoad?e.onLoad:qe,this.callbacks.onConfigSuccess=e.onConfigSuccess?e.onConfigSuccess:qe,this.callbacks.onFieldValid=e.onFieldValid?e.onFieldValid:qe,this.callbacks.onAllValid=e.onAllValid?e.onAllValid:qe,this.callbacks.onBrand=e.onBrand?e.onBrand:qe,this.callbacks.onError=e.onError?e.onError:qe,this.callbacks.onFocus=e.onFocus?e.onFocus:qe,this.callbacks.onBinValue=e.onBinValue?e.onBinValue:qe,this.callbacks.onAutoComplete=e.onAutoComplete?e.onAutoComplete:qe,this.callbacks.onAdditionalSFConfig=e.onAdditionalSFConfig?e.onAdditionalSFConfig:qe,this.callbacks.onAdditionalSFRemoved=e.onAdditionalSFRemoved?e.onAdditionalSFRemoved:qe,this.callbacks.onTouchstartIOS=e.onTouchstartIOS?e.onTouchstartIOS:qe,this.callbacks.onKeyDown=e.onKeyDown?e.onKeyDown:qe}const dl=({fieldType:e,encryptedFieldName:t,uuid:n,isValid:o,txVariant:r,rootNode:i})=>({fieldType:e,encryptedFieldName:t,uid:n,valid:o,type:r,rootNode:i}),Fh=({fieldType:e,txVariant:t,rootNode:n})=>{const o=e===z,r=[],i=["encryptedExpiryMonth","encryptedExpiryYear"];let a,s,l,c;const d=o?2:1;for(a=0;a<d;a+=1){l=o?i[a]:e,s=`${t}-encrypted-${l}`,c=o?l:e;const p=dl({fieldType:e,encryptedFieldName:c,uuid:s,isValid:!1,txVariant:t,rootNode:n});r.push(p)}return r},Mh=({fieldType:e,txVariant:t,rootNode:n,encryptedObjArr:o})=>{let r,i,a,s,l;const c=[];for(r=0;r<o.length;r+=1){a=o[r],s=a.encryptedFieldName,i=`${t}-encrypted-${s}`,l=a.blob;const d=dl({fieldType:e,encryptedFieldName:s,uuid:i,isValid:!0,txVariant:t,rootNode:n});d.blob=l,c.push(d)}return c};function Y(e={},t){return Object.prototype.hasOwnProperty.call(e,t)}const ul=(e,t,n,o,r)=>{if(!Y(e,"error"))return null;const i=t,a={rootNode:o,fieldType:e.fieldType,error:null,type:null},s=e.error!=="";return s||i.hasError?(a.error=s?e.error:"",a.type=n,i.hasError=s,i.errorType=a.error,r(a),a):null};function Lh(e){let t;const n=e.fieldType;if(this.state.type==="card"&&Y(e,"cvcPolicy")&&Tt(e.cvcPolicy)&&Y(this.state.securedFields,j)&&(this.state.securedFields[j].cvcPolicy=e.cvcPolicy),ul(e,this.state.securedFields[n],this.state.type,this.props.rootNode,this.callbacks.onError),this.state.securedFields[n].isEncrypted){t=Fh({fieldType:n,txVariant:this.state.type,rootNode:this.props.rootNode}),n===H&&(t[0].endDigits="");for(let o=0,r=t.length;o<r;o+=1)this.callbacks.onFieldValid(t[o]);this.state.securedFields[n].isEncrypted=!1}this.validateForm(),Y(e,"brand")&&this.processBrand(e)}const nt=(e,t,n)=>{if(t){const o=JSON.stringify(e);t.postMessage(o,n)}};function ut(e,t){return e.securedFields[t]?.iframeContentWindow||null}function Oh(e){const t=e.fieldType;let n,o;this.config.autoFocus&&(e.type!=="year"&&t!==Z||this.setFocusOnFrame(j),t===X&&this.setFocusOnFrame(Z));const r=e[t];this.state.securedFields[t].isEncrypted=!0,ul({error:"",fieldType:e.fieldType},this.state.securedFields[t],this.state.type,this.props.rootNode,this.callbacks.onError);const i=Mh({fieldType:t,txVariant:this.state.type,rootNode:this.props.rootNode,encryptedObjArr:r});if(t===X&&Y(this.state.securedFields,Z)){const a={txVariant:this.state.type,code:e.code,blob:r[0].blob,fieldType:Z,numKey:this.state.securedFields[Z].numKey};nt(a,ut(this.state,Z),this.config.loadingContext)}for(t===H&&Qo(e.endDigits)&&(i[0].endDigits=e.endDigits),t===H&&Qo(e.issuerBin)&&(i[0].issuerBin=+e.issuerBin),t===z&&Qo(e.expiryDate)&&(i[1].expiryDate=e.expiryDate),n=0,o=i.length;n<o;n+=1)this.callbacks.onFieldValid(i[n]);this.validateForm()}const hl=(e,t)=>{let n=[];return e&&typeof e.querySelectorAll=="function"&&(n=[].slice.call(e.querySelectorAll(t))),n},_t=(e,t)=>{if(e)return e.querySelector(t)},Jo=(e,t)=>{if(e)return e.getAttribute(t)},Bh=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)};let ki;const V={__NO_BRAND:"noBrand",cards:[]};V.cards.push({cardType:"mc",permittedLengths:[16],pattern:/^(5[1-5][0-9]{0,14}|2[2-7][0-9]{0,14})$/,securityCode:"CVC"}),V.cards.push({cardType:"visadankort",permittedLengths:[16],pattern:/^(4571)[0-9]{0,12}$/}),V.cards.push({cardType:"visa",permittedLengths:[13,16,19],pattern:/^4[0-9]{0,18}$/,securityCode:"CVV"}),V.cards.push({cardType:"amex",permittedLengths:[15],pattern:/^3[47][0-9]{0,13}$/,securityCode:"CID"}),V.cards.push({cardType:"diners",permittedLengths:[14,15,16,17,18,19],pattern:/^(36)[0-9]{0,12}$/}),V.cards.push({cardType:"maestrouk",permittedLengths:[16,18,19],pattern:/^(6759)[0-9]{0,15}$/}),V.cards.push({cardType:"solo",permittedLengths:[16,18,19],pattern:/^(6767)[0-9]{0,15}$/}),V.cards.push({cardType:"laser",permittedLengths:[16,17,18,19],pattern:/^(6304|6706|6709|6771)[0-9]{0,15}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"discover",permittedLengths:[16,17,18,19],pattern:/^(6011[0-9]{0,12}|(644|645|646|647|648|649)[0-9]{0,13}|65[0-9]{0,14})$/}),V.cards.push({cardType:"jcb",permittedLengths:[16,19],pattern:/^(352[8,9]{1}[0-9]{0,15}|35[4-8]{1}[0-9]{0,16})$/,securityCode:"CAV"}),V.cards.push({cardType:"bcmc",permittedLengths:[16,17,18,19],pattern:/^((6703)[0-9]{0,15}|(479658|606005)[0-9]{0,13})$/,cvcPolicy:"hidden"}),V.cards.push({cardType:"bijcard",permittedLengths:[16],pattern:/^(5100081)[0-9]{0,9}$/}),V.cards.push({cardType:"dankort",permittedLengths:[16],pattern:/^(5|50|501|5019[0-9]{0,12}|4|45|457|4571[0-9]{0,12}|3|35|357|3571[0-9]{0,12})$/}),V.cards.push({cardType:"hipercard",permittedLengths:[16],pattern:/^(606282)[0-9]{0,10}$/}),V.cards.push({cardType:"cup",permittedLengths:[14,15,16,17,18,19],pattern:/^(62|81)[0-9]{0,17}$/}),V.cards.push({cardType:"maestro",permittedLengths:[16,17,18,19],pattern:/^(5[0|6-8][0-9]{0,17}|6[0-9]{0,18})$/,cvcPolicy:"optional"}),V.cards.push({cardType:"elo",permittedLengths:[16],pattern:/^((((506699)|(506770)|(506771)|(506772)|(506773)|(506774)|(506775)|(506776)|(506777)|(506778)|(401178)|(438935)|(451416)|(457631)|(457632)|(504175)|(627780)|(636368)|(636297))[0-9]{0,10})|((50676)|(50675)|(50674)|(50673)|(50672)|(50671)|(50670))[0-9]{0,11})$/}),V.cards.push({cardType:"uatp",permittedLengths:[15],pattern:/^1[0-9]{0,14}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"cartebancaire",permittedLengths:[16],pattern:/^[4-6][0-9]{0,15}$/}),V.cards.push({cardType:"visaalphabankbonus",permittedLengths:[16],pattern:/^(450903)[0-9]{0,10}$/}),V.cards.push({cardType:"mcalphabankbonus",permittedLengths:[16],pattern:/^(510099)[0-9]{0,10}$/}),V.cards.push({cardType:"hiper",permittedLengths:[16],pattern:/^(637095|637568|637599|637609|637612)[0-9]{0,10}$/}),V.cards.push({cardType:"oasis",permittedLengths:[16],pattern:/^(982616)[0-9]{0,10}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"karenmillen",permittedLengths:[16],pattern:/^(98261465)[0-9]{0,8}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"warehouse",permittedLengths:[16],pattern:/^(982633)[0-9]{0,10}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"mir",permittedLengths:[16,17,18,19],pattern:/^(220)[0-9]{0,16}$/}),V.cards.push({cardType:"codensa",permittedLengths:[16],pattern:/^(590712)[0-9]{0,10}$/}),V.cards.push({cardType:"naranja",permittedLengths:[16,17,18,19],pattern:/^(37|40|5[28])([279])\d*$/}),V.cards.push({cardType:"cabal",permittedLengths:[16,17,18,19],pattern:/^(58|6[03])([03469])\d*$/}),V.cards.push({cardType:"shopping",permittedLengths:[16,17,18,19],pattern:/^(27|58|60)([39])\d*$/}),V.cards.push({cardType:"argencard",permittedLengths:[16,17,18,19],pattern:/^(50)(1)\d*$/}),V.cards.push({cardType:"troy",permittedLengths:[16],pattern:/^(97)(9)\d*$/}),V.cards.push({cardType:"forbrugsforeningen",permittedLengths:[16],pattern:/^(60)(0)\d*$/}),V.cards.push({cardType:"vpay",permittedLengths:[13,14,15,16,17,18,19],pattern:/^(40[1,8]|413|43[4,5]|44[1,2,3,4,6,7]|45[5,8]|46[0,1,3,6]|47[1,9]|48[2,3,7])[0-9]{0,16}$/}),V.cards.push({cardType:"rupay",permittedLengths:[16],pattern:/^(100003|508(2|[5-9])|60(69|[7-8])|652(1[5-9]|[2-5][0-9]|8[5-9])|65300[3-4]|8172([0-1]|[3-5]|7|9)|817(3[3-8]|40[6-9]|410)|35380([0-2]|[5-6]|9))[0-9]{0,12}$/}),V.cards.push({cardType:"ticket",expiryDatePolicy:"hidden"});var Ei={detectCard:(e,t)=>{let n;return t?(n=V.cards.filter(o=>t.includes(o.cardType)).filter(o=>Y(o,"pattern")&&e.match(o.pattern)),n.length?(n.length===1||n.sort((o,r)=>t.indexOf(o.cardType)-t.indexOf(r.cardType)),n[0]):{cardType:V.__NO_BRAND}):{cardType:V.__NO_BRAND}},detectCardLength:(e,t)=>{let n,o,r=0,i=!1,a=t;const s=e.cardType!==V.__NO_BRAND?e.permittedLengths[e.permittedLengths.length-1]:0;if(s&&a>s&&(r=a.length-s,r>0&&(a=a.substring(0,a.length-r),o=a)),e.permittedLengths.forEach(l=>{a.length===l&&(i=!0)}),a.length===s){const l=Math.floor(a.length/4);n=s+(a.length%4>0?l:l-1),e.cardType.toLowerCase()==="amex"&&(n=s+2)}return{shortenedNewValue:o,maxLength:n,reachedValidLength:i}},getShortestPermittedCardLength:()=>{if(!ki){let e=[];V.cards.forEach(t=>{e=e.concat(t.permittedLengths??[])}),ki=Math.min.apply(null,e)}return ki},getCardByBrand:e=>V.cards.filter(t=>t.cardType===e)[0],isGenericCardType:e=>{if(!e)throw new Error("Error: isGenericCardType: type param has not been specified");return e==="card"||e==="scheme"},__NO_BRAND:V.__NO_BRAND,allCards:V.cards};function Vh({src:e,title:t="iframe element",policy:n="origin"}){const o=document.createElement("iframe");o.setAttribute("src",e),o.classList.add("js-iframe"),t!==""&&t.trim().length>0&&o.setAttribute("title",t),o.setAttribute("allowtransparency","true"),o.setAttribute("referrerpolicy",n);const r=document.createTextNode("<p>Your browser does not support iframes.</p>");return o.appendChild(r),o}const Zn=(e,t,n,o=!1)=>!(!e||typeof e.addEventListener!="function")&&(e.addEventListener(t,n,o),!0),Qn=(e,t,n,o=!1)=>!(!e||typeof e.removeEventListener!="function")&&(e.removeEventListener(t,n,o),!0),Uh=(e,t,n)=>{const o=e.origin,r=t.indexOf("/checkoutshopper/");let i=r>-1?t.substring(0,r):t;const a=i.length-1;return i.charAt(a)==="/"&&(i=i.substring(0,a)),o===i||(n&&Gt(`WARNING postMessageValidation: postMessage listener for iframe::origin mismatch!
|
|
132
|
-
Received message with origin:`,o,"but the only allowed origin for messages to CSF is",i,"### event.data=",e.data),!1)},Hh=e=>e.data&&e.data.type&&typeof e.data.type=="string"&&e.data.type.includes("webpack"),Kh=e=>e.data&&typeof e.data=="string"&&e.data.includes("cvox");function jh(){if(!window.crypto)return 4294967296*Math.random()|0;const e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]}function pl(e,t){const n=typeof e;return e&&t&&n==="object"&&n===typeof t?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(o=>pl(e[o],t[o])):e===t}function wt(...e){const t=e,n=t.shift();return function(...o){return n.apply(this,t.concat(o))}}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let zh=class{constructor(){J(this,"sfConfig",void 0),J(this,"componentType",void 0),J(this,"loadingContext",void 0),J(this,"holderEl",void 0),J(this,"iframeRef",void 0),J(this,"loadToConfigTimeout",void 0),J(this,"_isValid",void 0),J(this,"_iframeContentWindow",void 0),J(this,"_numKey",void 0),J(this,"_isEncrypted",void 0),J(this,"_hasError",void 0),J(this,"_errorType",void 0),J(this,"_cvcPolicy",void 0),J(this,"_expiryDatePolicy",void 0),J(this,"_iframeOnLoadListener",void 0),J(this,"_postMessageListener",void 0),J(this,"submitAnalytics",void 0),J(this,"onIframeLoadedCallback",void 0),J(this,"onConfigCallback",void 0),J(this,"onEncryptionCallback",void 0),J(this,"onValidationCallback",void 0),J(this,"onFocusCallback",void 0),J(this,"onBinValueCallback",void 0),J(this,"onTouchstartCallback",void 0),J(this,"onShiftTabCallback",void 0),J(this,"onAutoCompleteCallback",void 0),J(this,"onKeyDownCallback",void 0),this.sfConfig={}}};const qh=(e,t)=>Object.values(Ft).reduce((n,o)=>(o.includes(t)&&(n[o]=e.get(o)),n),{}),Wh=(e,t,n)=>{const o={...e},r=Gh(n);return o.error=qh(t,r),o},ml=(e,t)=>{let n=e;for(const[o,r]of Object.entries(t))if(r===e){n=o;break}return n?.toLowerCase().replace(/[_.\s]/g,"-")},Gh=e=>{let t;switch(e){case H:t=gn.CC_NUM;break;case z:t=gn.CC_DAT;break;case X:t=gn.CC_MTH;break;case Z:t=gn.CC_YR;break;case j:t=gn.CC_CVC;break;case et:t=gn.KCP_PWD}return t},Yh=({errors:e,i18n:t,layout:n,countrySpecificLabels:o,fieldTypeMappingFn:r})=>Object.entries(e).reduce((i,[a,s])=>{if(s){const l=e[a],c="errorI18n"in l&&"rootNode"in l,d=typeof l.errorMessage=="object";let p,h;if(p=c?l.error:d?l.errorMessage.translationKey:l.errorMessage,c&&"errorI18n"in l)h=l.errorI18n+"";else{const m=r?r(a,t,o):"";if(d){const f=l.errorMessage.translationKey,y=l.errorMessage.translationObject.values.format;h=`${t.get(f,{values:{label:m,format:y}})}`}else h=t.get(l.errorMessage,{values:{label:m}})+""}i.push({field:a,errorMessage:h,errorCode:p}),n&&i.sort((m,f)=>n.indexOf(m.field)-n.indexOf(f.field))}return i},[]),Zh=({i18n:e,fieldTypeMappingFn:t,SRPanelRef:n},{errors:o,isValidating:r,layout:i,countrySpecificLabels:a,hasDisplayedErrors:s=!0})=>{const l=Yh({errors:o,i18n:e,fieldTypeMappingFn:t,countrySpecificLabels:a,layout:i});if(l.length){if(r){const c=l.map(p=>p.errorMessage);n.setMessages(c);const d=l.map(p=>p.field);return{currentErrorsSortedByLayout:l,action:il,fieldToFocus:d[0]}}return n?.setMessages(null),{currentErrorsSortedByLayout:l,action:al}}return s&&n?.setMessages(null),{currentErrorsSortedByLayout:l,action:"none"}};var Qh=(e,t,n,o)=>{const r={...e},i={};switch(n){case"ach":case pi:break;default:if(o===j)i[ui]=t.get("creditCard.securityCode.contextualText.3digits"),i[hi]=t.get("creditCard.securityCode.contextualText.4digits");else{const a=`creditCard.${Wo[o]}.contextualText`,s=t.get(a);s!==a&&(i[o]=s)}}return Object.keys(i).length&&(r.contextualTexts=i),r};function Jh(e,t,n,o){const r=["giftcard"].includes(e)?e:"creditCard";let i=n.get(`${r}.${t}.aria.iframeTitle`);i==="none"&&(i="");const a=n.get(`${r}.${Wo[t]}.label`),s=n.locale;let l=Wh({iframeTitle:i,label:a},n,t);return o&&(l=Qh(l,n,e,t)),{...s&&{lang:s},[t]:l}}function Xh(e,t,n){return e===pi?{[t]:n[Wo[t]]??""}:t===j?{[ui]:n.securityCodeThreeDigits??"",[hi]:n.securityCodeFourDigits??""}:{[t]:n[Wo[t]]??""}}function Be(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return(e=="x"?t:3&t|8).toString(16)})}function xi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yt=(function(e){return e.info="info",e.error="error",e.log="log",e})({});let Pi=class{constructor(t){xi(this,"timestamp",void 0),xi(this,"id",void 0),xi(this,"component",void 0),this.component=t,this.id=Be(),this.timestamp=String(Date.now())}};function Ti(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ie=(function(e){return e.network="Network",e.implementation="Implementation",e.internal="Internal",e.apiError="ApiError",e.sdkError="SdkError",e.thirdParty="ThirdParty",e.generic="Generic",e.redirect="Redirect",e.threeDS2="ThreeDS2",e})({}),pe=(function(e){return e.SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND="500",e.REDIRECT="600",e.SECURED_FIELDS_KEY_NOT_FOUND="608",e.SECURED_FIELDS_ENCRYPTION_KEY_GEN_FAILED="609",e.SECURED_FIELDS_ENCRYPTION_ERROR="610",e.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA="700",e.THREEDS2_ACTION_IS_MISSING_TOKEN="701",e.THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL="702",e.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS="703",e.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED="704",e.THREEDS2_TIMEOUT="710",e.THREEDS2_TOKEN_IS_MISSING_ACSURL="800",e.THREEDS2_NO_TRANSSTATUS="801",e.THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED="802",e.THREEDS2_NO_COMPONENT_FOR_ACTION="803",e.THREEDS2_NO_ACTION_FOR_CHALLENGE="804",e.THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP="805",e.THREEDS2_CHALLENGE_TOKEN_IS_MISSING_THREEDSNOTIFICATIONURL="806",e})({});class Re extends Pi{getEventCategory(){return Yt.error}constructor(t){super(t.component),Ti(this,"errorType",void 0),Ti(this,"code",void 0),Ti(this,"message",void 0),this.errorType=t.errorType,this.code=t.code,t.message&&(this.message=t.message)}}let ep=class extends zh{init(t,n,o,r){const i=Jh(this.sfConfig.txVariant,this.sfConfig.fieldType,t,r);this.sfConfig.iframeUIConfig.ariaConfig=i,this.sfConfig.iframeUIConfig.placeholders=Xh(this.sfConfig.txVariant,this.sfConfig.fieldType,o);const a={src:n,title:i[this.sfConfig.fieldType].iframeTitle,policy:"origin"},s=Vh(a);this.holderEl.appendChild(s);const l=_t(this.holderEl,".js-iframe");if(l){if(!l.contentWindow){console.error("ERROR: Trying to initialise a securedField iframe, but the iframe.contentWindow is undefined. Are you sure the element into which the Card component is being mounted already exists in the DOM *before* the Card component is mounted?");const c=new Re({component:this.componentType,code:pe.SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND,errorType:Ie.implementation,message:`Trying to initialise an iframe for ${this.sfConfig.fieldType}, but the iframe.contentWindow is undefined`});this.submitAnalytics?.(c)}this.iframeContentWindow=l.contentWindow,this.iframeOnLoadListener=this.iframeOnLoadListenerFn,Zn(l,"load",this.iframeOnLoadListener,!1)}return this.iframeRef=l,this}iframeOnLoadListenerFn(){this.postMessageListener=this.postMessageListenerFn,Zn(window,"message",this.postMessageListener,!1);const t={...this.sfConfig,numKey:this.numKey};window._b$dl&&console.log("### SecuredField:::: onIframeLoaded:: created configObj=",t),nt(t,this.iframeContentWindow,this.loadingContext),this.onIframeLoadedCallback()}postMessageListenerFn(t){if(!Uh(t,this.loadingContext,this.sfConfig.showWarnings))return;let n;try{n=JSON.parse(t.data)}catch{return Hh(t)?void(this.sfConfig.showWarnings&&Si("### SecuredField::postMessageListenerFn:: PARSE FAIL - WEBPACK")):Kh(t)?void(this.sfConfig.showWarnings&&Si("### SecuredField::postMessageListenerFn:: PARSE FAIL - CHROMEVOX")):void(this.sfConfig.showWarnings&&Si("### SecuredField::postMessageListenerFn:: PARSE FAIL - UNKNOWN REASON: event.data=",t.data))}if(Y(n,"action")&&Y(n,"numKey"))if(this.numKey===n.numKey)switch(n.action){case"encryption":this.isValid=!0,this.onEncryptionCallback(n);break;case"config":window._b$dl&&console.log("### SecuredField::postMessageListenerFn:: configured - calling onConfigCallback",n.fieldType),this.onConfigCallback(n);break;case"focus":this.onFocusCallback(n);break;case"binValue":this.onBinValueCallback(n);break;case"touch":this.onTouchstartCallback(n);break;case"shifttab":this.onShiftTabCallback(n);break;case"autoComplete":this.onAutoCompleteCallback(n);break;case"enterKeyPressed":this.onKeyDownCallback(n);break;case"encryptionError":{const o=new Re({component:this.componentType,code:n.code,errorType:Ie.internal,message:`${n.error}. Field= ${this.sfConfig.fieldType}`});this.submitAnalytics?.(o);break}default:this.isValid=!1,this.onValidationCallback(n)}else this.sfConfig.showWarnings&&Gt("WARNING SecuredField :: postMessage listener for iframe :: data mismatch! (Probably a message from an unrelated securedField)");else this.sfConfig.showWarnings&&Gt("WARNING SecuredField :: postMessage listener for iframe :: data mismatch!")}destroy(){Qn(window,"message",this.postMessageListener,!1),Qn(this.iframeRef,"load",this.iframeOnLoadListener,!1),this.iframeContentWindow=null,Bh(this.holderEl)}isOptionalOrHidden(){if(this.sfConfig.fieldType===z||this.sfConfig.fieldType===X||this.sfConfig.fieldType===Z)switch(this.expiryDatePolicy){case yn:return!0;case Yn:return!this.hasError;default:return!1}if(this.sfConfig.fieldType===j)switch(this.cvcPolicy){case qo:return!0;case Gn:return!this.hasError;default:return!1}return!1}onIframeLoaded(t){return this.onIframeLoadedCallback=t,this}onEncryption(t){return this.onEncryptionCallback=t,this}onValidation(t){return this.onValidationCallback=t,this}onConfig(t){return this.onConfigCallback=t,this}onFocus(t){return this.onFocusCallback=t,this}onBinValue(t){return this.onBinValueCallback=t,this}onTouchstart(t){return this.onTouchstartCallback=t,this}onShiftTab(t){return this.onShiftTabCallback=t,this}onAutoComplete(t){return this.onAutoCompleteCallback=t,this}onKeyDown(t){return this.onKeyDownCallback=t,this}get errorType(){return this._errorType}set errorType(t){this._errorType=t}get hasError(){return this._hasError}set hasError(t){this._hasError=t}get isValid(){if(this.sfConfig.fieldType===j)switch(this.cvcPolicy){case qo:return!0;case Gn:return!this.hasError;default:return this._isValid}if(this.sfConfig.fieldType===z||this.sfConfig.fieldType===X||this.sfConfig.fieldType===Z)switch(this.expiryDatePolicy){case yn:return!0;case Yn:return!this.hasError;default:return this._isValid}return this._isValid}set isValid(t){this._isValid=t}get cvcPolicy(){return this._cvcPolicy}set cvcPolicy(t){this.sfConfig.fieldType===j&&t!==this.cvcPolicy&&(this._cvcPolicy=t,this.hasError&&this.errorType==="isValidated"&&(this.hasError=!1))}get expiryDatePolicy(){return this._expiryDatePolicy}set expiryDatePolicy(t){this.sfConfig.fieldType!==z&&this.sfConfig.fieldType!==X&&this.sfConfig.fieldType!==Z||t!==this.expiryDatePolicy&&(this._expiryDatePolicy=t,this.hasError&&this.errorType==="isValidated"&&(this.hasError=!1))}get iframeContentWindow(){return this._iframeContentWindow}set iframeContentWindow(t){this._iframeContentWindow=t}get isEncrypted(){return this._isEncrypted}set isEncrypted(t){this._isEncrypted=t}get numKey(){return this._numKey}set numKey(t){this._numKey=t}get iframeOnLoadListener(){return this._iframeOnLoadListener}set iframeOnLoadListener(t){this._iframeOnLoadListener=t.bind(this)}get postMessageListener(){return this._postMessageListener}set postMessageListener(t){this._postMessageListener=t.bind(this)}constructor(t,n){var o,r,i;super(),i=void 0,(r="sfConfig")in(o=this)?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i;const a=_i(["loadingContext","holderEl","iframeSrc","showContextualElement","placeholders"]).from(t);this.sfConfig={...a,iframeUIConfig:{...a.iframeUIConfig}};const{iframeSrc:s,placeholders:l,showContextualElement:c}=t;return this.loadingContext=t.loadingContext,this.holderEl=t.holderEl,this.submitAnalytics=t.submitAnalytics,this.componentType=t.componentType,this.isValid=!1,this.iframeContentWindow=null,this.numKey=jh(),this.isEncrypted=!1,this.hasError=!1,this.errorType="",this.cvcPolicy=t.cvcPolicy,this.expiryDatePolicy=t.expiryDatePolicy,this.init(n,s,l,c)}};function Di(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fl="NETWORK_ERROR",tp="CANCEL",Ni="IMPLEMENTATION_ERROR",Ai="API_ERROR",Xo="ERROR",np="SCRIPT_ERROR",op="SDK_ERROR";let F=class au extends Error{constructor(t,n,o){super(n),Di(this,"cause",void 0),Di(this,"options",void 0),this.name=au.errorTypes[t],this.options=o||{},this.cause=this.options.cause}};Di(F,"errorTypes",{NETWORK_ERROR:fl,CANCEL:tp,IMPLEMENTATION_ERROR:Ni,API_ERROR:Ai,ERROR:Xo,SCRIPT_ERROR:np,SDK_ERROR:op});const rp=e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase(),ip=(e,t)=>{const n=e==="card"?"nocard":e||"nocard",o={type:n,extension:"svg"};return t.getImage(o)(n)},Ii=e=>{let t=rp(e);return bn(e)&&(t=t.substring(fh.length+1)),t};function bn(e){return vh.includes(e)}function ap(){this.encryptedAttrName=tl;const e=hl(this.props.rootNode,`[${this.encryptedAttrName}]`).filter(o=>{const r=Jo(o,this.encryptedAttrName),i=bn(r);return i||console.warn(`WARNING: '${r}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`),i}),t=$t,n=Pt;return this.config.isCreditCardType?(this.isSingleBrandedCard=!1,this.securityCode="",this.createCardSecuredFields(e,t,n),e.length):(this.createNonCardSecuredFields(e),e.length)}async function sp(e){for(let t=0;t<e.length;t++){const n=e[t];await this.setupSecuredField(n).catch(o=>{window._b$dl&&console.log("Secured fields setup failure. e=",o)})}}async function lp(e,t,n){let o=this.state.type;if(o==="card"&&this.config.cardGroupTypes.length===1&&(o=this.config.cardGroupTypes[0],this.state.type=o),this.isSingleBrandedCard=o!=="card",this.isSingleBrandedCard){const r=Ei.getCardByBrand(o);Tt(r)?(t=r.cvcPolicy||$t,n=r.expiryDatePolicy||Pt,this.securityCode=r.securityCode):this.state.type="unrecognised-single-brand"}for(let r=0;r<e.length;r++){const i=e[r];window._b$dl&&console.log(`
|
|
133
|
-
About to set up securedField:`,i),await this.setupSecuredField(i,t,n).catch(a=>{window._b$dl&&console.log("Secured fields setup failure. e=",a)}),window._b$dl&&console.log("Finished setting up securedField:",i)}if(window._b$dl&&console.log("Finished setting up all securedFields"),this.isSingleBrandedCard){const
|
|
134
|
-
iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`);if(s.loadToConfigTimeout=setTimeout(()=>{r({type:a.fieldType,failReason:"sf took too long to config"})},wh),this.state.iframeCount===this.state.originalNumIframes){const l={iframesLoaded:!0};this.callbacks.onLoad(l)}}).onConfig(l=>{this.handleIframeConfigFeedback(l),clearTimeout(s.loadToConfigTimeout),s.loadToConfigTimeout=null,o(l)}).onFocus(l=>{this.handleFocus(l)}).onBinValue(l=>{this.handleBinValue(l)}).onTouchstart(l=>{this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents||l.hasGenuineTouchEvents)&&this.callbacks.onTouchstartIOS({fieldType:l.fieldType}),(l.hasGenuineTouchEvents||this.hasGenuineTouchEvents)&&this.postMessageToAllIframes({fieldType:l.fieldType,fieldClick:!0})}).onShiftTab(l=>{this.handleSFShiftTab(l.fieldType)}).onEncryption(l=>{this.handleEncryption(l)}).onValidation(l=>{this.handleValidation(l)}).onAutoComplete(l=>{this.processAutoComplete(l)}).onKeyDown(l=>{const{numKey:c,...d}=l;this.callbacks.onKeyDown(d)});this.state.securedFields[i]=s})}var ht={__IS_IE:typeof navigator<"u"&&(function(){const e=navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){const o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}const n=e.indexOf("Edge/");return n>0&&parseInt(e.substring(n+5,e.indexOf(".",n)),10)})(),__IS_IOS:typeof navigator<"u"&&/iphone|ipod|ipad/i.test(navigator.userAgent),__IS_FIREFOX:typeof navigator<"u"&&/(firefox)/i.test(navigator.userAgent)},Jn={touchendListener:function(e){const t=e.target;if(t instanceof HTMLInputElement||HTMLTextAreaElement&&t instanceof HTMLTextAreaElement){const o=t.value;let r="selectionStart"in(n=t)?n.selectionStart:0,i=!1;r===o.length&&(r-=1,i=!0),t.value=o;try{t.setSelectionRange&&(t.focus(),t.setSelectionRange(r,r),i&&(r+=1,setTimeout(()=>{t.setSelectionRange(r,r)},0)))}catch{}}else if(this.config.keypadFix){const o=this.props.rootNode,r=document.createElement("input");r.style.width="1px",r.style.height="1px",r.style.opacity="0",r.style.fontSize="18px",o.appendChild(r),r.focus(),o.removeChild(r)}var n;this.destroyTouchendListener(),this.state.registerFieldForIos=!1,this.postMessageToAllIframes({fieldType:"webInternalElement",fieldClick:!0})},touchstartListener:function(e){this.hasGenuineTouchEvents=!0;const t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLSpanElement){this.postMessageToAllIframes({fieldType:"webInternalElement",checkoutTouchEvent:!0});const n=t.getAttribute("name")??t.getAttribute("data-id");this.callbacks.onTouchstartIOS?.({fieldType:"webInternalElement",name:n})}},handleTouchend:function(){const e=_t(document,"body");e.style.cursor="pointer",Zn(e,"touchend",this.touchendListener),this.state.registerFieldForIos=!0},destroyTouchendListener:function(){if(!ht.__IS_IOS)return!1;const e=_t(document,"body");return e.style.cursor="auto",Qn(e,"touchend",this.touchendListener),!0},destroyTouchstartListener:function(){return!!ht.__IS_IOS&&(Qn(document,"touchstart",this.touchstartListener),!0)}};const Xn=(e,t,n)=>((o,r=!0)=>{const i=Array.prototype.slice.call(hl(document,"*[data-cse], a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), object, embed, *[tabindex], *[contenteditable]")),a=[];i.forEach(l=>{const c=l.getAttribute("tabindex"),d=!c||parseInt(c,10)>=0,p=l.getBoundingClientRect(),h=p.width>0&&p.height>0;d&&h&&a.push(l)});const s=((l,c)=>{for(let d=0;d<l.length;d+=1)if(c(l[d]))return d;return-1})(a,l=>l===o||o.contains(l));return a[s+(r?-1:1)]})(_t(t,`[data-cse=${e}]`),n),dp=e=>{e&&(e.focus(),e.blur(),e.focus())};function up(e,t,n,o){let r,i;switch(e){case H:r=Xn(H,t);break;case z:case X:i=H;break;case Z:i=X;break;case j:o===1?r=Xn(j,t):i=n?Z:z}return{fieldToFocus:i,additionalField:r}}function hp(e,t){let n,o;switch(e){case H:n=Xn(H,t);break;case j:o=H}return{fieldToFocus:o,additionalField:n}}function pp(e,t,n){let o,r;switch(e){case H:o=Xn(H,t);break;case z:case X:r=H;break;case Z:r=X;break;case j:r=n?Z:z;break;case et:o=Xn(e,t)}return{fieldToFocus:r,additionalField:o}}var yl={handleShiftTab:function(e){let t;this.state.type==="giftcard"?t=hp(e,this.props.rootNode):t=this.state.isKCP?pp(e,this.props.rootNode,this.state.hasSeparateDateFields):up(e,this.props.rootNode,this.state.hasSeparateDateFields,this.state.numIframes);const n=t.fieldToFocus,o=t.additionalField;n?this.setFocusOnFrame(n,!1):o&&dp(o)},handleSFShiftTab:function(e){(ht.__IS_FIREFOX||ht.__IS_IE&&ht.__IS_IE<=11)&&this.handleShiftTab(e)}};function mp(e){if(Y(this.state.securedFields,H)){const t={txVariant:this.state.type,...e,fieldType:H,numKey:this.state.securedFields[H].numKey};nt(t,ut(this.state,H),this.config.loadingContext)}}function fp(e){(Y(this.state.securedFields,X)&&Y(this.state.securedFields,Z)?[X,Z]:[z]).forEach(t=>{const n={txVariant:this.state.type,...e,fieldType:t,numKey:this.state.securedFields[t].numKey};nt(n,ut(this.state,t),this.config.loadingContext)})}function yp(e,t){const n=this.state.type==="card";if(!e||!Object.keys(e).length)return n?(this.sendBrandToCardSF({brand:"reset"}),this.sendExpiryDatePolicyToSF({expiryDatePolicy:Pt})):t&&this.processBrand({...t,fieldType:H}),void(this.state.type==="card"&&Y(this.state.securedFields,z)&&(this.state.securedFields[z].expiryDatePolicy=Pt));const o=e.supportedBrands[0],r=o.brand,i=o.expiryDatePolicy??(o.showExpiryDate===!0?Pt:yn),a={brand:r,cvcPolicy:o.cvcPolicy,expiryDatePolicy:i,cvcText:"Security code",showSocialSecurityNumber:o.showSocialSecurityNumber??!1,fieldType:H,mode:Sh};if(this.processBrand(a),n){const s={brand:r,enableLuhnCheck:e.supportedBrands[0].enableLuhnCheck!==!1,...o?.panLength&&!e.isDualBrandSelection&&{panLength:o?.panLength}};this.sendBrandToCardSF(s),this.sendExpiryDatePolicyToSF({expiryDatePolicy:i})}Y(this.state.securedFields,j)&&(this.state.securedFields[j].cvcPolicy=o.cvcPolicy),Y(this.state.securedFields,z)?this.state.securedFields[z].expiryDatePolicy=i:Y(this.state.securedFields,X)&&Y(this.state.securedFields,Z)&&(this.state.securedFields[X].expiryDatePolicy=i,this.state.securedFields[Z].expiryDatePolicy=i),this.validateForm()}function gp({csfState:e,csfConfig:t},n,o){if(!Y(e.securedFields,n))return;const r={txVariant:e.type,fieldType:n,focus:!0,numKey:e.securedFields[n].numKey};nt(r,ut(e,n),t.loadingContext)}function bp({csfState:e,csfConfig:t},n){const o=Object.keys(n||{});return o.length?(Object.keys(e.securedFields).forEach(r=>{const i={txVariant:e.type,fieldType:r,numKey:e.securedFields[r].numKey};o.forEach(a=>{i[a]=n[a]}),nt(i,ut(e,r),t.loadingContext)}),!0):!1}function vp({csfState:e,csfConfig:t,csfProps:n,csfCallbacks:o},r){if(r.fieldType===H){const s={brand:r.brand,cvcPolicy:r.cvcPolicy,expiryDatePolicy:r.expiryDatePolicy,showSocialSecurityNumber:r.showSocialSecurityNumber},l=(i=s,a=e.brand,!pl(i,a));if(!l)return null;const c=e.type==="card"||e.type==="bcmc";if(c&&l&&(e.brand=s,Y(e.securedFields,j))){const p={txVariant:e.type,brand:s.brand,fieldType:j,cvcPolicy:r.cvcPolicy,numKey:e.securedFields[j].numKey};nt(p,ut(e,j),t.loadingContext)}const d=c?Ci(["brand","cvcPolicy","cvcText","expiryDatePolicy","showSocialSecurityNumber","mode"]).from(r):null;if(d&&d.brand){const p=d;p.type=e.type,p.rootNode=n.rootNode,o.onBrand(p)}return!0}var i,a;return!1}function Cp({csfState:e,csfConfig:t,csfCallbacks:n},o){if(o.name==="cc-name"){const r={...o};delete r.numKey;const i=r;return n.onAutoComplete(i),!0}if(o.name==="cc-exp"){const r=o.value.replace(/[^0-9]/gi,"/").split("/");if(r.length!==2)return!1;r[0].length===1&&(r[0]=`0${r[0]}`);const i=r[0],a=r[1];if(!((a?.length===4||a?.length===2)&&!isNaN(parseInt(a))))return!1;const s=a.slice(-2),l=`${i}/${s}`;if(Y(e.securedFields,z)){const c={txVariant:e.type,fieldType:z,autoComplete:l,numKey:e.securedFields[z].numKey};return nt(c,ut(e,z),t.loadingContext),!0}if(Y(e.securedFields,X)){const c={txVariant:e.type,fieldType:X,autoComplete:i,numKey:e.securedFields[X].numKey};nt(c,ut(e,X),t.loadingContext)}return Y(e.securedFields,Z)&&setTimeout(()=>{const c={txVariant:e.type,fieldType:Z,autoComplete:s,numKey:e.securedFields[Z].numKey};nt(c,ut(e,Z),t.loadingContext)},0),!0}return!1}function _p({csfState:e,csfProps:t,csfCallbacks:n},o,r){const i={...r};delete i.numKey,i.rootNode=t.rootNode,i.type=e.type;const a=i.fieldType;i.focus?e.currentFocusObject!==a&&(e.currentFocusObject=a,ht.__IS_IOS&&!e.registerFieldForIos&&o()):e.currentFocusObject===a&&(e.currentFocusObject=null);const s=i;s.currentFocusObject=e.currentFocusObject,n.onFocus(s)}function wp({csfState:e,csfCallbacks:t},n,o){if(e.iframeConfigCount+=1,window._b$dl&&console.log("### handleIframeConfigFeedback::csfState.iframeConfigCount:: ",e.iframeConfigCount,"who=",o.fieldType),e.isConfigured){const r={additionalIframeConfigured:!0,fieldType:o.fieldType,type:e.type};t.onAdditionalSFConfig(r)}else if(e.iframeConfigCount===e.originalNumIframes)return n(),!0;return!1}function Sp({csfState:e,csfConfig:t,csfProps:n,csfCallbacks:o},r){e.isConfigured=!0;const i={iframesConfigured:!0,type:e.type,rootNode:n.rootNode};if(o.onConfigSuccess(i),e.numIframes===1&&t.isCreditCardType){if(e.type==="card")return wi("ERROR: Payment method with a single secured field - but 'brands' has not been set to an array containing the specific card brand"),!1;const a=Ei.getCardByBrand(e.type);a&&(a.cvcPolicy??$t)!==$t&&r()}return!0}function kp({csfState:e,csfProps:t,csfCallbacks:n}){const o=(a=>{const s=Object.keys(a);for(let l=0,c=s.length;l<c;l+=1)if(!a[s[l]].isValid)return!1;return!0})(e.securedFields),r=o!==e.allValid;if(e.allValid=o,!o&&!r)return;const i={allValid:o,type:e.type,rootNode:t.rootNode};n.onAllValid(i)}function Ep({csfState:e,csfCallbacks:t},n){const{binValue:o,encryptedBin:r,uuid:i}=n,a={binValue:o,type:e.type};r&&(a.encryptedBin=r,a.uuid=i),t.onBinValue(a)}function xp(){this.postMessageToAllIframes({destroy:!0}),Object.keys(this.state.securedFields).forEach(e=>{const t=this.state.securedFields[e];t&&t.destroy(),this.state.securedFields[e]=null}),this.destroyTouchendListener(),this.destroyTouchstartListener(),this.state.securedFields={}}const eo=(e="You cannot use secured fields")=>{Gt(`${e} - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.`)};class Pp extends Nh{init(){this.configHandler(this.props),this.callbacksHandler(this.props.callbacks);const t=this.createSecuredFields();this.state.numIframes=this.state.originalNumIframes=t,this.state.isKCP=!!this.props.isKCP,ht.__IS_IOS&&this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents=!1,Zn(document,"touchstart",this.touchstartListener))}createReturnObject(){return{updateStyles:t=>{this.state.isConfigured?this.postMessageToAllIframes({styleObject:t}):Gt("You cannot update the secured fields styling - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.")},setFocusOnFrame:t=>{this.state.isConfigured?this.setFocusOnFrame(t):eo("You cannot set focus on any secured field")},isValidated:(t,n)=>{if(this.state.isConfigured){if(Y(this.state.securedFields,t)){this.state.securedFields[t].hasError=!0,this.state.securedFields[t].errorType===""&&(this.state.securedFields[t].errorType="isValidated");const o={txVariant:this.state.type,fieldType:t,externalValidation:!0,code:n,numKey:this.state.securedFields[t].numKey};nt(o,ut(this.state,t),this.config.loadingContext)}}else eo("You cannot set validated on any secured field")},hasUnsupportedCard:(t,n)=>{if(this.state.isConfigured){if(Y(this.state.securedFields,t)){this.state.securedFields[t].hasError=!!n,this.state.securedFields[t].errorType=n;const o={txVariant:this.state.type,fieldType:t,unsupportedCard:!!n,code:n,numKey:this.state.securedFields[t].numKey};nt(o,ut(this.state,t),this.config.loadingContext)}}else eo("You cannot set hasUnsupportedCard on any secured field")},destroy:()=>{this.state.isConfigured?this.destroySecuredFields():eo("You cannot destroy secured fields")},brandsFromBinLookup:(t,n)=>{if(!this.config.isCreditCardType)return null;this.state.isConfigured?this.handleBrandFromBinLookup(t,n):eo("You cannot set pass brands to secured fields")},addSecuredField:t=>{const n=_t(this.props.rootNode,`[data-cse="${t}"]`);n&&(this.state.numIframes+=1,this.setupSecuredField(n))},removeSecuredField:t=>{if(this.state.securedFields[t]){this.state.securedFields[t].destroy(),delete this.state.securedFields[t],this.state.numIframes-=1,this.state.iframeCount-=1;const n={additionalIframeRemoved:!0,fieldType:t,type:this.state.type};this.callbacks.onAdditionalSFRemoved(n)}},setKCPStatus:t=>{this.state.isKCP=t},sfIsOptionalOrHidden:t=>this.state.securedFields[t].isOptionalOrHidden()}}constructor(t){super(t),this.state={type:this.props.type,brand:this.props.type!=="card"?{brand:this.props.type,cvcPolicy:"required"}:{brand:null,cvcPolicy:"required"},allValid:void 0,numIframes:0,originalNumIframes:0,iframeCount:0,iframeConfigCount:0,isConfigured:!1,hasSeparateDateFields:!1,currentFocusObject:null,registerFieldForIos:!1,securedFields:{},isKCP:!1};const n={csfState:this.state,csfConfig:this.config,csfProps:this.props,csfCallbacks:this.callbacks};this.configHandler=Rh.bind(this),this.callbacksHandler=$h.bind(this),this.validateForm=wt(kp,n),this.isConfigured=wt(Sp,n,this.validateForm),this.handleIframeConfigFeedback=wt(wp,n,this.isConfigured),this.processBrand=wt(vp,n),this.handleValidation=Lh.bind(this),this.handleEncryption=Oh.bind(this),this.createSecuredFields=ap.bind(this),this.createNonCardSecuredFields=sp.bind(this),this.createCardSecuredFields=lp.bind(this),this.setupSecuredField=cp.bind(this),this.postMessageToAllIframes=wt(bp,n),this.handleIOSTouchEvents=Jn.handleTouchend.bind(this),this.touchendListener=Jn.touchendListener.bind(this),this.destroyTouchendListener=Jn.destroyTouchendListener.bind(this),this.touchstartListener=Jn.touchstartListener.bind(this),this.destroyTouchstartListener=Jn.destroyTouchstartListener.bind(this),this.setFocusOnFrame=wt(gp,n),this.handleFocus=wt(_p,n,this.handleIOSTouchEvents),this.handleSFShiftTab=yl.handleSFShiftTab.bind(this),this.handleShiftTab=yl.handleShiftTab.bind(this),this.destroySecuredFields=xp.bind(this),this.processAutoComplete=wt(Cp,n),this.handleBinValue=wt(Ep,n),this.handleBrandFromBinLookup=yp.bind(this),this.sendBrandToCardSF=mp.bind(this),this.sendExpiryDatePolicyToSF=fp.bind(this),this.init()}}const Tp=e=>{if(!e)throw new Error("No securedFields configuration object defined");const t={...e};try{const o=Ei.isGenericCardType(t.type);t.type=o?"card":t.type}catch{t.type="card"}if(!Y(t,"rootNode"))return wi('ERROR: SecuredFields configuration object is missing a "rootNode" property');if(cl(t.clientKey))return Gt('WARNING: AdyenCheckout configuration object is missing a "clientKey" property.');const n=Dp(t.rootNode);return n?(t.rootNode=n,new Pp(t).createReturnObject()):wi(`ERROR: SecuredFields cannot find a valid rootNode element for ${t.type}`)},Dp=e=>{let t;return typeof e=="object"&&(t=e),typeof e!="string"||(t=_t(document,e),t)?t:null};function er(e,t,n,o){return(t!==mi&&t!==fi||n[e]!==0)&&o[e]}var pt={handleFocus:function(e){this.numCharsInField[e.fieldType]=e.numChars,this.props.onFocus(e)},handleOnAllValid:function(e){return!this.state.detectedUnsupportedBrands&&(this.setState({isSfpValid:e.allValid},()=>{this.props.onChange(this.state,{event:"handleOnAllValid"}),this.props.onAllValid(e)}),!0)},handleOnAutoComplete:function(e){this.setState({autoCompleteName:e.value},()=>{this.props.onChange(this.state,{event:"handleOnAutoComplete",fieldType:e.fieldType}),this.setState({autoCompleteName:null})}),this.props.onAutoComplete(e)},handleOnFieldValid:function(e){return(!this.state.detectedUnsupportedBrands||e.fieldType!==H)&&(this.setState(t=>({data:{...t.data,[e.encryptedFieldName]:e.blob},valid:{...t.valid,[e.encryptedFieldName]:e.valid},errors:{...t.errors,[e.fieldType]:t.errors[e.fieldType]??null}}),()=>{this.props.onChange(this.state,{event:"handleOnFieldValid",fieldType:e.fieldType}),this.props.onFieldValid(e)}),!0)},handleOnLoad:function(e){clearTimeout(this.csfLoadFailTimeout),this.csfLoadFailTimeout=null,this.props.onLoad(e),this.csfConfigFailTimeout=setTimeout(()=>{this.state.status!=="ready"&&(this.setState({status:"csfConfigFailure"}),this.props.onError(new F("ERROR","secured fields have failed to configure")))},this.csfConfigFailTimeoutMS)},handleOnConfigSuccess:function(e){clearTimeout(this.csfConfigFailTimeout),this.csfConfigFailTimeout=null,this.setState({status:"ready"},()=>{this.props.onConfigSuccess(e)})},handleOnBrand:function(e){this.setState(t=>{const n=er(j,e.cvcPolicy,this.numCharsInField,t.errors),o=this.numDateFields===1?er(z,e.expiryDatePolicy,this.numCharsInField,t.errors):null,r=this.numDateFields===2?er(X,e.expiryDatePolicy,this.numCharsInField,t.errors):null,i=this.numDateFields===2?er(Z,e.expiryDatePolicy,this.numCharsInField,t.errors):null;return{brand:e.brand,cvcPolicy:e.cvcPolicy??$t,showSocialSecurityNumber:e.showSocialSecurityNumber,errors:{...t.errors,...Tt(n)&&{[j]:n},...Tt(o)&&{[z]:o},...Tt(r)&&{[X]:r},...Tt(i)&&{[Z]:i}},expiryDatePolicy:e.expiryDatePolicy??Pt}},()=>{this.props.onChange(this.state,{event:"handleOnBrand"});const t=this.props.brandsConfiguration[e.brand]?.icon??ip(e.brand,this.props.resources);this.props.onBrand({...e,brandImageUrl:t})})},handleOnError:function(e,t=null){const n=e.error;return this.setState(o=>({errors:{...o.errors,[e.fieldType]:n||null},...t&&{data:{...o.data,[H]:void 0}},...t&&{valid:{...o.valid,[H]:!1}},...t&&{isSfpValid:!1}}),()=>{this.props.onChange(this.state,{event:"handleOnError",fieldType:e.fieldType})}),!0},handleOnNoDataRequired:function(){this.setState({status:"ready"},()=>this.props.onChange({isSfpValid:!0}))},handleOnTouchstartIOS:function(e){this.props.disableIOSArrowKeys?.(e)},handleKeyDown:function(e){if(e.action==="enterKeyPressed"){const t=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter"});this.props.handleKeyDown?.(t)}}},Np={type:"card",keypadFix:!0,rootNode:null,loadingContext:null,brands:[],showWarnings:!1,autoFocus:!0,trimTrailingSeparator:!0,onChange:()=>{},onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onFocus:()=>{},onAutoComplete:()=>{},handleKeyDown:()=>{},styles:{}},Ri=(function(e){return e.full="full",e.partial="partial",e.none="none",e})({});const gl="holderName",$i="socialSecurityNumber",tr=[H,z,j],nr=[gl,H,z,j],or=[H,z,j,gl],Fi=["taxNumber",et],Ap=tr.concat(Fi),Ip=nr.concat(Fi),Rp=or.concat(Fi),$p=tr.concat([$i]),Fp=nr.concat([$i]),Mp=or.concat([$i]),rr="N/A",ir=["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],[Mt,mt,Zt,vn,We,Qt]=ir,Lp={street:"address-line1",houseNumberOrName:"address-line2",postalCode:"postal-code",city:"address-level2"},Mi={AU:{hasDataset:!0,labels:{[mt]:"apartmentSuite",[We]:"state",[Mt]:"address"},optionalFields:[mt],placeholders:{[We]:"select.state"},schema:[Qt,Mt,mt,vn,[[We,50],[Zt,50]]]},BR:{hasDataset:!0,labels:{[We]:"state"},placeholders:{[We]:"select.state"}},CA:{hasDataset:!0,labels:{[mt]:"apartmentSuite",[We]:"provinceOrTerritory",[Mt]:"address"},optionalFields:[mt],schema:[Qt,Mt,mt,[[vn,70],[Zt,30]],We]},GB:{labels:{[vn]:"cityTown"},schema:[Qt,[[mt,30],[Mt,70]],[[vn,70],[Zt,30]],We]},US:{hasDataset:!0,labels:{[Zt]:"zipCode",[mt]:"apartmentSuite",[We]:"state",[Mt]:"address"},optionalFields:[mt],placeholders:{[We]:"select.state"},schema:[Qt,Mt,mt,vn,[[We,50],[Zt,50]]]},default:{optionalFields:[],placeholders:{[We]:"select.provinceOrTerritory"},schema:[Qt,[[Mt,70],[mt,30]],[[Zt,30],[vn,70]],We]}},Op=Object.keys(Mi).reduce((e,t)=>(e[t]={labels:Mi[t].labels,schema:[Zt]},e),{}),Li=jo(void 0),Bp=({i18n:e,loadingContext:t,resources:n,analytics:o,children:r})=>{const i=Wt(Li);return R(()=>{e&&t&&n||console.warn(`CoreProvider - WARNING core provider is missing:${e?"":"i18n"} ${t?"":"loadingContext"} ${n?"":"resources"}`)},[e,t,n]),i?u(G,null,Ho(r)):u(Li.Provider,{value:{i18n:e,loadingContext:t,resources:n,analytics:o}},Ho(r))},O=()=>{const e=Wt(Li);if(e===void 0)throw new Error('"useCoreContext" must be used within a CoreProvider');return e};function Pe(){const{resources:e}=O();return T(t=>e?.getImage(t),[])}const bl=(e,t)=>t({type:e==="card"?"nocard":e||"nocard",extension:"svg"})(e),Vp=e=>["revolving","bonus"].includes(e?.plan)||e?.value>1,Up=({props:e,showKCP:t,showBrazilianSSN:n,countrySpecificSchemas:o=null,billingAddressRequiredFields:r=null})=>{let i=tr;const a=e.hasHolderName&&e.holderNameRequired;if(a&&(i=e.positionHolderNameOnTop?nr:or),t&&(i=Ap,a&&(i=e.positionHolderNameOnTop?Ip:Rp)),n&&(i=$p,a&&(i=e.positionHolderNameOnTop?Fp:Mp)),o){const s=o.flat(2).filter(c=>typeof c!="number");let l=s;r&&(l=s.filter(c=>r.includes(c))),i=tr.concat(l),a&&(i=e.positionHolderNameOnTop?nr.concat(l):or.concat(l))}return i},Hp=(e,t,n)=>{switch(e){case"socialSecurityNumber":return t.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return n?.[e]?t.get(n?.[e]):t.get(e);default:return null}},Kp=e=>({billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),jp=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyDown:e.handleKeyDown,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),vl=e=>e==Ri.partial?Op:null;function zp(e){return![Ft.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,Ft.ERROR_MSG_CARD_TOO_OLD,Ft.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,Ft.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function Oi(e){return _h[e]??e}const qp={"cc.cvc.920":"cc.cvc.920.amex","cc.cvc.921":"cc.cvc.921.amex"};function Cl(e,t){return t&&qp[e]||e}const Wp=(e,t)=>e.map(n=>{const o=n.id,r=Pe(),i=o==="card"?"nocard":o,a=t?.[o]?.icon??bl(i,r);return{id:n.id,name:n.brandObject.localeBrand||n.brandObject.brand,imageURL:a,altName:Oi(o)}}),Bi=(e,t,n)=>t.some(o=>e.includes(o[n])),Gp=({installmentOptions:e,fundingSource:t,amount:n})=>!(!e||Object.keys(e).length===0)&&!(!n||n.value===0)&&(!t||t==="credit");var g=(function(e){return e.address="address",e.bankTransfer_IBAN="bankTransfer_IBAN",e.bankTransfer_BE="bankTransfer_BE",e.bankTransfer_NL="bankTransfer_NL",e.bankTransfer_PL="bankTransfer_PL",e.bankTransfer_FR="bankTransfer_FR",e.bankTransfer_CH="bankTransfer_CH",e.bankTransfer_IE="bankTransfer_IE",e.bankTransfer_GB="bankTransfer_GB",e.bankTransfer_DE="bankTransfer_DE",e.bankTransfer_AE="bankTransfer_AE",e.bankTransfer_AT="bankTransfer_AT",e.bankTransfer_AU="bankTransfer_AU",e.bankTransfer_BG="bankTransfer_BG",e.bankTransfer_CA="bankTransfer_CA",e.bankTransfer_EE="bankTransfer_EE",e.bankTransfer_ES="bankTransfer_ES",e.bankTransfer_FI="bankTransfer_FI",e.bankTransfer_HK="bankTransfer_HK",e.bankTransfer_HU="bankTransfer_HU",e.bankTransfer_IT="bankTransfer_IT",e.bankTransfer_JP="bankTransfer_JP",e.bankTransfer_LU="bankTransfer_LU",e.bankTransfer_NZ="bankTransfer_NZ",e.bankTransfer_PT="bankTransfer_PT",e.bankTransfer_SG="bankTransfer_SG",e.bankTransfer_SK="bankTransfer_SK",e.bankTransfer_US="bankTransfer_US",e.donation="donation",e.personal_details="personal_details",e.dropin="dropin",e.bcmc="bcmc",e.card="card",e.scheme="scheme",e.storedCard="storedCard",e.customCard="customcard",e.threeDS2Challenge="threeDS2Challenge",e.threeDS2Fingerprint="threeDS2Fingerprint",e.threeDS2DeviceFingerprint="threeDS2DeviceFingerprint",e.ach="ach",e.directdebit_GB="directdebit_GB",e.sepadirectdebit="sepadirectdebit",e.eft_directdebit_CA="eft_directdebit_CA",e.affirm="affirm",e.afterpay="afterpay",e.afterpay_default="afterpay_default",e.afterpay_b2b="afterpay_b2b",e.atome="atome",e.facilypay_3x="facilypay_3x",e.facilypay_4x="facilypay_4x",e.facilypay_6x="facilypay_6x",e.facilypay_10x="facilypay_10x",e.facilypay_12x="facilypay_12x",e.ratepay="ratepay",e.ratepay_directdebit="ratepay_directdebit",e.amazonpay="amazonpay",e.applepay="applepay",e.cashapp="cashapp",e.clicktopay="clicktopay",e.googlepay="googlepay",e.paypal="paypal",e.fastlane="fastlane",e.paywithgoogle="paywithgoogle",e.boletobancario="boletobancario",e.boletobancario_itau="boletobancario_itau",e.boletobancario_santander="boletobancario_santander",e.primeiropay_boleto="primeiropay_boleto",e.doku="doku",e.doku_alfamart="doku_alfamart",e.doku_permata_lite_atm="doku_permata_lite_atm",e.doku_indomaret="doku_indomaret",e.doku_atm_mandiri_va="doku_atm_mandiri_va",e.doku_sinarmas_va="doku_sinarmas_va",e.doku_mandiri_va="doku_mandiri_va",e.doku_cimb_va="doku_cimb_va",e.doku_danamon_va="doku_danamon_va",e.doku_bri_va="doku_bri_va",e.doku_bni_va="doku_bni_va",e.doku_bca_va="doku_bca_va",e.doku_wallet="doku_wallet",e.oxxo="oxxo",e.billdesk_online="billdesk_online",e.billdesk_wallet="billdesk_wallet",e.dotpay="dotpay",e.eps="eps",e.iris="iris",e.molpay_ebanking_fpx_MY="molpay_ebanking_fpx_MY",e.molpay_ebanking_TH="molpay_ebanking_TH",e.molpay_ebanking_VN="molpay_ebanking_VN",e.onlineBanking_CZ="onlineBanking_CZ",e.onlinebanking_IN="onlinebanking_IN",e.onlineBanking_PL="onlineBanking_PL",e.onlineBanking_SK="onlineBanking_SK",e.paybybank="paybybank",e.payu_IN_cashcard="payu_IN_cashcard",e.payu_IN_nb="payu_IN_nb",e.wallet_IN="wallet_IN",e.dragonpay="dragonpay",e.dragonpay_ebanking="dragonpay_ebanking",e.dragonpay_otc_banking="dragonpay_otc_banking",e.dragonpay_otc_non_banking="dragonpay_otc_non_banking",e.dragonpay_otc_philippines="dragonpay_otc_philippines",e.econtext="econtext",e.econtext_atm="econtext_atm",e.econtext_online="econtext_online",e.econtext_seven_eleven="econtext_seven_eleven",e.econtext_stores="econtext_stores",e.giropay="giropay",e.multibanco="multibanco",e.redirect="redirect",e.twint="twint",e.vipps="vipps",e.trustly="trustly",e.paybybank_AIS_DD="paybybank_AIS_DD",e.riverty="riverty",e.paybybank_pix="paybybank_pix",e.klarna="klarna",e.klarna_account="klarna_account",e.klarna_paynow="klarna_paynow",e.klarna_b2b="klarna_b2b",e.bcmc_mobile="bcmc_mobile",e.bcmc_mobile_QR="bcmc_mobile_QR",e.pix="pix",e.swish="swish",e.wechatpay="wechatpay",e.wechatpayQR="wechatpayQR",e.promptpay="promptpay",e.paynow="paynow",e.duitnow="duitnow",e.blik="blik",e.mbway="mbway",e.ancv="ancv",e.payto="payto",e.upi="upi",e.upi_qr="upi_qr",e.upi_intent="upi_intent",e.giftcard="giftcard",e.mealVoucher_FR="mealVoucher_FR",e.mealVoucher_FR_natixis="mealVoucher_FR_natixis",e.mealVoucher_FR_sodexo="mealVoucher_FR_sodexo",e.mealVoucher_FR_groupeup="mealVoucher_FR_groupeup",e})({});function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class _l extends Ae{componentDidMount(){this.props.rootNode&&this.setRootNode(this.props.rootNode);const t=xh(this.rootNode),n=t.reduce(Ph,{});this.setState({valid:n}),t.forEach(o=>{this.numCharsInField[o]=0}),this.numDateFields=t.filter(o=>o.match(/Expiry/)).length,t.length?(this.destroy(),this.initializeCSF(this.rootNode)):(this.props.componentType===g.customCard&&console.debug('You are trying to create a CustomCard component but the element into which you are trying to mount the CustomCard component does not contain any elements with a "data-cse" attribute e.g. <div data-cse="encryptedCardNumber"></div>'),this.handleOnNoDataRequired())}componentDidUpdate(){this.checkForKCPFields(),this.props.onStateUpdate?.(this.state)}componentWillUnmount(){this.csf=null,clearTimeout(this.csfLoadFailTimeout),clearTimeout(this.csfConfigFailTimeout)}initializeCSF(t){let n=this.props.loadingContext;const o={rootNode:t,type:this.props.type,componentType:this.props.componentType,clientKey:this.props.clientKey,cardGroupTypes:this.props.brands,autoFocus:this.props.autoFocus,trimTrailingSeparator:this.props.trimTrailingSeparator,loadingContext:n,keypadFix:this.props.keypadFix,showWarnings:this.props.showWarnings,iframeUIConfig:{sfStyles:this.props.styles},i18n:this.props.i18n,onSubmitAnalytics:this.props.onSubmitAnalytics,callbacks:{onLoad:this.handleOnLoad,onConfigSuccess:this.handleOnConfigSuccess,onFieldValid:this.handleOnFieldValid,onAllValid:this.handleOnAllValid,onBrand:this.handleOnBrand,onError:this.handleOnError,onFocus:this.handleFocus,onBinValue:this.props.onBinValue,onAutoComplete:this.handleOnAutoComplete,onAdditionalSFConfig:this.props.onAdditionalSFConfig,onAdditionalSFRemoved:this.props.onAdditionalSFRemoved,onTouchstartIOS:this.handleOnTouchstartIOS,onKeyDown:this.handleKeyDown},isKCP:this.state.hasKoreanFields,legacyInputMode:this.props.legacyInputMode,minimumExpiryDate:this.props.minimumExpiryDate,implementationType:this.props.implementationType||"components",forceCompat:this.props.forceCompat,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,shouldDisableIOSArrowKeys:!!this.props.disableIOSArrowKeys,placeholders:this.props.placeholders??{},showContextualElement:this.props.showContextualElement};this.csf=Tp(o),this.csfLoadFailTimeout=setTimeout(()=>{this.state.status!=="ready"&&(this.setState({status:"csfLoadFailure"}),this.props.onError(new F("ERROR","secured field iframes have failed to load")))},this.csfLoadFailTimeoutMS)}checkForKCPFields(){let t=!1;if(this.props.koreanAuthenticationRequired&&(t=this.issuingCountryCode?this.issuingCountryCode==="kr":this.props.countryCode==="kr"),this.state.hasKoreanFields&&!t){const n=o=>({data:{...o.data,[et]:void 0},valid:{...o.valid,[et]:!1},errors:{...o.errors,[et]:null},hasKoreanFields:!1});this.setState(n,()=>{this.props.onChange(this.state)}),this.csf.removeSecuredField(et),this.csf.setKCPStatus(!1)}if(!this.state.hasKoreanFields&&t){const n=o=>({valid:{...o.valid,[et]:!1},hasKoreanFields:!0,isSfpValid:!1});this.setState(n,()=>{this.props.onChange(this.state)}),this.csf.addSecuredField(et),this.csf.setKCPStatus(!0)}}getChildContext(){return{i18n:this.props.i18n}}handleUnsupportedCard(t){const n=!!t.error;return n&&this.setState({detectedUnsupportedBrands:t.detectedBrands}),t.rootNode=this.rootNode,this.handleOnError(t,n),this.csf&&this.csf.hasUnsupportedCard(H,t.error),n}setFocusOn(t){this.csf&&this.csf.setFocusOnFrame(t)}updateStyles(t){this.csf&&this.csf.updateStyles(t)}sfIsOptionalOrHidden(t){return this.csf.sfIsOptionalOrHidden(t)}destroy(){this.csf&&this.csf.destroy()}getRootNode(){return this.rootNode}showValidation(){const{numDateFields:t,state:n}=this;Object.keys(n.valid).reduce(Th(t,n),[]).forEach(o=>{const r=Dh(o,this.rootNode,n);this.handleOnError(r,!!n.detectedUnsupportedBrands),this.csf&&this.csf.isValidated&&this.csf.isValidated(o,r.error)})}mapErrorsToValidationRuleResult(){return Object.keys(this.state.errors).reduce((t,n)=>{const o=this.state.errors[n];return t[n]=o?{isValid:!1,errorMessage:ml(o,Ft),errorI18n:this.props.i18n.get(Cl(o,this.state.brand==="amex")),error:o,rootNode:this.rootNode,...this.state.detectedUnsupportedBrands&&{detectedBrands:this.state.detectedUnsupportedBrands}}:null,t},{})}processBinLookupResponse(t,n){if(this.state.detectedUnsupportedBrands&&(this.setState(i=>({errors:{...i.errors,[H]:null},detectedUnsupportedBrands:null})),this.csf&&t)){const i={type:"card",fieldType:"encryptedCardNumber",error:""};this.handleUnsupportedCard(i)}this.issuingCountryCode=t?.issuingCountryCode?.toLowerCase();const o=n?.brand,r=o&&Ch.includes(n.brand);r&&this.setState(n,()=>{this.props.onChange(this.state)}),this.csf&&this.csf.brandsFromBinLookup(t,r?n:null)}render(t,n){return t.render({setRootNode:this.setRootNode,setFocusOn:this.setFocusOn},n)}constructor(t){super(t),re(this,"csfLoadFailTimeout",void 0),re(this,"csfLoadFailTimeoutMS",void 0),re(this,"csfConfigFailTimeout",void 0),re(this,"csfConfigFailTimeoutMS",void 0),re(this,"numCharsInField",void 0),re(this,"rootNode",void 0),re(this,"numDateFields",void 0),re(this,"csf",void 0),re(this,"handleOnLoad",void 0),re(this,"handleOnConfigSuccess",void 0),re(this,"handleOnFieldValid",void 0),re(this,"handleOnAllValid",void 0),re(this,"handleOnBrand",void 0),re(this,"handleFocus",void 0),re(this,"handleOnError",void 0),re(this,"handleOnAutoComplete",void 0),re(this,"handleOnNoDataRequired",void 0),re(this,"handleOnTouchstartIOS",void 0),re(this,"handleKeyDown",void 0),re(this,"state",void 0),re(this,"props",void 0),re(this,"issuingCountryCode",void 0),re(this,"setRootNode",o=>{this.rootNode=o});const n={status:"loading",brand:t.type,errors:{},valid:{},data:{},cvcPolicy:$t,expiryDatePolicy:Pt,isSfpValid:!1,hasKoreanFields:t.hasKoreanFields};this.state=n,this.csfLoadFailTimeout=null,this.csfLoadFailTimeoutMS=3e4,this.csfConfigFailTimeout=null,this.csfConfigFailTimeoutMS=15e3,this.numCharsInField={},this.handleOnLoad=pt.handleOnLoad.bind(this),this.handleOnConfigSuccess=pt.handleOnConfigSuccess.bind(this),this.handleOnFieldValid=pt.handleOnFieldValid.bind(this),this.handleOnAllValid=pt.handleOnAllValid.bind(this),this.handleOnBrand=pt.handleOnBrand.bind(this),this.handleFocus=pt.handleFocus.bind(this),this.handleOnError=pt.handleOnError.bind(this),this.handleOnNoDataRequired=pt.handleOnNoDataRequired.bind(this),this.handleOnAutoComplete=pt.handleOnAutoComplete.bind(this),this.handleOnTouchstartIOS=pt.handleOnTouchstartIOS.bind(this),this.handleKeyDown=pt.handleKeyDown.bind(this),this.processBinLookupResponse=this.processBinLookupResponse.bind(this),this.setFocusOn=this.setFocusOn.bind(this),this.updateStyles=this.updateStyles.bind(this),this.handleUnsupportedCard=this.handleUnsupportedCard.bind(this),this.showValidation=this.showValidation.bind(this),this.destroy=this.destroy.bind(this)}}re(_l,"defaultProps",Np);var ar={type:"scheme",setComponentRef:()=>{},autoFocus:!0,billingAddressAllowedCountries:[],billingAddressMode:Ri.full,billingAddressRequired:!1,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},data:{billingAddress:{}},disableIOSArrowKeys:!1,enableStoreDetails:!1,exposeExpiryDate:!1,forceCompat:!1,hasHolderName:!1,holderNameRequired:!1,hasCVC:!0,hideCVC:!1,installmentOptions:{},keypadFix:!0,legacyInputMode:!1,maskSecurityCode:!1,minimumExpiryDate:null,name:null,placeholders:{},positionHolderNameOnTop:!1,showBrandIcon:!0,showInstallmentAmounts:null,styles:{},trimTrailingSeparator:!0,isPayButtonPrimaryVariant:!0,showContextualElement:!0,onLoad:e=>{},onConfigSuccess:e=>{},onAllValid:e=>{},onFieldValid:e=>{},onBrand:e=>{},onError:e=>{},onBinValue:e=>{},onBlur:e=>{},onFocus:e=>{},onChange:()=>{}};const Yp=11;function Zp(e){return e.replace(/\W/gi,"").replace(/(\d{3})(?!$)/g,"$1.").replace(/(.{11}).(\d{1,2})$/g,"$1-$2")}function Qp(e){return e.replace(/^(\d{2})(\d{3})(\d{3})?(\d{4})?(\d{1,2})?$/g,(t,n,o,r,i="",a="")=>`${n}.${o}.${r}/${i}${a.length?`-${a}`:""}`)}function Jp(e){return e.replace(/[^0-9]/g,"").trim()}function Xp(e=""){if(typeof e!="string")return"";const t=Jp(e);return t.length>Yp?Qp(t):Zp(t)}function e0(e){return/(^\d{3}\.\d{3}\.\d{3}-\d{2}$)|(^\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}$)/.test(e)}const t0=(e,t,n,o)=>e[n]?.[t]?.formatterFn?null:e[n]?.[t]?.maxlength||30,Jt=e=>!(e!=null&&!/^[\s]*$/.test(e)),wl="?\\+_=!@#$%^&*(){}~<>\\[\\]\\\\",Xt=(e,t="g")=>new RegExp(`[${e}]`,t),n0=e=>e.trim().replace(/\s+/g," "),o0={socialSecurityNumber:Xp},Sl={socialSecurityNumber:[{modes:["blur"],validate:e=>Jt(e)?null:e0(e),errorMessage:sl}],taxNumber:[{modes:["blur"],validate:e=>Jt(e)?null:e?.length===6||e?.length===10,errorMessage:bi}],holderName:[{modes:["blur"],validate:e=>!Jt(e)||null,errorMessage:gi}],default:[{modes:["blur"],validate:e=>!!e&&typeof e=="string"&&e.trim().length>0}]},r0=(e,t)=>{const n=Sl[e];return(Array.isArray(n)?n:[n]).reduce((o,r)=>(o.length||r.modes.includes(t)&&o.push(r.validate),o),[])[0]??(()=>!0)};function i0(e,t){const[n,o]=e;return{dualBrandSelectElements:[{id:n.brand,brandObject:n},{id:o.brand,brandObject:o}],selectedBrandValue:t?n.brand:"",leadBrand:n}}const Vi=["cartebancaire","bcmc","dankort"],a0=(e,t)=>e.reduce((n,o)=>n||t.includes(o.brand),!1),kl=e=>e.map(t=>({...t})),s0=(e,t="mc",n="visa")=>{const o=kl(e);return o[0].brand!==t&&o[0].brand!==n&&o.reverse(),o.length=1,o};function l0(e,t,n,o={}){const{type:r,cvcPolicy:i}=e,{sfp:a}=t,{dualBrandSelectElements:s,setDualBrandSelectElements:l,setSelectedBrandValue:c,issuingCountryCode:d,setIssuingCountryCode:p}=n;return{processBinLookup:(h,m)=>{const f=h?.issuingCountryCode?h.issuingCountryCode.toLowerCase():null;if(p(f),!h||!Object.keys(h).length){l([]),c("");const y=m&&r!=="card"?r:null;return a.current.processBinLookupResponse(h,{brand:y,cvcPolicy:i}),void(o.current=0)}if(h.supportedBrands?.length){const y=a0(h.supportedBrands,rl),b=y?s0(h.supportedBrands):kl(h.supportedBrands);if(b.length>1){const v=Bi(Vi,b,"brand"),C=i0(b,v);l(C.dualBrandSelectElements),c(C.selectedBrandValue),a.current.processBinLookupResponse({issuingCountryCode:h.issuingCountryCode,supportedBrands:[C.leadBrand]}),C.leadBrand.panLength>0&&(o.current=C.leadBrand.panLength)}else l([]),c(""),y||c(b[0].brand),a.current.processBinLookupResponse({issuingCountryCode:h.issuingCountryCode,supportedBrands:b}),b[0].panLength>0&&(o.current=b[0].panLength)}},handleDualBrandSelection:h=>{let m=[];h&&(m=s.reduce((f,y)=>(y.brandObject.brand===h&&f.push(y.brandObject),f),[]),m.length&&(c(h),a.current.processBinLookupResponse({issuingCountryCode:d,supportedBrands:m,isDualBrandSelection:!0})))}}}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let c0=class{hasError(t=!1){return t?!this.isValid&&this.shouldValidate:this.isValid!=null&&!this.isValid&&this.shouldValidate}constructor(t,n,o,r,i){sr(this,"shouldValidate",void 0),sr(this,"isValid",void 0),sr(this,"errorMessage",void 0),sr(this,"errorI18n",void 0),this.shouldValidate=t.modes.includes(o),this.isValid=t.validate(n,r),this.errorMessage=t.errorMessage,typeof t.errorMessage=="string"?this.errorI18n=i.get(t.errorMessage):t.errorMessage&&(this.errorI18n=i.get(t.errorMessage.translationKey,t.errorMessage.translationObject))}};function Ui(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let d0=class{get isValid(){return this.validationResults.reduce((t,n)=>t&&n.isValid,!0)}hasError(t=!1){return!!this.getError(t)}getError(t=!1){return this.validationResults.find(n=>n.hasError(t))}getAllErrors(){return this.validationResults.filter(t=>t.hasError())}constructor(t){Ui(this,"validationResults",void 0),this.validationResults=t}},u0=class{setRules(t){this.rules={...this.rules,...t}}getRulesFor(t){let n=this.rules[t]??this.rules.default;return Array.isArray(n)||(n=[n]),n}validate({key:t,value:n,mode:o="blur"},r){const i=this.getRulesFor(t).map(a=>new c0(a,n,o,r,this.i18n));return new d0(i)}constructor(t,n){Ui(this,"rules",{default:{validate:()=>!0,modes:["blur","input"]}}),Ui(this,"i18n",void 0),this.setRules(t),this.i18n=n}};const Cn=(e,t)=>Object.keys(e).filter(n=>!t.includes(n)).reduce((n,o)=>(n[o]=e[o],n),{}),Hi=(e,t,n,o,r)=>t.reduce((i,a)=>({...i,[a]:i[a]??r?.[a]??o?.[a]??n}),e);function El({schema:e,defaultData:t,processField:n,fieldProblems:o}){const r=a=>{if(t[a]===void 0)return{valid:!1,errors:null,data:null,fieldProblems:o?.[a]??null};const[s,l]=n({key:a,value:t[a],mode:"blur"},{state:{data:t}});return{valid:l.isValid&&!o?.[a]||!1,errors:l.hasError()?l.getError():null,data:s,fieldProblems:o?.[a]??null}},i=e.reduce((a,s)=>{const{valid:l,errors:c,data:d,fieldProblems:p}=r(s);return{valid:{...a.valid,[s]:l},errors:{...a.errors,[s]:c},data:{...a.data,[s]:d},fieldProblems:{...a.fieldProblems,[s]:p}}},{data:{},valid:{},errors:{},fieldProblems:{}});return{schema:e,data:i.data,valid:i.valid,errors:i.errors,fieldProblems:i.fieldProblems}}function h0(e){return function(t,{type:n,key:o,value:r,mode:i,schema:a,defaultData:s,formValue:l,selectedSchema:c,fieldProblems:d,data:p}){const h=c||t.schema;switch(n){case"setData":return{...t,data:{...t.data,[o]:r}};case"mergeData":return{...t,data:{...t.data,...p}};case"setValid":return{...t,valid:{...t.valid,[o]:r}};case"setErrors":return{...t,errors:{...t.errors,[o]:r}};case"setFieldProblems":return t?.schema?.reduce((m,f)=>({...m,fieldProblems:{...t.fieldProblems,[f]:d?.[f]??null},valid:{...t.valid,[f]:t.valid?.[f]&&!d[f]}}),t)??t;case"updateField":{const[m,f]=e({key:o,value:r,mode:i},{state:t}),y=t.data[o],b={...t.fieldProblems};return y!==m&&(b[o]=null),{...t,data:{...t.data,[o]:m},errors:{...t.errors,[o]:f.hasError()?f.getError():null},valid:{...t.valid,[o]:f.isValid&&!b[o]||!1},fieldProblems:b}}case"mergeForm":{const m={...t,data:{...t.data,...l.data},errors:{...t.errors,...l.errors},valid:{...t.valid,...l.valid},fieldProblems:{...t.fieldProblems,...l.fieldProblems}};return m.valid&&(m.isValid=Object.values(m.valid).every(f=>f)),m}case"setSchema":{const m=El({schema:a,defaultData:s,processField:e,fieldProblems:d}),f=t.schema.filter(S=>!a.includes(S)),y=a.filter(S=>!t.schema.includes(S)),b={data:Cn(t.data,y),errors:Cn(t.errors,y),valid:Cn(t.valid,y)},v=Hi(Cn(t.data,f),y,null,m.data,t.local?.data),C=Hi(Cn(t.valid,f),y,!1,m.valid,t.local?.valid),_=Hi(Cn(t.errors,f),y,null,m.errors,t.local?.errors);return{...t,schema:a,data:v,valid:C,errors:_,local:b}}case"validateForm":{const m=h.reduce((f,y)=>{const[,b]=e({key:y,value:t.data[y],mode:"blur"},{state:t});return{valid:{...f.valid,[y]:b.isValid&&!t.fieldProblems[y]||!1},errors:{...f.errors,[y]:b.hasError(!0)?b.getError(!0):null}}},{valid:t.valid,errors:t.errors});return{...t,valid:m.valid,errors:m.errors}}default:throw new Error("Undefined useForm action")}}}function to(e){const{rules:t,formatters:n,defaultData:o,fieldProblems:r,schema:i}=e,a=t??{},s=n??{},l=o??{},c=r??{},d=i??[],{i18n:p}=O(),h=te(()=>new u0(a,p),[a]),m=({key:N,value:L,mode:U},ye)=>{const Q=s?.[N],ne=(function(we){return we&&"formatterFn"in we})(Q)?Q.formatterFn:Q,be=ne&&typeof ne=="function"?ne(L??"",ye):L;return[be,h.validate({key:N,value:be,mode:U},ye)]},[f,y]=Qs(h0(m),{defaultData:l,schema:d,processField:m,fieldProblems:c},El),b=te(()=>f.schema.reduce((N,L)=>N&&f.valid[L],!0),[f.schema,f.valid]),v=T((N=null)=>{y({type:"validateForm",selectedSchema:N})},[]),C=T((N,L)=>y({type:"setErrors",key:N,value:L}),[]),_=T((N,L)=>y({type:"setValid",key:N,value:L}),[]),S=T((N,L)=>y({type:"setData",key:N,value:L}),[]),E=T(N=>y({type:"mergeData",data:N}),[]),k=T(N=>y({type:"setSchema",schema:N,defaultData:l}),[f.schema]),A=T(N=>y({type:"mergeForm",formValue:N}),[]),$=T(N=>y({type:"setFieldProblems",fieldProblems:N}),[f.schema]);return R(()=>{$(c??{})},[JSON.stringify(c)]),{handleChangeFor:(N,L)=>U=>{const ye=((Q,ne)=>ne.target?ne.target.type==="checkbox"?!f.data[Q]:ne.target.value:ne)(N,U);y({type:"updateField",key:N,value:ye,mode:L})},triggerValidation:v,setSchema:k,setData:S,mergeData:E,setValid:_,setErrors:C,isValid:b,mergeForm:A,setFieldProblems:$,schema:f.schema,valid:f.valid,errors:f.errors,data:f.data,fieldProblems:f.fieldProblems}}let xl=class{countryHasDataset(t){return!!this.specifications?.[t]?.hasDataset}countryHasOptionalField(t,n){return!!this.specifications?.[t]?.optionalFields?.includes(n)}getAddressSchemaForCountry(t){return this.specifications?.[t]?.schema||this.specifications.default.schema}getAddressLabelsForCountry(t){return this.specifications?.[t]?.labels||this.specifications.default.labels}getOptionalFieldsForCountry(t){return this.specifications?.[t]?.optionalFields||this.specifications.default?.optionalFields||[]}getKeyForField(t,n){return this.specifications?.[n]?.labels?.[t]||this.specifications?.default?.labels?.[t]||t}getPlaceholderKeyForField(t,n){return this.specifications?.[n]?.placeholders?.[t]||this.specifications?.default?.placeholders?.[t]}getAddressSchemaForCountryFlat(t){return this.getAddressSchemaForCountry(t).flat(2).filter(n=>typeof n=="string")}constructor(t){var n,o,r;r=void 0,(o="specifications")in(n=this)?Object.defineProperty(n,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[o]=r,this.specifications={...Mi,...t}}};function p0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pl={exports:{}};var Tl;function m0(){return Tl||(Tl=1,e=Pl,(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()),Pl.exports;var e}var I=p0(m0());const _n=({inline:e=!1,size:t="large"})=>u("div",{"data-testid":"spinner",className:"adyen-checkout__spinner__wrapper "+(e?"adyen-checkout__spinner__wrapper--inline":"")},u("div",{className:`adyen-checkout__spinner adyen-checkout__spinner--${t}`})),Dl=jo({srPanel:null,setSRMessagesFromObjects:null,setSRMessagesFromStrings:null,clearSRPanel:null,shouldMoveFocusSR:null});function Nl(){return Wt(Dl)}const Al=e=>{const{srPanel:t}=Nl();R(()=>{if(t)return t.setAriaProps({"aria-relevant":"additions text"}),()=>{t.setAriaProps({"aria-relevant":t.constructor.defaultProps.ariaAttributes["aria-relevant"]})}},[t]),R(()=>{t&&e!==void 0&&t.setMessages(e)},[t,e])},f0=(e,t)=>{const{i18n:n}=O(),o=W(e);e&&(o.current=!0);const r=e?n.get("loading"):o.current?n.get("loaded"):void 0;Al(r)},Il=({children:e,status:t})=>{f0(t==="loading");const n=I("adyen-checkout__loading-input__form","loading-input__form",{"loading-input__form--loading":t==="loading"}),o=I({"loading-input__spinner":!0,"loading-input__spinner--active":t==="loading"});return u("div",{style:{position:"relative"}},u("div",{className:o},u(_n,null)),u("div",{className:n},e))};function y0({frontCVC:e=!1}){const t=I({"adyen-checkout__card__cvc__hint__wrapper":!0,"adyen-checkout__field__cvc--front-hint":!!e,"adyen-checkout__field__cvc--back-hint":!e});return u("span",{className:t},u("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front","data-testid":"cvc-hint-front",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},u("path",{d:"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z",fill:"#E6E9EB"}),u("rect",{x:"4",y:"12",width:"19",height:"2",fill:"#B9C4C9"}),u("rect",{x:"4",y:"4",width:"4",height:"4",rx:"1",fill:"white"}),u("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"4.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})),u("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back","data-testid":"cvc-hint-back",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},u("path",{d:"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z",fill:"#E6E9EB"}),u("path",{d:"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z",fill:"#E6E9EB"}),u("rect",{y:"4.00012",width:"27",height:"3.00001",fill:"#687282"}),u("path",{d:"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z",fill:"white"}),u("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"9.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})))}function fe(e){const{backgroundUrl:t="",className:n="",classNameModifiers:o=[],src:r="",alt:i="",showOnError:a=!1}=e,[s,l]=w(!1),c=W(null),d=()=>{l(!0)},p=I([n],"adyen-checkout__image",{"adyen-checkout__image--loaded":s},...o.map(h=>`adyen-checkout__image--${h}`));return R(()=>{const h=t?new Image:c.current;h.src=t||r,h.onload=d,l(!!h.complete)},[]),t?u("div",{"data-testid":"background",style:{backgroundUrl:t},...e,className:p}):u("img",{...e,alt:i,ref:c,className:p,onError:h=>{l(a),e?.onError?.(h)}})}const lr=({type:e,className:t="",alt:n="",height:o,width:r})=>{const i=Pe(),a=i({imageFolder:"components/"})?.(e);return u(fe,{className:I("adyen-checkout__icon",t),alt:n,src:a,height:o,width:r})};let Rl=Date.now();const Ki=(e="field")=>(Rl+=1,`${e}-${Rl}`),en="bento_",me=e=>{const{children:t,className:n,classNameModifiers:o,dir:r,disabled:i,readOnly:a,errorMessage:s,helper:l,inputWrapperModifiers:c,isLoading:d,isValid:p,label:h,labelEndAdornment:m,name:f,onBlur:y,onFieldBlur:b,onFocus:v,onFocusField:C,showValidIcon:_,useLabelElement:S,showErrorElement:E,showContextualElement:k,staticValue:A,contextualText:$,filled:N,focused:L,i18n:U,contextVisibleToScreenReader:ye,renderAlternativeToLabel:Q,onInputContainerClick:ne,errorLive:be}=e,we=ye??!0,Fe=E&&typeof s=="string"&&s.length>0,Me=k&&!Fe&&$&&$.length>0,ve=W(Ki(`adyen-checkout-${f}`)),Qe=te(()=>A?`input-static-value-${Be()}`:null,[A]),[Je,M]=w(!1),[ae,de]=w(!1);L!=null&&M(!!L),N!=null&&de(!!N);const ie=T(D=>{M(!0),v?.(D)},[v]),Le=T(D=>{M(!1),y?.(D),b?.(D)},[y,b]),Xe=T(()=>u(G,null,typeof h=="string"&&u("span",{className:I({"adyen-checkout__label__text":!0,"adyen-checkout__label__text--error":s}),"data-id":f,"data-testid":f},h),typeof h=="function"&&h(),m&&u("span",{className:"adyen-checkout__label-adornment--end"},m),l&&u("span",{className:"adyen-checkout__helper-text"},l)),[h,s,m,l]),Se=T(()=>{const D=u("span",{className:I({"adyen-checkout-contextual-text--error":!0,"adyen-checkout-contextual-text--hidden":!Fe}),...we&&{id:`${ve.current}${Go}`},"aria-hidden":we?void 0:"true",...we&&be&&{"aria-live":"polite"}},s),q=u("span",{className:I({"adyen-checkout-contextual-text":!0,"adyen-checkout-contextual-text--hidden":!Me}),...we&&{id:`${ve.current}${Yo}`},"aria-hidden":we?void 0:"true"},$);return u(G,null,u("div",{className:I(["adyen-checkout__input-wrapper",...c.map(ke=>`adyen-checkout__input-wrapper--${ke}`)]),dir:r,onClick:ne},A&&u("span",{id:Qe,className:"adyen-checkout__field-static-value"},A),Ho(t).map(ke=>{const gt={isValid:p,onFocusHandler:ie,onBlurHandler:Le,isInvalid:!!s,"aria-owns":Qe,...f&&{uniqueId:ve.current},showErrorElement:E};return uh(ke,gt)}),d&&u("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--loading"},u(_n,{size:"small"})),p&&_!==!1&&u("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--valid"},u(lr,{type:`${en}checkmark_black`,alt:U?.get("field.valid")})),s&&u("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--invalid"},u(lr,{type:`${en}field_error`,alt:U?.get("error.title")}))),D,q)},[t,s,$,d,p,ie,Le]),je=T(({onFocusField:D,focused:q,filled:ke,disabled:gt,name:dn,uniqueId:un,useLabelElement:Io,isSecuredField:rs,children:Br,renderAlternativeToLabel:Kt})=>{const dt={onClick:D,className:I({"adyen-checkout__label":!0,"adyen-checkout__label--focused":q,"adyen-checkout__label--filled":ke,"adyen-checkout__label--disabled":gt})};return Io?u("label",{...dt,...!rs&&dn&&{htmlFor:un,id:`${un}-label`}},Br):Kt(dt,Br,un)},[]);return u("div",{"data-testid":"form-field",className:I("adyen-checkout__field",n,o?.map(D=>`adyen-checkout__field--${D}`),{"adyen-checkout__field--error":s,"adyen-checkout__field--valid":p,"adyen-checkout__field--inactive":a||i})},u(je,{onFocusField:C,name:f,disabled:i,filled:ae,focused:Je,useLabelElement:S,uniqueId:ve.current,isSecuredField:!we,renderAlternativeToLabel:Q},Xe()),Se())};me.defaultProps={className:"",classNameModifiers:[],inputWrapperModifiers:[],useLabelElement:!0,showErrorElement:!0,showContextualElement:!0,renderAlternativeToLabel:()=>null};function cr(e){const t={[tl]:e.encryptedFieldType,[nl]:e["data-info"],[ol]:e.uniqueId,className:e.className};return u("span",t,e.children)}const no=(e,t)=>u("div",{...e,"aria-hidden":"true"},t);function $l(e){const{label:t,onFocusField:n=()=>{},errorCode:o="",className:r="",classNameModifiers:i=[],focused:a,filled:s,isValid:l,frontCVC:c=!1,cvcPolicy:d=$t,showContextualElement:p,contextualText:h}=e,{i18n:m}=O(),f=o?m.get(Cl(o,c)):"",y=I(r,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":d===qo,"adyen-checkout__field__cvc--optional":d===Gn}),b=I({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":a,"adyen-checkout__input--valid":l}),v=d!==Gn?t:m.get("creditCard.securityCode.label.optional");return u(me,{label:v,focused:a,filled:s,classNameModifiers:[...i,"securityCode"],onFocusField:()=>n(j),className:y,errorMessage:f,isValid:l,dir:"ltr",name:j,i18n:m,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:no,showContextualElement:p,contextualText:h,onInputContainerClick:()=>{n(j)}},u(cr,{encryptedFieldType:j,className:b}),u(y0,{frontCVC:c}))}function dr({setRef:e,...t}){const{autoCorrect:n,classNameModifiers:o,isInvalid:r,isValid:i,readonly:a=null,spellcheck:s,type:l,uniqueId:c,disabled:d}=t,p=t.className;Object.prototype.hasOwnProperty.call(t,"onChange")&&console.error("Error: Form fields that rely on InputBase may not have an onChange property");const h=T(L=>{t.onInput?.(L)},[t.onInput]),m=T(L=>{t?.onKeyDown&&t.onKeyDown(L)},[t?.onKeyDown]),f=T(L=>{if(t?.onBlurHandler?.(L),t.trimOnBlur){const U=L.target;U.value=n0(U.value)}t?.onBlur?.(L)},[t.onBlur,t.onBlurHandler]),y=T(L=>{t?.onFocusHandler?.(L)},[t.onFocusHandler]),b=I("adyen-checkout__input",[`adyen-checkout__input--${l}`],p,{"adyen-checkout__input--invalid":r,"adyen-checkout__input--valid":i},(o??[]).map(L=>`adyen-checkout__input--${L}`)),{classNameModifiers:v,uniqueId:C,isInvalid:_,isValid:S,addContextualElement:E,"aria-describedby":k,autocomplete:A,...$}=t,N=[typeof k=="string"&&k?k:null,c?`${c}${r?Go:Yo}`:null].filter(Boolean).join(" ")||null;return u("input",{id:c,...$,autocomplete:A,"aria-required":$.required,type:l,className:b,readOnly:a,spellcheck:s,autoCorrect:n,"aria-describedby":N,"aria-invalid":r,onInput:h,onBlur:f,onFocus:y,onKeyDown:m,disabled:d,ref:e})}dr.defaultProps={type:"text",classNameModifiers:[]};function oo(e){return u(dr,{classNameModifiers:["large"],...e,"aria-required":e.required,type:"text"})}function ur({children:e,classNameModifiers:t=[],classNamesFields:n=[],label:o,readonly:r=!1,description:i,id:a,renderLabelAsSectionHeading:s=!1,descriptionId:l}){const{i18n:c}=O(),d=te(()=>Ki("fieldset-description"),[]),p=l??d;return u("fieldset",{id:a,className:I(["adyen-checkout__fieldset",...t.map(h=>`adyen-checkout__fieldset--${h}`),{"adyen-checkout__fieldset--readonly":r}])},o&&u("legend",{className:"adyen-checkout__fieldset__title"},s?u("h2",{className:"adyen-checkout__fieldset__title-heading"},c.get(o)):c.get(o)),i&&u("p",{id:p,className:"adyen-checkout__fieldset__description"},c.get(i)),u("div",{className:I("adyen-checkout__fieldset__fields",n)},e))}function g0({brand:e,hasCVC:t,onFocusField:n,errors:o,valid:r,cvcPolicy:i,focusedElement:a,lastFour:s,expiryMonth:l,expiryYear:c,showContextualElement:d}){const{i18n:p}=O(),h=`${p.get("creditCard.storedCard.description.ariaLabel").replace("%@",s)}${l&&c?` ${p.get("creditCard.expiryDate.label")} ${l}/${c}`:""}`,m=e==="amex",f=m?p.get("creditCard.securityCode.contextualText.4digits"):p.get("creditCard.securityCode.contextualText.3digits");return u("div",{className:"adyen-checkout__card__form adyen-checkout__card__form--oneClick","aria-label":h},u(ur,{classNamesFields:["adyen-checkout__card__exp-cvc"]},l&&c&&u(me,{label:p.get("creditCard.expiryDate.label"),classNameModifiers:["col-50","storedCard"],name:"expiryDateField",disabled:!0},u(oo,{name:"expiryDateField",className:"adyen-checkout__input adyen-checkout__input--disabled adyen-checkout__card__exp-date__input--oneclick",value:`${l} / ${c}`,disabled:!0,dir:"ltr",autocomplete:void 0})),t&&u($l,{cvcPolicy:i,errorCode:o[j],focused:a==="encryptedSecurityCode",filled:!!r.encryptedSecurityCode||!!o.encryptedSecurityCode,isValid:!!r.encryptedSecurityCode,label:p.get("creditCard.securityCode.label"),onFocusField:n,classNameModifiers:[...l&&c?["col-50","storedCard"]:["storedCard"]],frontCVC:m,showContextualElement:d,contextualText:f})))}function Fl(e){const{items:t,name:n,onChange:o,value:r,isInvalid:i,uniqueId:a,ariaLabel:s,style:l="classic"}=e,{i18n:c}=O(),d=a?.replace(/[0-9]/g,"").substring(0,a.lastIndexOf("-"));return u("div",{className:I(["adyen-checkout__radio_group",`adyen-checkout__radio_group--${l}`]),role:"radiogroup",...s&&{"aria-label":s}},t.map(p=>{const h=Ki(d);return u("div",{key:p.id,className:"adyen-checkout__radio_group__input-wrapper"},u("input",{id:h,type:"radio",checked:r===p.id,className:"adyen-checkout__radio_group__input",name:n,onChange:o,onClick:o,value:p.id}),u("label",{className:I(["adyen-checkout__label__text","adyen-checkout__radio_group__label",e.className,{"adyen-checkout__radio_group__label--invalid":i}]),htmlFor:h},c.get(p.name)))}))}Fl.defaultProps={onChange:()=>{},items:[],autocomplete:void 0};var ji={tag:"Tag-module_tag__zTym4",success:"Tag-module_success__UU5x9",info:"Tag-module_info__iyn3C"},zi=(function(e){return e.SUCCESS="success",e.INFO="info",e})({});const b0={[zi.SUCCESS]:ji.success,[zi.INFO]:ji.info},v0=({label:e,variant:t=zi.INFO})=>u("span",{className:I(ji.tag,b0[t])},e);var C0={tagList:"TagList-module_tagList__qCdT0"};const qi=({tags:e,className:t})=>e?.length?u("div",{className:I(C0.tagList,t)},e.map((n,o)=>u(v0,{key:`${o}-${n.label}`,label:n.label,variant:n.variant}))):null;function _0({filterable:e,toggleButtonRef:t,showList:n,selectListId:o,readonly:r,...i}){if(e){const{id:a,...s}=i;return u("div",{...s,ref:t})}return u("button",{role:"combobox",type:"button",id:i.id,className:i.className,"aria-haspopup":"listbox","aria-expanded":n,"aria-controls":o,"aria-activedescendant":i["aria-activedescendant"]||void 0,disabled:i.disabled,"aria-disabled":r,"aria-describedby":i["aria-describedby"],"aria-labelledby":i.id?`${i.id}-label ${i.id}-value`:void 0,onClick:i.onClick,onKeyDown:i.onKeyDown,ref:t},i.children)}function w0(e){const{active:t,selected:n,inputText:o,readonly:r,showList:i,required:a}=e,s=te(()=>{const h=n.selectedOptionName||n.name;return!(typeof h=="string"&&h.trim()!=="")},[n,e.placeholder]),l=n.selectedOptionName||n.name||e.placeholder||"",c=i?o??"":l,d=h=>{h.preventDefault(),e.filterInputRef.current?.focus(),h.target===e.filterInputRef.current&&e.showList||e.toggleList(h)},p=t.id?`listItem-${t.id}`:"";return u(_0,{className:I({"adyen-checkout__dropdown__button":!0,"adyen-checkout__dropdown__button--readonly":r,"adyen-checkout__dropdown__button--active":i,"adyen-checkout__dropdown__button--invalid":e.isInvalid,"adyen-checkout__dropdown__button--valid":e.isValid,"adyen-checkout__dropdown__button--disabled":n.disabled}),disabled:e.disabled,filterable:e.filterable,readonly:r,onClick:r?null:e.filterable?d:e.toggleList,onKeyDown:r?null:e.onButtonKeyDown,toggleButtonRef:e.toggleButtonRef,id:e.id,showList:i,selectListId:e.selectListId,"aria-activedescendant":!e.filterable&&i&&p||void 0,"aria-describedby":e.ariaDescribedBy},e.filterable?u(G,null,!i&&n.icon&&u(fe,{className:"adyen-checkout__dropdown__button__icon",src:n.icon,alt:n.name}),u("input",{value:c,"aria-autocomplete":"list","aria-controls":e.selectListId,"aria-expanded":i,"aria-owns":e.selectListId,autoComplete:"off",className:I("adyen-checkout__filter-input",{"adyen-checkout__filter-input--placeholder":!i&&s}),onInput:e.onInput,ref:e.filterInputRef,role:"combobox","aria-activedescendant":p,type:"text",readOnly:e.readonly,"aria-disabled":e.readonly,id:e.id,"aria-describedby":e.ariaDescribedBy,required:a}),!i&&u(qi,{tags:n.tags,className:"adyen-checkout__dropdown__button__tags"})):u(G,null,n.icon&&u(fe,{className:"adyen-checkout__dropdown__button__icon",src:n.icon,alt:n.name}),u("span",{id:e.id?`${e.id}-value`:void 0,className:I("adyen-checkout__dropdown__button__text",{"adyen-checkout__dropdown__button__text-placeholder":s})},l),u(qi,{tags:n.tags,className:"adyen-checkout__dropdown__button__tags"})))}const S0=({item:e,active:t,selected:n,...o})=>u("li",{"aria-disabled":!!e.disabled,"aria-selected":n,className:I(["adyen-checkout__dropdown__element",{"adyen-checkout__dropdown__element--active":t,"adyen-checkout__dropdown__element--disabled":!!e.disabled}]),"data-disabled":e.disabled===!0||null,"data-value":e.id,onClick:o.onSelect,onMouseEnter:o.onHover,role:"option",id:`listItem-${e.id}`},u("div",{className:"adyen-checkout__dropdown__element__content"},u("div",{className:"adyen-checkout__dropdown__element__primary"},e.icon&&u(fe,{className:"adyen-checkout__dropdown__element__icon",alt:e.name,src:e.icon}),u("span",{className:"adyen-checkout__dropdown__element__text"},e.name)),e.secondaryText&&u("span",{className:"adyen-checkout__dropdown__element__secondary-text"},e.secondaryText)),u(qi,{tags:e.tags,className:"adyen-checkout__dropdown__element__tags"}),n&&u(lr,{type:`${en}checkmark_black`,height:14,width:14}));function k0({selected:e,active:t,filteredItems:n,showList:o,...r}){const{i18n:i}=O();return u("ul",{className:I({"adyen-checkout__dropdown__list":!0,"adyen-checkout__dropdown__list--active":o}),id:r.selectListId,ref:r.selectListRef,role:"listbox"},n.length?n.map(a=>u(S0,{active:a.id===t.id,item:a,key:a.id,onSelect:r.onSelect,onHover:r.onHover,selected:a.id===e.id})):u("li",null,u("div",{className:"adyen-checkout__dropdown__element adyen-checkout__dropdown__element--no-options"},i.get("select.noOptionsFound"))))}const ot={arrowDown:"ArrowDown",arrowUp:"ArrowUp",enter:"Enter",escape:"Escape",space:" ",tab:"Tab"},E0=e=>{const t=e.parentNode,n=window.getComputedStyle(t,null),o=parseInt(n.getPropertyValue("border-top-width")),r=e.offsetTop-t.offsetTop<t.scrollTop,i=e.offsetTop-t.offsetTop+e.clientHeight-o>t.scrollTop+t.clientHeight;(r||i)&&(t.scrollTop=e.offsetTop-t.offsetTop-t.clientHeight/2-o+e.clientHeight/2)},Ml=e=>{e.key!=="Enter"&&e.code!=="Enter"&&e.key!==" "&&e.code!=="Space"||e.stopPropagation()};function tn({items:e=[],className:t="",classNameModifiers:n=[],filterable:o=!0,readonly:r=!1,onChange:i=()=>{},onInput:a,selectedValue:s,name:l,isInvalid:c,isValid:d,placeholder:p,uniqueId:h,disabled:m,disableTextFilter:f,clearOnSelect:y,blurOnClose:b,onListToggle:v,required:C,additionalDescribedBy:_}){const{i18n:S}=O(),E=W(null),k=W(null),A=W(null),$=W(null),[N,L]=w(null),[U,ye]=w(!1),[Q,ne]=w(null),be=te(()=>`select-${Be()}`,[]),we=e.find(D=>D.id===s)||{},[Fe,Me]=w(),[ve,Qe]=w(we),Je=we,M=f?e:e.filter(D=>!N||D.name.toLowerCase().includes(N.toLowerCase())),ae=[h?`${h}${c?Go:Yo}`:null,_].filter(Boolean).join(" ")||null,de=D=>{if(!D)return;const q=document.getElementById(`listItem-${D.id}`);E0(q)},ie=()=>{b&&E.current.blur(),ye(!1)},Le=()=>{ye(!0)},Xe=D=>{const q=D.currentTarget.getAttribute("data-value");return M.find(ke=>ke.id==q)},Se=D=>{let q;D.preventDefault(),q=D.currentTarget instanceof HTMLElement&&D.currentTarget.getAttribute("role")==="option"?Xe(D):ve.id&&M.some(ke=>ke.id===ve.id)?ve:N?M[0]:{id:s},q&&!q.disabled&&(i({target:{value:q.id,name:l}}),y&&Me(null),ie())},je=D=>{switch(D.key){case ot.space:case ot.enter:Se(D);break;case ot.arrowDown:D.preventDefault(),(()=>{if(!M||M.length<1)return;const q=M.findIndex(dn=>dn.id===ve.id)+1,ke=q<M.length?q:0,gt=M[ke];de(gt),Qe(gt)})();break;case ot.arrowUp:D.preventDefault(),(()=>{if(!M||M.length<1)return;const q=M.findIndex(dn=>dn.id===ve.id)-1,ke=q<0?M.length-1:q,gt=M[ke];de(gt),Qe(gt)})()}};return R(()=>{U?Me(null):L(null)},[U]),R(()=>{U&&o&&E.current&&E.current.focus(),v?.(U)},[U]),R(()=>{function D(q){(q.composedPath?!q.composedPath().includes(k.current):!k.current.contains(q.target))&&ie()}return document.addEventListener("click",D,!1),()=>{document.removeEventListener("click",D,!1)}},[k]),R(()=>{const D=setTimeout(()=>{M.length===0?ne(S.get("select.noOptionsFound")):ne(S.get("select.results",{values:{count:M.length}}))},500);return()=>clearTimeout(D)},[U,M.length,S]),u("div",{className:I(["adyen-checkout__dropdown",t,...n.map(D=>`adyen-checkout__dropdown--${D}`)]),ref:k},u(w0,{inputText:Fe,id:h??null,active:ve,selected:Je,filterInputRef:E,filterable:o,isInvalid:c,isValid:d,onButtonKeyDown:D=>{Ml(D),D.key===ot.enter&&o&&U&&N?Se(D):D.key===ot.escape?ie():![ot.arrowUp,ot.arrowDown,ot.enter].includes(D.key)&&(D.key!==ot.space||o&&U)?(D.shiftKey&&D.key===ot.tab||D.key===ot.tab)&&ie():(D.preventDefault(),U?je(D):Le())},onInput:D=>{const q=D.target.value;Me(q),L(q),U||Le(),a&&a(q)},placeholder:p,readonly:r,selectListId:be,showList:U,toggleButtonRef:A,toggleList:D=>{D.preventDefault(),U?(Me(Je.name),ie()):(Me(null),Le())},disabled:m,ariaDescribedBy:ae,required:C}),u(k0,{active:ve,filteredItems:M,onHover:D=>{D.preventDefault();const q=Xe(D);Qe(q)},onSelect:Se,selected:Je,selectListId:be,selectListRef:$,showList:U}),u("div",{key:Fe,role:"status","aria-live":"polite","aria-relevant":"additions text",className:"adyen-checkout__dropdown__status"},Q))}tn.defaultProps={className:"",classNameModifiers:[],filterable:!0,items:[],readonly:!1,onChange:()=>{}};const hr=jo(void 0),ro=()=>{const e=Wt(hr);if(!e)throw new Error("useAmount must be used within an AmountProvider");return{amount:e.amount,isZeroAuth:e.amount?.value===0}},x0=()=>{const e=Wt(hr);if(!e)throw new Error("useAmount must be used within an AmountProvider");return{secondaryAmount:e.secondaryAmount}},P0=({amount:e,secondaryAmount:t,providerRef:n,children:o})=>{const r=Wt(hr),[i,a]=w(e),[s,l]=w(t);R(()=>{a(e)},[e]),hh(n,()=>({update:(d,p)=>{a(d),l(p)}}));const c=te(()=>({amount:i,secondaryAmount:s}),[i,s]);return r?u(G,null,o):u(hr.Provider,{value:c},o)};function Wi(e){const{i18n:t}=O(),{amount:n}=ro(),{brand:o,onChange:r,type:i}=e,a=e.installmentOptions[o]||e.installmentOptions.card,s=a?.values?.length===1,[l,c]=w(a?.preselectedValue||a?.values[0]),[d,p]=w("onetime"),h=a?.plans?.includes("revolving")||a?.plans?.includes("bonus"),m=te(()=>(function(v,C){return v?[{id:"onetime",name:"installments.oneTime"},{id:"installments",name:"installments.installments"},...C?.includes("revolving")?[{id:"revolving",name:"installments.revolving"}]:[],...C?.includes("bonus")?[{id:"bonus",name:"installments.bonus"}]:[]]:[]})(h,a?.plans),[h,a]),f=v=>{const C=v.target.value;c(Number(C))},y=v=>{const C=v.currentTarget.getAttribute("value");p(C)},b=v=>{let C,_;return i==="amount"?(C="installmentOption",_={count:v,values:{times:v,partialValue:(S=>t.amount(n.value/S,n.currency))(v)}}):(C="installmentOptionMonths",_={count:v,values:{times:v}}),{id:v,name:n.value?t.get(C,_):`${v}`}};return R(()=>{a?.values?.includes(l)||c(a?.preselectedValue??a?.values[0])},[o]),R(()=>{const v={value:l,...h&&d==="onetime"&&{value:1},...h&&d==="revolving"&&{value:1,plan:"revolving"},...h&&d==="bonus"&&{value:1,plan:"bonus"}};r(a?v:{value:null})},[r,h,l,a,d]),a&&n&&n.value!==0?h?u("div",{className:"adyen-checkout__installments adyen-checkout__installments--revolving-plan"},u(me,{label:t.get("installments"),classNameModifiers:["installments"],name:"installmentsPseudoLabel",useLabelElement:!1,showContextualElement:!1,renderAlternativeToLabel:no},u(ur,{classNameModifiers:["revolving-plan"],label:""},u(Fl,{items:m,onChange:y,value:d,ariaLabel:t.get("installments")}),u(me,{className:d!=="installments"?"revolving-plan-installments__disabled":"revolving-plan-installments",classNameModifiers:["revolving-plan-installments"],name:"",useLabelElement:!1,showContextualElement:!1},u(tn,{filterable:!1,items:a.values.map(b),selectedValue:l,onChange:f,name:"installments",disabled:d!=="installments"}))))):u("div",{className:"adyen-checkout__installments"},u(me,{label:t.get("installments"),classNameModifiers:["installments"],name:"installments",showContextualElement:!1},u(tn,{filterable:!1,items:a.values.map(b),selectedValue:l,onChange:f,name:"installments",readonly:s,disabled:s}))):null}Wi.defaultProps={brand:"",onChange:()=>{}};const Lt=(e,t=!1)=>{let n;try{n=new URL(e)}catch{return!1}return t&&n.protocol==="http:"||n.protocol==="https:"},Gi=["ar","bg-BG","ca-ES","cs-CZ","da-DK","de-DE","el-GR","en-US","es-ES","et-EE","fi-FI","fr-FR","hr-HR","hu-HU","is-IS","it-IT","ja-JP","ko-KR","lt-LT","lv-LV","nl-NL","no-NO","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","sv-SE","zh-CN","zh-TW"],pr="en-US",T0=2,D0=5,Yi=e=>e.toLowerCase().substring(0,2),Ll=e=>!!e&&e.length>=T0&&e.length<=D0;function Ol(e,t){if(!e||typeof e!="string")return null;const n=e.toLowerCase(),o=t.find(i=>i.toLowerCase()===n);if(o)return o;const r=Yi(e);return t.find(i=>Yi(i)===r)||null}function Bl(e){const t=e.replace("_","-");if(/^([a-z]{2})(-)([A-Z]{2})$/.test(t))return t;const[n,o]=t.split("-");if(!n||!o)return null;const r=[n.toLowerCase(),o.toUpperCase()].join("-");return r.length===5?r:null}function N0(e,t){if(!Ll(e))return pr;const n=Bl(e);return n&&t.includes(n)?n:Ol(n||e,t)||pr}function A0(e={}){return Object.keys(e).reduce((t,n)=>(Ll(n)&&(t[Bl(n)||Yi(n)]=e[n]),t),{})}const Zi=(e,t)=>e.replace(/%{(\w+)}/g,(n,o)=>t[o]||""),I0=(e,t,n={})=>{const{values:o={},count:r=0}=n,i=`${t}__plural`,a=s=>`${t}__${s}`;return Object.prototype.hasOwnProperty.call(e,a(r))?Zi(e[a(r)],o):Object.prototype.hasOwnProperty.call(e,i)&&r>1?Zi(e[i],o):Object.prototype.hasOwnProperty.call(e,t)?Zi(e[t],o):null},R0=(e,t)=>{const n=e.split(/%#(.*?)%#/gm);if(t.length!==Math.floor(n.length/2))throw Error("The number of functions provided does not match the number of elements in the translation string.");return n.map((o,r)=>{const i=Math.floor(r/2);return r%2==0?o:t[i](o)})},$0=({to:e,children:t})=>u("a",{className:"adyen-checkout-link",href:e,target:"_blank",rel:"noopener noreferrer"},t);function Qi({message:e,urls:t=[]}){return u("span",{className:"adyen-checkout-disclaimer__label"},u(Vl,{message:e,urls:t}))}function Vl({message:e,urls:t}){const n=typeof e=="string",o=t.every(i=>typeof i=="string"&&Lt(i));if(!n||!o)return null;let r;try{r=R0(e,t.map(i=>function(a){return u($0,{to:i},a)}))}catch(i){r=e,console.warn(i)}return u(G,null,r)}const F0=({sfpState:e,setFocusOn:t,cvcPolicy:n,focusedElement:o,hasInstallments:r,handleInstallments:i,showAmountsInInstallments:a,showContextualElement:s,hasCVC:l,installmentOptions:c,lastFour:d,expiryMonth:p,expiryYear:h,disclaimerMessage:m})=>u(Il,{status:e.status},u(g0,{errors:e.errors,brand:e.brand,hasCVC:l,cvcPolicy:n,onFocusField:t,focusedElement:o,valid:e.valid,lastFour:d,expiryMonth:p,expiryYear:h,showContextualElement:s}),r&&u(Wi,{brand:e.brand,installmentOptions:c,onChange:i,type:a?"amount":"months"}),m&&u(Qi,{message:m.message.replace("%{linkText}",`%#${m.linkText}%#`),urls:[m.link]})),Ji=({src:e,alt:t,wrapperClassName:n="",imgClassName:o="",showOnError:r,as:i})=>{const[a,s]=w(!1),l=I("adyen-checkout-brand-wrapper",n,r?{}:{"adyen-checkout-brand-wrapper--error":a});return u(i??"span",{className:l,"data-testid":"brand-image-wrapper"},u(fe,{className:o,src:e,alt:t,onError:()=>s(!0)}))};function Ul({brand:e,brandsConfiguration:t}){const n=Pe(),o=e==="card",r=o?"nocard":e,i=t?.[e]?.icon??bl(r,n);return u(Ji,{imgClassName:"adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon",alt:o?"":Oi(e),src:i})}var mr={dualBrandSelector:"DualBrandSelector-module_dualBrandSelector__Fz7UW",dualBrandSelectorButton:"DualBrandSelector-module_dualBrandSelectorButton__3Dxem",dualBrandSelectorButtonSelected:"DualBrandSelector-module_dualBrandSelectorButtonSelected__EswTK",dualBrandSelectorIcon:"DualBrandSelector-module_dualBrandSelectorIcon__qeN0L"};function M0({dualBrandingElements:e,brandsConfiguration:t,dualBrandingChangeHandler:n,selectedBrandValue:o}){const{i18n:r}=O(),i=Wp(e,t),[a,s]=w(o);return u("div",{className:mr.dualBrandSelector,role:"group","aria-label":r.get("creditCard.dualBrand.description")},i.map(l=>u("button",{key:l.id,type:"button",className:I(mr.dualBrandSelectorButton,{[mr.dualBrandSelectorButtonSelected]:a===l.id}),onMouseDown:c=>c.preventDefault(),onClick:()=>{return c=l.id,s(c),void n(c);var c},onKeyDown:Ml,"aria-label":l.altName,"aria-pressed":a===l.id},u("img",{src:l.imageURL,alt:l.altName,className:mr.dualBrandSelectorIcon}))))}function L0(e){const{i18n:t}=O(),{error:n="",isValid:o=!1,onFocusField:r=()=>{},dualBrandingElements:i,dualBrandingChangeHandler:a,brandsConfiguration:s,selectedBrandValue:l}=e,c=!!i&&Bi(Vi,i,"id"),d=c?t.get("creditCard.dualBrand.description"):void 0;return u(me,{label:e.label,focused:e.focused,filled:e.filled,classNameModifiers:["cardNumber"],onFocusField:()=>r(H),errorMessage:n,isValid:o,dir:"ltr",name:H,showValidIcon:!1,i18n:t,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:no,onInputContainerClick:()=>{r(H)},contextualText:d},u(cr,{encryptedFieldType:H,className:I({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":n,"adyen-checkout__input--focus":e.focused,"adyen-checkout__input--valid":o,"adyen-checkout__card__cardNumber__input--noBrand":!e.showBrandIcon})}),e.showBrandIcon&&!i&&u(Ul,{brandsConfiguration:e.brandsConfiguration,brand:e.brand}),i&&!n&&u("div",{className:I(["adyen-checkout__card__dual-branding__icons"])},c?u(M0,{dualBrandingElements:i,dualBrandingChangeHandler:a,brandsConfiguration:s,selectedBrandValue:l}):i.map(p=>u(Ul,{key:p.id,brand:p.id,brandsConfiguration:e.brandsConfiguration}))),u("span",{className:"adyen-checkout__card__dual-branding__sr-only","aria-live":"polite"},d))}function O0(e){const{label:t,focused:n,filled:o,onFocusField:r,className:i="",classNameModifiers:a=[],error:s="",isValid:l=!1,expiryDatePolicy:c=Pt,showContextualElement:d,contextualText:p}=e,{i18n:h}=O(),m=Pe(),f=I(i,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":c===yn,"adyen-checkout__field__exp-date--optional":c===Yn}),y=c!==Yn?t:`${t} ${h.get("field.title.optional")}`;return u(me,{label:y,classNameModifiers:[...a,"expiryDate"],className:f,focused:n,filled:o,onFocusField:()=>r(z),errorMessage:s,isValid:l,dir:"ltr",name:"encryptedExpiryDate",i18n:h,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:no,showContextualElement:d,contextualText:p,onInputContainerClick:()=>{r(z)}},u(cr,{encryptedFieldType:z,className:I("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":s,"adyen-checkout__input--focus":n,"adyen-checkout__input--valid":l})}),u(Ji,{wrapperClassName:s||l?I("adyen-checkout__field__exp-date_hint_wrapper","adyen-checkout__field__exp-date_hint_wrapper--hidden"):"adyen-checkout__field__exp-date_hint_wrapper",imgClassName:"adyen-checkout__field__exp-date_hint",alt:"",src:m({imageFolder:"components/"})("expiry_date_hint")}))}var wn={container:"BrandIcons-module_container__FeCxK",grid:"BrandIcons-module_grid__wb0DE",smallImgGrid:"BrandIcons-module_smallImgGrid__iCMqT",remainingBrandsLabel:"BrandIcons-module_remainingBrandsLabel__v0FKS",img:"BrandIcons-module_img__Oe3i-",smallImg:"BrandIcons-module_smallImg__GwOZ0"};const B0=({brandIcons:e,maxBrandsToShow:t=e.length,remainingBrandsLabel:n,className:o,containerType:r="flex",remainingBrandsLabelClassName:i,brandImageClassName:a,brandImageWrapperClassName:s,showIconOnError:l,smallIcons:c,renderBrandIcon:d,ariaHidden:p})=>{const h=te(()=>e.slice(0,t),[e,t]),m=te(()=>e.slice(t),[e,t]),f=!!n||m.length>0;return u("ul",{className:I(wn.container,{[wn.grid]:r==="grid",[wn.smallImgGrid]:c&&r==="grid"},o),"aria-hidden":p},h.map(y=>d?d(y):u(Ji,{as:"li",key:y.alt,src:y.src,alt:y.alt,wrapperClassName:s,imgClassName:I(wn.img,{[wn.smallImg]:c},a),showOnError:l})),f&&u("li",{className:I(wn.remainingBrandsLabel,i)},n||`+ ${m.length}`))},V0=({brands:e,activeBrand:t})=>{if(!e?.length)return null;const n=t!=="card",o=te(()=>e.map(r=>({src:r.icon,alt:Oi(r.name)})),[e]);return u(B0,{className:I("adyen-checkout__card__brands",{"adyen-checkout__card__brands--hidden":n}),brandIcons:o,smallIcons:!0,showIconOnError:!0,containerType:"grid",ariaHidden:n||void 0})};function U0({brand:e,brandsIcons:t,brandsConfiguration:n,dualBrandingElements:o,selectedBrandValue:r,dualBrandingChangeHandler:i,errors:a,focusedElement:s,hasCVC:l,cvcPolicy:c,expiryDatePolicy:d,onFocusField:p,showBrandIcon:h,valid:m,showContextualElement:f}){const{i18n:y}=O(),b=(S,E)=>{const k=S[E];return k?y.get(k):null},v=t?.filter(S=>!rl?.includes(S.name)),C=e==="amex",_=C?y.get("creditCard.securityCode.contextualText.4digits"):y.get("creditCard.securityCode.contextualText.3digits");return u("div",{className:"adyen-checkout__card__form"},u(L0,{brand:e,brandsConfiguration:n,error:b(a,H),focused:s===H,isValid:!!m.encryptedCardNumber,label:y.get("creditCard.cardNumber.label"),onFocusField:p,filled:!!a.encryptedCardNumber||!!m.encryptedCardNumber,showBrandIcon:h,dualBrandingElements:o,selectedBrandValue:r,dualBrandingChangeHandler:i}),u(V0,{activeBrand:e,brands:v}),u("div",{className:I("adyen-checkout__card__exp-cvc",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":d===yn})},u(O0,{classNameModifiers:["col-50"],error:b(a,z),focused:s===z,isValid:!!m.encryptedExpiryMonth&&!!m.encryptedExpiryYear,filled:!!a.encryptedExpiryDate||!!m.encryptedExpiryYear,label:y.get("creditCard.expiryDate.label"),onFocusField:p,expiryDatePolicy:d,showContextualElement:f,contextualText:y.get("creditCard.expiryDate.contextualText")}),l&&u($l,{classNameModifiers:["col-50"],errorCode:a[j],focused:s===j,cvcPolicy:c,isValid:!!m.encryptedSecurityCode,filled:!!a.encryptedSecurityCode||!!m.encryptedSecurityCode,label:y.get("creditCard.securityCode.label"),onFocusField:p,frontCVC:C,showContextualElement:f,contextualText:_})))}function Hl(e){return u(dr,{...e,type:"tel"})}function H0(e){const{i18n:t}=O(),n=te(()=>e.value?.length>6?t.get("creditCard.taxNumber.labelAlt"):t.get("creditCard.taxNumber.label"),[e.value]);return u("div",{className:"adyen-checkout__card__kcp-authentication"},u(me,{label:n,filled:e.filled,classNameModifiers:["kcp-taxNumber"],errorMessage:e.error&&t.get(bi),isValid:e.isValid,dir:"ltr",name:"kcpTaxNumberOrDOB",onFocus:o=>e.onFieldFocusAnalytics("taxNumber",o),onBlur:o=>e.onFieldBlurAnalytics("taxNumber",o)},u(Hl,{name:"kcpTaxNumberOrDOB",className:"adyen-checkout__card__kcp-taxNumber__input adyen-checkout__input",maxLength:10,minLength:6,autoComplete:"false",value:e.value,required:!0,onBlur:e.onBlur,onInput:e.onInput,disabled:e.disabled,placeholder:e.placeholder})),u(me,{label:t.get("creditCard.password.label"),focused:e.focusedElement==="encryptedPassword",filled:e.filled,classNameModifiers:["50","koreanAuthentication-encryptedPassword"],onFocusField:()=>e.onFocusField("encryptedPassword"),errorMessage:e.encryptedPasswordState.errors&&t.get(String(e.encryptedPasswordState.errors)),isValid:e.encryptedPasswordState.valid,dir:"ltr",name:"encryptedPassword",useLabelElement:!1,renderAlternativeToLabel:no},u(cr,{encryptedFieldType:"encryptedPassword",className:I({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":e.encryptedPasswordState.errors,"adyen-checkout__input--valid":e.encryptedPasswordState.valid,"adyen-checkout__input--focus":e.focusedElement==="encryptedPassword"})})))}const K0=({onBlur:e,onInput:t,valid:n=!1,error:o=null,data:r="",required:i=!1,disabled:a=!1,onFieldFocusAnalytics:s=null,onFieldBlurAnalytics:l=null})=>{const{i18n:c}=O();return u(me,{label:`${c.get("boleto.socialSecurityNumber")}`,classNameModifiers:["socialSecurityNumber"],errorMessage:o&&o.errorMessage?c.get(o.errorMessage):!!o,isValid:!!n,name:"socialSecurityNumber",onFocus:d=>s?.("socialSecurityNumber",d),onBlur:d=>l?.("socialSecurityNumber",d)},u(oo,{name:"socialSecurityNumber",autocorrect:"off",spellcheck:!1,value:r,maxlength:18,onInput:t,onBlur:e,required:i,disabled:a,autocomplete:void 0}))};function Xi({classNameModifiers:e=[],label:t,isInvalid:n,onChange:o,disabled:r=!1,...i}){const{uniqueId:a,showErrorElement:s,showContextualElement:l,...c}=i;return u("label",{className:"adyen-checkout__checkbox",htmlFor:a},u("input",{id:a,...c,...s&&{"aria-describedby":`${a}${Go}`},...l&&{"aria-describedby":`${a}${Yo}`},className:I(["adyen-checkout__checkbox__input",[i.className],{"adyen-checkout__checkbox__input--invalid":n},e.map(d=>`adyen-checkout__input--${d}`)]),type:"checkbox",disabled:r,onChange:o}),u("span",{className:"adyen-checkout__checkbox__label"},t))}Xi.defaultProps={onChange:()=>{}};function j0({storeDetails:e=!1,disabled:t=!1,className:n="",...o}){const{i18n:r}=O(),[i,a]=w(e);return R(()=>{o.onChange(i)},[i]),u("div",{className:I("adyen-checkout__store-details",n)},u(Xi,{onChange:s=>{a(s.target.checked)},disabled:t,label:r.get("storeDetails"),name:"storeDetails"}))}const z0=({data:e,label:t})=>{const{street:n,houseNumberOrName:o,city:r,postalCode:i,stateOrProvince:a,country:s}=e;return u(ur,{classNameModifiers:[t],label:t,readonly:!0},u(G,null,!!n&&n,o&&`, ${o},`,u("br",null),i&&`${i}`,r&&`, ${r}`,a&&a!==rr&&`, ${a}`,s&&`, ${s} `))},se=e=>({formatterFn:t=>t.replace(Xt("^\\d","g"),"").substring(0,e),format:new Array(e).fill("9").join(""),maxlength:e}),q0=Xt(wl),ea=e=>e.replace(q0,""),W0={postalCode:{formatterFn:(e,t)=>{const n=t.state.data.country,o=ta[n]?.postalCode.formatterFn;return o?o(e):e}},street:{formatterFn:ea},houseNumberOrName:{formatterFn:ea},city:{formatterFn:ea}},ta={AT:{postalCode:se(4)},AU:{postalCode:se(4)},BE:{postalCode:se(4)},BG:{postalCode:se(4)},BR:{postalCode:{formatterFn:e=>{const t=e.replace(Xt("^\\d-","g"),""),n=t.includes("-")?9:8;return t.substring(0,n)},format:"12345678 or 12345-678",maxlength:9}},CA:{postalCode:{format:"A9A 9A9 or A9A9A9",maxlength:7}},CH:{postalCode:se(4)},CY:{postalCode:se(4)},CZ:{postalCode:{format:"999 99",maxlength:6}},DE:{postalCode:se(5)},DK:{postalCode:{format:"9999",maxlength:7}},EE:{postalCode:se(5)},ES:{postalCode:se(5)},FI:{postalCode:se(5)},FR:{postalCode:se(5)},GB:{postalCode:{formatterFn:e=>e.replace(Xt(wl),"").substring(0,8),format:"AA99 9AA or A99 9AA or A9 9AA",maxlength:8}},GR:{postalCode:{format:"999 99",maxlength:6}},HR:{postalCode:{format:"[1-5]9999",maxlength:5}},HU:{postalCode:se(4)},IE:{postalCode:{format:"A99 A999",maxlength:8}},IS:{postalCode:se(3)},IT:{postalCode:se(5)},LI:{postalCode:se(4)},LT:{postalCode:{format:"9999 or 99999 or LT-99999",maxlength:8}},LU:{postalCode:se(4)},LV:{postalCode:{format:"9999 or LV-9999",maxlength:7}},MC:{postalCode:{format:"980NN",maxlength:5}},MT:{postalCode:{format:"AA99 or AAA99 or AA9999 or AAA9999",maxlength:8}},MY:{postalCode:se(5)},NL:{postalCode:{format:"9999AA",maxlength:7}},NZ:{postalCode:se(4)},NO:{postalCode:se(4)},PL:{postalCode:{formatterFn:e=>{const t=e.replace(Xt("^\\d-","g"),""),n=t.includes("-")?6:5;return t.substring(0,n)},format:"99999 or 99-999",maxlength:6}},PT:{postalCode:{formatterFn:e=>e.replace(Xt("^\\d-","g"),"").substring(0,8),format:"9999-999",maxlength:8}},RO:{postalCode:se(6)},SI:{postalCode:{format:"9999 or SI-9999",maxlength:7}},SE:{postalCode:se(5)},SG:{postalCode:se(6)},SK:{postalCode:{format:"99999 or SK-99999",maxlength:8}},JP:{postalCode:{format:"999-9999",maxlength:8}},US:{postalCode:{formatterFn:e=>{const t=e.replace(Xt("^\\d-","g"),""),n=t.includes("-")?10:5;return t.substring(0,n)},format:"99999 or 99999-9999"}}},le=e=>({pattern:new RegExp(`\\d{${e}}`)}),Kl=(e,t,n)=>{if(t){if(Jt(e))return null;n.postalCode.errorMessage={translationKey:yi,translationObject:{values:{format:ta[t]?.postalCode.format||null}}};const o=G0[t]?.pattern;return o?o.test(e):!!e}return!Jt(e)||null},G0={AT:le(4),AU:le(4),BE:{pattern:/(?:(?:[1-9])(?:\d{3}))/},BG:le(4),BR:{pattern:/^\d{5}-?\d{3}$/},CA:{pattern:/(?:[ABCEGHJ-NPRSTVXY]\d[A-Z][ -]?\d[A-Z]\d)/},CH:{pattern:/[1-9]\d{3}/},CY:le(4),CZ:{pattern:/\d{3}\s?\d{2}/},DE:le(5),DK:le(4),EE:le(5),ES:{pattern:/(?:0[1-9]|[1-4]\d|5[0-2])\d{3}/},FI:le(5),FR:le(5),GB:{pattern:/^([A-Za-z][A-Ha-hK-Yk-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$/},GE:le(4),GR:{pattern:/^\d{3}\s{0,1}\d{2}$/},HR:{pattern:/^([1-5])[0-9]{4}$/},HU:le(4),IE:{pattern:/(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}/},IS:le(3),IT:le(5),LI:le(4),LT:{pattern:/^(LT-\d{5}|\d{4,5})$/},LU:le(4),LV:{pattern:/^(LV-)[0-9]{4}$/},MC:{pattern:/^980\d{2}$/},MT:{pattern:/^[A-Za-z]{3}\d{4}$/},MY:le(5),NL:{pattern:/(?:NL-)?(?:[1-9]\d{3} ?(?:[A-EGHJ-NPRTVWXZ][A-EGHJ-NPRSTVWXZ]|S[BCEGHJ-NPRTVWXZ]))/},NO:le(4),PL:{pattern:/^\d{2}[-]{0,1}\d{3}$/},PT:{pattern:/^([1-9]\d{3})([- ]?(\d{3})? *)$/},RO:le(6),SI:le(4),SE:le(5),SG:le(6),SK:le(5),US:{pattern:/^\d{5}(?:-\d{4})?$/}},Y0=e=>{const t={postalCode:{modes:["blur"],validate:n=>Kl(n,e,t),errorMessage:tt}};return t},Z0=e=>{const t={postalCode:{modes:["blur"],validate:(n,o)=>{const r=o.state.data.country;return Kl(n,r,t)},errorMessage:tt},houseNumberOrName:{validate:(n,o)=>{const r=o.state?.data?.country;return r&&e.countryHasOptionalField(r,"houseNumberOrName")||!Jt(n)||null},modes:["blur"],errorMessage:tt},default:{validate:n=>!Jt(n)||null,modes:["blur"],errorMessage:tt}};return t};function jl(e,t){if(e==null)throw new Error(t);return e}const Q0="https://checkoutshopper-live.adyen.com/checkoutshopper/",na=jl("6.44.0","LIBRARY_VERSION is not defined"),zl=jl("esm","BUNDLE_TYPE is not defined"),J0=["amount","secondaryAmount","countryCode","environment","_environmentUrls","loadingContext","i18n","modules","order","session","clientKey","showPayButton","redirectFromTopWhenInIframe","donation","onPaymentCompleted","onPaymentFailed","beforeRedirect","beforeSubmit","onSubmit","onActionHandled","onAdditionalDetails","onChange","onEnterKeyPressed","onError","onBalanceCheck","onOrderCancel","onOrderRequest","onOrderUpdated","onPaymentMethodsRequest"],X0=6e4;var oa=(function(e){return e.WEB="web",e})({});const ra="web";var ql=(function(e){return e.NATIVE="nativeComponent",e.GENERIC="genericComponent",e})({});function Wl(e,t){const{headers:n=[],errorLevel:o="warn",errorCode:r,loadingContext:i=Q0,method:a="GET",path:s,timeout:l=X0}=e,c={method:a,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":a==="POST"?"application/json":"text/plain",...n},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(l)},...t&&{body:JSON.stringify(t)}},d=`${i}${s}`;return fetch(d,c).then(async p=>{if(p.status===204)return;const h=await p.json();if(p.ok)return h;if((function(m){return m&&m.errorCode&&m.errorType&&m.message&&m.status})(h))return void ia({message:h.message,level:o,cause:h,code:r});ia({message:e.errorMessage||`Service at ${d} is not available`,level:o,cause:h,code:r})}).catch(p=>{if(p instanceof F)throw p;ia({message:e.errorMessage||`Call to ${d} failed. Error= ${p}`,level:o,cause:p,code:r})})}function ia({message:e,level:t,cause:n,code:o}){switch(t){case"silent":break;case"info":case"warn":case"error":console[t](e);break;default:throw new F("NETWORK_ERROR",e,{cause:n,code:o})}}function Gl(e,t){return Wl({...e,method:"GET"},t)}function Ve(e,t){return Wl({...e,method:"POST"},t)}function Yl(e,t,n){return Gl({loadingContext:t,errorLevel:"warn",errorMessage:`Dataset ${e} is not available`,path:n?`datasets/${e}/${n}.json`:`datasets/${e}.json`})}function em(e){const{classNameModifiers:t,label:n,onDropdownChange:o,readOnly:r,selectedCountry:i,specifications:a,value:s,required:l}=e,{i18n:c,loadingContext:d}=O(),[p,h]=w([]),[m,f]=w(!1);return li(()=>{if(!i||!a.countryHasDataset(i))return h([]),void f(!0);Yl(`states/${i}`,d,c.locale).then(y=>{const b=y&&y.length?y:[];h(b),f(!0)}).catch(()=>{h([]),f(!0)})},[i]),m&&p.length?u(me,{label:n,classNameModifiers:t,errorMessage:e.errorMessage,isValid:!!s,showValidIcon:!1,name:"stateOrProvince",i18n:c,readOnly:r&&!!s},u(tn,{name:"stateOrProvince",onChange:o,selectedValue:s,items:p,required:l,readonly:r&&!!s})):null}function tm(e){const{allowedCountries:t=[],classNameModifiers:n=[],errorMessage:o,onDropdownChange:r,value:i,required:a}=e,{i18n:s,loadingContext:l}=O(),[c,d]=w([]),[p,h]=w(!1),[m,f]=w(e.readOnly);return li(()=>{Yl("countries",l,s.locale).then(y=>{const b=((v,C)=>{const _=S=>({...S,name:S.name,selectedOptionName:S.name});return C.length?v.filter(S=>C.includes(S.id)).map(_):v.map(_)})(y,t);d(b||[]),f(b.length===1||m),h(!0)}).catch(y=>{console.error(y),d([]),h(!0)})},[]),p?u(me,{name:"country",label:s.get("country"),errorMessage:o,classNameModifiers:n,isValid:!!i,showValidIcon:!1,i18n:s,readOnly:m&&!!i},u(tn,{onChange:r,name:"country",selectedValue:i,items:c,readonly:m&&!!i,required:a})):null}function nm(e,t){const n=Lp[e];if(n)return t==="billingAddress"?`billing ${n}`:t==="deliveryAddress"?`shipping ${n}`:n}function om(e){const{i18n:t}=O(),{classNameModifiers:n=[],data:o,errors:r,valid:i,fieldName:a,onInput:s,onBlur:l,trimOnBlur:c,maxLength:d,disabled:p,addressType:h}=e,m=o[a],f=o.country,y=e.specifications.countryHasOptionalField(f,a),b=e.specifications.getKeyForField(a,f),v=y?` ${t.get("field.title.optional")}`:"",C=`${t.get(b)}${v}`,_=(function(S,E,k,A){if(typeof S[E]?.errorMessage=="object"){const{translationKey:$,translationObject:N}=S[E].errorMessage;return k.get($,N)}return k.get(S[E]?.errorMessage,{values:{label:A.toLowerCase()}})||!!S[E]})(r,a,t,C);switch(a){case"country":return u(tm,{allowedCountries:e.allowedCountries,classNameModifiers:n,label:C,errorMessage:_,onDropdownChange:e.onDropdownChange,value:m,required:!y});case"stateOrProvince":return u(em,{classNameModifiers:n,label:C,errorMessage:_,onDropdownChange:e.onDropdownChange,selectedCountry:f,specifications:e.specifications,value:m,required:!y});default:return u(me,{label:C,classNameModifiers:n,errorMessage:_,isValid:i[a],name:a,i18n:t,onFocus:S=>e.onFieldFocusAnalytics(a,S),onBlur:S=>e.onFieldBlurAnalytics(a,S)},u(oo,{name:a,classNameModifiers:n,value:m,onInput:s,onBlur:l,maxlength:d,trimOnBlur:c,disabled:p,required:!y,autocomplete:nm(a,h)}))}}const rm=300,aa=(e,t=300)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e.apply(this,o),t)}};function im({onAddressLookup:e,onAddressSelected:t,onSelect:n,onManualAddress:o,externalErrorMessage:r,hideManualButton:i,showContextualElement:a,contextualText:s,placeholder:l,addressSearchDebounceMs:c}){const[d,p]=w([]),[h,m]=w([]),[f,y]=w(""),{i18n:b}=O(),v=T(S=>{S?.errorMessage&&y(S.errorMessage)},[]),C=T(S=>{new Promise((E,k)=>{e(S,{resolve:E,reject:k})}).then(E=>{m(E),p(E.map(({id:k,name:A})=>({id:k,name:A}))),y("")}).catch(E=>v(E))},[e]);R(()=>{y(r)},[r]);const _=te(()=>aa(C,c),[]);return u("div",{className:"adyen-checkout__address-search adyen-checkout__field-group"},u(me,{label:b.get("address"),classNameModifiers:["address-search"],errorMessage:f,name:"address-search",showContextualElement:a,contextualText:s},u(tn,{name:"address-search",className:"adyen-checkout__address-search__dropdown",placeholder:l,onInput:_,items:d,onChange:S=>{if(!S.target.value)return void y(b.get("address.errors.incomplete"));const E=h.find(k=>k.id===S.target.value);if(typeof t!="function")return n(E),void p([]);new Promise((k,A)=>{t(E,{resolve:k,reject:A})}).then(k=>{n(k),p([])}).catch(k=>v(k))},disableTextFilter:!0,blurOnClose:!0})),!i&&u("span",{className:"adyen-checkout__address-search__manual-add"},u("button",{type:"button",className:"adyen-checkout__button adyen-checkout__button--inline adyen-checkout__button--link adyen-checkout__address-search__manual-add__button",onClick:o},"+ "+b.get("address.enterManually"))))}const am=(e,t)=>e||(t==="billingAddress"||t==="deliveryAddress"?t:void 0),sm={};function Zl(e){const{i18n:t}=O(),{label:n="",requiredFields:o,visibility:r,iOSFocusedField:i=null,showContextualElement:a}=e,s=am(e.addressType,n),l=W({});Object.keys(l.current).length||e.setComponentRef?.(l.current);const c=te(()=>new xl(e.specifications),[e.specifications]),d=c.getAddressSchemaForCountryFlat(e.countryCode).filter(M=>o.includes(M)),[p,h]=w(!1),[m,f]=w(!1),[y,b]=w(""),v=!!e.onAddressLookup,[C,_]=w(!1),S=!e.onAddressLookup||p||m,E=e.data??sm,k=E.country,A=k&&!d.includes(Qt)?[...d,Qt]:d,$=te(()=>k?{...E,country:k.toUpperCase()}:E,[E,k]),{data:N,errors:L,valid:U,isValid:ye,handleChangeFor:Q,triggerValidation:ne,setData:be,mergeData:we}=to({schema:A,defaultData:$,rules:{...Z0(c),...e.validationRules},formatters:W0}),Fe=T(M=>{const ae=ir.reduce((de,ie)=>{const Le=M[ie];return Le!=null&&(de[ie]=String(Le)),de},{});we(ae),_(!0),ne(),h(!0)},[h,ne,be]),Me=T(()=>{f(!0)},[]);l.current.showValidation=()=>{ne(),b(!v||S||ye?"":t.get("address.errors.incomplete"))};const ve=d.filter(M=>!i||M===i);if(R(()=>{if(C)return void _(!1);const M=c.countryHasDataset(N.country)?"":rr,ae={...N,stateOrProvince:M};o.forEach(de=>{Q(de,"input")(ae[de]??"")}),ae.postalCode&&Q("postalCode","blur")(N.postalCode)},[N.country]),R(()=>{const M=o.includes("stateOrProvince"),ae=N.country&&c.countryHasDataset(N.country),de=M&&ae,ie=N.stateOrProvince||(de?"":rr);Q("stateOrProvince","input")(ie)},[]),R(()=>{const M=c.getOptionalFieldsForCountry(N.country),ae=ir.reduce((de,ie)=>{const Le=M.includes(ie),Xe=o.includes(ie),Se=N[ie],je=$[ie],D=Le&&!Se||!Xe?!Xe&&je?je:rr:Se;return D?.length&&(de[ie]=D),de},{});e.onChange({data:ae,valid:U,errors:L,isValid:ye})},[N,U,L,ye]),r==="hidden")return null;if(r==="readOnly")return u(z0,{data:N,label:n});const Qe=(M,{classNameModifiers:ae=[]})=>o.includes(M)?u(om,{key:M,allowedCountries:e.allowedCountries,classNameModifiers:[...ae,M],data:N,errors:L,valid:U,fieldName:M,onInput:Q(M,"input"),onBlur:Q(M,"blur"),onDropdownChange:Q(M,"blur"),specifications:c,maxLength:t0(ta,M,N.country),trimOnBlur:!0,disabled:!ve.includes(M),addressType:s,onFieldFocusAnalytics:e.onFieldFocusAnalytics,onFieldBlurAnalytics:e.onFieldBlurAnalytics}):null,Je=c.getAddressSchemaForCountry(N.country);return u(G,null,u(ur,{classNameModifiers:[n,"address"],label:n,renderLabelAsSectionHeading:!0},v&&u(im,{onAddressLookup:e.onAddressLookup,onAddressSelected:e.onAddressSelected,onSelect:Fe,onManualAddress:Me,externalErrorMessage:y,hideManualButton:S,showContextualElement:a,contextualText:t.get("address.search.contextualText"),addressSearchDebounceMs:e.addressSearchDebounceMs}),S&&u(G,null,Je.map(M=>M instanceof Array?u("div",{className:"adyen-checkout__field-group"},M.map(([ae,de])=>Qe(ae,{classNameModifiers:[`col-${de}`]}))):Qe(M,{})))))}Zl.defaultProps={countryCode:null,validationRules:null,data:{},onChange:()=>{},visibility:"editable",requiredFields:ir,specifications:{},onFieldFocusAnalytics:()=>{},onFieldBlurAnalytics:()=>{}};function lm({onBlur:e,onInput:t,placeholder:n,value:o,required:r,error:i=!1,isValid:a,disabled:s,onFieldFocusAnalytics:l,onFieldBlurAnalytics:c}){const{i18n:d}=O();return u(me,{label:d.get("creditCard.holderName"),className:"adyen-checkout__card__holderName",errorMessage:i&&d.get(gi),isValid:!!a,name:"holderName",i18n:d,onFocus:p=>l("holderName",p),onBlur:p=>c("holderName",p)},u(oo,{name:"holderName",className:"adyen-checkout__card__holderName__input adyen-checkout__input",placeholder:n,autocomplete:"cc-name",value:o,required:r,onBlur:e,onInput:t,disabled:s}))}const cm=({data:e,valid:t,errors:n,handleChangeFor:o,sfpState:r,setFocusOn:i,cvcPolicy:a,focusedElement:s,hasInstallments:l,handleInstallments:c,showAmountsInInstallments:d,brandsIcons:p,formData:h,formErrors:m,formValid:f,expiryDatePolicy:y,dualBrandSelectElements:b,extensions:v,selectedBrandValue:C,showKCP:_,showBrazilianSSN:S,socialSecurityNumber:E,handleOnStoreDetails:k,billingAddress:A,handleAddress:$,setAddressRef:N,partialAddressSchema:L,onAddressLookup:U,onAddressSelected:ye,addressSearchDebounceMs:Q,billingAddressRequired:ne,billingAddressRequiredFields:be,billingAddressAllowedCountries:we,billingAddressValidationRules:Fe=null,brandsConfiguration:Me,showStoreDetailsCheckbox:ve,hasCVC:Qe,hasHolderName:Je,holderNameRequired:M,installmentOptions:ae,placeholders:de,positionHolderNameOnTop:ie,showBrandIcon:Le,showContextualElement:Xe,iOSFocusedField:Se,disclaimerMessage:je,onFieldFocusAnalytics:D,onFieldBlurAnalytics:q})=>{const ke=u(lm,{required:M,placeholder:de.holderName,value:h.holderName,error:!!m.holderName&&M,isValid:!!f.holderName,onBlur:o("holderName","blur"),onInput:o("holderName","input"),disabled:Se&&Se!=="holderName",onFieldFocusAnalytics:D,onFieldBlurAnalytics:q});return u(Il,{status:r.status},Je&&ie&&ke,u(U0,{showBrandIcon:Le,showContextualElement:Xe,brand:r.brand??"card",brandsIcons:p,brandsConfiguration:Me,focusedElement:s,onFocusField:i,hasCVC:Qe,cvcPolicy:a,expiryDatePolicy:y,errors:r.errors,valid:r.valid,dualBrandingElements:b.length>0&&b,dualBrandingChangeHandler:v.handleDualBrandSelection,selectedBrandValue:C}),Je&&!ie&&ke,_&&u(H0,{onFocusField:i,focusedElement:s,encryptedPasswordState:{data:r.encryptedPassword,valid:!!r.valid&&r.valid.encryptedPassword,errors:!!r.errors&&r.errors.encryptedPassword},value:e.taxNumber,error:!!n.taxNumber,isValid:!!t.taxNumber,onBlur:o("taxNumber","blur"),onInput:o("taxNumber","input"),disabled:Se&&Se!=="kcpTaxNumberOrDOB",placeholder:de.taxNumber,onFieldFocusAnalytics:D,onFieldBlurAnalytics:q}),S&&u("div",{className:"adyen-checkout__card__socialSecurityNumber"},u(K0,{onBlur:o("socialSecurityNumber","blur"),onInput:o("socialSecurityNumber","input"),error:n?.socialSecurityNumber,valid:t?.socialSecurityNumber,data:E,required:!0,disabled:Se&&Se!=="socialSecurityNumber",onFieldFocusAnalytics:D,onFieldBlurAnalytics:q})),ve&&u(j0,{onChange:k}),l&&u(Wi,{brand:r.brand,installmentOptions:ae,onChange:c,type:d?"amount":"months"}),ne&&u(Zl,{label:"billingAddress",data:A,onChange:$,allowedCountries:we,requiredFields:be,setComponentRef:N,validationRules:Fe,specifications:L,iOSFocusedField:Se,onAddressLookup:U,showContextualElement:Xe,onAddressSelected:ye,addressSearchDebounceMs:Q,onFieldFocusAnalytics:D,onFieldBlurAnalytics:q}),je&&u(Qi,{message:je.message.replace("%{linkText}",`%#${je.linkText}%#`),urls:[je.link]}))},Ql=e=>{if(e){const t=document.body.getBoundingClientRect().top,n=e.getBoundingClientRect().top-t-100;window.scrollTo({top:n,behavior:"smooth"})}},dm=(e,t,n)=>{if(e){if(ht.__IS_IOS){const o=t.current.getRootNode?.(),r=o?.querySelector(`[data-id="${n}"]`);Ql(r)}bn(n)?t.current.setFocusOn(n):Jl(n,t,ht.__IS_IOS)}},um=(e,t,n)=>o=>{e("billingAddress",o.data),t("billingAddress",o.isValid),n("billingAddress",o.errors)},hm=(e,t,n)=>o=>{e(o.currentFocusObject),o.focus===!0?t(o.fieldType,o):n(o.fieldType,o)},pm=(e,t,n)=>()=>{e.current||(e.current=!0,Promise.resolve().then(()=>{const o=n.findIndex(i=>i===H),r=n.slice(o+1);for(const i of r){if(!bn(i)){Jl(i,t,!1);break}if(!t.current.sfIsOptionalOrHidden(i)){t.current.setFocusOn(i);break}}e.current=!1}))},Jl=(e,t,n)=>{e==="taxNumber"&&(e="kcpTaxNumberOrDOB");const o=t.current.getRootNode?.();e==="country"||e==="stateOrProvince"?_t(o,`.adyen-checkout__field--${e} .adyen-checkout__filter-input`)?.focus({preventScroll:n}):_t(o,`[name="${e}"]`)?.focus({preventScroll:n})};function Xl(e,t,n){let o;const r=n;return e.length!==1||t||(o=e),e.length>t?.length&&(o=e.filter(({[r]:i})=>!t.some(({[r]:a})=>a===i))),o}const mm=()=>{const{i18n:e}=O();return u("p",{className:"adyen-checkout-form-instruction"},e.get("form.instruction"))};function ec(e){const t=W();return R(()=>{t.current=e},[e]),t.current}const fm=({errors:e,props:t,isValidating:n,retrieveLayout:o,specifications:r,billingAddress:i,sfp:a})=>{const{setSRMessagesFromObjects:s,setSRMessagesFromStrings:l,clearSRPanel:c,shouldMoveFocusSR:d}=Nl(),p=s?.({fieldTypeMappingFn:Hp}),h=vl(t.billingAddressMode),[m,f]=w(null),y=ec(m),b=a.current?.mapErrorsToValidationRuleResult(),v={...e,...b};return R(()=>{try{const{billingAddress:C,..._}=v,S={..._,...C},E=p?.({errors:S,isValidating:n.current,layout:o(),countrySpecificLabels:r.getAddressLabelsForCountry(i?.country)??h?.default?.labels,hasDisplayedErrors:!!m?.length}),k=E?.currentErrorsSortedByLayout;switch(f(k),E?.action){case il:d&&E?.fieldToFocus&&dm(n.current,a,E?.fieldToFocus),setTimeout(()=>{n.current=!1},300);break;case al:{const A=Xl(k,y,"field"),$=A?.[0];if($){const N=zp($.errorCode)?$.errorMessage:null;l(N)}else c();break}}}catch{}},[e]),{sortedErrorList:m,previousSortedErrors:y,clearSRPanel:c}},ym=({label:e,labelPosition:t="after",ariaLabel:n,description:o,checked:r,disabled:i=!1,readonly:a=!1,onChange:s})=>{const l=te(()=>o?`toggle-description-${Be()}`:null,[o]),c=te(()=>n||(typeof e=="string"?e:null),[n,e]),d=I({"adyen-checkout-toggle--label-first":t==="before","adyen-checkout-toggle--disabled":i,"adyen-checkout-toggle--readonly":a}),p=T(h=>{s(h.target.checked)},[s]);return u("label",{className:`adyen-checkout-toggle ${d}`},u("input",{disabled:i,checked:r,onChange:p,"aria-label":c,"aria-readonly":a,"aria-describedby":l,role:"switch",type:"checkbox",className:"adyen-checkout-toggle__input"}),u("span",{"aria-hidden":!0,className:"adyen-checkout-toggle__track"},u("span",{className:"adyen-checkout-toggle__handle"},r&&u("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},u("path",{fill:"#00112C",d:"M12.0608 6.00011L11.0001 4.93945L7.00011 8.93945L5.00011 6.93945L3.93945 8.00011L7.00011 11.0608L12.0608 6.00011Z"})))),e&&u("span",{className:"adyen-checkout-toggle__label-container"},u("span",{className:"adyen-checkout-toggle__label-text","data-testid":"inner-label"},e),o&&u("span",{"data-testid":"description",className:"adyen-checkout-toggle__description",id:l},o)))};function tc(e){if(!e)return"";let t=e;return t=t.replace(/\D/g,""),t.length>3&&t.length<=6?t=t.slice(0,3)+" "+t.slice(3):t.length>6&&(t=t.slice(0,3)+" "+t.slice(3,6)+" "+t.slice(6,10)),t}const gm=({initialValue:e,onChange:t})=>{const{i18n:n}=O(),{handleChangeFor:o,data:r}=to({schema:["mobileNumber"],defaultData:{mobileNumber:e},formatters:{mobileNumber:tc}}),i=W(null),a=T(()=>{i.current?.focus()},[i.current]);return R(()=>{t(r.mobileNumber?.replaceAll(" ",""))},[r.mobileNumber,t]),u(me,{name:"mobile-number",label:n.get("card.fastlane.mobileInputLabel"),staticValue:"+1",onInputContainerClick:a},u(Hl,{name:"mobile-number",autocorrect:"off",spellcheck:!1,maxlength:12,value:r.mobileNumber,onInput:o("mobileNumber","input"),onBlur:o("mobileNumber","blur"),setRef:i}))},bm=({rootElement:e,focusFirst:t,shouldTrap:n=!0})=>{const[o,r]=w(t);R(()=>{n&&o?.focus()},[o,n]),R(()=>{if(!n)return;const i=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),a=i[0],s=i[i.length-1];r(t||a);const l=c=>{if(c.key==="Tab"||c.keyCode===9)return c.shiftKey&&document.activeElement===a?(s.focus(),void c.preventDefault()):document.activeElement===s?(a.focus(),void c.preventDefault()):void 0};return e.addEventListener("keydown",l),()=>{r(null),e.removeEventListener("keydown",l)}},[e,t,n])},vm=({modalElement:e,isOpen:t,isDismissible:n,focusFirst:o,focusAfterClose:r,onClose:i})=>{bm({rootElement:e,shouldTrap:t,focusFirst:o});const a=T(()=>{r.focus(),i()},[i,r]),s=T(l=>{n&&l.target instanceof HTMLElement&&!e.contains(l.target)&&a()},[a,n,e]);return R(()=>{if(!t||!e)return;const l=c=>{(c.key==="Escape"||c.key==="Esc"||c.keyCode===27)&&a()};return e.addEventListener("keydown",l),()=>e.removeEventListener("keydown",l)},[t,e,a]),{closeModal:a,handleClickOutside:s}},nc=({children:e,classNameModifiers:t=[],isOpen:n,onClose:o,isDismissible:r=!0,labelledBy:i,describedBy:a,focusFirst:s,focusAfterClose:l,...c})=>{const d=W(),{closeModal:p,handleClickOutside:h}=vm({modalElement:d.current,isOpen:n,isDismissible:r,focusFirst:s,focusAfterClose:l,onClose:o});return R(()=>{if(!d.current)return;const m=f=>{f.key!=="Enter"&&f.code!=="Enter"||f.stopPropagation()};return d.current.addEventListener("keydown",m,{capture:!0}),()=>{d.current.removeEventListener("keydown",m)}},[d.current]),u("div",{className:I("adyen-checkout__modal-wrapper",t.map(m=>`adyen-checkout__modal-wrapper--${m}`),{"adyen-checkout__modal-wrapper--open":n}),role:"dialog","aria-labelledby":i,"aria-describedby":a,"aria-modal":"true","aria-hidden":!n,onClick:h,...c},u("div",{className:"adyen-checkout__modal",ref:d},e({onCloseModal:p})))};function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ge=class extends Ae{render(){const{id:t,classNameModifiers:n=[],disabled:o,href:r,icon:i,onClickCompletedIcon:a,inline:s,label:l,ariaLabel:c,ariaLabelledBy:d,ariaDescribedBy:p,ariaExpanded:h,ariaControls:m,status:f,variant:y,buttonRef:b,onClickCompletedLabel:v,onMouseEnter:C,onMouseLeave:_,onFocus:S,onBlur:E,onKeyDown:k}=this.props,{completed:A}=this.state,{i18n:$}=O(),N=a||i?u("img",{className:"adyen-checkout__button__icon",src:this.state.completed?a??i:i,alt:"","aria-hidden":"true"}):"",L=[...n,...y==="primary"?[]:[y],...s?["inline"]:[],...A?["completed"]:[],...f==="loading"||f==="redirect"?["loading"]:[]],U=I(["adyen-checkout__button",...L.map(ne=>`adyen-checkout__button--${ne}`)]),ye={loading:u("span",{"aria-hidden":"true",className:"adyen-checkout__button__content"},u(_n,{size:"medium",inline:!0})),redirect:u("span",{"aria-hidden":"true",className:"adyen-checkout__button__content"},u(_n,{size:"medium",inline:!0}),$.get("payButton.redirecting")),default:u("span",{className:"adyen-checkout__button__content"},N,u("span",{className:"adyen-checkout__button__text"},this.state.completed?v??l:l))},Q=ye[f]||ye.default;return r?u("a",{className:U,href:r,target:this.props.target,rel:this.props.rel,"aria-disabled":o,onClick:ne=>{o&&ne.preventDefault()}},Q):u("button",{ref:b,id:t,className:U,type:"button",disabled:o,onClick:this.onClick,"aria-label":c,"aria-labelledby":d,"aria-describedby":p,"aria-expanded":h,"aria-controls":m,onMouseEnter:C,onMouseLeave:_,onKeyDown:k,onFocus:S,onBlur:E},Q,f!=="loading"&&f!=="redirect"&&this.props.children,u("span",{role:"status","aria-live":"polite",className:"adyen-checkout__button__text--sr-only"},$.get(this.buttonStatusSRLabel(f))))}constructor(...t){super(...t),fr(this,"onClick",n=>{n.preventDefault(),this.props.disabled||this.props.onClick?.(n,{complete:this.complete})}),fr(this,"complete",(n=1e3)=>{this.setState({completed:!0}),setTimeout(()=>{this.setState({completed:!1})},n)}),fr(this,"buttonStatusSRLabel",n=>({loading:"loading",redirect:"payButton.redirecting"})[n]||"")}};fr(Ge,"defaultProps",{status:"default",variant:"primary",disabled:!1,label:"",inline:!1,target:"_self"});const sa=[{headerKey:"card.fastlane.modal.benefit1.header",labelById:`adyen-fastlane-modal-label-${Be()}`,descriptionTextKey:"card.fastlane.modal.benefit1.text",describedById:`adyen-fastlane-modal-describedBy-${Be()}`,image:"fastlane_autofill",altImage:""},{headerKey:"card.fastlane.modal.benefit2.header",labelById:`adyen-fastlane-modal-label-${Be()}`,descriptionTextKey:"card.fastlane.modal.benefit2.text",describedById:`adyen-fastlane-modal-describedBy-${Be()}`,image:"fastlane_protection",altImage:""},{headerKey:"card.fastlane.modal.benefit3.header",labelById:`adyen-fastlane-modal-label-${Be()}`,descriptionTextKey:"card.fastlane.modal.benefit3.text",describedById:`adyen-fastlane-modal-describedBy-${Be()}`,image:"fastlane_ubiquity",altImage:""}],Cm=({isOpen:e,onClose:t,focusAfterClose:n})=>{const{i18n:o}=O(),r=W(),i=Pe(),a=sa.map(l=>l.labelById).join(" "),s=sa.map(l=>l.describedById).join(" ");return u(nc,{onClose:t,isOpen:e,labelledBy:a,describedBy:s,focusFirst:r.current,focusAfterClose:n},({onCloseModal:l})=>u("div",{className:"adyen-checkout-card-fastlane__modal"},u("div",{className:"adyen-checkout-card-fastlane__modal-button-container"},u(Ge,{onClick:l,inline:!0,variant:"link",ariaLabel:o.get("card.fastlane.a11y.closeDialog"),label:u(fe,{height:"10",width:"10",src:i({imageFolder:"components/"})("cross_black"),"aria-hidden":!0,alt:""})})),sa.map(c=>u("div",{key:c.labelById,className:"adyen-checkout-card-fastlane__modal-section"},u(fe,{className:"adyen-checkout-card-fastlane__modal-section-image",src:i({imageFolder:"components/"})(c.image),alt:c.altImage}),u("h1",{id:c.labelById,className:"adyen-checkout-card-fastlane__modal-section-header"},o.get(c.headerKey)),u("div",{id:c.describedById,className:"adyen-checkout-card-fastlane__modal-section-text"},o.get(c.descriptionTextKey)))),u(fe,{className:"adyen-checkout-card-fastlane__modal-brand",src:i({imageFolder:"components/"})("paypal_fastlane_black"),alt:o.get("card.fastlane.a11y.logo")})))},_m=()=>{const[e,t]=w(!1),{i18n:n}=O(),o=Pe(),r=W(),i=T(()=>{t(!1)},[]),a=T(()=>{t(!0)},[]);return u(G,null,u(Ge,{buttonRef:r,onClick:a,classNameModifiers:["fastlane-info-modal"],variant:"link",ariaLabel:n.get("card.fastlane.a11y.openDialog"),label:u(fe,{height:"14",width:"14",src:o({imageFolder:"components/"})("fastlane_info"),alt:"","aria-hidden":!0})}),u(Cm,{isOpen:e,onClose:i,focusAfterClose:r.current}))},wm=["showConsent","defaultToggleState","termsAndConditionsLink","privacyPolicyLink","termsAndConditionsVersion","fastlaneSessionId"],Sm=e=>{if(!e)return!1;Object.keys(e).forEach(s=>!wm.includes(s)&&console.warn(`Fastlane: '${s}' is not valid Fastlane config property`));const{showConsent:t,defaultToggleState:n,termsAndConditionsLink:o,privacyPolicyLink:r,termsAndConditionsVersion:i}=e;let a=!1;return a=t?Lt(r)&&Lt(o)&&typeof t=="boolean"&&typeof n=="boolean"&&!!i:typeof t=="boolean",a||console.warn("Fastlane: Component configuration is not valid. Fastlane will not be displayed"),a},oc={[gi]:"925",[bi]:"942",[sl]:"926",[`${tt}.country`]:"930",[`${tt}.street`]:"931",[`${tt}.house_number_or_name`]:"932",[`${tt}.postal_code`]:"933",[`${tt}.city`]:"935",[`${tt}.state_or_province`]:"936",[`${yi}.postal_code`]:"934"},km="fetch-checkoutAttemptId-failed",Em=e=>e.replace(/[^0-9]/g,""),xm=(e,t)=>{if(e===tt||e===yi)return oc[`${e}.${t}`]??e;let n=oc[e]??e;return isNaN(Number(n))&&(n=Em(n)),n},Pm=e=>e?["applicationInfo","checkoutAttemptId"].reduce((t,n)=>n==="applicationInfo"?(e.applicationInfo!==void 0&&(t.applicationInfo=e.applicationInfo),t):(n==="checkoutAttemptId"&&e.checkoutAttemptId!==void 0&&(t.checkoutAttemptId=e.checkoutAttemptId),t),{}):{};function $e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Sn=(function(e){return e.instantPaymentButton="instant_payment_button",e.dualBrandButton="dual_brand_button",e.fastlaneSignupConsentToggle="fastlane_signup_consent_toggle",e.otherPaymentMethodButton="otherpaymentmethod_button",e.featuredIssuer="featured_issuer",e.list="list",e.listSearch="list_search",e.qrDownloadButton="qr_download_button",e.segmentedControl="segmented_control",e.cardNumber="card_number",e.expiryDate="expiry_date",e.expiryMonth="expiry_month",e.expiryYear="expiry_year",e.securityCode="security_code",e.donationAmountButton="donation_amount_button",e})({}),ge=(function(e){return e.clicked="clicked",e.rendered="rendered",e.selected="selected",e.validationError="validationError",e.focus="focus",e.unfocus="unfocus",e.configured="configured",e.displayed="displayed",e.input="input",e.download="download",e.sdkDownloadInitiated="sdkDownloadInitiated",e.sdkDownloadFailed="sdkDownloadFailed",e.sdkDownloadAborted="sdkDownloadAborted",e.sdkDownloadCompleted="sdkDownloadCompleted",e.Initialized="initialized",e.LookupStarted="lookupStarted",e.LookupUserNotFound="lookupUserNotFound",e.OtpStarted="otpStarted",e.OtpSucceeded="otpSucceeded",e.OtpCanceled="otpCanceled",e.OtpFailed="otpFailed",e.AddressSelectorClicked="addressSelectorClicked",e.AddressSelectorClosed="addressSelectorClosed",e.AddressChanged="addressChanged",e.PaymentListDisplayed="paymentListDisplayed",e})({});let Te=class extends Pi{get configDataExcludedFields(){return["paymentMethodsConfiguration","elementRef","isDropin","oneClick","storedPaymentMethodId","paymentMethodId","isInstantPayment","type","data","holderName","shopperEmail","email","telephoneNumber","clickToPayConfiguration","modules","i18n"]}createAnalyticsConfigData(t){if(!t)return{};const n={};try{for(const[o,r]of Object.entries(t))this.configDataExcludedFields.includes(o)||(typeof r=="function"?n[o]="function":Array.isArray(r)?n[o]=r.join(", ").substring(0,128):n[o]=typeof r=="object"&&r!==null?JSON.stringify(r).substring(0,128):r);return n}catch{return n}}getEventCategory(){return Yt.info}constructor(t){super(t.component),$e(this,"type",void 0),$e(this,"configData",void 0),$e(this,"target",void 0),$e(this,"issuer",void 0),$e(this,"isExpress",void 0),$e(this,"expressPage",void 0),$e(this,"isStoredPaymentMethod",void 0),$e(this,"brand",void 0),$e(this,"selectedValue",void 0),$e(this,"validationErrorCode",void 0),$e(this,"validationErrorMessage",void 0),$e(this,"presentedValues",void 0),$e(this,"availablePaymentMethods",void 0),$e(this,"unavailablePaymentMethods",void 0),$e(this,"cdnUrl",void 0),this.type=t.type,t.target&&(this.target=t.target),t.issuer&&(this.issuer=t.issuer),t.isStoredPaymentMethod!==void 0&&(this.isStoredPaymentMethod=t.isStoredPaymentMethod),t.isExpress!==void 0&&(this.isExpress=t.isExpress),t.expressPage&&(this.expressPage=t.expressPage),t.brand&&(this.brand=t.brand),t.cdnUrl&&(this.cdnUrl=t.cdnUrl),t.selectedValue&&(this.selectedValue=t.selectedValue),t.validationErrorCode&&(this.validationErrorCode=t.validationErrorCode),t.validationErrorMessage&&(this.validationErrorMessage=t.validationErrorMessage),t.presentedValues&&(this.presentedValues=t.presentedValues),t.availablePaymentMethods&&(this.availablePaymentMethods=t.availablePaymentMethods),t.unavailablePaymentMethods&&(this.unavailablePaymentMethods=t.unavailablePaymentMethods),this.type==="rendered"&&(this.configData=this.createAnalyticsConfigData(t?.configData)),this.type==="validationError"&&(this.validationErrorCode=xm(this.validationErrorCode,this.target))}};const Tm=["mc","visa"],Dm=({showConsent:e,defaultToggleState:t,termsAndConditionsLink:n,privacyPolicyLink:o,termsAndConditionsVersion:r,fastlaneSessionId:i,currentDetectedBrand:a,telephoneNumber:s,onChange:l,onSubmitAnalytics:c,type:d})=>{const p=te(()=>e&&Tm.includes(a),[e,a]),[h,m]=w(p),[f,y]=w(t),b=Pe(),[v,C]=w(""),{i18n:_}=O(),S=te(()=>Sm({showConsent:e,defaultToggleState:t,termsAndConditionsLink:n,privacyPolicyLink:o,termsAndConditionsVersion:r,fastlaneSessionId:i}),[e,t,n,o,r,i]),E=T(()=>{const k=!f;y(k);const A=new Te({component:d,type:ge.clicked,target:Sn.fastlaneSignupConsentToggle,configData:{isToggleOn:k}});c(A)},[f,c,d]);return R(()=>{S&&l({fastlaneData:{consentShown:h,fastlaneSessionId:i,consentGiven:!!p&&f,...r&&{consentVersion:r},...v&&{telephoneNumber:v}}})},[p,h,r,f,i,v,l,S]),R(()=>{p&&m(!0)},[p]),R(()=>{if(!S)return;const k=new Te({component:d,type:ge.rendered,configData:{isFastlaneSignupRendered:p}});c(k)},[p,S,c,d]),p&&S?u("div",{className:"adyen-checkout-card__fastlane","data-testid":"fastlane-signup-component"},u("div",{className:I("adyen-checkout-card__fastlane-consent-toggle",{"adyen-checkout-card__fastlane-consent-toggle--active":f})},u(ym,{checked:f,onChange:E,ariaLabel:_.get("card.fastlane.consentToggle"),label:u("span",null,_.get("card.fastlane.consentToggle"))}),u(_m,null)),f&&u(G,null,u(gm,{initialValue:tc(s),onChange:C}),u("div",{className:"adyen-checkout-card__fastlane-consent-text"},u(Vl,{message:_.get("card.fastlane.consentText"),urls:[n,o]})),u(fe,{className:"adyen-checkout-card__fastlane-brand",src:b({imageFolder:"components/"})("paypal_fastlane_black"),alt:_.get("card.fastlane.a11y.logo")}))):null},rc=e=>{const t=W(null),n=W(!1),o=Pe(),r=W(null),i=B=>{r.current=B},a=W({});Object.keys(a.current).length||e.setComponentRef(a.current);const s=W(0),l=W(!1),c=te(()=>new xl(e.specifications),[e.specifications]),{amount:d}=ro();a.current.sfp=t;const[p,h]=w("ready"),[m,f]=w({}),[y,b]=w({...e.holderNameRequired&&{holderName:!1}}),[v,C]=w({...e.hasHolderName&&{holderName:e.data?.holderName??""}}),[_,S]=w(""),[E,k]=w(!1),[A,$]=w(Pt),[N,L]=w($t),[U,ye]=w(null),[Q,ne]=w([]),[be,we]=w(e.storedPaymentMethodId?e.brand:""),Fe=e.billingAddressMode!==Ri.none&&e.billingAddressRequired,Me=vl(e.billingAddressMode),ve=e.data?.billingAddress??null,Qe=W(Me?ve?.country?.toUpperCase()??null:null),[Je,M]=w(!1),[ae,de]=w(Fe?ve:null),[ie,Le]=w(!1),[Xe,Se]=w(""),[je,D]=w({value:null}),[q,ke]=w(null),[gt,dn]=w("card"),[un,Io]=w(!1),{handleChangeFor:rs,triggerValidation:Br,data:Kt,valid:dt,errors:bt,setSchema:i4,setData:Xd,setValid:eu,setErrors:tu}=to({schema:[],defaultData:e.data,formatters:o0,rules:Sl}),a4=Gp({installmentOptions:e.installmentOptions,fundingSource:e.fundingSource,amount:d}),s4=e.showInstallmentAmounts??!0,l4=(U??e.countryCode)==="kr",Fn=!!e.configuration.koreanAuthenticationRequired&&l4,Mn=ie&&e.configuration.socialSecurityNumberMode==="auto"||e.configuration.socialSecurityNumberMode==="show",nu=(B,ue)=>{e.onFocus({fieldType:B,event:ue})},ou=(B,ue)=>{e.onBlur({fieldType:B,event:ue})},c4=T(B=>{dn(B.brand),e.onBrand(B)},[]),d4=hm(S,nu,ou),ru=()=>Up({props:e,showKCP:Fn,showBrazilianSSN:Mn,...e.billingAddressRequired&&{countrySpecificSchemas:c.getAddressSchemaForCountry(ae?.country),billingAddressRequiredFields:e.billingAddressRequiredFields}}),u4=T(B=>{const ue=B.fieldType!=="webInternalElement"?B.fieldType:B.name;ke(ue)},[]),h4=um(Xd,eu,tu),p4=pm(l,t,ru()),m4=T(B=>{f4(B)},[un,Io]),f4=B=>{B.status&&(B.status=="loading"?Io(!1):Io(!0))},iu=te(()=>l0(e,{sfp:t},{dualBrandSelectElements:Q,setDualBrandSelectElements:ne,setSelectedBrandValue:we,issuingCountryCode:U,setIssuingCountryCode:ye},s),[Q,U]);a.current.showValidation=()=>{n.current=!0,g4?.(),t.current.showValidation(),Br(["holderName","socialSecurityNumber","taxNumber"]),r?.current&&r.current.showValidation()},a.current.processBinLookupResponse=(B,ue)=>{iu.processBinLookup(B,ue)},a.current.setStatus=h,R(()=>(a.current.setFocusOn=t.current.setFocusOn,a.current.updateStyles=t.current.updateStyles,a.current.handleUnsupportedCard=t.current.handleUnsupportedCard,()=>{t.current.destroy()}),[]),R(()=>{const B=[...e.hasHolderName?["holderName"]:[],...Mn?["socialSecurityNumber"]:[],...Fn?["taxNumber"]:[],...Fe?["billingAddress"]:[]];i4(B)},[e.hasHolderName,Mn,Fn]),R(()=>{C({...v,holderName:Kt.holderName??"",taxNumber:Kt.taxNumber}),Se(Kt.socialSecurityNumber),Fe&&de({...Kt.billingAddress}),b({...y,holderName:!e.holderNameRequired||dt.holderName,socialSecurityNumber:!!dt.socialSecurityNumber&&dt.socialSecurityNumber,taxNumber:!!dt.taxNumber&&dt.taxNumber,billingAddress:!!dt.billingAddress&&dt.billingAddress});const B=!!bt.billingAddress&&Object.entries(bt.billingAddress).reduce((ue,[,De])=>ue||De!=null,!1);f({...m,holderName:e.holderNameRequired&&bt.holderName?bt.holderName:null,socialSecurityNumber:Mn&&bt.socialSecurityNumber?bt.socialSecurityNumber:null,taxNumber:Fn&&bt.taxNumber?bt.taxNumber:null,billingAddress:Fe&&B?bt.billingAddress:null})},[Kt,dt,bt]);const{sortedErrorList:is,previousSortedErrors:y4,clearSRPanel:g4}=fm({errors:m,props:e,isValidating:n,retrieveLayout:ru,specifications:c,billingAddress:ae,sfp:t});R(()=>{is&&Xl(is,y4,"field")?.forEach(ue=>{const De=new Te({component:e.type,type:ge.validationError,target:Ii(ue.field),validationErrorCode:ue.errorCode,validationErrorMessage:ml(ue.errorCode,Ft)});e.onSubmitAnalytics(De)})},[is]),R(()=>{const B=!!y.holderName,ue=E,De=!Fe||!!y.billingAddress,hn=!Fn||!!y.taxNumber&&!!y.encryptedPassword,Vr=!Mn||!!y.socialSecurityNumber,C4=ue&&B&&De&&hn&&Vr,_4=t.current.mapErrorsToValidationRuleResult(),w4={...m,..._4};e.onChange({data:v,valid:y,errors:w4,isValid:C4,billingAddress:ae,selectedBrandValue:be,storePaymentMethod:Je,socialSecurityNumber:Xe,installments:je})},[v,y,m,be,Je,je]),R(()=>{if(Q.length>0&&Q){const B=Q.map(hn=>hn.id),ue=B[0],De=B.toString();if(Q&&Bi(Vi,Q,"id")){const hn=new Te({component:e.type,type:ge.displayed,target:Sn.dualBrandButton,brand:ue,configData:{dualBrands:De}});e.onSubmitAnalytics(hn)}}},[Q]);const b4=ec(be);R(()=>{if(b4?.length&&be?.length){const B=new Te({component:e.type,type:ge.selected,target:Sn.dualBrandButton,brand:be});e.onSubmitAnalytics(B)}},[be]);const v4=e.storedPaymentMethodId?F0:cm;return u(G,null,u(_l,{ref:t,...jp(e),styles:{...e.styles},koreanAuthenticationRequired:e.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!e.configuration.koreanAuthenticationRequired||e.countryCode!=="kr"),onSubmitAnalytics:e.onSubmitAnalytics,onChange:(B,ue)=>{if(B.autoCompleteName){if(!e.hasHolderName)return;const hn=r0("holderName","blur"),Vr=hn?.(B.autoCompleteName,null)?B.autoCompleteName:null;return void(Vr&&(Xd("holderName",Vr),eu("holderName",!0),tu("holderName",null)))}var De;e.autoFocus&&s.current>0&&ue?.event==="handleOnFieldValid"&&ue?.fieldType===H&&B.valid.encryptedCardNumber&&p4(),C({...v,...B.data}),f({...m,...(De=B.errors,De?{encryptedCardNumber:!!De.encryptedCardNumber,encryptedExpiryDate:!!De.encryptedExpiryDate,encryptedSecurityCode:!!De.encryptedSecurityCode,encryptedPassword:!!De.encryptedPassword}:{})}),b({...y,...B.valid}),k(B.isSfpValid),L(B.cvcPolicy),Le(B.showSocialSecurityNumber),$(B.expiryDatePolicy)},onBrand:c4,onFocus:d4,onStateUpdate:m4,type:e.brand,componentType:e.type,disableIOSArrowKeys:e.disableIOSArrowKeys?u4:null,render:({setRootNode:B,setFocusOn:ue},De)=>u("div",{ref:B,className:I({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${e.fundingSource??"credit"}`]:!0,"adyen-checkout__card-input--loading":p==="loading"}),role:"form"},un&&u(mm,null),u(v4,{...Kp(e),data:v,valid:y,errors:m,handleChangeFor:rs,focusedElement:_,setFocusOn:ue,sfpState:De,cvcPolicy:N,hasInstallments:a4,showAmountsInInstallments:s4,handleInstallments:D,brandsIcons:e.brandsIcons,formData:Kt,formErrors:bt,formValid:dt,expiryDatePolicy:A,dualBrandSelectElements:Q,extensions:iu,selectedBrandValue:be,showKCP:Fn,showBrazilianSSN:Mn,socialSecurityNumber:Xe,handleOnStoreDetails:M,setAddressRef:i,billingAddress:ae,billingAddressValidationRules:Me&&Y0(Qe.current),partialAddressSchema:Me,handleAddress:h4,onAddressLookup:e.onAddressLookup,onAddressSelected:e.onAddressSelected,addressSearchDebounceMs:e.addressSearchDebounceMs,iOSFocusedField:q,onFieldFocusAnalytics:nu,onFieldBlurAnalytics:ou}))}),e.fastlaneConfiguration&&u(Dm,{...e.fastlaneConfiguration,currentDetectedBrand:gt,onChange:e.onChange,onSubmitAnalytics:e.onSubmitAnalytics,type:e.type}),un&&e.showPayButton&&e.payButton({status:p,variant:e.isPayButtonPrimaryVariant?"primary":"secondary",icon:o({imageFolder:"components/"})(`${en}lock`)}))};rc.defaultProps=ar;function yr(){if(typeof window>"u")return;const e=window.screen.colorDepth,t=window.screen.height,n=window.screen.width,o=window.navigator.userAgent;return{acceptHeader:"*/*",javaEnabled:!1,colorDepth:e,language:window.navigator.language||"en",screenHeight:t,screenWidth:n,userAgent:o,timeZoneOffset:new Date().getTimezoneOffset()}}const Nm=e=>{let t=null;return n=>{if(e.props.doBinLookup!==!1){if(n.encryptedBin&&"clientKey"in e.props&&e.props.clientKey)t=n.uuid??null,Ve({loadingContext:e.props.loadingContext,path:`v3/bin/binLookup?token=${e.props.clientKey}`},{type:"brand"in e.props?e.props.brand:g.card,supportedBrands:e.props.brands||Wn,encryptedBin:n.encryptedBin,requestId:n.uuid}).then(o=>{if(o?.requestId===t)if(o.brands?.length){const r=o.brands.reduce((a,s)=>(a.detectedBrands.push(s.brand),a.paymentMethodVariants.push(s.paymentMethodVariant),s.healthcare!==void 0&&a.healthcare.push({[s.brand]:s.healthcare}),s.supported===!0&&a.supportedBrands.push(s),a),{supportedBrands:[],detectedBrands:[],paymentMethodVariants:[],healthcare:[]}),i=r.healthcare.length>0;if(r.supportedBrands.length)return e.processBinLookupResponse({issuingCountryCode:o.issuingCountryCode??"",supportedBrands:r.supportedBrands,...o.showSocialSecurityNumber?{showSocialSecurityNumber:o.showSocialSecurityNumber}:{}}),void e.onBinLookup({type:n.type,detectedBrands:r.detectedBrands,supportedBrands:r.supportedBrands.map(a=>a.brand),paymentMethodVariants:r.paymentMethodVariants,supportedBrandsRaw:r.supportedBrands,brands:e.props.brands||Wn,issuingCountryCode:o.issuingCountryCode,...i&&{healthcare:r.healthcare}});if(r.detectedBrands.length){const a={type:"card",fieldType:"encryptedCardNumber",error:Ft.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,detectedBrands:r.detectedBrands};return e.handleUnsupportedCard(a),void e.onBinLookup({type:n.type,detectedBrands:r.detectedBrands,supportedBrands:null,paymentMethodVariants:r.paymentMethodVariants,...i&&{healthcare:r.healthcare},brands:e.props.brands||Wn})}}else e.onBinLookup({type:n.type,detectedBrands:null,supportedBrands:null,brands:e.props.brands||Wn}),e.processBinLookupResponse({},!0);else o?.requestId||e.props.onError?.(o||{errorType:"binLookup",message:"unknownError"})});else if(t){e.processBinLookupResponse(null,!0),t=null;const o={type:"card",fieldType:"encryptedCardNumber",error:""};e.handleUnsupportedCard(o),e.onBinLookup({isReset:!0})}e.props.onBinValue&&e.props.onBinValue(n)}else e.props.onBinValue&&e.props.onBinValue(n)}},Am="https://sandbox-assets.secure.checkout.visa.com/checkout-widget/resources/js/src-i-adapter/visa-sdk.js?v2",Im="https://assets.secure.checkout.visa.com/checkout-widget/resources/js/src-i-adapter/visa-sdk.js?v2",Rm="https://sandbox.src.mastercard.com/sdk/srcsdk.mastercard.js",$m="https://src.mastercard.com/sdk/srcsdk.mastercard.js",Fm=({dpaLocale:e="en_US",dpaPresentationName:t=""})=>({dpaTransactionOptions:{dpaLocale:e,payloadTypeIndicator:"NON_PAYMENT",customInputData:{checkoutOrchestrator:"merchant"}},dpaData:{dpaPresentationName:t}}),Mm=({dpaLocale:e="en_US",dpaPresentationName:t=""})=>({dpaTransactionOptions:{dpaLocale:e,paymentOptions:{dynamicDataType:"CARD_APPLICATION_CRYPTOGRAM_SHORT_FORM"},consumerNameRequested:!0,customInputData:{"com.mastercard.dcfExperience":"PAYMENT_SETTINGS"},confirmPayment:!1},dpaData:{dpaPresentationName:t}});function io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ce=class extends Error{toString(){return`Reason: ${this.reason} / Source: ${this.source} / Scheme: ${this.scheme} / Message: ${this.message}`}constructor(t,n,o){super(),io(this,"reason",void 0),io(this,"message",void 0),io(this,"source",void 0),io(this,"scheme",void 0),io(this,"errorFromCardSchemeSdk",void 0);const r="error"in t?t?.error?.message:t?.message,i="error"in t?t?.error?.reason:t?.reason;this.message=r,this.reason=i,this.source=n,this.scheme=o,this.errorFromCardSchemeSdk=t}};function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ao=class as{removeScript(){this.cleanupListeners(),this.script?.parentNode?.removeChild(this.script),this.script=null}cleanupListeners(){this.script&&(this.script.removeEventListener("load",this.handleOnLoad),this.script.removeEventListener("error",this.handleOnError))}attachListeners(){this.script&&(this.cleanupListeners(),this.script.addEventListener("load",this.handleOnLoad),this.script.addEventListener("error",this.handleOnError))}loadScript(){return new Promise((t,n)=>{const o=document.querySelector(this.node);o?(this.resolveLoadScript=t,this.rejectLoadScript=n,this.script=o.querySelector(`script[src="${this.src}"]`),this.script?.getAttribute("data-script-loaded")?this.resolveLoadScript():this.script?this.attachListeners():(this.script=document.createElement("script"),Object.assign(this.script,this.attributes),Object.assign(this.script.dataset,this.dataAttributes),this.script.src=this.src,this.script.async=!0,this.attachListeners(),o.appendChild(this.script))):n(new F("SCRIPT_ERROR",`Unable to find script container node: ${this.node}`))})}trackEvent(t){const n=new Te({type:t,component:this.component,cdnUrl:this.baseUrl});this.analytics?.sendAnalytics(n)}constructor({src:t,component:n,node:o="body",attributes:r,dataAttributes:i,analytics:a}){_e(this,"src",void 0),_e(this,"component",void 0),_e(this,"node",void 0),_e(this,"attributes",void 0),_e(this,"dataAttributes",void 0),_e(this,"analytics",void 0),_e(this,"baseUrl",void 0),_e(this,"script",void 0),_e(this,"loadPromise",null),_e(this,"rejectLoadPromise",null),_e(this,"resolveLoadScript",null),_e(this,"rejectLoadScript",null),_e(this,"handleOnLoad",()=>{this.script?.setAttribute("data-script-loaded","true"),this.cleanupListeners(),this.resolveLoadScript?.()}),_e(this,"handleOnError",s=>{this.cleanupListeners();const l=new F("SCRIPT_ERROR",`Unable to load script ${this.src}.${s?.message&&`Message: ${s.message}`}`,{cause:s?.error||s});this.rejectLoadScript?.(l)}),_e(this,"load",()=>(this.loadPromise!==null||(this.loadPromise=new Promise((s,l)=>{this.rejectLoadPromise=l;let c=0;this.trackEvent(ge.sdkDownloadInitiated);const d=async()=>{try{c++,await this.loadScript(),this.trackEvent(ge.sdkDownloadCompleted),s()}catch(p){if(this.loadPromise===null)return;this.trackEvent(ge.sdkDownloadFailed),this.removeScript(),c<as.MAX_NUMBER_OF_RETRIES?setTimeout(()=>{d()},as.RETRY_DELAY):(this.trackEvent(ge.sdkDownloadAborted),this.loadPromise=null,this.rejectLoadPromise=null,l(p))}};d()})),this.loadPromise)),_e(this,"remove",()=>{this.rejectLoadPromise?.(new F("CANCEL","Script loading cancelled.")),this.removeScript(),this.loadPromise=null}),this.src=t,this.component=n,this.node=o,this.attributes=r,this.dataAttributes=i,this.analytics=a,this.baseUrl=(function(s){const l=new URL(s);return l.origin+l.pathname})(this.src)}};_e(ao,"RETRY_DELAY",1e3),_e(ao,"MAX_NUMBER_OF_RETRIES",3);function so(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ic=class{async loadSdkScript(){this.isSdkIsAvailableOnWindow()||(this.scriptElement=new ao({src:this.sdkUrl,component:"clicktopay",analytics:this.analytics}),await this.scriptElement.load()),this.assignSdkReference()}removeSdkScript(){this.scriptElement.remove()}async checkout(t){try{return await this.schemeSdk.checkout(t)}catch(n){throw new Ce(n,"checkout",this.schemeName)}}async unbindAppInstance(){try{await this.schemeSdk.unbindAppInstance()}catch(t){throw new Ce(t,"unbindAppInstance",this.schemeName)}}async isRecognized(){try{return await this.schemeSdk.isRecognized()}catch(t){throw new Ce(t,"isRecognized",this.schemeName)}}async initiateIdentityValidation(){try{return await this.schemeSdk.initiateIdentityValidation()}catch(t){throw new Ce(t,"initiateIdentityValidation",this.schemeName)}}async getSrcProfile(t){try{return await this.schemeSdk.getSrcProfile({idTokens:t})}catch(n){throw new Ce(n,"getSrcProfile",this.schemeName)}}constructor(t,n,o){if(so(this,"schemeSdk",void 0),so(this,"customSdkConfiguration",void 0),so(this,"analytics",void 0),so(this,"sdkUrl",void 0),so(this,"scriptElement",null),!t)throw Error("AbstractSrcInitiator: Invalid SDK URL");this.sdkUrl=t,this.customSdkConfiguration=n,this.analytics=o}};const Lm={email:"EMAIL",telephoneNumber:"MOBILE_NUMBER"};let Om=class extends ic{isSdkIsAvailableOnWindow(){return!!window.vAdapters?.VisaSRCI}assignSdkReference(){this.schemeSdk=new window.vAdapters.VisaSRCI}async init(t,n){try{const o={...t,...Fm(this.customSdkConfiguration),srciTransactionId:n};await this.schemeSdk.init(o);const r=document.getElementById("vcop-src-system-frame");r?.setAttribute("aria-hidden","true"),r?.setAttribute("tabindex","-1"),r?.setAttribute("inert","")}catch(o){throw new Ce(o,"init",this.schemeName)}}async identityLookup({identityValue:t,type:n}){try{const o={identityValue:t,type:Lm[n]};return await this.schemeSdk.identityLookup(o)}catch(o){throw new Ce(o,"identityLookup",this.schemeName)}}async completeIdentityValidation(t){try{return await this.schemeSdk.completeIdentityValidation(t)}catch(n){throw new Ce(n,"completeIdentityValidation",this.schemeName)}}constructor(t,n,o){var r,i,a;super(t.toLowerCase().includes("live")?Im:Am,n,o),a="visa",(i="schemeName")in(r=this)?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a}};const Bm={email:"EMAIL_ADDRESS",telephoneNumber:"MOBILE_PHONE_NUMBER"};let Vm=class extends ic{isSdkIsAvailableOnWindow(){return!!window.SRCSDK_MASTERCARD}assignSdkReference(){this.schemeSdk=window.SRCSDK_MASTERCARD}async init(t,n){try{const o={...t,...Mm(this.customSdkConfiguration),srciTransactionId:n};await this.schemeSdk.init(o)}catch(o){throw new Ce(o,"init",this.schemeName)}}async identityLookup({identityValue:t,type:n}){try{const o={identityValue:t,identityType:Bm[n]};return await this.schemeSdk.identityLookup({consumerIdentity:o})}catch(o){throw new Ce(o,"identityLookup",this.schemeName)}}async completeIdentityValidation(t){try{return await this.schemeSdk.completeIdentityValidation({validationData:t})}catch(n){throw new Ce(n,"completeIdentityValidation",this.schemeName)}}constructor(t,n,o){var r,i,a;super(t.toLowerCase().includes("live")?$m:Rm,n,o),a="mc",(i="schemeName")in(r=this)?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a}};const ac=e=>e.status==="fulfilled",sc=e=>e.status==="rejected";function lc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cc={visa:Om,mc:Vm,default:null};let Um=class{async load(t,n){if(!this.schemes||this.schemes.length===0)throw new F("ERROR","ClickToPay -> SrcSdkLoader: There are no schemes set to be loaded");return new Promise((o,r)=>{const i=this.schemes.map(s=>((l,c,d,p)=>{const h=cc[l]||cc.default;return h?new h(c,d,p):null})(s,t,this.customSdkConfiguration,n)),a=i.map(s=>s.loadSdkScript());Promise.allSettled(a).then(s=>{s.every(sc)&&r(new F("ERROR",`ClickToPay -> SrcSdkLoader # Unable to load network schemes: ${this.schemes.toString()}`));const l=i.filter((c,d)=>ac(s[d]));o(l)})})}constructor(t,{dpaLocale:n="en_US",dpaPresentationName:o=""}){lc(this,"schemes",void 0),lc(this,"customSdkConfiguration",void 0),this.schemes=t,this.customSdkConfiguration={dpaLocale:n,dpaPresentationName:o}}};const gr={mc:"Mastercard",visa:"Visa"};function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Hm=class{get title(){return this.scheme==="visa"?gr[this.scheme]:this.descriptorName||gr[this.scheme]}get isDcfPopupEmbedded(){return this.scheme==="mc"}confirmCardIsExpired(){if(!["ACTIVE","PENDING"].includes(this.status))return!0;if(!this.panExpirationYear&&!this.panExpirationMonth)return!1;const[t,n]=[new Date().getMonth()+1,new Date().getFullYear()];return!(Number(this.panExpirationYear)>n)&&!(Number(this.panExpirationYear)===n&&Number(this.panExpirationMonth)>=t)}constructor(t,n,o){Ye(this,"dateOfCardLastUsed",void 0),Ye(this,"dateOfCardCreated",void 0),Ye(this,"panLastFour",void 0),Ye(this,"srcDigitalCardId",void 0),Ye(this,"scheme",void 0),Ye(this,"artUri",void 0),Ye(this,"srcCorrelationId",void 0),Ye(this,"tokenId",void 0),Ye(this,"isExpired",void 0),Ye(this,"panExpirationMonth",void 0),Ye(this,"panExpirationYear",void 0),Ye(this,"descriptorName",void 0),Ye(this,"status",null),this.dateOfCardLastUsed=t.dateOfCardLastUsed,this.dateOfCardCreated=t.dateOfCardCreated,this.panLastFour=t.panLastFour,this.srcDigitalCardId=t.srcDigitalCardId,this.descriptorName=t.digitalCardData.descriptorName,this.tokenId=t.tokenId,this.scheme=n,this.artUri=t.digitalCardData.artUri,this.srcCorrelationId=o,this.panExpirationMonth=t.panExpirationMonth,this.panExpirationYear=t.panExpirationYear,this.status=t.digitalCardData.status,this.isExpired=this.confirmCardIsExpired()}};const dc="ctpIframe";function Km(e,t,n){const{scheme:o,tokenId:r,srcDigitalCardId:i,srcCorrelationId:a}=e;return o==="visa"?r?{srcScheme:o,srcCorrelationId:a,srcTokenReference:n.toLowerCase().includes("live")?r:"987654321"}:{srcScheme:o,srcCheckoutPayload:t.checkoutResponse,srcCorrelationId:a}:{srcScheme:o,srcDigitalCardId:i,srcCorrelationId:a}}function jm(e,t){const{profiles:n,srcCorrelationId:o}=t,r=n.reduce((i,a)=>[...i,...a.maskedCards.map(s=>new Hm(s,t.scheme,o))],[]);return[...e,...r]}function uc(e,t){return new Date(t.dateOfCardLastUsed).getTime()-new Date(e.dateOfCardLastUsed).getTime()}function zm(e,t){return new Date(t.dateOfCardCreated).getTime()-new Date(e.dateOfCardCreated).getTime()}function qm(e,t){return t.isExpired?e.expiredCards.push(t):e.availableCards.push(t),e}function Wm(e,t){return t.dateOfCardLastUsed?e.usedCards.push(t):e.unusedCards.push(t),e}function Gm(e){const t=e.reduce(jm,[]),{availableCards:n,expiredCards:o}=t.reduce(qm,{availableCards:[],expiredCards:[]}),{unusedCards:r,usedCards:i}=n.reduce(Wm,{unusedCards:[],usedCards:[]});return[...i.sort(uc),...r.sort(zm),...o.sort(uc)]}function la(e){return!!e.reason}function br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let kn=class extends Error{setCorrelationId(t){this.correlationId=t}toString(){return this.message}constructor(t){super(`ClickToPayService - Timeout during ${t.source}() of the scheme '${t.scheme}'`),br(this,"scheme",void 0),br(this,"source",void 0),br(this,"isTimeoutTriggeredBySchemeSdk",void 0),br(this,"correlationId",void 0),this.name="TimeoutError",this.source=t.source,this.scheme=t.scheme,this.isTimeoutTriggeredBySchemeSdk=t.isTimeoutTriggeredBySchemeSdk}};function ca(e,t,n){let o=null;return Promise.race([e(),(r=t,new Promise((i,a)=>{o=setTimeout(()=>a(n),r)}))]).then(i=>(clearTimeout(o),i)).catch(i=>{throw clearTimeout(o),i});var r}function Ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ce=(function(e){return e.Idle="Idle",e.Loading="Loading",e.ShopperIdentified="ShopperIdentified",e.OneTimePassword="OneTimePassword",e.Ready="Ready",e.Login="Login",e.NotAvailable="NotAvailable",e})({});let Ym=class{get shopperAccountFound(){return["Ready","ShopperIdentified"].includes(this.state)}get schemes(){return this.sdkLoader.schemes}updateStoreCookiesConsent(t){this.storeCookies=t}async initialize(){this.setState("Loading");try{this.sdks=await this.sdkLoader.load(this.environment,this.analytics),await this.initiateSdks();const{recognized:t=!1,idTokens:n=null}=await this.verifyIfShopperIsRecognized();if(t)return await this.getShopperProfile(n),void this.setState("Ready");if(!this.shopperIdentity)return void this.setState("NotAvailable");const{isEnrolled:o}=await this.verifyIfShopperIsEnrolled(this.shopperIdentity);if(o)return void this.setState("ShopperIdentified");this.setState("NotAvailable")}catch(t){t instanceof Ce&&t?.reason==="REQUEST_TIMEOUT"||t instanceof kn?this.handleTimeout(t):t instanceof Ce?console.warn(`Error at ClickToPayService # init: ${t.toString()}`):console.warn(t),this.setState("NotAvailable")}}subscribeOnStateChange(t){this.stateSubscriber=t}async startIdentityValidation(){if(!this.validationSchemeSdk)throw Error("startIdentityValidation: No ValidationSDK set for the validation process");try{const{maskedValidationChannel:t}=await this.validationSchemeSdk.initiateIdentityValidation();this.identityValidationData={maskedShopperContact:t.replace(/\*/g,"•"),selectedNetwork:gr[this.validationSchemeSdk.schemeName]},this.setState("OneTimePassword")}catch(t){throw this.validationSchemeSdk=null,t}}async finishIdentityValidation(t){if(!this.validationSchemeSdk)throw Error("finishIdentityValidation: No ValidationSDK set for the validation process");const n=await this.validationSchemeSdk.completeIdentityValidation(t);await this.getShopperProfile([n.idToken]),this.setState("Ready"),this.validationSchemeSdk=null}async checkout(t){if(!t)throw Error("ClickToPayService # checkout: Missing card data");const n=this.sdks.find(r=>r.schemeName===t.scheme),o=await n.checkout({srcDigitalCardId:t.srcDigitalCardId,srcCorrelationId:t.srcCorrelationId,...t.isDcfPopupEmbedded&&{windowRef:window.frames[dc]},...this.storeCookies&&{complianceSettings:{complianceResources:[{complianceType:"REMEMBER_ME",uri:""}]}}});if(o.dcfActionCode!=="COMPLETE")throw new F("ERROR",`Checkout through Scheme DCF did not complete. DCF Action code received: ${o.dcfActionCode}`);return Km(t,o,this.environment)}async logout(){if(!this.sdks)throw new F("ERROR","ClickToPayService is not initialized");try{const t=this.sdks.map(n=>n.unbindAppInstance());await Promise.all(t)}catch(t){t instanceof Ce?console.warn(`Error at ClickToPayService # logout: ${t.toString()}`):console.warn(t)}this.shopperCards=null,this.identityValidationData=null,this.validationSchemeSdk=null,this.setState("Login")}verifyIfShopperIsEnrolled(t){const{shopperEmail:n}=t;return new Promise((o,r)=>{const i=this.sdks.map(a=>ca(()=>a.identityLookup({identityValue:n,type:"email"}),5e3,new kn({source:"identityLookup",scheme:a.schemeName,isTimeoutTriggeredBySchemeSdk:!1})).then(s=>{s.consumerPresent&&!this.validationSchemeSdk&&(this.setSdkForPerformingShopperIdentityValidation(a),o({isEnrolled:!0}))}).catch(s=>{r(s)}));Promise.allSettled(i).then(()=>{o({isEnrolled:!1})})})}setState(t){this.state=t,this.stateSubscriber?.(this.state)}setSdkForPerformingShopperIdentityValidation(t){this.validationSchemeSdk=t}handleTimeout(t){const n=t instanceof Ce?new kn({source:t.source,scheme:t.scheme,isTimeoutTriggeredBySchemeSdk:!0}):t;n.scheme==="visa"&&(n.setCorrelationId(window.VISA_SDK?.correlationId),window.VISA_SDK?.correlationId?window.VISA_SDK?.buildClientProfile?.():window.VISA_SDK?.buildClientProfile?.(this.schemesConfig.visa.srciDpaId)),this.onTimeout?.(n)}async getShopperProfile(t){return new Promise((n,o)=>{const r=this.sdks.map(i=>i.getSrcProfile(t));Promise.allSettled(r).then(i=>{i.every(sc)&&o(i[0].reason);const a=i.map((s,l)=>ac(s)&&{...s.value,scheme:this.sdks[l].schemeName}).filter(s=>!!s);this.shopperCards=Gm(a),n()})})}verifyIfShopperIsRecognized(){return new Promise((t,n)=>{const o=this.sdks.map(r=>ca(()=>r.isRecognized(),5e3,new kn({source:"isRecognized",scheme:r.schemeName,isTimeoutTriggeredBySchemeSdk:!1})).then(i=>{i.recognized&&t(i)}).catch(i=>{n(i)}));Promise.allSettled(o).then(()=>{t({recognized:!1})})})}initiateSdks(){const t=this.sdks.map(n=>{const o=this.schemesConfig[n.schemeName];return ca(()=>n.init(o,this.srciTransactionId),5e3,new kn({source:"init",scheme:n.schemeName,isTimeoutTriggeredBySchemeSdk:!1}))});return Promise.all(t)}constructor(t,n,o,r,i,a){Ue(this,"sdkLoader",void 0),Ue(this,"schemesConfig",void 0),Ue(this,"shopperIdentity",void 0),Ue(this,"environment",void 0),Ue(this,"analytics",void 0),Ue(this,"onTimeout",void 0),Ue(this,"srciTransactionId",Be()),Ue(this,"sdks",void 0),Ue(this,"validationSchemeSdk",null),Ue(this,"stateSubscriber",void 0),Ue(this,"state","Idle"),Ue(this,"shopperCards",null),Ue(this,"identityValidationData",null),Ue(this,"storeCookies",!1),this.sdkLoader=n,this.schemesConfig=t,this.shopperIdentity=i,this.environment=o,this.onTimeout=a,this.analytics=r}};function Zm(e,t,n,o){const r=Jm(e);if(!r)return null;const i=Qm(t?.shopperEmail,t?.telephoneNumber),a=Object.keys(r),s=new Um(a,{dpaLocale:t?.locale,dpaPresentationName:t?.merchantDisplayName});return new Ym(r,s,n,o,i,t?.onTimeout)}const Qm=(e,t)=>{const n={...e&&{shopperEmail:e}};return Object.keys(n).length>0?n:null},Jm=e=>{if(!e)return null;const{visaSrciDpaId:t,visaSrcInitiatorId:n,mcDpaId:o,mcSrcClientId:r}=e,i={...o&&r&&{mc:{srciDpaId:o,srcInitiatorId:r}},...t&&n&&{visa:{srciDpaId:t,srcInitiatorId:n}}};return Object.keys(i).length===0?null:i},hc=jo({status:null,onSubmit:null,onSetStatus:null,onError:null,onReady:null,configuration:null,isStandaloneComponent:null,isCtpPrimaryPaymentMethod:null,isStoringCookies:!1,setIsCtpPrimaryPaymentMethod:null,logoutShopper:null,updateStoreCookiesConsent:null,ctpState:null,cards:[],schemes:[],otpMaskedContact:null,otpNetwork:null,checkout:null,verifyIfShopperIsEnrolled:null,startIdentityValidation:null,finishIdentityValidation:null}),Xm=({isStandaloneComponent:e=!1,clickToPayService:t,configuration:n,children:o,setClickToPayRef:r,onSubmit:i,onSetStatus:a,onError:s})=>{const[l]=w(t),[c,d]=w(t?.state||ce.NotAvailable),[p,h]=w(!0),[m,f]=w("ready"),y=W(!1),b=W({setStatus:f});R(()=>{r(b.current)},[]),R(()=>{l?.subscribeOnStateChange($=>d($))},[l]);const v=T(()=>{y.current||(n.onReady?.(),y.current=!0)},[n?.onReady]),C=T(async $=>{await l?.finishIdentityValidation($)},[l]),_=T(async()=>await l?.startIdentityValidation(),[l]),S=T(async $=>await l?.checkout($),[l]),E=T(async $=>await l?.verifyIfShopperIsEnrolled($),[l]),k=T(async()=>{await l?.logout()},[l]),A=T($=>{l.updateStoreCookiesConsent($)},[l]);return u(hc.Provider,{value:{status:m,onSubmit:i,onError:s,onSetStatus:a,configuration:n,isStoringCookies:l?.storeCookies,isStandaloneComponent:e,isCtpPrimaryPaymentMethod:p,setIsCtpPrimaryPaymentMethod:h,ctpState:c,verifyIfShopperIsEnrolled:E,cards:l?.shopperCards,schemes:l?.schemes,otpMaskedContact:l?.identityValidationData?.maskedShopperContact,otpNetwork:l?.identityValidationData?.selectedNetwork,checkout:S,logoutShopper:k,startIdentityValidation:_,finishIdentityValidation:C,updateStoreCookiesConsent:A,onReady:v}},o)};function rt(){return Wt(hc)}const e1={otp:{validate:e=>!!e&&e.length>0,errorMessage:"field.error.required",modes:["blur"]},default:{validate:e=>!!e&&e.length>0,errorMessage:"field.error.required",modes:["blur"]}},t1=({onError:e,onResendCode:t,disabled:n})=>{const[o,r]=w(null),[i,a]=w(!1),{i18n:s}=O(),{startIdentityValidation:l}=rt(),[c,d]=w(null);Al(c),R(()=>{let h;return o>0&&(h=setTimeout(()=>r(o-1),1e3)),o===60?d(`${s.get("ctp.otp.resendCode")} - ${o}s`):o===0&&d(s.get("ctp.otp.resendCode")),()=>clearTimeout(h)},[o]),R(()=>{let h;return i&&(h=setTimeout(()=>{a(!1),r(60)},2e3)),()=>clearTimeout(h)},[i]);const p=T(async h=>{h.preventDefault();try{t(),a(!0),await l()}catch(m){if(r(0),a(!1),!la(m))return void console.error(m);e(m.reason)}},[l,e,t]);return i?u("div",{role:"alert",className:"adyen-checkout-ctp__otp-resend-code--confirmation"},s.get("ctp.otp.codeResent"),u(lr,{type:`${en}checkmark_black`,height:14,width:14})):o>0?u("div",{role:"timer",className:"adyen-checkout-ctp__otp-resend-code--disabled"},s.get("ctp.otp.resendCode")," -"," ",u("span",{className:"adyen-checkout-ctp__otp-resend-code-counter"}," ",o>0&&`${o}s`," ")):u(Ge,{classNameModifiers:[I("otp-resend-code",{"otp-resend-code--disabled":n})],onClick:p,variant:"link",inline:!0,disabled:n},s.get("ctp.otp.resendCode"))},da=(e,t,n="")=>{const o=e instanceof Element?e:_t(document,e);let r;r=_t(o,t==="country"||t==="stateOrProvince"||t==="issuer-list"||t==="selectedAccountType"?`${n}.adyen-checkout__field--${t} .adyen-checkout__filter-input`:`${n} [name="${t}"]`),ht.__IS_IOS&&Ql(r),r?.focus({preventScroll:ht.__IS_IOS})};function n1(e){return{focusFirstError:T((t,n)=>{const o=(function(i){return i&&typeof i=="object"&&"current"in i?i.current??void 0:i})(e);if(!o)return;const r=n.find(i=>t[i]);r&&da(o,r)},[e])}}function pc(e){const{formHolder:t,...n}=e,o=to(n),{focusFirstError:r}=n1(t),i=W(!1),a=T((s=null)=>{i.current=!0,o.triggerValidation(s)},[o.triggerValidation]);return R(()=>{i.current&&(i.current=!1,r(o.errors,o.schema))},[o.errors]),{...o,triggerValidation:a}}const o1=(e,t,n,o=!0)=>{if(t?.errorMessage&&typeof t.errorMessage=="string"){const r=t.errorMessage,i=[tt,kh].includes(r),a={values:{label:o?n?.toLowerCase():n}};return i?e.get(r,a):e.get(r)}return!!t},r1=e=>{const{i18n:t}=O(),{configuration:{disableOtpAutoFocus:n}}=rt(),[o,r]=w(null),i=W(null),{handleChangeFor:a,data:s,triggerValidation:l,valid:c,errors:d,isValid:p,setData:h}=pc({schema:["otp"],rules:e1,formHolder:i}),m=W({validateInput:null}),f=W(null),[y,b]=w(!1),v=T(()=>{b(!0),l()},[l]);R(()=>{s.otp&&b(!0)},[s.otp]),R(()=>{!n&&f.current&&f.current.focus()},[f.current,n]),R(()=>{i.current&&e.errorMessage&&da(i.current,"otp")},[e.errorMessage]),R(()=>{m.current.validateInput=v,e.onSetInputHandlers(m.current)},[v,e.onSetInputHandlers]);const C=T(()=>{h("otp",""),r(null),n||f.current.focus(),e.onResendCode()},[e.onResendCode,f.current,n]),_=T(k=>{const A=t.get(`ctp.errors.${k}`);A&&r(A)},[t]),S=T(k=>{k.key==="Enter"&&e.onPressEnter()},[e.onPressEnter]);R(()=>{e.onChange({data:s,valid:c,errors:d,isValid:p})},[s,c,d]);const E=T(()=>y?o||e.errorMessage||o1(t,d.otp,t.get("ctp.otp.fieldLabel")):null,[y,o,e.errorMessage,d.otp,t]);return u("div",{ref:i,className:"adyen-checkout-ctp__otp-field-wrapper"},u(me,{name:"oneTimePassword",label:t.get("ctp.otp.fieldLabel"),errorMessage:E(),classNameModifiers:["otp"],errorLive:!0},u(oo,{name:"otp",autocorrect:"off",spellcheck:!1,value:s.otp,disabled:e.disabled,onInput:a("otp","input"),onBlur:a("otp","blur"),onKeyDown:S,setRef:k=>{f.current=k},autocomplete:"off"})),u("div",{className:"adyen-checkout-ctp__otp-resend-code-wrapper"},u(t1,{disabled:e.isValidatingOtp,onError:_,onResendCode:C})))},mc=({classNameModifiers:e=[]})=>{const t=Pe(),{schemes:n}=rt(),o=t()("ctp"),r=t({imageFolder:"components/"})("pipe");return u("div",{className:I("adyen_checkout-ctp__brand-wrapper",e.map(i=>`adyen_checkout-ctp__brand-wrapper--${i}`))},u(fe,{className:"adyen_checkout-ctp__brand-logo",src:o,alt:"Logo of Click to Pay"}),u(fe,{className:"adyen_checkout-ctp__brand-pipe",src:r,alt:""}),n.map(i=>u(fe,{key:i,className:I("adyen_checkout-ctp__brand-scheme",`adyen_checkout-ctp__brand-scheme-${i}`),src:t()(i),alt:`Logo of ${gr[i]}`})))};let fc=Date.now();function yc(){return fc+=1,`adyen-${fc}`}const i1=({isOpen:e,onClose:t,focusAfterClose:n})=>{const o=W(),{i18n:r}=O(),i=Pe(),a=yc(),s=yc();return u(nc,{onClose:t,isOpen:e,classNameModifiers:["ctp"],labelledBy:a,describedBy:s,focusFirst:o.current,focusAfterClose:n},({onCloseModal:l})=>u(G,null,u(fe,{className:"adyen-checkout__ctp-modal-header-image",src:i({imageFolder:"components/"})("ctp_landscape"),alt:""}),u("h2",{id:a,className:"adyen-checkout__ctp-modal-title"},r.get("ctp.infoPopup.title")),u("div",{id:s},u("p",{tabIndex:-1,ref:o,className:"adyen-checkout__ctp-modal-text"},r.get("ctp.infoPopup.subtitle")),u("ul",{className:"adyen-checkout__ctp-modal-text adyen-checkout__ctp-modal-benefits"},u("li",null,r.get("ctp.infoPopup.benefit1")),u("li",null,r.get("ctp.infoPopup.benefit2")),u("li",null,r.get("ctp.infoPopup.benefit3"))),u(mc,{classNameModifiers:["popup"]})),u(Ge,{onClick:l,label:r.get("close")})))},gc=()=>{const[e,t]=w(!1),n=W(),{i18n:o}=O(),r=Pe()({imageFolder:"components/"})("info"),i=T(()=>{t(!1)},[]),a=T(()=>{t(!0)},[]);return u(G,null,u("button",{ref:n,onClick:a,className:"adyen-web__ctp-info-button","aria-label":o.get("ctp.aria.infoModalButton"),type:"button"},u(fe,{height:"15",src:r,"aria-hidden":!0})),u(i1,{isOpen:e,onClose:i,focusAfterClose:n.current}))},a1=()=>{const{ctpState:e,logoutShopper:t,status:n,cards:o}=rt(),{i18n:r}=O();if([ce.Ready,ce.OneTimePassword].includes(e)===!1)return null;const i=te(()=>e===ce.Ready&&o.length>1?r.get("ctp.logout.notYourCards"):e===ce.Ready&&o.length===1?r.get("ctp.logout.notYourCard"):e===ce.Ready&&o.length===0?r.get("ctp.logout.notYourProfile"):r.get("ctp.logout.notYou"),[r,e]);return u(Ge,{classNameModifiers:[I("section-logout-button",{"section-logout-button--disabled":n==="loading"})],disabled:n==="loading",onClick:t,variant:"link",inline:!0},i)},Ot=({children:e,onEnterKeyPress:t})=>{const{isStandaloneComponent:n}=rt();return u("div",{className:I("adyen-checkout-ctp__section",{"adyen-checkout-ctp__section--standalone":n}),onKeyDown:t},u("div",{className:"adyen-checkout-ctp__section-brand"},u(mc,null),u(a1,null)),e)};Ot.Title=({endAdornment:e,children:t})=>u("div",{className:"adyen-checkout-ctp__section-header"},u("h1",{className:"adyen-checkout-ctp__section-header-title"},t),e&&u("span",{className:"adyen-checkout-ctp__section-header-adornment"},e)),Ot.Text=({children:e})=>u("p",{className:"adyen-checkout-ctp__section-text"},e);const s1=()=>window.matchMedia("(max-width: 480px)").matches;function l1(){const{i18n:e}=O(),{updateStoreCookiesConsent:t,isStoringCookies:n}=rt(),[o,r]=w(n),[i,a]=w(s1()),s=T(()=>{const l=!o;r(l),t(l)},[t,r,o]);return u("div",{className:I("adyen-checkout-ctp__otp-checkbox-container",{"adyen-checkout-ctp__otp-checkbox-container--checked":o})},u(me,{classNameModifiers:["consentCheckbox"],name:"clickToPayCookiesCheckbox",showContextualElement:!1,useLabelElement:!1,i18n:e},u(Xi,{name:"clickToPayCookiesCheckbox",onInput:s,label:e.get("ctp.otp.saveCookiesCheckbox.label"),checked:o,"aria-describedby":"adyen-ctp-cookies-info"})),u("p",{className:"adyen-checkout-ctp__otp-checkbox-info"},i?u(G,null,u("span",{id:"adyen-ctp-cookies-info"},e.get("ctp.otp.saveCookiesCheckbox.shorterInfo")," "),u("button",{className:"adyen-checkout-ctp__otp-readmore-button",onClick:()=>a(!1)},e.get("readMore"),"..")):u("span",{id:"adyen-ctp-cookies-info"},e.get("ctp.otp.saveCookiesCheckbox.information"))))}const c1=({onDisplayCardComponent:e})=>{const{i18n:t}=O(),{finishIdentityValidation:n,otpMaskedContact:o,otpNetwork:r,isCtpPrimaryPaymentMethod:i}=rt(),[a,s]=w(null),[l,c]=w(!1),[d,p]=w(!1),[h,m]=w(null),[f,y]=w(null),[b,v]=w(!1),C=T($=>{y($)},[]),_=T(({data:$,isValid:N})=>{s($.otp),c(N)},[]),S=T(()=>{m(null)},[]),E=T(async()=>{if(m(null),l){p(!0);try{await n(a)}catch($){if(!la($))return void p(!1);m($?.reason),p(!1),$?.reason==="ACCT_INACCESSIBLE"&&(v(!0),e?.())}}else f.validateInput()},[a,l,f,e]),k=T($=>{$.key==="Enter"&&E()},[E]),A=t.get("ctp.otp.subtitle").split("%@");return u(G,null,u(Ot.Title,{endAdornment:u(gc,null)},t.get("ctp.otp.title")),u(Ot.Text,null,A[0]," ",r," ",A[1],u("span",{className:"adyen-checkout-ctp__otp-subtitle--highlighted"},o),A[2]),u(r1,{hideResendOtpButton:b,onChange:_,onSetInputHandlers:C,disabled:d,errorMessage:h&&t.get(`ctp.errors.${h}`),onPressEnter:E,onResendCode:S,isValidatingOtp:d}),u(l1,null),u(Ge,{disabled:b,label:t.get("continue"),variant:i?"primary":"secondary",onClick:E,status:d&&"loading",onKeyDown:k}))},d1=({card:e,errorMessage:t})=>{const{i18n:n}=O(),o=Pe(),r=e.artUri||o()(e.scheme);return u(G,null,u("div",{className:"adyen-checkout-ctp__card-list-single-card"},u(fe,{src:r,height:24,className:"adyen-checkout-ctp__card-image"}),u("span",{className:I({"adyen-checkout-ctp__card-list-single-card-expired":e.isExpired})},e.title," ",`•••• ${e.panLastFour}`),e.isExpired&&u("span",{className:"adyen-checkout-ctp__expired-label"},n.get("ctp.cards.expiredCard"))),t&&u("div",{className:"adyen-checkout-contextual-text--error"},t))},bc=(e,t)=>t?.value&&t?.currency?e.amount(t.value,t.currency,{currencyDisplay:t.currencyDisplay||"symbol"}):"",vc=e=>{const t=e.get("payAmountFormat"),n=t.indexOf("%@");return n>=0&&t.substring(n+2).trim().length>0},Cc=(e,t,n)=>{const o=bc(e,t);if(!o)return e.get("payButton");if(n&&vc(e)){const r=_c(e,n);return e.get("payAmountFormat").replace("%@",`${o}${r}`)}return e.get("payAmountFormat").replace("%@",o)},_c=(e,t)=>{const n=t&&t?.value&&t?.currency?e.amount(t.value,t.currency,{currencyDisplay:t.currencyDisplay||"symbol"}):"";return`${n.length?"/ ":""}${n}`};function u1(e,t,n,o,r,i){return t||(r?Cc(e,r):o?e.get("confirmPreauthorization"):Cc(e,n,i))}function h1(e,t,n,o,r){return o||r||!n||!t||vc(e)?null:_c(e,t)}const p1=({label:e})=>u("span",{className:"checkout-secondary-button__text"},e),m1={IDR:1,JPY:1,KRW:1,VND:1,BYR:1,CVE:1,DJF:1,GHC:1,GNF:1,KMF:1,PYG:1,RWF:1,UGX:1,VUV:1,XAF:1,XOF:1,XPF:1,MRO:10,BHD:1e3,IQD:1e3,JOD:1e3,KWD:1e3,OMR:1e3,LYD:1e3,TND:1e3},wc={RSD:{minimumFractionDigits:2},AFN:{minimumFractionDigits:2},ALL:{minimumFractionDigits:2},IRR:{minimumFractionDigits:2},LAK:{minimumFractionDigits:2},LBP:{minimumFractionDigits:2},MMK:{minimumFractionDigits:2},SOS:{minimumFractionDigits:2},SYP:{minimumFractionDigits:2},YER:{minimumFractionDigits:2},IQD:{minimumFractionDigits:3}},f1=e=>m1[e]||100,ua=(e,t)=>{const n=f1(t);return parseInt(String(e),10)/n},y1=(e,t,n,o={})=>{const r=e.toString(),i=ua(r,n),a=t.replace("_","-"),s={style:"currency",currency:n,currencyDisplay:"symbol",...wc[n]?{...o,...wc[n]}:o};try{return i.toLocaleString(a,s)}catch{return r}},ha=e=>{if(!e||typeof e!="object")return!1;const t=typeof e.value=="number"&&!Number.isNaN(e.value),n=typeof e.currency=="string"&&e.currency.length>0,o=e.currencyDisplay===void 0||typeof e.currencyDisplay=="string";return t&&n&&o},pa=({customAmount:e,classNameModifiers:t=[],label:n,...o})=>{const{amount:r,isZeroAuth:i}=ro(),{secondaryAmount:a}=x0(),{i18n:s}=O(),l=u1(s,n,r,i,e,a),c=h1(s,a,ha(r),i,n),d=o.disabled||o.status==="loading";return u(Ge,{...o,disabled:d,classNameModifiers:[...t,"pay"],label:l},c&&u(p1,{label:c}))},Sc=()=>window.matchMedia("(max-width: 768px)").matches&&/Android|iPhone|iPod/.test(navigator.userAgent),g1=["srcDigitalCardId"],b1=({cardSelected:e,cards:t,errorMessage:n,onChangeCard:o})=>{const{i18n:r}=O(),i=Pe(),{status:a}=rt(),{handleChangeFor:s,data:l}=to({schema:g1,defaultData:{srcDigitalCardId:e.srcDigitalCardId}}),c=te(()=>t.map(d=>({icon:d.artUri||i()(d.scheme),name:`${Sc()?"":d.title} •••• ${d.panLastFour} `,secondaryText:d.isExpired&&r.get("ctp.cards.expiredCard"),id:d.srcDigitalCardId,disabled:d.isExpired})),[t]);return R(()=>{const{srcDigitalCardId:d}=l,p=t.find(h=>h.srcDigitalCardId===d);o(p)},[l,o]),u(me,{name:"clickToPayCards",className:"adyen-checkout-ctp__cards-list-field",errorMessage:n,readOnly:a==="loading",label:r.get("ctp.cards.subtitle")},u(tn,{items:c,selectedValue:l.srcDigitalCardId,name:"clickToPayCards",filterable:!1,className:"adyen-checkout-ctp__cards-list-dropdown",readonly:a==="loading",onChange:s("srcDigitalCardId")}))};function kc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let lo=class extends Ae{iframeOnLoad(){this.props.callback&&typeof this.props.callback=="function"&&this.props.callback(this.iframeEl.contentWindow)}componentDidMount(){this.iframeEl.addEventListener?this.iframeEl.addEventListener("load",this.iframeOnLoad.bind(this),!1):this.iframeEl.attachEvent?this.iframeEl.attachEvent("onload",this.iframeOnLoad.bind(this)):this.iframeEl.onload=this.iframeOnLoad.bind(this)}componentWillUnmount(){this.iframeEl.removeEventListener?this.iframeEl.removeEventListener("load",this.iframeOnLoad.bind(this),!1):this.iframeEl.detachEvent?this.iframeEl.detachEvent("onload",this.iframeOnLoad.bind(this)):this.iframeEl.onload=null}render({name:t,src:n,width:o,height:r,minWidth:i,minHeight:a,allow:s,title:l,sandbox:c,classNameModifiers:d}){const p=d.filter(h=>!!h);return u("iframe",{ref:h=>{this.iframeEl=h},allow:s,className:I("adyen-checkout__iframe",`adyen-checkout__iframe--${t}`,p.length&&d.map(h=>`adyen-checkout__iframe--${t}-${h}`)),name:t,src:n,width:o,height:r,frameBorder:"0",title:l,referrerpolicy:"origin","min-width":i,"min-height":a,sandbox:c})}constructor(...t){super(...t),kc(this,"iframeEl",void 0)}};kc(lo,"defaultProps",{width:"0",height:"0",minWidth:"0",minHeight:"0",src:null,allow:null,title:"components iframe",classNameModifiers:[]});function Ec(e,t){if(!e)return null;const n=t.get(`ctp.errors.${e}`);return n.includes("ctp.errors")?t.get("ctp.errors.UNKNOWN_ERROR"):n}function v1(e,t,n){return n?Sc()?null:e.get("payButton.with",{values:{value:bc(e,t),maskedData:`•••• ${n?.panLastFour}`}}):e.get("payButton")}const C1=({onDisplayCardComponent:e})=>{const{i18n:t}=O(),n=Pe(),{cards:o,checkout:r,isCtpPrimaryPaymentMethod:i,status:a,onSubmit:s,onSetStatus:l,onError:c}=rt(),[d,p]=w(o.find(A=>!A.isExpired)||o[0]),[h,m]=w(null),f=o.every(A=>A.isExpired),[y,b]=w(!1),{amount:v}=ro();R(()=>{(o.length===0||f)&&e?.()},[e,f,o]);const C=T(async()=>{if(d)try{b(!0),m(null),l("loading");const A=await r(d);s(A)}catch(A){A instanceof Ce&&(m(A?.reason),console.warn(`CtP - Checkout: Reason: ${A?.reason} / Source: ${A?.source} / Scheme: ${A?.scheme}`)),b(!1),c(A instanceof F?A:new F("ERROR","Error during ClickToPay checkout",{cause:A}))}},[r,d]),_=T(A=>{p(A)},[]),S=y&&a==="loading"&&d?.isDcfPopupEmbedded,E=a!=="loading"||!S,k=T(A=>{A.key==="Enter"&&C()},[C]);return u(G,null,u(lo,{name:dc,height:"380",width:"100%",classNameModifiers:[S?"":"hidden"]}),E&&u(G,null,u(Ot.Title,null,t.get("ctp.cards.title")),o.length===0&&u("div",{className:"adyen-checkout-ctp__empty-cards"},t.get("ctp.emptyProfile.message")),o.length===1&&u(d1,{card:o[0],errorMessage:Ec(h,t)}),o.length>1&&u(b1,{cardSelected:d,cards:o,onChangeCard:_,errorMessage:Ec(h,t)}),u(pa,{disabled:f,label:v1(t,v,d),status:a,variant:i?"primary":"secondary",icon:o.length!==0&&n({imageFolder:"components/"})(i?`${en}lock`:`${en}lock_black`),onClick:C,onKeyDown:k})))},_1=()=>{const{i18n:e}=O();return u(G,null,u("div",{className:"adyen-checkout-ctp__card-animation"},u("div",{className:"adyen-checkout-ctp__card-animation-layer"}),u("div",{className:"adyen-checkout-ctp__card-animation-layer"}),u("div",{className:"adyen-checkout-ctp__card-animation-layer"})),u("div",{className:"adyen-checkout-ctp__loading-subtitle"},e.get("ctp.loading.intro")))},w1={shopperLogin:{validate:e=>!!e&&e.length>0,errorMessage:"ctp.errors.INVALID_EMAIL",modes:["blur"]},default:{validate:e=>!!e&&e.length>0,errorMessage:"",modes:["blur"]}};function S1(e){return u(dr,{...e,type:"email",autoCapitalize:"off"})}const k1=e=>{const{i18n:t}=O(),n=W(null),{handleChangeFor:o,data:r,triggerValidation:i,valid:a,errors:s,isValid:l}=pc({schema:["shopperLogin"],rules:w1,formHolder:n}),c=W({validateInput:null,focusInput:null}),[d,p]=w(!1),h=T(()=>{p(!0),i()},[i]);R(()=>{n.current&&e.errorMessage&&da(n.current,"shopperLogin")},[e.errorMessage]),R(()=>{r.shopperLogin&&p(!0)},[r.shopperLogin]),R(()=>{c.current.validateInput=h,e.onSetInputHandlers(c.current)},[h,e.onSetInputHandlers]);const m=T(f=>{f.key==="Enter"&&e.onPressEnter()},[e.onPressEnter]);return R(()=>{e.onChange({data:r,valid:a,errors:s,isValid:l})},[r,a,s]),u("div",{ref:n},u(me,{name:"shopperLogin",label:t.get("ctp.login.inputLabel"),errorMessage:d?e.errorMessage||s.shopperLogin&&t.get(s.shopperLogin.errorMessage):null,classNameModifiers:["shopperLogin"],errorLive:!0},u(S1,{name:"shopperLogin",autocorrect:"off",spellcheck:!1,value:r.shopperLogin,disabled:e.disabled,onInput:o("shopperLogin","input"),onBlur:o("shopperLogin","blur"),onKeyDown:m,autocomplete:"email"})))},E1=()=>{const{i18n:e}=O(),{isCtpPrimaryPaymentMethod:t,setIsCtpPrimaryPaymentMethod:n,verifyIfShopperIsEnrolled:o,startIdentityValidation:r}=rt(),[i,a]=w(null),[s,l]=w(!1),[c,d]=w(null),[p,h]=w(!1),[m,f]=w(null),y=T(_=>{f(_)},[]),b=T(({data:_,isValid:S})=>{a(_.shopperLogin),l(S),_?.shopperLogin?.length>0&&n(!0)},[]),v=T(async()=>{if(d(null),s){h(!0);try{const{isEnrolled:_}=await o({shopperEmail:i});_?await r():(d("NOT_FOUND"),h(!1))}catch(_){_ instanceof Ce&&console.warn(`CtP - Login error: ${_.toString()}`),_ instanceof kn&&console.warn(_.toString()),la(_)?d(_.reason==="INVALID_PARAMETER"?"INVALID_EMAIL":_.reason):console.error(_),h(!1)}}else m.validateInput()},[o,r,i,s,m]),C=T(_=>{_.key==="Enter"&&v()},[v]);return u(G,null,u(Ot.Title,{endAdornment:u(gc,null)},e.get("ctp.login.title")),u(Ot.Text,null,e.get("ctp.login.subtitle")),u(k1,{onChange:b,onSetInputHandlers:y,disabled:p,errorMessage:c&&e.get(`ctp.errors.${c}`),onPressEnter:v}),u(Ge,{label:e.get("continue"),variant:t?"primary":"secondary",status:p&&"loading",onClick:()=>{v()},onKeyDown:C}))},xc=({onDisplayCardComponent:e})=>{const{ctpState:t,onReady:n,startIdentityValidation:o,logoutShopper:r}=rt();R(()=>{[ce.OneTimePassword,ce.Login,ce.Ready].includes(t)&&n()},[t,n]),R(()=>{t===ce.ShopperIdentified&&(async function(){try{await o()}catch(a){a instanceof Ce&&console.warn(`CtP - Identity Validation error: ${a.toString()}`),await r()}})()},[t]);const i=T(a=>{a.key==="Enter"&&(a.preventDefault(),a.stopPropagation())},[]);return t===ce.NotAvailable?null:u(Ot,{onEnterKeyPress:i},[ce.Loading,ce.ShopperIdentified].includes(t)&&u(_1,null),t===ce.OneTimePassword&&u(c1,{onDisplayCardComponent:e}),t===ce.Ready&&u(C1,{onDisplayCardComponent:e}),t===ce.Login&&u(E1,null))};function x1({label:e="qrCodeOrApp",classNames:t=[]}){const{i18n:n}=O();return u("div",{className:I("adyen-checkout__content-separator",...t)},n.get(e))}const P1=({children:e})=>{const{i18n:t}=O(),[n,o]=w(null),{ctpState:r,isCtpPrimaryPaymentMethod:i,setIsCtpPrimaryPaymentMethod:a,status:s}=rt(),l=n===null&&i===null;R(()=>{if(l){if(r===ce.ShopperIdentified||r===ce.Ready)return o(!1),void a(!0);r===ce.NotAvailable&&(o(!0),a(!1))}},[r,l]);const c=T(()=>{o(!0),a(!1)},[]),d=T(p=>{p.key==="Enter"&&c()},[c]);return r===ce.NotAvailable?e():r===ce.Loading||r===ce.ShopperIdentified?u(xc,null):u(G,null,u(xc,{onDisplayCardComponent:c}),u(x1,{classNames:["adyen-checkout-ctp__separator"],label:t.get("ctp.separatorText")}),n?e(!i):u(Ge,{variant:"secondary",disabled:s==="loading",label:t.get("ctp.manualCardEntry"),onClick:c,onKeyDown:d}))},T1=({configuration:e,clickToPayService:t,setClickToPayRef:n,onSetStatus:o,onSubmit:r,onError:i,isStandaloneComponent:a,...s})=>u(Xm,{isStandaloneComponent:a,configuration:e,clickToPayService:t,setClickToPayRef:n,onSetStatus:o,onSubmit:r,onError:i},u(P1,null,s.children)),D1="not base64",N1="malformed URI sequence",En={decode:e=>{if(!En.isBase64(e))return{success:!1,error:D1};try{return{success:!0,data:(t=e,decodeURIComponent(Array.prototype.map.call(window.atob(t),n=>`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")))}}catch{return{success:!1,error:N1}}var t},encode:e=>window.btoa(e),isBase64:e=>{if(!e||e.length%4)return!1;try{return window.btoa(window.atob(e))===e}catch{return!1}}};function A1(e,t,n){const o={schemaVersion:1,createdAt:Date.now(),channel:oa.WEB,platform:ra,sdkVersion:na,paymentMethodBehavior:n,analytics:{checkoutAttemptId:e},...t&&{riskData:{clientData:t}}};return En.encode(JSON.stringify(o))}const I1={[g.address]:"Address",[g.donation]:"Donation",[g.personal_details]:"PersonalDetails",[g.bankTransfer_IBAN]:"BankTransfer",[g.bankTransfer_BE]:"BankTransfer",[g.bankTransfer_NL]:"BankTransfer",[g.bankTransfer_PL]:"BankTransfer",[g.bankTransfer_FR]:"BankTransfer",[g.bankTransfer_CH]:"BankTransfer",[g.bankTransfer_IE]:"BankTransfer",[g.bankTransfer_GB]:"BankTransfer",[g.bankTransfer_DE]:"BankTransfer",[g.bcmc]:"Bancontact",[g.card]:"Card",[g.scheme]:"Card",[g.storedCard]:"Card",[g.customCard]:"CustomCard",[g.ach]:"Ach",[g.directdebit_GB]:"BacsDirectDebit",[g.sepadirectdebit]:"SepaDirectDebit",[g.eft_directdebit_CA]:"PreAuthorizedDebitCanada",[g.affirm]:"Affirm",[g.afterpay]:"AfterPay",[g.afterpay_default]:"AfterPay",[g.afterpay_b2b]:"AfterPayB2B",[g.atome]:"Atome",[g.facilypay_3x]:"FacilyPay3x",[g.facilypay_4x]:"FacilyPay4x",[g.facilypay_6x]:"FacilyPay6x",[g.facilypay_10x]:"FacilyPay10x",[g.facilypay_12x]:"FacilyPay12x",[g.ratepay]:"RatePay",[g.ratepay_directdebit]:"RatePayDirectDebit",[g.amazonpay]:"AmazonPay",[g.applepay]:"ApplePay",[g.cashapp]:"CashAppPay",[g.clicktopay]:"ClickToPay",[g.googlepay]:"GooglePay",[g.paypal]:"PayPal",[g.fastlane]:"Fastlane",[g.paywithgoogle]:"GooglePay",[g.boletobancario]:"Boleto",[g.boletobancario_itau]:"Boleto",[g.boletobancario_santander]:"Boleto",[g.doku]:"Doku",[g.doku_alfamart]:"Doku",[g.doku_permata_lite_atm]:"Doku",[g.doku_indomaret]:"Doku",[g.doku_atm_mandiri_va]:"Doku",[g.doku_sinarmas_va]:"Doku",[g.doku_mandiri_va]:"Doku",[g.doku_cimb_va]:"Doku",[g.doku_danamon_va]:"Doku",[g.doku_bri_va]:"Doku",[g.doku_bni_va]:"Doku",[g.doku_bca_va]:"Doku",[g.doku_wallet]:"Doku",[g.oxxo]:"Oxxo",[g.primeiropay_boleto]:"Boleto",[g.billdesk_online]:"BillDeskOnline",[g.billdesk_wallet]:"BillDeskWallet",[g.dotpay]:"Dotpay",[g.eps]:"Eps",[g.iris]:"Iris",[g.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[g.molpay_ebanking_TH]:"MolPayEBankingTH",[g.molpay_ebanking_VN]:"MolPayEBankingVN",[g.onlineBanking_CZ]:"OnlineBankingCZ",[g.onlinebanking_IN]:"OnlineBankingIN",[g.onlineBanking_PL]:"OnlineBankingPL",[g.onlineBanking_SK]:"OnlineBankingSK",[g.paybybank]:"PayByBank",[g.payu_IN_cashcard]:"PayuCashcard",[g.payu_IN_nb]:"PayuNetBanking",[g.wallet_IN]:"WalletINElement",[g.dragonpay_ebanking]:"Dragonpay",[g.dragonpay_otc_banking]:"Dragonpay",[g.dragonpay_otc_non_banking]:"Dragonpay",[g.dragonpay_otc_philippines]:"Dragonpay",[g.econtext_atm]:"Econtext",[g.econtext_online]:"Econtext",[g.econtext_seven_eleven]:"Econtext",[g.econtext_stores]:"Econtext",[g.giropay]:"Giropay",[g.multibanco]:"Multibanco",[g.redirect]:"Redirect",[g.twint]:"Twint",[g.vipps]:"Vipps",[g.trustly]:"Trustly",[g.paybybank_AIS_DD]:"PayByBankUS",[g.riverty]:"Riverty",[g.paybybank_pix]:"PayByBankPix",[g.klarna]:"Klarna",[g.klarna_account]:"Klarna",[g.klarna_paynow]:"Klarna",[g.klarna_b2b]:"Klarna",[g.bcmc_mobile]:"BcmcMobile",[g.bcmc_mobile_QR]:"BcmcMobile",[g.pix]:"Pix",[g.swish]:"Swish",[g.wechatpay]:"WeChat",[g.wechatpayQR]:"WeChat",[g.promptpay]:"PromptPay",[g.paynow]:"PayNow",[g.duitnow]:"DuitNow",[g.blik]:"Blik",[g.mbway]:"MBWay",[g.ancv]:"ANCV",[g.payto]:"PayTo",[g.upi]:"UPI",[g.upi_qr]:"UPI",[g.upi_intent]:"UPI",[g.giftcard]:"Giftcard",[g.mealVoucher_FR_natixis]:"MealVoucherFR",[g.mealVoucher_FR_sodexo]:"MealVoucherFR",[g.mealVoucher_FR_groupeup]:"MealVoucherFR"};function R1(e){return I1[e]}function nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let vr=class{buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}submitAnalytics(t){return null}handleKeyDown(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=this.state.order||this.props.order,n=this.formatData(),o=!!R1(n.paymentMethod?.type),r=this.core.modules.risk.data,i=this.core.modules.analytics.checkoutAttemptId??km,a=o?ql.NATIVE:ql.GENERIC,s=A1(i,r,a);return n.paymentMethod&&i&&(n.paymentMethod.checkoutAttemptId=i),n.paymentMethod&&s&&(n.paymentMethod.sdkData=s),{...r&&{riskData:{clientData:r}},...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},...n,clientStateDataIndicator:!0}}activate(){}render(){throw new Error("Payment method cannot be rendered.")}mount(t){const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error("Component could not mount. Root node was not found.");return this._node&&this.unmount(),this._node=n,Zn(this._node,"keydown",this.handleKeyDown,!1),this._component=this.render(),Hs(this._component,n),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return Qn(this._node,"keydown",this.handleKeyDown),this._node&&Hs(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}constructor(t,n){if(nn(this,"_id",`${this.constructor.type}-${Be()}`),nn(this,"core",void 0),nn(this,"props",void 0),nn(this,"state",{}),nn(this,"_component",void 0),nn(this,"_node",null),!(function(r){return!!r&&typeof r.initialize=="function"&&typeof r.createFromAction=="function"})(t))throw new F("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(n),this.handleKeyDown=this.handleKeyDown.bind(this)}};nn(vr,"defaultProps",{});const $1=["action","resultCode","sessionData","order","sessionResult","donationToken","error","askDonation"];function co(e){const t=[],n=Object.keys(e).reduce((o,r)=>($1.includes(r)?o[r]=e[r]:t.push(r),o),{});return t.length&&console.warn(`The following properties should not be passed to the client: ${t.join(", ")}`),n}function Cr(e){e&&(delete e.order,delete e.action,e.donationToken&&e.donationToken.length!==0||delete e.donationToken)}function uo(e){return["Cancelled","Error","Refused"].includes(e.resultCode)?Promise.reject(e):Promise.resolve(e)}function _r(e){return e?typeof e.activePaymentMethod=="object"&&typeof e.closeActivePaymentMethod=="function":!1}function F1(e,t){return e==="FI"&&t?{openFirstPaymentMethod:!1,openFirstStoredPaymentMethod:!1}:{}}function wr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var it=(function(e){return e.action="action",e.submit="submit",e.redirect="redirect",e.threeDS2="threeDS2",e.closed="closed",e.apiRequest="apiRequest",e})({}),St=(function(e){return e.challengeIframeLoaded="challengeIframeLoaded",e.challengeDataSentWeb="challengeDataSentWeb",e.challengeCompleted="challengeCompleted",e.fingerprintDataSentWeb="fingerprintDataSentWeb",e.fingerprintCompleted="fingerprintCompleted",e.fingerprintIframeLoaded="fingerprintIframeLoaded",e.threeDS2="threeDS2",e.redirect="redirect",e.voucher="voucher",e.await="awat",e.qrCode="qrCode",e.bankTransfer="bankTransfer",e.sdk="sdk",e.donation="donation",e.donationCampaigns="donationCampaigns",e})({});let Ze=class extends Pi{getEventCategory(){return Yt.log}static getSubtypeFromActionType(t){return St[t]}constructor(t){super(t.component),wr(this,"type",void 0),wr(this,"subType",void 0),wr(this,"message",void 0),wr(this,"result",void 0),this.type=t.type,this.message=t.message,t.subType&&(this.subType=t.subType),t.result&&(this.result=t.result)}},Sr=class extends Error{constructor(t){super(t)}};const M1=({srPanel:e,children:t})=>{const{i18n:n}=O(),o=e.moveFocus;return u(Dl.Provider,{value:{srPanel:e,setSRMessagesFromObjects:({fieldTypeMappingFn:r})=>wt(Zh,{SRPanelRef:e,i18n:n,fieldTypeMappingFn:r}),setSRMessagesFromStrings:r=>{e.setMessages(r)},clearSRPanel:()=>{e.setMessages(null)},shouldMoveFocusSR:o}},t)};function at(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Dt extends vr{createBeforeRenderHook(t){const n=this.render;this.render=(...o)=>(this.beforeRender(t),n.apply(this,o))}beforeRender(t){if(t?.originalAction)return;const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.oneClick&&{isStoredPaymentMethod:!0}});this.analytics.sendAnalytics(n)}reportIntegrationFlavor(){this.analytics.sendFlavor("components")}get analytics(){return this.core.modules.analytics}get srPanel(){return this.core.modules.srPanel}getPaymentMethodConfigFromResponse(t){return t?.storedPaymentMethodId?this.getStoredPaymentMethodDetails(t.storedPaymentMethodId):this.getPaymentMethodFromPaymentMethodsResponse(t?.type,t?.paymentMethodId)}buildElementProps(t){const n={showPayButton:!0,...this.core.getCorePropsForComponent(),...this.getPaymentMethodConfigFromResponse(t),...t},o=_r(this);this.props=this.formatProps({...this.constructor.defaultProps,...F1(this.core.options.countryCode,o),...n})}getStoredPaymentMethodDetails(t){return this.core.paymentMethodsResponse.findStoredPaymentMethod(t)}getPaymentMethodFromPaymentMethodsResponse(t,n){return n?this.core.paymentMethodsResponse.findById(n):this.core.paymentMethodsResponse?.find(t||this.constructor.type)}storeElementRefOnCore(t){t?.isDropin||this.core.storeElementReference(this)}isAvailable(){return Promise.resolve()}setState(t){this.state={...this.state,...t},this.onChange()}showValidation(){return this.componentRef&&this.componentRef.showValidation&&this.componentRef.showValidation(),this}updateAmount(t,n){this.props={...this.props,...t&&{amount:t},...n&&{secondaryAmount:n}},this.amountProviderRef.current?.update(t,n)}setElementStatus(t,n){return this.elementRef?.setStatus(t,n),this}setStatus(t,n){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,n),this}onChange(){this.props.onChange?.({data:this.data,isValid:this.isValid,errors:this.state.errors,valid:this.state.valid},this.elementRef)}submitAnalytics(t){this.analytics.sendAnalytics(t)}submit(){this.isValid?this.makePaymentsCall().then(co).then(uo).then(this.handleResponse).catch(t=>{t instanceof Sr?this.setElementStatus("ready"):this.handleFailedResult(t)}):this.showValidation()}makePaymentsCall(){if(this.setElementStatus("loading"),this.props.onSubmit)return this.submitUsingAdvancedFlow();if(this.core.session)return(this.props.beforeSubmit?new Promise((t,n)=>{this.props.beforeSubmit(this.data,this.elementRef,{resolve:t,reject:()=>n(new Sr("beforeSubmitRejected"))})}):Promise.resolve(this.data)).then(this.submitUsingSessionsFlow);this.handleError(new F("IMPLEMENTATION_ERROR",'It can not perform /payments call. Callback "onSubmit" is missing or Checkout session is not available'))}async submitUsingAdvancedFlow(){const t=new Ze({component:this.type,type:it.submit,message:"Shopper clicked pay"});return this.submitAnalytics(t),new Promise((n,o)=>{this.props.onSubmit({data:this.data,isValid:this.isValid},this.elementRef,{resolve:n,reject:o})})}async submitUsingSessionsFlow(t){const n=new Ze({component:this.type,type:it.submit,message:"Shopper clicked pay"});this.submitAnalytics(n);try{return await this.core.session.submitPayment(t)}catch(o){return o instanceof F?this.handleError(o):this.handleError(new F("ERROR","Error when making /payments call",{cause:o})),Promise.reject(o)}}onComplete(t){this.handleAdditionalDetails(t)}handleAdditionalDetails(t){this.makeAdditionalDetailsCall(t).then(co).then(uo).then(this.handleResponse).catch(this.handleFailedResult)}makeAdditionalDetailsCall(t){return this.props.onAdditionalDetails?new Promise((n,o)=>{this.props.onAdditionalDetails(t,this.elementRef,{resolve:n,reject:o})}):this.core.session?this.submitAdditionalDetailsUsingSessionsFlow(t.data):void this.handleError(new F("IMPLEMENTATION_ERROR",'It can not perform /payments/details call. Callback "onAdditionalDetails" is missing or Checkout session is not available'))}async submitAdditionalDetailsUsingSessionsFlow(t){try{return await this.core.session.submitDetails(t)}catch(n){return n instanceof F?this.handleError(n):this.handleError(new F("ERROR","Error when making /details call",{cause:n})),Promise.reject(n)}}handleAction(t,n={}){if(!t||!t.type)throw Y(t,"action")&&Y(t,"resultCode")?new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?'):new Error('handleAction::Invalid Action - the passed action object does not have a "type" property');const o=this.core.createFromAction(t,{...this.elementRef.props,...n});return o?(this.unmount(),o.mount(this._node)):null}onActionHandled(t){this.props?.onActionHandled?.({originalAction:this.props.originalAction,...t})}setupSessionsDonation(){const{amount:t,donation:n}=this.props;if(n?.autoMount!==!1){const o=_r(this.elementRef)?this.elementRef._node:this._node;new(this.core.getComponent(g.donation))(this.core,{rootNode:o,commercialTxAmount:t.value})}}handleResponse(t){t.action?this.elementRef.handleAction(t.action):t.order?.remainingAmount?.value>0?this.handleOrder(t):this.handleSuccessResult(t)}handleKeyDown(t){t.key!=="Enter"&&t.code!=="Enter"||(t.preventDefault(),this.onEnterKeyPressed(document?.activeElement,this))}onEnterKeyPressed(t,n){this.props.onEnterKeyPressed?this.props.onEnterKeyPressed(t,n):(t.blur(),this.submit())}updateParent(t={}){return this.elementRef.core.update(t)}get isValid(){return!1}get icon(){const t=this.props.paymentMethodType||this.type;return this.props.icon??this.resources.getImage()(t)}get displayName(){const t=this.core.paymentMethodsResponse?.paymentMethods?.find(n=>n.type===this.type);return this.props.name||t?.name||this.type}get accessibleName(){return this.displayName}get additionalInfo(){return null}get type(){return this.props.type||this.constructor.type}async handleAdvanceFlowPaymentMethodsUpdate(t,n){return new Promise((o,r)=>{if(!this.props.onPaymentMethodsRequest)return o();this.props.onPaymentMethodsRequest({...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},locale:this.core.options.locale},{resolve:o,reject:r})}).catch(o=>{this.handleError(new F("IMPLEMENTATION_ERROR","Something failed during payment methods update or onPaymentMethodsRequest was not implemented",{cause:o}))}).then(o=>this.core.update({...o&&{paymentMethodsResponse:o},order:t,amount:t?t.remainingAmount:n}))}render(){return u(Bp,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources,analytics:this.analytics},u(M1,{srPanel:this.srPanel},u(P0,{amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,providerRef:this.amountProviderRef},this.componentToRender())))}constructor(t,n){super(t,n),at(this,"componentRef",void 0),at(this,"resources",void 0),at(this,"elementRef",void 0),at(this,"amountProviderRef",ih()),at(this,"handleError",o=>{if(this.setElementStatus("ready"),o.name===fl&&o.options.code){const r=new Re({component:this.type,errorType:Ie.apiError,code:o.options.code});this.submitAnalytics(r)}this.props.onError&&this.props.onError(o,this.elementRef)}),at(this,"handleOrder",o=>{const{order:r}=o;(this.core.session?this.core.update({order:r}):this.handleAdvanceFlowPaymentMethodsUpdate(r)).then(()=>{this.props.onOrderUpdated?.({order:r})})}),at(this,"handleFailedResult",o=>{_r(this.elementRef)&&this.elementRef.displayFinalAnimation("error"),Cr(o),this.props.onPaymentFailed?.(o,this.elementRef)}),at(this,"handleSuccessResult",o=>{_r(this.elementRef)&&this.elementRef.displayFinalAnimation("success"),Cr(o),this.core.session&&o.askDonation===!0&&this.setupSessionsDonation(),this.props.onPaymentCompleted?.(o,this.elementRef)}),at(this,"setComponentRef",o=>{this.componentRef=o}),at(this,"payButton",o=>u(pa,{...o,onClick:this.submit})),this.core.register(this.constructor),this.submit=this.submit.bind(this),this.setState=this.setState.bind(this),this.onComplete=this.onComplete.bind(this),this.handleAction=this.handleAction.bind(this),this.handleOrder=this.handleOrder.bind(this),this.handleAdditionalDetails=this.handleAdditionalDetails.bind(this),this.handleResponse=this.handleResponse.bind(this),this.setElementStatus=this.setElementStatus.bind(this),this.submitAnalytics=this.submitAnalytics.bind(this),this.makePaymentsCall=this.makePaymentsCall.bind(this),this.makeAdditionalDetailsCall=this.makeAdditionalDetailsCall.bind(this),this.submitUsingSessionsFlow=this.submitUsingSessionsFlow.bind(this),this.updateAmount=this.updateAmount.bind(this),this.setupSessionsDonation=this.setupSessionsDonation.bind(this),this.elementRef=n&&n.elementRef||this,this.resources=this.props.modules?this.props.modules.resources:void 0,this.storeElementRefOnCore(this.props),this.onEnterKeyPressed=this.onEnterKeyPressed.bind(this),this.onActionHandled=this.onActionHandled.bind(this),this.createBeforeRenderHook(n),this.reportIntegrationFlavor()}}at(Dt,"type",void 0),at(Dt,"txVariants",[]);function st(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ma=class Ur extends Dt{setStatus(t,n){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,n),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t),this}getPaymentMethodConfigFromResponse(t){return t?.fundingSource?this.core.paymentMethodsResponse?.findByFundingSource(t.type,t.fundingSource):super.getPaymentMethodConfigFromResponse(t)}formatProps(t){const n=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,o=t.amount?.value!==0&&n,r=t.storedPaymentMethodId||t.id,i=r&&t?.supportedShopperInteractions?.includes("Ecommerce");if(r&&!i)throw new F(Ni,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");const a=t.installmentOptions;t.session&&Ah(a)&&console.warn(`WARNING: You have defined installments configuration on the Card component, but you are using a /sessions integration.
|
|
131
|
+
`;function yn(){const e=k("span",{class:"inline-flex items-center gap-1.5 text-xs text-zinc-500"}),t=k("span",{class:"inline-flex size-4 shrink-0 overflow-hidden"}),n=bs.match(/<svg[\s\S]*<\/svg>/i)?.[0]??bs;t.innerHTML=n;const r=t.querySelector("svg");r&&(r.setAttribute("width","16"),r.setAttribute("height","16"),r.setAttribute("aria-hidden","true"),r.classList.add("size-4","block"));const o=k("span");return o.append(document.createTextNode("Powered by "),k("strong",{class:"font-semibold text-zinc-700",text:"Finyx"})),e.append(t,o),e}function ei(e,t={}){const n=t.variant??"primary",r=k("button",{type:"button",class:Or("inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium transition",n==="primary"&&"bg-[var(--fy-color-primary)] text-white hover:opacity-90 disabled:opacity-50",n==="ghost"&&"text-blue-600 hover:underline")});return r.textContent=e,r.disabled=!!t.disabled,t.onClick&&r.addEventListener("click",t.onClick),r}function Hn(e="Loading…"){const t=k("div",{class:"flex items-center gap-2 py-4 text-sm text-zinc-500"});return t.innerHTML='<svg class="h-5 w-5 animate-spin text-zinc-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>',t.append(k("span",{text:e})),t}function Oe(e){return k("p",{class:"mt-3 text-sm text-red-600",text:e})}const Kn={newline:10,reset:27};function Ju(e){if(!Number.isSafeInteger(e))throw new Error(`integer expected: ${e}`)}function Xu(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw new Error(`Invalid version=${e}. Expected number [1..40]`)}function qt(e,t){return e.toString(2).padStart(t,"0")}function vs(e,t){const n=e%t;return n>=0?n:t+n}function vt(e,t){return new Array(e).fill(t)}function ti(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function Cs(e){let t=0,n=0;for(const i of e)t=Math.max(t,i.length),n+=i.length;const r=new Uint8Array(n);let o=0;for(let i=0;i<t;i++)for(const a of e)i<a.length&&(r[o++]=a[i]);return r}function eh(){let e,t=1/0;return{add(n,r){n>=t||(e=r,t=n)},get:()=>e,score:()=>t}}function _s(e){return{has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(Ju(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}}}function ws(e){if(e.length!==32)throw new Error("expects 32 element matrix");const t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){const r=t[n]>>>0,o=1<<n,i=o<<1;for(let a=0;a<32;a+=i)for(let s=0;s<o;s++){const l=a+s,c=l+o,d=e[l]>>>0,p=e[c]>>>0,h=(d>>>o^p)&r;e[l]=(d^h<<o)>>>0,e[c]=(p^h)>>>0}}}const jn=e=>1<<(e&31)>>>0,Wt=(e,t)=>t===0?0:t===32?4294967295:(1<<t)-1<<e>>>0;class Ae{static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){t=t.replace(/^\n+/g,"").replace(/\n+$/g,"");const n=t.split(String.fromCharCode(Kn.newline)),r=n.length;let o;const i=[];for(const a of n){const s=a.split("").map(l=>{if(l==="X")return!0;if(l===" ")return!1;if(l!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${l}`)});if(o!==void 0&&s.length!==o)throw new Error(`Bitmap.fromString different row sizes: width=${o} cur=${s.length}`);o=s.length,i.push(s)}return o===void 0&&(o=0),new Ae({height:r,width:o},i)}defined;value;tailMask;words;fullWords;height;width;constructor(t,n){const{height:r,width:o}=Ae.size(t);if(this.height=r,this.width=o,this.tailMask=Wt(0,o&31||32),this.words=Math.ceil(o/32)|0,this.fullWords=Math.floor(o/32)|0,this.value=new Uint32Array(this.words*r),this.defined=new Uint32Array(this.value.length),n){if(n.length!==r)throw new Error(`Bitmap: data height mismatch: exp=${r} got=${n.length}`);for(let i=0;i<r;i++){const a=n[i];if(!a||a.length!==o)throw new Error(`Bitmap: data width mismatch at y=${i}: exp=${o} got=${a?.length}`);for(let s=0;s<o;s++)this.set(s,i,a[s])}}}point(t){return this.get(t.x,t.y)}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:r}=this.xy(t);return{height:this.height-r,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=vs(t.x,this.width),t.y=vs(t.y,this.height),t}wordIndex(t,n){return n*this.words+(t>>>5)}bitIndex(t,n){return{word:this.wordIndex(t,n),bit:t&31}}isDefined(t,n){const r=this.wordIndex(t,n),o=jn(t);return(this.defined[r]&o)!==0}get(t,n){const r=this.wordIndex(t,n),o=jn(t);return(this.value[r]&o)!==0}maskWord(t,n,r){const{defined:o,value:i}=this;o[t]|=n,i[t]=i[t]&~n|-r&n}set(t,n,r){r!==void 0&&this.maskWord(this.wordIndex(t,n),jn(t),r)}fillRectConst(t,n,r,o,i){if(r<=0||o<=0||i===void 0)return;const{value:a,defined:s,words:l}=this,c=t>>>5,d=t+r-1>>>5,p=t&31,h=t+r-1&31;for(let m=0;m<o;m++){const f=(n+m)*l;if(c===d){const y=Wt(p,h-p+1);this.maskWord(f+c,y,i);continue}this.maskWord(f+c,Wt(p,32-p),i);for(let y=c+1;y<d;y++)s[f+y]=4294967295,a[f+y]=i?4294967295:0;this.maskWord(f+d,Wt(0,h+1),i)}}rectWords(t,n,r,o,i){for(let a=0;a<o;a++){const s=n+a;for(let l=0;l<r;){const c=t+l,{bit:d,word:p}=this.bitIndex(c,s),h=Math.min(32-d,r-l);i(p,c,l,a,h),l+=h}}}rect(t,n,r){const{x:o,y:i}=this.xy(t),{height:a,width:s}=Ae.size(n,this.size({x:o,y:i}));if(typeof r!="function")return this.fillRectConst(o,i,s,a,r),this;const{defined:l,value:c}=this;return this.rectWords(o,i,s,a,(d,p,h,m,f)=>{let y=0,b=c[d];for(let v=0;v<f;v++){const C=jn(p+v),_=r({x:h+v,y:m},(b&C)!==0);_!==void 0&&(y|=C,b=b&~C|-_&C)}l[d]|=y,c[d]=b}),this}rectRead(t,n,r){const{x:o,y:i}=this.xy(t),{height:a,width:s}=Ae.size(n,this.size({x:o,y:i})),{value:l}=this;return this.rectWords(o,i,s,a,(c,d,p,h,m)=>{const f=l[c];for(let y=0;y<m;y++){const b=jn(d+y);r({x:p+y,y:h},(f&b)!==0)}}),this}hLine(t,n,r){return this.rect(t,{width:n,height:1},r)}vLine(t,n,r){return this.rect(t,{width:1,height:n},r)}border(t=2,n){const r=this.height+2*t,o=this.width+2*t,i=new Ae({height:r,width:o});return i.rect(0,1/0,n),i.embed({x:t,y:t},this),i}embed(t,n){const{x:r,y:o}=this.xy(t),{height:i,width:a}=Ae.size(n.size(),this.size({x:r,y:o}));if(a<=0||i<=0)return this;const{value:s,defined:l}=this,{words:c,value:d}=n;for(let p=0;p<i;p++){const h=p*c;for(let m=0;m<a;){const f=r+m,{word:y,bit:b}=this.bitIndex(f,o+p),{word:v,bit:C}=n.bitIndex(m,p),_=Math.min(32-b,a-m),S=d[v],x=C&&v+1<h+c?d[v+1]:0,E=C?(S>>>C|x<<32-C)>>>0:S,N=Wt(b,_),$=(E&Wt(0,_))<<b>>>0;l[y]|=N,s[y]=s[y]&~N|$,m+=_}}return this}rectSlice(t,n=this.size()){const{x:r,y:o}=this.xy(t),{height:i,width:a}=Ae.size(n,this.size({x:r,y:o})),s=new Ae({height:i,width:a});return this.rectRead({x:r,y:o},{height:i,width:a},(l,c)=>{this.isDefined(r+l.x,o+l.y)&&s.set(l.x,l.y,c)}),s}transpose(){const{height:t,width:n,value:r,defined:o,words:i}=this,a=new Ae({height:n,width:t}),{words:s,value:l,defined:c,tailMask:d}=a,p=new Uint32Array(32),h=new Uint32Array(32);for(let m=0;m<t;m+=32)for(let f=0;f<i;f++){const y=Math.min(32,t-m);for(let b=0;b<y;b++){const v=this.wordIndex(32*f,m+b);p[b]=r[v],h[b]=o[v]}p.fill(0,y),h.fill(0,y),ws(p),ws(h);for(let b=0;b<32;b++){const v=f*32+b;if(v>=n)break;const C=a.wordIndex(m,v),_=m>>>5===s-1?d:4294967295;l[C]=p[b]&_,c[C]=h[b]&_}}return a}negate(){const t=this.defined.length;for(let n=0;n<t;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:n,width:r}=this;return new Ae({height:t*n,width:t*r}).rect({x:0,y:0},1/0,({x:i,y:a})=>this.get(i/t|0,a/t|0))}clone(){const t=new Ae(this.size());return t.defined.set(this.defined),t.value.set(this.value),t}assertDrawn(){const{height:t,width:n,defined:r,tailMask:o,fullWords:i,words:a}=this;if(!(!t||!n))for(let s=0;s<t;s++){const l=s*a;for(let c=0;c<i;c++)if(r[l+c]!==4294967295)throw new Error("Invalid color type=undefined");if(a!==i&&(r[l+i]&o)!==o)throw new Error("Invalid color type=undefined")}}countPatternInRow(t,n,...r){if(n<=0||n>=32)throw new Error("wrong patternLen");const o=(1<<n)-1,{width:i,value:a,words:s}=this;let l=0;const c=this.wordIndex(0,t);for(let d=0,p=0;d<s;d++){const h=a[c+d],m=d===s-1&&i&31||32;for(let f=0;f<m;f++)if(p=(p<<1|h>>>f&1)&o,!(d*32+f+1<n)){for(const y of r)if(p===y){l++;break}}}return l}getRuns(t,n){const{width:r,value:o,words:i}=this;if(r===0)return;let a=0,s;const l=this.wordIndex(0,t);for(let c=0;c<i;c++){const d=o[l+c],p=c===i-1&&r&31||32;for(let h=0;h<p;h++){const m=(d&1<<h)!==0;if(m===s){a++;continue}s!==void 0&&n(a,s),s=m,a=1}}s!==void 0&&n(a,s)}popcnt(){const{height:t,width:n,words:r,fullWords:o,tailMask:i}=this;if(!t||!n)return 0;let a=0;for(let s=0;s<t;s++){const l=s*r;for(let c=0;c<o;c++)a+=ti(this.value[l+c]);r!==o&&(a+=ti(this.value[l+o]&i))}return a}countBoxes2x2(t){const{width:n,words:r}=this;if(n<2||(t|0)<0||t+1>=this.height)return 0;const o=this.wordIndex(0,t)|0,i=this.wordIndex(0,t+1)|0,s=(n&31)===0?2147483647:Wt(0,n-1&31);let l=0;for(let c=0;c<r;c++){const d=this.value[o+c],p=this.value[i+c],h=~(d^p)>>>0,m=c+1<r?this.value[o+c+1]>>>0:0,f=~(d^(d>>>1|(m&1)<<31)>>>0)>>>0,y=c+1<r?this.value[i+c+1]>>>0:0,b=~(p^(p>>>1|(y&1)<<31)>>>0)>>>0;let v=(h&f&b)>>>0;c===r-1&&(v&=s),l+=ti(v)}return l}toString(){const t=String.fromCharCode(Kn.newline);let n="";for(let r=0;r<this.height;r++){let o="";for(let i=0;i<this.width;i++){const a=this.get(i,r);o+=this.isDefined(i,r)?a?"X":" ":"?"}n+=o+(r+1===this.height?"":t)}return n}toRaw(){const t=Array.from({length:this.height},()=>new Array(this.width));for(let n=0;n<this.height;n++){const r=t[n];for(let o=0;o<this.width;o++)r[o]=this.get(o,n)}return t}toASCII(){const{height:t,width:n}=this;let r="";for(let o=0;o<t;o+=2){for(let i=0;i<n;i++){const a=this.get(i,o),s=o+1>=t?!0:this.get(i,o+1);!a&&!s?r+="█":!a&&s?r+="▀":a&&!s?r+="▄":a&&s&&(r+=" ")}r+=String.fromCharCode(Kn.newline)}return r}toTerm(){const t=String.fromCharCode(Kn.reset),n=t+"[0m",r=t+"[1;47m "+n,o=t+"[40m "+n,i=String.fromCharCode(Kn.newline);let a="";for(let s=0;s<this.height;s++){for(let l=0;l<this.width;l++){const c=this.get(l,s);a+=c?o:r}a+=i}return a}toSVG(t=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,r="",o;return this.rectRead(0,1/0,(i,a)=>{if(!a)return;const{x:s,y:l}=i;if(!t){n+=`<rect x="${s}" y="${l}" width="1" height="1" />`;return}let c=`M${s} ${l}`;if(o){const p=`m${s-o.x} ${l-o.y}`;p.length<=c.length&&(c=p)}const d=s<10?`H${s}`:"h-1";r+=`${c}h1v1${d}Z`,o=i}),t&&(n+=`<path d="${r}"/>`),n+="</svg>",n}toGIF(){const t=s=>[s&255,s>>>8&255],n=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,(s,l)=>r.push(+(l===!0)));const o=126,i=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...vt(381,0),44,0,0,0,0,...n,0,7],a=Math.floor(r.length/o);for(let s=0;s<a;s++)i.push(o+1,128,...r.slice(o*s,o*(s+1)).map(l=>+l));return i.push(r.length%o+1,128,...r.slice(a*o).map(s=>+s)),i.push(1,129,0,59),new Uint8Array(i)}toImage(t=!1){const{height:n,width:r}=this.size(),o=new Uint8Array(n*r*(t?3:4));let i=0;for(let a=0;a<n;a++)for(let s=0;s<r;s++){const l=this.get(s,a)?0:255;o[i++]=l,o[i++]=l,o[i++]=l,t||(o[i++]=255)}return{height:n,width:r,data:o}}}const Ss=["low","medium","quartile","high"],ks=["numeric","alphanumeric","byte","kanji","eci"],th=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],nh={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},rh={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},xe={size:{encode:e=>21+4*(e-1),decode:e=>(e-17)/4},sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=6,n=xe.size.encode(e)-t-1,r=n-t,o=Math.ceil(r/28);let i=Math.floor(r/o);i%2?i+=1:r%o*2>=o&&(i+=2);const a=[t];for(let s=1;s<o;s++)a.push(n-(o-s)*i);return a.push(n),a},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(e,t){const n=xe.ECCode[e]<<3|t;let r=n;for(let o=0;o<10;o++)r=r<<1^(r>>9)*1335;return(n<<10|r)^xe.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^(t>>11)*7973;return e<<12|t},alphabet:{numeric:_s("0123456789"),alphanumerc:_s("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits(e,t){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[t][xe.sizeType(e)]},modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(e,t){const n=th[e-1],r=nh[t][e-1],o=rh[t][e-1],i=Math.floor(n/o)-r,a=o-n%o;return{words:r,numBlocks:o,shortBlocks:a,blockLen:i,capacity:(n-r*o)*8,total:(r+i)*o+o-a}}},ni=[(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0],P={tables:(e=>{const t=vt(256,0),n=vt(256,0);for(let r=0,o=1;r<256;r++)t[r]=o,n[o]=r,o<<=1,o&256&&(o^=e);return{exp:t,log:n}})(285),exp:e=>P.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: invalid arg=${e}`);return P.tables.log[e]%255},mul(e,t){return e===0||t===0?0:P.tables.exp[(P.tables.log[e]+P.tables.log[t])%255]},add:(e,t)=>e^t,pow:(e,t)=>P.tables.exp[P.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: invalid arg=${e}`);return P.tables.exp[255-P.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: invalid length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: invalid degree=${e}`);if(t==0)return[0];let n=vt(e+1,0);return n[0]=t,P.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[P.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=vt(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let o=0;o<t.length;o++)n[r+o]=P.add(n[r+o],P.mul(e[r],t[o]));return P.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=vt(e.length,0);for(let r=0;r<e.length;r++)n[r]=P.mul(e[r],t);return P.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(n==0)return[0];const r=vt(e.length+t,0);for(let o=0;o<e.length;o++)r[o]=P.mul(e[o],n);return P.polynomial(r)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let o=vt(r.length,0),i=r.length-n.length,a=r.slice(0,i);for(let s=0;s<a.length;s++)o[s]=a[s];for(let s=i;s<r.length;s++)o[s]=P.add(n[s-i],r[s]);return P.polynomial(o)},remainderPoly(e,t){const n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){const o=n[r];if(o!==0)for(let i=1;i<t.length;i++)t[i]!==0&&(n[r+i]=P.add(n[r+i],P.mul(t[i],o)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=P.mulPoly(t,[1,P.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return P.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=P.add(P.mul(t,n),e[r]);return n},euclidian(e,t,n){P.degree(e)<P.degree(t)&&([e,t]=[t,e]);let r=e,o=t,i=[0],a=[1];for(;2*P.degree(o)>=n;){let c=r,d=i;if(r=o,i=a,r[0]===0)throw new Error("rLast[0] === 0");o=c;let p=[0];const h=P.inv(r[0]);for(;P.degree(o)>=P.degree(r)&&o[0]!==0;){const m=P.degree(o)-P.degree(r),f=P.mul(o[0],h);p=P.addPoly(p,P.monomial(m,f)),o=P.addPoly(o,P.mulPolyMonomial(r,m,f))}if(p=P.mulPoly(p,i),a=P.addPoly(p,d),P.degree(o)>=P.degree(r))throw new Error(`Division failed r: ${o}, rLast: ${r}`)}const s=P.coefficient(a,0);if(s==0)throw new Error("sigmaTilde(0) was zero");const l=P.inv(s);return[P.mulPolyScalar(a,l),P.mulPolyScalar(o,l)]}};function oh(e){return{encode(t){const n=P.divisorPoly(e),r=Array.from(t);return r.push(...n.slice(0,-1).fill(0)),Uint8Array.from(P.remainderPoly(r,n))},decode(t){const n=t.slice(),r=P.polynomial(Array.from(t));let o=vt(e,0),i=!1;for(let p=0;p<e;p++){const h=P.evalPoly(r,P.exp(p));o[o.length-1-p]=h,h!==0&&(i=!0)}if(!i)return n;o=P.polynomial(o);const a=P.monomial(e,1),[s,l]=P.euclidian(a,o,e),c=vt(P.degree(s),0);let d=0;for(let p=1;p<256&&d<c.length;p++)P.evalPoly(s,p)===0&&(c[d++]=P.inv(p));if(d!==c.length)throw new Error("RS.decode: invalid errors number");for(let p=0;p<c.length;p++){const h=n.length-1-P.log(c[p]);if(h<0)throw new Error("RS.decode: invalid error location");const m=P.inv(c[p]);let f=1;for(let y=0;y<c.length;y++)p!==y&&(f=P.mul(f,P.add(1,P.mul(c[y],m))));n[h]=P.add(n[h],P.mul(P.evalPoly(l,m),P.inv(f)))}return n}}}function ih(e,t){const{words:n,shortBlocks:r,numBlocks:o,blockLen:i,total:a}=xe.capacity(e,t),s=oh(n);return{encode(l){const c=[],d=[];for(let f=0;f<o;f++){const y=f<r,b=i+(y?0:1);c.push(l.subarray(0,b)),d.push(s.encode(l.subarray(0,b))),l=l.subarray(b)}const p=Cs(c),h=Cs(d),m=new Uint8Array(p.length+h.length);return m.set(p),m.set(h,p.length),m},decode(l){if(l.length!==a)throw new Error(`interleave.decode: len(data)=${l.length}, total=${a}`);const c=[];for(let h=0;h<o;h++){const m=h<r;c.push(new Uint8Array(n+i+(m?0:1)))}let d=0;for(let h=0;h<i;h++)for(let m=0;m<o;m++)c[m][h]=l[d++];for(let h=r;h<o;h++)c[h][i]=l[d++];for(let h=i;h<i+n;h++)for(let m=0;m<o;m++){const f=m<r;c[m][h+(f?0:1)]=l[d++]}const p=[];for(const h of c)p.push(...Array.from(s.decode(h)).slice(0,-n));return Uint8Array.from(p)}}}function ah(e,t,n,r=!1){const o=xe.size.encode(e);let i=new Ae(o+2);const a=new Ae(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);i=i.embed(0,a).embed({x:-a.width,y:0},a).embed({x:0,y:-a.height},a),i=i.rectSlice(1,o);const s=new Ae(1).rect(0,1,!0).border(1,!1).border(1,!0),l=xe.alignmentPatterns(e);for(const c of l)for(const d of l)i.isDefined(d,c)||i.embed({x:d-2,y:c-2},s);i=i.hLine({x:0,y:6},1/0,({x:c})=>i.isDefined(c,6)?void 0:c%2==0).vLine({x:6,y:0},1/0,({y:c})=>i.isDefined(6,c)?void 0:c%2==0);{const c=xe.formatBits(t,n),d=p=>!r&&(c>>p&1)==1;for(let p=0;p<6;p++)i.set(8,p,d(p));for(let p=6;p<8;p++)i.set(8,p+1,d(p));for(let p=8;p<15;p++)i.set(8,o-15+p,d(p));for(let p=0;p<8;p++)i.set(o-p-1,8,d(p));for(let p=8;p<9;p++)i.set(15-p-1+1,8,d(p));for(let p=9;p<15;p++)i.set(15-p-1,8,d(p));i.set(8,o-8,!r)}if(e>=7){const c=xe.versionBits(e);for(let d=0;d<18;d+=1){const p=!r&&(c>>d&1)==1,h=Math.floor(d/3),m=d%3+o-8-3;i.set(m,h,p),i.set(h,m,p)}}return i}function sh(e,t,n){const r=e.height,o=ni[t];let i=-1,a=r-1;for(let s=r-1;s>0;s-=2){for(s==6&&(s=5);;a+=i){for(let l=0;l<2;l+=1){const c=s-l;e.isDefined(c,a)||n(c,a,o(c,a))}if(a+i<0||a+i>=r)break}i=-i}}function lh(e){let t="numeric";for(let n of e)if(!xe.alphabet.numeric.has(n)&&(t="alphanumeric",!xe.alphabet.alphanumerc.has(n)))return"byte";return t}function ch(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Es(e,t,n,r,o=ch){let i="",a=n.length;if(r==="numeric"){const h=xe.alphabet.numeric.decode(n.split("")),m=h.length;for(let f=0;f<m-2;f+=3)i+=qt(h[f]*100+h[f+1]*10+h[f+2],10);m%3===1?i+=qt(h[m-1],4):m%3===2&&(i+=qt(h[m-2]*10+h[m-1],7))}else if(r==="alphanumeric"){const h=xe.alphabet.alphanumerc.decode(n.split("")),m=h.length;for(let f=0;f<m-1;f+=2)i+=qt(h[f]*45+h[f+1],11);m%2==1&&(i+=qt(h[m-1],6))}else if(r==="byte"){const h=o(n);a=h.length,i=Array.from(h).map(m=>qt(m,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:s}=xe.capacity(e,t),l=qt(a,xe.lengthBits(e,r));let c=xe.modeBits[r]+l+i;if(c.length>s)throw new Error("Capacity overflow");c+="0".repeat(Math.min(4,Math.max(0,s-c.length))),c.length%8&&(c+="0".repeat(8-c.length%8));const d="1110110000010001";for(let h=0;c.length!==s;h++)c+=d[h%d.length];const p=Uint8Array.from(c.match(/(.{8})/g).map(h=>+`0b${h}`));return ih(e,t).encode(p)}function xs(e,t,n,r,o=!1){const i=ah(e,t,r,o);let a=0;const s=8*n.length;if(sh(i,r,(l,c,d)=>{let p=!1;a<s&&(p=(n[a>>>3]>>(7-a&7)&1)!==0,a++),i.set(l,c,p!==d)}),a!==s)throw new Error("QR: bytes left after draw");return i}const Ps=e=>{const t=e.map(n=>n?"1":"0").join("");return{len:t.length,n:+`0b${t}`}},Ts=[!0,!1,!0,!0,!0,!1,!0],Ds=[!1,!1,!1,!1],Ur=Ps([...Ts,...Ds]),As=Ps([...Ds,...Ts]);function dh(e){const{width:t,height:n}=e,r=e.transpose();let o=0;for(let d=0;d<n;d++)e.getRuns(d,p=>{p>=5&&(o+=3+(p-5))});for(let d=0;d<t;d++)r.getRuns(d,p=>{p>=5&&(o+=3+(p-5))});let i=0;for(let d=0;d<n-1;d++)i+=3*e.countBoxes2x2(d);let a=0;for(let d=0;d<n;d++)a+=40*e.countPatternInRow(d,Ur.len,Ur.n,As.n);for(let d=0;d<t;d++)a+=40*r.countPatternInRow(d,Ur.len,Ur.n,As.n);let s=0;s=e.popcnt();const l=s/(n*t)*100,c=10*Math.floor(Math.abs(l-50)/5);return o+i+a+c}function uh(e,t,n,r){if(r===void 0){const o=eh();for(let i=0;i<ni.length;i++)o.add(dh(xs(e,t,n,i,!0)),i);r=o.get()}if(r===void 0)throw new Error("Cannot find mask");return xs(e,t,n,r)}function hh(e){if(!Ss.includes(e))throw new Error(`Invalid error correction mode=${e}. Expected: ${Ss}`)}function ph(e){if(!ks.includes(e))throw new Error(`Encoding: invalid mode=${e}. Expected: ${ks}`);if(e==="kanji"||e==="eci")throw new Error(`Encoding: ${e} is not supported (yet?).`)}function mh(e){if(![0,1,2,3,4,5,6,7].includes(e)||!ni[e])throw new Error(`Invalid mask=${e}. Expected number [0..7]`)}function fh(e,t="raw",n={}){const r=n.ecc!==void 0?n.ecc:"medium";hh(r);const o=n.encoding!==void 0?n.encoding:lh(e);ph(o),n.mask!==void 0&&mh(n.mask);let i=n.version,a,s=new Error("Unknown error");if(i!==void 0)Xu(i),a=Es(i,r,e,o,n.textEncoder);else for(let d=1;d<=40;d++)try{a=Es(d,r,e,o,n.textEncoder),i=d;break}catch(p){s=p}if(!i||!a)throw s;let l=uh(i,r,a,n.mask);l.assertDrawn();const c=n.border===void 0?2:n.border;if(!Number.isSafeInteger(c))throw new Error(`invalid border type=${typeof c}`);if(l=l.border(c,!1),n.scale!==void 0&&(l=l.scale(n.scale)),t==="raw")return l.toRaw();if(t==="ascii")return l.toASCII();if(t==="svg")return l.toSVG(n.optimize);if(t==="gif")return l.toGIF();if(t==="term")return l.toTerm();throw new Error(`Unknown output: ${t}`)}const yh=new Set(["Authorised","Scheduled","Processing Settlement","Settled","Paid Out"]),Ns=new Set(["Cancelled","Failed"]),gh=new Set(["SUCCEEDED","REQUIRES_CAPTURE"]),bh=new Set(["CANCELLED"]),vh=new Set(["AUTHORIZED","CAPTURED","SETTLED"]),Is=new Set(["FAILED","CANCELLED","EXPIRED","AUTHENTICATION_FAILED"]);function Ch(e){const t=e.payment?.transactionStatus,n=e.paymentIntent?.status,r=e.paymentAttempt?.status;return t&&yh.has(t)||n&&gh.has(n)||typeof r=="string"&&vh.has(r)?"success":t&&Ns.has(t)||n&&bh.has(n)||typeof r=="string"&&Is.has(r)?"failed":"pending"}function _h(e){const t=e.payment?.transactionStatus,n=e.paymentAttempt?.status;return t&&Ns.has(t)?t:typeof n=="string"&&Is.has(n)?n:"Failed"}const wh={card:"card",paynow:"qr",wechatpay:"qr",applepay:"wallet",googlepay:"wallet",alipay:"alipay",alipaycn:"alipay",alipayhk:"alipay"};function Rs(e){return wh[e.toLowerCase()]??"redirect"}function $s(e){return e==="applepay"||e==="googlepay"}function Sh(e){return e==="paynow"||e==="wechatpay"}function Ms(e){return e==="alipay"||e==="alipaycn"||e==="alipayhk"}var zn,ee,Fs,Rt,Ls,Os,Bs,ri,Hr,qn,Vs,oi,ii,ai,Us,Kr={},jr=[],kh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wn=Array.isArray;function Ct(e,t){for(var n in t)e[n]=t[n];return e}function si(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function u(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?zn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Gn(e,a,r,o,null)}function Gn(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Fs,__i:-1,__u:0};return o==null&&ee.vnode!=null&&ee.vnode(i),i}function Eh(){return{current:null}}function G(e){return e.children}function Ne(e,t){this.props=e,this.context=t}function gn(e,t){if(t==null)return e.__?gn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?gn(e):null}function xh(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=Ct({},t);i.__v=t.__v+1,ee.vnode&&ee.vnode(i),ci(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??gn(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,Gs(r,i,o),t.__e=t.__=null,i.__e!=n&&Hs(i)}}function Hs(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Hs(e)}function li(e){(!e.__d&&(e.__d=!0)&&Rt.push(e)&&!zr.__r++||Ls!=ee.debounceRendering)&&((Ls=ee.debounceRendering)||Os)(zr)}function zr(){try{for(var e,t=1;Rt.length;)Rt.length>t&&Rt.sort(Bs),e=Rt.shift(),t=Rt.length,xh(e)}finally{Rt.length=zr.__r=0}}function Ks(e,t,n,r,o,i,a,s,l,c,d){var p,h,m,f,y,b,v,C=r&&r.__k||jr,_=t.length;for(l=Ph(n,t,C,l,_),p=0;p<_;p++)(m=n.__k[p])!=null&&(h=m.__i!=-1&&C[m.__i]||Kr,m.__i=p,b=ci(e,m,h,o,i,a,s,l,c,d),f=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&di(h.ref,null,m),d.push(m.ref,m.__c||f,m)),y==null&&f!=null&&(y=f),(v=!!(4&m.__u))||h.__k===m.__k?(l=js(m,l,e,v),v&&h.__e&&(h.__e=null)):typeof m.type=="function"&&b!==void 0?l=b:f&&(l=f.nextSibling),m.__u&=-7);return n.__e=y,l}function Ph(e,t,n,r,o){var i,a,s,l,c,d=n.length,p=d,h=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=Gn(null,a,null,null,null):Wn(a)?a=e.__k[i]=Gn(G,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=Gn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+h,a.__=e,a.__b=e.__b+1,s=null,(c=a.__i=Th(a,n,l,p))!=-1&&(p--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>d?h--:o<d&&h++),typeof a.type!="function"&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<d;i++)(s=n[i])!=null&&!(2&s.__u)&&(s.__e==r&&(r=gn(s)),Zs(s,s));return r}function js(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=js(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=gn(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function qr(e,t){return t=t||[],e==null||typeof e=="boolean"||(Wn(e)?e.some(function(n){qr(n,t)}):t.push(e)),t}function Th(e,t,n,r){var o,i,a,s=e.key,l=e.type,c=t[n],d=c!=null&&!(2&c.__u);if(c===null&&s==null||d&&s==c.key&&l==c.type)return n;if(r>(d?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((c=t[a=o>=0?o--:i++])!=null&&!(2&c.__u)&&s==c.key&&l==c.type)return a}return-1}function zs(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||kh.test(t)?n:n+"px"}function Wr(e,t,n,r,o){var i,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||zs(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||zs(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Vs,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[qn]=r[qn]:(n[qn]=oi,e.addEventListener(t,i?ai:ii,i)):e.removeEventListener(t,i?ai:ii,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function qs(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Hr]==null)t[Hr]=oi++;else if(t[Hr]<n[qn])return;return n(ee.event?ee.event(t):t)}}}function ci(e,t,n,r,o,i,a,s,l,c){var d,p,h,m,f,y,b,v,C,_,S,x,E,N,$,A,L=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(d=ee.__b)&&d(t);e:if(typeof L=="function"){p=a.length;try{if(C=t.props,_=L.prototype&&L.prototype.render,S=(d=L.contextType)&&r[d.__c],x=d?S?S.props.value:d.__:r,n.__c?v=(h=t.__c=n.__c).__=h.__E:(_?t.__c=h=new L(C,x):(t.__c=h=new Ne(C,x),h.constructor=L,h.render=Ah),S&&S.sub(h),h.state||(h.state={}),h.__n=r,m=h.__d=!0,h.__h=[],h._sb=[]),_&&h.__s==null&&(h.__s=h.state),_&&L.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ct({},h.__s)),Ct(h.__s,L.getDerivedStateFromProps(C,h.__s))),f=h.props,y=h.state,h.__v=t,m)_&&L.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),_&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(_&&L.getDerivedStateFromProps==null&&C!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(C,x),t.__v==n.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(C,h.__s,x)===!1){t.__v!=n.__v&&(h.props=C,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t)}),jr.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(C,h.__s,x),_&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,y,b)})}if(h.context=x,h.props=C,h.__P=e,h.__e=!1,E=ee.__r,N=0,_)h.state=h.__s,h.__d=!1,E&&E(t),d=h.render(h.props,h.state,h.context),jr.push.apply(h.__h,h._sb),h._sb=[];else do h.__d=!1,E&&E(t),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++N<25);h.state=h.__s,h.getChildContext!=null&&(r=Ct(Ct({},r),h.getChildContext())),_&&!m&&h.getSnapshotBeforeUpdate!=null&&(b=h.getSnapshotBeforeUpdate(f,y)),$=d!=null&&d.type===G&&d.key==null?Ys(d.props.children):d,s=Ks(e,Wn($)?$:[$],t,n,r,o,i,a,s,l,c),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),v&&(h.__E=h.__=null)}catch(U){if(a.length=p,t.__v=null,l||i!=null){if(U.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else if(i!=null)for(A=i.length;A--;)si(i[A])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),U.then||Ws(t),ee.__e(U,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Dh(n.__e,t,n,r,o,i,a,l,c);return(d=ee.diffed)&&d(t),128&t.__u?void 0:s}function Ws(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ws))}function Gs(e,t,n){for(var r=0;r<n.length;r++)di(n[r],n[++r],n[++r]);ee.__c&&ee.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){ee.__e(i,o.__v)}})}function Ys(e){return typeof e!="object"||e==null||e.__b>0?e:Wn(e)?e.map(Ys):e.constructor!==void 0?null:Ct({},e)}function Dh(e,t,n,r,o,i,a,s,l){var c,d,p,h,m,f,y,b=n.props||Kr,v=t.props,C=t.type;if(C=="svg"?o="http://www.w3.org/2000/svg":C=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((m=i[c])&&"setAttribute"in m==!!C&&(C?m.localName==C:m.nodeType==3)){e=m,i[c]=null;break}}if(e==null){if(C==null)return document.createTextNode(v);e=document.createElementNS(o,C,v.is&&v),s&&(ee.__m&&ee.__m(t,i),s=!1),i=null}if(C==null)b===v||s&&e.data==v||(e.data=v);else{if(i=C=="textarea"&&v.defaultValue!=null?null:i&&zn.call(e.childNodes),!s&&i!=null)for(b={},c=0;c<e.attributes.length;c++)b[(m=e.attributes[c]).name]=m.value;for(c in b)m=b[c],c=="dangerouslySetInnerHTML"?p=m:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||Wr(e,c,null,m,o);for(c in v)m=v[c],c=="children"?h=m:c=="dangerouslySetInnerHTML"?d=m:c=="value"?f=m:c=="checked"?y=m:s&&typeof m!="function"||b[c]===m||Wr(e,c,m,b[c],o);if(d)s||p&&(d.__html==p.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),Ks(t.type=="template"?e.content:e,Wn(h)?h:[h],t,n,r,C=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&gn(n,0),s,l),i!=null)for(c=i.length;c--;)si(i[c]);s&&C!="textarea"||(c="value",C=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[c]||C=="progress"&&!f||C=="option"&&f!=b[c])&&Wr(e,c,f,b[c],o),c="checked",y!=null&&y!=e[c]&&Wr(e,c,y,b[c],o))}return e}function di(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){ee.__e(o,n)}}function Zs(e,t,n){var r,o;if(ee.unmount&&ee.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||di(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){ee.__e(i,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Zs(r[o],t,n||typeof e.type!="function");n||si(e.__e),e.__c=e.__=e.__e=void 0}function Ah(e,t,n){return this.constructor(e,n)}function Qs(e,t,n){var r,o,i;t==document&&(t=document.documentElement),ee.__&&ee.__(e,t),r=t.__k,o=[],i=[],ci(t,e=t.__k=u(G,null,[e]),r||Kr,Kr,t.namespaceURI,r?null:t.firstChild?zn.call(t.childNodes):null,o,r?r.__e:t.firstChild,!1,i),Gs(o,e,i),e.props.children=null}function Nh(e,t,n){var r,o,i,a,s=Ct({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i]===void 0&&a!=null?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?zn.call(arguments,2):n),Gn(e.type,s,r||e.key,o||e.ref,null)}function Gr(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(a){a.__e=!0,li(a)})},this.sub=function(i){r.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),a&&a.call(i)}}),n.children}return t.__c="__cC"+Us++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}zn=jr.slice,ee={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s}throw e}},Fs=0,Ne.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ct({},this.state),typeof e=="function"&&(e=e(Ct({},n),this.props)),e&&Ct(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),li(this))},Ne.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),li(this))},Ne.prototype.render=G,Rt=[],Os=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Bs=function(e,t){return e.__v.__b-t.__v.__b},zr.__r=0,ri=Math.random().toString(8),Hr="__d"+ri,qn="__a"+ri,Vs=/(PointerCapture)$|Capture$/i,oi=0,ii=qs(!1),ai=qs(!0),Us=0;var Gt,re,ui,Js,bn=0,Xs=[],he=ee,el=he.__b,tl=he.__r,nl=he.diffed,rl=he.__c,ol=he.unmount,il=he.__;function Yn(e,t){he.__h&&he.__h(re,e,bn||t),bn=0;var n=re.__H||(re.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function w(e){return bn=1,al(ll,e)}function al(e,t,n){var r=Yn(Gt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ll(void 0,t),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=re,!re.__f)){var o=function(s,l,c){if(!r.__c.__H)return!0;var d=!1,p=r.__c.props!==s;if(r.__c.__H.__.some(function(m){if(m.__N){d=!0;var f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(p=!0)}}),i){var h=i.call(this,s,l,c);return d?h||p:h}return!d||p};re.__f=!0;var i=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,l,c){if(this.__e){var d=i;i=void 0,o(s,l,c),i=d}a&&a.call(this,s,l,c)},re.shouldComponentUpdate=o}return r.__N||r.__}function R(e,t){var n=Yn(Gt++,3);!he.__s&&mi(n.__H,t)&&(n.__=e,n.u=t,re.__H.__h.push(n))}function hi(e,t){var n=Yn(Gt++,4);!he.__s&&mi(n.__H,t)&&(n.__=e,n.u=t,re.__h.push(n))}function W(e){return bn=5,te(function(){return{current:e}},[])}function Ih(e,t,n){bn=6,hi(function(){if(typeof e=="function"){var r=e(t());return function(){e(null),r&&typeof r=="function"&&r()}}if(e)return e.current=t(),function(){return e.current=null}},n)}function te(e,t){var n=Yn(Gt++,7);return mi(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function T(e,t){return bn=8,te(function(){return e},t)}function Yt(e){var t=re.context[e.__c],n=Yn(Gt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(re)),t.props.value):e.__}function Rh(){for(var e;e=Xs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Yr),t.__h.some(pi),t.__h=[]}catch(n){t.__h=[],he.__e(n,e.__v)}}}he.__b=function(e){re=null,el&&el(e)},he.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),il&&il(e,t)},he.__r=function(e){tl&&tl(e),Gt=0;var t=(re=e.__c).__H;t&&(ui===re?(t.__h=[],re.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Yr),t.__h.some(pi),t.__h=[],Gt=0)),ui=re},he.diffed=function(e){nl&&nl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Xs.push(t)!==1&&Js===he.requestAnimationFrame||((Js=he.requestAnimationFrame)||$h)(Rh)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),ui=re=null},he.__c=function(e,t){t.some(function(n){try{n.__h.some(Yr),n.__h=n.__h.filter(function(r){return!r.__||pi(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],he.__e(r,n.__v)}}),rl&&rl(e,t)},he.unmount=function(e){ol&&ol(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Yr(r)}catch(o){t=o}}),n.__H=void 0,t&&he.__e(t,n.__v))};var sl=typeof requestAnimationFrame=="function";function $h(e){var t,n=function(){clearTimeout(r),sl&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);sl&&(t=requestAnimationFrame(n))}function Yr(e){var t=re,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),re=t}function pi(e){var t=re;e.__c=e.__(),re=t}function mi(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function ll(e,t){return typeof t=="function"?t(e):t}const Mh="encrypted",H="encryptedCardNumber",z="encryptedExpiryDate",X="encryptedExpiryMonth",Z="encryptedExpiryYear",j="encryptedSecurityCode",et="encryptedPassword",fi="encryptedSecurityCode3digits",yi="encryptedSecurityCode4digits",gi="giftcard",Fh="6.3.0",Zn=["amex","mc","visa"],Lh=[gi],Oh=[H,z,X,Z,j,et],Bh=Oh,Vh=["bcmc"],cl="required",bi="optional",vi="hidden",$t=cl,Qn=bi,Zr=vi,Pt=cl,Jn=bi,vn=vi,dl="data-cse",ul="data-info",hl="data-uid",pl=["accel","pulse","star","nyce"],Uh={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},Qr={[H]:"cardNumber",[z]:"expiryDate",[j]:"securityCode",[X]:"expiryMonth",[Z]:"expiryYear",[et]:"password",[fi]:"securityCodeThreeDigits",[yi]:"securityCodeFourDigits"},Hh=6e3,Kh="bin-lookup",Jr="-ariaError",Xr="-ariaContext",ml="focusField",fl="notValidating:blurScenario",tt="field.error.required",jh="field.error.invalid",Ci="invalid.format.expects",_i="creditCard.holderName.invalid",wi="creditCard.taxNumber.invalid",yl="boleto.socialSecurityNumber.invalid";var Cn=(function(e){return e.CC_NUM="cc.num",e.CC_DAT="cc.dat",e.CC_MTH="cc.mth",e.CC_YR="cc.yr",e.CC_CVC="cc.cvc",e.KCP_PWD="kcp.pwd",e})({}),Mt=(function(e){return e.ERROR_MSG_INCOMPLETE_FIELD="err.gen.9100",e.ERROR_MSG_INVALID_FIELD="err.gen.9101",e.ERROR_MSG_LUHN_CHECK_FAILED="cc.num.902",e.ERROR_MSG_EMPTY_PAN="cc.num.900",e.ERROR_MSG_UNSUPPORTED_CARD_ENTERED="cc.num.903",e.ERROR_MSG_INCORRECTLY_FILLED_PAN="cc.num.901",e.ERROR_MSG_CARD_TOO_OLD="cc.dat.912",e.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE="cc.dat.913",e.ERROR_MSG_CARD_EXPIRES_TOO_SOON="cc.dat.914",e.ERROR_MSG_EMPTY_DATE="cc.dat.910",e.ERROR_MSG_INCORRECTLY_FILLED__DATE="cc.dat.911",e.ERROR_MSG_EMPTY_YEAR="cc.yr.917",e.ERROR_MSG_INCORRECTLY_FILLED_YEAR="cc.yr.918",e.ERROR_MSG_EMPTY_MONTH="cc.mth.915",e.ERROR_MSG_EMPTY_CVC="cc.cvc.920",e.ERROR_MSG_INCORRECTLY_FILLED_CVC="cc.cvc.921",e.ERROR_MSG_EMPTY_CVC_AMEX="cc.cvc.920.amex",e.ERROR_MSG_INCORRECTLY_FILLED_CVC_AMEX="cc.cvc.921.amex",e.ERROR_MSG_EMPTY_KCP_PWD="kcp.pwd.940",e.ERROR_MSG_INCORRECTLY_FILLED_KCP_PWD="kcp.pwd.941",e})({});const zh={[H]:"cc.num.900",[z]:"cc.dat.910",[X]:"cc.mth.915",[Z]:"cc.yr.917",[j]:"cc.cvc.920",[et]:"kcp.pwd.940"},qh=e=>e?Array.prototype.slice.call(e.querySelectorAll('[data-cse*="encrypted"]')).map(t=>t.getAttribute("data-cse")):[],Wh=(e,t)=>(t===z?(e[X]=!1,e[Z]=!1):e[t]=!1,e),Gh=(e,t)=>(n,r)=>{let o=t.valid[r]!==!0?((i,a)=>a!==1||i!==X&&i!==Z?i:z)(r,e):null;return o=((i,a,s)=>{const{isFieldOfType:l,fieldIsValid:c}=s.reduce((m,f)=>(m.isFieldOfType||(m.isFieldOfType=i===f,m.fieldIsValid=!a.errors?.[f]),m),{isFieldOfType:!1,fieldIsValid:!1}),d=i===j?"cvcPolicy":"expiryDatePolicy",p=d==="cvcPolicy"?Qn:Jn,h=d==="cvcPolicy"?Zr:vn;return(a[d]===p||a[d]===h)&&c&&l?null:i})(o,t,[j,z,X,Z]),o&&!n.includes(o)&&n.push(o),n},Yh=(e,t,n)=>({rootNode:t,fieldType:e,error:n.errors?.[e]||zh[e],type:"card"});function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Zh=class{constructor(t){K(this,"callbacks",void 0),K(this,"config",void 0),K(this,"props",void 0),K(this,"state",void 0),K(this,"validateForm",void 0),K(this,"handleBrandFromBinLookup",void 0),K(this,"callbacksHandler",void 0),K(this,"configHandler",void 0),K(this,"createCardSecuredFields",void 0),K(this,"createNonCardSecuredFields",void 0),K(this,"createSecuredFields",void 0),K(this,"destroySecuredFields",void 0),K(this,"handleIOSTouchEvents",void 0),K(this,"destroyTouchendListener",void 0),K(this,"destroyTouchstartListener",void 0),K(this,"handleBinValue",void 0),K(this,"handleEncryption",void 0),K(this,"handleFocus",void 0),K(this,"handleIframeConfigFeedback",void 0),K(this,"handleValidation",void 0),K(this,"handleSFShiftTab",void 0),K(this,"handleShiftTab",void 0),K(this,"isConfigured",void 0),K(this,"postMessageToAllIframes",void 0),K(this,"processAutoComplete",void 0),K(this,"processBrand",void 0),K(this,"sendBrandToCardSF",void 0),K(this,"sendExpiryDatePolicyToSF",void 0),K(this,"setFocusOnFrame",void 0),K(this,"setupSecuredField",void 0),K(this,"touchendListener",void 0),K(this,"touchstartListener",void 0),K(this,"hasGenuineTouchEvents",void 0),K(this,"encryptedAttrName",void 0),K(this,"hasRedundantCVCField",void 0),K(this,"isSingleBrandedCard",void 0),K(this,"securityCode",void 0),this.props=t,this.state={},this.config={},this.callbacks={}}};const gl=Object.prototype.toString;function eo(e){return typeof e=="object"&&e!==null&&Object.prototype.toString.call(e)==="[object Array]"}function Tt(e){return e!=null}function to(e){return e!==!1&&Tt(e)}function Si(e){return!!e&&typeof e=="object"}function bl(e){return!to(e)||!(!(typeof(t=e)=="number"||Si(t)&&gl.call(t)==="[object Number]")||e!==0&&!Number.isNaN(e))||!(!eo(e)&&!(function(n){return typeof n=="string"||Si(n)&&gl.call(n)==="[object String]"})(e)||e.length!==0)||!(!Si(e)||Object.keys(e).length!==0);var t}function Qh(e){return!bl(e)}function ki(...e){const t=eo(e[0])?e[0]:e;return{from:n=>t.map(r=>r in n?{[r]:n[r]}:{}).reduce((r,o)=>({...r,...o}),{})}}function Ei(...e){const t=eo(e[0])?e[0]:e;return{from:n=>ki(...Object.keys(n).filter(r=>!t.includes(r))).from(n)}}const Jh=e=>eo(e)&&e.length?e:Zn;let xi=typeof window<"u"&&window.console&&window.console.error&&window.console.error.bind(window.console);typeof window<"u"&&window.console&&window.console.info&&window.console.info.bind(window.console);let Pi=typeof window<"u"&&window.console&&window.console.log&&window.console.log.bind(window.console),Zt=typeof window<"u"&&window.console&&window.console.warn&&window.console.warn.bind(window.console);function Xh(e){this.config.cardGroupTypes=Jh(e.cardGroupTypes);const t=e.loadingContext;if(!t)return void Zt("WARNING Config :: no loadingContext has been specified!");var n;this.config.loadingContext=(n=t).charAt(n.length-1)==="/"?t:`${t}/`,this.config.isCreditCardType=Lh.includes(e.type)===!1,this.config.iframeUIConfig=e.iframeUIConfig??{},this.config.autoFocus=!(e.autoFocus===!1||e.autoFocus==="false"),this.config.showWarnings=e.showWarnings===!0||e.showWarnings==="true",this.config.trimTrailingSeparator=!(e.trimTrailingSeparator===!1||e.trimTrailingSeparator==="false"),this.config.keypadFix=!(e.keypadFix===!1||e.keypadFix==="false"),this.config.legacyInputMode=e.legacyInputMode||null,this.config.minimumExpiryDate=e.minimumExpiryDate||null,this.config.sfLogAtStart=window._b$dl===!0;const r=this.config.isCreditCardType?"card":e.type,o=btoa(window.location.origin),i=`${r}${!this.config.loadingContext.includes("live")&&e.forceCompat?"Compat":""}`;this.config.iframeSrc=`${this.config.loadingContext}securedfields/${e.clientKey}/${Fh}/securedFields.html?type=${i}&d=${o}`}const qe=()=>{};function ep(e={}){this.callbacks.onLoad=e.onLoad?e.onLoad:qe,this.callbacks.onConfigSuccess=e.onConfigSuccess?e.onConfigSuccess:qe,this.callbacks.onFieldValid=e.onFieldValid?e.onFieldValid:qe,this.callbacks.onAllValid=e.onAllValid?e.onAllValid:qe,this.callbacks.onBrand=e.onBrand?e.onBrand:qe,this.callbacks.onError=e.onError?e.onError:qe,this.callbacks.onFocus=e.onFocus?e.onFocus:qe,this.callbacks.onBinValue=e.onBinValue?e.onBinValue:qe,this.callbacks.onAutoComplete=e.onAutoComplete?e.onAutoComplete:qe,this.callbacks.onAdditionalSFConfig=e.onAdditionalSFConfig?e.onAdditionalSFConfig:qe,this.callbacks.onAdditionalSFRemoved=e.onAdditionalSFRemoved?e.onAdditionalSFRemoved:qe,this.callbacks.onTouchstartIOS=e.onTouchstartIOS?e.onTouchstartIOS:qe,this.callbacks.onKeyDown=e.onKeyDown?e.onKeyDown:qe}const vl=({fieldType:e,encryptedFieldName:t,uuid:n,isValid:r,txVariant:o,rootNode:i})=>({fieldType:e,encryptedFieldName:t,uid:n,valid:r,type:o,rootNode:i}),tp=({fieldType:e,txVariant:t,rootNode:n})=>{const r=e===z,o=[],i=["encryptedExpiryMonth","encryptedExpiryYear"];let a,s,l,c;const d=r?2:1;for(a=0;a<d;a+=1){l=r?i[a]:e,s=`${t}-encrypted-${l}`,c=r?l:e;const p=vl({fieldType:e,encryptedFieldName:c,uuid:s,isValid:!1,txVariant:t,rootNode:n});o.push(p)}return o},np=({fieldType:e,txVariant:t,rootNode:n,encryptedObjArr:r})=>{let o,i,a,s,l;const c=[];for(o=0;o<r.length;o+=1){a=r[o],s=a.encryptedFieldName,i=`${t}-encrypted-${s}`,l=a.blob;const d=vl({fieldType:e,encryptedFieldName:s,uuid:i,isValid:!0,txVariant:t,rootNode:n});d.blob=l,c.push(d)}return c};function Y(e={},t){return Object.prototype.hasOwnProperty.call(e,t)}const Cl=(e,t,n,r,o)=>{if(!Y(e,"error"))return null;const i=t,a={rootNode:r,fieldType:e.fieldType,error:null,type:null},s=e.error!=="";return s||i.hasError?(a.error=s?e.error:"",a.type=n,i.hasError=s,i.errorType=a.error,o(a),a):null};function rp(e){let t;const n=e.fieldType;if(this.state.type==="card"&&Y(e,"cvcPolicy")&&Tt(e.cvcPolicy)&&Y(this.state.securedFields,j)&&(this.state.securedFields[j].cvcPolicy=e.cvcPolicy),Cl(e,this.state.securedFields[n],this.state.type,this.props.rootNode,this.callbacks.onError),this.state.securedFields[n].isEncrypted){t=tp({fieldType:n,txVariant:this.state.type,rootNode:this.props.rootNode}),n===H&&(t[0].endDigits="");for(let r=0,o=t.length;r<o;r+=1)this.callbacks.onFieldValid(t[r]);this.state.securedFields[n].isEncrypted=!1}this.validateForm(),Y(e,"brand")&&this.processBrand(e)}const nt=(e,t,n)=>{if(t){const r=JSON.stringify(e);t.postMessage(r,n)}};function ut(e,t){return e.securedFields[t]?.iframeContentWindow||null}function op(e){const t=e.fieldType;let n,r;this.config.autoFocus&&(e.type!=="year"&&t!==Z||this.setFocusOnFrame(j),t===X&&this.setFocusOnFrame(Z));const o=e[t];this.state.securedFields[t].isEncrypted=!0,Cl({error:"",fieldType:e.fieldType},this.state.securedFields[t],this.state.type,this.props.rootNode,this.callbacks.onError);const i=np({fieldType:t,txVariant:this.state.type,rootNode:this.props.rootNode,encryptedObjArr:o});if(t===X&&Y(this.state.securedFields,Z)){const a={txVariant:this.state.type,code:e.code,blob:o[0].blob,fieldType:Z,numKey:this.state.securedFields[Z].numKey};nt(a,ut(this.state,Z),this.config.loadingContext)}for(t===H&&to(e.endDigits)&&(i[0].endDigits=e.endDigits),t===H&&to(e.issuerBin)&&(i[0].issuerBin=+e.issuerBin),t===z&&to(e.expiryDate)&&(i[1].expiryDate=e.expiryDate),n=0,r=i.length;n<r;n+=1)this.callbacks.onFieldValid(i[n]);this.validateForm()}const _l=(e,t)=>{let n=[];return e&&typeof e.querySelectorAll=="function"&&(n=[].slice.call(e.querySelectorAll(t))),n},_t=(e,t)=>{if(e)return e.querySelector(t)},no=(e,t)=>{if(e)return e.getAttribute(t)},ip=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)};let Ti;const V={__NO_BRAND:"noBrand",cards:[]};V.cards.push({cardType:"mc",permittedLengths:[16],pattern:/^(5[1-5][0-9]{0,14}|2[2-7][0-9]{0,14})$/,securityCode:"CVC"}),V.cards.push({cardType:"visadankort",permittedLengths:[16],pattern:/^(4571)[0-9]{0,12}$/}),V.cards.push({cardType:"visa",permittedLengths:[13,16,19],pattern:/^4[0-9]{0,18}$/,securityCode:"CVV"}),V.cards.push({cardType:"amex",permittedLengths:[15],pattern:/^3[47][0-9]{0,13}$/,securityCode:"CID"}),V.cards.push({cardType:"diners",permittedLengths:[14,15,16,17,18,19],pattern:/^(36)[0-9]{0,12}$/}),V.cards.push({cardType:"maestrouk",permittedLengths:[16,18,19],pattern:/^(6759)[0-9]{0,15}$/}),V.cards.push({cardType:"solo",permittedLengths:[16,18,19],pattern:/^(6767)[0-9]{0,15}$/}),V.cards.push({cardType:"laser",permittedLengths:[16,17,18,19],pattern:/^(6304|6706|6709|6771)[0-9]{0,15}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"discover",permittedLengths:[16,17,18,19],pattern:/^(6011[0-9]{0,12}|(644|645|646|647|648|649)[0-9]{0,13}|65[0-9]{0,14})$/}),V.cards.push({cardType:"jcb",permittedLengths:[16,19],pattern:/^(352[8,9]{1}[0-9]{0,15}|35[4-8]{1}[0-9]{0,16})$/,securityCode:"CAV"}),V.cards.push({cardType:"bcmc",permittedLengths:[16,17,18,19],pattern:/^((6703)[0-9]{0,15}|(479658|606005)[0-9]{0,13})$/,cvcPolicy:"hidden"}),V.cards.push({cardType:"bijcard",permittedLengths:[16],pattern:/^(5100081)[0-9]{0,9}$/}),V.cards.push({cardType:"dankort",permittedLengths:[16],pattern:/^(5|50|501|5019[0-9]{0,12}|4|45|457|4571[0-9]{0,12}|3|35|357|3571[0-9]{0,12})$/}),V.cards.push({cardType:"hipercard",permittedLengths:[16],pattern:/^(606282)[0-9]{0,10}$/}),V.cards.push({cardType:"cup",permittedLengths:[14,15,16,17,18,19],pattern:/^(62|81)[0-9]{0,17}$/}),V.cards.push({cardType:"maestro",permittedLengths:[16,17,18,19],pattern:/^(5[0|6-8][0-9]{0,17}|6[0-9]{0,18})$/,cvcPolicy:"optional"}),V.cards.push({cardType:"elo",permittedLengths:[16],pattern:/^((((506699)|(506770)|(506771)|(506772)|(506773)|(506774)|(506775)|(506776)|(506777)|(506778)|(401178)|(438935)|(451416)|(457631)|(457632)|(504175)|(627780)|(636368)|(636297))[0-9]{0,10})|((50676)|(50675)|(50674)|(50673)|(50672)|(50671)|(50670))[0-9]{0,11})$/}),V.cards.push({cardType:"uatp",permittedLengths:[15],pattern:/^1[0-9]{0,14}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"cartebancaire",permittedLengths:[16],pattern:/^[4-6][0-9]{0,15}$/}),V.cards.push({cardType:"visaalphabankbonus",permittedLengths:[16],pattern:/^(450903)[0-9]{0,10}$/}),V.cards.push({cardType:"mcalphabankbonus",permittedLengths:[16],pattern:/^(510099)[0-9]{0,10}$/}),V.cards.push({cardType:"hiper",permittedLengths:[16],pattern:/^(637095|637568|637599|637609|637612)[0-9]{0,10}$/}),V.cards.push({cardType:"oasis",permittedLengths:[16],pattern:/^(982616)[0-9]{0,10}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"karenmillen",permittedLengths:[16],pattern:/^(98261465)[0-9]{0,8}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"warehouse",permittedLengths:[16],pattern:/^(982633)[0-9]{0,10}$/,cvcPolicy:"optional"}),V.cards.push({cardType:"mir",permittedLengths:[16,17,18,19],pattern:/^(220)[0-9]{0,16}$/}),V.cards.push({cardType:"codensa",permittedLengths:[16],pattern:/^(590712)[0-9]{0,10}$/}),V.cards.push({cardType:"naranja",permittedLengths:[16,17,18,19],pattern:/^(37|40|5[28])([279])\d*$/}),V.cards.push({cardType:"cabal",permittedLengths:[16,17,18,19],pattern:/^(58|6[03])([03469])\d*$/}),V.cards.push({cardType:"shopping",permittedLengths:[16,17,18,19],pattern:/^(27|58|60)([39])\d*$/}),V.cards.push({cardType:"argencard",permittedLengths:[16,17,18,19],pattern:/^(50)(1)\d*$/}),V.cards.push({cardType:"troy",permittedLengths:[16],pattern:/^(97)(9)\d*$/}),V.cards.push({cardType:"forbrugsforeningen",permittedLengths:[16],pattern:/^(60)(0)\d*$/}),V.cards.push({cardType:"vpay",permittedLengths:[13,14,15,16,17,18,19],pattern:/^(40[1,8]|413|43[4,5]|44[1,2,3,4,6,7]|45[5,8]|46[0,1,3,6]|47[1,9]|48[2,3,7])[0-9]{0,16}$/}),V.cards.push({cardType:"rupay",permittedLengths:[16],pattern:/^(100003|508(2|[5-9])|60(69|[7-8])|652(1[5-9]|[2-5][0-9]|8[5-9])|65300[3-4]|8172([0-1]|[3-5]|7|9)|817(3[3-8]|40[6-9]|410)|35380([0-2]|[5-6]|9))[0-9]{0,12}$/}),V.cards.push({cardType:"ticket",expiryDatePolicy:"hidden"});var Di={detectCard:(e,t)=>{let n;return t?(n=V.cards.filter(r=>t.includes(r.cardType)).filter(r=>Y(r,"pattern")&&e.match(r.pattern)),n.length?(n.length===1||n.sort((r,o)=>t.indexOf(r.cardType)-t.indexOf(o.cardType)),n[0]):{cardType:V.__NO_BRAND}):{cardType:V.__NO_BRAND}},detectCardLength:(e,t)=>{let n,r,o=0,i=!1,a=t;const s=e.cardType!==V.__NO_BRAND?e.permittedLengths[e.permittedLengths.length-1]:0;if(s&&a>s&&(o=a.length-s,o>0&&(a=a.substring(0,a.length-o),r=a)),e.permittedLengths.forEach(l=>{a.length===l&&(i=!0)}),a.length===s){const l=Math.floor(a.length/4);n=s+(a.length%4>0?l:l-1),e.cardType.toLowerCase()==="amex"&&(n=s+2)}return{shortenedNewValue:r,maxLength:n,reachedValidLength:i}},getShortestPermittedCardLength:()=>{if(!Ti){let e=[];V.cards.forEach(t=>{e=e.concat(t.permittedLengths??[])}),Ti=Math.min.apply(null,e)}return Ti},getCardByBrand:e=>V.cards.filter(t=>t.cardType===e)[0],isGenericCardType:e=>{if(!e)throw new Error("Error: isGenericCardType: type param has not been specified");return e==="card"||e==="scheme"},__NO_BRAND:V.__NO_BRAND,allCards:V.cards};function ap({src:e,title:t="iframe element",policy:n="origin"}){const r=document.createElement("iframe");r.setAttribute("src",e),r.classList.add("js-iframe"),t!==""&&t.trim().length>0&&r.setAttribute("title",t),r.setAttribute("allowtransparency","true"),r.setAttribute("referrerpolicy",n);const o=document.createTextNode("<p>Your browser does not support iframes.</p>");return r.appendChild(o),r}const Xn=(e,t,n,r=!1)=>!(!e||typeof e.addEventListener!="function")&&(e.addEventListener(t,n,r),!0),er=(e,t,n,r=!1)=>!(!e||typeof e.removeEventListener!="function")&&(e.removeEventListener(t,n,r),!0),sp=(e,t,n)=>{const r=e.origin,o=t.indexOf("/checkoutshopper/");let i=o>-1?t.substring(0,o):t;const a=i.length-1;return i.charAt(a)==="/"&&(i=i.substring(0,a)),r===i||(n&&Zt(`WARNING postMessageValidation: postMessage listener for iframe::origin mismatch!
|
|
132
|
+
Received message with origin:`,r,"but the only allowed origin for messages to CSF is",i,"### event.data=",e.data),!1)},lp=e=>e.data&&e.data.type&&typeof e.data.type=="string"&&e.data.type.includes("webpack"),cp=e=>e.data&&typeof e.data=="string"&&e.data.includes("cvox");function dp(){if(!window.crypto)return 4294967296*Math.random()|0;const e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]}function wl(e,t){const n=typeof e;return e&&t&&n==="object"&&n===typeof t?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>wl(e[r],t[r])):e===t}function wt(...e){const t=e,n=t.shift();return function(...r){return n.apply(this,t.concat(r))}}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let up=class{constructor(){J(this,"sfConfig",void 0),J(this,"componentType",void 0),J(this,"loadingContext",void 0),J(this,"holderEl",void 0),J(this,"iframeRef",void 0),J(this,"loadToConfigTimeout",void 0),J(this,"_isValid",void 0),J(this,"_iframeContentWindow",void 0),J(this,"_numKey",void 0),J(this,"_isEncrypted",void 0),J(this,"_hasError",void 0),J(this,"_errorType",void 0),J(this,"_cvcPolicy",void 0),J(this,"_expiryDatePolicy",void 0),J(this,"_iframeOnLoadListener",void 0),J(this,"_postMessageListener",void 0),J(this,"submitAnalytics",void 0),J(this,"onIframeLoadedCallback",void 0),J(this,"onConfigCallback",void 0),J(this,"onEncryptionCallback",void 0),J(this,"onValidationCallback",void 0),J(this,"onFocusCallback",void 0),J(this,"onBinValueCallback",void 0),J(this,"onTouchstartCallback",void 0),J(this,"onShiftTabCallback",void 0),J(this,"onAutoCompleteCallback",void 0),J(this,"onKeyDownCallback",void 0),this.sfConfig={}}};const hp=(e,t)=>Object.values(Mt).reduce((n,r)=>(r.includes(t)&&(n[r]=e.get(r)),n),{}),pp=(e,t,n)=>{const r={...e},o=mp(n);return r.error=hp(t,o),r},Sl=(e,t)=>{let n=e;for(const[r,o]of Object.entries(t))if(o===e){n=r;break}return n?.toLowerCase().replace(/[_.\s]/g,"-")},mp=e=>{let t;switch(e){case H:t=Cn.CC_NUM;break;case z:t=Cn.CC_DAT;break;case X:t=Cn.CC_MTH;break;case Z:t=Cn.CC_YR;break;case j:t=Cn.CC_CVC;break;case et:t=Cn.KCP_PWD}return t},fp=({errors:e,i18n:t,layout:n,countrySpecificLabels:r,fieldTypeMappingFn:o})=>Object.entries(e).reduce((i,[a,s])=>{if(s){const l=e[a],c="errorI18n"in l&&"rootNode"in l,d=typeof l.errorMessage=="object";let p,h;if(p=c?l.error:d?l.errorMessage.translationKey:l.errorMessage,c&&"errorI18n"in l)h=l.errorI18n+"";else{const m=o?o(a,t,r):"";if(d){const f=l.errorMessage.translationKey,y=l.errorMessage.translationObject.values.format;h=`${t.get(f,{values:{label:m,format:y}})}`}else h=t.get(l.errorMessage,{values:{label:m}})+""}i.push({field:a,errorMessage:h,errorCode:p}),n&&i.sort((m,f)=>n.indexOf(m.field)-n.indexOf(f.field))}return i},[]),yp=({i18n:e,fieldTypeMappingFn:t,SRPanelRef:n},{errors:r,isValidating:o,layout:i,countrySpecificLabels:a,hasDisplayedErrors:s=!0})=>{const l=fp({errors:r,i18n:e,fieldTypeMappingFn:t,countrySpecificLabels:a,layout:i});if(l.length){if(o){const c=l.map(p=>p.errorMessage);n.setMessages(c);const d=l.map(p=>p.field);return{currentErrorsSortedByLayout:l,action:ml,fieldToFocus:d[0]}}return n?.setMessages(null),{currentErrorsSortedByLayout:l,action:fl}}return s&&n?.setMessages(null),{currentErrorsSortedByLayout:l,action:"none"}};var gp=(e,t,n,r)=>{const o={...e},i={};switch(n){case"ach":case gi:break;default:if(r===j)i[fi]=t.get("creditCard.securityCode.contextualText.3digits"),i[yi]=t.get("creditCard.securityCode.contextualText.4digits");else{const a=`creditCard.${Qr[r]}.contextualText`,s=t.get(a);s!==a&&(i[r]=s)}}return Object.keys(i).length&&(o.contextualTexts=i),o};function bp(e,t,n,r){const o=["giftcard"].includes(e)?e:"creditCard";let i=n.get(`${o}.${t}.aria.iframeTitle`);i==="none"&&(i="");const a=n.get(`${o}.${Qr[t]}.label`),s=n.locale;let l=pp({iframeTitle:i,label:a},n,t);return r&&(l=gp(l,n,e,t)),{...s&&{lang:s},[t]:l}}function vp(e,t,n){return e===gi?{[t]:n[Qr[t]]??""}:t===j?{[fi]:n.securityCodeThreeDigits??"",[yi]:n.securityCodeFourDigits??""}:{[t]:n[Qr[t]]??""}}function Be(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return(e=="x"?t:3&t|8).toString(16)})}function Ai(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qt=(function(e){return e.info="info",e.error="error",e.log="log",e})({});let Ni=class{constructor(t){Ai(this,"timestamp",void 0),Ai(this,"id",void 0),Ai(this,"component",void 0),this.component=t,this.id=Be(),this.timestamp=String(Date.now())}};function Ii(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ie=(function(e){return e.network="Network",e.implementation="Implementation",e.internal="Internal",e.apiError="ApiError",e.sdkError="SdkError",e.thirdParty="ThirdParty",e.generic="Generic",e.redirect="Redirect",e.threeDS2="ThreeDS2",e})({}),pe=(function(e){return e.SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND="500",e.REDIRECT="600",e.SECURED_FIELDS_KEY_NOT_FOUND="608",e.SECURED_FIELDS_ENCRYPTION_KEY_GEN_FAILED="609",e.SECURED_FIELDS_ENCRYPTION_ERROR="610",e.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA="700",e.THREEDS2_ACTION_IS_MISSING_TOKEN="701",e.THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL="702",e.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS="703",e.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED="704",e.THREEDS2_TIMEOUT="710",e.THREEDS2_TOKEN_IS_MISSING_ACSURL="800",e.THREEDS2_NO_TRANSSTATUS="801",e.THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED="802",e.THREEDS2_NO_COMPONENT_FOR_ACTION="803",e.THREEDS2_NO_ACTION_FOR_CHALLENGE="804",e.THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP="805",e.THREEDS2_CHALLENGE_TOKEN_IS_MISSING_THREEDSNOTIFICATIONURL="806",e})({});class Re extends Ni{getEventCategory(){return Qt.error}constructor(t){super(t.component),Ii(this,"errorType",void 0),Ii(this,"code",void 0),Ii(this,"message",void 0),this.errorType=t.errorType,this.code=t.code,t.message&&(this.message=t.message)}}let Cp=class extends up{init(t,n,r,o){const i=bp(this.sfConfig.txVariant,this.sfConfig.fieldType,t,o);this.sfConfig.iframeUIConfig.ariaConfig=i,this.sfConfig.iframeUIConfig.placeholders=vp(this.sfConfig.txVariant,this.sfConfig.fieldType,r);const a={src:n,title:i[this.sfConfig.fieldType].iframeTitle,policy:"origin"},s=ap(a);this.holderEl.appendChild(s);const l=_t(this.holderEl,".js-iframe");if(l){if(!l.contentWindow){console.error("ERROR: Trying to initialise a securedField iframe, but the iframe.contentWindow is undefined. Are you sure the element into which the Card component is being mounted already exists in the DOM *before* the Card component is mounted?");const c=new Re({component:this.componentType,code:pe.SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND,errorType:Ie.implementation,message:`Trying to initialise an iframe for ${this.sfConfig.fieldType}, but the iframe.contentWindow is undefined`});this.submitAnalytics?.(c)}this.iframeContentWindow=l.contentWindow,this.iframeOnLoadListener=this.iframeOnLoadListenerFn,Xn(l,"load",this.iframeOnLoadListener,!1)}return this.iframeRef=l,this}iframeOnLoadListenerFn(){this.postMessageListener=this.postMessageListenerFn,Xn(window,"message",this.postMessageListener,!1);const t={...this.sfConfig,numKey:this.numKey};window._b$dl&&console.log("### SecuredField:::: onIframeLoaded:: created configObj=",t),nt(t,this.iframeContentWindow,this.loadingContext),this.onIframeLoadedCallback()}postMessageListenerFn(t){if(!sp(t,this.loadingContext,this.sfConfig.showWarnings))return;let n;try{n=JSON.parse(t.data)}catch{return lp(t)?void(this.sfConfig.showWarnings&&Pi("### SecuredField::postMessageListenerFn:: PARSE FAIL - WEBPACK")):cp(t)?void(this.sfConfig.showWarnings&&Pi("### SecuredField::postMessageListenerFn:: PARSE FAIL - CHROMEVOX")):void(this.sfConfig.showWarnings&&Pi("### SecuredField::postMessageListenerFn:: PARSE FAIL - UNKNOWN REASON: event.data=",t.data))}if(Y(n,"action")&&Y(n,"numKey"))if(this.numKey===n.numKey)switch(n.action){case"encryption":this.isValid=!0,this.onEncryptionCallback(n);break;case"config":window._b$dl&&console.log("### SecuredField::postMessageListenerFn:: configured - calling onConfigCallback",n.fieldType),this.onConfigCallback(n);break;case"focus":this.onFocusCallback(n);break;case"binValue":this.onBinValueCallback(n);break;case"touch":this.onTouchstartCallback(n);break;case"shifttab":this.onShiftTabCallback(n);break;case"autoComplete":this.onAutoCompleteCallback(n);break;case"enterKeyPressed":this.onKeyDownCallback(n);break;case"encryptionError":{const r=new Re({component:this.componentType,code:n.code,errorType:Ie.internal,message:`${n.error}. Field= ${this.sfConfig.fieldType}`});this.submitAnalytics?.(r);break}default:this.isValid=!1,this.onValidationCallback(n)}else this.sfConfig.showWarnings&&Zt("WARNING SecuredField :: postMessage listener for iframe :: data mismatch! (Probably a message from an unrelated securedField)");else this.sfConfig.showWarnings&&Zt("WARNING SecuredField :: postMessage listener for iframe :: data mismatch!")}destroy(){er(window,"message",this.postMessageListener,!1),er(this.iframeRef,"load",this.iframeOnLoadListener,!1),this.iframeContentWindow=null,ip(this.holderEl)}isOptionalOrHidden(){if(this.sfConfig.fieldType===z||this.sfConfig.fieldType===X||this.sfConfig.fieldType===Z)switch(this.expiryDatePolicy){case vn:return!0;case Jn:return!this.hasError;default:return!1}if(this.sfConfig.fieldType===j)switch(this.cvcPolicy){case Zr:return!0;case Qn:return!this.hasError;default:return!1}return!1}onIframeLoaded(t){return this.onIframeLoadedCallback=t,this}onEncryption(t){return this.onEncryptionCallback=t,this}onValidation(t){return this.onValidationCallback=t,this}onConfig(t){return this.onConfigCallback=t,this}onFocus(t){return this.onFocusCallback=t,this}onBinValue(t){return this.onBinValueCallback=t,this}onTouchstart(t){return this.onTouchstartCallback=t,this}onShiftTab(t){return this.onShiftTabCallback=t,this}onAutoComplete(t){return this.onAutoCompleteCallback=t,this}onKeyDown(t){return this.onKeyDownCallback=t,this}get errorType(){return this._errorType}set errorType(t){this._errorType=t}get hasError(){return this._hasError}set hasError(t){this._hasError=t}get isValid(){if(this.sfConfig.fieldType===j)switch(this.cvcPolicy){case Zr:return!0;case Qn:return!this.hasError;default:return this._isValid}if(this.sfConfig.fieldType===z||this.sfConfig.fieldType===X||this.sfConfig.fieldType===Z)switch(this.expiryDatePolicy){case vn:return!0;case Jn:return!this.hasError;default:return this._isValid}return this._isValid}set isValid(t){this._isValid=t}get cvcPolicy(){return this._cvcPolicy}set cvcPolicy(t){this.sfConfig.fieldType===j&&t!==this.cvcPolicy&&(this._cvcPolicy=t,this.hasError&&this.errorType==="isValidated"&&(this.hasError=!1))}get expiryDatePolicy(){return this._expiryDatePolicy}set expiryDatePolicy(t){this.sfConfig.fieldType!==z&&this.sfConfig.fieldType!==X&&this.sfConfig.fieldType!==Z||t!==this.expiryDatePolicy&&(this._expiryDatePolicy=t,this.hasError&&this.errorType==="isValidated"&&(this.hasError=!1))}get iframeContentWindow(){return this._iframeContentWindow}set iframeContentWindow(t){this._iframeContentWindow=t}get isEncrypted(){return this._isEncrypted}set isEncrypted(t){this._isEncrypted=t}get numKey(){return this._numKey}set numKey(t){this._numKey=t}get iframeOnLoadListener(){return this._iframeOnLoadListener}set iframeOnLoadListener(t){this._iframeOnLoadListener=t.bind(this)}get postMessageListener(){return this._postMessageListener}set postMessageListener(t){this._postMessageListener=t.bind(this)}constructor(t,n){var r,o,i;super(),i=void 0,(o="sfConfig")in(r=this)?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i;const a=Ei(["loadingContext","holderEl","iframeSrc","showContextualElement","placeholders"]).from(t);this.sfConfig={...a,iframeUIConfig:{...a.iframeUIConfig}};const{iframeSrc:s,placeholders:l,showContextualElement:c}=t;return this.loadingContext=t.loadingContext,this.holderEl=t.holderEl,this.submitAnalytics=t.submitAnalytics,this.componentType=t.componentType,this.isValid=!1,this.iframeContentWindow=null,this.numKey=dp(),this.isEncrypted=!1,this.hasError=!1,this.errorType="",this.cvcPolicy=t.cvcPolicy,this.expiryDatePolicy=t.expiryDatePolicy,this.init(n,s,l,c)}};function Ri(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const kl="NETWORK_ERROR",_p="CANCEL",$i="IMPLEMENTATION_ERROR",Mi="API_ERROR",ro="ERROR",wp="SCRIPT_ERROR",Sp="SDK_ERROR";let M=class yu extends Error{constructor(t,n,r){super(n),Ri(this,"cause",void 0),Ri(this,"options",void 0),this.name=yu.errorTypes[t],this.options=r||{},this.cause=this.options.cause}};Ri(M,"errorTypes",{NETWORK_ERROR:kl,CANCEL:_p,IMPLEMENTATION_ERROR:$i,API_ERROR:Mi,ERROR:ro,SCRIPT_ERROR:wp,SDK_ERROR:Sp});const kp=e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase(),Ep=(e,t)=>{const n=e==="card"?"nocard":e||"nocard",r={type:n,extension:"svg"};return t.getImage(r)(n)},Fi=e=>{let t=kp(e);return _n(e)&&(t=t.substring(Mh.length+1)),t};function _n(e){return Bh.includes(e)}function xp(){this.encryptedAttrName=dl;const e=_l(this.props.rootNode,`[${this.encryptedAttrName}]`).filter(r=>{const o=no(r,this.encryptedAttrName),i=_n(o);return i||console.warn(`WARNING: '${o}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`),i}),t=$t,n=Pt;return this.config.isCreditCardType?(this.isSingleBrandedCard=!1,this.securityCode="",this.createCardSecuredFields(e,t,n),e.length):(this.createNonCardSecuredFields(e),e.length)}async function Pp(e){for(let t=0;t<e.length;t++){const n=e[t];await this.setupSecuredField(n).catch(r=>{window._b$dl&&console.log("Secured fields setup failure. e=",r)})}}async function Tp(e,t,n){let r=this.state.type;if(r==="card"&&this.config.cardGroupTypes.length===1&&(r=this.config.cardGroupTypes[0],this.state.type=r),this.isSingleBrandedCard=r!=="card",this.isSingleBrandedCard){const o=Di.getCardByBrand(r);Tt(o)?(t=o.cvcPolicy||$t,n=o.expiryDatePolicy||Pt,this.securityCode=o.securityCode):this.state.type="unrecognised-single-brand"}for(let o=0;o<e.length;o++){const i=e[o];window._b$dl&&console.log(`
|
|
133
|
+
About to set up securedField:`,i),await this.setupSecuredField(i,t,n).catch(a=>{window._b$dl&&console.log("Secured fields setup failure. e=",a)}),window._b$dl&&console.log("Finished setting up securedField:",i)}if(window._b$dl&&console.log("Finished setting up all securedFields"),this.isSingleBrandedCard){const o={type:this.state.type,rootNode:this.props.rootNode,brand:r,cvcPolicy:t,expiryDatePolicy:n,cvcText:this.securityCode};setTimeout(()=>{this.callbacks.onBrand(o)},0)}}function Dp(e,t,n){return new Promise((r,o)=>{const i=no(e,this.encryptedAttrName);i===Z&&(this.state.hasSeparateDateFields=!0);const a={fieldType:i,extraFieldData:no(e,ul),uid:no(e,hl),cvcPolicy:t,holderEl:e,expiryDatePolicy:n,txVariant:this.state.type,cardGroupTypes:this.config.cardGroupTypes,iframeUIConfig:this.config.iframeUIConfig,sfLogAtStart:this.config.sfLogAtStart,trimTrailingSeparator:this.config.trimTrailingSeparator,isCreditCardType:this.config.isCreditCardType,iframeSrc:this.config.iframeSrc,loadingContext:this.config.loadingContext,showWarnings:this.config.showWarnings,legacyInputMode:this.config.legacyInputMode,minimumExpiryDate:this.config.minimumExpiryDate,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,disableIOSArrowKeys:this.props.shouldDisableIOSArrowKeys,implementationType:this.props.implementationType,showContextualElement:this.props.showContextualElement,placeholders:this.props.placeholders,submitAnalytics:this.props.onSubmitAnalytics,componentType:this.props.componentType},s=new Cp(a,this.props.i18n).onIframeLoaded(()=>{if(this.state.iframeCount+=1,window._b$dl&&console.log("### createSecuredFields::onIframeLoaded:: this.state.iframeCount=",this.state.iframeCount),this.state.iframeCount>this.state.numIframes)throw this.destroySecuredFields(),new M("ERROR",`One or more securedFields has just loaded new content. This should never happen. securedFields have been removed.
|
|
134
|
+
iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`);if(s.loadToConfigTimeout=setTimeout(()=>{o({type:a.fieldType,failReason:"sf took too long to config"})},Hh),this.state.iframeCount===this.state.originalNumIframes){const l={iframesLoaded:!0};this.callbacks.onLoad(l)}}).onConfig(l=>{this.handleIframeConfigFeedback(l),clearTimeout(s.loadToConfigTimeout),s.loadToConfigTimeout=null,r(l)}).onFocus(l=>{this.handleFocus(l)}).onBinValue(l=>{this.handleBinValue(l)}).onTouchstart(l=>{this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents||l.hasGenuineTouchEvents)&&this.callbacks.onTouchstartIOS({fieldType:l.fieldType}),(l.hasGenuineTouchEvents||this.hasGenuineTouchEvents)&&this.postMessageToAllIframes({fieldType:l.fieldType,fieldClick:!0})}).onShiftTab(l=>{this.handleSFShiftTab(l.fieldType)}).onEncryption(l=>{this.handleEncryption(l)}).onValidation(l=>{this.handleValidation(l)}).onAutoComplete(l=>{this.processAutoComplete(l)}).onKeyDown(l=>{const{numKey:c,...d}=l;this.callbacks.onKeyDown(d)});this.state.securedFields[i]=s})}var ht={__IS_IE:typeof navigator<"u"&&(function(){const e=navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){const r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}const n=e.indexOf("Edge/");return n>0&&parseInt(e.substring(n+5,e.indexOf(".",n)),10)})(),__IS_IOS:typeof navigator<"u"&&/iphone|ipod|ipad/i.test(navigator.userAgent),__IS_FIREFOX:typeof navigator<"u"&&/(firefox)/i.test(navigator.userAgent)},tr={touchendListener:function(e){const t=e.target;if(t instanceof HTMLInputElement||HTMLTextAreaElement&&t instanceof HTMLTextAreaElement){const r=t.value;let o="selectionStart"in(n=t)?n.selectionStart:0,i=!1;o===r.length&&(o-=1,i=!0),t.value=r;try{t.setSelectionRange&&(t.focus(),t.setSelectionRange(o,o),i&&(o+=1,setTimeout(()=>{t.setSelectionRange(o,o)},0)))}catch{}}else if(this.config.keypadFix){const r=this.props.rootNode,o=document.createElement("input");o.style.width="1px",o.style.height="1px",o.style.opacity="0",o.style.fontSize="18px",r.appendChild(o),o.focus(),r.removeChild(o)}var n;this.destroyTouchendListener(),this.state.registerFieldForIos=!1,this.postMessageToAllIframes({fieldType:"webInternalElement",fieldClick:!0})},touchstartListener:function(e){this.hasGenuineTouchEvents=!0;const t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLSpanElement){this.postMessageToAllIframes({fieldType:"webInternalElement",checkoutTouchEvent:!0});const n=t.getAttribute("name")??t.getAttribute("data-id");this.callbacks.onTouchstartIOS?.({fieldType:"webInternalElement",name:n})}},handleTouchend:function(){const e=_t(document,"body");e.style.cursor="pointer",Xn(e,"touchend",this.touchendListener),this.state.registerFieldForIos=!0},destroyTouchendListener:function(){if(!ht.__IS_IOS)return!1;const e=_t(document,"body");return e.style.cursor="auto",er(e,"touchend",this.touchendListener),!0},destroyTouchstartListener:function(){return!!ht.__IS_IOS&&(er(document,"touchstart",this.touchstartListener),!0)}};const nr=(e,t,n)=>((r,o=!0)=>{const i=Array.prototype.slice.call(_l(document,"*[data-cse], a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), object, embed, *[tabindex], *[contenteditable]")),a=[];i.forEach(l=>{const c=l.getAttribute("tabindex"),d=!c||parseInt(c,10)>=0,p=l.getBoundingClientRect(),h=p.width>0&&p.height>0;d&&h&&a.push(l)});const s=((l,c)=>{for(let d=0;d<l.length;d+=1)if(c(l[d]))return d;return-1})(a,l=>l===r||r.contains(l));return a[s+(o?-1:1)]})(_t(t,`[data-cse=${e}]`),n),Ap=e=>{e&&(e.focus(),e.blur(),e.focus())};function Np(e,t,n,r){let o,i;switch(e){case H:o=nr(H,t);break;case z:case X:i=H;break;case Z:i=X;break;case j:r===1?o=nr(j,t):i=n?Z:z}return{fieldToFocus:i,additionalField:o}}function Ip(e,t){let n,r;switch(e){case H:n=nr(H,t);break;case j:r=H}return{fieldToFocus:r,additionalField:n}}function Rp(e,t,n){let r,o;switch(e){case H:r=nr(H,t);break;case z:case X:o=H;break;case Z:o=X;break;case j:o=n?Z:z;break;case et:r=nr(e,t)}return{fieldToFocus:o,additionalField:r}}var El={handleShiftTab:function(e){let t;this.state.type==="giftcard"?t=Ip(e,this.props.rootNode):t=this.state.isKCP?Rp(e,this.props.rootNode,this.state.hasSeparateDateFields):Np(e,this.props.rootNode,this.state.hasSeparateDateFields,this.state.numIframes);const n=t.fieldToFocus,r=t.additionalField;n?this.setFocusOnFrame(n,!1):r&&Ap(r)},handleSFShiftTab:function(e){(ht.__IS_FIREFOX||ht.__IS_IE&&ht.__IS_IE<=11)&&this.handleShiftTab(e)}};function $p(e){if(Y(this.state.securedFields,H)){const t={txVariant:this.state.type,...e,fieldType:H,numKey:this.state.securedFields[H].numKey};nt(t,ut(this.state,H),this.config.loadingContext)}}function Mp(e){(Y(this.state.securedFields,X)&&Y(this.state.securedFields,Z)?[X,Z]:[z]).forEach(t=>{const n={txVariant:this.state.type,...e,fieldType:t,numKey:this.state.securedFields[t].numKey};nt(n,ut(this.state,t),this.config.loadingContext)})}function Fp(e,t){const n=this.state.type==="card";if(!e||!Object.keys(e).length)return n?(this.sendBrandToCardSF({brand:"reset"}),this.sendExpiryDatePolicyToSF({expiryDatePolicy:Pt})):t&&this.processBrand({...t,fieldType:H}),void(this.state.type==="card"&&Y(this.state.securedFields,z)&&(this.state.securedFields[z].expiryDatePolicy=Pt));const r=e.supportedBrands[0],o=r.brand,i=r.expiryDatePolicy??(r.showExpiryDate===!0?Pt:vn),a={brand:o,cvcPolicy:r.cvcPolicy,expiryDatePolicy:i,cvcText:"Security code",showSocialSecurityNumber:r.showSocialSecurityNumber??!1,fieldType:H,mode:Kh};if(this.processBrand(a),n){const s={brand:o,enableLuhnCheck:e.supportedBrands[0].enableLuhnCheck!==!1,...r?.panLength&&!e.isDualBrandSelection&&{panLength:r?.panLength}};this.sendBrandToCardSF(s),this.sendExpiryDatePolicyToSF({expiryDatePolicy:i})}Y(this.state.securedFields,j)&&(this.state.securedFields[j].cvcPolicy=r.cvcPolicy),Y(this.state.securedFields,z)?this.state.securedFields[z].expiryDatePolicy=i:Y(this.state.securedFields,X)&&Y(this.state.securedFields,Z)&&(this.state.securedFields[X].expiryDatePolicy=i,this.state.securedFields[Z].expiryDatePolicy=i),this.validateForm()}function Lp({csfState:e,csfConfig:t},n,r){if(!Y(e.securedFields,n))return;const o={txVariant:e.type,fieldType:n,focus:!0,numKey:e.securedFields[n].numKey};nt(o,ut(e,n),t.loadingContext)}function Op({csfState:e,csfConfig:t},n){const r=Object.keys(n||{});return r.length?(Object.keys(e.securedFields).forEach(o=>{const i={txVariant:e.type,fieldType:o,numKey:e.securedFields[o].numKey};r.forEach(a=>{i[a]=n[a]}),nt(i,ut(e,o),t.loadingContext)}),!0):!1}function Bp({csfState:e,csfConfig:t,csfProps:n,csfCallbacks:r},o){if(o.fieldType===H){const s={brand:o.brand,cvcPolicy:o.cvcPolicy,expiryDatePolicy:o.expiryDatePolicy,showSocialSecurityNumber:o.showSocialSecurityNumber},l=(i=s,a=e.brand,!wl(i,a));if(!l)return null;const c=e.type==="card"||e.type==="bcmc";if(c&&l&&(e.brand=s,Y(e.securedFields,j))){const p={txVariant:e.type,brand:s.brand,fieldType:j,cvcPolicy:o.cvcPolicy,numKey:e.securedFields[j].numKey};nt(p,ut(e,j),t.loadingContext)}const d=c?ki(["brand","cvcPolicy","cvcText","expiryDatePolicy","showSocialSecurityNumber","mode"]).from(o):null;if(d&&d.brand){const p=d;p.type=e.type,p.rootNode=n.rootNode,r.onBrand(p)}return!0}var i,a;return!1}function Vp({csfState:e,csfConfig:t,csfCallbacks:n},r){if(r.name==="cc-name"){const o={...r};delete o.numKey;const i=o;return n.onAutoComplete(i),!0}if(r.name==="cc-exp"){const o=r.value.replace(/[^0-9]/gi,"/").split("/");if(o.length!==2)return!1;o[0].length===1&&(o[0]=`0${o[0]}`);const i=o[0],a=o[1];if(!((a?.length===4||a?.length===2)&&!isNaN(parseInt(a))))return!1;const s=a.slice(-2),l=`${i}/${s}`;if(Y(e.securedFields,z)){const c={txVariant:e.type,fieldType:z,autoComplete:l,numKey:e.securedFields[z].numKey};return nt(c,ut(e,z),t.loadingContext),!0}if(Y(e.securedFields,X)){const c={txVariant:e.type,fieldType:X,autoComplete:i,numKey:e.securedFields[X].numKey};nt(c,ut(e,X),t.loadingContext)}return Y(e.securedFields,Z)&&setTimeout(()=>{const c={txVariant:e.type,fieldType:Z,autoComplete:s,numKey:e.securedFields[Z].numKey};nt(c,ut(e,Z),t.loadingContext)},0),!0}return!1}function Up({csfState:e,csfProps:t,csfCallbacks:n},r,o){const i={...o};delete i.numKey,i.rootNode=t.rootNode,i.type=e.type;const a=i.fieldType;i.focus?e.currentFocusObject!==a&&(e.currentFocusObject=a,ht.__IS_IOS&&!e.registerFieldForIos&&r()):e.currentFocusObject===a&&(e.currentFocusObject=null);const s=i;s.currentFocusObject=e.currentFocusObject,n.onFocus(s)}function Hp({csfState:e,csfCallbacks:t},n,r){if(e.iframeConfigCount+=1,window._b$dl&&console.log("### handleIframeConfigFeedback::csfState.iframeConfigCount:: ",e.iframeConfigCount,"who=",r.fieldType),e.isConfigured){const o={additionalIframeConfigured:!0,fieldType:r.fieldType,type:e.type};t.onAdditionalSFConfig(o)}else if(e.iframeConfigCount===e.originalNumIframes)return n(),!0;return!1}function Kp({csfState:e,csfConfig:t,csfProps:n,csfCallbacks:r},o){e.isConfigured=!0;const i={iframesConfigured:!0,type:e.type,rootNode:n.rootNode};if(r.onConfigSuccess(i),e.numIframes===1&&t.isCreditCardType){if(e.type==="card")return xi("ERROR: Payment method with a single secured field - but 'brands' has not been set to an array containing the specific card brand"),!1;const a=Di.getCardByBrand(e.type);a&&(a.cvcPolicy??$t)!==$t&&o()}return!0}function jp({csfState:e,csfProps:t,csfCallbacks:n}){const r=(a=>{const s=Object.keys(a);for(let l=0,c=s.length;l<c;l+=1)if(!a[s[l]].isValid)return!1;return!0})(e.securedFields),o=r!==e.allValid;if(e.allValid=r,!r&&!o)return;const i={allValid:r,type:e.type,rootNode:t.rootNode};n.onAllValid(i)}function zp({csfState:e,csfCallbacks:t},n){const{binValue:r,encryptedBin:o,uuid:i}=n,a={binValue:r,type:e.type};o&&(a.encryptedBin=o,a.uuid=i),t.onBinValue(a)}function qp(){this.postMessageToAllIframes({destroy:!0}),Object.keys(this.state.securedFields).forEach(e=>{const t=this.state.securedFields[e];t&&t.destroy(),this.state.securedFields[e]=null}),this.destroyTouchendListener(),this.destroyTouchstartListener(),this.state.securedFields={}}const rr=(e="You cannot use secured fields")=>{Zt(`${e} - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.`)};class Wp extends Zh{init(){this.configHandler(this.props),this.callbacksHandler(this.props.callbacks);const t=this.createSecuredFields();this.state.numIframes=this.state.originalNumIframes=t,this.state.isKCP=!!this.props.isKCP,ht.__IS_IOS&&this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents=!1,Xn(document,"touchstart",this.touchstartListener))}createReturnObject(){return{updateStyles:t=>{this.state.isConfigured?this.postMessageToAllIframes({styleObject:t}):Zt("You cannot update the secured fields styling - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.")},setFocusOnFrame:t=>{this.state.isConfigured?this.setFocusOnFrame(t):rr("You cannot set focus on any secured field")},isValidated:(t,n)=>{if(this.state.isConfigured){if(Y(this.state.securedFields,t)){this.state.securedFields[t].hasError=!0,this.state.securedFields[t].errorType===""&&(this.state.securedFields[t].errorType="isValidated");const r={txVariant:this.state.type,fieldType:t,externalValidation:!0,code:n,numKey:this.state.securedFields[t].numKey};nt(r,ut(this.state,t),this.config.loadingContext)}}else rr("You cannot set validated on any secured field")},hasUnsupportedCard:(t,n)=>{if(this.state.isConfigured){if(Y(this.state.securedFields,t)){this.state.securedFields[t].hasError=!!n,this.state.securedFields[t].errorType=n;const r={txVariant:this.state.type,fieldType:t,unsupportedCard:!!n,code:n,numKey:this.state.securedFields[t].numKey};nt(r,ut(this.state,t),this.config.loadingContext)}}else rr("You cannot set hasUnsupportedCard on any secured field")},destroy:()=>{this.state.isConfigured?this.destroySecuredFields():rr("You cannot destroy secured fields")},brandsFromBinLookup:(t,n)=>{if(!this.config.isCreditCardType)return null;this.state.isConfigured?this.handleBrandFromBinLookup(t,n):rr("You cannot set pass brands to secured fields")},addSecuredField:t=>{const n=_t(this.props.rootNode,`[data-cse="${t}"]`);n&&(this.state.numIframes+=1,this.setupSecuredField(n))},removeSecuredField:t=>{if(this.state.securedFields[t]){this.state.securedFields[t].destroy(),delete this.state.securedFields[t],this.state.numIframes-=1,this.state.iframeCount-=1;const n={additionalIframeRemoved:!0,fieldType:t,type:this.state.type};this.callbacks.onAdditionalSFRemoved(n)}},setKCPStatus:t=>{this.state.isKCP=t},sfIsOptionalOrHidden:t=>this.state.securedFields[t].isOptionalOrHidden()}}constructor(t){super(t),this.state={type:this.props.type,brand:this.props.type!=="card"?{brand:this.props.type,cvcPolicy:"required"}:{brand:null,cvcPolicy:"required"},allValid:void 0,numIframes:0,originalNumIframes:0,iframeCount:0,iframeConfigCount:0,isConfigured:!1,hasSeparateDateFields:!1,currentFocusObject:null,registerFieldForIos:!1,securedFields:{},isKCP:!1};const n={csfState:this.state,csfConfig:this.config,csfProps:this.props,csfCallbacks:this.callbacks};this.configHandler=Xh.bind(this),this.callbacksHandler=ep.bind(this),this.validateForm=wt(jp,n),this.isConfigured=wt(Kp,n,this.validateForm),this.handleIframeConfigFeedback=wt(Hp,n,this.isConfigured),this.processBrand=wt(Bp,n),this.handleValidation=rp.bind(this),this.handleEncryption=op.bind(this),this.createSecuredFields=xp.bind(this),this.createNonCardSecuredFields=Pp.bind(this),this.createCardSecuredFields=Tp.bind(this),this.setupSecuredField=Dp.bind(this),this.postMessageToAllIframes=wt(Op,n),this.handleIOSTouchEvents=tr.handleTouchend.bind(this),this.touchendListener=tr.touchendListener.bind(this),this.destroyTouchendListener=tr.destroyTouchendListener.bind(this),this.touchstartListener=tr.touchstartListener.bind(this),this.destroyTouchstartListener=tr.destroyTouchstartListener.bind(this),this.setFocusOnFrame=wt(Lp,n),this.handleFocus=wt(Up,n,this.handleIOSTouchEvents),this.handleSFShiftTab=El.handleSFShiftTab.bind(this),this.handleShiftTab=El.handleShiftTab.bind(this),this.destroySecuredFields=qp.bind(this),this.processAutoComplete=wt(Vp,n),this.handleBinValue=wt(zp,n),this.handleBrandFromBinLookup=Fp.bind(this),this.sendBrandToCardSF=$p.bind(this),this.sendExpiryDatePolicyToSF=Mp.bind(this),this.init()}}const Gp=e=>{if(!e)throw new Error("No securedFields configuration object defined");const t={...e};try{const r=Di.isGenericCardType(t.type);t.type=r?"card":t.type}catch{t.type="card"}if(!Y(t,"rootNode"))return xi('ERROR: SecuredFields configuration object is missing a "rootNode" property');if(bl(t.clientKey))return Zt('WARNING: AdyenCheckout configuration object is missing a "clientKey" property.');const n=Yp(t.rootNode);return n?(t.rootNode=n,new Wp(t).createReturnObject()):xi(`ERROR: SecuredFields cannot find a valid rootNode element for ${t.type}`)},Yp=e=>{let t;return typeof e=="object"&&(t=e),typeof e!="string"||(t=_t(document,e),t)?t:null};function oo(e,t,n,r){return(t!==bi&&t!==vi||n[e]!==0)&&r[e]}var pt={handleFocus:function(e){this.numCharsInField[e.fieldType]=e.numChars,this.props.onFocus(e)},handleOnAllValid:function(e){return!this.state.detectedUnsupportedBrands&&(this.setState({isSfpValid:e.allValid},()=>{this.props.onChange(this.state,{event:"handleOnAllValid"}),this.props.onAllValid(e)}),!0)},handleOnAutoComplete:function(e){this.setState({autoCompleteName:e.value},()=>{this.props.onChange(this.state,{event:"handleOnAutoComplete",fieldType:e.fieldType}),this.setState({autoCompleteName:null})}),this.props.onAutoComplete(e)},handleOnFieldValid:function(e){return(!this.state.detectedUnsupportedBrands||e.fieldType!==H)&&(this.setState(t=>({data:{...t.data,[e.encryptedFieldName]:e.blob},valid:{...t.valid,[e.encryptedFieldName]:e.valid},errors:{...t.errors,[e.fieldType]:t.errors[e.fieldType]??null}}),()=>{this.props.onChange(this.state,{event:"handleOnFieldValid",fieldType:e.fieldType}),this.props.onFieldValid(e)}),!0)},handleOnLoad:function(e){clearTimeout(this.csfLoadFailTimeout),this.csfLoadFailTimeout=null,this.props.onLoad(e),this.csfConfigFailTimeout=setTimeout(()=>{this.state.status!=="ready"&&(this.setState({status:"csfConfigFailure"}),this.props.onError(new M("ERROR","secured fields have failed to configure")))},this.csfConfigFailTimeoutMS)},handleOnConfigSuccess:function(e){clearTimeout(this.csfConfigFailTimeout),this.csfConfigFailTimeout=null,this.setState({status:"ready"},()=>{this.props.onConfigSuccess(e)})},handleOnBrand:function(e){this.setState(t=>{const n=oo(j,e.cvcPolicy,this.numCharsInField,t.errors),r=this.numDateFields===1?oo(z,e.expiryDatePolicy,this.numCharsInField,t.errors):null,o=this.numDateFields===2?oo(X,e.expiryDatePolicy,this.numCharsInField,t.errors):null,i=this.numDateFields===2?oo(Z,e.expiryDatePolicy,this.numCharsInField,t.errors):null;return{brand:e.brand,cvcPolicy:e.cvcPolicy??$t,showSocialSecurityNumber:e.showSocialSecurityNumber,errors:{...t.errors,...Tt(n)&&{[j]:n},...Tt(r)&&{[z]:r},...Tt(o)&&{[X]:o},...Tt(i)&&{[Z]:i}},expiryDatePolicy:e.expiryDatePolicy??Pt}},()=>{this.props.onChange(this.state,{event:"handleOnBrand"});const t=this.props.brandsConfiguration[e.brand]?.icon??Ep(e.brand,this.props.resources);this.props.onBrand({...e,brandImageUrl:t})})},handleOnError:function(e,t=null){const n=e.error;return this.setState(r=>({errors:{...r.errors,[e.fieldType]:n||null},...t&&{data:{...r.data,[H]:void 0}},...t&&{valid:{...r.valid,[H]:!1}},...t&&{isSfpValid:!1}}),()=>{this.props.onChange(this.state,{event:"handleOnError",fieldType:e.fieldType})}),!0},handleOnNoDataRequired:function(){this.setState({status:"ready"},()=>this.props.onChange({isSfpValid:!0}))},handleOnTouchstartIOS:function(e){this.props.disableIOSArrowKeys?.(e)},handleKeyDown:function(e){if(e.action==="enterKeyPressed"){const t=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter"});this.props.handleKeyDown?.(t)}}},Zp={type:"card",keypadFix:!0,rootNode:null,loadingContext:null,brands:[],showWarnings:!1,autoFocus:!0,trimTrailingSeparator:!0,onChange:()=>{},onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onFocus:()=>{},onAutoComplete:()=>{},handleKeyDown:()=>{},styles:{}},Li=(function(e){return e.full="full",e.partial="partial",e.none="none",e})({});const xl="holderName",Oi="socialSecurityNumber",io=[H,z,j],ao=[xl,H,z,j],so=[H,z,j,xl],Bi=["taxNumber",et],Qp=io.concat(Bi),Jp=ao.concat(Bi),Xp=so.concat(Bi),e0=io.concat([Oi]),t0=ao.concat([Oi]),n0=so.concat([Oi]),lo="N/A",co=["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],[Ft,mt,Jt,wn,We,Xt]=co,r0={street:"address-line1",houseNumberOrName:"address-line2",postalCode:"postal-code",city:"address-level2"},Vi={AU:{hasDataset:!0,labels:{[mt]:"apartmentSuite",[We]:"state",[Ft]:"address"},optionalFields:[mt],placeholders:{[We]:"select.state"},schema:[Xt,Ft,mt,wn,[[We,50],[Jt,50]]]},BR:{hasDataset:!0,labels:{[We]:"state"},placeholders:{[We]:"select.state"}},CA:{hasDataset:!0,labels:{[mt]:"apartmentSuite",[We]:"provinceOrTerritory",[Ft]:"address"},optionalFields:[mt],schema:[Xt,Ft,mt,[[wn,70],[Jt,30]],We]},GB:{labels:{[wn]:"cityTown"},schema:[Xt,[[mt,30],[Ft,70]],[[wn,70],[Jt,30]],We]},US:{hasDataset:!0,labels:{[Jt]:"zipCode",[mt]:"apartmentSuite",[We]:"state",[Ft]:"address"},optionalFields:[mt],placeholders:{[We]:"select.state"},schema:[Xt,Ft,mt,wn,[[We,50],[Jt,50]]]},default:{optionalFields:[],placeholders:{[We]:"select.provinceOrTerritory"},schema:[Xt,[[Ft,70],[mt,30]],[[Jt,30],[wn,70]],We]}},o0=Object.keys(Vi).reduce((e,t)=>(e[t]={labels:Vi[t].labels,schema:[Jt]},e),{}),Ui=Gr(void 0),i0=({i18n:e,loadingContext:t,resources:n,analytics:r,children:o})=>{const i=Yt(Ui);return R(()=>{e&&t&&n||console.warn(`CoreProvider - WARNING core provider is missing:${e?"":"i18n"} ${t?"":"loadingContext"} ${n?"":"resources"}`)},[e,t,n]),i?u(G,null,qr(o)):u(Ui.Provider,{value:{i18n:e,loadingContext:t,resources:n,analytics:r}},qr(o))},O=()=>{const e=Yt(Ui);if(e===void 0)throw new Error('"useCoreContext" must be used within a CoreProvider');return e};function Pe(){const{resources:e}=O();return T(t=>e?.getImage(t),[])}const Pl=(e,t)=>t({type:e==="card"?"nocard":e||"nocard",extension:"svg"})(e),a0=e=>["revolving","bonus"].includes(e?.plan)||e?.value>1,s0=({props:e,showKCP:t,showBrazilianSSN:n,countrySpecificSchemas:r=null,billingAddressRequiredFields:o=null})=>{let i=io;const a=e.hasHolderName&&e.holderNameRequired;if(a&&(i=e.positionHolderNameOnTop?ao:so),t&&(i=Qp,a&&(i=e.positionHolderNameOnTop?Jp:Xp)),n&&(i=e0,a&&(i=e.positionHolderNameOnTop?t0:n0)),r){const s=r.flat(2).filter(c=>typeof c!="number");let l=s;o&&(l=s.filter(c=>o.includes(c))),i=io.concat(l),a&&(i=e.positionHolderNameOnTop?ao.concat(l):so.concat(l))}return i},l0=(e,t,n)=>{switch(e){case"socialSecurityNumber":return t.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return n?.[e]?t.get(n?.[e]):t.get(e);default:return null}},c0=e=>({billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),d0=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyDown:e.handleKeyDown,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),Tl=e=>e==Li.partial?o0:null;function u0(e){return![Mt.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,Mt.ERROR_MSG_CARD_TOO_OLD,Mt.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,Mt.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function Hi(e){return Uh[e]??e}const h0={"cc.cvc.920":"cc.cvc.920.amex","cc.cvc.921":"cc.cvc.921.amex"};function Dl(e,t){return t&&h0[e]||e}const p0=(e,t)=>e.map(n=>{const r=n.id,o=Pe(),i=r==="card"?"nocard":r,a=t?.[r]?.icon??Pl(i,o);return{id:n.id,name:n.brandObject.localeBrand||n.brandObject.brand,imageURL:a,altName:Hi(r)}}),Ki=(e,t,n)=>t.some(r=>e.includes(r[n])),m0=({installmentOptions:e,fundingSource:t,amount:n})=>!(!e||Object.keys(e).length===0)&&!(!n||n.value===0)&&(!t||t==="credit");var g=(function(e){return e.address="address",e.bankTransfer_IBAN="bankTransfer_IBAN",e.bankTransfer_BE="bankTransfer_BE",e.bankTransfer_NL="bankTransfer_NL",e.bankTransfer_PL="bankTransfer_PL",e.bankTransfer_FR="bankTransfer_FR",e.bankTransfer_CH="bankTransfer_CH",e.bankTransfer_IE="bankTransfer_IE",e.bankTransfer_GB="bankTransfer_GB",e.bankTransfer_DE="bankTransfer_DE",e.bankTransfer_AE="bankTransfer_AE",e.bankTransfer_AT="bankTransfer_AT",e.bankTransfer_AU="bankTransfer_AU",e.bankTransfer_BG="bankTransfer_BG",e.bankTransfer_CA="bankTransfer_CA",e.bankTransfer_EE="bankTransfer_EE",e.bankTransfer_ES="bankTransfer_ES",e.bankTransfer_FI="bankTransfer_FI",e.bankTransfer_HK="bankTransfer_HK",e.bankTransfer_HU="bankTransfer_HU",e.bankTransfer_IT="bankTransfer_IT",e.bankTransfer_JP="bankTransfer_JP",e.bankTransfer_LU="bankTransfer_LU",e.bankTransfer_NZ="bankTransfer_NZ",e.bankTransfer_PT="bankTransfer_PT",e.bankTransfer_SG="bankTransfer_SG",e.bankTransfer_SK="bankTransfer_SK",e.bankTransfer_US="bankTransfer_US",e.donation="donation",e.personal_details="personal_details",e.dropin="dropin",e.bcmc="bcmc",e.card="card",e.scheme="scheme",e.storedCard="storedCard",e.customCard="customcard",e.threeDS2Challenge="threeDS2Challenge",e.threeDS2Fingerprint="threeDS2Fingerprint",e.threeDS2DeviceFingerprint="threeDS2DeviceFingerprint",e.ach="ach",e.directdebit_GB="directdebit_GB",e.sepadirectdebit="sepadirectdebit",e.eft_directdebit_CA="eft_directdebit_CA",e.affirm="affirm",e.afterpay="afterpay",e.afterpay_default="afterpay_default",e.afterpay_b2b="afterpay_b2b",e.atome="atome",e.facilypay_3x="facilypay_3x",e.facilypay_4x="facilypay_4x",e.facilypay_6x="facilypay_6x",e.facilypay_10x="facilypay_10x",e.facilypay_12x="facilypay_12x",e.ratepay="ratepay",e.ratepay_directdebit="ratepay_directdebit",e.amazonpay="amazonpay",e.applepay="applepay",e.cashapp="cashapp",e.clicktopay="clicktopay",e.googlepay="googlepay",e.paypal="paypal",e.fastlane="fastlane",e.paywithgoogle="paywithgoogle",e.boletobancario="boletobancario",e.boletobancario_itau="boletobancario_itau",e.boletobancario_santander="boletobancario_santander",e.primeiropay_boleto="primeiropay_boleto",e.doku="doku",e.doku_alfamart="doku_alfamart",e.doku_permata_lite_atm="doku_permata_lite_atm",e.doku_indomaret="doku_indomaret",e.doku_atm_mandiri_va="doku_atm_mandiri_va",e.doku_sinarmas_va="doku_sinarmas_va",e.doku_mandiri_va="doku_mandiri_va",e.doku_cimb_va="doku_cimb_va",e.doku_danamon_va="doku_danamon_va",e.doku_bri_va="doku_bri_va",e.doku_bni_va="doku_bni_va",e.doku_bca_va="doku_bca_va",e.doku_wallet="doku_wallet",e.oxxo="oxxo",e.billdesk_online="billdesk_online",e.billdesk_wallet="billdesk_wallet",e.dotpay="dotpay",e.eps="eps",e.iris="iris",e.molpay_ebanking_fpx_MY="molpay_ebanking_fpx_MY",e.molpay_ebanking_TH="molpay_ebanking_TH",e.molpay_ebanking_VN="molpay_ebanking_VN",e.onlineBanking_CZ="onlineBanking_CZ",e.onlinebanking_IN="onlinebanking_IN",e.onlineBanking_PL="onlineBanking_PL",e.onlineBanking_SK="onlineBanking_SK",e.paybybank="paybybank",e.payu_IN_cashcard="payu_IN_cashcard",e.payu_IN_nb="payu_IN_nb",e.wallet_IN="wallet_IN",e.dragonpay="dragonpay",e.dragonpay_ebanking="dragonpay_ebanking",e.dragonpay_otc_banking="dragonpay_otc_banking",e.dragonpay_otc_non_banking="dragonpay_otc_non_banking",e.dragonpay_otc_philippines="dragonpay_otc_philippines",e.econtext="econtext",e.econtext_atm="econtext_atm",e.econtext_online="econtext_online",e.econtext_seven_eleven="econtext_seven_eleven",e.econtext_stores="econtext_stores",e.giropay="giropay",e.multibanco="multibanco",e.redirect="redirect",e.twint="twint",e.vipps="vipps",e.trustly="trustly",e.paybybank_AIS_DD="paybybank_AIS_DD",e.riverty="riverty",e.paybybank_pix="paybybank_pix",e.klarna="klarna",e.klarna_account="klarna_account",e.klarna_paynow="klarna_paynow",e.klarna_b2b="klarna_b2b",e.bcmc_mobile="bcmc_mobile",e.bcmc_mobile_QR="bcmc_mobile_QR",e.pix="pix",e.swish="swish",e.wechatpay="wechatpay",e.wechatpayQR="wechatpayQR",e.promptpay="promptpay",e.paynow="paynow",e.duitnow="duitnow",e.blik="blik",e.mbway="mbway",e.ancv="ancv",e.payto="payto",e.upi="upi",e.upi_qr="upi_qr",e.upi_intent="upi_intent",e.giftcard="giftcard",e.mealVoucher_FR="mealVoucher_FR",e.mealVoucher_FR_natixis="mealVoucher_FR_natixis",e.mealVoucher_FR_sodexo="mealVoucher_FR_sodexo",e.mealVoucher_FR_groupeup="mealVoucher_FR_groupeup",e})({});function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Al extends Ne{componentDidMount(){this.props.rootNode&&this.setRootNode(this.props.rootNode);const t=qh(this.rootNode),n=t.reduce(Wh,{});this.setState({valid:n}),t.forEach(r=>{this.numCharsInField[r]=0}),this.numDateFields=t.filter(r=>r.match(/Expiry/)).length,t.length?(this.destroy(),this.initializeCSF(this.rootNode)):(this.props.componentType===g.customCard&&console.debug('You are trying to create a CustomCard component but the element into which you are trying to mount the CustomCard component does not contain any elements with a "data-cse" attribute e.g. <div data-cse="encryptedCardNumber"></div>'),this.handleOnNoDataRequired())}componentDidUpdate(){this.checkForKCPFields(),this.props.onStateUpdate?.(this.state)}componentWillUnmount(){this.csf=null,clearTimeout(this.csfLoadFailTimeout),clearTimeout(this.csfConfigFailTimeout)}initializeCSF(t){let n=this.props.loadingContext;const r={rootNode:t,type:this.props.type,componentType:this.props.componentType,clientKey:this.props.clientKey,cardGroupTypes:this.props.brands,autoFocus:this.props.autoFocus,trimTrailingSeparator:this.props.trimTrailingSeparator,loadingContext:n,keypadFix:this.props.keypadFix,showWarnings:this.props.showWarnings,iframeUIConfig:{sfStyles:this.props.styles},i18n:this.props.i18n,onSubmitAnalytics:this.props.onSubmitAnalytics,callbacks:{onLoad:this.handleOnLoad,onConfigSuccess:this.handleOnConfigSuccess,onFieldValid:this.handleOnFieldValid,onAllValid:this.handleOnAllValid,onBrand:this.handleOnBrand,onError:this.handleOnError,onFocus:this.handleFocus,onBinValue:this.props.onBinValue,onAutoComplete:this.handleOnAutoComplete,onAdditionalSFConfig:this.props.onAdditionalSFConfig,onAdditionalSFRemoved:this.props.onAdditionalSFRemoved,onTouchstartIOS:this.handleOnTouchstartIOS,onKeyDown:this.handleKeyDown},isKCP:this.state.hasKoreanFields,legacyInputMode:this.props.legacyInputMode,minimumExpiryDate:this.props.minimumExpiryDate,implementationType:this.props.implementationType||"components",forceCompat:this.props.forceCompat,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,shouldDisableIOSArrowKeys:!!this.props.disableIOSArrowKeys,placeholders:this.props.placeholders??{},showContextualElement:this.props.showContextualElement};this.csf=Gp(r),this.csfLoadFailTimeout=setTimeout(()=>{this.state.status!=="ready"&&(this.setState({status:"csfLoadFailure"}),this.props.onError(new M("ERROR","secured field iframes have failed to load")))},this.csfLoadFailTimeoutMS)}checkForKCPFields(){let t=!1;if(this.props.koreanAuthenticationRequired&&(t=this.issuingCountryCode?this.issuingCountryCode==="kr":this.props.countryCode==="kr"),this.state.hasKoreanFields&&!t){const n=r=>({data:{...r.data,[et]:void 0},valid:{...r.valid,[et]:!1},errors:{...r.errors,[et]:null},hasKoreanFields:!1});this.setState(n,()=>{this.props.onChange(this.state)}),this.csf.removeSecuredField(et),this.csf.setKCPStatus(!1)}if(!this.state.hasKoreanFields&&t){const n=r=>({valid:{...r.valid,[et]:!1},hasKoreanFields:!0,isSfpValid:!1});this.setState(n,()=>{this.props.onChange(this.state)}),this.csf.addSecuredField(et),this.csf.setKCPStatus(!0)}}getChildContext(){return{i18n:this.props.i18n}}handleUnsupportedCard(t){const n=!!t.error;return n&&this.setState({detectedUnsupportedBrands:t.detectedBrands}),t.rootNode=this.rootNode,this.handleOnError(t,n),this.csf&&this.csf.hasUnsupportedCard(H,t.error),n}setFocusOn(t){this.csf&&this.csf.setFocusOnFrame(t)}updateStyles(t){this.csf&&this.csf.updateStyles(t)}sfIsOptionalOrHidden(t){return this.csf.sfIsOptionalOrHidden(t)}destroy(){this.csf&&this.csf.destroy()}getRootNode(){return this.rootNode}showValidation(){const{numDateFields:t,state:n}=this;Object.keys(n.valid).reduce(Gh(t,n),[]).forEach(r=>{const o=Yh(r,this.rootNode,n);this.handleOnError(o,!!n.detectedUnsupportedBrands),this.csf&&this.csf.isValidated&&this.csf.isValidated(r,o.error)})}mapErrorsToValidationRuleResult(){return Object.keys(this.state.errors).reduce((t,n)=>{const r=this.state.errors[n];return t[n]=r?{isValid:!1,errorMessage:Sl(r,Mt),errorI18n:this.props.i18n.get(Dl(r,this.state.brand==="amex")),error:r,rootNode:this.rootNode,...this.state.detectedUnsupportedBrands&&{detectedBrands:this.state.detectedUnsupportedBrands}}:null,t},{})}processBinLookupResponse(t,n){if(this.state.detectedUnsupportedBrands&&(this.setState(i=>({errors:{...i.errors,[H]:null},detectedUnsupportedBrands:null})),this.csf&&t)){const i={type:"card",fieldType:"encryptedCardNumber",error:""};this.handleUnsupportedCard(i)}this.issuingCountryCode=t?.issuingCountryCode?.toLowerCase();const r=n?.brand,o=r&&Vh.includes(n.brand);o&&this.setState(n,()=>{this.props.onChange(this.state)}),this.csf&&this.csf.brandsFromBinLookup(t,o?n:null)}render(t,n){return t.render({setRootNode:this.setRootNode,setFocusOn:this.setFocusOn},n)}constructor(t){super(t),oe(this,"csfLoadFailTimeout",void 0),oe(this,"csfLoadFailTimeoutMS",void 0),oe(this,"csfConfigFailTimeout",void 0),oe(this,"csfConfigFailTimeoutMS",void 0),oe(this,"numCharsInField",void 0),oe(this,"rootNode",void 0),oe(this,"numDateFields",void 0),oe(this,"csf",void 0),oe(this,"handleOnLoad",void 0),oe(this,"handleOnConfigSuccess",void 0),oe(this,"handleOnFieldValid",void 0),oe(this,"handleOnAllValid",void 0),oe(this,"handleOnBrand",void 0),oe(this,"handleFocus",void 0),oe(this,"handleOnError",void 0),oe(this,"handleOnAutoComplete",void 0),oe(this,"handleOnNoDataRequired",void 0),oe(this,"handleOnTouchstartIOS",void 0),oe(this,"handleKeyDown",void 0),oe(this,"state",void 0),oe(this,"props",void 0),oe(this,"issuingCountryCode",void 0),oe(this,"setRootNode",r=>{this.rootNode=r});const n={status:"loading",brand:t.type,errors:{},valid:{},data:{},cvcPolicy:$t,expiryDatePolicy:Pt,isSfpValid:!1,hasKoreanFields:t.hasKoreanFields};this.state=n,this.csfLoadFailTimeout=null,this.csfLoadFailTimeoutMS=3e4,this.csfConfigFailTimeout=null,this.csfConfigFailTimeoutMS=15e3,this.numCharsInField={},this.handleOnLoad=pt.handleOnLoad.bind(this),this.handleOnConfigSuccess=pt.handleOnConfigSuccess.bind(this),this.handleOnFieldValid=pt.handleOnFieldValid.bind(this),this.handleOnAllValid=pt.handleOnAllValid.bind(this),this.handleOnBrand=pt.handleOnBrand.bind(this),this.handleFocus=pt.handleFocus.bind(this),this.handleOnError=pt.handleOnError.bind(this),this.handleOnNoDataRequired=pt.handleOnNoDataRequired.bind(this),this.handleOnAutoComplete=pt.handleOnAutoComplete.bind(this),this.handleOnTouchstartIOS=pt.handleOnTouchstartIOS.bind(this),this.handleKeyDown=pt.handleKeyDown.bind(this),this.processBinLookupResponse=this.processBinLookupResponse.bind(this),this.setFocusOn=this.setFocusOn.bind(this),this.updateStyles=this.updateStyles.bind(this),this.handleUnsupportedCard=this.handleUnsupportedCard.bind(this),this.showValidation=this.showValidation.bind(this),this.destroy=this.destroy.bind(this)}}oe(Al,"defaultProps",Zp);var uo={type:"scheme",setComponentRef:()=>{},autoFocus:!0,billingAddressAllowedCountries:[],billingAddressMode:Li.full,billingAddressRequired:!1,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},data:{billingAddress:{}},disableIOSArrowKeys:!1,enableStoreDetails:!1,exposeExpiryDate:!1,forceCompat:!1,hasHolderName:!1,holderNameRequired:!1,hasCVC:!0,hideCVC:!1,installmentOptions:{},keypadFix:!0,legacyInputMode:!1,maskSecurityCode:!1,minimumExpiryDate:null,name:null,placeholders:{},positionHolderNameOnTop:!1,showBrandIcon:!0,showInstallmentAmounts:null,styles:{},trimTrailingSeparator:!0,isPayButtonPrimaryVariant:!0,showContextualElement:!0,onLoad:e=>{},onConfigSuccess:e=>{},onAllValid:e=>{},onFieldValid:e=>{},onBrand:e=>{},onError:e=>{},onBinValue:e=>{},onBlur:e=>{},onFocus:e=>{},onChange:()=>{}};const f0=11;function y0(e){return e.replace(/\W/gi,"").replace(/(\d{3})(?!$)/g,"$1.").replace(/(.{11}).(\d{1,2})$/g,"$1-$2")}function g0(e){return e.replace(/^(\d{2})(\d{3})(\d{3})?(\d{4})?(\d{1,2})?$/g,(t,n,r,o,i="",a="")=>`${n}.${r}.${o}/${i}${a.length?`-${a}`:""}`)}function b0(e){return e.replace(/[^0-9]/g,"").trim()}function v0(e=""){if(typeof e!="string")return"";const t=b0(e);return t.length>f0?g0(t):y0(t)}function C0(e){return/(^\d{3}\.\d{3}\.\d{3}-\d{2}$)|(^\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}$)/.test(e)}const _0=(e,t,n,r)=>e[n]?.[t]?.formatterFn?null:e[n]?.[t]?.maxlength||30,en=e=>!(e!=null&&!/^[\s]*$/.test(e)),Nl="?\\+_=!@#$%^&*(){}~<>\\[\\]\\\\",tn=(e,t="g")=>new RegExp(`[${e}]`,t),w0=e=>e.trim().replace(/\s+/g," "),S0={socialSecurityNumber:v0},Il={socialSecurityNumber:[{modes:["blur"],validate:e=>en(e)?null:C0(e),errorMessage:yl}],taxNumber:[{modes:["blur"],validate:e=>en(e)?null:e?.length===6||e?.length===10,errorMessage:wi}],holderName:[{modes:["blur"],validate:e=>!en(e)||null,errorMessage:_i}],default:[{modes:["blur"],validate:e=>!!e&&typeof e=="string"&&e.trim().length>0}]},k0=(e,t)=>{const n=Il[e];return(Array.isArray(n)?n:[n]).reduce((r,o)=>(r.length||o.modes.includes(t)&&r.push(o.validate),r),[])[0]??(()=>!0)};function E0(e,t){const[n,r]=e;return{dualBrandSelectElements:[{id:n.brand,brandObject:n},{id:r.brand,brandObject:r}],selectedBrandValue:t?n.brand:"",leadBrand:n}}const ji=["cartebancaire","bcmc","dankort"],x0=(e,t)=>e.reduce((n,r)=>n||t.includes(r.brand),!1),Rl=e=>e.map(t=>({...t})),P0=(e,t="mc",n="visa")=>{const r=Rl(e);return r[0].brand!==t&&r[0].brand!==n&&r.reverse(),r.length=1,r};function T0(e,t,n,r={}){const{type:o,cvcPolicy:i}=e,{sfp:a}=t,{dualBrandSelectElements:s,setDualBrandSelectElements:l,setSelectedBrandValue:c,issuingCountryCode:d,setIssuingCountryCode:p}=n;return{processBinLookup:(h,m)=>{const f=h?.issuingCountryCode?h.issuingCountryCode.toLowerCase():null;if(p(f),!h||!Object.keys(h).length){l([]),c("");const y=m&&o!=="card"?o:null;return a.current.processBinLookupResponse(h,{brand:y,cvcPolicy:i}),void(r.current=0)}if(h.supportedBrands?.length){const y=x0(h.supportedBrands,pl),b=y?P0(h.supportedBrands):Rl(h.supportedBrands);if(b.length>1){const v=Ki(ji,b,"brand"),C=E0(b,v);l(C.dualBrandSelectElements),c(C.selectedBrandValue),a.current.processBinLookupResponse({issuingCountryCode:h.issuingCountryCode,supportedBrands:[C.leadBrand]}),C.leadBrand.panLength>0&&(r.current=C.leadBrand.panLength)}else l([]),c(""),y||c(b[0].brand),a.current.processBinLookupResponse({issuingCountryCode:h.issuingCountryCode,supportedBrands:b}),b[0].panLength>0&&(r.current=b[0].panLength)}},handleDualBrandSelection:h=>{let m=[];h&&(m=s.reduce((f,y)=>(y.brandObject.brand===h&&f.push(y.brandObject),f),[]),m.length&&(c(h),a.current.processBinLookupResponse({issuingCountryCode:d,supportedBrands:m,isDualBrandSelection:!0})))}}}function ho(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let D0=class{hasError(t=!1){return t?!this.isValid&&this.shouldValidate:this.isValid!=null&&!this.isValid&&this.shouldValidate}constructor(t,n,r,o,i){ho(this,"shouldValidate",void 0),ho(this,"isValid",void 0),ho(this,"errorMessage",void 0),ho(this,"errorI18n",void 0),this.shouldValidate=t.modes.includes(r),this.isValid=t.validate(n,o),this.errorMessage=t.errorMessage,typeof t.errorMessage=="string"?this.errorI18n=i.get(t.errorMessage):t.errorMessage&&(this.errorI18n=i.get(t.errorMessage.translationKey,t.errorMessage.translationObject))}};function zi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let A0=class{get isValid(){return this.validationResults.reduce((t,n)=>t&&n.isValid,!0)}hasError(t=!1){return!!this.getError(t)}getError(t=!1){return this.validationResults.find(n=>n.hasError(t))}getAllErrors(){return this.validationResults.filter(t=>t.hasError())}constructor(t){zi(this,"validationResults",void 0),this.validationResults=t}},N0=class{setRules(t){this.rules={...this.rules,...t}}getRulesFor(t){let n=this.rules[t]??this.rules.default;return Array.isArray(n)||(n=[n]),n}validate({key:t,value:n,mode:r="blur"},o){const i=this.getRulesFor(t).map(a=>new D0(a,n,r,o,this.i18n));return new A0(i)}constructor(t,n){zi(this,"rules",{default:{validate:()=>!0,modes:["blur","input"]}}),zi(this,"i18n",void 0),this.setRules(t),this.i18n=n}};const Sn=(e,t)=>Object.keys(e).filter(n=>!t.includes(n)).reduce((n,r)=>(n[r]=e[r],n),{}),qi=(e,t,n,r,o)=>t.reduce((i,a)=>({...i,[a]:i[a]??o?.[a]??r?.[a]??n}),e);function $l({schema:e,defaultData:t,processField:n,fieldProblems:r}){const o=a=>{if(t[a]===void 0)return{valid:!1,errors:null,data:null,fieldProblems:r?.[a]??null};const[s,l]=n({key:a,value:t[a],mode:"blur"},{state:{data:t}});return{valid:l.isValid&&!r?.[a]||!1,errors:l.hasError()?l.getError():null,data:s,fieldProblems:r?.[a]??null}},i=e.reduce((a,s)=>{const{valid:l,errors:c,data:d,fieldProblems:p}=o(s);return{valid:{...a.valid,[s]:l},errors:{...a.errors,[s]:c},data:{...a.data,[s]:d},fieldProblems:{...a.fieldProblems,[s]:p}}},{data:{},valid:{},errors:{},fieldProblems:{}});return{schema:e,data:i.data,valid:i.valid,errors:i.errors,fieldProblems:i.fieldProblems}}function I0(e){return function(t,{type:n,key:r,value:o,mode:i,schema:a,defaultData:s,formValue:l,selectedSchema:c,fieldProblems:d,data:p}){const h=c||t.schema;switch(n){case"setData":return{...t,data:{...t.data,[r]:o}};case"mergeData":return{...t,data:{...t.data,...p}};case"setValid":return{...t,valid:{...t.valid,[r]:o}};case"setErrors":return{...t,errors:{...t.errors,[r]:o}};case"setFieldProblems":return t?.schema?.reduce((m,f)=>({...m,fieldProblems:{...t.fieldProblems,[f]:d?.[f]??null},valid:{...t.valid,[f]:t.valid?.[f]&&!d[f]}}),t)??t;case"updateField":{const[m,f]=e({key:r,value:o,mode:i},{state:t}),y=t.data[r],b={...t.fieldProblems};return y!==m&&(b[r]=null),{...t,data:{...t.data,[r]:m},errors:{...t.errors,[r]:f.hasError()?f.getError():null},valid:{...t.valid,[r]:f.isValid&&!b[r]||!1},fieldProblems:b}}case"mergeForm":{const m={...t,data:{...t.data,...l.data},errors:{...t.errors,...l.errors},valid:{...t.valid,...l.valid},fieldProblems:{...t.fieldProblems,...l.fieldProblems}};return m.valid&&(m.isValid=Object.values(m.valid).every(f=>f)),m}case"setSchema":{const m=$l({schema:a,defaultData:s,processField:e,fieldProblems:d}),f=t.schema.filter(S=>!a.includes(S)),y=a.filter(S=>!t.schema.includes(S)),b={data:Sn(t.data,y),errors:Sn(t.errors,y),valid:Sn(t.valid,y)},v=qi(Sn(t.data,f),y,null,m.data,t.local?.data),C=qi(Sn(t.valid,f),y,!1,m.valid,t.local?.valid),_=qi(Sn(t.errors,f),y,null,m.errors,t.local?.errors);return{...t,schema:a,data:v,valid:C,errors:_,local:b}}case"validateForm":{const m=h.reduce((f,y)=>{const[,b]=e({key:y,value:t.data[y],mode:"blur"},{state:t});return{valid:{...f.valid,[y]:b.isValid&&!t.fieldProblems[y]||!1},errors:{...f.errors,[y]:b.hasError(!0)?b.getError(!0):null}}},{valid:t.valid,errors:t.errors});return{...t,valid:m.valid,errors:m.errors}}default:throw new Error("Undefined useForm action")}}}function or(e){const{rules:t,formatters:n,defaultData:r,fieldProblems:o,schema:i}=e,a=t??{},s=n??{},l=r??{},c=o??{},d=i??[],{i18n:p}=O(),h=te(()=>new N0(a,p),[a]),m=({key:A,value:L,mode:U},ye)=>{const Q=s?.[A],ne=(function(we){return we&&"formatterFn"in we})(Q)?Q.formatterFn:Q,be=ne&&typeof ne=="function"?ne(L??"",ye):L;return[be,h.validate({key:A,value:be,mode:U},ye)]},[f,y]=al(I0(m),{defaultData:l,schema:d,processField:m,fieldProblems:c},$l),b=te(()=>f.schema.reduce((A,L)=>A&&f.valid[L],!0),[f.schema,f.valid]),v=T((A=null)=>{y({type:"validateForm",selectedSchema:A})},[]),C=T((A,L)=>y({type:"setErrors",key:A,value:L}),[]),_=T((A,L)=>y({type:"setValid",key:A,value:L}),[]),S=T((A,L)=>y({type:"setData",key:A,value:L}),[]),x=T(A=>y({type:"mergeData",data:A}),[]),E=T(A=>y({type:"setSchema",schema:A,defaultData:l}),[f.schema]),N=T(A=>y({type:"mergeForm",formValue:A}),[]),$=T(A=>y({type:"setFieldProblems",fieldProblems:A}),[f.schema]);return R(()=>{$(c??{})},[JSON.stringify(c)]),{handleChangeFor:(A,L)=>U=>{const ye=((Q,ne)=>ne.target?ne.target.type==="checkbox"?!f.data[Q]:ne.target.value:ne)(A,U);y({type:"updateField",key:A,value:ye,mode:L})},triggerValidation:v,setSchema:E,setData:S,mergeData:x,setValid:_,setErrors:C,isValid:b,mergeForm:N,setFieldProblems:$,schema:f.schema,valid:f.valid,errors:f.errors,data:f.data,fieldProblems:f.fieldProblems}}let Ml=class{countryHasDataset(t){return!!this.specifications?.[t]?.hasDataset}countryHasOptionalField(t,n){return!!this.specifications?.[t]?.optionalFields?.includes(n)}getAddressSchemaForCountry(t){return this.specifications?.[t]?.schema||this.specifications.default.schema}getAddressLabelsForCountry(t){return this.specifications?.[t]?.labels||this.specifications.default.labels}getOptionalFieldsForCountry(t){return this.specifications?.[t]?.optionalFields||this.specifications.default?.optionalFields||[]}getKeyForField(t,n){return this.specifications?.[n]?.labels?.[t]||this.specifications?.default?.labels?.[t]||t}getPlaceholderKeyForField(t,n){return this.specifications?.[n]?.placeholders?.[t]||this.specifications?.default?.placeholders?.[t]}getAddressSchemaForCountryFlat(t){return this.getAddressSchemaForCountry(t).flat(2).filter(n=>typeof n=="string")}constructor(t){var n,r,o;o=void 0,(r="specifications")in(n=this)?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,this.specifications={...Vi,...t}}};function R0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fl={exports:{}};var Ll;function $0(){return Ll||(Ll=1,e=Fl,(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=o(i,r(s)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=o(a,s));return a}function o(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()),Fl.exports;var e}var I=R0($0());const kn=({inline:e=!1,size:t="large"})=>u("div",{"data-testid":"spinner",className:"adyen-checkout__spinner__wrapper "+(e?"adyen-checkout__spinner__wrapper--inline":"")},u("div",{className:`adyen-checkout__spinner adyen-checkout__spinner--${t}`})),Ol=Gr({srPanel:null,setSRMessagesFromObjects:null,setSRMessagesFromStrings:null,clearSRPanel:null,shouldMoveFocusSR:null});function Bl(){return Yt(Ol)}const Vl=e=>{const{srPanel:t}=Bl();R(()=>{if(t)return t.setAriaProps({"aria-relevant":"additions text"}),()=>{t.setAriaProps({"aria-relevant":t.constructor.defaultProps.ariaAttributes["aria-relevant"]})}},[t]),R(()=>{t&&e!==void 0&&t.setMessages(e)},[t,e])},M0=(e,t)=>{const{i18n:n}=O(),r=W(e);e&&(r.current=!0);const o=e?n.get("loading"):r.current?n.get("loaded"):void 0;Vl(o)},Ul=({children:e,status:t})=>{M0(t==="loading");const n=I("adyen-checkout__loading-input__form","loading-input__form",{"loading-input__form--loading":t==="loading"}),r=I({"loading-input__spinner":!0,"loading-input__spinner--active":t==="loading"});return u("div",{style:{position:"relative"}},u("div",{className:r},u(kn,null)),u("div",{className:n},e))};function F0({frontCVC:e=!1}){const t=I({"adyen-checkout__card__cvc__hint__wrapper":!0,"adyen-checkout__field__cvc--front-hint":!!e,"adyen-checkout__field__cvc--back-hint":!e});return u("span",{className:t},u("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front","data-testid":"cvc-hint-front",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},u("path",{d:"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z",fill:"#E6E9EB"}),u("rect",{x:"4",y:"12",width:"19",height:"2",fill:"#B9C4C9"}),u("rect",{x:"4",y:"4",width:"4",height:"4",rx:"1",fill:"white"}),u("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"4.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})),u("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back","data-testid":"cvc-hint-back",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},u("path",{d:"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z",fill:"#E6E9EB"}),u("path",{d:"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z",fill:"#E6E9EB"}),u("rect",{y:"4.00012",width:"27",height:"3.00001",fill:"#687282"}),u("path",{d:"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z",fill:"white"}),u("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"9.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})))}function fe(e){const{backgroundUrl:t="",className:n="",classNameModifiers:r=[],src:o="",alt:i="",showOnError:a=!1}=e,[s,l]=w(!1),c=W(null),d=()=>{l(!0)},p=I([n],"adyen-checkout__image",{"adyen-checkout__image--loaded":s},...r.map(h=>`adyen-checkout__image--${h}`));return R(()=>{const h=t?new Image:c.current;h.src=t||o,h.onload=d,l(!!h.complete)},[]),t?u("div",{"data-testid":"background",style:{backgroundUrl:t},...e,className:p}):u("img",{...e,alt:i,ref:c,className:p,onError:h=>{l(a),e?.onError?.(h)}})}const po=({type:e,className:t="",alt:n="",height:r,width:o})=>{const i=Pe(),a=i({imageFolder:"components/"})?.(e);return u(fe,{className:I("adyen-checkout__icon",t),alt:n,src:a,height:r,width:o})};let Hl=Date.now();const Wi=(e="field")=>(Hl+=1,`${e}-${Hl}`),nn="bento_",me=e=>{const{children:t,className:n,classNameModifiers:r,dir:o,disabled:i,readOnly:a,errorMessage:s,helper:l,inputWrapperModifiers:c,isLoading:d,isValid:p,label:h,labelEndAdornment:m,name:f,onBlur:y,onFieldBlur:b,onFocus:v,onFocusField:C,showValidIcon:_,useLabelElement:S,showErrorElement:x,showContextualElement:E,staticValue:N,contextualText:$,filled:A,focused:L,i18n:U,contextVisibleToScreenReader:ye,renderAlternativeToLabel:Q,onInputContainerClick:ne,errorLive:be}=e,we=ye??!0,Me=x&&typeof s=="string"&&s.length>0,Fe=E&&!Me&&$&&$.length>0,ve=W(Wi(`adyen-checkout-${f}`)),Qe=te(()=>N?`input-static-value-${Be()}`:null,[N]),[Je,F]=w(!1),[ae,de]=w(!1);L!=null&&F(!!L),A!=null&&de(!!A);const ie=T(D=>{F(!0),v?.(D)},[v]),Le=T(D=>{F(!1),y?.(D),b?.(D)},[y,b]),Xe=T(()=>u(G,null,typeof h=="string"&&u("span",{className:I({"adyen-checkout__label__text":!0,"adyen-checkout__label__text--error":s}),"data-id":f,"data-testid":f},h),typeof h=="function"&&h(),m&&u("span",{className:"adyen-checkout__label-adornment--end"},m),l&&u("span",{className:"adyen-checkout__helper-text"},l)),[h,s,m,l]),Se=T(()=>{const D=u("span",{className:I({"adyen-checkout-contextual-text--error":!0,"adyen-checkout-contextual-text--hidden":!Me}),...we&&{id:`${ve.current}${Jr}`},"aria-hidden":we?void 0:"true",...we&&be&&{"aria-live":"polite"}},s),q=u("span",{className:I({"adyen-checkout-contextual-text":!0,"adyen-checkout-contextual-text--hidden":!Fe}),...we&&{id:`${ve.current}${Xr}`},"aria-hidden":we?void 0:"true"},$);return u(G,null,u("div",{className:I(["adyen-checkout__input-wrapper",...c.map(ke=>`adyen-checkout__input-wrapper--${ke}`)]),dir:o,onClick:ne},N&&u("span",{id:Qe,className:"adyen-checkout__field-static-value"},N),qr(t).map(ke=>{const gt={isValid:p,onFocusHandler:ie,onBlurHandler:Le,isInvalid:!!s,"aria-owns":Qe,...f&&{uniqueId:ve.current},showErrorElement:x};return Nh(ke,gt)}),d&&u("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--loading"},u(kn,{size:"small"})),p&&_!==!1&&u("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--valid"},u(po,{type:`${nn}checkmark_black`,alt:U?.get("field.valid")})),s&&u("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--invalid"},u(po,{type:`${nn}field_error`,alt:U?.get("error.title")}))),D,q)},[t,s,$,d,p,ie,Le]),je=T(({onFocusField:D,focused:q,filled:ke,disabled:gt,name:un,uniqueId:hn,useLabelElement:$r,isSecuredField:ss,children:jo,renderAlternativeToLabel:jt})=>{const dt={onClick:D,className:I({"adyen-checkout__label":!0,"adyen-checkout__label--focused":q,"adyen-checkout__label--filled":ke,"adyen-checkout__label--disabled":gt})};return $r?u("label",{...dt,...!ss&&un&&{htmlFor:hn,id:`${hn}-label`}},jo):jt(dt,jo,hn)},[]);return u("div",{"data-testid":"form-field",className:I("adyen-checkout__field",n,r?.map(D=>`adyen-checkout__field--${D}`),{"adyen-checkout__field--error":s,"adyen-checkout__field--valid":p,"adyen-checkout__field--inactive":a||i})},u(je,{onFocusField:C,name:f,disabled:i,filled:ae,focused:Je,useLabelElement:S,uniqueId:ve.current,isSecuredField:!we,renderAlternativeToLabel:Q},Xe()),Se())};me.defaultProps={className:"",classNameModifiers:[],inputWrapperModifiers:[],useLabelElement:!0,showErrorElement:!0,showContextualElement:!0,renderAlternativeToLabel:()=>null};function mo(e){const t={[dl]:e.encryptedFieldType,[ul]:e["data-info"],[hl]:e.uniqueId,className:e.className};return u("span",t,e.children)}const ir=(e,t)=>u("div",{...e,"aria-hidden":"true"},t);function Kl(e){const{label:t,onFocusField:n=()=>{},errorCode:r="",className:o="",classNameModifiers:i=[],focused:a,filled:s,isValid:l,frontCVC:c=!1,cvcPolicy:d=$t,showContextualElement:p,contextualText:h}=e,{i18n:m}=O(),f=r?m.get(Dl(r,c)):"",y=I(o,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":d===Zr,"adyen-checkout__field__cvc--optional":d===Qn}),b=I({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":a,"adyen-checkout__input--valid":l}),v=d!==Qn?t:m.get("creditCard.securityCode.label.optional");return u(me,{label:v,focused:a,filled:s,classNameModifiers:[...i,"securityCode"],onFocusField:()=>n(j),className:y,errorMessage:f,isValid:l,dir:"ltr",name:j,i18n:m,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:ir,showContextualElement:p,contextualText:h,onInputContainerClick:()=>{n(j)}},u(mo,{encryptedFieldType:j,className:b}),u(F0,{frontCVC:c}))}function fo({setRef:e,...t}){const{autoCorrect:n,classNameModifiers:r,isInvalid:o,isValid:i,readonly:a=null,spellcheck:s,type:l,uniqueId:c,disabled:d}=t,p=t.className;Object.prototype.hasOwnProperty.call(t,"onChange")&&console.error("Error: Form fields that rely on InputBase may not have an onChange property");const h=T(L=>{t.onInput?.(L)},[t.onInput]),m=T(L=>{t?.onKeyDown&&t.onKeyDown(L)},[t?.onKeyDown]),f=T(L=>{if(t?.onBlurHandler?.(L),t.trimOnBlur){const U=L.target;U.value=w0(U.value)}t?.onBlur?.(L)},[t.onBlur,t.onBlurHandler]),y=T(L=>{t?.onFocusHandler?.(L)},[t.onFocusHandler]),b=I("adyen-checkout__input",[`adyen-checkout__input--${l}`],p,{"adyen-checkout__input--invalid":o,"adyen-checkout__input--valid":i},(r??[]).map(L=>`adyen-checkout__input--${L}`)),{classNameModifiers:v,uniqueId:C,isInvalid:_,isValid:S,addContextualElement:x,"aria-describedby":E,autocomplete:N,...$}=t,A=[typeof E=="string"&&E?E:null,c?`${c}${o?Jr:Xr}`:null].filter(Boolean).join(" ")||null;return u("input",{id:c,...$,autocomplete:N,"aria-required":$.required,type:l,className:b,readOnly:a,spellcheck:s,autoCorrect:n,"aria-describedby":A,"aria-invalid":o,onInput:h,onBlur:f,onFocus:y,onKeyDown:m,disabled:d,ref:e})}fo.defaultProps={type:"text",classNameModifiers:[]};function ar(e){return u(fo,{classNameModifiers:["large"],...e,"aria-required":e.required,type:"text"})}function yo({children:e,classNameModifiers:t=[],classNamesFields:n=[],label:r,readonly:o=!1,description:i,id:a,renderLabelAsSectionHeading:s=!1,descriptionId:l}){const{i18n:c}=O(),d=te(()=>Wi("fieldset-description"),[]),p=l??d;return u("fieldset",{id:a,className:I(["adyen-checkout__fieldset",...t.map(h=>`adyen-checkout__fieldset--${h}`),{"adyen-checkout__fieldset--readonly":o}])},r&&u("legend",{className:"adyen-checkout__fieldset__title"},s?u("h2",{className:"adyen-checkout__fieldset__title-heading"},c.get(r)):c.get(r)),i&&u("p",{id:p,className:"adyen-checkout__fieldset__description"},c.get(i)),u("div",{className:I("adyen-checkout__fieldset__fields",n)},e))}function L0({brand:e,hasCVC:t,onFocusField:n,errors:r,valid:o,cvcPolicy:i,focusedElement:a,lastFour:s,expiryMonth:l,expiryYear:c,showContextualElement:d}){const{i18n:p}=O(),h=`${p.get("creditCard.storedCard.description.ariaLabel").replace("%@",s)}${l&&c?` ${p.get("creditCard.expiryDate.label")} ${l}/${c}`:""}`,m=e==="amex",f=m?p.get("creditCard.securityCode.contextualText.4digits"):p.get("creditCard.securityCode.contextualText.3digits");return u("div",{className:"adyen-checkout__card__form adyen-checkout__card__form--oneClick","aria-label":h},u(yo,{classNamesFields:["adyen-checkout__card__exp-cvc"]},l&&c&&u(me,{label:p.get("creditCard.expiryDate.label"),classNameModifiers:["col-50","storedCard"],name:"expiryDateField",disabled:!0},u(ar,{name:"expiryDateField",className:"adyen-checkout__input adyen-checkout__input--disabled adyen-checkout__card__exp-date__input--oneclick",value:`${l} / ${c}`,disabled:!0,dir:"ltr",autocomplete:void 0})),t&&u(Kl,{cvcPolicy:i,errorCode:r[j],focused:a==="encryptedSecurityCode",filled:!!o.encryptedSecurityCode||!!r.encryptedSecurityCode,isValid:!!o.encryptedSecurityCode,label:p.get("creditCard.securityCode.label"),onFocusField:n,classNameModifiers:[...l&&c?["col-50","storedCard"]:["storedCard"]],frontCVC:m,showContextualElement:d,contextualText:f})))}function jl(e){const{items:t,name:n,onChange:r,value:o,isInvalid:i,uniqueId:a,ariaLabel:s,style:l="classic"}=e,{i18n:c}=O(),d=a?.replace(/[0-9]/g,"").substring(0,a.lastIndexOf("-"));return u("div",{className:I(["adyen-checkout__radio_group",`adyen-checkout__radio_group--${l}`]),role:"radiogroup",...s&&{"aria-label":s}},t.map(p=>{const h=Wi(d);return u("div",{key:p.id,className:"adyen-checkout__radio_group__input-wrapper"},u("input",{id:h,type:"radio",checked:o===p.id,className:"adyen-checkout__radio_group__input",name:n,onChange:r,onClick:r,value:p.id}),u("label",{className:I(["adyen-checkout__label__text","adyen-checkout__radio_group__label",e.className,{"adyen-checkout__radio_group__label--invalid":i}]),htmlFor:h},c.get(p.name)))}))}jl.defaultProps={onChange:()=>{},items:[],autocomplete:void 0};var Gi={tag:"Tag-module_tag__zTym4",success:"Tag-module_success__UU5x9",info:"Tag-module_info__iyn3C"},Yi=(function(e){return e.SUCCESS="success",e.INFO="info",e})({});const O0={[Yi.SUCCESS]:Gi.success,[Yi.INFO]:Gi.info},B0=({label:e,variant:t=Yi.INFO})=>u("span",{className:I(Gi.tag,O0[t])},e);var V0={tagList:"TagList-module_tagList__qCdT0"};const Zi=({tags:e,className:t})=>e?.length?u("div",{className:I(V0.tagList,t)},e.map((n,r)=>u(B0,{key:`${r}-${n.label}`,label:n.label,variant:n.variant}))):null;function U0({filterable:e,toggleButtonRef:t,showList:n,selectListId:r,readonly:o,...i}){if(e){const{id:a,...s}=i;return u("div",{...s,ref:t})}return u("button",{role:"combobox",type:"button",id:i.id,className:i.className,"aria-haspopup":"listbox","aria-expanded":n,"aria-controls":r,"aria-activedescendant":i["aria-activedescendant"]||void 0,disabled:i.disabled,"aria-disabled":o,"aria-describedby":i["aria-describedby"],"aria-labelledby":i.id?`${i.id}-label ${i.id}-value`:void 0,onClick:i.onClick,onKeyDown:i.onKeyDown,ref:t},i.children)}function H0(e){const{active:t,selected:n,inputText:r,readonly:o,showList:i,required:a}=e,s=te(()=>{const h=n.selectedOptionName||n.name;return!(typeof h=="string"&&h.trim()!=="")},[n,e.placeholder]),l=n.selectedOptionName||n.name||e.placeholder||"",c=i?r??"":l,d=h=>{h.preventDefault(),e.filterInputRef.current?.focus(),h.target===e.filterInputRef.current&&e.showList||e.toggleList(h)},p=t.id?`listItem-${t.id}`:"";return u(U0,{className:I({"adyen-checkout__dropdown__button":!0,"adyen-checkout__dropdown__button--readonly":o,"adyen-checkout__dropdown__button--active":i,"adyen-checkout__dropdown__button--invalid":e.isInvalid,"adyen-checkout__dropdown__button--valid":e.isValid,"adyen-checkout__dropdown__button--disabled":n.disabled}),disabled:e.disabled,filterable:e.filterable,readonly:o,onClick:o?null:e.filterable?d:e.toggleList,onKeyDown:o?null:e.onButtonKeyDown,toggleButtonRef:e.toggleButtonRef,id:e.id,showList:i,selectListId:e.selectListId,"aria-activedescendant":!e.filterable&&i&&p||void 0,"aria-describedby":e.ariaDescribedBy},e.filterable?u(G,null,!i&&n.icon&&u(fe,{className:"adyen-checkout__dropdown__button__icon",src:n.icon,alt:n.name}),u("input",{value:c,"aria-autocomplete":"list","aria-controls":e.selectListId,"aria-expanded":i,"aria-owns":e.selectListId,autoComplete:"off",className:I("adyen-checkout__filter-input",{"adyen-checkout__filter-input--placeholder":!i&&s}),onInput:e.onInput,ref:e.filterInputRef,role:"combobox","aria-activedescendant":p,type:"text",readOnly:e.readonly,"aria-disabled":e.readonly,id:e.id,"aria-describedby":e.ariaDescribedBy,required:a}),!i&&u(Zi,{tags:n.tags,className:"adyen-checkout__dropdown__button__tags"})):u(G,null,n.icon&&u(fe,{className:"adyen-checkout__dropdown__button__icon",src:n.icon,alt:n.name}),u("span",{id:e.id?`${e.id}-value`:void 0,className:I("adyen-checkout__dropdown__button__text",{"adyen-checkout__dropdown__button__text-placeholder":s})},l),u(Zi,{tags:n.tags,className:"adyen-checkout__dropdown__button__tags"})))}const K0=({item:e,active:t,selected:n,...r})=>u("li",{"aria-disabled":!!e.disabled,"aria-selected":n,className:I(["adyen-checkout__dropdown__element",{"adyen-checkout__dropdown__element--active":t,"adyen-checkout__dropdown__element--disabled":!!e.disabled}]),"data-disabled":e.disabled===!0||null,"data-value":e.id,onClick:r.onSelect,onMouseEnter:r.onHover,role:"option",id:`listItem-${e.id}`},u("div",{className:"adyen-checkout__dropdown__element__content"},u("div",{className:"adyen-checkout__dropdown__element__primary"},e.icon&&u(fe,{className:"adyen-checkout__dropdown__element__icon",alt:e.name,src:e.icon}),u("span",{className:"adyen-checkout__dropdown__element__text"},e.name)),e.secondaryText&&u("span",{className:"adyen-checkout__dropdown__element__secondary-text"},e.secondaryText)),u(Zi,{tags:e.tags,className:"adyen-checkout__dropdown__element__tags"}),n&&u(po,{type:`${nn}checkmark_black`,height:14,width:14}));function j0({selected:e,active:t,filteredItems:n,showList:r,...o}){const{i18n:i}=O();return u("ul",{className:I({"adyen-checkout__dropdown__list":!0,"adyen-checkout__dropdown__list--active":r}),id:o.selectListId,ref:o.selectListRef,role:"listbox"},n.length?n.map(a=>u(K0,{active:a.id===t.id,item:a,key:a.id,onSelect:o.onSelect,onHover:o.onHover,selected:a.id===e.id})):u("li",null,u("div",{className:"adyen-checkout__dropdown__element adyen-checkout__dropdown__element--no-options"},i.get("select.noOptionsFound"))))}const rt={arrowDown:"ArrowDown",arrowUp:"ArrowUp",enter:"Enter",escape:"Escape",space:" ",tab:"Tab"},z0=e=>{const t=e.parentNode,n=window.getComputedStyle(t,null),r=parseInt(n.getPropertyValue("border-top-width")),o=e.offsetTop-t.offsetTop<t.scrollTop,i=e.offsetTop-t.offsetTop+e.clientHeight-r>t.scrollTop+t.clientHeight;(o||i)&&(t.scrollTop=e.offsetTop-t.offsetTop-t.clientHeight/2-r+e.clientHeight/2)},zl=e=>{e.key!=="Enter"&&e.code!=="Enter"&&e.key!==" "&&e.code!=="Space"||e.stopPropagation()};function rn({items:e=[],className:t="",classNameModifiers:n=[],filterable:r=!0,readonly:o=!1,onChange:i=()=>{},onInput:a,selectedValue:s,name:l,isInvalid:c,isValid:d,placeholder:p,uniqueId:h,disabled:m,disableTextFilter:f,clearOnSelect:y,blurOnClose:b,onListToggle:v,required:C,additionalDescribedBy:_}){const{i18n:S}=O(),x=W(null),E=W(null),N=W(null),$=W(null),[A,L]=w(null),[U,ye]=w(!1),[Q,ne]=w(null),be=te(()=>`select-${Be()}`,[]),we=e.find(D=>D.id===s)||{},[Me,Fe]=w(),[ve,Qe]=w(we),Je=we,F=f?e:e.filter(D=>!A||D.name.toLowerCase().includes(A.toLowerCase())),ae=[h?`${h}${c?Jr:Xr}`:null,_].filter(Boolean).join(" ")||null,de=D=>{if(!D)return;const q=document.getElementById(`listItem-${D.id}`);z0(q)},ie=()=>{b&&x.current.blur(),ye(!1)},Le=()=>{ye(!0)},Xe=D=>{const q=D.currentTarget.getAttribute("data-value");return F.find(ke=>ke.id==q)},Se=D=>{let q;D.preventDefault(),q=D.currentTarget instanceof HTMLElement&&D.currentTarget.getAttribute("role")==="option"?Xe(D):ve.id&&F.some(ke=>ke.id===ve.id)?ve:A?F[0]:{id:s},q&&!q.disabled&&(i({target:{value:q.id,name:l}}),y&&Fe(null),ie())},je=D=>{switch(D.key){case rt.space:case rt.enter:Se(D);break;case rt.arrowDown:D.preventDefault(),(()=>{if(!F||F.length<1)return;const q=F.findIndex(un=>un.id===ve.id)+1,ke=q<F.length?q:0,gt=F[ke];de(gt),Qe(gt)})();break;case rt.arrowUp:D.preventDefault(),(()=>{if(!F||F.length<1)return;const q=F.findIndex(un=>un.id===ve.id)-1,ke=q<0?F.length-1:q,gt=F[ke];de(gt),Qe(gt)})()}};return R(()=>{U?Fe(null):L(null)},[U]),R(()=>{U&&r&&x.current&&x.current.focus(),v?.(U)},[U]),R(()=>{function D(q){(q.composedPath?!q.composedPath().includes(E.current):!E.current.contains(q.target))&&ie()}return document.addEventListener("click",D,!1),()=>{document.removeEventListener("click",D,!1)}},[E]),R(()=>{const D=setTimeout(()=>{F.length===0?ne(S.get("select.noOptionsFound")):ne(S.get("select.results",{values:{count:F.length}}))},500);return()=>clearTimeout(D)},[U,F.length,S]),u("div",{className:I(["adyen-checkout__dropdown",t,...n.map(D=>`adyen-checkout__dropdown--${D}`)]),ref:E},u(H0,{inputText:Me,id:h??null,active:ve,selected:Je,filterInputRef:x,filterable:r,isInvalid:c,isValid:d,onButtonKeyDown:D=>{zl(D),D.key===rt.enter&&r&&U&&A?Se(D):D.key===rt.escape?ie():![rt.arrowUp,rt.arrowDown,rt.enter].includes(D.key)&&(D.key!==rt.space||r&&U)?(D.shiftKey&&D.key===rt.tab||D.key===rt.tab)&&ie():(D.preventDefault(),U?je(D):Le())},onInput:D=>{const q=D.target.value;Fe(q),L(q),U||Le(),a&&a(q)},placeholder:p,readonly:o,selectListId:be,showList:U,toggleButtonRef:N,toggleList:D=>{D.preventDefault(),U?(Fe(Je.name),ie()):(Fe(null),Le())},disabled:m,ariaDescribedBy:ae,required:C}),u(j0,{active:ve,filteredItems:F,onHover:D=>{D.preventDefault();const q=Xe(D);Qe(q)},onSelect:Se,selected:Je,selectListId:be,selectListRef:$,showList:U}),u("div",{key:Me,role:"status","aria-live":"polite","aria-relevant":"additions text",className:"adyen-checkout__dropdown__status"},Q))}rn.defaultProps={className:"",classNameModifiers:[],filterable:!0,items:[],readonly:!1,onChange:()=>{}};const go=Gr(void 0),sr=()=>{const e=Yt(go);if(!e)throw new Error("useAmount must be used within an AmountProvider");return{amount:e.amount,isZeroAuth:e.amount?.value===0}},q0=()=>{const e=Yt(go);if(!e)throw new Error("useAmount must be used within an AmountProvider");return{secondaryAmount:e.secondaryAmount}},W0=({amount:e,secondaryAmount:t,providerRef:n,children:r})=>{const o=Yt(go),[i,a]=w(e),[s,l]=w(t);R(()=>{a(e)},[e]),Ih(n,()=>({update:(d,p)=>{a(d),l(p)}}));const c=te(()=>({amount:i,secondaryAmount:s}),[i,s]);return o?u(G,null,r):u(go.Provider,{value:c},r)};function Qi(e){const{i18n:t}=O(),{amount:n}=sr(),{brand:r,onChange:o,type:i}=e,a=e.installmentOptions[r]||e.installmentOptions.card,s=a?.values?.length===1,[l,c]=w(a?.preselectedValue||a?.values[0]),[d,p]=w("onetime"),h=a?.plans?.includes("revolving")||a?.plans?.includes("bonus"),m=te(()=>(function(v,C){return v?[{id:"onetime",name:"installments.oneTime"},{id:"installments",name:"installments.installments"},...C?.includes("revolving")?[{id:"revolving",name:"installments.revolving"}]:[],...C?.includes("bonus")?[{id:"bonus",name:"installments.bonus"}]:[]]:[]})(h,a?.plans),[h,a]),f=v=>{const C=v.target.value;c(Number(C))},y=v=>{const C=v.currentTarget.getAttribute("value");p(C)},b=v=>{let C,_;return i==="amount"?(C="installmentOption",_={count:v,values:{times:v,partialValue:(S=>t.amount(n.value/S,n.currency))(v)}}):(C="installmentOptionMonths",_={count:v,values:{times:v}}),{id:v,name:n.value?t.get(C,_):`${v}`}};return R(()=>{a?.values?.includes(l)||c(a?.preselectedValue??a?.values[0])},[r]),R(()=>{const v={value:l,...h&&d==="onetime"&&{value:1},...h&&d==="revolving"&&{value:1,plan:"revolving"},...h&&d==="bonus"&&{value:1,plan:"bonus"}};o(a?v:{value:null})},[o,h,l,a,d]),a&&n&&n.value!==0?h?u("div",{className:"adyen-checkout__installments adyen-checkout__installments--revolving-plan"},u(me,{label:t.get("installments"),classNameModifiers:["installments"],name:"installmentsPseudoLabel",useLabelElement:!1,showContextualElement:!1,renderAlternativeToLabel:ir},u(yo,{classNameModifiers:["revolving-plan"],label:""},u(jl,{items:m,onChange:y,value:d,ariaLabel:t.get("installments")}),u(me,{className:d!=="installments"?"revolving-plan-installments__disabled":"revolving-plan-installments",classNameModifiers:["revolving-plan-installments"],name:"",useLabelElement:!1,showContextualElement:!1},u(rn,{filterable:!1,items:a.values.map(b),selectedValue:l,onChange:f,name:"installments",disabled:d!=="installments"}))))):u("div",{className:"adyen-checkout__installments"},u(me,{label:t.get("installments"),classNameModifiers:["installments"],name:"installments",showContextualElement:!1},u(rn,{filterable:!1,items:a.values.map(b),selectedValue:l,onChange:f,name:"installments",readonly:s,disabled:s}))):null}Qi.defaultProps={brand:"",onChange:()=>{}};const Lt=(e,t=!1)=>{let n;try{n=new URL(e)}catch{return!1}return t&&n.protocol==="http:"||n.protocol==="https:"},Ji=["ar","bg-BG","ca-ES","cs-CZ","da-DK","de-DE","el-GR","en-US","es-ES","et-EE","fi-FI","fr-FR","hr-HR","hu-HU","is-IS","it-IT","ja-JP","ko-KR","lt-LT","lv-LV","nl-NL","no-NO","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","sv-SE","zh-CN","zh-TW"],bo="en-US",G0=2,Y0=5,Xi=e=>e.toLowerCase().substring(0,2),ql=e=>!!e&&e.length>=G0&&e.length<=Y0;function Wl(e,t){if(!e||typeof e!="string")return null;const n=e.toLowerCase(),r=t.find(i=>i.toLowerCase()===n);if(r)return r;const o=Xi(e);return t.find(i=>Xi(i)===o)||null}function Gl(e){const t=e.replace("_","-");if(/^([a-z]{2})(-)([A-Z]{2})$/.test(t))return t;const[n,r]=t.split("-");if(!n||!r)return null;const o=[n.toLowerCase(),r.toUpperCase()].join("-");return o.length===5?o:null}function Z0(e,t){if(!ql(e))return bo;const n=Gl(e);return n&&t.includes(n)?n:Wl(n||e,t)||bo}function Q0(e={}){return Object.keys(e).reduce((t,n)=>(ql(n)&&(t[Gl(n)||Xi(n)]=e[n]),t),{})}const ea=(e,t)=>e.replace(/%{(\w+)}/g,(n,r)=>t[r]||""),J0=(e,t,n={})=>{const{values:r={},count:o=0}=n,i=`${t}__plural`,a=s=>`${t}__${s}`;return Object.prototype.hasOwnProperty.call(e,a(o))?ea(e[a(o)],r):Object.prototype.hasOwnProperty.call(e,i)&&o>1?ea(e[i],r):Object.prototype.hasOwnProperty.call(e,t)?ea(e[t],r):null},X0=(e,t)=>{const n=e.split(/%#(.*?)%#/gm);if(t.length!==Math.floor(n.length/2))throw Error("The number of functions provided does not match the number of elements in the translation string.");return n.map((r,o)=>{const i=Math.floor(o/2);return o%2==0?r:t[i](r)})},em=({to:e,children:t})=>u("a",{className:"adyen-checkout-link",href:e,target:"_blank",rel:"noopener noreferrer"},t);function ta({message:e,urls:t=[]}){return u("span",{className:"adyen-checkout-disclaimer__label"},u(Yl,{message:e,urls:t}))}function Yl({message:e,urls:t}){const n=typeof e=="string",r=t.every(i=>typeof i=="string"&&Lt(i));if(!n||!r)return null;let o;try{o=X0(e,t.map(i=>function(a){return u(em,{to:i},a)}))}catch(i){o=e,console.warn(i)}return u(G,null,o)}const tm=({sfpState:e,setFocusOn:t,cvcPolicy:n,focusedElement:r,hasInstallments:o,handleInstallments:i,showAmountsInInstallments:a,showContextualElement:s,hasCVC:l,installmentOptions:c,lastFour:d,expiryMonth:p,expiryYear:h,disclaimerMessage:m})=>u(Ul,{status:e.status},u(L0,{errors:e.errors,brand:e.brand,hasCVC:l,cvcPolicy:n,onFocusField:t,focusedElement:r,valid:e.valid,lastFour:d,expiryMonth:p,expiryYear:h,showContextualElement:s}),o&&u(Qi,{brand:e.brand,installmentOptions:c,onChange:i,type:a?"amount":"months"}),m&&u(ta,{message:m.message.replace("%{linkText}",`%#${m.linkText}%#`),urls:[m.link]})),na=({src:e,alt:t,wrapperClassName:n="",imgClassName:r="",showOnError:o,as:i})=>{const[a,s]=w(!1),l=I("adyen-checkout-brand-wrapper",n,o?{}:{"adyen-checkout-brand-wrapper--error":a});return u(i??"span",{className:l,"data-testid":"brand-image-wrapper"},u(fe,{className:r,src:e,alt:t,onError:()=>s(!0)}))};function Zl({brand:e,brandsConfiguration:t}){const n=Pe(),r=e==="card",o=r?"nocard":e,i=t?.[e]?.icon??Pl(o,n);return u(na,{imgClassName:"adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon",alt:r?"":Hi(e),src:i})}var vo={dualBrandSelector:"DualBrandSelector-module_dualBrandSelector__Fz7UW",dualBrandSelectorButton:"DualBrandSelector-module_dualBrandSelectorButton__3Dxem",dualBrandSelectorButtonSelected:"DualBrandSelector-module_dualBrandSelectorButtonSelected__EswTK",dualBrandSelectorIcon:"DualBrandSelector-module_dualBrandSelectorIcon__qeN0L"};function nm({dualBrandingElements:e,brandsConfiguration:t,dualBrandingChangeHandler:n,selectedBrandValue:r}){const{i18n:o}=O(),i=p0(e,t),[a,s]=w(r);return u("div",{className:vo.dualBrandSelector,role:"group","aria-label":o.get("creditCard.dualBrand.description")},i.map(l=>u("button",{key:l.id,type:"button",className:I(vo.dualBrandSelectorButton,{[vo.dualBrandSelectorButtonSelected]:a===l.id}),onMouseDown:c=>c.preventDefault(),onClick:()=>{return c=l.id,s(c),void n(c);var c},onKeyDown:zl,"aria-label":l.altName,"aria-pressed":a===l.id},u("img",{src:l.imageURL,alt:l.altName,className:vo.dualBrandSelectorIcon}))))}function rm(e){const{i18n:t}=O(),{error:n="",isValid:r=!1,onFocusField:o=()=>{},dualBrandingElements:i,dualBrandingChangeHandler:a,brandsConfiguration:s,selectedBrandValue:l}=e,c=!!i&&Ki(ji,i,"id"),d=c?t.get("creditCard.dualBrand.description"):void 0;return u(me,{label:e.label,focused:e.focused,filled:e.filled,classNameModifiers:["cardNumber"],onFocusField:()=>o(H),errorMessage:n,isValid:r,dir:"ltr",name:H,showValidIcon:!1,i18n:t,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:ir,onInputContainerClick:()=>{o(H)},contextualText:d},u(mo,{encryptedFieldType:H,className:I({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":n,"adyen-checkout__input--focus":e.focused,"adyen-checkout__input--valid":r,"adyen-checkout__card__cardNumber__input--noBrand":!e.showBrandIcon})}),e.showBrandIcon&&!i&&u(Zl,{brandsConfiguration:e.brandsConfiguration,brand:e.brand}),i&&!n&&u("div",{className:I(["adyen-checkout__card__dual-branding__icons"])},c?u(nm,{dualBrandingElements:i,dualBrandingChangeHandler:a,brandsConfiguration:s,selectedBrandValue:l}):i.map(p=>u(Zl,{key:p.id,brand:p.id,brandsConfiguration:e.brandsConfiguration}))),u("span",{className:"adyen-checkout__card__dual-branding__sr-only","aria-live":"polite"},d))}function om(e){const{label:t,focused:n,filled:r,onFocusField:o,className:i="",classNameModifiers:a=[],error:s="",isValid:l=!1,expiryDatePolicy:c=Pt,showContextualElement:d,contextualText:p}=e,{i18n:h}=O(),m=Pe(),f=I(i,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":c===vn,"adyen-checkout__field__exp-date--optional":c===Jn}),y=c!==Jn?t:`${t} ${h.get("field.title.optional")}`;return u(me,{label:y,classNameModifiers:[...a,"expiryDate"],className:f,focused:n,filled:r,onFocusField:()=>o(z),errorMessage:s,isValid:l,dir:"ltr",name:"encryptedExpiryDate",i18n:h,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:ir,showContextualElement:d,contextualText:p,onInputContainerClick:()=>{o(z)}},u(mo,{encryptedFieldType:z,className:I("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":s,"adyen-checkout__input--focus":n,"adyen-checkout__input--valid":l})}),u(na,{wrapperClassName:s||l?I("adyen-checkout__field__exp-date_hint_wrapper","adyen-checkout__field__exp-date_hint_wrapper--hidden"):"adyen-checkout__field__exp-date_hint_wrapper",imgClassName:"adyen-checkout__field__exp-date_hint",alt:"",src:m({imageFolder:"components/"})("expiry_date_hint")}))}var En={container:"BrandIcons-module_container__FeCxK",grid:"BrandIcons-module_grid__wb0DE",smallImgGrid:"BrandIcons-module_smallImgGrid__iCMqT",remainingBrandsLabel:"BrandIcons-module_remainingBrandsLabel__v0FKS",img:"BrandIcons-module_img__Oe3i-",smallImg:"BrandIcons-module_smallImg__GwOZ0"};const im=({brandIcons:e,maxBrandsToShow:t=e.length,remainingBrandsLabel:n,className:r,containerType:o="flex",remainingBrandsLabelClassName:i,brandImageClassName:a,brandImageWrapperClassName:s,showIconOnError:l,smallIcons:c,renderBrandIcon:d,ariaHidden:p})=>{const h=te(()=>e.slice(0,t),[e,t]),m=te(()=>e.slice(t),[e,t]),f=!!n||m.length>0;return u("ul",{className:I(En.container,{[En.grid]:o==="grid",[En.smallImgGrid]:c&&o==="grid"},r),"aria-hidden":p},h.map(y=>d?d(y):u(na,{as:"li",key:y.alt,src:y.src,alt:y.alt,wrapperClassName:s,imgClassName:I(En.img,{[En.smallImg]:c},a),showOnError:l})),f&&u("li",{className:I(En.remainingBrandsLabel,i)},n||`+ ${m.length}`))},am=({brands:e,activeBrand:t})=>{if(!e?.length)return null;const n=t!=="card",r=te(()=>e.map(o=>({src:o.icon,alt:Hi(o.name)})),[e]);return u(im,{className:I("adyen-checkout__card__brands",{"adyen-checkout__card__brands--hidden":n}),brandIcons:r,smallIcons:!0,showIconOnError:!0,containerType:"grid",ariaHidden:n||void 0})};function sm({brand:e,brandsIcons:t,brandsConfiguration:n,dualBrandingElements:r,selectedBrandValue:o,dualBrandingChangeHandler:i,errors:a,focusedElement:s,hasCVC:l,cvcPolicy:c,expiryDatePolicy:d,onFocusField:p,showBrandIcon:h,valid:m,showContextualElement:f}){const{i18n:y}=O(),b=(S,x)=>{const E=S[x];return E?y.get(E):null},v=t?.filter(S=>!pl?.includes(S.name)),C=e==="amex",_=C?y.get("creditCard.securityCode.contextualText.4digits"):y.get("creditCard.securityCode.contextualText.3digits");return u("div",{className:"adyen-checkout__card__form"},u(rm,{brand:e,brandsConfiguration:n,error:b(a,H),focused:s===H,isValid:!!m.encryptedCardNumber,label:y.get("creditCard.cardNumber.label"),onFocusField:p,filled:!!a.encryptedCardNumber||!!m.encryptedCardNumber,showBrandIcon:h,dualBrandingElements:r,selectedBrandValue:o,dualBrandingChangeHandler:i}),u(am,{activeBrand:e,brands:v}),u("div",{className:I("adyen-checkout__card__exp-cvc",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":d===vn})},u(om,{classNameModifiers:["col-50"],error:b(a,z),focused:s===z,isValid:!!m.encryptedExpiryMonth&&!!m.encryptedExpiryYear,filled:!!a.encryptedExpiryDate||!!m.encryptedExpiryYear,label:y.get("creditCard.expiryDate.label"),onFocusField:p,expiryDatePolicy:d,showContextualElement:f,contextualText:y.get("creditCard.expiryDate.contextualText")}),l&&u(Kl,{classNameModifiers:["col-50"],errorCode:a[j],focused:s===j,cvcPolicy:c,isValid:!!m.encryptedSecurityCode,filled:!!a.encryptedSecurityCode||!!m.encryptedSecurityCode,label:y.get("creditCard.securityCode.label"),onFocusField:p,frontCVC:C,showContextualElement:f,contextualText:_})))}function Ql(e){return u(fo,{...e,type:"tel"})}function lm(e){const{i18n:t}=O(),n=te(()=>e.value?.length>6?t.get("creditCard.taxNumber.labelAlt"):t.get("creditCard.taxNumber.label"),[e.value]);return u("div",{className:"adyen-checkout__card__kcp-authentication"},u(me,{label:n,filled:e.filled,classNameModifiers:["kcp-taxNumber"],errorMessage:e.error&&t.get(wi),isValid:e.isValid,dir:"ltr",name:"kcpTaxNumberOrDOB",onFocus:r=>e.onFieldFocusAnalytics("taxNumber",r),onBlur:r=>e.onFieldBlurAnalytics("taxNumber",r)},u(Ql,{name:"kcpTaxNumberOrDOB",className:"adyen-checkout__card__kcp-taxNumber__input adyen-checkout__input",maxLength:10,minLength:6,autoComplete:"false",value:e.value,required:!0,onBlur:e.onBlur,onInput:e.onInput,disabled:e.disabled,placeholder:e.placeholder})),u(me,{label:t.get("creditCard.password.label"),focused:e.focusedElement==="encryptedPassword",filled:e.filled,classNameModifiers:["50","koreanAuthentication-encryptedPassword"],onFocusField:()=>e.onFocusField("encryptedPassword"),errorMessage:e.encryptedPasswordState.errors&&t.get(String(e.encryptedPasswordState.errors)),isValid:e.encryptedPasswordState.valid,dir:"ltr",name:"encryptedPassword",useLabelElement:!1,renderAlternativeToLabel:ir},u(mo,{encryptedFieldType:"encryptedPassword",className:I({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":e.encryptedPasswordState.errors,"adyen-checkout__input--valid":e.encryptedPasswordState.valid,"adyen-checkout__input--focus":e.focusedElement==="encryptedPassword"})})))}const cm=({onBlur:e,onInput:t,valid:n=!1,error:r=null,data:o="",required:i=!1,disabled:a=!1,onFieldFocusAnalytics:s=null,onFieldBlurAnalytics:l=null})=>{const{i18n:c}=O();return u(me,{label:`${c.get("boleto.socialSecurityNumber")}`,classNameModifiers:["socialSecurityNumber"],errorMessage:r&&r.errorMessage?c.get(r.errorMessage):!!r,isValid:!!n,name:"socialSecurityNumber",onFocus:d=>s?.("socialSecurityNumber",d),onBlur:d=>l?.("socialSecurityNumber",d)},u(ar,{name:"socialSecurityNumber",autocorrect:"off",spellcheck:!1,value:o,maxlength:18,onInput:t,onBlur:e,required:i,disabled:a,autocomplete:void 0}))};function ra({classNameModifiers:e=[],label:t,isInvalid:n,onChange:r,disabled:o=!1,...i}){const{uniqueId:a,showErrorElement:s,showContextualElement:l,...c}=i;return u("label",{className:"adyen-checkout__checkbox",htmlFor:a},u("input",{id:a,...c,...s&&{"aria-describedby":`${a}${Jr}`},...l&&{"aria-describedby":`${a}${Xr}`},className:I(["adyen-checkout__checkbox__input",[i.className],{"adyen-checkout__checkbox__input--invalid":n},e.map(d=>`adyen-checkout__input--${d}`)]),type:"checkbox",disabled:o,onChange:r}),u("span",{className:"adyen-checkout__checkbox__label"},t))}ra.defaultProps={onChange:()=>{}};function dm({storeDetails:e=!1,disabled:t=!1,className:n="",...r}){const{i18n:o}=O(),[i,a]=w(e);return R(()=>{r.onChange(i)},[i]),u("div",{className:I("adyen-checkout__store-details",n)},u(ra,{onChange:s=>{a(s.target.checked)},disabled:t,label:o.get("storeDetails"),name:"storeDetails"}))}const um=({data:e,label:t})=>{const{street:n,houseNumberOrName:r,city:o,postalCode:i,stateOrProvince:a,country:s}=e;return u(yo,{classNameModifiers:[t],label:t,readonly:!0},u(G,null,!!n&&n,r&&`, ${r},`,u("br",null),i&&`${i}`,o&&`, ${o}`,a&&a!==lo&&`, ${a}`,s&&`, ${s} `))},se=e=>({formatterFn:t=>t.replace(tn("^\\d","g"),"").substring(0,e),format:new Array(e).fill("9").join(""),maxlength:e}),hm=tn(Nl),oa=e=>e.replace(hm,""),pm={postalCode:{formatterFn:(e,t)=>{const n=t.state.data.country,r=ia[n]?.postalCode.formatterFn;return r?r(e):e}},street:{formatterFn:oa},houseNumberOrName:{formatterFn:oa},city:{formatterFn:oa}},ia={AT:{postalCode:se(4)},AU:{postalCode:se(4)},BE:{postalCode:se(4)},BG:{postalCode:se(4)},BR:{postalCode:{formatterFn:e=>{const t=e.replace(tn("^\\d-","g"),""),n=t.includes("-")?9:8;return t.substring(0,n)},format:"12345678 or 12345-678",maxlength:9}},CA:{postalCode:{format:"A9A 9A9 or A9A9A9",maxlength:7}},CH:{postalCode:se(4)},CY:{postalCode:se(4)},CZ:{postalCode:{format:"999 99",maxlength:6}},DE:{postalCode:se(5)},DK:{postalCode:{format:"9999",maxlength:7}},EE:{postalCode:se(5)},ES:{postalCode:se(5)},FI:{postalCode:se(5)},FR:{postalCode:se(5)},GB:{postalCode:{formatterFn:e=>e.replace(tn(Nl),"").substring(0,8),format:"AA99 9AA or A99 9AA or A9 9AA",maxlength:8}},GR:{postalCode:{format:"999 99",maxlength:6}},HR:{postalCode:{format:"[1-5]9999",maxlength:5}},HU:{postalCode:se(4)},IE:{postalCode:{format:"A99 A999",maxlength:8}},IS:{postalCode:se(3)},IT:{postalCode:se(5)},LI:{postalCode:se(4)},LT:{postalCode:{format:"9999 or 99999 or LT-99999",maxlength:8}},LU:{postalCode:se(4)},LV:{postalCode:{format:"9999 or LV-9999",maxlength:7}},MC:{postalCode:{format:"980NN",maxlength:5}},MT:{postalCode:{format:"AA99 or AAA99 or AA9999 or AAA9999",maxlength:8}},MY:{postalCode:se(5)},NL:{postalCode:{format:"9999AA",maxlength:7}},NZ:{postalCode:se(4)},NO:{postalCode:se(4)},PL:{postalCode:{formatterFn:e=>{const t=e.replace(tn("^\\d-","g"),""),n=t.includes("-")?6:5;return t.substring(0,n)},format:"99999 or 99-999",maxlength:6}},PT:{postalCode:{formatterFn:e=>e.replace(tn("^\\d-","g"),"").substring(0,8),format:"9999-999",maxlength:8}},RO:{postalCode:se(6)},SI:{postalCode:{format:"9999 or SI-9999",maxlength:7}},SE:{postalCode:se(5)},SG:{postalCode:se(6)},SK:{postalCode:{format:"99999 or SK-99999",maxlength:8}},JP:{postalCode:{format:"999-9999",maxlength:8}},US:{postalCode:{formatterFn:e=>{const t=e.replace(tn("^\\d-","g"),""),n=t.includes("-")?10:5;return t.substring(0,n)},format:"99999 or 99999-9999"}}},le=e=>({pattern:new RegExp(`\\d{${e}}`)}),Jl=(e,t,n)=>{if(t){if(en(e))return null;n.postalCode.errorMessage={translationKey:Ci,translationObject:{values:{format:ia[t]?.postalCode.format||null}}};const r=mm[t]?.pattern;return r?r.test(e):!!e}return!en(e)||null},mm={AT:le(4),AU:le(4),BE:{pattern:/(?:(?:[1-9])(?:\d{3}))/},BG:le(4),BR:{pattern:/^\d{5}-?\d{3}$/},CA:{pattern:/(?:[ABCEGHJ-NPRSTVXY]\d[A-Z][ -]?\d[A-Z]\d)/},CH:{pattern:/[1-9]\d{3}/},CY:le(4),CZ:{pattern:/\d{3}\s?\d{2}/},DE:le(5),DK:le(4),EE:le(5),ES:{pattern:/(?:0[1-9]|[1-4]\d|5[0-2])\d{3}/},FI:le(5),FR:le(5),GB:{pattern:/^([A-Za-z][A-Ha-hK-Yk-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$/},GE:le(4),GR:{pattern:/^\d{3}\s{0,1}\d{2}$/},HR:{pattern:/^([1-5])[0-9]{4}$/},HU:le(4),IE:{pattern:/(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}/},IS:le(3),IT:le(5),LI:le(4),LT:{pattern:/^(LT-\d{5}|\d{4,5})$/},LU:le(4),LV:{pattern:/^(LV-)[0-9]{4}$/},MC:{pattern:/^980\d{2}$/},MT:{pattern:/^[A-Za-z]{3}\d{4}$/},MY:le(5),NL:{pattern:/(?:NL-)?(?:[1-9]\d{3} ?(?:[A-EGHJ-NPRTVWXZ][A-EGHJ-NPRSTVWXZ]|S[BCEGHJ-NPRTVWXZ]))/},NO:le(4),PL:{pattern:/^\d{2}[-]{0,1}\d{3}$/},PT:{pattern:/^([1-9]\d{3})([- ]?(\d{3})? *)$/},RO:le(6),SI:le(4),SE:le(5),SG:le(6),SK:le(5),US:{pattern:/^\d{5}(?:-\d{4})?$/}},fm=e=>{const t={postalCode:{modes:["blur"],validate:n=>Jl(n,e,t),errorMessage:tt}};return t},ym=e=>{const t={postalCode:{modes:["blur"],validate:(n,r)=>{const o=r.state.data.country;return Jl(n,o,t)},errorMessage:tt},houseNumberOrName:{validate:(n,r)=>{const o=r.state?.data?.country;return o&&e.countryHasOptionalField(o,"houseNumberOrName")||!en(n)||null},modes:["blur"],errorMessage:tt},default:{validate:n=>!en(n)||null,modes:["blur"],errorMessage:tt}};return t};function Xl(e,t){if(e==null)throw new Error(t);return e}const gm="https://checkoutshopper-live.adyen.com/checkoutshopper/",aa=Xl("6.44.0","LIBRARY_VERSION is not defined"),ec=Xl("esm","BUNDLE_TYPE is not defined"),bm=["amount","secondaryAmount","countryCode","environment","_environmentUrls","loadingContext","i18n","modules","order","session","clientKey","showPayButton","redirectFromTopWhenInIframe","donation","onPaymentCompleted","onPaymentFailed","beforeRedirect","beforeSubmit","onSubmit","onActionHandled","onAdditionalDetails","onChange","onEnterKeyPressed","onError","onBalanceCheck","onOrderCancel","onOrderRequest","onOrderUpdated","onPaymentMethodsRequest"],vm=6e4;var sa=(function(e){return e.WEB="web",e})({});const la="web";var tc=(function(e){return e.NATIVE="nativeComponent",e.GENERIC="genericComponent",e})({});function nc(e,t){const{headers:n=[],errorLevel:r="warn",errorCode:o,loadingContext:i=gm,method:a="GET",path:s,timeout:l=vm}=e,c={method:a,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":a==="POST"?"application/json":"text/plain",...n},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(l)},...t&&{body:JSON.stringify(t)}},d=`${i}${s}`;return fetch(d,c).then(async p=>{if(p.status===204)return;const h=await p.json();if(p.ok)return h;if((function(m){return m&&m.errorCode&&m.errorType&&m.message&&m.status})(h))return void ca({message:h.message,level:r,cause:h,code:o});ca({message:e.errorMessage||`Service at ${d} is not available`,level:r,cause:h,code:o})}).catch(p=>{if(p instanceof M)throw p;ca({message:e.errorMessage||`Call to ${d} failed. Error= ${p}`,level:r,cause:p,code:o})})}function ca({message:e,level:t,cause:n,code:r}){switch(t){case"silent":break;case"info":case"warn":case"error":console[t](e);break;default:throw new M("NETWORK_ERROR",e,{cause:n,code:r})}}function rc(e,t){return nc({...e,method:"GET"},t)}function Ve(e,t){return nc({...e,method:"POST"},t)}function oc(e,t,n){return rc({loadingContext:t,errorLevel:"warn",errorMessage:`Dataset ${e} is not available`,path:n?`datasets/${e}/${n}.json`:`datasets/${e}.json`})}function Cm(e){const{classNameModifiers:t,label:n,onDropdownChange:r,readOnly:o,selectedCountry:i,specifications:a,value:s,required:l}=e,{i18n:c,loadingContext:d}=O(),[p,h]=w([]),[m,f]=w(!1);return hi(()=>{if(!i||!a.countryHasDataset(i))return h([]),void f(!0);oc(`states/${i}`,d,c.locale).then(y=>{const b=y&&y.length?y:[];h(b),f(!0)}).catch(()=>{h([]),f(!0)})},[i]),m&&p.length?u(me,{label:n,classNameModifiers:t,errorMessage:e.errorMessage,isValid:!!s,showValidIcon:!1,name:"stateOrProvince",i18n:c,readOnly:o&&!!s},u(rn,{name:"stateOrProvince",onChange:r,selectedValue:s,items:p,required:l,readonly:o&&!!s})):null}function _m(e){const{allowedCountries:t=[],classNameModifiers:n=[],errorMessage:r,onDropdownChange:o,value:i,required:a}=e,{i18n:s,loadingContext:l}=O(),[c,d]=w([]),[p,h]=w(!1),[m,f]=w(e.readOnly);return hi(()=>{oc("countries",l,s.locale).then(y=>{const b=((v,C)=>{const _=S=>({...S,name:S.name,selectedOptionName:S.name});return C.length?v.filter(S=>C.includes(S.id)).map(_):v.map(_)})(y,t);d(b||[]),f(b.length===1||m),h(!0)}).catch(y=>{console.error(y),d([]),h(!0)})},[]),p?u(me,{name:"country",label:s.get("country"),errorMessage:r,classNameModifiers:n,isValid:!!i,showValidIcon:!1,i18n:s,readOnly:m&&!!i},u(rn,{onChange:o,name:"country",selectedValue:i,items:c,readonly:m&&!!i,required:a})):null}function wm(e,t){const n=r0[e];if(n)return t==="billingAddress"?`billing ${n}`:t==="deliveryAddress"?`shipping ${n}`:n}function Sm(e){const{i18n:t}=O(),{classNameModifiers:n=[],data:r,errors:o,valid:i,fieldName:a,onInput:s,onBlur:l,trimOnBlur:c,maxLength:d,disabled:p,addressType:h}=e,m=r[a],f=r.country,y=e.specifications.countryHasOptionalField(f,a),b=e.specifications.getKeyForField(a,f),v=y?` ${t.get("field.title.optional")}`:"",C=`${t.get(b)}${v}`,_=(function(S,x,E,N){if(typeof S[x]?.errorMessage=="object"){const{translationKey:$,translationObject:A}=S[x].errorMessage;return E.get($,A)}return E.get(S[x]?.errorMessage,{values:{label:N.toLowerCase()}})||!!S[x]})(o,a,t,C);switch(a){case"country":return u(_m,{allowedCountries:e.allowedCountries,classNameModifiers:n,label:C,errorMessage:_,onDropdownChange:e.onDropdownChange,value:m,required:!y});case"stateOrProvince":return u(Cm,{classNameModifiers:n,label:C,errorMessage:_,onDropdownChange:e.onDropdownChange,selectedCountry:f,specifications:e.specifications,value:m,required:!y});default:return u(me,{label:C,classNameModifiers:n,errorMessage:_,isValid:i[a],name:a,i18n:t,onFocus:S=>e.onFieldFocusAnalytics(a,S),onBlur:S=>e.onFieldBlurAnalytics(a,S)},u(ar,{name:a,classNameModifiers:n,value:m,onInput:s,onBlur:l,maxlength:d,trimOnBlur:c,disabled:p,required:!y,autocomplete:wm(a,h)}))}}const km=300,da=(e,t=300)=>{let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}};function Em({onAddressLookup:e,onAddressSelected:t,onSelect:n,onManualAddress:r,externalErrorMessage:o,hideManualButton:i,showContextualElement:a,contextualText:s,placeholder:l,addressSearchDebounceMs:c}){const[d,p]=w([]),[h,m]=w([]),[f,y]=w(""),{i18n:b}=O(),v=T(S=>{S?.errorMessage&&y(S.errorMessage)},[]),C=T(S=>{new Promise((x,E)=>{e(S,{resolve:x,reject:E})}).then(x=>{m(x),p(x.map(({id:E,name:N})=>({id:E,name:N}))),y("")}).catch(x=>v(x))},[e]);R(()=>{y(o)},[o]);const _=te(()=>da(C,c),[]);return u("div",{className:"adyen-checkout__address-search adyen-checkout__field-group"},u(me,{label:b.get("address"),classNameModifiers:["address-search"],errorMessage:f,name:"address-search",showContextualElement:a,contextualText:s},u(rn,{name:"address-search",className:"adyen-checkout__address-search__dropdown",placeholder:l,onInput:_,items:d,onChange:S=>{if(!S.target.value)return void y(b.get("address.errors.incomplete"));const x=h.find(E=>E.id===S.target.value);if(typeof t!="function")return n(x),void p([]);new Promise((E,N)=>{t(x,{resolve:E,reject:N})}).then(E=>{n(E),p([])}).catch(E=>v(E))},disableTextFilter:!0,blurOnClose:!0})),!i&&u("span",{className:"adyen-checkout__address-search__manual-add"},u("button",{type:"button",className:"adyen-checkout__button adyen-checkout__button--inline adyen-checkout__button--link adyen-checkout__address-search__manual-add__button",onClick:r},"+ "+b.get("address.enterManually"))))}const xm=(e,t)=>e||(t==="billingAddress"||t==="deliveryAddress"?t:void 0),Pm={};function ic(e){const{i18n:t}=O(),{label:n="",requiredFields:r,visibility:o,iOSFocusedField:i=null,showContextualElement:a}=e,s=xm(e.addressType,n),l=W({});Object.keys(l.current).length||e.setComponentRef?.(l.current);const c=te(()=>new Ml(e.specifications),[e.specifications]),d=c.getAddressSchemaForCountryFlat(e.countryCode).filter(F=>r.includes(F)),[p,h]=w(!1),[m,f]=w(!1),[y,b]=w(""),v=!!e.onAddressLookup,[C,_]=w(!1),S=!e.onAddressLookup||p||m,x=e.data??Pm,E=x.country,N=E&&!d.includes(Xt)?[...d,Xt]:d,$=te(()=>E?{...x,country:E.toUpperCase()}:x,[x,E]),{data:A,errors:L,valid:U,isValid:ye,handleChangeFor:Q,triggerValidation:ne,setData:be,mergeData:we}=or({schema:N,defaultData:$,rules:{...ym(c),...e.validationRules},formatters:pm}),Me=T(F=>{const ae=co.reduce((de,ie)=>{const Le=F[ie];return Le!=null&&(de[ie]=String(Le)),de},{});we(ae),_(!0),ne(),h(!0)},[h,ne,be]),Fe=T(()=>{f(!0)},[]);l.current.showValidation=()=>{ne(),b(!v||S||ye?"":t.get("address.errors.incomplete"))};const ve=d.filter(F=>!i||F===i);if(R(()=>{if(C)return void _(!1);const F=c.countryHasDataset(A.country)?"":lo,ae={...A,stateOrProvince:F};r.forEach(de=>{Q(de,"input")(ae[de]??"")}),ae.postalCode&&Q("postalCode","blur")(A.postalCode)},[A.country]),R(()=>{const F=r.includes("stateOrProvince"),ae=A.country&&c.countryHasDataset(A.country),de=F&&ae,ie=A.stateOrProvince||(de?"":lo);Q("stateOrProvince","input")(ie)},[]),R(()=>{const F=c.getOptionalFieldsForCountry(A.country),ae=co.reduce((de,ie)=>{const Le=F.includes(ie),Xe=r.includes(ie),Se=A[ie],je=$[ie],D=Le&&!Se||!Xe?!Xe&&je?je:lo:Se;return D?.length&&(de[ie]=D),de},{});e.onChange({data:ae,valid:U,errors:L,isValid:ye})},[A,U,L,ye]),o==="hidden")return null;if(o==="readOnly")return u(um,{data:A,label:n});const Qe=(F,{classNameModifiers:ae=[]})=>r.includes(F)?u(Sm,{key:F,allowedCountries:e.allowedCountries,classNameModifiers:[...ae,F],data:A,errors:L,valid:U,fieldName:F,onInput:Q(F,"input"),onBlur:Q(F,"blur"),onDropdownChange:Q(F,"blur"),specifications:c,maxLength:_0(ia,F,A.country),trimOnBlur:!0,disabled:!ve.includes(F),addressType:s,onFieldFocusAnalytics:e.onFieldFocusAnalytics,onFieldBlurAnalytics:e.onFieldBlurAnalytics}):null,Je=c.getAddressSchemaForCountry(A.country);return u(G,null,u(yo,{classNameModifiers:[n,"address"],label:n,renderLabelAsSectionHeading:!0},v&&u(Em,{onAddressLookup:e.onAddressLookup,onAddressSelected:e.onAddressSelected,onSelect:Me,onManualAddress:Fe,externalErrorMessage:y,hideManualButton:S,showContextualElement:a,contextualText:t.get("address.search.contextualText"),addressSearchDebounceMs:e.addressSearchDebounceMs}),S&&u(G,null,Je.map(F=>F instanceof Array?u("div",{className:"adyen-checkout__field-group"},F.map(([ae,de])=>Qe(ae,{classNameModifiers:[`col-${de}`]}))):Qe(F,{})))))}ic.defaultProps={countryCode:null,validationRules:null,data:{},onChange:()=>{},visibility:"editable",requiredFields:co,specifications:{},onFieldFocusAnalytics:()=>{},onFieldBlurAnalytics:()=>{}};function Tm({onBlur:e,onInput:t,placeholder:n,value:r,required:o,error:i=!1,isValid:a,disabled:s,onFieldFocusAnalytics:l,onFieldBlurAnalytics:c}){const{i18n:d}=O();return u(me,{label:d.get("creditCard.holderName"),className:"adyen-checkout__card__holderName",errorMessage:i&&d.get(_i),isValid:!!a,name:"holderName",i18n:d,onFocus:p=>l("holderName",p),onBlur:p=>c("holderName",p)},u(ar,{name:"holderName",className:"adyen-checkout__card__holderName__input adyen-checkout__input",placeholder:n,autocomplete:"cc-name",value:r,required:o,onBlur:e,onInput:t,disabled:s}))}const Dm=({data:e,valid:t,errors:n,handleChangeFor:r,sfpState:o,setFocusOn:i,cvcPolicy:a,focusedElement:s,hasInstallments:l,handleInstallments:c,showAmountsInInstallments:d,brandsIcons:p,formData:h,formErrors:m,formValid:f,expiryDatePolicy:y,dualBrandSelectElements:b,extensions:v,selectedBrandValue:C,showKCP:_,showBrazilianSSN:S,socialSecurityNumber:x,handleOnStoreDetails:E,billingAddress:N,handleAddress:$,setAddressRef:A,partialAddressSchema:L,onAddressLookup:U,onAddressSelected:ye,addressSearchDebounceMs:Q,billingAddressRequired:ne,billingAddressRequiredFields:be,billingAddressAllowedCountries:we,billingAddressValidationRules:Me=null,brandsConfiguration:Fe,showStoreDetailsCheckbox:ve,hasCVC:Qe,hasHolderName:Je,holderNameRequired:F,installmentOptions:ae,placeholders:de,positionHolderNameOnTop:ie,showBrandIcon:Le,showContextualElement:Xe,iOSFocusedField:Se,disclaimerMessage:je,onFieldFocusAnalytics:D,onFieldBlurAnalytics:q})=>{const ke=u(Tm,{required:F,placeholder:de.holderName,value:h.holderName,error:!!m.holderName&&F,isValid:!!f.holderName,onBlur:r("holderName","blur"),onInput:r("holderName","input"),disabled:Se&&Se!=="holderName",onFieldFocusAnalytics:D,onFieldBlurAnalytics:q});return u(Ul,{status:o.status},Je&&ie&&ke,u(sm,{showBrandIcon:Le,showContextualElement:Xe,brand:o.brand??"card",brandsIcons:p,brandsConfiguration:Fe,focusedElement:s,onFocusField:i,hasCVC:Qe,cvcPolicy:a,expiryDatePolicy:y,errors:o.errors,valid:o.valid,dualBrandingElements:b.length>0&&b,dualBrandingChangeHandler:v.handleDualBrandSelection,selectedBrandValue:C}),Je&&!ie&&ke,_&&u(lm,{onFocusField:i,focusedElement:s,encryptedPasswordState:{data:o.encryptedPassword,valid:!!o.valid&&o.valid.encryptedPassword,errors:!!o.errors&&o.errors.encryptedPassword},value:e.taxNumber,error:!!n.taxNumber,isValid:!!t.taxNumber,onBlur:r("taxNumber","blur"),onInput:r("taxNumber","input"),disabled:Se&&Se!=="kcpTaxNumberOrDOB",placeholder:de.taxNumber,onFieldFocusAnalytics:D,onFieldBlurAnalytics:q}),S&&u("div",{className:"adyen-checkout__card__socialSecurityNumber"},u(cm,{onBlur:r("socialSecurityNumber","blur"),onInput:r("socialSecurityNumber","input"),error:n?.socialSecurityNumber,valid:t?.socialSecurityNumber,data:x,required:!0,disabled:Se&&Se!=="socialSecurityNumber",onFieldFocusAnalytics:D,onFieldBlurAnalytics:q})),ve&&u(dm,{onChange:E}),l&&u(Qi,{brand:o.brand,installmentOptions:ae,onChange:c,type:d?"amount":"months"}),ne&&u(ic,{label:"billingAddress",data:N,onChange:$,allowedCountries:we,requiredFields:be,setComponentRef:A,validationRules:Me,specifications:L,iOSFocusedField:Se,onAddressLookup:U,showContextualElement:Xe,onAddressSelected:ye,addressSearchDebounceMs:Q,onFieldFocusAnalytics:D,onFieldBlurAnalytics:q}),je&&u(ta,{message:je.message.replace("%{linkText}",`%#${je.linkText}%#`),urls:[je.link]}))},ac=e=>{if(e){const t=document.body.getBoundingClientRect().top,n=e.getBoundingClientRect().top-t-100;window.scrollTo({top:n,behavior:"smooth"})}},Am=(e,t,n)=>{if(e){if(ht.__IS_IOS){const r=t.current.getRootNode?.(),o=r?.querySelector(`[data-id="${n}"]`);ac(o)}_n(n)?t.current.setFocusOn(n):sc(n,t,ht.__IS_IOS)}},Nm=(e,t,n)=>r=>{e("billingAddress",r.data),t("billingAddress",r.isValid),n("billingAddress",r.errors)},Im=(e,t,n)=>r=>{e(r.currentFocusObject),r.focus===!0?t(r.fieldType,r):n(r.fieldType,r)},Rm=(e,t,n)=>()=>{e.current||(e.current=!0,Promise.resolve().then(()=>{const r=n.findIndex(i=>i===H),o=n.slice(r+1);for(const i of o){if(!_n(i)){sc(i,t,!1);break}if(!t.current.sfIsOptionalOrHidden(i)){t.current.setFocusOn(i);break}}e.current=!1}))},sc=(e,t,n)=>{e==="taxNumber"&&(e="kcpTaxNumberOrDOB");const r=t.current.getRootNode?.();e==="country"||e==="stateOrProvince"?_t(r,`.adyen-checkout__field--${e} .adyen-checkout__filter-input`)?.focus({preventScroll:n}):_t(r,`[name="${e}"]`)?.focus({preventScroll:n})};function lc(e,t,n){let r;const o=n;return e.length!==1||t||(r=e),e.length>t?.length&&(r=e.filter(({[o]:i})=>!t.some(({[o]:a})=>a===i))),r}const $m=()=>{const{i18n:e}=O();return u("p",{className:"adyen-checkout-form-instruction"},e.get("form.instruction"))};function cc(e){const t=W();return R(()=>{t.current=e},[e]),t.current}const Mm=({errors:e,props:t,isValidating:n,retrieveLayout:r,specifications:o,billingAddress:i,sfp:a})=>{const{setSRMessagesFromObjects:s,setSRMessagesFromStrings:l,clearSRPanel:c,shouldMoveFocusSR:d}=Bl(),p=s?.({fieldTypeMappingFn:l0}),h=Tl(t.billingAddressMode),[m,f]=w(null),y=cc(m),b=a.current?.mapErrorsToValidationRuleResult(),v={...e,...b};return R(()=>{try{const{billingAddress:C,..._}=v,S={..._,...C},x=p?.({errors:S,isValidating:n.current,layout:r(),countrySpecificLabels:o.getAddressLabelsForCountry(i?.country)??h?.default?.labels,hasDisplayedErrors:!!m?.length}),E=x?.currentErrorsSortedByLayout;switch(f(E),x?.action){case ml:d&&x?.fieldToFocus&&Am(n.current,a,x?.fieldToFocus),setTimeout(()=>{n.current=!1},300);break;case fl:{const N=lc(E,y,"field"),$=N?.[0];if($){const A=u0($.errorCode)?$.errorMessage:null;l(A)}else c();break}}}catch{}},[e]),{sortedErrorList:m,previousSortedErrors:y,clearSRPanel:c}},Fm=({label:e,labelPosition:t="after",ariaLabel:n,description:r,checked:o,disabled:i=!1,readonly:a=!1,onChange:s})=>{const l=te(()=>r?`toggle-description-${Be()}`:null,[r]),c=te(()=>n||(typeof e=="string"?e:null),[n,e]),d=I({"adyen-checkout-toggle--label-first":t==="before","adyen-checkout-toggle--disabled":i,"adyen-checkout-toggle--readonly":a}),p=T(h=>{s(h.target.checked)},[s]);return u("label",{className:`adyen-checkout-toggle ${d}`},u("input",{disabled:i,checked:o,onChange:p,"aria-label":c,"aria-readonly":a,"aria-describedby":l,role:"switch",type:"checkbox",className:"adyen-checkout-toggle__input"}),u("span",{"aria-hidden":!0,className:"adyen-checkout-toggle__track"},u("span",{className:"adyen-checkout-toggle__handle"},o&&u("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},u("path",{fill:"#00112C",d:"M12.0608 6.00011L11.0001 4.93945L7.00011 8.93945L5.00011 6.93945L3.93945 8.00011L7.00011 11.0608L12.0608 6.00011Z"})))),e&&u("span",{className:"adyen-checkout-toggle__label-container"},u("span",{className:"adyen-checkout-toggle__label-text","data-testid":"inner-label"},e),r&&u("span",{"data-testid":"description",className:"adyen-checkout-toggle__description",id:l},r)))};function dc(e){if(!e)return"";let t=e;return t=t.replace(/\D/g,""),t.length>3&&t.length<=6?t=t.slice(0,3)+" "+t.slice(3):t.length>6&&(t=t.slice(0,3)+" "+t.slice(3,6)+" "+t.slice(6,10)),t}const Lm=({initialValue:e,onChange:t})=>{const{i18n:n}=O(),{handleChangeFor:r,data:o}=or({schema:["mobileNumber"],defaultData:{mobileNumber:e},formatters:{mobileNumber:dc}}),i=W(null),a=T(()=>{i.current?.focus()},[i.current]);return R(()=>{t(o.mobileNumber?.replaceAll(" ",""))},[o.mobileNumber,t]),u(me,{name:"mobile-number",label:n.get("card.fastlane.mobileInputLabel"),staticValue:"+1",onInputContainerClick:a},u(Ql,{name:"mobile-number",autocorrect:"off",spellcheck:!1,maxlength:12,value:o.mobileNumber,onInput:r("mobileNumber","input"),onBlur:r("mobileNumber","blur"),setRef:i}))},Om=({rootElement:e,focusFirst:t,shouldTrap:n=!0})=>{const[r,o]=w(t);R(()=>{n&&r?.focus()},[r,n]),R(()=>{if(!n)return;const i=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),a=i[0],s=i[i.length-1];o(t||a);const l=c=>{if(c.key==="Tab"||c.keyCode===9)return c.shiftKey&&document.activeElement===a?(s.focus(),void c.preventDefault()):document.activeElement===s?(a.focus(),void c.preventDefault()):void 0};return e.addEventListener("keydown",l),()=>{o(null),e.removeEventListener("keydown",l)}},[e,t,n])},Bm=({modalElement:e,isOpen:t,isDismissible:n,focusFirst:r,focusAfterClose:o,onClose:i})=>{Om({rootElement:e,shouldTrap:t,focusFirst:r});const a=T(()=>{o.focus(),i()},[i,o]),s=T(l=>{n&&l.target instanceof HTMLElement&&!e.contains(l.target)&&a()},[a,n,e]);return R(()=>{if(!t||!e)return;const l=c=>{(c.key==="Escape"||c.key==="Esc"||c.keyCode===27)&&a()};return e.addEventListener("keydown",l),()=>e.removeEventListener("keydown",l)},[t,e,a]),{closeModal:a,handleClickOutside:s}},uc=({children:e,classNameModifiers:t=[],isOpen:n,onClose:r,isDismissible:o=!0,labelledBy:i,describedBy:a,focusFirst:s,focusAfterClose:l,...c})=>{const d=W(),{closeModal:p,handleClickOutside:h}=Bm({modalElement:d.current,isOpen:n,isDismissible:o,focusFirst:s,focusAfterClose:l,onClose:r});return R(()=>{if(!d.current)return;const m=f=>{f.key!=="Enter"&&f.code!=="Enter"||f.stopPropagation()};return d.current.addEventListener("keydown",m,{capture:!0}),()=>{d.current.removeEventListener("keydown",m)}},[d.current]),u("div",{className:I("adyen-checkout__modal-wrapper",t.map(m=>`adyen-checkout__modal-wrapper--${m}`),{"adyen-checkout__modal-wrapper--open":n}),role:"dialog","aria-labelledby":i,"aria-describedby":a,"aria-modal":"true","aria-hidden":!n,onClick:h,...c},u("div",{className:"adyen-checkout__modal",ref:d},e({onCloseModal:p})))};function Co(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ge=class extends Ne{render(){const{id:t,classNameModifiers:n=[],disabled:r,href:o,icon:i,onClickCompletedIcon:a,inline:s,label:l,ariaLabel:c,ariaLabelledBy:d,ariaDescribedBy:p,ariaExpanded:h,ariaControls:m,status:f,variant:y,buttonRef:b,onClickCompletedLabel:v,onMouseEnter:C,onMouseLeave:_,onFocus:S,onBlur:x,onKeyDown:E}=this.props,{completed:N}=this.state,{i18n:$}=O(),A=a||i?u("img",{className:"adyen-checkout__button__icon",src:this.state.completed?a??i:i,alt:"","aria-hidden":"true"}):"",L=[...n,...y==="primary"?[]:[y],...s?["inline"]:[],...N?["completed"]:[],...f==="loading"||f==="redirect"?["loading"]:[]],U=I(["adyen-checkout__button",...L.map(ne=>`adyen-checkout__button--${ne}`)]),ye={loading:u("span",{"aria-hidden":"true",className:"adyen-checkout__button__content"},u(kn,{size:"medium",inline:!0})),redirect:u("span",{"aria-hidden":"true",className:"adyen-checkout__button__content"},u(kn,{size:"medium",inline:!0}),$.get("payButton.redirecting")),default:u("span",{className:"adyen-checkout__button__content"},A,u("span",{className:"adyen-checkout__button__text"},this.state.completed?v??l:l))},Q=ye[f]||ye.default;return o?u("a",{className:U,href:o,target:this.props.target,rel:this.props.rel,"aria-disabled":r,onClick:ne=>{r&&ne.preventDefault()}},Q):u("button",{ref:b,id:t,className:U,type:"button",disabled:r,onClick:this.onClick,"aria-label":c,"aria-labelledby":d,"aria-describedby":p,"aria-expanded":h,"aria-controls":m,onMouseEnter:C,onMouseLeave:_,onKeyDown:E,onFocus:S,onBlur:x},Q,f!=="loading"&&f!=="redirect"&&this.props.children,u("span",{role:"status","aria-live":"polite",className:"adyen-checkout__button__text--sr-only"},$.get(this.buttonStatusSRLabel(f))))}constructor(...t){super(...t),Co(this,"onClick",n=>{n.preventDefault(),this.props.disabled||this.props.onClick?.(n,{complete:this.complete})}),Co(this,"complete",(n=1e3)=>{this.setState({completed:!0}),setTimeout(()=>{this.setState({completed:!1})},n)}),Co(this,"buttonStatusSRLabel",n=>({loading:"loading",redirect:"payButton.redirecting"})[n]||"")}};Co(Ge,"defaultProps",{status:"default",variant:"primary",disabled:!1,label:"",inline:!1,target:"_self"});const ua=[{headerKey:"card.fastlane.modal.benefit1.header",labelById:`adyen-fastlane-modal-label-${Be()}`,descriptionTextKey:"card.fastlane.modal.benefit1.text",describedById:`adyen-fastlane-modal-describedBy-${Be()}`,image:"fastlane_autofill",altImage:""},{headerKey:"card.fastlane.modal.benefit2.header",labelById:`adyen-fastlane-modal-label-${Be()}`,descriptionTextKey:"card.fastlane.modal.benefit2.text",describedById:`adyen-fastlane-modal-describedBy-${Be()}`,image:"fastlane_protection",altImage:""},{headerKey:"card.fastlane.modal.benefit3.header",labelById:`adyen-fastlane-modal-label-${Be()}`,descriptionTextKey:"card.fastlane.modal.benefit3.text",describedById:`adyen-fastlane-modal-describedBy-${Be()}`,image:"fastlane_ubiquity",altImage:""}],Vm=({isOpen:e,onClose:t,focusAfterClose:n})=>{const{i18n:r}=O(),o=W(),i=Pe(),a=ua.map(l=>l.labelById).join(" "),s=ua.map(l=>l.describedById).join(" ");return u(uc,{onClose:t,isOpen:e,labelledBy:a,describedBy:s,focusFirst:o.current,focusAfterClose:n},({onCloseModal:l})=>u("div",{className:"adyen-checkout-card-fastlane__modal"},u("div",{className:"adyen-checkout-card-fastlane__modal-button-container"},u(Ge,{onClick:l,inline:!0,variant:"link",ariaLabel:r.get("card.fastlane.a11y.closeDialog"),label:u(fe,{height:"10",width:"10",src:i({imageFolder:"components/"})("cross_black"),"aria-hidden":!0,alt:""})})),ua.map(c=>u("div",{key:c.labelById,className:"adyen-checkout-card-fastlane__modal-section"},u(fe,{className:"adyen-checkout-card-fastlane__modal-section-image",src:i({imageFolder:"components/"})(c.image),alt:c.altImage}),u("h1",{id:c.labelById,className:"adyen-checkout-card-fastlane__modal-section-header"},r.get(c.headerKey)),u("div",{id:c.describedById,className:"adyen-checkout-card-fastlane__modal-section-text"},r.get(c.descriptionTextKey)))),u(fe,{className:"adyen-checkout-card-fastlane__modal-brand",src:i({imageFolder:"components/"})("paypal_fastlane_black"),alt:r.get("card.fastlane.a11y.logo")})))},Um=()=>{const[e,t]=w(!1),{i18n:n}=O(),r=Pe(),o=W(),i=T(()=>{t(!1)},[]),a=T(()=>{t(!0)},[]);return u(G,null,u(Ge,{buttonRef:o,onClick:a,classNameModifiers:["fastlane-info-modal"],variant:"link",ariaLabel:n.get("card.fastlane.a11y.openDialog"),label:u(fe,{height:"14",width:"14",src:r({imageFolder:"components/"})("fastlane_info"),alt:"","aria-hidden":!0})}),u(Vm,{isOpen:e,onClose:i,focusAfterClose:o.current}))},Hm=["showConsent","defaultToggleState","termsAndConditionsLink","privacyPolicyLink","termsAndConditionsVersion","fastlaneSessionId"],Km=e=>{if(!e)return!1;Object.keys(e).forEach(s=>!Hm.includes(s)&&console.warn(`Fastlane: '${s}' is not valid Fastlane config property`));const{showConsent:t,defaultToggleState:n,termsAndConditionsLink:r,privacyPolicyLink:o,termsAndConditionsVersion:i}=e;let a=!1;return a=t?Lt(o)&&Lt(r)&&typeof t=="boolean"&&typeof n=="boolean"&&!!i:typeof t=="boolean",a||console.warn("Fastlane: Component configuration is not valid. Fastlane will not be displayed"),a},hc={[_i]:"925",[wi]:"942",[yl]:"926",[`${tt}.country`]:"930",[`${tt}.street`]:"931",[`${tt}.house_number_or_name`]:"932",[`${tt}.postal_code`]:"933",[`${tt}.city`]:"935",[`${tt}.state_or_province`]:"936",[`${Ci}.postal_code`]:"934"},jm="fetch-checkoutAttemptId-failed",zm=e=>e.replace(/[^0-9]/g,""),qm=(e,t)=>{if(e===tt||e===Ci)return hc[`${e}.${t}`]??e;let n=hc[e]??e;return isNaN(Number(n))&&(n=zm(n)),n},Wm=e=>e?["applicationInfo","checkoutAttemptId"].reduce((t,n)=>n==="applicationInfo"?(e.applicationInfo!==void 0&&(t.applicationInfo=e.applicationInfo),t):(n==="checkoutAttemptId"&&e.checkoutAttemptId!==void 0&&(t.checkoutAttemptId=e.checkoutAttemptId),t),{}):{};function $e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xn=(function(e){return e.instantPaymentButton="instant_payment_button",e.dualBrandButton="dual_brand_button",e.fastlaneSignupConsentToggle="fastlane_signup_consent_toggle",e.otherPaymentMethodButton="otherpaymentmethod_button",e.featuredIssuer="featured_issuer",e.list="list",e.listSearch="list_search",e.qrDownloadButton="qr_download_button",e.segmentedControl="segmented_control",e.cardNumber="card_number",e.expiryDate="expiry_date",e.expiryMonth="expiry_month",e.expiryYear="expiry_year",e.securityCode="security_code",e.donationAmountButton="donation_amount_button",e})({}),ge=(function(e){return e.clicked="clicked",e.rendered="rendered",e.selected="selected",e.validationError="validationError",e.focus="focus",e.unfocus="unfocus",e.configured="configured",e.displayed="displayed",e.input="input",e.download="download",e.sdkDownloadInitiated="sdkDownloadInitiated",e.sdkDownloadFailed="sdkDownloadFailed",e.sdkDownloadAborted="sdkDownloadAborted",e.sdkDownloadCompleted="sdkDownloadCompleted",e.Initialized="initialized",e.LookupStarted="lookupStarted",e.LookupUserNotFound="lookupUserNotFound",e.OtpStarted="otpStarted",e.OtpSucceeded="otpSucceeded",e.OtpCanceled="otpCanceled",e.OtpFailed="otpFailed",e.AddressSelectorClicked="addressSelectorClicked",e.AddressSelectorClosed="addressSelectorClosed",e.AddressChanged="addressChanged",e.PaymentListDisplayed="paymentListDisplayed",e})({});let Te=class extends Ni{get configDataExcludedFields(){return["paymentMethodsConfiguration","elementRef","isDropin","oneClick","storedPaymentMethodId","paymentMethodId","isInstantPayment","type","data","holderName","shopperEmail","email","telephoneNumber","clickToPayConfiguration","modules","i18n"]}createAnalyticsConfigData(t){if(!t)return{};const n={};try{for(const[r,o]of Object.entries(t))this.configDataExcludedFields.includes(r)||(typeof o=="function"?n[r]="function":Array.isArray(o)?n[r]=o.join(", ").substring(0,128):n[r]=typeof o=="object"&&o!==null?JSON.stringify(o).substring(0,128):o);return n}catch{return n}}getEventCategory(){return Qt.info}constructor(t){super(t.component),$e(this,"type",void 0),$e(this,"configData",void 0),$e(this,"target",void 0),$e(this,"issuer",void 0),$e(this,"isExpress",void 0),$e(this,"expressPage",void 0),$e(this,"isStoredPaymentMethod",void 0),$e(this,"brand",void 0),$e(this,"selectedValue",void 0),$e(this,"validationErrorCode",void 0),$e(this,"validationErrorMessage",void 0),$e(this,"presentedValues",void 0),$e(this,"availablePaymentMethods",void 0),$e(this,"unavailablePaymentMethods",void 0),$e(this,"cdnUrl",void 0),this.type=t.type,t.target&&(this.target=t.target),t.issuer&&(this.issuer=t.issuer),t.isStoredPaymentMethod!==void 0&&(this.isStoredPaymentMethod=t.isStoredPaymentMethod),t.isExpress!==void 0&&(this.isExpress=t.isExpress),t.expressPage&&(this.expressPage=t.expressPage),t.brand&&(this.brand=t.brand),t.cdnUrl&&(this.cdnUrl=t.cdnUrl),t.selectedValue&&(this.selectedValue=t.selectedValue),t.validationErrorCode&&(this.validationErrorCode=t.validationErrorCode),t.validationErrorMessage&&(this.validationErrorMessage=t.validationErrorMessage),t.presentedValues&&(this.presentedValues=t.presentedValues),t.availablePaymentMethods&&(this.availablePaymentMethods=t.availablePaymentMethods),t.unavailablePaymentMethods&&(this.unavailablePaymentMethods=t.unavailablePaymentMethods),this.type==="rendered"&&(this.configData=this.createAnalyticsConfigData(t?.configData)),this.type==="validationError"&&(this.validationErrorCode=qm(this.validationErrorCode,this.target))}};const Gm=["mc","visa"],Ym=({showConsent:e,defaultToggleState:t,termsAndConditionsLink:n,privacyPolicyLink:r,termsAndConditionsVersion:o,fastlaneSessionId:i,currentDetectedBrand:a,telephoneNumber:s,onChange:l,onSubmitAnalytics:c,type:d})=>{const p=te(()=>e&&Gm.includes(a),[e,a]),[h,m]=w(p),[f,y]=w(t),b=Pe(),[v,C]=w(""),{i18n:_}=O(),S=te(()=>Km({showConsent:e,defaultToggleState:t,termsAndConditionsLink:n,privacyPolicyLink:r,termsAndConditionsVersion:o,fastlaneSessionId:i}),[e,t,n,r,o,i]),x=T(()=>{const E=!f;y(E);const N=new Te({component:d,type:ge.clicked,target:xn.fastlaneSignupConsentToggle,configData:{isToggleOn:E}});c(N)},[f,c,d]);return R(()=>{S&&l({fastlaneData:{consentShown:h,fastlaneSessionId:i,consentGiven:!!p&&f,...o&&{consentVersion:o},...v&&{telephoneNumber:v}}})},[p,h,o,f,i,v,l,S]),R(()=>{p&&m(!0)},[p]),R(()=>{if(!S)return;const E=new Te({component:d,type:ge.rendered,configData:{isFastlaneSignupRendered:p}});c(E)},[p,S,c,d]),p&&S?u("div",{className:"adyen-checkout-card__fastlane","data-testid":"fastlane-signup-component"},u("div",{className:I("adyen-checkout-card__fastlane-consent-toggle",{"adyen-checkout-card__fastlane-consent-toggle--active":f})},u(Fm,{checked:f,onChange:x,ariaLabel:_.get("card.fastlane.consentToggle"),label:u("span",null,_.get("card.fastlane.consentToggle"))}),u(Um,null)),f&&u(G,null,u(Lm,{initialValue:dc(s),onChange:C}),u("div",{className:"adyen-checkout-card__fastlane-consent-text"},u(Yl,{message:_.get("card.fastlane.consentText"),urls:[n,r]})),u(fe,{className:"adyen-checkout-card__fastlane-brand",src:b({imageFolder:"components/"})("paypal_fastlane_black"),alt:_.get("card.fastlane.a11y.logo")}))):null},pc=e=>{const t=W(null),n=W(!1),r=Pe(),o=W(null),i=B=>{o.current=B},a=W({});Object.keys(a.current).length||e.setComponentRef(a.current);const s=W(0),l=W(!1),c=te(()=>new Ml(e.specifications),[e.specifications]),{amount:d}=sr();a.current.sfp=t;const[p,h]=w("ready"),[m,f]=w({}),[y,b]=w({...e.holderNameRequired&&{holderName:!1}}),[v,C]=w({...e.hasHolderName&&{holderName:e.data?.holderName??""}}),[_,S]=w(""),[x,E]=w(!1),[N,$]=w(Pt),[A,L]=w($t),[U,ye]=w(null),[Q,ne]=w([]),[be,we]=w(e.storedPaymentMethodId?e.brand:""),Me=e.billingAddressMode!==Li.none&&e.billingAddressRequired,Fe=Tl(e.billingAddressMode),ve=e.data?.billingAddress??null,Qe=W(Fe?ve?.country?.toUpperCase()??null:null),[Je,F]=w(!1),[ae,de]=w(Me?ve:null),[ie,Le]=w(!1),[Xe,Se]=w(""),[je,D]=w({value:null}),[q,ke]=w(null),[gt,un]=w("card"),[hn,$r]=w(!1),{handleChangeFor:ss,triggerValidation:jo,data:jt,valid:dt,errors:bt,setSchema:x4,setData:cu,setValid:du,setErrors:uu}=or({schema:[],defaultData:e.data,formatters:S0,rules:Il}),P4=m0({installmentOptions:e.installmentOptions,fundingSource:e.fundingSource,amount:d}),T4=e.showInstallmentAmounts??!0,D4=(U??e.countryCode)==="kr",Vn=!!e.configuration.koreanAuthenticationRequired&&D4,Un=ie&&e.configuration.socialSecurityNumberMode==="auto"||e.configuration.socialSecurityNumberMode==="show",hu=(B,ue)=>{e.onFocus({fieldType:B,event:ue})},pu=(B,ue)=>{e.onBlur({fieldType:B,event:ue})},A4=T(B=>{un(B.brand),e.onBrand(B)},[]),N4=Im(S,hu,pu),mu=()=>s0({props:e,showKCP:Vn,showBrazilianSSN:Un,...e.billingAddressRequired&&{countrySpecificSchemas:c.getAddressSchemaForCountry(ae?.country),billingAddressRequiredFields:e.billingAddressRequiredFields}}),I4=T(B=>{const ue=B.fieldType!=="webInternalElement"?B.fieldType:B.name;ke(ue)},[]),R4=Nm(cu,du,uu),$4=Rm(l,t,mu()),M4=T(B=>{F4(B)},[hn,$r]),F4=B=>{B.status&&(B.status=="loading"?$r(!1):$r(!0))},fu=te(()=>T0(e,{sfp:t},{dualBrandSelectElements:Q,setDualBrandSelectElements:ne,setSelectedBrandValue:we,issuingCountryCode:U,setIssuingCountryCode:ye},s),[Q,U]);a.current.showValidation=()=>{n.current=!0,O4?.(),t.current.showValidation(),jo(["holderName","socialSecurityNumber","taxNumber"]),o?.current&&o.current.showValidation()},a.current.processBinLookupResponse=(B,ue)=>{fu.processBinLookup(B,ue)},a.current.setStatus=h,R(()=>(a.current.setFocusOn=t.current.setFocusOn,a.current.updateStyles=t.current.updateStyles,a.current.handleUnsupportedCard=t.current.handleUnsupportedCard,()=>{t.current.destroy()}),[]),R(()=>{const B=[...e.hasHolderName?["holderName"]:[],...Un?["socialSecurityNumber"]:[],...Vn?["taxNumber"]:[],...Me?["billingAddress"]:[]];x4(B)},[e.hasHolderName,Un,Vn]),R(()=>{C({...v,holderName:jt.holderName??"",taxNumber:jt.taxNumber}),Se(jt.socialSecurityNumber),Me&&de({...jt.billingAddress}),b({...y,holderName:!e.holderNameRequired||dt.holderName,socialSecurityNumber:!!dt.socialSecurityNumber&&dt.socialSecurityNumber,taxNumber:!!dt.taxNumber&&dt.taxNumber,billingAddress:!!dt.billingAddress&&dt.billingAddress});const B=!!bt.billingAddress&&Object.entries(bt.billingAddress).reduce((ue,[,De])=>ue||De!=null,!1);f({...m,holderName:e.holderNameRequired&&bt.holderName?bt.holderName:null,socialSecurityNumber:Un&&bt.socialSecurityNumber?bt.socialSecurityNumber:null,taxNumber:Vn&&bt.taxNumber?bt.taxNumber:null,billingAddress:Me&&B?bt.billingAddress:null})},[jt,dt,bt]);const{sortedErrorList:ls,previousSortedErrors:L4,clearSRPanel:O4}=Mm({errors:m,props:e,isValidating:n,retrieveLayout:mu,specifications:c,billingAddress:ae,sfp:t});R(()=>{ls&&lc(ls,L4,"field")?.forEach(ue=>{const De=new Te({component:e.type,type:ge.validationError,target:Fi(ue.field),validationErrorCode:ue.errorCode,validationErrorMessage:Sl(ue.errorCode,Mt)});e.onSubmitAnalytics(De)})},[ls]),R(()=>{const B=!!y.holderName,ue=x,De=!Me||!!y.billingAddress,pn=!Vn||!!y.taxNumber&&!!y.encryptedPassword,zo=!Un||!!y.socialSecurityNumber,U4=ue&&B&&De&&pn&&zo,H4=t.current.mapErrorsToValidationRuleResult(),K4={...m,...H4};e.onChange({data:v,valid:y,errors:K4,isValid:U4,billingAddress:ae,selectedBrandValue:be,storePaymentMethod:Je,socialSecurityNumber:Xe,installments:je})},[v,y,m,be,Je,je]),R(()=>{if(Q.length>0&&Q){const B=Q.map(pn=>pn.id),ue=B[0],De=B.toString();if(Q&&Ki(ji,Q,"id")){const pn=new Te({component:e.type,type:ge.displayed,target:xn.dualBrandButton,brand:ue,configData:{dualBrands:De}});e.onSubmitAnalytics(pn)}}},[Q]);const B4=cc(be);R(()=>{if(B4?.length&&be?.length){const B=new Te({component:e.type,type:ge.selected,target:xn.dualBrandButton,brand:be});e.onSubmitAnalytics(B)}},[be]);const V4=e.storedPaymentMethodId?tm:Dm;return u(G,null,u(Al,{ref:t,...d0(e),styles:{...e.styles},koreanAuthenticationRequired:e.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!e.configuration.koreanAuthenticationRequired||e.countryCode!=="kr"),onSubmitAnalytics:e.onSubmitAnalytics,onChange:(B,ue)=>{if(B.autoCompleteName){if(!e.hasHolderName)return;const pn=k0("holderName","blur"),zo=pn?.(B.autoCompleteName,null)?B.autoCompleteName:null;return void(zo&&(cu("holderName",zo),du("holderName",!0),uu("holderName",null)))}var De;e.autoFocus&&s.current>0&&ue?.event==="handleOnFieldValid"&&ue?.fieldType===H&&B.valid.encryptedCardNumber&&$4(),C({...v,...B.data}),f({...m,...(De=B.errors,De?{encryptedCardNumber:!!De.encryptedCardNumber,encryptedExpiryDate:!!De.encryptedExpiryDate,encryptedSecurityCode:!!De.encryptedSecurityCode,encryptedPassword:!!De.encryptedPassword}:{})}),b({...y,...B.valid}),E(B.isSfpValid),L(B.cvcPolicy),Le(B.showSocialSecurityNumber),$(B.expiryDatePolicy)},onBrand:A4,onFocus:N4,onStateUpdate:M4,type:e.brand,componentType:e.type,disableIOSArrowKeys:e.disableIOSArrowKeys?I4:null,render:({setRootNode:B,setFocusOn:ue},De)=>u("div",{ref:B,className:I({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${e.fundingSource??"credit"}`]:!0,"adyen-checkout__card-input--loading":p==="loading"}),role:"form"},hn&&u($m,null),u(V4,{...c0(e),data:v,valid:y,errors:m,handleChangeFor:ss,focusedElement:_,setFocusOn:ue,sfpState:De,cvcPolicy:A,hasInstallments:P4,showAmountsInInstallments:T4,handleInstallments:D,brandsIcons:e.brandsIcons,formData:jt,formErrors:bt,formValid:dt,expiryDatePolicy:N,dualBrandSelectElements:Q,extensions:fu,selectedBrandValue:be,showKCP:Vn,showBrazilianSSN:Un,socialSecurityNumber:Xe,handleOnStoreDetails:F,setAddressRef:i,billingAddress:ae,billingAddressValidationRules:Fe&&fm(Qe.current),partialAddressSchema:Fe,handleAddress:R4,onAddressLookup:e.onAddressLookup,onAddressSelected:e.onAddressSelected,addressSearchDebounceMs:e.addressSearchDebounceMs,iOSFocusedField:q,onFieldFocusAnalytics:hu,onFieldBlurAnalytics:pu}))}),e.fastlaneConfiguration&&u(Ym,{...e.fastlaneConfiguration,currentDetectedBrand:gt,onChange:e.onChange,onSubmitAnalytics:e.onSubmitAnalytics,type:e.type}),hn&&e.showPayButton&&e.payButton({status:p,variant:e.isPayButtonPrimaryVariant?"primary":"secondary",icon:r({imageFolder:"components/"})(`${nn}lock`)}))};pc.defaultProps=uo;function _o(){if(typeof window>"u")return;const e=window.screen.colorDepth,t=window.screen.height,n=window.screen.width,r=window.navigator.userAgent;return{acceptHeader:"*/*",javaEnabled:!1,colorDepth:e,language:window.navigator.language||"en",screenHeight:t,screenWidth:n,userAgent:r,timeZoneOffset:new Date().getTimezoneOffset()}}const Zm=e=>{let t=null;return n=>{if(e.props.doBinLookup!==!1){if(n.encryptedBin&&"clientKey"in e.props&&e.props.clientKey)t=n.uuid??null,Ve({loadingContext:e.props.loadingContext,path:`v3/bin/binLookup?token=${e.props.clientKey}`},{type:"brand"in e.props?e.props.brand:g.card,supportedBrands:e.props.brands||Zn,encryptedBin:n.encryptedBin,requestId:n.uuid}).then(r=>{if(r?.requestId===t)if(r.brands?.length){const o=r.brands.reduce((a,s)=>(a.detectedBrands.push(s.brand),a.paymentMethodVariants.push(s.paymentMethodVariant),s.healthcare!==void 0&&a.healthcare.push({[s.brand]:s.healthcare}),s.supported===!0&&a.supportedBrands.push(s),a),{supportedBrands:[],detectedBrands:[],paymentMethodVariants:[],healthcare:[]}),i=o.healthcare.length>0;if(o.supportedBrands.length)return e.processBinLookupResponse({issuingCountryCode:r.issuingCountryCode??"",supportedBrands:o.supportedBrands,...r.showSocialSecurityNumber?{showSocialSecurityNumber:r.showSocialSecurityNumber}:{}}),void e.onBinLookup({type:n.type,detectedBrands:o.detectedBrands,supportedBrands:o.supportedBrands.map(a=>a.brand),paymentMethodVariants:o.paymentMethodVariants,supportedBrandsRaw:o.supportedBrands,brands:e.props.brands||Zn,issuingCountryCode:r.issuingCountryCode,...i&&{healthcare:o.healthcare}});if(o.detectedBrands.length){const a={type:"card",fieldType:"encryptedCardNumber",error:Mt.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,detectedBrands:o.detectedBrands};return e.handleUnsupportedCard(a),void e.onBinLookup({type:n.type,detectedBrands:o.detectedBrands,supportedBrands:null,paymentMethodVariants:o.paymentMethodVariants,...i&&{healthcare:o.healthcare},brands:e.props.brands||Zn})}}else e.onBinLookup({type:n.type,detectedBrands:null,supportedBrands:null,brands:e.props.brands||Zn}),e.processBinLookupResponse({},!0);else r?.requestId||e.props.onError?.(r||{errorType:"binLookup",message:"unknownError"})});else if(t){e.processBinLookupResponse(null,!0),t=null;const r={type:"card",fieldType:"encryptedCardNumber",error:""};e.handleUnsupportedCard(r),e.onBinLookup({isReset:!0})}e.props.onBinValue&&e.props.onBinValue(n)}else e.props.onBinValue&&e.props.onBinValue(n)}},Qm="https://sandbox-assets.secure.checkout.visa.com/checkout-widget/resources/js/src-i-adapter/visa-sdk.js?v2",Jm="https://assets.secure.checkout.visa.com/checkout-widget/resources/js/src-i-adapter/visa-sdk.js?v2",Xm="https://sandbox.src.mastercard.com/sdk/srcsdk.mastercard.js",e1="https://src.mastercard.com/sdk/srcsdk.mastercard.js",t1=({dpaLocale:e="en_US",dpaPresentationName:t=""})=>({dpaTransactionOptions:{dpaLocale:e,payloadTypeIndicator:"NON_PAYMENT",customInputData:{checkoutOrchestrator:"merchant"}},dpaData:{dpaPresentationName:t}}),n1=({dpaLocale:e="en_US",dpaPresentationName:t=""})=>({dpaTransactionOptions:{dpaLocale:e,paymentOptions:{dynamicDataType:"CARD_APPLICATION_CRYPTOGRAM_SHORT_FORM"},consumerNameRequested:!0,customInputData:{"com.mastercard.dcfExperience":"PAYMENT_SETTINGS"},confirmPayment:!1},dpaData:{dpaPresentationName:t}});function lr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ce=class extends Error{toString(){return`Reason: ${this.reason} / Source: ${this.source} / Scheme: ${this.scheme} / Message: ${this.message}`}constructor(t,n,r){super(),lr(this,"reason",void 0),lr(this,"message",void 0),lr(this,"source",void 0),lr(this,"scheme",void 0),lr(this,"errorFromCardSchemeSdk",void 0);const o="error"in t?t?.error?.message:t?.message,i="error"in t?t?.error?.reason:t?.reason;this.message=o,this.reason=i,this.source=n,this.scheme=r,this.errorFromCardSchemeSdk=t}};function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let cr=class cs{removeScript(){this.cleanupListeners(),this.script?.parentNode?.removeChild(this.script),this.script=null}cleanupListeners(){this.script&&(this.script.removeEventListener("load",this.handleOnLoad),this.script.removeEventListener("error",this.handleOnError))}attachListeners(){this.script&&(this.cleanupListeners(),this.script.addEventListener("load",this.handleOnLoad),this.script.addEventListener("error",this.handleOnError))}loadScript(){return new Promise((t,n)=>{const r=document.querySelector(this.node);r?(this.resolveLoadScript=t,this.rejectLoadScript=n,this.script=r.querySelector(`script[src="${this.src}"]`),this.script?.getAttribute("data-script-loaded")?this.resolveLoadScript():this.script?this.attachListeners():(this.script=document.createElement("script"),Object.assign(this.script,this.attributes),Object.assign(this.script.dataset,this.dataAttributes),this.script.src=this.src,this.script.async=!0,this.attachListeners(),r.appendChild(this.script))):n(new M("SCRIPT_ERROR",`Unable to find script container node: ${this.node}`))})}trackEvent(t){const n=new Te({type:t,component:this.component,cdnUrl:this.baseUrl});this.analytics?.sendAnalytics(n)}constructor({src:t,component:n,node:r="body",attributes:o,dataAttributes:i,analytics:a}){_e(this,"src",void 0),_e(this,"component",void 0),_e(this,"node",void 0),_e(this,"attributes",void 0),_e(this,"dataAttributes",void 0),_e(this,"analytics",void 0),_e(this,"baseUrl",void 0),_e(this,"script",void 0),_e(this,"loadPromise",null),_e(this,"rejectLoadPromise",null),_e(this,"resolveLoadScript",null),_e(this,"rejectLoadScript",null),_e(this,"handleOnLoad",()=>{this.script?.setAttribute("data-script-loaded","true"),this.cleanupListeners(),this.resolveLoadScript?.()}),_e(this,"handleOnError",s=>{this.cleanupListeners();const l=new M("SCRIPT_ERROR",`Unable to load script ${this.src}.${s?.message&&`Message: ${s.message}`}`,{cause:s?.error||s});this.rejectLoadScript?.(l)}),_e(this,"load",()=>(this.loadPromise!==null||(this.loadPromise=new Promise((s,l)=>{this.rejectLoadPromise=l;let c=0;this.trackEvent(ge.sdkDownloadInitiated);const d=async()=>{try{c++,await this.loadScript(),this.trackEvent(ge.sdkDownloadCompleted),s()}catch(p){if(this.loadPromise===null)return;this.trackEvent(ge.sdkDownloadFailed),this.removeScript(),c<cs.MAX_NUMBER_OF_RETRIES?setTimeout(()=>{d()},cs.RETRY_DELAY):(this.trackEvent(ge.sdkDownloadAborted),this.loadPromise=null,this.rejectLoadPromise=null,l(p))}};d()})),this.loadPromise)),_e(this,"remove",()=>{this.rejectLoadPromise?.(new M("CANCEL","Script loading cancelled.")),this.removeScript(),this.loadPromise=null}),this.src=t,this.component=n,this.node=r,this.attributes=o,this.dataAttributes=i,this.analytics=a,this.baseUrl=(function(s){const l=new URL(s);return l.origin+l.pathname})(this.src)}};_e(cr,"RETRY_DELAY",1e3),_e(cr,"MAX_NUMBER_OF_RETRIES",3);function dr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let mc=class{async loadSdkScript(){this.isSdkIsAvailableOnWindow()||(this.scriptElement=new cr({src:this.sdkUrl,component:"clicktopay",analytics:this.analytics}),await this.scriptElement.load()),this.assignSdkReference()}removeSdkScript(){this.scriptElement.remove()}async checkout(t){try{return await this.schemeSdk.checkout(t)}catch(n){throw new Ce(n,"checkout",this.schemeName)}}async unbindAppInstance(){try{await this.schemeSdk.unbindAppInstance()}catch(t){throw new Ce(t,"unbindAppInstance",this.schemeName)}}async isRecognized(){try{return await this.schemeSdk.isRecognized()}catch(t){throw new Ce(t,"isRecognized",this.schemeName)}}async initiateIdentityValidation(){try{return await this.schemeSdk.initiateIdentityValidation()}catch(t){throw new Ce(t,"initiateIdentityValidation",this.schemeName)}}async getSrcProfile(t){try{return await this.schemeSdk.getSrcProfile({idTokens:t})}catch(n){throw new Ce(n,"getSrcProfile",this.schemeName)}}constructor(t,n,r){if(dr(this,"schemeSdk",void 0),dr(this,"customSdkConfiguration",void 0),dr(this,"analytics",void 0),dr(this,"sdkUrl",void 0),dr(this,"scriptElement",null),!t)throw Error("AbstractSrcInitiator: Invalid SDK URL");this.sdkUrl=t,this.customSdkConfiguration=n,this.analytics=r}};const r1={email:"EMAIL",telephoneNumber:"MOBILE_NUMBER"};let o1=class extends mc{isSdkIsAvailableOnWindow(){return!!window.vAdapters?.VisaSRCI}assignSdkReference(){this.schemeSdk=new window.vAdapters.VisaSRCI}async init(t,n){try{const r={...t,...t1(this.customSdkConfiguration),srciTransactionId:n};await this.schemeSdk.init(r);const o=document.getElementById("vcop-src-system-frame");o?.setAttribute("aria-hidden","true"),o?.setAttribute("tabindex","-1"),o?.setAttribute("inert","")}catch(r){throw new Ce(r,"init",this.schemeName)}}async identityLookup({identityValue:t,type:n}){try{const r={identityValue:t,type:r1[n]};return await this.schemeSdk.identityLookup(r)}catch(r){throw new Ce(r,"identityLookup",this.schemeName)}}async completeIdentityValidation(t){try{return await this.schemeSdk.completeIdentityValidation(t)}catch(n){throw new Ce(n,"completeIdentityValidation",this.schemeName)}}constructor(t,n,r){var o,i,a;super(t.toLowerCase().includes("live")?Jm:Qm,n,r),a="visa",(i="schemeName")in(o=this)?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a}};const i1={email:"EMAIL_ADDRESS",telephoneNumber:"MOBILE_PHONE_NUMBER"};let a1=class extends mc{isSdkIsAvailableOnWindow(){return!!window.SRCSDK_MASTERCARD}assignSdkReference(){this.schemeSdk=window.SRCSDK_MASTERCARD}async init(t,n){try{const r={...t,...n1(this.customSdkConfiguration),srciTransactionId:n};await this.schemeSdk.init(r)}catch(r){throw new Ce(r,"init",this.schemeName)}}async identityLookup({identityValue:t,type:n}){try{const r={identityValue:t,identityType:i1[n]};return await this.schemeSdk.identityLookup({consumerIdentity:r})}catch(r){throw new Ce(r,"identityLookup",this.schemeName)}}async completeIdentityValidation(t){try{return await this.schemeSdk.completeIdentityValidation({validationData:t})}catch(n){throw new Ce(n,"completeIdentityValidation",this.schemeName)}}constructor(t,n,r){var o,i,a;super(t.toLowerCase().includes("live")?e1:Xm,n,r),a="mc",(i="schemeName")in(o=this)?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a}};const fc=e=>e.status==="fulfilled",yc=e=>e.status==="rejected";function gc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bc={visa:o1,mc:a1,default:null};let s1=class{async load(t,n){if(!this.schemes||this.schemes.length===0)throw new M("ERROR","ClickToPay -> SrcSdkLoader: There are no schemes set to be loaded");return new Promise((r,o)=>{const i=this.schemes.map(s=>((l,c,d,p)=>{const h=bc[l]||bc.default;return h?new h(c,d,p):null})(s,t,this.customSdkConfiguration,n)),a=i.map(s=>s.loadSdkScript());Promise.allSettled(a).then(s=>{s.every(yc)&&o(new M("ERROR",`ClickToPay -> SrcSdkLoader # Unable to load network schemes: ${this.schemes.toString()}`));const l=i.filter((c,d)=>fc(s[d]));r(l)})})}constructor(t,{dpaLocale:n="en_US",dpaPresentationName:r=""}){gc(this,"schemes",void 0),gc(this,"customSdkConfiguration",void 0),this.schemes=t,this.customSdkConfiguration={dpaLocale:n,dpaPresentationName:r}}};const wo={mc:"Mastercard",visa:"Visa"};function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let l1=class{get title(){return this.scheme==="visa"?wo[this.scheme]:this.descriptorName||wo[this.scheme]}get isDcfPopupEmbedded(){return this.scheme==="mc"}confirmCardIsExpired(){if(!["ACTIVE","PENDING"].includes(this.status))return!0;if(!this.panExpirationYear&&!this.panExpirationMonth)return!1;const[t,n]=[new Date().getMonth()+1,new Date().getFullYear()];return!(Number(this.panExpirationYear)>n)&&!(Number(this.panExpirationYear)===n&&Number(this.panExpirationMonth)>=t)}constructor(t,n,r){Ye(this,"dateOfCardLastUsed",void 0),Ye(this,"dateOfCardCreated",void 0),Ye(this,"panLastFour",void 0),Ye(this,"srcDigitalCardId",void 0),Ye(this,"scheme",void 0),Ye(this,"artUri",void 0),Ye(this,"srcCorrelationId",void 0),Ye(this,"tokenId",void 0),Ye(this,"isExpired",void 0),Ye(this,"panExpirationMonth",void 0),Ye(this,"panExpirationYear",void 0),Ye(this,"descriptorName",void 0),Ye(this,"status",null),this.dateOfCardLastUsed=t.dateOfCardLastUsed,this.dateOfCardCreated=t.dateOfCardCreated,this.panLastFour=t.panLastFour,this.srcDigitalCardId=t.srcDigitalCardId,this.descriptorName=t.digitalCardData.descriptorName,this.tokenId=t.tokenId,this.scheme=n,this.artUri=t.digitalCardData.artUri,this.srcCorrelationId=r,this.panExpirationMonth=t.panExpirationMonth,this.panExpirationYear=t.panExpirationYear,this.status=t.digitalCardData.status,this.isExpired=this.confirmCardIsExpired()}};const vc="ctpIframe";function c1(e,t,n){const{scheme:r,tokenId:o,srcDigitalCardId:i,srcCorrelationId:a}=e;return r==="visa"?o?{srcScheme:r,srcCorrelationId:a,srcTokenReference:n.toLowerCase().includes("live")?o:"987654321"}:{srcScheme:r,srcCheckoutPayload:t.checkoutResponse,srcCorrelationId:a}:{srcScheme:r,srcDigitalCardId:i,srcCorrelationId:a}}function d1(e,t){const{profiles:n,srcCorrelationId:r}=t,o=n.reduce((i,a)=>[...i,...a.maskedCards.map(s=>new l1(s,t.scheme,r))],[]);return[...e,...o]}function Cc(e,t){return new Date(t.dateOfCardLastUsed).getTime()-new Date(e.dateOfCardLastUsed).getTime()}function u1(e,t){return new Date(t.dateOfCardCreated).getTime()-new Date(e.dateOfCardCreated).getTime()}function h1(e,t){return t.isExpired?e.expiredCards.push(t):e.availableCards.push(t),e}function p1(e,t){return t.dateOfCardLastUsed?e.usedCards.push(t):e.unusedCards.push(t),e}function m1(e){const t=e.reduce(d1,[]),{availableCards:n,expiredCards:r}=t.reduce(h1,{availableCards:[],expiredCards:[]}),{unusedCards:o,usedCards:i}=n.reduce(p1,{unusedCards:[],usedCards:[]});return[...i.sort(Cc),...o.sort(u1),...r.sort(Cc)]}function ha(e){return!!e.reason}function So(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Pn=class extends Error{setCorrelationId(t){this.correlationId=t}toString(){return this.message}constructor(t){super(`ClickToPayService - Timeout during ${t.source}() of the scheme '${t.scheme}'`),So(this,"scheme",void 0),So(this,"source",void 0),So(this,"isTimeoutTriggeredBySchemeSdk",void 0),So(this,"correlationId",void 0),this.name="TimeoutError",this.source=t.source,this.scheme=t.scheme,this.isTimeoutTriggeredBySchemeSdk=t.isTimeoutTriggeredBySchemeSdk}};function pa(e,t,n){let r=null;return Promise.race([e(),(o=t,new Promise((i,a)=>{r=setTimeout(()=>a(n),o)}))]).then(i=>(clearTimeout(r),i)).catch(i=>{throw clearTimeout(r),i});var o}function Ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ce=(function(e){return e.Idle="Idle",e.Loading="Loading",e.ShopperIdentified="ShopperIdentified",e.OneTimePassword="OneTimePassword",e.Ready="Ready",e.Login="Login",e.NotAvailable="NotAvailable",e})({});let f1=class{get shopperAccountFound(){return["Ready","ShopperIdentified"].includes(this.state)}get schemes(){return this.sdkLoader.schemes}updateStoreCookiesConsent(t){this.storeCookies=t}async initialize(){this.setState("Loading");try{this.sdks=await this.sdkLoader.load(this.environment,this.analytics),await this.initiateSdks();const{recognized:t=!1,idTokens:n=null}=await this.verifyIfShopperIsRecognized();if(t)return await this.getShopperProfile(n),void this.setState("Ready");if(!this.shopperIdentity)return void this.setState("NotAvailable");const{isEnrolled:r}=await this.verifyIfShopperIsEnrolled(this.shopperIdentity);if(r)return void this.setState("ShopperIdentified");this.setState("NotAvailable")}catch(t){t instanceof Ce&&t?.reason==="REQUEST_TIMEOUT"||t instanceof Pn?this.handleTimeout(t):t instanceof Ce?console.warn(`Error at ClickToPayService # init: ${t.toString()}`):console.warn(t),this.setState("NotAvailable")}}subscribeOnStateChange(t){this.stateSubscriber=t}async startIdentityValidation(){if(!this.validationSchemeSdk)throw Error("startIdentityValidation: No ValidationSDK set for the validation process");try{const{maskedValidationChannel:t}=await this.validationSchemeSdk.initiateIdentityValidation();this.identityValidationData={maskedShopperContact:t.replace(/\*/g,"•"),selectedNetwork:wo[this.validationSchemeSdk.schemeName]},this.setState("OneTimePassword")}catch(t){throw this.validationSchemeSdk=null,t}}async finishIdentityValidation(t){if(!this.validationSchemeSdk)throw Error("finishIdentityValidation: No ValidationSDK set for the validation process");const n=await this.validationSchemeSdk.completeIdentityValidation(t);await this.getShopperProfile([n.idToken]),this.setState("Ready"),this.validationSchemeSdk=null}async checkout(t){if(!t)throw Error("ClickToPayService # checkout: Missing card data");const n=this.sdks.find(o=>o.schemeName===t.scheme),r=await n.checkout({srcDigitalCardId:t.srcDigitalCardId,srcCorrelationId:t.srcCorrelationId,...t.isDcfPopupEmbedded&&{windowRef:window.frames[vc]},...this.storeCookies&&{complianceSettings:{complianceResources:[{complianceType:"REMEMBER_ME",uri:""}]}}});if(r.dcfActionCode!=="COMPLETE")throw new M("ERROR",`Checkout through Scheme DCF did not complete. DCF Action code received: ${r.dcfActionCode}`);return c1(t,r,this.environment)}async logout(){if(!this.sdks)throw new M("ERROR","ClickToPayService is not initialized");try{const t=this.sdks.map(n=>n.unbindAppInstance());await Promise.all(t)}catch(t){t instanceof Ce?console.warn(`Error at ClickToPayService # logout: ${t.toString()}`):console.warn(t)}this.shopperCards=null,this.identityValidationData=null,this.validationSchemeSdk=null,this.setState("Login")}verifyIfShopperIsEnrolled(t){const{shopperEmail:n}=t;return new Promise((r,o)=>{const i=this.sdks.map(a=>pa(()=>a.identityLookup({identityValue:n,type:"email"}),5e3,new Pn({source:"identityLookup",scheme:a.schemeName,isTimeoutTriggeredBySchemeSdk:!1})).then(s=>{s.consumerPresent&&!this.validationSchemeSdk&&(this.setSdkForPerformingShopperIdentityValidation(a),r({isEnrolled:!0}))}).catch(s=>{o(s)}));Promise.allSettled(i).then(()=>{r({isEnrolled:!1})})})}setState(t){this.state=t,this.stateSubscriber?.(this.state)}setSdkForPerformingShopperIdentityValidation(t){this.validationSchemeSdk=t}handleTimeout(t){const n=t instanceof Ce?new Pn({source:t.source,scheme:t.scheme,isTimeoutTriggeredBySchemeSdk:!0}):t;n.scheme==="visa"&&(n.setCorrelationId(window.VISA_SDK?.correlationId),window.VISA_SDK?.correlationId?window.VISA_SDK?.buildClientProfile?.():window.VISA_SDK?.buildClientProfile?.(this.schemesConfig.visa.srciDpaId)),this.onTimeout?.(n)}async getShopperProfile(t){return new Promise((n,r)=>{const o=this.sdks.map(i=>i.getSrcProfile(t));Promise.allSettled(o).then(i=>{i.every(yc)&&r(i[0].reason);const a=i.map((s,l)=>fc(s)&&{...s.value,scheme:this.sdks[l].schemeName}).filter(s=>!!s);this.shopperCards=m1(a),n()})})}verifyIfShopperIsRecognized(){return new Promise((t,n)=>{const r=this.sdks.map(o=>pa(()=>o.isRecognized(),5e3,new Pn({source:"isRecognized",scheme:o.schemeName,isTimeoutTriggeredBySchemeSdk:!1})).then(i=>{i.recognized&&t(i)}).catch(i=>{n(i)}));Promise.allSettled(r).then(()=>{t({recognized:!1})})})}initiateSdks(){const t=this.sdks.map(n=>{const r=this.schemesConfig[n.schemeName];return pa(()=>n.init(r,this.srciTransactionId),5e3,new Pn({source:"init",scheme:n.schemeName,isTimeoutTriggeredBySchemeSdk:!1}))});return Promise.all(t)}constructor(t,n,r,o,i,a){Ue(this,"sdkLoader",void 0),Ue(this,"schemesConfig",void 0),Ue(this,"shopperIdentity",void 0),Ue(this,"environment",void 0),Ue(this,"analytics",void 0),Ue(this,"onTimeout",void 0),Ue(this,"srciTransactionId",Be()),Ue(this,"sdks",void 0),Ue(this,"validationSchemeSdk",null),Ue(this,"stateSubscriber",void 0),Ue(this,"state","Idle"),Ue(this,"shopperCards",null),Ue(this,"identityValidationData",null),Ue(this,"storeCookies",!1),this.sdkLoader=n,this.schemesConfig=t,this.shopperIdentity=i,this.environment=r,this.onTimeout=a,this.analytics=o}};function y1(e,t,n,r){const o=b1(e);if(!o)return null;const i=g1(t?.shopperEmail,t?.telephoneNumber),a=Object.keys(o),s=new s1(a,{dpaLocale:t?.locale,dpaPresentationName:t?.merchantDisplayName});return new f1(o,s,n,r,i,t?.onTimeout)}const g1=(e,t)=>{const n={...e&&{shopperEmail:e}};return Object.keys(n).length>0?n:null},b1=e=>{if(!e)return null;const{visaSrciDpaId:t,visaSrcInitiatorId:n,mcDpaId:r,mcSrcClientId:o}=e,i={...r&&o&&{mc:{srciDpaId:r,srcInitiatorId:o}},...t&&n&&{visa:{srciDpaId:t,srcInitiatorId:n}}};return Object.keys(i).length===0?null:i},_c=Gr({status:null,onSubmit:null,onSetStatus:null,onError:null,onReady:null,configuration:null,isStandaloneComponent:null,isCtpPrimaryPaymentMethod:null,isStoringCookies:!1,setIsCtpPrimaryPaymentMethod:null,logoutShopper:null,updateStoreCookiesConsent:null,ctpState:null,cards:[],schemes:[],otpMaskedContact:null,otpNetwork:null,checkout:null,verifyIfShopperIsEnrolled:null,startIdentityValidation:null,finishIdentityValidation:null}),v1=({isStandaloneComponent:e=!1,clickToPayService:t,configuration:n,children:r,setClickToPayRef:o,onSubmit:i,onSetStatus:a,onError:s})=>{const[l]=w(t),[c,d]=w(t?.state||ce.NotAvailable),[p,h]=w(!0),[m,f]=w("ready"),y=W(!1),b=W({setStatus:f});R(()=>{o(b.current)},[]),R(()=>{l?.subscribeOnStateChange($=>d($))},[l]);const v=T(()=>{y.current||(n.onReady?.(),y.current=!0)},[n?.onReady]),C=T(async $=>{await l?.finishIdentityValidation($)},[l]),_=T(async()=>await l?.startIdentityValidation(),[l]),S=T(async $=>await l?.checkout($),[l]),x=T(async $=>await l?.verifyIfShopperIsEnrolled($),[l]),E=T(async()=>{await l?.logout()},[l]),N=T($=>{l.updateStoreCookiesConsent($)},[l]);return u(_c.Provider,{value:{status:m,onSubmit:i,onError:s,onSetStatus:a,configuration:n,isStoringCookies:l?.storeCookies,isStandaloneComponent:e,isCtpPrimaryPaymentMethod:p,setIsCtpPrimaryPaymentMethod:h,ctpState:c,verifyIfShopperIsEnrolled:x,cards:l?.shopperCards,schemes:l?.schemes,otpMaskedContact:l?.identityValidationData?.maskedShopperContact,otpNetwork:l?.identityValidationData?.selectedNetwork,checkout:S,logoutShopper:E,startIdentityValidation:_,finishIdentityValidation:C,updateStoreCookiesConsent:N,onReady:v}},r)};function ot(){return Yt(_c)}const C1={otp:{validate:e=>!!e&&e.length>0,errorMessage:"field.error.required",modes:["blur"]},default:{validate:e=>!!e&&e.length>0,errorMessage:"field.error.required",modes:["blur"]}},_1=({onError:e,onResendCode:t,disabled:n})=>{const[r,o]=w(null),[i,a]=w(!1),{i18n:s}=O(),{startIdentityValidation:l}=ot(),[c,d]=w(null);Vl(c),R(()=>{let h;return r>0&&(h=setTimeout(()=>o(r-1),1e3)),r===60?d(`${s.get("ctp.otp.resendCode")} - ${r}s`):r===0&&d(s.get("ctp.otp.resendCode")),()=>clearTimeout(h)},[r]),R(()=>{let h;return i&&(h=setTimeout(()=>{a(!1),o(60)},2e3)),()=>clearTimeout(h)},[i]);const p=T(async h=>{h.preventDefault();try{t(),a(!0),await l()}catch(m){if(o(0),a(!1),!ha(m))return void console.error(m);e(m.reason)}},[l,e,t]);return i?u("div",{role:"alert",className:"adyen-checkout-ctp__otp-resend-code--confirmation"},s.get("ctp.otp.codeResent"),u(po,{type:`${nn}checkmark_black`,height:14,width:14})):r>0?u("div",{role:"timer",className:"adyen-checkout-ctp__otp-resend-code--disabled"},s.get("ctp.otp.resendCode")," -"," ",u("span",{className:"adyen-checkout-ctp__otp-resend-code-counter"}," ",r>0&&`${r}s`," ")):u(Ge,{classNameModifiers:[I("otp-resend-code",{"otp-resend-code--disabled":n})],onClick:p,variant:"link",inline:!0,disabled:n},s.get("ctp.otp.resendCode"))},ma=(e,t,n="")=>{const r=e instanceof Element?e:_t(document,e);let o;o=_t(r,t==="country"||t==="stateOrProvince"||t==="issuer-list"||t==="selectedAccountType"?`${n}.adyen-checkout__field--${t} .adyen-checkout__filter-input`:`${n} [name="${t}"]`),ht.__IS_IOS&&ac(o),o?.focus({preventScroll:ht.__IS_IOS})};function w1(e){return{focusFirstError:T((t,n)=>{const r=(function(i){return i&&typeof i=="object"&&"current"in i?i.current??void 0:i})(e);if(!r)return;const o=n.find(i=>t[i]);o&&ma(r,o)},[e])}}function wc(e){const{formHolder:t,...n}=e,r=or(n),{focusFirstError:o}=w1(t),i=W(!1),a=T((s=null)=>{i.current=!0,r.triggerValidation(s)},[r.triggerValidation]);return R(()=>{i.current&&(i.current=!1,o(r.errors,r.schema))},[r.errors]),{...r,triggerValidation:a}}const S1=(e,t,n,r=!0)=>{if(t?.errorMessage&&typeof t.errorMessage=="string"){const o=t.errorMessage,i=[tt,jh].includes(o),a={values:{label:r?n?.toLowerCase():n}};return i?e.get(o,a):e.get(o)}return!!t},k1=e=>{const{i18n:t}=O(),{configuration:{disableOtpAutoFocus:n}}=ot(),[r,o]=w(null),i=W(null),{handleChangeFor:a,data:s,triggerValidation:l,valid:c,errors:d,isValid:p,setData:h}=wc({schema:["otp"],rules:C1,formHolder:i}),m=W({validateInput:null}),f=W(null),[y,b]=w(!1),v=T(()=>{b(!0),l()},[l]);R(()=>{s.otp&&b(!0)},[s.otp]),R(()=>{!n&&f.current&&f.current.focus()},[f.current,n]),R(()=>{i.current&&e.errorMessage&&ma(i.current,"otp")},[e.errorMessage]),R(()=>{m.current.validateInput=v,e.onSetInputHandlers(m.current)},[v,e.onSetInputHandlers]);const C=T(()=>{h("otp",""),o(null),n||f.current.focus(),e.onResendCode()},[e.onResendCode,f.current,n]),_=T(E=>{const N=t.get(`ctp.errors.${E}`);N&&o(N)},[t]),S=T(E=>{E.key==="Enter"&&e.onPressEnter()},[e.onPressEnter]);R(()=>{e.onChange({data:s,valid:c,errors:d,isValid:p})},[s,c,d]);const x=T(()=>y?r||e.errorMessage||S1(t,d.otp,t.get("ctp.otp.fieldLabel")):null,[y,r,e.errorMessage,d.otp,t]);return u("div",{ref:i,className:"adyen-checkout-ctp__otp-field-wrapper"},u(me,{name:"oneTimePassword",label:t.get("ctp.otp.fieldLabel"),errorMessage:x(),classNameModifiers:["otp"],errorLive:!0},u(ar,{name:"otp",autocorrect:"off",spellcheck:!1,value:s.otp,disabled:e.disabled,onInput:a("otp","input"),onBlur:a("otp","blur"),onKeyDown:S,setRef:E=>{f.current=E},autocomplete:"off"})),u("div",{className:"adyen-checkout-ctp__otp-resend-code-wrapper"},u(_1,{disabled:e.isValidatingOtp,onError:_,onResendCode:C})))},Sc=({classNameModifiers:e=[]})=>{const t=Pe(),{schemes:n}=ot(),r=t()("ctp"),o=t({imageFolder:"components/"})("pipe");return u("div",{className:I("adyen_checkout-ctp__brand-wrapper",e.map(i=>`adyen_checkout-ctp__brand-wrapper--${i}`))},u(fe,{className:"adyen_checkout-ctp__brand-logo",src:r,alt:"Logo of Click to Pay"}),u(fe,{className:"adyen_checkout-ctp__brand-pipe",src:o,alt:""}),n.map(i=>u(fe,{key:i,className:I("adyen_checkout-ctp__brand-scheme",`adyen_checkout-ctp__brand-scheme-${i}`),src:t()(i),alt:`Logo of ${wo[i]}`})))};let kc=Date.now();function Ec(){return kc+=1,`adyen-${kc}`}const E1=({isOpen:e,onClose:t,focusAfterClose:n})=>{const r=W(),{i18n:o}=O(),i=Pe(),a=Ec(),s=Ec();return u(uc,{onClose:t,isOpen:e,classNameModifiers:["ctp"],labelledBy:a,describedBy:s,focusFirst:r.current,focusAfterClose:n},({onCloseModal:l})=>u(G,null,u(fe,{className:"adyen-checkout__ctp-modal-header-image",src:i({imageFolder:"components/"})("ctp_landscape"),alt:""}),u("h2",{id:a,className:"adyen-checkout__ctp-modal-title"},o.get("ctp.infoPopup.title")),u("div",{id:s},u("p",{tabIndex:-1,ref:r,className:"adyen-checkout__ctp-modal-text"},o.get("ctp.infoPopup.subtitle")),u("ul",{className:"adyen-checkout__ctp-modal-text adyen-checkout__ctp-modal-benefits"},u("li",null,o.get("ctp.infoPopup.benefit1")),u("li",null,o.get("ctp.infoPopup.benefit2")),u("li",null,o.get("ctp.infoPopup.benefit3"))),u(Sc,{classNameModifiers:["popup"]})),u(Ge,{onClick:l,label:o.get("close")})))},xc=()=>{const[e,t]=w(!1),n=W(),{i18n:r}=O(),o=Pe()({imageFolder:"components/"})("info"),i=T(()=>{t(!1)},[]),a=T(()=>{t(!0)},[]);return u(G,null,u("button",{ref:n,onClick:a,className:"adyen-web__ctp-info-button","aria-label":r.get("ctp.aria.infoModalButton"),type:"button"},u(fe,{height:"15",src:o,"aria-hidden":!0})),u(E1,{isOpen:e,onClose:i,focusAfterClose:n.current}))},x1=()=>{const{ctpState:e,logoutShopper:t,status:n,cards:r}=ot(),{i18n:o}=O();if([ce.Ready,ce.OneTimePassword].includes(e)===!1)return null;const i=te(()=>e===ce.Ready&&r.length>1?o.get("ctp.logout.notYourCards"):e===ce.Ready&&r.length===1?o.get("ctp.logout.notYourCard"):e===ce.Ready&&r.length===0?o.get("ctp.logout.notYourProfile"):o.get("ctp.logout.notYou"),[o,e]);return u(Ge,{classNameModifiers:[I("section-logout-button",{"section-logout-button--disabled":n==="loading"})],disabled:n==="loading",onClick:t,variant:"link",inline:!0},i)},Ot=({children:e,onEnterKeyPress:t})=>{const{isStandaloneComponent:n}=ot();return u("div",{className:I("adyen-checkout-ctp__section",{"adyen-checkout-ctp__section--standalone":n}),onKeyDown:t},u("div",{className:"adyen-checkout-ctp__section-brand"},u(Sc,null),u(x1,null)),e)};Ot.Title=({endAdornment:e,children:t})=>u("div",{className:"adyen-checkout-ctp__section-header"},u("h1",{className:"adyen-checkout-ctp__section-header-title"},t),e&&u("span",{className:"adyen-checkout-ctp__section-header-adornment"},e)),Ot.Text=({children:e})=>u("p",{className:"adyen-checkout-ctp__section-text"},e);const P1=()=>window.matchMedia("(max-width: 480px)").matches;function T1(){const{i18n:e}=O(),{updateStoreCookiesConsent:t,isStoringCookies:n}=ot(),[r,o]=w(n),[i,a]=w(P1()),s=T(()=>{const l=!r;o(l),t(l)},[t,o,r]);return u("div",{className:I("adyen-checkout-ctp__otp-checkbox-container",{"adyen-checkout-ctp__otp-checkbox-container--checked":r})},u(me,{classNameModifiers:["consentCheckbox"],name:"clickToPayCookiesCheckbox",showContextualElement:!1,useLabelElement:!1,i18n:e},u(ra,{name:"clickToPayCookiesCheckbox",onInput:s,label:e.get("ctp.otp.saveCookiesCheckbox.label"),checked:r,"aria-describedby":"adyen-ctp-cookies-info"})),u("p",{className:"adyen-checkout-ctp__otp-checkbox-info"},i?u(G,null,u("span",{id:"adyen-ctp-cookies-info"},e.get("ctp.otp.saveCookiesCheckbox.shorterInfo")," "),u("button",{className:"adyen-checkout-ctp__otp-readmore-button",onClick:()=>a(!1)},e.get("readMore"),"..")):u("span",{id:"adyen-ctp-cookies-info"},e.get("ctp.otp.saveCookiesCheckbox.information"))))}const D1=({onDisplayCardComponent:e})=>{const{i18n:t}=O(),{finishIdentityValidation:n,otpMaskedContact:r,otpNetwork:o,isCtpPrimaryPaymentMethod:i}=ot(),[a,s]=w(null),[l,c]=w(!1),[d,p]=w(!1),[h,m]=w(null),[f,y]=w(null),[b,v]=w(!1),C=T($=>{y($)},[]),_=T(({data:$,isValid:A})=>{s($.otp),c(A)},[]),S=T(()=>{m(null)},[]),x=T(async()=>{if(m(null),l){p(!0);try{await n(a)}catch($){if(!ha($))return void p(!1);m($?.reason),p(!1),$?.reason==="ACCT_INACCESSIBLE"&&(v(!0),e?.())}}else f.validateInput()},[a,l,f,e]),E=T($=>{$.key==="Enter"&&x()},[x]),N=t.get("ctp.otp.subtitle").split("%@");return u(G,null,u(Ot.Title,{endAdornment:u(xc,null)},t.get("ctp.otp.title")),u(Ot.Text,null,N[0]," ",o," ",N[1],u("span",{className:"adyen-checkout-ctp__otp-subtitle--highlighted"},r),N[2]),u(k1,{hideResendOtpButton:b,onChange:_,onSetInputHandlers:C,disabled:d,errorMessage:h&&t.get(`ctp.errors.${h}`),onPressEnter:x,onResendCode:S,isValidatingOtp:d}),u(T1,null),u(Ge,{disabled:b,label:t.get("continue"),variant:i?"primary":"secondary",onClick:x,status:d&&"loading",onKeyDown:E}))},A1=({card:e,errorMessage:t})=>{const{i18n:n}=O(),r=Pe(),o=e.artUri||r()(e.scheme);return u(G,null,u("div",{className:"adyen-checkout-ctp__card-list-single-card"},u(fe,{src:o,height:24,className:"adyen-checkout-ctp__card-image"}),u("span",{className:I({"adyen-checkout-ctp__card-list-single-card-expired":e.isExpired})},e.title," ",`•••• ${e.panLastFour}`),e.isExpired&&u("span",{className:"adyen-checkout-ctp__expired-label"},n.get("ctp.cards.expiredCard"))),t&&u("div",{className:"adyen-checkout-contextual-text--error"},t))},Pc=(e,t)=>t?.value&&t?.currency?e.amount(t.value,t.currency,{currencyDisplay:t.currencyDisplay||"symbol"}):"",Tc=e=>{const t=e.get("payAmountFormat"),n=t.indexOf("%@");return n>=0&&t.substring(n+2).trim().length>0},Dc=(e,t,n)=>{const r=Pc(e,t);if(!r)return e.get("payButton");if(n&&Tc(e)){const o=Ac(e,n);return e.get("payAmountFormat").replace("%@",`${r}${o}`)}return e.get("payAmountFormat").replace("%@",r)},Ac=(e,t)=>{const n=t&&t?.value&&t?.currency?e.amount(t.value,t.currency,{currencyDisplay:t.currencyDisplay||"symbol"}):"";return`${n.length?"/ ":""}${n}`};function N1(e,t,n,r,o,i){return t||(o?Dc(e,o):r?e.get("confirmPreauthorization"):Dc(e,n,i))}function I1(e,t,n,r,o){return r||o||!n||!t||Tc(e)?null:Ac(e,t)}const R1=({label:e})=>u("span",{className:"checkout-secondary-button__text"},e),$1={IDR:1,JPY:1,KRW:1,VND:1,BYR:1,CVE:1,DJF:1,GHC:1,GNF:1,KMF:1,PYG:1,RWF:1,UGX:1,VUV:1,XAF:1,XOF:1,XPF:1,MRO:10,BHD:1e3,IQD:1e3,JOD:1e3,KWD:1e3,OMR:1e3,LYD:1e3,TND:1e3},Nc={RSD:{minimumFractionDigits:2},AFN:{minimumFractionDigits:2},ALL:{minimumFractionDigits:2},IRR:{minimumFractionDigits:2},LAK:{minimumFractionDigits:2},LBP:{minimumFractionDigits:2},MMK:{minimumFractionDigits:2},SOS:{minimumFractionDigits:2},SYP:{minimumFractionDigits:2},YER:{minimumFractionDigits:2},IQD:{minimumFractionDigits:3}},M1=e=>$1[e]||100,fa=(e,t)=>{const n=M1(t);return parseInt(String(e),10)/n},F1=(e,t,n,r={})=>{const o=e.toString(),i=fa(o,n),a=t.replace("_","-"),s={style:"currency",currency:n,currencyDisplay:"symbol",...Nc[n]?{...r,...Nc[n]}:r};try{return i.toLocaleString(a,s)}catch{return o}},ya=e=>{if(!e||typeof e!="object")return!1;const t=typeof e.value=="number"&&!Number.isNaN(e.value),n=typeof e.currency=="string"&&e.currency.length>0,r=e.currencyDisplay===void 0||typeof e.currencyDisplay=="string";return t&&n&&r},ga=({customAmount:e,classNameModifiers:t=[],label:n,...r})=>{const{amount:o,isZeroAuth:i}=sr(),{secondaryAmount:a}=q0(),{i18n:s}=O(),l=N1(s,n,o,i,e,a),c=I1(s,a,ya(o),i,n),d=r.disabled||r.status==="loading";return u(Ge,{...r,disabled:d,classNameModifiers:[...t,"pay"],label:l},c&&u(R1,{label:c}))},Ic=()=>window.matchMedia("(max-width: 768px)").matches&&/Android|iPhone|iPod/.test(navigator.userAgent),L1=["srcDigitalCardId"],O1=({cardSelected:e,cards:t,errorMessage:n,onChangeCard:r})=>{const{i18n:o}=O(),i=Pe(),{status:a}=ot(),{handleChangeFor:s,data:l}=or({schema:L1,defaultData:{srcDigitalCardId:e.srcDigitalCardId}}),c=te(()=>t.map(d=>({icon:d.artUri||i()(d.scheme),name:`${Ic()?"":d.title} •••• ${d.panLastFour} `,secondaryText:d.isExpired&&o.get("ctp.cards.expiredCard"),id:d.srcDigitalCardId,disabled:d.isExpired})),[t]);return R(()=>{const{srcDigitalCardId:d}=l,p=t.find(h=>h.srcDigitalCardId===d);r(p)},[l,r]),u(me,{name:"clickToPayCards",className:"adyen-checkout-ctp__cards-list-field",errorMessage:n,readOnly:a==="loading",label:o.get("ctp.cards.subtitle")},u(rn,{items:c,selectedValue:l.srcDigitalCardId,name:"clickToPayCards",filterable:!1,className:"adyen-checkout-ctp__cards-list-dropdown",readonly:a==="loading",onChange:s("srcDigitalCardId")}))};function Rc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ur=class extends Ne{iframeOnLoad(){this.props.callback&&typeof this.props.callback=="function"&&this.props.callback(this.iframeEl.contentWindow)}componentDidMount(){this.iframeEl.addEventListener?this.iframeEl.addEventListener("load",this.iframeOnLoad.bind(this),!1):this.iframeEl.attachEvent?this.iframeEl.attachEvent("onload",this.iframeOnLoad.bind(this)):this.iframeEl.onload=this.iframeOnLoad.bind(this)}componentWillUnmount(){this.iframeEl.removeEventListener?this.iframeEl.removeEventListener("load",this.iframeOnLoad.bind(this),!1):this.iframeEl.detachEvent?this.iframeEl.detachEvent("onload",this.iframeOnLoad.bind(this)):this.iframeEl.onload=null}render({name:t,src:n,width:r,height:o,minWidth:i,minHeight:a,allow:s,title:l,sandbox:c,classNameModifiers:d}){const p=d.filter(h=>!!h);return u("iframe",{ref:h=>{this.iframeEl=h},allow:s,className:I("adyen-checkout__iframe",`adyen-checkout__iframe--${t}`,p.length&&d.map(h=>`adyen-checkout__iframe--${t}-${h}`)),name:t,src:n,width:r,height:o,frameBorder:"0",title:l,referrerpolicy:"origin","min-width":i,"min-height":a,sandbox:c})}constructor(...t){super(...t),Rc(this,"iframeEl",void 0)}};Rc(ur,"defaultProps",{width:"0",height:"0",minWidth:"0",minHeight:"0",src:null,allow:null,title:"components iframe",classNameModifiers:[]});function $c(e,t){if(!e)return null;const n=t.get(`ctp.errors.${e}`);return n.includes("ctp.errors")?t.get("ctp.errors.UNKNOWN_ERROR"):n}function B1(e,t,n){return n?Ic()?null:e.get("payButton.with",{values:{value:Pc(e,t),maskedData:`•••• ${n?.panLastFour}`}}):e.get("payButton")}const V1=({onDisplayCardComponent:e})=>{const{i18n:t}=O(),n=Pe(),{cards:r,checkout:o,isCtpPrimaryPaymentMethod:i,status:a,onSubmit:s,onSetStatus:l,onError:c}=ot(),[d,p]=w(r.find(N=>!N.isExpired)||r[0]),[h,m]=w(null),f=r.every(N=>N.isExpired),[y,b]=w(!1),{amount:v}=sr();R(()=>{(r.length===0||f)&&e?.()},[e,f,r]);const C=T(async()=>{if(d)try{b(!0),m(null),l("loading");const N=await o(d);s(N)}catch(N){N instanceof Ce&&(m(N?.reason),console.warn(`CtP - Checkout: Reason: ${N?.reason} / Source: ${N?.source} / Scheme: ${N?.scheme}`)),b(!1),c(N instanceof M?N:new M("ERROR","Error during ClickToPay checkout",{cause:N}))}},[o,d]),_=T(N=>{p(N)},[]),S=y&&a==="loading"&&d?.isDcfPopupEmbedded,x=a!=="loading"||!S,E=T(N=>{N.key==="Enter"&&C()},[C]);return u(G,null,u(ur,{name:vc,height:"380",width:"100%",classNameModifiers:[S?"":"hidden"]}),x&&u(G,null,u(Ot.Title,null,t.get("ctp.cards.title")),r.length===0&&u("div",{className:"adyen-checkout-ctp__empty-cards"},t.get("ctp.emptyProfile.message")),r.length===1&&u(A1,{card:r[0],errorMessage:$c(h,t)}),r.length>1&&u(O1,{cardSelected:d,cards:r,onChangeCard:_,errorMessage:$c(h,t)}),u(ga,{disabled:f,label:B1(t,v,d),status:a,variant:i?"primary":"secondary",icon:r.length!==0&&n({imageFolder:"components/"})(i?`${nn}lock`:`${nn}lock_black`),onClick:C,onKeyDown:E})))},U1=()=>{const{i18n:e}=O();return u(G,null,u("div",{className:"adyen-checkout-ctp__card-animation"},u("div",{className:"adyen-checkout-ctp__card-animation-layer"}),u("div",{className:"adyen-checkout-ctp__card-animation-layer"}),u("div",{className:"adyen-checkout-ctp__card-animation-layer"})),u("div",{className:"adyen-checkout-ctp__loading-subtitle"},e.get("ctp.loading.intro")))},H1={shopperLogin:{validate:e=>!!e&&e.length>0,errorMessage:"ctp.errors.INVALID_EMAIL",modes:["blur"]},default:{validate:e=>!!e&&e.length>0,errorMessage:"",modes:["blur"]}};function K1(e){return u(fo,{...e,type:"email",autoCapitalize:"off"})}const j1=e=>{const{i18n:t}=O(),n=W(null),{handleChangeFor:r,data:o,triggerValidation:i,valid:a,errors:s,isValid:l}=wc({schema:["shopperLogin"],rules:H1,formHolder:n}),c=W({validateInput:null,focusInput:null}),[d,p]=w(!1),h=T(()=>{p(!0),i()},[i]);R(()=>{n.current&&e.errorMessage&&ma(n.current,"shopperLogin")},[e.errorMessage]),R(()=>{o.shopperLogin&&p(!0)},[o.shopperLogin]),R(()=>{c.current.validateInput=h,e.onSetInputHandlers(c.current)},[h,e.onSetInputHandlers]);const m=T(f=>{f.key==="Enter"&&e.onPressEnter()},[e.onPressEnter]);return R(()=>{e.onChange({data:o,valid:a,errors:s,isValid:l})},[o,a,s]),u("div",{ref:n},u(me,{name:"shopperLogin",label:t.get("ctp.login.inputLabel"),errorMessage:d?e.errorMessage||s.shopperLogin&&t.get(s.shopperLogin.errorMessage):null,classNameModifiers:["shopperLogin"],errorLive:!0},u(K1,{name:"shopperLogin",autocorrect:"off",spellcheck:!1,value:o.shopperLogin,disabled:e.disabled,onInput:r("shopperLogin","input"),onBlur:r("shopperLogin","blur"),onKeyDown:m,autocomplete:"email"})))},z1=()=>{const{i18n:e}=O(),{isCtpPrimaryPaymentMethod:t,setIsCtpPrimaryPaymentMethod:n,verifyIfShopperIsEnrolled:r,startIdentityValidation:o}=ot(),[i,a]=w(null),[s,l]=w(!1),[c,d]=w(null),[p,h]=w(!1),[m,f]=w(null),y=T(_=>{f(_)},[]),b=T(({data:_,isValid:S})=>{a(_.shopperLogin),l(S),_?.shopperLogin?.length>0&&n(!0)},[]),v=T(async()=>{if(d(null),s){h(!0);try{const{isEnrolled:_}=await r({shopperEmail:i});_?await o():(d("NOT_FOUND"),h(!1))}catch(_){_ instanceof Ce&&console.warn(`CtP - Login error: ${_.toString()}`),_ instanceof Pn&&console.warn(_.toString()),ha(_)?d(_.reason==="INVALID_PARAMETER"?"INVALID_EMAIL":_.reason):console.error(_),h(!1)}}else m.validateInput()},[r,o,i,s,m]),C=T(_=>{_.key==="Enter"&&v()},[v]);return u(G,null,u(Ot.Title,{endAdornment:u(xc,null)},e.get("ctp.login.title")),u(Ot.Text,null,e.get("ctp.login.subtitle")),u(j1,{onChange:b,onSetInputHandlers:y,disabled:p,errorMessage:c&&e.get(`ctp.errors.${c}`),onPressEnter:v}),u(Ge,{label:e.get("continue"),variant:t?"primary":"secondary",status:p&&"loading",onClick:()=>{v()},onKeyDown:C}))},Mc=({onDisplayCardComponent:e})=>{const{ctpState:t,onReady:n,startIdentityValidation:r,logoutShopper:o}=ot();R(()=>{[ce.OneTimePassword,ce.Login,ce.Ready].includes(t)&&n()},[t,n]),R(()=>{t===ce.ShopperIdentified&&(async function(){try{await r()}catch(a){a instanceof Ce&&console.warn(`CtP - Identity Validation error: ${a.toString()}`),await o()}})()},[t]);const i=T(a=>{a.key==="Enter"&&(a.preventDefault(),a.stopPropagation())},[]);return t===ce.NotAvailable?null:u(Ot,{onEnterKeyPress:i},[ce.Loading,ce.ShopperIdentified].includes(t)&&u(U1,null),t===ce.OneTimePassword&&u(D1,{onDisplayCardComponent:e}),t===ce.Ready&&u(V1,{onDisplayCardComponent:e}),t===ce.Login&&u(z1,null))};function q1({label:e="qrCodeOrApp",classNames:t=[]}){const{i18n:n}=O();return u("div",{className:I("adyen-checkout__content-separator",...t)},n.get(e))}const W1=({children:e})=>{const{i18n:t}=O(),[n,r]=w(null),{ctpState:o,isCtpPrimaryPaymentMethod:i,setIsCtpPrimaryPaymentMethod:a,status:s}=ot(),l=n===null&&i===null;R(()=>{if(l){if(o===ce.ShopperIdentified||o===ce.Ready)return r(!1),void a(!0);o===ce.NotAvailable&&(r(!0),a(!1))}},[o,l]);const c=T(()=>{r(!0),a(!1)},[]),d=T(p=>{p.key==="Enter"&&c()},[c]);return o===ce.NotAvailable?e():o===ce.Loading||o===ce.ShopperIdentified?u(Mc,null):u(G,null,u(Mc,{onDisplayCardComponent:c}),u(q1,{classNames:["adyen-checkout-ctp__separator"],label:t.get("ctp.separatorText")}),n?e(!i):u(Ge,{variant:"secondary",disabled:s==="loading",label:t.get("ctp.manualCardEntry"),onClick:c,onKeyDown:d}))},G1=({configuration:e,clickToPayService:t,setClickToPayRef:n,onSetStatus:r,onSubmit:o,onError:i,isStandaloneComponent:a,...s})=>u(v1,{isStandaloneComponent:a,configuration:e,clickToPayService:t,setClickToPayRef:n,onSetStatus:r,onSubmit:o,onError:i},u(W1,null,s.children)),Y1="not base64",Z1="malformed URI sequence",Tn={decode:e=>{if(!Tn.isBase64(e))return{success:!1,error:Y1};try{return{success:!0,data:(t=e,decodeURIComponent(Array.prototype.map.call(window.atob(t),n=>`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")))}}catch{return{success:!1,error:Z1}}var t},encode:e=>window.btoa(e),isBase64:e=>{if(!e||e.length%4)return!1;try{return window.btoa(window.atob(e))===e}catch{return!1}}};function Q1(e,t,n){const r={schemaVersion:1,createdAt:Date.now(),channel:sa.WEB,platform:la,sdkVersion:aa,paymentMethodBehavior:n,analytics:{checkoutAttemptId:e},...t&&{riskData:{clientData:t}}};return Tn.encode(JSON.stringify(r))}const J1={[g.address]:"Address",[g.donation]:"Donation",[g.personal_details]:"PersonalDetails",[g.bankTransfer_IBAN]:"BankTransfer",[g.bankTransfer_BE]:"BankTransfer",[g.bankTransfer_NL]:"BankTransfer",[g.bankTransfer_PL]:"BankTransfer",[g.bankTransfer_FR]:"BankTransfer",[g.bankTransfer_CH]:"BankTransfer",[g.bankTransfer_IE]:"BankTransfer",[g.bankTransfer_GB]:"BankTransfer",[g.bankTransfer_DE]:"BankTransfer",[g.bcmc]:"Bancontact",[g.card]:"Card",[g.scheme]:"Card",[g.storedCard]:"Card",[g.customCard]:"CustomCard",[g.ach]:"Ach",[g.directdebit_GB]:"BacsDirectDebit",[g.sepadirectdebit]:"SepaDirectDebit",[g.eft_directdebit_CA]:"PreAuthorizedDebitCanada",[g.affirm]:"Affirm",[g.afterpay]:"AfterPay",[g.afterpay_default]:"AfterPay",[g.afterpay_b2b]:"AfterPayB2B",[g.atome]:"Atome",[g.facilypay_3x]:"FacilyPay3x",[g.facilypay_4x]:"FacilyPay4x",[g.facilypay_6x]:"FacilyPay6x",[g.facilypay_10x]:"FacilyPay10x",[g.facilypay_12x]:"FacilyPay12x",[g.ratepay]:"RatePay",[g.ratepay_directdebit]:"RatePayDirectDebit",[g.amazonpay]:"AmazonPay",[g.applepay]:"ApplePay",[g.cashapp]:"CashAppPay",[g.clicktopay]:"ClickToPay",[g.googlepay]:"GooglePay",[g.paypal]:"PayPal",[g.fastlane]:"Fastlane",[g.paywithgoogle]:"GooglePay",[g.boletobancario]:"Boleto",[g.boletobancario_itau]:"Boleto",[g.boletobancario_santander]:"Boleto",[g.doku]:"Doku",[g.doku_alfamart]:"Doku",[g.doku_permata_lite_atm]:"Doku",[g.doku_indomaret]:"Doku",[g.doku_atm_mandiri_va]:"Doku",[g.doku_sinarmas_va]:"Doku",[g.doku_mandiri_va]:"Doku",[g.doku_cimb_va]:"Doku",[g.doku_danamon_va]:"Doku",[g.doku_bri_va]:"Doku",[g.doku_bni_va]:"Doku",[g.doku_bca_va]:"Doku",[g.doku_wallet]:"Doku",[g.oxxo]:"Oxxo",[g.primeiropay_boleto]:"Boleto",[g.billdesk_online]:"BillDeskOnline",[g.billdesk_wallet]:"BillDeskWallet",[g.dotpay]:"Dotpay",[g.eps]:"Eps",[g.iris]:"Iris",[g.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[g.molpay_ebanking_TH]:"MolPayEBankingTH",[g.molpay_ebanking_VN]:"MolPayEBankingVN",[g.onlineBanking_CZ]:"OnlineBankingCZ",[g.onlinebanking_IN]:"OnlineBankingIN",[g.onlineBanking_PL]:"OnlineBankingPL",[g.onlineBanking_SK]:"OnlineBankingSK",[g.paybybank]:"PayByBank",[g.payu_IN_cashcard]:"PayuCashcard",[g.payu_IN_nb]:"PayuNetBanking",[g.wallet_IN]:"WalletINElement",[g.dragonpay_ebanking]:"Dragonpay",[g.dragonpay_otc_banking]:"Dragonpay",[g.dragonpay_otc_non_banking]:"Dragonpay",[g.dragonpay_otc_philippines]:"Dragonpay",[g.econtext_atm]:"Econtext",[g.econtext_online]:"Econtext",[g.econtext_seven_eleven]:"Econtext",[g.econtext_stores]:"Econtext",[g.giropay]:"Giropay",[g.multibanco]:"Multibanco",[g.redirect]:"Redirect",[g.twint]:"Twint",[g.vipps]:"Vipps",[g.trustly]:"Trustly",[g.paybybank_AIS_DD]:"PayByBankUS",[g.riverty]:"Riverty",[g.paybybank_pix]:"PayByBankPix",[g.klarna]:"Klarna",[g.klarna_account]:"Klarna",[g.klarna_paynow]:"Klarna",[g.klarna_b2b]:"Klarna",[g.bcmc_mobile]:"BcmcMobile",[g.bcmc_mobile_QR]:"BcmcMobile",[g.pix]:"Pix",[g.swish]:"Swish",[g.wechatpay]:"WeChat",[g.wechatpayQR]:"WeChat",[g.promptpay]:"PromptPay",[g.paynow]:"PayNow",[g.duitnow]:"DuitNow",[g.blik]:"Blik",[g.mbway]:"MBWay",[g.ancv]:"ANCV",[g.payto]:"PayTo",[g.upi]:"UPI",[g.upi_qr]:"UPI",[g.upi_intent]:"UPI",[g.giftcard]:"Giftcard",[g.mealVoucher_FR_natixis]:"MealVoucherFR",[g.mealVoucher_FR_sodexo]:"MealVoucherFR",[g.mealVoucher_FR_groupeup]:"MealVoucherFR"};function X1(e){return J1[e]}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ko=class{buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}submitAnalytics(t){return null}handleKeyDown(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=this.state.order||this.props.order,n=this.formatData(),r=!!X1(n.paymentMethod?.type),o=this.core.modules.risk.data,i=this.core.modules.analytics.checkoutAttemptId??jm,a=r?tc.NATIVE:tc.GENERIC,s=Q1(i,o,a);return n.paymentMethod&&i&&(n.paymentMethod.checkoutAttemptId=i),n.paymentMethod&&s&&(n.paymentMethod.sdkData=s),{...o&&{riskData:{clientData:o}},...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},...n,clientStateDataIndicator:!0}}activate(){}render(){throw new Error("Payment method cannot be rendered.")}mount(t){const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error("Component could not mount. Root node was not found.");return this._node&&this.unmount(),this._node=n,Xn(this._node,"keydown",this.handleKeyDown,!1),this._component=this.render(),Qs(this._component,n),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return er(this._node,"keydown",this.handleKeyDown),this._node&&Qs(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}constructor(t,n){if(on(this,"_id",`${this.constructor.type}-${Be()}`),on(this,"core",void 0),on(this,"props",void 0),on(this,"state",{}),on(this,"_component",void 0),on(this,"_node",null),!(function(o){return!!o&&typeof o.initialize=="function"&&typeof o.createFromAction=="function"})(t))throw new M("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(n),this.handleKeyDown=this.handleKeyDown.bind(this)}};on(ko,"defaultProps",{});const ef=["action","resultCode","sessionData","order","sessionResult","donationToken","error","askDonation"];function hr(e){const t=[],n=Object.keys(e).reduce((r,o)=>(ef.includes(o)?r[o]=e[o]:t.push(o),r),{});return t.length&&console.warn(`The following properties should not be passed to the client: ${t.join(", ")}`),n}function Eo(e){e&&(delete e.order,delete e.action,e.donationToken&&e.donationToken.length!==0||delete e.donationToken)}function pr(e){return["Cancelled","Error","Refused"].includes(e.resultCode)?Promise.reject(e):Promise.resolve(e)}function xo(e){return e?typeof e.activePaymentMethod=="object"&&typeof e.closeActivePaymentMethod=="function":!1}function tf(e,t){return e==="FI"&&t?{openFirstPaymentMethod:!1,openFirstStoredPaymentMethod:!1}:{}}function Po(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var it=(function(e){return e.action="action",e.submit="submit",e.redirect="redirect",e.threeDS2="threeDS2",e.closed="closed",e.apiRequest="apiRequest",e})({}),St=(function(e){return e.challengeIframeLoaded="challengeIframeLoaded",e.challengeDataSentWeb="challengeDataSentWeb",e.challengeCompleted="challengeCompleted",e.fingerprintDataSentWeb="fingerprintDataSentWeb",e.fingerprintCompleted="fingerprintCompleted",e.fingerprintIframeLoaded="fingerprintIframeLoaded",e.threeDS2="threeDS2",e.redirect="redirect",e.voucher="voucher",e.await="awat",e.qrCode="qrCode",e.bankTransfer="bankTransfer",e.sdk="sdk",e.donation="donation",e.donationCampaigns="donationCampaigns",e})({});let Ze=class extends Ni{getEventCategory(){return Qt.log}static getSubtypeFromActionType(t){return St[t]}constructor(t){super(t.component),Po(this,"type",void 0),Po(this,"subType",void 0),Po(this,"message",void 0),Po(this,"result",void 0),this.type=t.type,this.message=t.message,t.subType&&(this.subType=t.subType),t.result&&(this.result=t.result)}},To=class extends Error{constructor(t){super(t)}};const nf=({srPanel:e,children:t})=>{const{i18n:n}=O(),r=e.moveFocus;return u(Ol.Provider,{value:{srPanel:e,setSRMessagesFromObjects:({fieldTypeMappingFn:o})=>wt(yp,{SRPanelRef:e,i18n:n,fieldTypeMappingFn:o}),setSRMessagesFromStrings:o=>{e.setMessages(o)},clearSRPanel:()=>{e.setMessages(null)},shouldMoveFocusSR:r}},t)};function at(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Dt extends ko{createBeforeRenderHook(t){const n=this.render;this.render=(...r)=>(this.beforeRender(t),n.apply(this,r))}beforeRender(t){if(t?.originalAction)return;const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.oneClick&&{isStoredPaymentMethod:!0}});this.analytics.sendAnalytics(n)}reportIntegrationFlavor(){this.analytics.sendFlavor("components")}get analytics(){return this.core.modules.analytics}get srPanel(){return this.core.modules.srPanel}getPaymentMethodConfigFromResponse(t){return t?.storedPaymentMethodId?this.getStoredPaymentMethodDetails(t.storedPaymentMethodId):this.getPaymentMethodFromPaymentMethodsResponse(t?.type,t?.paymentMethodId)}buildElementProps(t){const n={showPayButton:!0,...this.core.getCorePropsForComponent(),...this.getPaymentMethodConfigFromResponse(t),...t},r=xo(this);this.props=this.formatProps({...this.constructor.defaultProps,...tf(this.core.options.countryCode,r),...n})}getStoredPaymentMethodDetails(t){return this.core.paymentMethodsResponse.findStoredPaymentMethod(t)}getPaymentMethodFromPaymentMethodsResponse(t,n){return n?this.core.paymentMethodsResponse.findById(n):this.core.paymentMethodsResponse?.find(t||this.constructor.type)}storeElementRefOnCore(t){t?.isDropin||this.core.storeElementReference(this)}isAvailable(){return Promise.resolve()}setState(t){this.state={...this.state,...t},this.onChange()}showValidation(){return this.componentRef&&this.componentRef.showValidation&&this.componentRef.showValidation(),this}updateAmount(t,n){this.props={...this.props,...t&&{amount:t},...n&&{secondaryAmount:n}},this.amountProviderRef.current?.update(t,n)}setElementStatus(t,n){return this.elementRef?.setStatus(t,n),this}setStatus(t,n){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,n),this}onChange(){this.props.onChange?.({data:this.data,isValid:this.isValid,errors:this.state.errors,valid:this.state.valid},this.elementRef)}submitAnalytics(t){this.analytics.sendAnalytics(t)}submit(){this.isValid?this.makePaymentsCall().then(hr).then(pr).then(this.handleResponse).catch(t=>{t instanceof To?this.setElementStatus("ready"):this.handleFailedResult(t)}):this.showValidation()}makePaymentsCall(){if(this.setElementStatus("loading"),this.props.onSubmit)return this.submitUsingAdvancedFlow();if(this.core.session)return(this.props.beforeSubmit?new Promise((t,n)=>{this.props.beforeSubmit(this.data,this.elementRef,{resolve:t,reject:()=>n(new To("beforeSubmitRejected"))})}):Promise.resolve(this.data)).then(this.submitUsingSessionsFlow);this.handleError(new M("IMPLEMENTATION_ERROR",'It can not perform /payments call. Callback "onSubmit" is missing or Checkout session is not available'))}async submitUsingAdvancedFlow(){const t=new Ze({component:this.type,type:it.submit,message:"Shopper clicked pay"});return this.submitAnalytics(t),new Promise((n,r)=>{this.props.onSubmit({data:this.data,isValid:this.isValid},this.elementRef,{resolve:n,reject:r})})}async submitUsingSessionsFlow(t){const n=new Ze({component:this.type,type:it.submit,message:"Shopper clicked pay"});this.submitAnalytics(n);try{return await this.core.session.submitPayment(t)}catch(r){return r instanceof M?this.handleError(r):this.handleError(new M("ERROR","Error when making /payments call",{cause:r})),Promise.reject(r)}}onComplete(t){this.handleAdditionalDetails(t)}handleAdditionalDetails(t){this.makeAdditionalDetailsCall(t).then(hr).then(pr).then(this.handleResponse).catch(this.handleFailedResult)}makeAdditionalDetailsCall(t){return this.props.onAdditionalDetails?new Promise((n,r)=>{this.props.onAdditionalDetails(t,this.elementRef,{resolve:n,reject:r})}):this.core.session?this.submitAdditionalDetailsUsingSessionsFlow(t.data):void this.handleError(new M("IMPLEMENTATION_ERROR",'It can not perform /payments/details call. Callback "onAdditionalDetails" is missing or Checkout session is not available'))}async submitAdditionalDetailsUsingSessionsFlow(t){try{return await this.core.session.submitDetails(t)}catch(n){return n instanceof M?this.handleError(n):this.handleError(new M("ERROR","Error when making /details call",{cause:n})),Promise.reject(n)}}handleAction(t,n={}){if(!t||!t.type)throw Y(t,"action")&&Y(t,"resultCode")?new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?'):new Error('handleAction::Invalid Action - the passed action object does not have a "type" property');const r=this.core.createFromAction(t,{...this.elementRef.props,...n});return r?(this.unmount(),r.mount(this._node)):null}onActionHandled(t){this.props?.onActionHandled?.({originalAction:this.props.originalAction,...t})}setupSessionsDonation(){const{amount:t,donation:n}=this.props;if(n?.autoMount!==!1){const r=xo(this.elementRef)?this.elementRef._node:this._node;new(this.core.getComponent(g.donation))(this.core,{rootNode:r,commercialTxAmount:t.value})}}handleResponse(t){t.action?this.elementRef.handleAction(t.action):t.order?.remainingAmount?.value>0?this.handleOrder(t):this.handleSuccessResult(t)}handleKeyDown(t){t.key!=="Enter"&&t.code!=="Enter"||(t.preventDefault(),this.onEnterKeyPressed(document?.activeElement,this))}onEnterKeyPressed(t,n){this.props.onEnterKeyPressed?this.props.onEnterKeyPressed(t,n):(t.blur(),this.submit())}updateParent(t={}){return this.elementRef.core.update(t)}get isValid(){return!1}get icon(){const t=this.props.paymentMethodType||this.type;return this.props.icon??this.resources.getImage()(t)}get displayName(){const t=this.core.paymentMethodsResponse?.paymentMethods?.find(n=>n.type===this.type);return this.props.name||t?.name||this.type}get accessibleName(){return this.displayName}get additionalInfo(){return null}get type(){return this.props.type||this.constructor.type}async handleAdvanceFlowPaymentMethodsUpdate(t,n){return new Promise((r,o)=>{if(!this.props.onPaymentMethodsRequest)return r();this.props.onPaymentMethodsRequest({...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},locale:this.core.options.locale},{resolve:r,reject:o})}).catch(r=>{this.handleError(new M("IMPLEMENTATION_ERROR","Something failed during payment methods update or onPaymentMethodsRequest was not implemented",{cause:r}))}).then(r=>this.core.update({...r&&{paymentMethodsResponse:r},order:t,amount:t?t.remainingAmount:n}))}render(){return u(i0,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources,analytics:this.analytics},u(nf,{srPanel:this.srPanel},u(W0,{amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,providerRef:this.amountProviderRef},this.componentToRender())))}constructor(t,n){super(t,n),at(this,"componentRef",void 0),at(this,"resources",void 0),at(this,"elementRef",void 0),at(this,"amountProviderRef",Eh()),at(this,"handleError",r=>{if(this.setElementStatus("ready"),r.name===kl&&r.options.code){const o=new Re({component:this.type,errorType:Ie.apiError,code:r.options.code});this.submitAnalytics(o)}this.props.onError&&this.props.onError(r,this.elementRef)}),at(this,"handleOrder",r=>{const{order:o}=r;(this.core.session?this.core.update({order:o}):this.handleAdvanceFlowPaymentMethodsUpdate(o)).then(()=>{this.props.onOrderUpdated?.({order:o})})}),at(this,"handleFailedResult",r=>{xo(this.elementRef)&&this.elementRef.displayFinalAnimation("error"),Eo(r),this.props.onPaymentFailed?.(r,this.elementRef)}),at(this,"handleSuccessResult",r=>{xo(this.elementRef)&&this.elementRef.displayFinalAnimation("success"),Eo(r),this.core.session&&r.askDonation===!0&&this.setupSessionsDonation(),this.props.onPaymentCompleted?.(r,this.elementRef)}),at(this,"setComponentRef",r=>{this.componentRef=r}),at(this,"payButton",r=>u(ga,{...r,onClick:this.submit})),this.core.register(this.constructor),this.submit=this.submit.bind(this),this.setState=this.setState.bind(this),this.onComplete=this.onComplete.bind(this),this.handleAction=this.handleAction.bind(this),this.handleOrder=this.handleOrder.bind(this),this.handleAdditionalDetails=this.handleAdditionalDetails.bind(this),this.handleResponse=this.handleResponse.bind(this),this.setElementStatus=this.setElementStatus.bind(this),this.submitAnalytics=this.submitAnalytics.bind(this),this.makePaymentsCall=this.makePaymentsCall.bind(this),this.makeAdditionalDetailsCall=this.makeAdditionalDetailsCall.bind(this),this.submitUsingSessionsFlow=this.submitUsingSessionsFlow.bind(this),this.updateAmount=this.updateAmount.bind(this),this.setupSessionsDonation=this.setupSessionsDonation.bind(this),this.elementRef=n&&n.elementRef||this,this.resources=this.props.modules?this.props.modules.resources:void 0,this.storeElementRefOnCore(this.props),this.onEnterKeyPressed=this.onEnterKeyPressed.bind(this),this.onActionHandled=this.onActionHandled.bind(this),this.createBeforeRenderHook(n),this.reportIntegrationFlavor()}}at(Dt,"type",void 0),at(Dt,"txVariants",[]);function st(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Do=class qo extends Dt{setStatus(t,n){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,n),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t),this}getPaymentMethodConfigFromResponse(t){return t?.fundingSource?this.core.paymentMethodsResponse?.findByFundingSource(t.type,t.fundingSource):super.getPaymentMethodConfigFromResponse(t)}formatProps(t){const n=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,r=t.amount?.value!==0&&n,o=t.storedPaymentMethodId||t.id,i=o&&t?.supportedShopperInteractions?.includes("Ecommerce");if(o&&!i)throw new M($i,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");const a=t.installmentOptions;t.session&&Qh(a)&&console.warn(`WARNING: You have defined installments configuration on the Card component, but you are using a /sessions integration.
|
|
135
135
|
With this integration, installments configuration must be defined when you create the session. Any configuration defined elsewhere will be ignored.
|
|
136
136
|
|
|
137
|
-
`);const s=t.session?t.session?.configuration?.installmentOptions??ar.installmentOptions:a;return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&t.brand==="bcmc"||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?ar.billingAddressMode:t.billingAddressMode,brand:t.brand??g.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:s,enableStoreDetails:n,showStoreDetailsCheckbox:o,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...r&&{storedPaymentMethodId:r}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:Ur.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId,holderName:this.props.holderName??""},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource},...this.state.fastlaneData&&{fastlaneData:btoa(JSON.stringify(this.state.fastlaneData))}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...Vp(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}beforeRender(t){if(t?.originalAction)return;const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.oneClick&&{isStoredPaymentMethod:!0,brand:t.brand}});this.analytics.sendAnalytics(n)}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}processBinLookupResponse(t,n=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,n),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}onBinLookup(t){if(!t.isReset){const n=_i("supportedBrandsRaw").from(t);this.props.onBinLookup?.(n)}}get storePaymentMethodPayload(){return this.props.storedPaymentMethodId?.length>0?{}:this.props.amount?.value===0?this.props.enableStoreDetails?{storePaymentMethod:!0}:{}:this.props.showStoreDetailsCheckbox&&this.state.storePaymentMethod!==void 0?{storePaymentMethod:!!this.state.storePaymentMethod}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:n}=this.props;return t?t.map(o=>({icon:n?.[o]?.icon??this.props.modules.resources.getImage()(o),name:o})):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||Ur.type}get accessibleName(){return(this.props.name||Ur.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return yr()}renderCardInput(t=!0){return u(rc,{setComponentRef:this.setComponentRef,...this.props,...this.state,onSubmitAnalytics:this.submitAnalytics,onChange:this.setState,onSubmit:this.submit,handleKeyDown:this.handleKeyDown,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:t,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onConfigSuccess:this.onConfigSuccess})}componentToRender(){return u(T1,{configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},t=>this.renderCardInput(t))}constructor(t,n){super(t,n),st(this,"clickToPayService",void 0),st(this,"clickToPayRef",null),st(this,"setClickToPayRef",o=>{this.clickToPayRef=o}),st(this,"onBrand",o=>{this.props.onBrand?.(o)}),st(this,"handleClickToPaySubmit",o=>{this.setState({data:{...o},valid:{},errors:{},isValid:!0}),this.submit()}),st(this,"onConfigSuccess",o=>{const r=new Te({component:this.type,type:ge.configured});this.submitAnalytics(r),this.props.onConfigSuccess?.(o)}),st(this,"onFocus",o=>{const r=new Te({component:this.type,type:ge.focus,target:Ii(o.fieldType)});this.submitAnalytics(r),bn(o.fieldType)?this.props.onFocus?.(o.event):this.props.onFocus?.(o)}),st(this,"onBlur",o=>{const r=new Te({component:this.type,type:ge.unfocus,target:Ii(o.fieldType)});this.submitAnalytics(r),bn(o.fieldType)?this.props.onBlur?.(o.event):this.props.onBlur?.(o)}),st(this,"onBinValue",Nm(this)),st(this,"payButton",o=>{const r=this.props.amount?.value===0,i=this.props.storedPaymentMethodId?.length>0;return u(pa,{...o,label:r&&!i?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})}),n&&!n._disableClickToPay&&this.props.fundingSource!=="prepaid"&&(this.clickToPayService=Zm(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment,this.analytics),this.clickToPayService?.initialize())}};st(ma,"type",g.scheme),st(ma,"defaultProps",{showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0,..._i(["type","setComponentRef"]).from(ar)});let Pc=class extends Ae{componentDidMount(){this.formEl.submit(),this.props.onFormSubmit(`${this.props.inputName} sent`)}render({name:t,action:n,target:o,inputName:r,inputValue:i}){return u("form",{ref:a=>{this.formEl=a},method:"POST",className:I(["adyen-checkout__threeds2__form",`adyen-checkout__threeds2__form--${t}`]),name:t,action:n,target:o,style:{display:"none"}},u("input",{name:r,value:i}))}constructor(...t){var n,o,r;super(...t),r=void 0,(o="formEl")in(n=this)?Object.defineProperty(n,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[o]=r}};const fa=(e,t,n,o)=>r=>{const i={};if(r.origin!==e)return"Message was not sent from the expected domain";if(typeof r.data!="string")return"Event data from expected domain but not in expected form";if(!r.data.length)return"Event data from expected domain, in expected form, but empty";try{const a=JSON.parse(r.data);return a&&typeof a=="object"&&Y(a,"type")?a.type===o?(t(a),!0):'Event data has "type" but the object is not in the expected form':"Event data had no type"}catch{return i.type=`${o}-JSON-parse-error`,i.comment="failed to JSON parse event.data",i.extraInfo=`event.data = ${r.data}`,i.eventDataRaw=r.data,console.debug("get-process-message-handler::CATCH::Un-parseable JSON:: parseErrorObj=",i),!1}},Tc="threeDS2Fingerprint",ho="3DS2Fingerprint_Error",ya="callSubmit3DS2Fingerprint_Response",Dc="threeDS2Challenge",kt="3DS2Challenge_Error",L1="threeDS2",kr="3DS2",xn='Missing "token" property from threeDS2 action',Nc="02",O1=1e4,B1=6e5,po="timeout",V1={result:{transStatus:"U"},type:"challengeResult",errorCode:po},U1={result:{threeDSCompInd:"N"},type:"fingerPrintResult",errorCode:po},H1="payment *; publickey-credentials-get *",K1="payment *; publickey-credentials-get *; publickey-credentials-create *",j1="allow-forms allow-same-origin allow-scripts allow-pointer-lock allow-popups",Ac={"01":["250px","400px"],"02":["390px","400px"],"03":["500px","600px"],"04":["600px","400px"],"05":["100%","100%"]},ga=e=>{const t=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(e);if(!t)return null;const[,n,o,r,i]=t;return n&&o&&r?`${n}:${o}${r}${i?`:${i}`:""}`:null},Er=e=>"success"in e&&!e.success,Ic=e=>{const t=En.decode(e);if(t.success&&t.data)try{return JSON.parse(t.data)}catch{return{success:!1,error:"Could not JSON parse token"}}return t},Rc=e=>{if(!e||!Object.keys(e).length)throw new Error("No (populated) data object to encode");return En.encode(JSON.stringify(e))},$c=e=>{const t=e.length===1?`0${e}`:e;return Object.prototype.hasOwnProperty.call(Ac,t)?t:Nc},z1=e=>Ac[$c(e)],q1=({token:e,size:t})=>{const n=Ic(e);if(Er(n))return n;const{acsTransID:o,acsURL:r,messageVersion:i,threeDSNotificationURL:a,threeDSServerTransID:s}=n,l=ga(a??"");return{acsURL:r??"",cReqData:{acsTransID:o??"",messageVersion:i??"",threeDSServerTransID:s??"",messageType:"CReq",challengeWindowSize:$c(t)},iframeSizeArr:z1(t),postMessageDomain:l}},W1=({token:e,notificationURL:t})=>{const n=Ic(e);if(Er(n))return n;const{threeDSMethodNotificationURL:o,threeDSMethodUrl:r,threeDSServerTransID:i}=n,a=t??o??"";return{threeDSServerTransID:i??"",threeDSMethodURL:r??"",threeDSMethodNotificationURL:a,postMessageDomain:ga(a)}},G1=(e,t,n)=>({data:{[e]:Rc({threeDSCompInd:t.threeDSCompInd}),paymentData:n}}),Y1=(e,t,n)=>({data:{details:{[e]:Rc({transStatus:t,authorisationToken:n})}}}),Fc=e=>{let t=window.btoa(e).split("=")[0];return t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_"),t},Z1=(e,t)=>e==="fingerprint"?{showSpinner:!t.isDropin,statusType:"loading",...t.elementRef&&{elementRef:t.elementRef}}:{statusType:"custom",i18n:t.i18n,elementRef:t.elementRef},ba=(e,t,n)=>{let o;return{promise:new Promise((r,i)=>{o=setTimeout(()=>{i(n)},e),t.then(a=>{clearTimeout(o),r(a)}).catch(a=>{clearTimeout(o),i(a)})}),cancel:()=>{clearTimeout(o)}}};function va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mc="threeDSIframe";let Q1=class extends Ae{get3DS2ChallengePromise(){return new Promise((t,n)=>{this.processMessageHandler=fa(this.props.postMessageDomain,t,n,"challengeResult"),window.addEventListener("message",this.processMessageHandler)})}componentDidMount(){this.challengePromise=ba(B1,this.get3DS2ChallengePromise(),V1),this.challengePromise.promise.then(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onCompleteChallenge(t)}).catch(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onErrorChallenge(t)})}componentWillUnmount(){this.challengePromise&&this.challengePromise.cancel(),window.removeEventListener("message",this.processMessageHandler)}render({acsURL:t,cReqData:n,iframeSizeArr:o,onFormSubmit:r,usePasskeyIFrameAttributes:i},{base64URLencodedData:a,status:s}){const[l,c]=o;return u("div",{className:I(["adyen-checkout__threeds2__challenge",`adyen-checkout__threeds2__challenge--${n.challengeWindowSize}`])},s!=="iframeLoaded"&&u(_n,null),u(lo,{name:Mc,width:l,height:c,callback:this.iframeCallback,allow:i?K1:H1,sandbox:i?j1:void 0}),u(Pc,{name:"cReqForm",action:t,target:Mc,inputName:"creq",inputValue:a??"",onFormSubmit:r}))}constructor(t){super(t),va(this,"processMessageHandler",void 0),va(this,"challengePromise",void 0),va(this,"iframeCallback",()=>{this.setState({status:"iframeLoaded"}),this.state.status==="init"&&this.props.onActionHandled?.({componentType:"3DS2Challenge",actionDescription:`${kr} challenge iframe loaded`})});const n=JSON.stringify(this.props.cReqData),o=Fc(n);this.state={base64URLencodedData:o,status:"init"}}};function Lc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Oc extends Ae{componentDidMount(){if(Er(this.state.challengeData)){const t=this.state.challengeData.error,n=t.includes(xn)?pe.THREEDS2_ACTION_IS_MISSING_TOKEN:pe.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED;this.setError({errorInfo:`${n}: ${this.props.i18n.get("err.gen.9102")}`},!0);const o=new Re({component:this.props.type,code:n,errorType:Ie.threeDS2,message:`${kt}: ${t}`});this.props.onSubmitAnalytics(o),console.debug("### PrepareChallenge3DS2::exiting:: no challengeData")}else{const t=this.props.environment==="test"&&this.props._environmentUrls?.api?.includes("http://localhost:8080"),{acsURL:n,postMessageDomain:o}=this.state.challengeData,r=Lt(n,t),i=Lt(o,t);if(!r||!i){const c=r?pe.THREEDS2_CHALLENGE_TOKEN_IS_MISSING_THREEDSNOTIFICATIONURL:pe.THREEDS2_TOKEN_IS_MISSING_ACSURL,d=r?"threeDSNotificationURL":"acsURL";this.setError({errorInfo:`${c}: ${this.props.i18n.get("err.gen.9102")}`},!0);const p=new Re({component:this.props.type,code:c,errorType:Ie.threeDS2,message:`${kt}: Decoded token is missing a valid ${d} property`});return this.props.onSubmitAnalytics(p),void console.debug(`### PrepareChallenge3DS2::exiting:: no valid ${d}.${i?"":` postMessageDomain=${o}`}`)}const{acsTransID:a,messageVersion:s,threeDSServerTransID:l}=this.state.challengeData.cReqData;if(!a||!s||!l){this.setError({errorInfo:`${pe.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS}: ${this.props.i18n.get("err.gen.9102")}`},!0);const c=new Re({component:this.props.type,code:pe.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS,errorType:Ie.threeDS2,message:`${kt}: Decoded token is missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)`});return this.props.onSubmitAnalytics(c),void console.debug("### PrepareChallenge3DS2::exiting:: missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)")}this.setState({status:"performingChallenge"})}}setStatusComplete(t,n=null){this.setState({status:"complete"},()=>{const o=Y1(this.props.dataKey,t.transStatus,this.props.paymentData);let r;n&&console.debug("### PrepareChallenge3DS2::errorCodeObject::",n);const i=n||t;if(i.errorCode){const s={code:i.errorCode==="timeout"?pe.THREEDS2_TIMEOUT:pe.THREEDS2_NO_TRANSSTATUS,errorType:Ie.threeDS2};r=new Re({component:this.props.type,message:i.message,...s}),this.props.onSubmitAnalytics(r)}let a;switch(t?.transStatus){case"Y":a="success";break;case"N":a="failed";break;case"U":a=n?"timeout":"cancelled"}t?.errorCode&&(a="noTransStatus"),r=new Ze({component:this.props.type,type:it.threeDS2,subType:St.challengeCompleted,message:`${kr} challenge has completed`,result:a}),this.props.onSubmitAnalytics(r),this.props.onComplete(o)})}setError(t,n){this.setState({status:"error",errorInfo:t.errorInfo}),n&&this.props.onError(new F(Xo,t.errorInfo,{cause:t.errorObj}))}render(t,{challengeData:n}){const o=n,r=Pe();return this.state.status==="performingChallenge"?u(Q1,{onCompleteChallenge:i=>{let a=null;if(Y(i.result,"errorCode")&&i.result.errorCode.length&&(a={errorCode:i.result.errorCode,message:`${kt}: ${i.result.errorDescription?i.result.errorDescription:"no transStatus could be retrieved"}`},this.props.isMDFlow&&this.props.onError(new F(Xo,`${kt}: ${i.result.errorDescription?i.result.errorDescription:"no transStatus could be retrieved"}`,{cause:i.result.errorCode}))),!i.result){this.setError({errorInfo:`${kt}: ${this.props.i18n.get("3ds.chal.805",{values:{result:'"result"'}})}`,errorObj:i},!0);const s=new Re({component:this.props.type,code:pe.THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP,errorType:Ie.threeDS2,message:`${kt}: challenge resolved without a "result" object`});return this.props.onSubmitAnalytics(s),void console.debug('### PrepareChallenge3DS2::exiting:: challenge resolved without a "result" object')}this.setStatusComplete(i.result,a)},onErrorChallenge:i=>{if(Y(i,"errorCode")){const a={errorCode:i.errorCode,message:`${Dc}: ${i.errorCode}`};return this.props.isMDFlow&&this.props.onError(new F(Xo,`${kt}: '3DS2 challenge timed out'`,{cause:i.errorCode})),void this.setStatusComplete(i.result,a)}},...o,onActionHandled:this.props.onActionHandled,onFormSubmit:this.onFormSubmit,usePasskeyIFrameAttributes:this.props.usePasskeyIFrameAttributes}):this.state.status==="error"?u("div",{className:"adyen-checkout__threeds2-challenge-error"},u(fe,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--error",src:r({imageFolder:"components/"})("error"),alt:""}),u("div",{className:"adyen-checkout__status__text"},this.state.errorInfo?this.state.errorInfo:this.props.i18n.get("error.message.unknown"))):null}constructor(t){if(super(t),Lc(this,"onFormSubmit",n=>{const o=new Ze({component:this.props.type,type:it.threeDS2,subType:St.challengeDataSentWeb,message:n});this.props.onSubmitAnalytics(o)}),this.props.token){const n=q1({token:this.props.token,size:this.props.challengeWindowSize||this.props.size});this.state={status:"init",challengeData:n}}else this.state={challengeData:{success:!1,error:xn}},console.debug(`${kt}: ${xn}`)}}Lc(Oc,"defaultProps",{onComplete:()=>{},onError:()=>{},isMDFlow:!1});function Ca(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let _a=class extends Dt{beforeRender(){}onComplete(t){this.props.isMDFlow?this.props.on3DS2RedirectFlowComplete?.(t,this.elementRef):super.onComplete(t),this.unmount()}componentToRender(){if(!Tt(this.props.paymentData)){const t=Y(this.props,"isMDFlow")?"paymentData":"authorisationToken";this.props.onError(new F(Ai,`No ${t} received. 3DS2 Challenge cannot proceed`));const n=new Re({component:this.type,code:pe.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA,errorType:Ie.threeDS2,message:`${kt}: Missing 'paymentData' property from threeDS2 action`});return this.submitAnalytics(n),null}return u(Oc,{...this.props,onComplete:this.onComplete,onSubmitAnalytics:this.submitAnalytics,onActionHandled:this.onActionHandled})}constructor(...t){super(...t),Ca(this,"onActionHandled",n=>{const o=new Ze({component:this.type,type:it.threeDS2,subType:St.challengeIframeLoaded,message:n.actionDescription});this.submitAnalytics(o),super.onActionHandled(n)})}};Ca(_a,"type",g.threeDS2Challenge),Ca(_a,"defaultProps",{dataKey:"threeDSResult",size:Nc,type:Dc});function wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bc="threeDSMethodIframe";let Vc=class extends Ae{get3DS2MethodPromise(){return new Promise((t,n)=>{this.processMessageHandler=fa(this.props.postMessageDomain,t,n,"fingerPrintResult"),window.addEventListener("message",this.processMessageHandler)})}componentDidMount(){this.fingerPrintPromise=ba(O1,this.get3DS2MethodPromise(),U1),this.fingerPrintPromise.promise.then(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onCompleteFingerprint(t)}).catch(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onErrorFingerprint(t)})}componentWillUnmount(){this.fingerPrintPromise&&this.fingerPrintPromise.cancel(),window.removeEventListener("message",this.processMessageHandler)}render({threeDSMethodURL:t,onActionHandled:n,onFormSubmit:o},{base64URLencodedData:r}){return u("div",{className:"adyen-checkout__3ds2-device-fingerprint"},this.props.showSpinner&&u(_n,null),u("div",{style:{display:"none"}},u(lo,{name:Bc,callback:()=>{n?.({componentType:"3DS2Fingerprint",actionDescription:`${kr} fingerprint iframe loaded`})}}),u(Pc,{name:"threeDSMethodForm",action:t,target:Bc,inputName:"threeDSMethodData",inputValue:r,onFormSubmit:o})))}constructor(t){super(t),wa(this,"processMessageHandler",void 0),wa(this,"fingerPrintPromise",void 0);const{threeDSServerTransID:n,threeDSMethodNotificationURL:o}=this.props,r=JSON.stringify({threeDSServerTransID:n,threeDSMethodNotificationURL:o}),i=Fc(r);this.state={base64URLencodedData:i}}};wa(Vc,"defaultProps",{showSpinner:!0});function Sa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ka extends Ae{componentDidMount(){if(Er(this.state.fingerPrintData)){const t=this.state.fingerPrintData.error,n=t.includes(xn)?pe.THREEDS2_ACTION_IS_MISSING_TOKEN:pe.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED;this.setStatusComplete({threeDSCompInd:"N"},{errorCode:n,message:`${ho}: ${t}`}),console.debug("### PrepareFingerprint3DS2:: token does not exist or could not be base64 decoded &/or JSON.parsed")}else{const t=this.props.environment==="test"&&this.props._environmentUrls?.api?.includes("http://localhost:8080"),{threeDSMethodURL:n,threeDSMethodNotificationURL:o,postMessageDomain:r,threeDSServerTransID:i}=this.state.fingerPrintData;if(!Lt(n,t))return this.setStatusComplete({threeDSCompInd:"U"},{errorCode:pe.THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL,message:`${ho}: Decoded token is missing a valid threeDSMethodURL property`}),void console.debug("### PrepareFingerprint3DS2::exiting:: no valid threeDSMethodURL");const a=Lt(o,t),s=Lt(r,t),l=i?.length;if(!a||!s||!l)return this.setStatusComplete({threeDSCompInd:"N"},{errorCode:pe.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS,message:`${ho}: Decoded token is missing one or more of the following properties (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)`}),void console.debug("### PrepareFingerprint3DS2::exiting:: Decoded token is missing one or more of the following properties (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)");this.setState({status:"retrievingFingerPrint"})}}setStatusComplete(t,n=null){this.setState({status:"complete"},()=>{const o=G1(this.props.dataKey,t,this.props.paymentData);let r;const i=n||t;if(i.errorCode){const s={code:i.errorCode===po?pe.THREEDS2_TIMEOUT:i.errorCode,errorType:Ie.threeDS2};r=new Re({component:this.props.type,message:i.message,...s}),this.props.onSubmitAnalytics(r)}let a;switch(t?.threeDSCompInd){case"Y":a="success";break;case"N":a=n?n.errorCode===po?po:"failedInternal":"failed";break;case"U":a="noThreeDSMethodURL"}r=new Ze({component:this.props.type,type:it.threeDS2,subType:St.fingerprintCompleted,message:`${kr} fingerprinting has completed`,result:a}),this.props.onSubmitAnalytics(r),this.props.onComplete(o)})}render({showSpinner:t},{status:n,fingerPrintData:o}){return n==="retrievingFingerPrint"?u(Vc,{onCompleteFingerprint:r=>{this.setStatusComplete(r.result)},onErrorFingerprint:r=>{const i={errorCode:r.errorCode,message:`${Tc}: ${r.errorCode}`};this.setStatusComplete(r.result,i)},showSpinner:t,...o,onActionHandled:this.props.onActionHandled,onFormSubmit:this.onFormSubmit}):null}constructor(t){super(t),Sa(this,"onFormSubmit",r=>{const i=new Ze({component:this.props.type,type:it.threeDS2,subType:St.fingerprintDataSentWeb,message:r});this.props.onSubmitAnalytics(i)});const{token:n,notificationURL:o}=this.props;if(n){const r=W1({token:n,notificationURL:o});this.state={status:"init",fingerPrintData:r}}else this.state={fingerPrintData:{success:!1,error:xn}},console.debug(`${ho}: ${xn}`)}}Sa(ka,"type","scheme"),Sa(ka,"defaultProps",{onComplete:()=>{},onError:()=>{},paymentData:"",showSpinner:!0,isMDFlow:!1});const Bt="v1",Pn={makePayments:"620",submitPaymentDetails:"621",submitThreeDS2Fingerprint:"622",createOrder:"624",donationCampaigns:"627",donations:"628"};function J1({data:e}){Ve({path:`v1/submitThreeDS2Fingerprint?token=${this.props.clientKey}`,loadingContext:this.props.loadingContext,errorLevel:"fatal",errorCode:Pn.submitThreeDS2Fingerprint},{...e}).then(t=>{let n;if(t.type==="completed"){const{details:r}=t;return t.details?this.onComplete({data:{details:r}}):(console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no details object in a response indicating either a "frictionless" flow, or a "refused" response. resData=',t),n=new Re({component:"threeDS2Fingerprint",code:pe.THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED,errorType:Ie.threeDS2,message:`${ya}: no details object in a response indicating either a "frictionless" flow, or a "refused" response`}),void this.submitAnalytics(n))}if(!t.action)return console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no action object in a response indicating a "challenge". resData=',t),n=new Re({component:"threeDS2Fingerprint",code:pe.THREEDS2_NO_ACTION_FOR_CHALLENGE,errorType:Ie.threeDS2,message:`${ya}: no action object in a response indicating a "challenge" flow`}),void this.submitAnalytics(n);const o=this.props.elementRef??this;return o?t.action?.type==="threeDS2"?o.handleAction(t.action,Ci("challengeWindowSize","usePasskeyIFrameAttributes").from(this.props)):t.action?.type==="redirect"?o.handleAction(t.action):void 0:(console.debug("Handled Error::callSubmit3DS2Fingerprint::FAILED:: no actionHandler"),n=new Re({component:"threeDS2Fingerprint",code:pe.THREEDS2_NO_COMPONENT_FOR_ACTION,errorType:Ie.threeDS2,message:`${ya}: no component defined to handle the action response`}),void this.submitAnalytics(n))}).catch(t=>{this.handleError(t)})}function xr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ea=class extends Dt{beforeRender(){}onComplete(t){this.props.isMDFlow?this.props.on3DS2RedirectFlowComplete?.(t,this.elementRef):super.onComplete(t),this.unmount()}componentToRender(){if(!Tt(this.props.paymentData)){this.props.onError(new F(Ai,"No paymentData received. 3DS2 Fingerprint cannot proceed"));const t=new Re({component:this.type,code:pe.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA,errorType:Ie.threeDS2,message:`${ho}: Missing 'paymentData' property from threeDS2 action`});return this.submitAnalytics(t),null}return u(ka,{...this.props,onComplete:this.props.isMDFlow?this.onComplete:this.callSubmit3DS2Fingerprint,onSubmitAnalytics:this.submitAnalytics,onActionHandled:this.onActionHandled})}constructor(...t){super(...t),xr(this,"callSubmit3DS2Fingerprint",J1.bind(this)),xr(this,"onActionHandled",n=>{const o=new Ze({component:this.type,type:it.threeDS2,subType:St.fingerprintIframeLoaded,message:n.actionDescription});this.submitAnalytics(o),super.onActionHandled(n)})}};xr(Ea,"type",g.threeDS2Fingerprint),xr(Ea,"defaultProps",{dataKey:"fingerprintResult",type:Tc});function X1({label:e=null,icon:t=null,payButton:n,onSubmit:o,name:r,showPayButton:i,...a}){const{i18n:s}=O(),[l,c]=w("ready"),{amount:d}=ro();if(this.setStatus=p=>{c(p)},i)return u(G,null,n({...a,status:l,icon:t,classNameModifiers:["standalone"],label:e||(d&&{}.hasOwnProperty.call(d,"value")&&d.value===0?`${s.get("preauthorizeWith")} ${r}`:`${s.get("continueTo")} ${r}`),onClick:o}))}const ef=({buttonStyle:e,buttonType:t,buttonLocale:n,onClick:o})=>u("apple-pay-button",{"data-testid":"apple-pay-button",buttonstyle:e,type:t,locale:n,onclick:o});function Uc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let tf=class{begin(){return this.session.begin()}onvalidatemerchant(t,n){return new Promise((o,r)=>{n(o,r,t.validationURL)}).then(o=>{this.session.completeMerchantValidation(o)}).catch(o=>{console.error(o),this.session.abort(),this.options.onError(o)})}onpaymentauthorized(t,n){return new Promise((o,r)=>n(o,r,t)).then(o=>{this.session.completePayment(o)}).catch(o=>{this.session.completePayment(o)})}onpaymentmethodselected(t,n){return new Promise((o,r)=>n(o,r,t)).then(o=>{this.session.completePaymentMethodSelection(o)}).catch(o=>{this.session.completePaymentMethodSelection(o)})}onshippingcontactselected(t,n){return new Promise((o,r)=>n(o,r,t)).then(o=>{this.session.completeShippingContactSelection(o)}).catch(o=>{this.session.completeShippingContactSelection(o)})}onshippingmethodselected(t,n){return new Promise((o,r)=>n(o,r,t)).then(o=>{this.session.completeShippingMethodSelection(o)}).catch(o=>{this.session.completeShippingMethodSelection(o)})}oncouponcodechanged(t,n){return new Promise((o,r)=>n(o,r,t)).then(o=>{this.session.completeCouponCodeChange(o)}).catch(o=>{this.session.completeCouponCodeChange(o)})}oncancel(t,n){n(t)}constructor(t,n){Uc(this,"session",void 0),Uc(this,"options",void 0),this.options=n,this.session=new ApplePaySession(n.version,t),this.session.onvalidatemerchant=o=>{this.onvalidatemerchant(o,n.onValidateMerchant)},this.session.onpaymentauthorized=o=>{this.onpaymentauthorized(o,n.onPaymentAuthorized)},this.session.oncancel=o=>{this.oncancel(o,n.onCancel)},typeof n.onPaymentMethodSelected=="function"&&(this.session.onpaymentmethodselected=o=>{this.onpaymentmethodselected(o,n.onPaymentMethodSelected)}),typeof n.onShippingContactSelected=="function"&&(this.session.onshippingcontactselected=o=>{this.onshippingcontactselected(o,n.onShippingContactSelected)}),typeof n.onShippingMethodSelected=="function"&&(this.session.onshippingmethodselected=o=>{this.onshippingmethodselected(o,n.onShippingMethodSelected)}),typeof n.onCouponCodeChanged=="function"&&(this.session.oncouponcodechanged=o=>{this.oncouponcodechanged(o,n.onCouponCodeChanged)})}};const nf={isExpress:!1,amount:{currency:"USD",value:0},totalPriceStatus:"final",initiative:"web",merchantCapabilities:["supports3DS"],supportedNetworks:["amex","discover","masterCard","visa"],buttonType:"plain",buttonColor:"black",onClick:e=>e()},of=e=>{const{countryCode:t,companyName:n,amount:o,...r}=e,i=(a=>String(ua(a.value,a.currency)))(o);return t||console.warn("Apple Pay - Make sure to set the countryCode in the AdyenCheckout configuration or in the Checkout Session creation"),{countryCode:t,currencyCode:o.currency,total:{label:r.totalPriceLabel,amount:i,type:r.totalPriceStatus},lineItems:r.lineItems,shippingContactEditingMode:r.shippingContactEditingMode,shippingMethods:r.shippingMethods,shippingType:r.shippingType,recurringPaymentRequest:r.recurringPaymentRequest,merchantCapabilities:r.merchantCapabilities,supportedCountries:r.supportedCountries,supportedNetworks:r.supportedNetworks,requiredShippingContactFields:r.requiredShippingContactFields,requiredBillingContactFields:r.requiredBillingContactFields,billingContact:r.billingContact,shippingContact:r.shippingContact,applicationData:r.applicationData,couponCode:r.couponCode,supportsCouponCode:r.supportsCouponCode}};function rf(e){try{for(let t=e;t>0;t--)if(typeof ApplePaySession?.supportsVersion=="function"&&ApplePaySession.supportsVersion(t))return t}catch(t){console.warn(t)}return null}function Hc(e,t){if(e)return{city:e.locality,country:e.countryCode,houseNumberOrName:"ZZ",postalCode:e.postalCode,street:e.addressLines?.join(" ").trim(),...e.administrativeArea&&{stateOrProvince:e.administrativeArea},...t&&{firstName:e.givenName,lastName:e.familyName}}}function af(e){const t={mc:"masterCard",amex:"amex",visa:"visa",elodebit:"elo",elo:"elo",interac:"interac",discover:"discover",jcb:"jcb",electron:"electron",maestro:"maestro",girocard:"girocard",cartebancaire:"cartesBancaires",eftpos_australia:"eftpos"};return e.reduce((n,o)=>(t[o]&&!n.includes(t[o])&&n.push(t[o]),n),[])}function Kc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sf="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js";let lf=class{async load(){try{const t=new ao({src:sf,component:"applepay",attributes:{crossOrigin:"anonymous"},analytics:this.analytics});return this.sdkLoadingPromise=t.load(),await this.sdkLoadingPromise,window?.ApplePaySession}catch(t){throw new F("SCRIPT_ERROR","ApplePaySDK failed to load",{cause:t})}}isSdkLoaded(){return this.sdkLoadingPromise===void 0?Promise.reject():this.sdkLoadingPromise}constructor({analytics:t}){Kc(this,"sdkLoadingPromise",void 0),Kc(this,"analytics",void 0),this.analytics=t}};const cf=()=>{if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}};function mo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class fo extends Dt{formatProps(t){const n=t.brands?.length?af(t.brands):t.supportedNetworks;return{...t,configuration:t.configuration,supportedNetworks:n,buttonLocale:t.buttonLocale??t.i18n?.locale,totalPriceLabel:t.totalPriceLabel||t.configuration?.merchantName,renderApplePayCodeAs:t.renderApplePayCodeAs??(cf()?"window":"modal")}}formatData(){const{applePayToken:t,billingAddress:n,deliveryAddress:o}=this.state,{isExpress:r}=this.props;return{paymentMethod:{type:fo.type,applePayToken:t,...r&&{subtype:"express"}},...n&&{billingAddress:n},...o&&{deliveryAddress:o}}}beforeRender(t){const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.isExpress&&{isExpress:t.isExpress},...t?.expressPage&&{expressPage:t.expressPage}});this.analytics.sendAnalytics(n)}get isValid(){return!0}async applePayCapabilities(t){const n=t||this.props.configuration.merchantId;try{return await this.sdkLoader.isSdkLoaded(),await ApplePaySession?.applePayCapabilities(n)}catch(o){throw new F("ERROR","Apple Pay: Error when requesting applePayCapabilities()",{cause:o})}}async isAvailable(){if(window.location.protocol!=="https:")return Promise.reject(new F("IMPLEMENTATION_ERROR","Trying to start an Apple Pay session from an insecure document"));try{return await this.sdkLoader.isSdkLoaded(),ApplePaySession?.canMakePayments()?Promise.resolve():Promise.reject(new F("ERROR","Apple Pay is not available on this device"))}catch(t){return Promise.reject(new F("ERROR","Apple Pay SDK failed to load",{cause:t}))}}defineApplePayVersionNumber(){window.location.protocol==="https:"&&(this.applePayVersionNumber=this.props.version||rf(14))}configureApplePayWebOptions(){if(window.ApplePayWebOptions){const{renderApplePayCodeAs:t,onApplePayCodeClose:n}=this.props;window.ApplePayWebOptions.set({renderApplePayCodeAs:t,...n&&{onApplePayCodeClose:n}})}}startSession(){const{onValidateMerchant:t,onPaymentMethodSelected:n,onShippingMethodSelected:o,onShippingContactSelected:r,onCouponCodeChanged:i}=this.props,a=of({companyName:this.props.configuration.merchantName,countryCode:this.core.options.countryCode,...this.props}),s=new tf(a,{version:this.applePayVersionNumber,onError:l=>{this.handleError(new F("ERROR","ApplePay - Something went wrong on ApplePayService",{cause:l}))},onCancel:l=>{this.handleError(new F("CANCEL","ApplePay UI dismissed",{cause:l}))},onPaymentMethodSelected:n,onShippingMethodSelected:o,onShippingContactSelected:r,onCouponCodeChanged:i,onValidateMerchant:t||this.validateMerchant,onPaymentAuthorized:(l,c,d)=>{const p=Hc(d.payment.billingContact),h=Hc(d.payment.shippingContact,!0);this.setState({applePayToken:btoa(JSON.stringify(d.payment.token.paymentData)),authorizedEvent:d,...p&&{billingAddress:p},...h&&{deliveryAddress:h}}),this.handleAuthorization().then(this.makePaymentsCall).then(co).then(uo).then(this.collectOrderTrackingDetailsIfNeeded).then(({paymentResponse:m,orderDetails:f})=>(l({status:ApplePaySession.STATUS_SUCCESS,...f&&{orderDetails:f}}),m)).then(m=>{this.handleResponse(m)}).catch(m=>{const f=m?.error?.applePayError;c({status:ApplePaySession.STATUS_FAILURE,errors:f?Array.isArray(f)?f:[f]:void 0});const y={...m,error:{applePayError:f}};this.handleFailedResult(y)})}});return new Promise((l,c)=>this.props.onClick(l,c)).then(()=>{s.begin()}).catch(()=>({}))}async handleAuthorization(){return new Promise((t,n)=>{this.props.onAuthorized||t();const{authorizedEvent:o,billingAddress:r,deliveryAddress:i}=this.state;this.props.onAuthorized({authorizedEvent:o,...r&&{billingAddress:r},...i&&{deliveryAddress:i}},{resolve:t,reject:n})}).catch(t=>{const n={error:{applePayError:t}};return Promise.reject(n)})}async collectOrderTrackingDetailsIfNeeded(t){return new Promise((n,o)=>{if(!this.props.onOrderTrackingRequest)return n();this.props.onOrderTrackingRequest(n,o)}).then(n=>({paymentResponse:t,...n&&{orderDetails:n}})).catch(()=>({paymentResponse:t}))}async validateMerchant(t,n){const{hostname:o}=window.location,{clientKey:r,configuration:i,loadingContext:a,initiative:s,domainName:l}=this.props,{merchantName:c,merchantId:d}=i,p={loadingContext:a,path:`v1/applePay/sessions?clientKey=${r}`},h={displayName:c,domainName:l||o,initiative:s,merchantIdentifier:d};try{const m=await Ve(p,h),f=En.decode(m.data);f.success?t(JSON.parse(f.data)):n("Could not decode Apple Pay session")}catch{n("Could not get Apple Pay session")}}componentToRender(){return this.props.showPayButton?u(ef,{buttonStyle:this.props.buttonColor,buttonType:this.props.buttonType,buttonLocale:this.props.buttonLocale,onClick:this.submit}):null}constructor(t,n){super(t,n),mo(this,"sdkLoader",void 0),mo(this,"applePayVersionNumber",void 0),mo(this,"submit",()=>{if(this.props.isInstantPayment){const a=new Te({component:this.type,type:ge.selected,target:Sn.instantPaymentButton});this.submitAnalytics(a)}this.startSession()});const{isExpress:o,onShippingContactSelected:r,onShippingMethodSelected:i}=this.props;if(o===!1&&(r||i))throw new F("IMPLEMENTATION_ERROR",'ApplePay - You must set "isExpress" flag to "true" in order to use "onShippingContactSelected" and/or "onShippingMethodSelected" callbacks');this.startSession=this.startSession.bind(this),this.submit=this.submit.bind(this),this.validateMerchant=this.validateMerchant.bind(this),this.collectOrderTrackingDetailsIfNeeded=this.collectOrderTrackingDetailsIfNeeded.bind(this),this.handleAuthorization=this.handleAuthorization.bind(this),this.defineApplePayVersionNumber=this.defineApplePayVersionNumber.bind(this),this.configureApplePayWebOptions=this.configureApplePayWebOptions.bind(this),this.sdkLoader=new lf({analytics:this.analytics}),this.sdkLoader.load().then(this.defineApplePayVersionNumber).then(this.configureApplePayWebOptions).catch(a=>{this.handleError(a)})}}mo(fo,"type",g.applepay),mo(fo,"defaultProps",nf);var Tn={API_VERSION:2,API_VERSION_MINOR:0,GATEWAY:"adyen",URL:"https://pay.google.com/gp/p/js/pay.js"};function df({allowedAuthMethods:e,allowedCardNetworks:t,existingPaymentMethodRequired:n=!1}){return{apiVersion:Tn.API_VERSION,apiVersionMinor:Tn.API_VERSION_MINOR,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:e,allowedCardNetworks:t},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{}}}],existingPaymentMethodRequired:n}}function uf({amount:e,countryCode:t="US",totalPriceStatus:n="FINAL",...o}){const r=String(ua(e.value,e.currency));return{countryCode:t,currencyCode:e.currency,totalPrice:r,totalPriceStatus:n,...o.transactionInfo}}function jc({configuration:e,...t},n){return{apiVersion:Tn.API_VERSION,apiVersionMinor:Tn.API_VERSION_MINOR,transactionInfo:uf({countryCode:n,...t}),merchantInfo:{merchantId:e.merchantId,merchantName:e.merchantName,...e.merchantOrigin?{merchantOrigin:e.merchantOrigin}:{},...e.authJwt?{authJwt:e.authJwt}:{}},allowedPaymentMethods:[{type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:Tn.GATEWAY,gatewayMerchantId:e.gatewayMerchantId}},parameters:{allowedAuthMethods:t.allowedAuthMethods,allowedCardNetworks:t.allowedCardNetworks,assuranceDetailsRequired:t.assuranceDetailsRequired,allowPrepaidCards:t.allowPrepaidCards,allowCreditCards:t.allowCreditCards,allowedIssuerCountryCodes:t.allowedIssuerCountryCodes,blockedIssuerCountryCodes:t.blockedIssuerCountryCodes,billingAddressRequired:t.billingAddressRequired,billingAddressParameters:t.billingAddressParameters}}],emailRequired:t.emailRequired,shippingAddressRequired:t.shippingAddressRequired,shippingAddressParameters:t.shippingAddressParameters,shippingOptionRequired:t.shippingOptionRequired,shippingOptionParameters:t.shippingOptionParameters,callbackIntents:t.callbackIntents}}function hf(e="PRODUCTION"){switch(e){case"beta":case"test":return"TEST";default:return"PRODUCTION"}}function zc(e,t){if(e)return{postalCode:e.postalCode,country:e.countryCode,street:[e.address1,e.address2,e.address3].join(" ").trim(),houseNumberOrName:"ZZ",city:e.locality||"",...e.administrativeArea&&{stateOrProvince:e.administrativeArea},...t&&{firstName:e.name}}}const pf=["en","ar","bg","ca","cs","da","de","el","es","et","fi","fr","hr","id","it","ja","ko","ms","nl","no","pl","pt","ru","sk","sl","sr","sv","th","tr","uk","zh"];function mf(e=""){const t=e.toLowerCase().substring(0,2);return pf.includes(t)?t:null}function qc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ff=class{async getGooglePaymentsClient(t){return window.google?.payments||await new ao({src:Tn.URL,component:"googlepay",analytics:this.analytics}).load(),new google.payments.api.PaymentsClient(t)}isReadyToPay(t){return this.paymentsClient?this.paymentsClient.then(n=>n.isReadyToPay(df(t))):Promise.reject(new Error("Google Pay is not available"))}prefetchPaymentData(t,n){if(!this.paymentsClient)throw new Error("Google Pay is not available");const o=jc(t,n);this.paymentsClient.then(r=>r.prefetchPaymentData(o))}initiatePayment(t,n){if(!this.paymentsClient)throw new Error("Google Pay is not available");const o=jc(t,n);return this.paymentsClient.then(r=>r.loadPaymentData(o))}constructor(t,n,o){qc(this,"analytics",void 0),qc(this,"paymentsClient",void 0);const r=hf(t);this.analytics=n,this.paymentsClient=this.getGooglePaymentsClient({environment:r,paymentDataCallbacks:o})}};const yf=e=>{const t=W(void 0);return R(()=>{const{onClick:n,buttonRadius:o,buttonColor:r,buttonType:i,buttonLocale:a,buttonSizeMode:s,buttonRootNode:l,paymentsClient:c}=e;c.then(d=>d.createButton({onClick:n,buttonType:i,buttonColor:r,buttonLocale:a,buttonSizeMode:s,buttonRootNode:l,...o!==void 0&&{buttonRadius:o}})).then(d=>{t.current&&t.current.appendChild(d)})},[e.buttonColor,e.buttonType,e.buttonLocale,e.buttonSizeMode,e.buttonRootNode,e.paymentsClient]),u("div",{"data-testid":"googlepay-button-container",className:"adyen-checkout__paywithgoogle",ref:t})},gf={isExpress:!1,existingPaymentMethodRequired:!1,buttonColor:"default",buttonType:"buy",buttonSizeMode:"fill",configuration:{gatewayMerchantId:"",merchantId:"",merchantName:""},amount:{value:0,currency:"USD"},totalPriceStatus:"FINAL",onClick:e=>e(),allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowCreditCards:!0,allowPrepaidCards:!0,billingAddressRequired:!1,billingAddressParameters:void 0,assuranceDetailsRequired:!1,emailRequired:!1,shippingAddressRequired:!1,shippingAddressParameters:void 0,shippingOptionRequired:!1,shippingOptionParameters:void 0,callbackIntents:[]},bf=Object.freeze({mc:"MASTERCARD",amex:"AMEX",visa:"VISA",elodebit:"ELO_DEBIT",elo:"ELO",interac:"INTERAC",discover:"DISCOVER",jcb:"JCB",electron:"ELECTRON",maestro:"MAESTRO"});function vf(e){const t=e.map(n=>bf[n]).filter(n=>!!n);return[...new Set(t)]}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cf=["AMEX","DISCOVER","JCB","MASTERCARD","VISA"];class Pr extends Dt{getPaymentMethodFromPaymentMethodsResponse(t,n){return n?this.core.paymentMethodsResponse.findById(n):this.core.paymentMethodsResponse.find(t||this.constructor.type)||this.core.paymentMethodsResponse.find(g.paywithgoogle)}formatProps(t){const n=t.buttonSizeMode??(t.isDropin?"fill":"static"),o=mf(t.buttonLocale??t.i18n?.locale),r=[...t.callbackIntents,"PAYMENT_AUTHORIZATION"],i=this.createAllowedCardNetworksValues({allowedCardNetworks:t.allowedCardNetworks,brands:t.brands});return{...t,allowedCardNetworks:i,configuration:t.configuration,buttonSizeMode:n,buttonLocale:o,callbackIntents:r}}formatData(){const{googlePayCardNetwork:t,googlePayToken:n,billingAddress:o,deliveryAddress:r}=this.state,{isExpress:i}=this.props;return{paymentMethod:{type:this.type,googlePayCardNetwork:t,googlePayToken:n,...i&&{subtype:"express"}},browserInfo:this.browserInfo,origin:!!window&&window.location.origin,...o&&{billingAddress:o},...r&&{deliveryAddress:r}}}createAllowedCardNetworksValues({allowedCardNetworks:t,brands:n}){return t?.length>0?t:n?.length>0?vf(n):Cf}beforeRender(t){if(t?.originalAction)return;const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.isExpress&&{isExpress:t.isExpress},...t?.expressPage&&{expressPage:t.expressPage}});this.analytics.sendAnalytics(n)}showGooglePayPaymentSheet(){this.googlePay.initiatePayment(this.props,this.core.options.countryCode).catch(t=>{this.handleError(new F(t.statusCode==="CANCELED"?"CANCEL":"ERROR",t.toString(),{cause:t}))})}async handleAuthorization(){return new Promise((t,n)=>{this.props.onAuthorized||t();const{authorizedEvent:o,billingAddress:r,deliveryAddress:i}=this.state;this.props.onAuthorized({authorizedEvent:o,...r&&{billingAddress:r},...i&&{deliveryAddress:i}},{resolve:t,reject:n})}).catch(t=>{const n={error:{googlePayError:t}};return Promise.reject(n)})}get isValid(){return!0}async isAvailable(){return this.isReadyToPay().then(t=>{if(!t.result)throw new F("ERROR","GooglePay is not available");if(t.paymentMethodPresent===!1)throw new F("ERROR","GooglePay - No paymentMethodPresent");return Promise.resolve()}).catch(t=>Promise.reject(t))}get browserInfo(){return yr()}get icon(){return this.props.icon??this.resources.getImage()("googlepay")}componentToRender(){return this.props.showPayButton?u(yf,{buttonColor:this.props.buttonColor,buttonType:this.props.buttonType,buttonSizeMode:this.props.buttonSizeMode,buttonLocale:this.props.buttonLocale,buttonRootNode:this.props.buttonRootNode,buttonRadius:this.props.buttonRadius,paymentsClient:this.googlePay.paymentsClient,onClick:this.submit}):null}constructor(t,n){super(t,n),Vt(this,"googlePay",void 0),Vt(this,"submit",()=>{if(this.props.isInstantPayment){const i=new Te({component:this.type,type:ge.selected,target:Sn.instantPaymentButton});this.submitAnalytics(i)}new Promise((i,a)=>this.props.onClick(i,a)).then(this.showGooglePayPaymentSheet).catch(()=>{})}),Vt(this,"onPaymentAuthorized",async i=>{const a=zc(i.paymentMethodData.info.billingAddress),s=zc(i.shippingAddress,!0);return this.setState({authorizedEvent:i,googlePayToken:i.paymentMethodData.tokenizationData.token,googlePayCardNetwork:i.paymentMethodData.info.cardNetwork,...a&&{billingAddress:a},...s&&{deliveryAddress:s}}),new Promise(l=>{this.handleAuthorization().then(this.makePaymentsCall).then(co).then(uo).then(c=>(l({transactionState:"SUCCESS"}),c)).then(c=>{this.handleResponse(c)}).catch(c=>{this.setElementStatus("ready");const d=c?.error?.googlePayError,p=this.props.i18n.get("error.subtitle.payment"),h=typeof d=="string"?{intent:"PAYMENT_AUTHORIZATION",reason:"OTHER_ERROR",message:d||p}:{intent:d?.intent||"PAYMENT_AUTHORIZATION",reason:d?.reason||"OTHER_ERROR",message:d?.message||p};l({transactionState:"ERROR",error:h});const m={...c,error:{googlePayError:h}};this.handleFailedResult(m)})})}),Vt(this,"isReadyToPay",()=>this.googlePay.isReadyToPay(this.props)),Vt(this,"prefetch",()=>this.googlePay.prefetchPaymentData(this.props,this.core.options.countryCode)),this.handleAuthorization=this.handleAuthorization.bind(this),this.showGooglePayPaymentSheet=this.showGooglePayPaymentSheet.bind(this);const{isExpress:o,paymentDataCallbacks:r}=this.props;if(o===!1&&r?.onPaymentDataChanged)throw new F("IMPLEMENTATION_ERROR",'GooglePay - You must set "isExpress" flag to "true" in order to use "onPaymentDataChanged" callback');if(!this.props.configuration.merchantId)throw new F("IMPLEMENTATION_ERROR","GooglePay - Missing merchantId. Please ensure that it is correctly configured in your customer area.");this.googlePay=new ff(this.props.environment,this.analytics,{...o&&r?.onPaymentDataChanged&&{onPaymentDataChanged:r.onPaymentDataChanged},onPaymentAuthorized:this.onPaymentAuthorized})}}Vt(Pr,"type",g.googlepay),Vt(Pr,"txVariants",[g.googlepay,g.paywithgoogle]),Vt(Pr,"defaultProps",gf);var Wc=()=>{try{if(window.parent.location.href)return window.location!==window.parent.location}catch{return!1}};function Gc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Yc=class extends Ae{componentDidMount(){new Promise((t,n)=>{this.props.beforeRedirect(t,n,{url:this.props.url,method:this.props.method,...this.props.data?{data:this.props.data}:{}})}).then(()=>{this.props.onActionHandled?.({componentType:this.props.paymentMethodType,actionDescription:"performing-redirect"}),this.postForm?this.postForm.submit():this.props.redirectFromTopWhenInIframe&&Wc()?window.top.location.assign?.(this.props.url):window.location.assign(this.props.url)}).catch(()=>{this.props.onRedirectError()})}render({url:t,method:n,data:o={}}){return n==="POST"?u("form",{method:"post","data-testid":"redirect-shopper-form",action:t,style:{display:"none"},ref:r=>{this.postForm=r},...this.props.redirectFromTopWhenInIframe&&Wc()&&{target:"_top"}},Object.keys(o).map(r=>u("input",{type:"hidden",name:r,key:r,value:o[r]}))):null}constructor(...t){super(...t),Gc(this,"postForm",void 0)}};Gc(Yc,"defaultProps",{beforeRedirect:e=>e(),onRedirectError:()=>{},method:"GET"});function xa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class yo extends Dt{formatData(){return{paymentMethod:{type:this.type},browserInfo:this.browserInfo}}get isRedirecting(){return!!this.props.url&&!!this.props.method}get isValid(){return!0}get browserInfo(){return yr()}componentToRender(){return this.isRedirecting?u(Yc,{url:this.props.url,...this.props,onActionHandled:this.onActionHandled,onRedirectError:this.handleRedirectError}):this.props.showPayButton?u(X1,{...this.props,showPayButton:this.props.showPayButton,name:this.displayName,onSubmit:this.submit,payButton:this.payButton,ref:t=>{this.componentRef=t}}):null}constructor(...t){super(...t),xa(this,"handleRedirectError",()=>{const n=new Re({component:this.props.paymentMethodType,errorType:Ie.redirect,code:pe.REDIRECT});super.submitAnalytics(n)})}}xa(yo,"type",g.redirect),xa(yo,"defaultProps",{type:yo.type});const _f={test:"https://checkoutshopper-test.adyen.com/checkoutshopper/",live:"https://checkoutshopper-live.adyen.com/checkoutshopper/","live-us":"https://checkoutshopper-live-us.adyen.com/checkoutshopper/","live-au":"https://checkoutshopper-live-au.adyen.com/checkoutshopper/","live-apse":"https://checkoutshopper-live-apse.adyen.com/checkoutshopper/","live-in":"https://checkoutshopper-live-in.adyen.com/checkoutshopper/","live-nea":"https://checkoutshopper-live-nea.adyen.com/checkoutshopper/",fallback:"https://checkoutshopper-live.adyen.com/checkoutshopper/"},Zc={test:"https://checkoutshopper-test.cdn.adyen.com/checkoutshopper/",live:"https://checkoutshopper-live.cdn.adyen.com/checkoutshopper/","live-us":"https://checkoutshopper-live-us.cdn.adyen.com/checkoutshopper/","live-au":"https://checkoutshopper-live-au.cdn.adyen.com/checkoutshopper/","live-apse":"https://checkoutshopper-live-apse.cdn.adyen.com/checkoutshopper/","live-in":"https://checkoutshopper-live-in.cdn.adyen.com/checkoutshopper/","live-nea":"https://checkoutshopper-live-nea.cdn.adyen.com/checkoutshopper/",fallback:"https://checkoutshopper-live.cdn.adyen.com/checkoutshopper/"},wf={test:"https://checkoutanalytics-test.adyen.com/checkoutanalytics/",live:"https://checkoutanalytics-live.adyen.com/checkoutanalytics/","live-us":"https://checkoutanalytics-live-us.adyen.com/checkoutanalytics/","live-au":"https://checkoutanalytics-live-au.adyen.com/checkoutanalytics/","live-apse":"https://checkoutanalytics-live-apse.adyen.com/checkoutanalytics/","live-in":"https://checkoutanalytics-live-in.adyen.com/checkoutanalytics/","live-nea":"https://checkoutanalytics-live-nea.adyen.com/checkoutanalytics/",fallback:"https://checkoutanalytics-live.adyen.com/checkoutanalytics/"},Tr=(e,t,n)=>n||t[e]||t.fallback,Sf=(e,t)=>({apiUrl:Tr(e,_f,t?.api),analyticsUrl:Tr(e,wf,t?.analytics),cdnImagesUrl:Tr(e,Zc,t?.cdn?.images),cdnTranslationsUrl:Tr(e,Zc,t?.cdn?.translations)});function kf(e){return Object.keys(e).reduce((t,n)=>(J0.includes(n)&&(t[n]=e[n]),t),{})}function Ef(e){const t=(n=>n)(["session","environment","_environmentUrls","showPayButton","clientKey","locale","translations","paymentMethodsResponse","amount","secondaryAmount","countryCode","allowPaymentMethods","removePaymentMethods","srConfig","analytics","risk","order","donation","exposeLibraryMetadata","beforeRedirect","beforeSubmit","onPaymentCompleted","onPaymentFailed","onSubmit","onAdditionalDetails","onActionHandled","onChange","onError","onBalanceCheck","onOrderRequest","onPaymentMethodsRequest","onOrderCancel","onOrderUpdated","loadingContext","onEnterKeyPressed","afterAdditionalDetails"]);Object.keys(e).forEach(n=>{t.includes(n)||console.warn(`AdyenCheckout - Configuration property "${n}" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to "paymentMethodsConfiguration" object`)})}function Qc({logoUrl:e="",nonprofitName:t="",causeName:n="",bannerUrl:o=""}){return u(G,null,u(fe,{className:"adyen-checkout__campaign-background-image",style:{backgroundImage:`url(${o})`},backgroundUrl:o}),u("div",{className:"adyen-checkout__campaign-content"},e&&u("img",{src:e,className:"adyen-checkout__campaign-logo",alt:t}),u("div",null,t&&u("div",{className:"adyen-checkout__campaign-title"},t),n&&u("div",{className:"adyen-checkout__campaign-cause"},n))))}function xf({logoUrl:e="",nonprofitDescription:t="",nonprofitName:n="",causeName:o="",nonprofitUrl:r="",bannerUrl:i=""}){return u("div",{className:"adyen-checkout__campaign"},r?u("a",{href:r,className:"adyen-checkout__campaign-link",target:"_blank",rel:"noopener noreferrer"},u(Qc,{logoUrl:e,nonprofitName:n,causeName:o,bannerUrl:i})):u(Qc,{logoUrl:e,nonprofitName:n,causeName:o,bannerUrl:i}),t&&u("div",{className:"adyen-checkout__campaign-description"},t))}const Pf=({options:e=[],name:t,onChange:n})=>u("div",{className:"adyen-checkout__button-group"},e.map(({label:o,selected:r,value:i,disabled:a},s)=>u("label",{key:`${t}${s}`,className:I({"adyen-checkout__button":!0,"adyen-checkout__button--selected":r,"adyen-checkout__button--disabled":a})},u("input",{type:"radio",className:"adyen-checkout__button-group__input",value:i,checked:r,onChange:n,disabled:a}),u("span",{className:"adyen-checkout__button-text"},o)))),Jc=(e,t)=>e-t%e,Pa=(e,{value:t,currency:n})=>e.amount(t,n),Tf=(e,{maxRoundupAmount:t,commercialTxAmount:n,currency:o})=>Pa(e,{value:Jc(t,n),currency:o});function Df(e){const{currency:t,values:n,selectedAmount:o,status:r,onAmountSelected:i,onDonateButtonClicked:a}=e,{i18n:s}=O();return u(G,null,u("div",{className:"adyen-checkout__amounts"},u(Pf,{options:n.map(l=>({value:l,label:Pa(s,{value:l,currency:t}),disabled:r==="loading",selected:l===o})),name:"amount",onChange:i})),u(Ge,{classNameModifiers:["donate"],onClick:a,label:s.get("donateButton"),disabled:o===null,status:r}))}function Nf(e){const{status:t,donationAmount:n,originalPaymentAmount:o,onDonateButtonClicked:r}=e,{i18n:i}=O();return u(G,null,u(Ge,{classNameModifiers:["donate"],onClick:r,label:`${i.get("donateButton")} ${n}`,status:t}),u("span",{className:"adyen-checkout-roundup-description"},i.get("donationRoundUpDescription",{values:{donationAmount:n,originalPaymentAmount:o}})))}function Xc(e){const{donation:t,commercialTxAmount:n,onAmountSelected:o,onCancel:r,onDonate:i,showCancelButton:a=!0,termsAndConditionsUrl:s}=e,{i18n:l}=O(),c=Pe(),{currency:d,type:p}=t,h=p==="roundup",[m,f]=w("ready"),[y,b]=w(h),[v,C]=w({currency:d,value:h?Jc(t.maxRoundupAmount,n):null});this.setStatus=S=>{f(S)};const _=()=>{f("loading"),i({data:{amount:v}})};return R(()=>{e.onChange({data:{amount:v},isValid:y})},[v,y]),m==="error"?u("div",{className:"adyen-checkout__adyen-giving"},u(fe,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--error",src:c({imageFolder:"components/"})("error"),alt:l.get("error.message.unknown")}),u("div",{className:"adyen-checkout__status__text"},l.get("error.message.unknown"))):m==="success"?u("div",{className:"adyen-checkout__adyen-giving"},u(fe,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--success",src:c({imageFolder:"components/"})("heart"),alt:l.get("thanksForYourSupport")}),u("div",{className:"adyen-checkout__status__text"},l.get("thanksForYourSupport"))):u("div",{className:"adyen-checkout__adyen-giving"},u(xf,e),u("div",{className:"adyen-checkout__adyen-giving-actions"},s&&u(Qi,{message:l.get("donationTermsCondition"),urls:[s]}),h?u(Nf,{donationAmount:Tf(l,{maxRoundupAmount:t.maxRoundupAmount,commercialTxAmount:n,currency:d}),originalPaymentAmount:Pa(l,{value:n,currency:d}),status:m,onDonateButtonClicked:_}):u(Df,{selectedAmount:v.value,values:t.values,currency:d,status:m,onAmountSelected:({target:S})=>{const E=parseInt(S.value,10);b(!0),C(k=>({...k,value:E})),o({data:{amount:{...v,value:E}}})},onDonateButtonClicked:_}),a&&u(Ge,{classNameModifiers:["decline"],variant:"ghost",onClick:()=>{f("ready"),r({data:{amount:v},isValid:y})},disabled:m==="loading",label:`${l.get("notNowButton")} ›`})))}Xc.defaultProps={onCancel:()=>{},onChange:()=>{},onDonate:()=>{},donation:{},showCancelButton:!0};function Dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Af=`Donation instantiation error:: You need to set donation.autoMount to false if you wish to display the Donation component in a different container.
|
|
138
|
-
The Donation component will be displayed in the default container.`;let
|
|
139
|
-
It will not be possible to mount a Donation component.`);return a}async callSessionsDonations(t,n){try{const o=await this.makeSessionDonationsCall(t);o.resultCode==="Authorised"?(n.setStatus("success"),this.onDonationCompleted?.({didDonate:!0})):(n.setStatus("error"),this.onDonationFailed?.(o.resultCode))}catch(o){n.setStatus("error"),this.onDonationFailed?.(o)}}async makeSessionsDonationCampaignsCall(){if(!this.core.session)throw new Error("DonationCampaignService requires a session to be configured");return await this.core.session.fetchDonationCampaigns()}async makeSessionDonationsCall(t){if(!this.core.session)throw new Error("DonationCampaignService requires a session to be configured");return await this.core.session.makeDonation(t)}constructor(t,n){Dn(this,"core",void 0),Dn(this,"commercialTxAmount",0),Dn(this,"onDonationCompleted",void 0),Dn(this,"onDonationFailed",void 0),Dn(this,"delayMS",void 0),this.core=t,this.onDonationCompleted=t.options.donation?.onDonationSuccess,this.onDonationFailed=t.options.donation?.onDonationFailure,this.commercialTxAmount=n.commercialTxAmount,this.delayMS=t.options.donation?.delay??3e3}};Dn(ed,"type","donationCampaignService");function Ta(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Da=class Ro extends Dt{static isServiceMode(t){return"rootNode"in t&&!!t.rootNode}async initialiseServiceMode(t,n){if(t.session)if(t.session.sessionsDonationInitiated)console.error(Af);else{t.session.sessionsDonationInitiated=!0;try{const o=await new ed(t,n).initialise();o&&(this.props={...this.props,...o},this.mount(n.rootNode))}catch(o){t.options.donation?.onDonationFailure?.(o)}}}get data(){return this.state.data}get isValid(){return this.state.isValid}setState(t){this.state={...this.state,...t}}donate(){const t=new Ze({component:Ro.type,type:it.submit,subType:St.donation,message:"Making donation"});this.core.modules.analytics.sendAnalytics(t);const{data:n,isValid:o}=this;this.props.onDonate({data:n,isValid:o},this)}cancel(){const t=new Ze({component:Ro.type,type:it.closed,subType:St.donation,message:"Opting to not make donation"});this.core.modules.analytics.sendAnalytics(t);const{data:n,isValid:o}=this;this.isInServiceMode&&this.unmount(),this.props.onCancel({data:n,isValid:o})}amountSelected(t){const n=new Te({component:Ro.type,type:ge.selected,selectedValue:JSON.stringify(t.data.amount),target:Sn.donationAmountButton});this.core.modules.analytics.sendAnalytics(n)}componentToRender(){return u(Xc,{...this.props,ref:t=>{this.componentRef=t},onChange:this.setState,onDonate:this.donate,onCancel:this.cancel,onAmountSelected:this.amountSelected})}constructor(t,n){const o=Ro.isServiceMode(n);super(t,o?void 0:n),Ta(this,"isInServiceMode",!1),this.donate=this.donate.bind(this),this.cancel=this.cancel.bind(this),this.amountSelected=this.amountSelected.bind(this),this.isInServiceMode=o,t.session&&o&&this.initialiseServiceMode(t,n)}};Ta(Da,"type",g.donation),Ta(Da,"defaultProps",{onCancel:()=>{},onDonate:()=>{}});function Dr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let If=class{get length(){return Object.keys(this.storage).length}key(t){return Object.keys(this.storage)[t]??null}getItem(t){return this.storage[t]||null}setItem(t,n){this.storage[t]=n}removeItem(t){delete this.storage[t]}clear(){this.storage={}}constructor(){Dr(this,"storage",void 0),this.storage={}}},td=class{get(){try{const t=this.storage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}set(t){this.storage.setItem(this.key,JSON.stringify(t))}remove(){this.storage.removeItem(this.key)}clear(){this.storage.clear()}keyByIndex(t){return this.storage.key(t)}get length(){return this.storage.length}constructor(t,n){Dr(this,"prefix","adyen-checkout__"),Dr(this,"key",void 0),Dr(this,"storage",void 0);try{if(this.storage=n?window[n]:window.localStorage,!this.storage)throw new Error("storage does not exist")}catch{this.storage=new If}this.key=this.prefix+t}};function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rf=rm;let $f=class{get checkoutAttemptId(){return this._checkoutAttemptId}set checkoutAttemptId(t){this._checkoutAttemptId=t}async setUp({sessionId:t,checkoutStage:n,locale:o}={}){try{const r=this.storage.get(),i=(function(d){if(!d?.timestamp)return!1;const p=Date.now()-9e5;return d.timestamp>p})(r),{applicationInfo:a,checkoutAttemptId:s}=Pm(this.analyticsData)??{},l=i?r?.id:s,c={version:na,buildType:zl,channel:oa.WEB,platform:ra,locale:o,referrer:window.location.href,screenWidth:window.screen.width,checkoutStage:n||"checkout",level:this.enabled?"all":"initial",...a&&{applicationInfo:a},...t&&{sessionId:t},...l&&{checkoutAttemptId:l}};this.checkoutAttemptId=await this.service.requestCheckoutAttemptId(c),this.dispatchPendingAnalytics(),this.storage.set({id:this.checkoutAttemptId,timestamp:i?r.timestamp:Date.now()})}catch(r){this.enabled=!1,console.warn("Analytics: Error setting up",r)}}sendAnalytics(t){if(this.enabled)try{this.addEventToQueue(t)}catch(n){console.warn("Analytics: Error adding event to queue",n)}}async sendFlavor(t){this.isFlavorReported||(this.checkoutAttemptId?await this.dispatchFlavor(t):this.pendingFlavor||(this.pendingFlavor=t))}async dispatchFlavor(t){if(!this.isFlavorReported&&this.checkoutAttemptId){this.isFlavorReported=!0;try{await this.service.reportIntegrationFlavor(t,this.checkoutAttemptId)}catch(n){console.warn("Analytics: Error reporting flavor",n)}}}flush(){this.sendEvents()}addEventToQueue(t){this.eventsQueue.add(t),t.getEventCategory()===Yt.info?this.debouncedSendInfoEvents():this.debouncedSendEvents()}async sendEvents(){if(!this.checkoutAttemptId||!this.enabled||!this.eventsQueue.hasEvents)return;const t={channel:oa.WEB,platform:ra,info:this.eventsQueue.infoEvents,errors:this.eventsQueue.errorEvents,logs:this.eventsQueue.logEvents};this.eventsQueue.clear();try{await this.service.sendEvents(t,this.checkoutAttemptId)}catch(n){console.warn("Analytics: Error sending events",n)}}dispatchPendingAnalytics(){if(!this.isFlavorReported&&this.pendingFlavor){const t=this.pendingFlavor;this.pendingFlavor=void 0,this.dispatchFlavor(t)}this.sendEvents()}constructor({service:t,eventQueue:n,enabled:o,analyticsData:r}){Et(this,"analyticsData",void 0),Et(this,"service",void 0),Et(this,"eventsQueue",void 0),Et(this,"storage",new td("checkout-attempt-id","sessionStorage")),Et(this,"debouncedSendInfoEvents",void 0),Et(this,"debouncedSendEvents",void 0),Et(this,"_checkoutAttemptId",void 0),Et(this,"enabled",!0),Et(this,"isFlavorReported",!1),Et(this,"pendingFlavor",void 0),this.service=t,this.eventsQueue=n,this.debouncedSendInfoEvents=aa(this.sendEvents.bind(this),1e4),this.debouncedSendEvents=aa(this.sendEvents.bind(this),Rf),o!==void 0&&(this.enabled=o),r&&(this.analyticsData=r)}};function Na(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ff=class{add(t){const n=t.getEventCategory();n===Yt.info&&this.info.push(t),n===Yt.error&&this.errors.push(t),n===Yt.log&&this.logs.push(t)}get infoEvents(){return this.info}get errorEvents(){return this.errors}get logEvents(){return this.logs}get hasEvents(){return this.info.length>0||this.errors.length>0||this.logs.length>0}clear(){this.info=[],this.errors=[],this.logs=[]}constructor(){Na(this,"info",[]),Na(this,"errors",[]),Na(this,"logs",[])}};function nd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Aa="v3/analytics";let Mf=class{async requestCheckoutAttemptId(t){const n={loadingContext:this.analyticsContext,path:`${Aa}?clientKey=${this.clientKey}`};try{const{checkoutAttemptId:o}=await Ve(n,t);return o}catch(o){throw new F("NETWORK_ERROR","requestCheckoutAttemptId() - failed to get checkout attempt ID",{cause:o})}}async sendEvents(t,n){if(!n)throw new F("IMPLEMENTATION_ERROR","sendEvents() - checkoutAttemptId is required");if(!t.info.length&&!t.errors.length&&!t.logs.length)return Promise.resolve();const o={loadingContext:this.analyticsContext,path:`${Aa}/${n}?clientKey=${this.clientKey}`};try{await Ve(o,t)}catch(r){throw new F("NETWORK_ERROR","sendEvents() - failed to send events",{cause:r})}}async reportIntegrationFlavor(t,n){if(!t||!n)throw new F("IMPLEMENTATION_ERROR","reportIntegrationFlavor() - flavor or checkoutAttemptId is required");const o={loadingContext:this.analyticsContext,path:`${Aa}?clientKey=${this.clientKey}`},r={flavor:t,checkoutAttemptId:n};try{await Ve(o,r)}catch(i){throw new F("NETWORK_ERROR","reportIntegrationFlavor() - failed to send flavor",{cause:i})}}constructor({clientKey:t,analyticsContext:n}){nd(this,"clientKey",void 0),nd(this,"analyticsContext",void 0),this.clientKey=t,this.analyticsContext=n}};var Ia={payButton:"Pay","payButton.redirecting":"Redirecting...","payButton.with":"Pay %{value} with %{maskedData}","payButton.saveDetails":"Save details",close:"Close",storeDetails:"Save for my next payment",readMore:"Read more","creditCard.holderName":"Name on card","creditCard.holderName.invalid":"Enter name as shown on card","creditCard.expiryDateField.month":"Month","creditCard.expiryDateField.year":"Year","creditCard.storeDetailsButton":"Remember for next time","creditCard.dualBrand.title":"Card Brand","creditCard.dualBrand.description":"You can select the card brand you prefer to pay with. This is optional.",installments:"Number of installments",installmentOption:"%{times}x %{partialValue}",installmentOptionMonths:"%{times} months","installments.oneTime":"One time payment","installments.installments":"Installments payment","installments.revolving":"Revolving payment","installments.bonus":"Bonus payment","sepaDirectDebit.ibanField.invalid":"Invalid account number","sepa.ownerName":"Holder Name","sepa.ibanNumber":"Account Number (IBAN)","error.title":"Error","error.subtitle.redirect":"Redirect failed","error.subtitle.payment":"Payment failed","error.subtitle.refused":"Payment refused","error.message.unknown":"An unknown error occurred","errorPanel.title":"Existing errors","idealIssuer.selectField.title":"Bank","creditCard.success":"Payment Successful",loading:"Loading…",loaded:"Loaded",continue:"Continue",continueTo:"Continue to","wechatpay.timetopay":"You have %@ to pay","sr.wechatpay.timetopay":"You have %#minutes%# %#seconds%# to pay","wechatpay.scanqrcode":"Scan QR code",personalDetails:"Personal details",companyDetails:"Company details","companyDetails.name":"Company name","companyDetails.registrationNumber":"Registration number",socialSecurityNumber:"Social security number",firstName:"First name","firstName.invalid":"Enter your first name",infix:"Prefix",lastName:"Last name","lastName.invalid":"Enter your last name",mobileNumber:"Mobile number","mobileNumber.invalid":"Invalid mobile number",city:"City",postalCode:"Postal code","postalCode.optional":"Postal code (optional)",countryCode:"Country Code",telephoneNumber:"Telephone number",telephonePrefix:"Prefix",dateOfBirth:"Date of birth",shopperEmail:"Email address",gender:"Gender","gender.notselected":"Select your gender",male:"Male",female:"Female",billingAddress:"Billing address",street:"Street",stateOrProvince:"State or province",country:"Country/Region",houseNumberOrName:"House number",separateDeliveryAddress:"Specify a separate delivery address",deliveryAddress:"Delivery Address","deliveryAddress.firstName":"Recipient first name","deliveryAddress.lastName":"Recipient last name",zipCode:"Zip code",apartmentSuite:"Apartment / Suite",provinceOrTerritory:"Province or Territory",cityTown:"City / Town",address:"Address","address.search.contextualText":"Type to start searching your address","address.errors.incomplete":"Enter an address to continue","address.enterManually":"Enter address manually",state:"State",payAmountFormat:"Pay %@","field.title.optional":"(optional)","issuerList.selectField.contextualText":"Select your bank to continue","issuerList.selectField.label":"Bank selection",privacyPolicy:"Privacy policy","afterPay.agreement":"I agree with the %@ of Riverty","riverty.termsAndConditions":"I agree with the general %#Terms & Conditions%# for the Riverty Payment Method. The privacy policy of Riverty can be found %#here%#.",paymentConditions:"payment conditions",openApp:"Open the app","voucher.readInstructions":"Read instructions","voucher.introduction":"Thank you for your purchase, please use the following coupon to complete your payment.","voucher.expirationDate":"Expiration Date","voucher.alternativeReference":"Alternative Reference","voucher.paymentReferenceLabel":"Payment Reference","voucher.surcharge":"Incl. %@ surcharge","voucher.introduction.doku":"Thank you for your purchase, please use the following information to complete your payment.","voucher.shopperName":"Shopper Name","voucher.merchantName":"Merchant","voucher.introduction.econtext":"Thank you for your purchase, please use the following information to complete your payment.","voucher.telephoneNumber":"Phone Number","voucher.shopperReference":"Shopper Reference","voucher.collectionInstitutionNumber":"Collection Institution Number","voucher.econtext.telephoneNumber.invalid":"Telephone number must be 10 or 11 digits long","boletobancario.btnLabel":"Generate Boleto","boleto.sendCopyToEmail":"Send a copy to my email","button.copy":"Copy","button.copied":"Copied!","button.download":"Download","boleto.socialSecurityNumber":"CPF/CNPJ","boleto.socialSecurityNumber.invalid":"Enter a valid CPF/CNPJ number","creditCard.storedCard.description.ariaLabel":"Stored card ends in %@","voucher.entity":"Entity",donateButton:"Donate",donationTermsCondition:"By donating you agree to the %#terms and conditions%#",donationRoundUpDescription:"%{donationAmount} is a round up from your original payment (%{originalPaymentAmount})",notNowButton:"Not now",thanksForYourSupport:"Thanks for your support!","resultMessages.preauthorized":"Details saved",preauthorizeWith:"Preauthorize with",confirmPreauthorization:"Confirm preauthorization",confirmPurchase:"Confirm purchase",applyGiftcard:"Redeem",giftcardBalance:"Gift card balance",deductedBalance:"Deducted balance","creditCard.taxNumber":"Cardholder birthdate or Corporate registration number","creditCard.taxNumber.label":"Cardholder birthdate (YYMMDD) or Corporate registration number (10 digits)","creditCard.taxNumber.labelAlt":"Corporate registration number (10 digits)","creditCard.taxNumber.invalid":"Invalid Cardholder birthdate or Corporate registration number","storedPaymentMethod.disable.button":"Remove","storedPaymentMethod.disable.confirmation":"Remove stored payment method","storedPaymentMethod.disable.confirmButton":"Yes, remove","storedPaymentMethod.disable.cancelButton":"Cancel","ach.bankAccount":"Bank account","ach.bankAccount.title":"Bank account details","ach.bankAccount.label":"Account type","ach.bankAccount.placeholder":"Choose an account type","ach.bankAccount.nothing-selected-error":"Choose an account type","ach.bankAccount.option.personal-checking":"Personal Checking Account","ach.bankAccount.option.personal-savings":"Personal Savings Account","ach.bankAccount.option.business-checking":"Business Checking Account","ach.bankAccount.option.business-savings":"Business Savings Account","ach.bankAccountNumberVerification.label":"Verify account number","ach.bankAccountNumberVerification.error.not-match":"Account number does not match","ach.bankAccountNumberVerification.error.empty":"Enter the provided account number to verify the account number","ach.routingNumber.label":"Routing number","ach.accountHolderNameField.title":"Account holder name","ach.accountHolderNameField.contextualText":"Located on the front of your card","ach.accountHolderNameField.invalid":"Invalid account holder name","ach.accountNumberField.invalid":"Invalid account number","ach.accountLocationField.invalid":"Invalid ABA routing number","ach.savedBankAccount":"Saved bank account","ach.savings":"Savings account","ach.checking":"Checking account","select.state":"Select state","select.stateOrProvince":"Select state or province","select.provinceOrTerritory":"Select province or territory","select.country":"Select country/region","select.noOptionsFound":"No options found","select.results":"%{count} results available","telephoneNumber.invalid":"Invalid telephone number",qrCodeOrApp:"or","paypal.processingPayment":"Processing payment...",generateQRCode:"Generate QR code","await.waitForConfirmation":"Waiting for confirmation","mbway.confirmPayment":"Confirm your payment on the MB WAY app","shopperEmail.invalid":"Invalid email address","dateOfBirth.format":"DD/MM/YYYY","dateOfBirth.invalid":"Enter a valid date of birth that indicates you are at least 18 years old","blik.confirmPayment":"Open your banking app to confirm the payment.","blik.invalid":"Enter 6 numbers","blik.code":"6-digit code","blik.help":"Get the code from your banking app.","swish.pendingMessage":"After you scan, the status can be pending for up to 10 minutes. Attempting to pay again within this time may result in multiple charges.","field.valid":"Field valid","field.invalid":"Field not valid","field.error.required":"Enter the %{label}","field.error.invalid":"Enter a valid %{label}","field.error.invalidCharacters":"Some special characters are not allowed, enter a valid %{label}","error.giftcard.no-balance":"This gift card has zero balance","error.giftcard.card-error":"In our records we have no gift card with this number","error.giftcard.currency-error":"Gift cards are only valid in the currency they were issued in","err.gen.9100":"Incomplete field","err.gen.9101":"Field not valid","err.gen.9102":"Data parsing error","3ds.chal.805":"Challenge resolved without a %{result} object","cc.num.902":"Enter a valid card number","cc.num.900":"Enter the card number","cc.num.903":"Enter a supported card brand","cc.num.901":"Enter the complete card number","cc.num.904":"This card type is not supported","cc.dat.912":"Enter a valid expiry date. Front of card in MM/YY format.","cc.dat.913":"Enter a valid expiry date. Front of card in MM/YY format.","cc.dat.914":"Credit card about to expire","cc.dat.910":"Enter the expiry date. Front of card in MM/YY format.","cc.dat.911":"Enter the complete expiry date. Front of card in MM/YY format.","cc.mth.915":"Enter the expiry month","cc.yr.917":"Enter the expiry year","cc.yr.918":"Enter the complete expiry year","cc.cvc.920":"Enter the security code. 3 digits on back of card.","cc.cvc.921":"Enter the complete security code. 3 digits on back of card.","cc.cvc.920.amex":"Enter the security code. 4 digits on front of card.","cc.cvc.921.amex":"Enter the complete security code. 4 digits on front of card.","ach.num.945":"Enter the bank account number","ach.num.946":"Enter the complete bank account number","ach.loc.947":"Enter the bank routing number","ach.loc.948":"Enter the complete bank routing number","kcp.pwd.940":"Enter the password","kcp.pwd.941":"Enter the complete password","amazonpay.signout":"Sign out from Amazon","amazonpay.changePaymentDetails":"Change payment details","order.paymentMethod.description":"%{name} ending in %{lastFour}","partialPayment.warning":"Select another payment method to pay the remaining","partialPayment.remainingBalance":"Remaining balance will be %{amount}","bankTransfer.beneficiary":"Beneficiary name","bankTransfer.iban":"IBAN","bankTransfer.bic":"BIC","bankTransfer.reference":"Reference","bankTransfer.accountNumber":"Account number","bankTransfer.sortCode":"Sort code","bankTransfer.routingNumber":"Routing number","bankTransfer.branchCode":"Branch code","bankTransfer.bankCode":"Bank code","bankTransfer.introduction":"Press ‘Continue’ to create a new bank transfer payment. You can use the details in the following screen to finalize this payment.","bankTransfer.instructions":"Thank you for your purchase, please use the following information to complete your payment.","bankTransfer.shopperEmail.contextualText":"A copy of the payment details will be sent to your email so you can complete the payment later.","bankTransfer.details.title":"Payment details","bankTransfer.instruction.title":"Payment process","bankTransfer.instruction.step1":"Open your banking app","bankTransfer.instruction.step2":"Start a new transfer","bankTransfer.instruction.step3":"Enter the account details provided below","bankTransfer.instruction.step4":"Review and confirm the payment","bacs.accountHolderName":"Bank account holder name","bacs.accountHolderName.invalid":"Invalid bank account holder name","bacs.accountNumber":"Bank account number","bacs.accountNumber.invalid":"Invalid bank account number","bacs.bankLocationId":"Sort code","bacs.bankLocationId.invalid":"Invalid sort code","bacs.consent.amount":"I agree that the above amount will be deducted from my bank account.","bacs.consent.account":"I confirm the account is in my name and I am the only signatory required to authorise the Direct Debit on this account.",edit:"Edit","bacs.confirm":"Confirm and pay","bacs.result.introduction":"Download your Direct Debit Instruction (DDI / Mandate)","download.pdf":"Download PDF","creditCard.encryptedCardNumber.aria.iframeTitle":"Card number","creditCard.encryptedExpiryDate.aria.iframeTitle":"Expiry date","creditCard.encryptedExpiryMonth.aria.iframeTitle":"Expiry month","creditCard.encryptedExpiryYear.aria.iframeTitle":"Expiry year","creditCard.encryptedSecurityCode.aria.iframeTitle":"Security code","creditCard.encryptedPassword.aria.iframeTitle":"Password","giftcard.encryptedCardNumber.aria.iframeTitle":"Card number","giftcard.encryptedSecurityCode.aria.iframeTitle":"Pin",giftcardTransactionLimit:"Max. %{amount} allowed per transaction on this gift card","pix.instructions":"Use your banking app to scan the QR code or copy the PIX code below to complete your payment.","pix.code.label":"PIX code","pix.code.copy.label":"Copy PIX code","pix.code.copied.label":"PIX code copied","twint.saved":"saved",orPayWith:"or pay with","invalid.format.expects":"%{label} Invalid format. Expected format: %{format}","upi.qrCodeWaitingMessage":"Scan the QR code using your preferred UPI app to complete the payment","upi.vpaWaitingMessage":"Open your UPI app to confirm the payment","upi.modeSelection":"How would you like to use UPI?","upi.completePayment":"Complete your payment","upi.mode.enterUpiId":"UPI ID","upi.mode.qrCode":"QR code","upi.mode.payByAnyUpi":"UPI apps","upi.collect.dropdown.label":"Enter UPI ID","upi.collect.instruction":"Enter your UPI ID","upi.collect.field.label":"UPI ID","upi.collect.field.contextualText":"Enter the UPI ID connected to your account and press continue","upi.collect.field.invalid-id-error":"Enter a valid UPI","upi.error.noAppSelected":"Select your preferred UPI app to continue","upi.intent.instruction":"Select your preferred UPI app","upi.qrCode.instruction":"After generating the QR code you can use your preferred UPI app to complete the payment.","onlineBanking.termsAndConditions":"By continuing you agree with the %#terms and conditions%#","onlineBankingPL.termsAndConditions":"By continuing you agree with the %#regulations%# and %#information obligation%# of Przelewy24","ctp.loading.poweredByCtp":"Powered by Click to Pay","ctp.loading.intro":"We are checking to see if you have any saved cards with Click to Pay...","ctp.login.title":"Continue to Click to Pay","ctp.login.subtitle":"Enter the email address that is connected to Click to Pay to continue.","ctp.login.inputLabel":"Email","ctp.logout.notYou":"Not you?","ctp.logout.notYourCards":"Not your cards?","ctp.logout.notYourCard":"Not your card?","ctp.logout.notYourProfile":"Not your profile?","ctp.otp.fieldLabel":"One time code","ctp.otp.resendCode":"Resend code","ctp.otp.codeResent":"Code resent","ctp.otp.title":"Access your Click to Pay cards","ctp.otp.subtitle":"Enter the code %@ sent to %@ to verify it‘s you.","ctp.otp.saveCookiesCheckbox.label":"Skip verification next time","ctp.otp.saveCookiesCheckbox.information":"Select to be remembered on your device and browser at participating stores for faster checkout. Not recommended for shared devices.","ctp.otp.saveCookiesCheckbox.shorterInfo":"Select to be remembered on your device and browser","ctp.emptyProfile.message":"No cards registered in this Click to Pay profile","ctp.separatorText":"or use","ctp.cards.title":"Complete payment with Click to Pay","ctp.cards.subtitle":"Select a card to use.","ctp.cards.expiredCard":"Expired","ctp.manualCardEntry":"Manual card entry","ctp.aria.infoModalButton":"What is Click to Pay","ctp.infoPopup.title":"Click to Pay brings the ease of contactless, online","ctp.infoPopup.subtitle":"A fast, secure payment method supported by Mastercard, Visa and other payment cards.","ctp.infoPopup.benefit1":"Click to Pay uses encryption to keep your information safe and secure","ctp.infoPopup.benefit2":"Use it with merchants worldwide","ctp.infoPopup.benefit3":"Set up once for hassle-free payments in the future","ctp.errors.AUTH_INVALID":"Authentication Invalid","ctp.errors.NOT_FOUND":"No account found, enter a valid email or continue using manual card entry","ctp.errors.ID_FORMAT_UNSUPPORTED":"Format not supported","ctp.errors.FRAUD":"The user account was locked or disabled","ctp.errors.CONSUMER_ID_MISSING":"Consumer identity is missing in the request","ctp.errors.ACCT_INACCESSIBLE":"This account is currently not available, e.g it is locked","ctp.errors.CODE_INVALID":"Incorrect verification code","ctp.errors.CODE_EXPIRED":"This code has expired","ctp.errors.RETRIES_EXCEEDED":"The limit for the number of retries for OTP generation was exceeded","ctp.errors.OTP_SEND_FAILED":"The OTP could not be sent to the recipient","ctp.errors.REQUEST_TIMEOUT":"Something went wrong, try again or use the manual card entry","ctp.errors.UNKNOWN_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.SERVICE_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.SERVER_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.INVALID_PARAMETER":"Something went wrong, try again or use the manual card entry","ctp.errors.AUTH_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.INVALID_EMAIL":"Enter a valid email address (e.g. name@example.com)","paymentMethodsList.aria.label":"Choose a payment method","paymentMethodsList.storedPayments.label":"Saved payment methods","paymentMethodsList.otherPayments.label":"More payment options","paymentMethodsList.otherPayments.buttonLabel":"Show %{count} more","paymentMethodsList.promotedPayments.label":"Other","companyDetails.name.invalid":"Enter the company name","companyDetails.registrationNumber.invalid":"Enter the registration number","consent.checkbox.invalid":"You must agree with the terms & conditions","form.instruction":"All fields are required unless marked otherwise.","trustly.descriptor":"Instant Bank Payment","trustly.description1":"Pay directly from any of your bank accounts, backed by bank-level security","trustly.description2":"No cards, no app download, no registration","ancv.input.label":"Your ANCV identification","ancv.confirmPayment":"Use your ANCV application to confirm the payment.","ancv.form.instruction":"The Cheque-Vacances application is necessary to validate this payment.","ancv.beneficiaryId.invalid":"Enter a valid email address or ANCV ID","creditCard.cardNumber.label":"Card number","creditCard.expiryDate.label":"Expiry date","creditCard.expiryDate.contextualText":"Front of card in MM/YY format","creditCard.securityCode.label":"Security code","creditCard.securityCode.label.optional":"Security code (optional)","creditCard.securityCode.contextualText.3digits":"3 digits on back of card","creditCard.securityCode.contextualText.4digits":"4 digits on front of card","creditCard.expiryMonth.label":"Expiry month","creditCard.expiryYear.label":"Expiry year","creditCard.pin.label":"Pin","creditCard.password.label":"First 2 digits of card password","giftcard.cardNumber.label":"Card Number","giftcard.expiryDate.label":"Expiry date","giftcard.securityCode.label":"Pin","ach.bankAccountNumber.label":"Account number","ach.bankLocationId.label":"ABA routing number","dragonpayVoucher.selectField.contextualText.nonBank":"Select your provider","dragonpayVoucher.selectField.contextualText.bank":"Select your bank","payme.openPayMeApp":"Complete your payment in the PayMe app by authorizing the payment in the app and wait for the confirmation.","payme.redirectButtonLabel":"Open PayMe app","payme.scanQrCode":"Complete your payment by QR code","payme.timeToPay":"This QR code is valid for %@","payme.instructions.steps":"Open the PayMe app.%@Scan the QR code to authorize the payment.%@Complete the payment in the app and wait for confirmation.","payme.instructions.footnote":"Please do not close this page before the payment is completed","payByBankAISDD.disclaimer.header":"Use Pay by Bank to pay instantly from any bank account.","payByBankAISDD.disclaimer.body":"By connecting your bank account you are authorizing debits to your account for any amount owed for use of our services and/or purchase of our products, until this authorization is revoked.","paymentMethodBrand.other":"other","paynow.scanQrCode":"Scan the QR code using the PayNow app to complete the payment","paynow.mobileViewInstruction.step1":"Take a screenshot of the QR code.","paynow.mobileViewInstruction.step2":"Open the PayNow bank or payment app.","paynow.mobileViewInstruction.step3":"Select the option to scan a QR code.","paynow.mobileViewInstruction.step4":"Choose the option to upload a QR and select the screenshot.","paynow.mobileViewInstruction.step5":"Complete the transaction.","payto.payid.description":"Enter the PayID and account details that are connected to your PayTo account.","payto.payid.label.identifier":"Identifier","payto.payid.label.orgid":"Organization ID","payto.payid.option.phone":"Mobile","payto.payid.option.email":"Email","payto.payid.option.orgid":"Organization ID","payto.bsb.description":"Enter the bank account number and the Bank State Branch that is connected to your account to continue","payto.bsb.label.bankAccountNumber":"Bank account number","payto.instructions.steps":"Log into your PayTo banking app@Authorize the PayTo agreement@Approve the payment terms@Complete the transaction","payto.confirmPayment":"Thank you for your purchase, complete your payment by following the instructions below.","payto.mandate.amount.label":"Amount","payto.mandate.frequency.label":"Frequency","payto.mandate.remarks.label":"Description","payto.mandate.startsAt.label":"First payment date","payto.mandate.endsAt.label":"End date","payto.mandate.payee.label":"Payee","payto.mandate.amount.max":"Up to %{amount} per transaction","payto.mandate.frequency.adhoc-no-count":"Ad Hoc","payto.mandate.frequency.adhoc":"%{count} time(s)","payto.mandate.frequency.daily":"%{count} payment(s) Daily","payto.mandate.frequency.weekly":"%{count} payment(s) Weekly","payto.mandate.frequency.biWeekly":"%{count} payment(s) Fortnightly","payto.mandate.frequency.monthly":"%{count} payment(s) Monthly","payto.mandate.frequency.quarterly":"%{count} payment(s) Quarterly","payto.mandate.frequency.halfYearly":"%{count} payment(s) Bi-Annual","payto.mandate.frequency.yearly":"%{count} payment(s) Yearly","payto.label.firstName":"Account holder first name","payto.label.lastName":"Account holder last name","payto.await.waitForConfirmation":"Awaiting your approval","payto.errors.accountHolderFirstName.invalid":"Enter your account holder first name","payto.errors.accountHolderLastName.invalid":"Enter your account holder last name","payto.bsb.option.label":"BSB and account number","card.fastlane.a11y.logo":"Fastlane by Paypal logo","card.fastlane.a11y.openDialog":"Read more about Fastlane","card.fastlane.a11y.closeDialog":"Close dialog","card.fastlane.mobileInputLabel":"Mobile number","card.fastlane.consentToggle":"Save your info with Fastlane for faster checkouts and more","card.fastlane.consentText":"By saving your info, you agree to get codes by text to use Fastlane everywhere it's available. Fastlane will text the number provided. You also agree to this %#terms%# and %#privacy statement%#.","card.fastlane.modal.benefit1.header":"Autofill your checkouts","card.fastlane.modal.benefit1.text":"Get one-time codes to use card and addresses you’ve saved.","card.fastlane.modal.benefit2.header":"Protect your info","card.fastlane.modal.benefit2.text":"Your payment info is encrypted when it’s stored and sent to places you shop.","card.fastlane.modal.benefit3.header":"Use across stores","card.fastlane.modal.benefit3.text":"Speed through checkout everywhere Fastlane is available.","paybybankpix.redirectBtn.label":"Continue to PIX through OpenBanking","paybybankpix.issuerList.disclaimer":"By continuing, you agree to the %#Consent Notice%# and will be redirected to your bank.","paybybankpix.issuerList.selectField.label":"Bank","paybybankpix.issuerList.introduction.logo.content":"Connect your favorite PIX keys to pay through Open Finance","paybybankpix.await.waitForConfirmation":"Waiting for your confirmation...","paybybankpix.await.timeToPay":"This process will take approximately %{numberOfMin} minute(s)","paybybankpix.await.withOpenFinance":"With the ease of Open Finance","paybybankpix.await.logoAlt.openFinance":"Open Finance","paybybankpix.storedPayment.payButton.label":"Continue payment","paybybankpix.storedPayment.additionalLabel":"%{receiver} account through PIX","paybybankpix.await.fetchDetails":"Fetching details...","eftpad-canada.input.accountHolderName.label":"Account holder name","eftpad-canada.input.accountHolderName.error":"Enter an account holder name","eftpad-canada.input.accountNumber.label":"Account number","eftpad-canada.input.accountNumber.contextualText":"Between 7 and 12 digits","eftpad-canada.input.accountNumber.error":"Enter an account number that is between 7 and 12 digits","eftpad-canada.input.institutionNumber.label":"Institution number","eftpad-canada.input.institutionNumber.contextualText":"3 digits","eftpad-canada.input.institutionNumber.error":"Enter an institution number that consists of 3 digits","eftpad-canada.input.transitNumber.label":"Transit number","eftpad-canada.input.transitNumber.contextualText":"5 digits","eftpad-canada.input.transitNumber.error":"Enter a transit number that consists of 5 digits","eftpad-canada.settlement-info":"The funds will be withdrawn from your bank account within 1–3 business days.","upi.mandate.intro":"You’re setting up a UPI Autopay recurring payment","upi.mandate.max.extraText":"You’ll approve a higher limit to allow future plan changes","upi.mandate.upTo":"up to %{amount}","upi.mandate.frequency.monthly":"/month","upi.mandate.frequency.weekly":"/week","upi.mandate.frequency.adhoc":" as presented",bankList:"Bank list",qrCode:"QR code","iris.instructions.generateQrCode":"After generating the QR code you can use your preferred banking app to complete the payment.","iris.instructions.payment.step1":"Open your preferred banking app.","iris.instructions.payment.step2":"Scan the QR code with your banking app.","iris.instructions.payment.step3":"Complete the payment in the app and wait for the confirmation here.","econtext.customerNumber":"Customer number","econtext.confirmationNumber":"Confirmation number","econtext.useBefore":"Use before","econtext.paymentInformation":"Payment information","issuerList.separatorText":"or choose from list","upi.intent.apps.title":"Options","upi.intent.apps.dropdown.label":"UPI apps","upi.intent.apps.dropdown.placeholder":"Choose preferred app","emi.subtitle":"Installment plans on credit cards","emi.title":"EMI plan","emi.instructions":"Choose your preferred combination from the options listed below and continue to enter your card details","emi.provider":"Provider","emi.plan":"Plan","emi.planSummary":"Plan summary","emi.itemPrice":"Item price","emi.amountReservedOnCard":"Amount reserved on card","emi.interestChargedByBank":"Interest charged by bank @%{interest}","emi.totalAmountOverTime":"Total amount to be paid over time","emi.upcomingMonthlyPayment":"Upcoming monthly payment","emi.discount":"Discount","emi.discountApplied":"%{amount} discount offer applied for using %{provider}","emi.noCost":"No cost","emi.lowCost":"Low cost","emi.discountAvailable":"discount available","emi.perAnnum":"p.a","emi.cardDetailsInstructions":"Enter card details that are associated with a %{provider} card","emi.cardDetails":"Card details"};function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Lf{async requestTranslations(){const t=await this.service.fetchTranslationsFromCdn(this.locale);this._translations={...Ia,...t,...!!this.customTranslations[this.locale]&&this.customTranslations[this.locale]}}get translations(){return this._translations}get(t,n){const o=I0(this._translations,t,n);return o!==null?o:t}amount(t,n,o){return y1(t,this.locale,n,o)}date(t,n={}){if(t===void 0)return"";const o={year:"numeric",month:"2-digit",day:"2-digit",...n};return new Date(t).toLocaleDateString(this.locale,o)}dateTime(t){return t===void 0?"":this.timeAndDateFormatter.format(new Date(t))}createSupportedLocalesList(t){if(!t)return Gi;const n=new Set([...Gi,...Object.keys(t)]);return Array.from(n).sort((o,r)=>o.localeCompare(r))}constructor(t){Nt(this,"locale",void 0),Nt(this,"languageCode",void 0),Nt(this,"service",void 0),Nt(this,"customTranslations",void 0),Nt(this,"supportedLocales",void 0),Nt(this,"_translations",{}),Nt(this,"timeFormatOptions",{hour:"numeric",minute:"numeric"}),Nt(this,"timeAndDateFormatOptions",{year:"numeric",month:"2-digit",day:"2-digit",...this.timeFormatOptions}),Nt(this,"timeAndDateFormatter",void 0);const{locale:n,customTranslations:o,service:r}=t;this.service=r,this.customTranslations=A0(o),this.supportedLocales=this.createSupportedLocalesList(this.customTranslations),this.locale=N0(n||pr,this.supportedLocales),this.languageCode=this.locale.split("-")[0],this.timeAndDateFormatter=Intl.DateTimeFormat(this.locale,this.timeAndDateFormatOptions)}}const Of="1.0.0",Bf="1.0.0",Nr="deviceFingerprint",Vf=2e4,Uf={result:{type:Nr,value:"df-timedOut"},errorCode:"timeout"},Hf={UNKNOWN:"unknownError"},od={timeout:"iframe loading timed out",wrongOrigin:"Result did not come from the expected origin",wrongDataType:"Result data was not of the expected type",missingProperty:"Result data did not contain the expected properties",unknownError:"An unknown error occurred"};function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Kf extends Ae{getDfpPromise(){return new Promise((t,n)=>{this.processMessageHandler=fa(this.postMessageDomain,t,n,Nr),window.addEventListener("message",this.processMessageHandler)})}componentDidMount(){this.deviceFingerPrintPromise=ba(Vf,this.getDfpPromise(),Uf),this.deviceFingerPrintPromise.promise.then(t=>{this.props.onCompleteFingerprint(t),window.removeEventListener("message",this.processMessageHandler)}).catch(t=>{this.props.onErrorFingerprint(t),window.removeEventListener("message",this.processMessageHandler)})}render({dfpURL:t}){return u("div",{className:"adyen-checkout-risk__device-fingerprint"},u(lo,{name:"dfIframe",src:t,allow:"geolocation; microphone; camera;",title:"devicefingerprinting iframe"}))}constructor(t){super(t),Ra(this,"postMessageDomain",void 0),Ra(this,"processMessageHandler",void 0),Ra(this,"deviceFingerPrintPromise",void 0),this.postMessageDomain=ga(this.props.loadingContext)||this.props.loadingContext}}const jf=e=>({errorCode:e,message:od[e]||od[Hf.UNKNOWN],type:Nr});let rd=class extends Ae{setStatusComplete(t){this.setState({status:"complete"},()=>{this.props.onComplete(t)})}render({loadingContext:t},{dfpURL:n}){return this.state.status==="retrievingFingerPrint"?u("div",{className:"adyen-checkout-risk__device-fingerprint--wrapper",style:{position:"absolute",width:0,height:0}},u(Kf,{loadingContext:t,dfpURL:n,onCompleteFingerprint:o=>{this.setStatusComplete(o)},onErrorFingerprint:o=>{this.props.onError(jf(o.errorCode)),this.setStatusComplete(o.result)}})):null}constructor(t){super(t),t.clientKey&&(this.state={status:"retrievingFingerPrint",dfpURL:`${this.props.loadingContext}assets/html/${t.clientKey}/dfp.${Bf}.html`})}};var $a,Fa,Ma;Ma={onComplete:()=>{},onError:()=>{}},(Fa="defaultProps")in($a=rd)?Object.defineProperty($a,Fa,{value:Ma,enumerable:!0,configurable:!0,writable:!0}):$a[Fa]=Ma;function Nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let La=class lu extends vr{formatProps(t){return{...t,risk:{...lu.defaultProps.risk,...t.risk}}}get isValid(){return this.state.isValid}get data(){if(this.isValid){const t={version:Of,...this.state.data};return En.encode(JSON.stringify(t))}return!1}get enabled(){return this.props.risk.enabled}componentWillUnmount(){this.cleanUp()}render(){return u(rd,{...this.props,loadingContext:this.props.loadingContext,onComplete:this.onComplete,onError:this.onError})}constructor(t,n){super(t,n),Nn(this,"nodeRiskContainer",null),Nn(this,"onComplete",r=>{const i={...this.state.data,[r.type]:r.value,persistentCookie:r.persistentCookie,components:r.components};this.setState({data:i,isValid:!0}),this.props.risk.onComplete(this.data),this.cleanUp()}),Nn(this,"onError",r=>{this.props.risk.onError(r),this.cleanUp()}),Nn(this,"cleanUp",()=>{this.nodeRiskContainer&&this.nodeRiskContainer.parentNode&&this.nodeRiskContainer.parentNode.removeChild(this.nodeRiskContainer)});const o={[Nr]:null};this.setState({data:o}),this.props.risk.enabled===!0&&(document.querySelector(this.props.risk.node)?(this.nodeRiskContainer=document.createElement("div"),document.querySelector(this.props.risk.node).appendChild(this.nodeRiskContainer),this.mount(this.nodeRiskContainer)):this.onError({message:"RiskModule node was not found"}))}};Nn(La,"type","risk"),Nn(La,"defaultProps",{risk:{enabled:!0,onComplete:()=>{},onError:()=>{},node:"body"}});function id(e){return!this.length||this.includes(e.type)}function ad(e){return!this.length||!this.includes(e.type)}function zf(e){return!!e&&!!e.supportedShopperInteractions&&e.supportedShopperInteractions.includes("Ecommerce")}const qf=["scheme","blik","twint","ach","cashapp","paybybank_AIS_DD","payto","paybybank_pix","eft_directdebit_CA"];function Wf(e){return!!e&&!!e.type&&qf.includes(e.type)}function Gf(e){return{...e,_id:Be()}}const Yf=(e,{allowPaymentMethods:t=[],removePaymentMethods:n=[]})=>e?e.filter(id,t).filter(ad,n).map(Gf):[],Zf=(e,{allowPaymentMethods:t=[],removePaymentMethods:n=[]},o=[])=>e?e.filter(Wf).filter(id,t).filter(ad,n).filter(zf).map(r=>((i,a)=>{const s=(function(l,c){if(l.type!=="scheme")return;const d=l.brand;return d?c.find(h=>h.type==="scheme"&&h.brands?.includes(d))?.fundingSource:void 0})(i,a);return{...i,storedPaymentMethodId:i.id,isStoredPaymentMethod:!0,...s&&{fundingSource:s}}})(r,o)):[],Qf=e=>{if(typeof e=="string")throw new Error('paymentMethodsResponse was provided but of an incorrect type (should be an object but a string was provided).Try JSON.parse("{...}") your paymentMethodsResponse.');if(e instanceof Array)throw new Error("paymentMethodsResponse was provided but of an incorrect type (should be an object but an array was provided).Please check you are passing the whole response.");!e||e?.paymentMethods?.length||e?.storedPaymentMethods?.length||console.warn("paymentMethodsResponse was provided but no payment methods were found.")};function sd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Jf=class{mapCreatedComponentType(t){return t==="card"?"scheme":t}has(t){return!!this.paymentMethods.find(n=>n.type===this.mapCreatedComponentType(t))}find(t){return this.paymentMethods.find(n=>n.type===this.mapCreatedComponentType(t))}findByFundingSource(t,n){const o=this.mapCreatedComponentType(t);return this.paymentMethods.find(r=>r.type===o&&r.fundingSource===n)}findById(t){return this.paymentMethods.find(n=>n._id===t)}findStoredPaymentMethod(t){return this.storedPaymentMethods.find(n=>n.id===t)}constructor(t,n={}){sd(this,"paymentMethods",[]),sd(this,"storedPaymentMethods",[]),Qf(t),this.paymentMethods=t?Yf(t.paymentMethods,n):[],this.storedPaymentMethods=t?Zf(t.storedPaymentMethods,n,t.paymentMethods||[]):[]}};const Oa=(e,t,n,o)=>{const r=t.getComponent(n);if(!r)throw Error(`Action Element of type ${n} not found in the registry`);return new r(e,{...o,id:`${n}-${Be()}`})},go=e=>(t,n,o,r)=>{const i={...r,...o,onError:r.onError,statusType:e,originalAction:o};return Oa(t,n,o.paymentMethodType,i)},Xf={redirect:(e,t,n,o)=>{const r={...o,...n,statusType:"redirect",originalAction:n};return Oa(e,t,"redirect",r)},threeDS2:(e,t,n,o)=>{const r=n.subtype==="fingerprint"?"threeDS2DeviceFingerprint":"threeDS2Challenge",i=n.subtype==="fingerprint"||o.isMDFlow?n.paymentData:n.authorisationToken,a={core:e,token:n.token,paymentData:i,onActionHandled:o.onActionHandled,on3DS2RedirectFlowComplete:o.on3DS2RedirectFlowComplete,onAdditionalDetails:o.onAdditionalDetails,onError:o.onError,isDropin:!!o.isDropin,loadingContext:o.loadingContext,clientKey:o.clientKey,paymentMethodType:o.paymentMethodType,challengeWindowSize:o.challengeWindowSize,usePasskeyIFrameAttributes:o.usePasskeyIFrameAttributes,isMDFlow:o.isMDFlow,modules:{analytics:o.modules?.analytics,resources:o.modules?.resources},...Z1(n.subtype,o)};return Oa(e,t,r,a)},voucher:go("custom"),qrCode:go("custom"),await:go("custom"),bankTransfer:go("custom"),sdk:go("custom")};function e2(e,t,n,o={}){const r=Xf[n.type];if(r&&typeof r=="function")return r(e,t,n,o);throw new Error("Invalid Action")}function t2(e,t){const n=`${Bt}/sessions/${t.id}/payments?clientKey=${t.clientKey}`,o={sessionData:t.data,...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal",errorCode:Pn.makePayments},o)}function n2(e,t){const n=`${Bt}/sessions/${t.id}/paymentDetails?clientKey=${t.clientKey}`,o={...t.data&&{sessionData:t.data},...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal",errorCode:Pn.submitPaymentDetails},o)}function o2(e){const t=`${Bt}/sessions/${e.id}/donationCampaigns?clientKey=${e.clientKey}`,n={...e.data&&{sessionData:e.data}};return Ve({loadingContext:e.loadingContext,path:t,errorLevel:"fatal",errorCode:Pn.donationCampaigns},n)}function r2(e,t){const n=`${Bt}/sessions/${t.id}/donations?clientKey=${t.clientKey}`,o={...t.data&&{sessionData:t.data},...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal",errorCode:Pn.donations},o)}function i2(e,t){const n=`${Bt}/sessions/${e.id}/setup?clientKey=${e.clientKey}`,o={browserInfo:t.browserInfo,sessionData:e.data,...t.order?{order:{orderData:t.order.orderData,pspReference:t.order.pspReference}}:{}};return Ve({loadingContext:e.loadingContext,path:n,errorLevel:"fatal"},o)}function a2(e,t){const n=`${Bt}/sessions/${t.id}/paymentMethodBalance?clientKey=${t.clientKey}`,o={sessionData:t.data,...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal"},o)}function s2(e){const t=`${Bt}/sessions/${e.id}/orders?clientKey=${e.clientKey}`,n={sessionData:e.data};return Ve({loadingContext:e.loadingContext,path:t,errorLevel:"fatal",errorCode:Pn.createOrder},n)}function l2(e){if(!e||!e.id)throw new F("IMPLEMENTATION_ERROR","Invalid session");const{shopperLocale:t,shopperEmail:n,telephoneNumber:o,id:r}=e;return{id:r,...e.sessionData?{sessionData:e.sessionData}:{},...t&&{shopperLocale:t},...n&&{shopperEmail:n},...o&&{telephoneNumber:o}}}function c2(e,t){const n=`${Bt}/sessions/${t.id}/orders/cancel?clientKey=${t.clientKey}`,o={sessionData:t.data,order:e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal"},o)}function An(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class d2{get shopperLocale(){return this.session.shopperLocale}get id(){return this.session.id}get data(){return this.session.sessionData}set sessionsDonationInitiated(t){this._sessionsDonationInitiated=t}get sessionsDonationInitiated(){return this._sessionsDonationInitiated}updateSessionData(t){this.session.sessionData=t,this.storeSession()}setupSession(t){const n={...t,browserInfo:yr()};return i2(this,n).then(o=>(o.configuration&&(this.configuration={...o.configuration}),o.sessionData&&this.updateSessionData(o.sessionData),o))}submitPayment(t){return t2(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}submitDetails(t){return n2(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}fetchDonationCampaigns(){return o2(this).then(t=>(t.sessionData&&this.updateSessionData(t.sessionData),t))}makeDonation(t){return r2(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}checkBalance(t){return a2(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}createOrder(){return s2(this).then(t=>(t.sessionData&&this.updateSessionData(t.sessionData),t))}cancelOrder(t){return c2(t.order,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}getStoredSession(){const t=this.storage.get();return this.id===t?.id?t:this.session}storeSession(){this.storage.set({id:this.session.id,sessionData:this.session.sessionData})}removeStoredSession(){this.storage.remove()}constructor(t,n,o){An(this,"storage",void 0),An(this,"session",void 0),An(this,"clientKey",void 0),An(this,"loadingContext",void 0),An(this,"configuration",void 0),An(this,"_sessionsDonationInitiated",void 0);const r=l2(t);if(!n)throw new Error("No clientKey available");if(!o)throw new Error("No loadingContext available");this.storage=new td("session","localStorage"),this.clientKey=n,this.loadingContext=o,this.session=r,this._sessionsDonationInitiated=!1,this.session.sessionData?this.storeSession():this.session=this.getStoredSession()}}function Ba(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let u2=class{getImage(t={}){return this.getImageUrl({...t,resourceContext:this.resourceContext})}constructor(t){if(Ba(this,"resourceContext",void 0),Ba(this,"returnImage",({name:n,resourceContext:o,imageFolder:r="",parentFolder:i="",extension:a,size:s="",subFolder:l=""})=>`${o}images/${r}${l}${i}${n}${s}.${a}`),Ba(this,"getImageUrl",({resourceContext:n,extension:o="svg",...r})=>i=>{const a={extension:o,resourceContext:n,imageFolder:"logos/",parentFolder:"",name:i,...r};return this.returnImage(a)}),!t)throw new F("IMPLEMENTATION_ERROR",'Resources module: "environmentsUrls.cdn" is not a valid URL');this.resourceContext=t}};function h2({setComponentRef:e}){const t=W({});Object.keys(t.current).length||e?.(t.current);const[n,o]=w(null),r=W(null),i=W(0),[a,s]=w(0);return t.current.setMessages=l=>{const c=r.current;l?.length&&c?.length===l.length&&c.every((d,p)=>d===l[p])&&(i.current+=1,s(i.current)),o(l)},r.current=n,n?u(G,null,n.map(l=>u("div",{key:`${a}-${l}`,className:"adyen-checkout-sr-panel__msg"},l))):null}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Va extends vr{get enabled(){return this._enabled}get moveFocus(){return this._moveFocus}setAriaProps(t){if(!this.props.enabled)return;const n=document.querySelector('[class^="adyen-checkout-sr-panel"]');if(n){for(const[o,r]of Object.entries(t))n.setAttribute(o,r);this.props={...this.props,ariaAttributes:{...this.props.ariaAttributes,...t}}}else console.error("SRPanel: Failed to set aria props because no panel was found")}render(){return this.props.enabled?u("div",{className:this.showPanel?"adyen-checkout-sr-panel":"adyen-checkout-sr-panel--sr-only",role:"log",...this.props.ariaAttributes},u(h2,{setComponentRef:this.setComponentRef})):null}constructor(t,n){if(super(t,n),xt(this,"srPanelContainer",null),xt(this,"id",void 0),xt(this,"showPanel",void 0),xt(this,"_enabled",void 0),xt(this,"_moveFocus",void 0),xt(this,"componentRef",void 0),xt(this,"setComponentRef",o=>{this.componentRef=o}),xt(this,"setMessages",o=>{if(!this.props.enabled)return;let r=null;o&&(r=Array.isArray(o)?o:[o]),this.componentRef.setMessages(r)}),this.id=this.props.id,this.showPanel=!1,this._enabled=!1,this._moveFocus=this.props.moveFocus??!0,this.props.enabled){this._enabled=!0;const o=document.querySelector(this.props.node);if(!o)throw new Error("Component could not mount. Root node was not found.");{const r=document.getElementById(this.id);r&&o.removeChild(r),this.srPanelContainer=document.createElement("div"),this.srPanelContainer.className="sr-panel-holder",this.srPanelContainer.id=this.id,o.appendChild(this.srPanelContainer),this.mount(this.srPanelContainer)}}}}xt(Va,"type","srPanel"),xt(Va,"defaultProps",{enabled:!0,node:"body",showPanel:!1,id:"ariaLiveSRPanel",ariaAttributes:{"aria-relevant":"all","aria-live":"polite","aria-atomic":"true"}});function ld(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p2={[g.redirect]:yo,[g.threeDS2Challenge]:_a,[g.threeDS2DeviceFingerprint]:Ea,[g.donation]:Da};var bo=new class{add(...e){this.componentsMap={...this.componentsMap,...this.createComponentsMap(e)}}getComponent(e){return this.componentsMap[e]||(this.supportedTxVariants.has(e)?void 0:yo)}createComponentsMap(e){return e.reduce((t,n)=>{var o;return typeof(o=n).type=="string"&&o.type?(n.type==="dropin"||[n.type,...n.txVariants].filter(r=>r).forEach(r=>{t={...t,[r]:n}}),t):(console.error("CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement"),t)},{})}constructor(){ld(this,"componentsMap",p2),ld(this,"supportedTxVariants",new Set(Object.values(g)))}};const m2={exposeLibraryMetadata:!0,showPayButton:!0};function cd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class f2{async fetchTranslationsFromCdn(t){const n=this.matchLocaleWithCdnSupportedLocales(t);if(n==="en-US")return Ia;try{return await Gl({loadingContext:this.cdnUrl,errorLevel:"fatal",errorMessage:`Translations: Failed to fetch translations for locale "${n}"`,path:`sdk/${this.sdkVersion}/translations/${n}.json`})}catch(o){return console.warn(`LanguageService - fetchTranslationsFromCdn(): Failed to fetch locale "${n}."`,o),Ia}}matchLocaleWithCdnSupportedLocales(t){return Ol(t,Gi)||pr}constructor({cdnUrl:t,sdkVersion:n}){cd(this,"cdnUrl",void 0),cd(this,"sdkVersion",void 0),this.cdnUrl=t,this.sdkVersion=n}}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class At{static setBundleType(t){At.metadata.bundleType=t}static register(...t){bo.add(...t)}register(...t){bo.add(...t)}getComponent(t){return bo.getComponent(t)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),this.createCoreModules(),this.assignLocaleToCore(),this.requestAnalyticsAttemptId(),await this.requestTranslations(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then(t=>{const{amount:n,shopperLocale:o,countryCode:r,paymentMethods:i,...a}=t;return this.setOptions({...a,amount:this.options.order?this.options.order.remainingAmount:n,locale:this.options.locale||o,countryCode:this.options.countryCode||r}),this.createPaymentMethodsList(i),this}).catch(t=>(this.options.onError&&this.options.onError(t),Promise.reject(t))):(this.createPaymentMethodsList(),Promise.resolve(this))}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new F(Ni,"You must specify a countryCode when initializing checkout.")}submitDetails(t){let n=null;this.options.onAdditionalDetails&&(n=new Promise((o,r)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:r})})),this.session&&(n=this.session.submitDetails(t).catch(o=>(this.options.onError?.(o),Promise.reject(o)))),n?n.then(co).then(uo).then(this.afterAdditionalDetails).then(o=>{Cr(o),this.options.onPaymentCompleted?.(o)}).catch(o=>{o instanceof Sr||(Cr(o),this.options.onPaymentFailed?.(o))}):this.options.onError?.(new F("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,n={}){if(!t||!t.type)throw Y(t,"action")&&Y(t,"resultCode")?new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?'):new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property');if(t.type){const o=t.type===L1?`${t.type}${t.subtype}`:t.paymentMethodType,r=new Ze({type:it.action,subType:Ze.getSubtypeFromActionType(t.type),message:`${o} action was handled by the SDK`,component:o});this.modules.analytics.sendAnalytics(r);const i={...this.getCorePropsForComponent(),...n};return e2(this,bo,t,i)}return this.handleCreateError()}update(t={},{shouldReinitializeCheckout:n=!0}={}){if(n)return this.setOptions(t),this.initialize().then(()=>(this.components.forEach(i=>{const a={...t.order?.remainingAmount?{amount:t.order.remainingAmount}:{amount:this.options.amount},...this.session&&{session:this.session},...t};i.update(a)}),this));const{amount:o,secondaryAmount:r}=t;return(o||r)&&this.triggerAmountUpdate(o,r),Promise.resolve(this)}triggerAmountUpdate(t,n){ha(t)?!n||ha(n)?(this.setOptions({amount:t,...n&&{secondaryAmount:n}}),this.components.forEach(o=>{o.updateAmount(t,n)})):console.warn("Core update(): Update canceled. Invalid secondary amount object"):console.warn("Core update(): Update canceled. Invalid amount object")}getCorePropsForComponent(){return{...kf(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const n=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(n)}createPaymentMethodsList(t){this.paymentMethodsResponse=new Jf(this.options.paymentMethodsResponse||t,this.options)}createCoreModules(){this.modules||(this.modules=Object.freeze({risk:new La(this,{...this.options,loadingContext:this.loadingContext}),analytics:new $f({eventQueue:new Ff,service:new Mf({analyticsContext:this.analyticsContext,clientKey:this.options.clientKey}),enabled:this.options.analytics?.enabled,analyticsData:this.options.analytics?.analyticsData}),resources:new u2(this.cdnImagesUrl),i18n:new Lf({locale:this.options.locale,customTranslations:this.options.translations,service:new f2({cdnUrl:this.cdnTranslationsUrl,sdkVersion:At.metadata.version}),onError:this.options?.onError}),srPanel:new Va(this,{...this.options.srConfig})}))}assignLocaleToCore(){this.options.locale=this.modules.i18n.locale}async requestTranslations(){try{await this.modules.i18n.requestTranslations()}catch(t){console.warn("Core - requestTranslations(): Something went wrong.",t)}}async requestAnalyticsAttemptId(){await this.modules.analytics.setUp({locale:this.options.locale,...this.session?.id&&{sessionId:this.session.id}})}constructor(t){He(this,"session",void 0),He(this,"paymentMethodsResponse",void 0),He(this,"modules",void 0),He(this,"options",void 0),He(this,"analyticsContext",void 0),He(this,"loadingContext",void 0),He(this,"cdnImagesUrl",void 0),He(this,"cdnTranslationsUrl",void 0),He(this,"components",[]),He(this,"afterAdditionalDetails",s=>{if(this.options.afterAdditionalDetails&&s?.action){const l=this.createFromAction(s.action);return this.options.afterAdditionalDetails(l),Promise.reject(new Sr("Handled by afterAdditionalDetails"))}return Promise.resolve(s)}),He(this,"remove",s=>(this.components=this.components.filter(l=>l._id!==s._id),s.unmount(),this)),He(this,"setOptions",s=>{this.options={...this.options,...s,locale:s?.locale||this.options?.locale,environment:String.prototype.toLowerCase.apply(s?.environment||this.options?.environment)}}),Ef(t),this.createFromAction=this.createFromAction.bind(this),this.update=this.update.bind(this),this.setOptions({...m2,...t});const{apiUrl:n,analyticsUrl:o,cdnImagesUrl:r,cdnTranslationsUrl:i}=Sf(this.options.environment,this.options._environmentUrls);this.loadingContext=n,this.analyticsContext=o,this.cdnImagesUrl=r,this.cdnTranslationsUrl=i,this.session=this.options.session&&new d2(this.options.session,this.options.clientKey,this.loadingContext);const a=this.options.clientKey?.substring(0,4);if((a==="test"||a==="live")&&!this.loadingContext.includes(a))throw new F("IMPLEMENTATION_ERROR",`Error: you are using a ${a} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);a==="pub."&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${this.options.clientKey?.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`),this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=At.metadata)}}He(At,"metadata",{version:na,bundleType:zl}),He(At,"registry",bo);async function Ua(e){return await new At(e).initialize()}Ua.register=(...e)=>{At.register(...e)},Ua.setBundleType=e=>{At.setBundleType(e)};const y2={SGD:"SG",USD:"US",HKD:"HK",AUD:"AU",GBP:"GB",EUR:"DE",CNY:"CN",JPY:"JP"};function dd(e){return y2[e.toUpperCase()]??"SG"}function Ar(e){const t=P("div",{class:"fy fy-threeds-overlay",role:"dialog","aria-modal":"true"}),n=P("div",{class:"fy-threeds-box"}),o=P("div",{class:"flex items-center justify-between border-b border-zinc-200 px-4 py-3"}),r=P("div",{class:"flex flex-col gap-0.5"});r.append(P("p",{class:"text-sm font-semibold",text:"Secure authentication"})),e.showWordmark!==!1&&r.append(On());const i=P("button",{type:"button",class:"rounded-md px-2 py-1 text-sm text-zinc-500 hover:bg-zinc-100",text:"Close"});o.append(r,i);const a=P("div",{class:"relative min-h-0 flex-1 bg-white"});let s=null;e.url&&(s=P("iframe",{src:e.url,title:"3-D Secure authentication",allow:"payment"}),s.style.cssText="width:100%;height:100%;border:0;display:block;",a.append(s)),n.append(o,a),t.append(n),document.body.append(t);const l=d=>{const p=d.data;if(!(!p||typeof p!="object")){if("code"in p&&p.code==="3DS-Success"){c(),e.onSuccess();return}if("code"in p&&p.code==="3DS-Error"){c(),e.onError(p.error?.message||p.resultCode||"3-D Secure failed");return}"success"in p&&p.success===!1&&(c(),e.onError(p.message||"3-D Secure failed"))}};window.addEventListener("message",l);function c(){window.removeEventListener("message",l),t.remove()}return i.addEventListener("click",()=>{c(),e.onError("Authentication cancelled")}),e.mountAdyen&&e.mountAdyen(a),c}function g2(e){return e==="applepay"?fo:e==="googlepay"?Pr:ma}async function ud(e){const t=e.paymentData.clientKey;if(!t)throw new Error("Adyen client key is missing.");let n=null,o=null;const r=await Ua({clientKey:t,environment:e.paymentData.environment||"test",locale:e.paymentData.locale||"en-US",countryCode:dd(e.currency),amount:{value:Math.round(e.amount*100),currency:e.currency},onSubmit:async(s,l)=>{if(!s.isValid)return;const c=s.data;await a({paymentMethod:c.paymentMethod,browserInfo:c.browserInfo},l)},onAdditionalDetails:async s=>{const l=s.data;await a({details:l.details,paymentData:l.paymentData},n)},onError:s=>{e.onError(s?.message||"Adyen checkout error")}}),i=g2(e.methodType);n=new i(r,{showPayButton:!0}).mount(e.container);async function a(s,l){const c=await e.client.confirmPayment(e.paymentId,s);if(!c.ok){e.onError(c.message);return}const d=c.data.paymentData?.action,p=c.data.paymentData?.resultCode;if(d){const h=String(d.type||""),m=zr(d.url);if((h==="redirect"||h==="redirect_iframe")&&m){o=Ar({url:m,showWordmark:e.showWordmark,onSuccess:e.onSuccess,onError:e.onError});return}o=Ar({showWordmark:e.showWordmark,onSuccess:e.onSuccess,onError:e.onError,mountAdyen:f=>{f.append(e.container);try{l?.handleAction?.(d)}catch{f.append("Could not present 3-D Secure challenge.")}}});return}if(p==="Authorised"||c.data.payment.transactionStatus==="Authorised"){e.onSuccess();return}p&&p!=="Pending"&&p!=="Received"&&e.onError(p)}return()=>{o?.(),n?.unmount?.()}}function hd(e){return String(e||"").toUpperCase()==="ADYEN"}function Ha(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function b2(e){if(Array.isArray(e))return e}function v2(e){if(Array.isArray(e))return Ha(e)}function pd(e,t,n,o,r,i,a){try{var s=e[i](a),l=s.value}catch(c){n(c);return}s.done?t(l):Promise.resolve(l).then(o,r)}function vo(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function a(l){pd(i,o,r,a,s,"next",l)}function s(l){pd(i,o,r,a,s,"throw",l)}a(void 0)})}}function Ka(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C2(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ja(e,t,n){return t&&C2(e.prototype,t),e}function za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function w2(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],r=!0,i=!1,a,s;try{for(n=n.call(e);!(r=(a=n.next()).done)&&(o.push(a.value),!(t&&o.length===t));r=!0);}catch(l){i=!0,s=l}finally{try{!r&&n.return!=null&&n.return()}finally{if(i)throw s}}return o}}function S2(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k2(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),o.forEach(function(r){za(e,r,n[r])})}return e}function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n}function Ir(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):E2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function md(e,t){return b2(e)||w2(e,t)||yd(e,t)||S2()}function fd(e){return v2(e)||_2(e)||yd(e)||k2()}function Co(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function yd(e,t){if(e){if(typeof e=="string")return Ha(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ha(e,t)}}function _o(e,t){var n,o,r,i,a={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=c[0]&2?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,o=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){a=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){a.label=c[1];break}if(c[0]===6&&a.label<r[1]){a.label=r[1],r=c;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(c);break}r[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(d){c=[6,d],o=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var on=(function(e){return e.production="prod",e.demo="demo",e.staging="staging",e})(on||{}),rn="airTracker_unknown",x2={appName:rn,appVersion:rn,env:"staging",isWebappContainer:!1,delay:2e3,errorRepeatTime:3,enableErrorMonitoring:!1,assetSpeedMonitoringWhiteList:[],enableDetectPageChange:!1,enableRecordPageRetention:!1,hideSearchParams:!1,useSessionStorageForSessionId:!1,assetSpeedMonitoringWhiteListByMFE:{}},P2={appName:rn,env:"staging",sessionId:rn,deviceId:rn},T2=function(e){return!e||/^\s*$/.test(e)?!1:(e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@"),e=e.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]"),e=e.replace(/(?:^|:|,)(?:\s*\[)+/g,""),/^[\],:{}\s]*$/.test(e))},gd=function(){var e=new WeakSet;return function(t,n){if(Ut(n,Error))return"Error.message: ".concat(n.message,`
|
|
140
|
-
Error.stack: `).concat(n.stack);if((typeof n>"u"?"undefined":
|
|
141
|
-
`).concat(In(e.error||""));Fr.normalLogPipeLine({severity:"autoDetectError",eventName:"windowOnError",extraInfo:{error:t}})},xd=function(e){var t=e&&In(e.reason);Fr.normalLogPipeLine({severity:"autoDetectError",eventName:"promiseError",extraInfo:{error:t}})},Pd=function(e){var t=e?.target||e?.srcElement;if(t){var n=t?.src||t?.href,o=t.tagName,r="unknown";if(typeof n=="string"&&o){if(window.location.href.indexOf(n)>-1)return;if(/\.js$/.test(n))r="script";else if(/\.css$/.test(n))r="css";else switch(o.toLowerCase()){case"script":r="script";break;case"link":r="css";break;case"img":r="image";break;case"audio":case"video":r="media";break;default:return}Fr.normalLogPipeLine({severity:"autoDetectError",eventName:"staticFileLoadError",extraInfo:{staticFileType:r,error:"".concat(o," load fail: ").concat(n)}})}}},z2=new So({name:"errorDetectionPlugin",setUp:function(e){Fr=e,window.addEventListener("error",Ed),window.addEventListener("unhandledrejection",xd),window.document.addEventListener("error",Pd,!0)},destroy:function(){window.removeEventListener("unhandledrejection",xd),window.document.removeEventListener("error",Pd,!0),window.removeEventListener("error",Ed)}}),q2=["img","css","script","link","audio","video","iframe"],Wa="resource",W2=function(e){var t=e.name;return{url:O2(t),method:"get",duration:Number(e.duration.toFixed(2)),type:"static",isHttps:V2(t),urlQuery:B2(t),domainLookup:Cd(e.domainLookupEnd-e.domainLookupStart),connectTime:Cd(e.connectEnd-e.connectStart)}},Ga=function(e,t){for(var n=0,o=e.length;n<o;n++){var r=e[n];q2.indexOf(r.initiatorType)!==-1&&U2(r.name,t)&&t.normalLogPipeLine({severity:"performance",eventName:"assets_speed",extraInfo:{log:W2(r)}})}},Ya,ko,G2=new So({name:"assetsSpeedPlugin",setUp:function(e){if(L2()){var t=0;window.performance.onresourcetimingbufferfull=function(){t=0,window.performance.clearResourceTimings()},typeof window.PerformanceObserver=="function"?(Ga(window.performance.getEntriesByType(Wa),e),ko=new window.PerformanceObserver(function(n){Ga(n.getEntries(),e)}),ko.observe({entryTypes:[Wa]})):Ya=setInterval(function(){var n=window.performance.getEntriesByType(Wa),o=n.slice(t);t=n.length,Ga(o,e)},3e3)}},destroy:function(){ko?.disconnect(),Ya&&clearInterval(Ya)}}),Eo,Y2=new So({name:"onPageChangePlugin",setUp:(function(){var e=vo(function(t){var n,o,r,i,a;return _o(this,function(s){return o=(n=location)===null||n===void 0?void 0:n.href,r=document.querySelector("body"),i=function(l){var c=l.prevHref,d,p,h,m,f;t.normalLogPipeLine({severity:"autoDetectEvent",eventName:"onPageChange",extraInfo:{prevHref:c,href:((d=location)===null||d===void 0?void 0:d.href)||"",hostname:(p=location)===null||p===void 0?void 0:p.hostname,pathName:(h=location)===null||h===void 0?void 0:h.pathname,protocol:(m=location)===null||m===void 0?void 0:m.protocol,search:(f=location)===null||f===void 0?void 0:f.search}})},i({prevHref:""}),Eo=new MutationObserver(function(){if(location.href!==o){var l=o;o=location.href,i({prevHref:l})}}),a={subtree:!0,childList:!0},Eo.observe(r||document,a),[2]})});return function(t){return e.apply(this,arguments)}})(),destroy:function(){Eo?.disconnect()}}),xo,Z2=new So({name:"onPageRetentionPlugin",setUp:(function(){var e=vo(function(t){var n,o,r,i,a,s,l;return _o(this,function(c){return typeof document.visibilityState>"u"?[2]:(o=(n=location)===null||n===void 0?void 0:n.href,r=document.querySelector("body"),a=function(){i=Date.now()},a(),document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"?s({href:location.href,leftReason:"visibilityChange"}):document.visibilityState==="visible"&&a()}),window.addEventListener("beforeunload",function(){s({href:location.href,sendImmediate:!0,leftReason:"pageClose"})}),s=function(d){var p=d.href,h=d.sendImmediate,m=d.leftReason;if(i){var f=Date.now()-i;if(f!==0){i=void 0;var y={severity:"autoDetectEvent",eventName:"onPageRetention",extraInfo:{href:p,duration:f,leftReason:m}};if(h){t.ImmediatePipeline(y);return}t.normalLogPipeLine(y)}}},xo=new MutationObserver(function(){if(location.href!==o){var d=o;o=location.href,s({href:d,leftReason:"nextPage"}),a()}}),l={subtree:!0,childList:!0},xo.observe(r||document,l),[2])})});return function(t){return e.apply(this,arguments)}})(),destroy:function(){xo?.disconnect()}}),Td=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2,15)},Dd=function(e,t){var n=[/^https?:\/\/[^\/]*\.airwallex\.com($|\/)/],o=[/authenticate\/heartbeat/,/papluginlogs\/.*/,/airtracker\/.*/,/o11y(-staging|-demo)?\.airwallex\.com/,/\.(png|jpe?g|gif|svg|ico|webp|avif|css|js|json|woff2?|ttf|eot|map|txt|csv|xml)(\?.*)?(#.*)?$/i];return o.some(function(r){return r.test(e)})?!1:qa(e,t||n)},Q2=function(e){var t=e.startTime,n=e.endTime,o=e.entries;if(o.length!==0){if(o.length===1)return o[0];var r=o.filter(function(i){return i.startTime>=t&&n&&i.responseEnd<=n}).sort(function(i,a){return i.startTime-a.startTime});return r?.[0]}},Nd=function(e){return Math.round(e*100)/100},J2=function(e){var t=e.startTime,n=e.duration,o=e.responseStart,r=e.connectEnd,i=e.connectStart,a=e.domainLookupEnd,s=e.domainLookupStart,l=e.requestStart,c=e.secureConnectionStart,d=e.redirectEnd,p=e.redirectStart,h=e.responseStatus,m=e.responseEnd,f=e.encodedBodySize,y=e.decodedBodySize,b=e.transferSize,v=e.deliveryType,C=e.initiatorType;return{startTime:Nd(t),totalDuration:Nd(n),timeToFirstByte:Rn(o,t),tcpDuration:Rn(r,i),dnsDuration:Rn(a,s),tlsDuration:Rn(l,c),redirectDuration:Rn(d,p),responseDuration:Rn(m,o),encodeResponseSize:f,decodeResponseSize:y,transferSize:b,deliveryType:v,statusCode:h,initiatorType:C}},Ad=function(e,t){var n=e.url,o=e.method,r=e.errorType,i=e.errorDetail,a=Q2(e),s=new URL(n,window.location.href),l=s.href,c=s.protocol,d=a?J2(a):{},p={severity:"autoDetectEvent",eventName:"httpClientMetrics",extraInfo:ft(Ir(ft({httpUrl:l,method:o,scheme:c},r&&{errorType:r},i&&{errorDetail:i},d),{statusCode:d?.statusCode||e?.responseStatus,startTime:d?.startTime||e?.startTime,initiatorType:d?.initiatorType||e?.initiatorType}),t)};return p},Id=function(e){return e&&(typeof e>"u"?"undefined":Co(e))==="object"&&"errors"in e&&Array.isArray(e.errors)&&e.errors.every(function(t){return t&&(typeof t>"u"?"undefined":Co(t))==="object"&&"message"in t})},lt="awx_airtracker_api_performance_queue",Rd="awx_airtracker_api_performance_plugin_loaded",X2=300,ey=1e4,Ke=typeof window<"u"?window:typeof global<"u"?global:{};Ke[lt]=Ke[lt]||[];var $n=function(e,t,n){setTimeout(function(){var o=Ad(e,n);t.observerPipeline(o),Ke[lt]=Ke[lt].filter(function(r){return r.id!==e.id})},X2)},$d=function(e,t){setTimeout(function(){var n=Ke[lt].find(function(r){return r.id===e});if(n){var o=Ad(n,{exceptionType:"timeout-without-response"});t.observerPipeline(o),Ke[lt]=Ke[lt].filter(function(r){return r.id!==e})}},ey)},ty=function(e){var t=XMLHttpRequest.prototype.open,n=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(r,i,a,s,l){try{var c,d=Td();this.__requestId=d;var p=Ut(i,URL)?i.href:new URL(i,window.location.href).href;if(!Dd(p,(c=e.config)===null||c===void 0?void 0:c.enableRecordAPIPerformanceWhitelist))return t.call(this,r,i,a??!0,s,l);var h={id:d,startTime:performance.now(),method:r,url:p,entries:[],initiatorType:"xmlhttprequest"};return Ke[lt].push(h),$d(d,e),t.call(this,r,i,a??!0,s,l)}catch(m){return e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject XHR open error",error:m}}),t.call(this,r,i,a??!0,s,l)}},XMLHttpRequest.prototype.send=function(){for(var r=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];try{var l=Ke[lt].find(function(d){return d.id===r.__requestId});if(!l)return n.apply(this,a);var c=this;return this.addEventListener("loadend",vo(function(){var d,p,h,m,f,y,b;return _o(this,function(v){switch(v.label){case 0:if(d=performance.now(),p=d-l.startTime,h=c.status,h===0)return[2];l.endTime=d,l.duration=p,l.responseStatus=h,v.label=1;case 1:return v.trys.push([1,6,,7]),c.responseType===""||c.responseType==="text"?(m=c.responseText,[3,5]):[3,2];case 2:return c.responseType!=="json"?[3,3]:(m=c.response,[3,5]);case 3:return c.responseType!=="blob"?[3,5]:(f=c.response,f?.type!=="application/json"?[3,5]:[4,f.text()]);case 4:m=v.sent(),v.label=5;case 5:return y=m&&typeof m=="string"?JSON.parse(m):m,y&&Id(y)&&(l.errorType="graphqlError",l.errorDetail=y.errors),[3,7];case 6:return b=v.sent(),e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in XHR",url:l?.url,error:b}}),[3,7];case 7:return $n(l,e),[2]}})})),this.addEventListener("error",function(){$n(l,e,{exceptionType:"network-error"})}),this.addEventListener("abort",function(){$n(l,e,{exceptionType:"abort-error"})}),this.addEventListener("timeout",function(){$n(l,e,{exceptionType:"timeout-error"})}),n.apply(this,a)}catch(d){throw e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"InjectXHR send error",error:d}}),d}}},ny=function(e){var t=window.fetch;window.fetch=vo(function(){var n,o,r,i,a,s,l,c,d,p,h,m,f,y,b,v,C=arguments;return _o(this,function(_){switch(_.label){case 0:for(n=C.length,o=new Array(n),r=0;r<n;r++)o[r]=C[r];return s=new URL(Ut(o[0],Request)?o[0].url:String(o[0]),window.location.href).href,Dd(s,(i=e.config)===null||i===void 0?void 0:i.enableRecordAPIPerformanceWhitelist)?[3,2]:[4,t.apply(this,o)];case 1:return[2,_.sent()];case 2:return _.trys.push([2,9,,10]),c=performance.now(),d=Td(),a={id:d,startTime:c,method:((l=Ut(o[0],Request)?o[0]:o[1])===null||l===void 0?void 0:l.method)||"GET",url:s,entries:[],initiatorType:"fetch"},Ke[lt].push(a),$d(d,e),[4,t.apply(this,o)];case 3:p=_.sent(),h=performance.now(),a.endTime=h,a.duration=h-c,a.responseStatus=p.status,m=p.clone(),_.label=4;case 4:return _.trys.push([4,7,,8]),m.ok?[4,m.json()]:[3,6];case 5:f=_.sent(),f&&Id(f)&&(a.errorType="graphqlError",a.errorDetail=f.errors),_.label=6;case 6:return[3,8];case 7:return y=_.sent(),e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in fetch",url:a?.url,error:y}}),[3,8];case 8:return $n(a,e),[2,p];case 9:throw b=_.sent(),a&&a.id&&Ke[lt].find(function(S){return S.id===a?.id})?(v="fetch-error",Ut(b,TypeError)?v="network-error":Ut(b,DOMException)&&b.name==="AbortError"&&(v="abort-error"),$n(a,e,{exceptionType:v})):e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject fetch error",error:b}}),b;case 10:return[2]}})})},oy=function(e){var t;if(ty(e),ny(e),!((t=window)===null||t===void 0)&&t.PerformanceObserver){var n=new window.PerformanceObserver(function(o){var r=o.getEntries();r.forEach(function(i){var a=i;if(a.initiatorType==="fetch"||a.initiatorType==="xmlhttprequest"){var s=Ke[lt].filter(function(l){return l.url===a.name});s.forEach(function(l){l.entries.push(a)})}})});n.observe({entryTypes:["resource"],buffered:!0})}else e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{error:"PerformanceObserver Not Supported"}})},ry=new So({name:"apiPerformancePlugin",setUp:(function(){var e=vo(function(t){var n,o;return _o(this,function(r){return Ke[Rd]?[2]:(!((n=t.config)===null||n===void 0)&&n.enableRecordAPIPerformance&&Math.random()<(((o=t.config)===null||o===void 0?void 0:o.enableRecordAPIPerformancePercentage)||0)&&(Ke[Rd]=!0,oy(t)),[2])})});return function(t){return e.apply(this,arguments)}})()}),iy="3.1.0",ay=(function(){function e(t){var n=this,o=t.config,r=t.plugins,i=r===void 0?[]:r;Ka(this,e),this.config=x2,this.lifeCycle=new j2,this.plugins=[],this._commonData=P2,this._MFECommonDataMap={},this.timeMap={},this.packedDataConvert=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d,p,h=ft({severity:s,eventName:l,currentHref:n.config.hideSearchParams?(((d=location)===null||d===void 0?void 0:d.href)||"").split("?")[0]||"":((p=location)===null||p===void 0?void 0:p.href)||""},c);return n.config.isWebappContainer&&(h.MFEName=wo(n)),h},this.normalPipelineObj=kd([wd(this,8),K2(this),_d(this)]),this.observerPipelineObj=kd([wd(this,8),H2(this)]),this.immediateSendPipe=_d(this),this.observerPipeline=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d=n.packedDataConvert({severity:s,eventName:l,extraInfo:c});return n.observerPipelineObj(d)},this.normalLogPipeLine=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d=n.packedDataConvert({severity:s,eventName:l,extraInfo:c});return n.config.disableThrottle?n.immediateSendPipe(d):n.normalPipelineObj(d)},this.ImmediatePipeline=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d=n.packedDataConvert({severity:s,eventName:l,extraInfo:c});return n.immediateSendPipe(d)},this.plugins=fd(i),this.setConfig(o),this.initCommonData(o),this.lifeCycle.emit(It.onInit),o.enableErrorMonitoring&&this.plugins.push(z2),(o?.assetSpeedMonitoringWhiteList&&o.assetSpeedMonitoringWhiteList.length>0||o.isWebappContainer)&&this.plugins.push(G2),o?.enableDetectPageChange&&this.plugins.push(Y2),o?.enableRecordPageRetention&&this.plugins.push(Z2),o?.enableRecordAPIPerformance&&o?.enableRecordAPIPerformancePercentage&&o.enableRecordAPIPerformancePercentage>0&&o.enableRecordAPIPerformancePercentage<=1&&this.plugins.push(ry),this.installPlugins()}return ja(e,[{key:"installPlugins",value:function(){var n=this;this.plugins.forEach(function(o){o.patch(n)})}},{key:"commonData",get:function(){return this._commonData}},{key:"MFECommonDataMap",get:function(){return this._MFECommonDataMap}},{key:"initCommonData",value:function(n){this._commonData.sessionId=n.useSessionStorageForSessionId?I2():$r(),this._commonData.deviceId=R2()||rn,this._commonData.riskDeviceId=$2(),this._commonData.networkType=F2()||"unknown",this._commonData.env=n.env||this._commonData.env,this._commonData.accountId=n.accountId||rn,this._commonData.appVersion=n.appVersion,this._commonData.appName=n.appName,this._commonData.sdkVersion=iy,this.lifeCycle.emit(It.onCommonDataInit,this.commonData)}},{key:"updateCommonDataBasedOnConfig",value:function(n){this.lifeCycle.emit(It.onCommonUpdated,this._commonData),this._commonData.env=n.env||this._commonData.env,this._commonData.appName=n.appName||this._commonData.appName,this._commonData.env=n.env||this._commonData.env,this._commonData.accountId=n.accountId||this._commonData.accountId,this._commonData.appVersion=n.appVersion||this._commonData.appVersion}},{key:"updateCommonData",value:function(n){this.lifeCycle.emit(It.onCommonUpdated,this._commonData),this._commonData=ft({},this._commonData,n)}},{key:"removeCommonDataByKey",value:function(n){var o=this;this.lifeCycle.emit(It.onCommonUpdated,this._commonData),setTimeout(function(){n.forEach(function(r){delete o._commonData[r]})},1e3)}},{key:"addToMFECommonData",value:function(n){var o=n.MFEName,r=n.MFECommonData,i;this.config.isWebappContainer&&(!o||!r||(this._MFECommonDataMap=Ir(ft({},this._MFECommonDataMap||{}),za({},o,ft({},((i=this._MFECommonDataMap)===null||i===void 0?void 0:i[o])||{},r)))))}},{key:"setConfig",value:function(n){var o=this;if(!this.config.isWebappContainer){var r=function(i,a){o.config[i]=a};Object.entries(n).forEach(function(i){var a=md(i,2),s=a[0],l=a[1];(typeof l>"u"?"undefined":Co(l))!==void 0&&r(s,l)}),this.lifeCycle.emit(It.onConfigInit,this.config),this.updateCommonDataBasedOnConfig(n)}}},{key:"verbose",value:function(n,o){this.normalLogPipeLine({severity:"verbose",eventName:n,extraInfo:o})}},{key:"httpLog",value:function(n,o){this.normalLogPipeLine({severity:"http",eventName:n,extraInfo:o})}},{key:"info",value:function(n,o){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:o})}},{key:"warn",value:function(n,o){this.normalLogPipeLine({severity:"warn",eventName:n,extraInfo:o})}},{key:"error",value:function(n,o){console.error("error",n),this.normalLogPipeLine({severity:"error",eventName:n,extraInfo:o})}},{key:"businessLog",value:function(n,o){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:Ir(ft({},o),{isBusinessLog:!0})})}},{key:"reportDuration",value:function(n,o,r){if(typeof n!="string"){console.warn("reportDuration: eventName (first param) must be a string");return}if(typeof o!="number"){console.warn("reportDuration: duration (second param) must be number");return}if(o<0||o>6e4){console.warn("reportDuration: duration (second param) must between 0 and 60000");return}this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:ft({duration:o},r)})}},{key:"getTimerKey",value:function(n){var o=wo(this);return this.config.isWebappContainer?"".concat(o,"_").concat(n):n}},{key:"timeStart",value:function(n){if(typeof n!="string"){console.warn("time: first param must be a string");return}this.timeMap[this.getTimerKey(n)]&&console.warn("Timer ".concat(n," already exists")),this.timeMap[this.getTimerKey(n)]=Date.now()}},{key:"timeEnd",value:function(n,o){if(typeof n!="string"){console.warn("timeEnd: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){var r=Date.now()-this.timeMap[this.getTimerKey(n)]+(o||0);this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:{duration:r}}),delete this.timeMap[this.getTimerKey(n)]}else console.warn("Timer key :".concat(n," does not exist"))}},{key:"addToAssetSpeedWhiteListByMFE",value:function(n){var o=n.MFEName,r=n.whiteList,i;if(this.config.isWebappContainer&&!(!o||!r?.length))if(this.config.assetSpeedMonitoringWhiteListByMFE||(this.config.assetSpeedMonitoringWhiteListByMFE={}),!(!((i=this.config.assetSpeedMonitoringWhiteListByMFE)===null||i===void 0)&&i[o]))this.config.assetSpeedMonitoringWhiteListByMFE=Ir(ft({},this.config.assetSpeedMonitoringWhiteListByMFE),za({},o,r));else{var a,s,l;(l=this.config.assetSpeedMonitoringWhiteListByMFE)===null||l===void 0||(s=l[o])===null||s===void 0||(a=s).push.apply(a,fd(r))}}},{key:"destroy",value:function(){this.config.isWebappContainer||this.plugins.forEach(function(n){n.uninstall()})}}]),e})(),sy=ay,Za=function(e,t){return Za=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},Za(e,t)};function Qa(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Za(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ct=function(){return ct=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ct.apply(this,arguments)};function Po(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(d){try{c(o.next(d))}catch(p){a(p)}}function l(d){try{c(o.throw(d))}catch(p){a(p)}}function c(d){d.done?i(d.value):r(d.value).then(s,l)}c((o=o.apply(e,[])).next())})}function To(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(d){return l([c,d])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(o=1,r&&(i=c[0]&2?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,r=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(d){c=[6,d],r=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Fd(e,t,n){for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ly="1.35.0",cy={version:ly},dy={dev:on.staging,staging:on.staging,demo:on.demo,prod:on.production},uy=function(e,t){return e===void 0&&(e=on.production),window._AirwallexSDKs.airTracker||(window._AirwallexSDKs.airTracker=new sy({config:{appName:"components-sdk",appVersion:cy.version,env:dy[e]||on.production}}),window._AirwallexSDKs.airTracker.updateCommonData({clientId:t})),window._AirwallexSDKs.airTracker},Mr=function(e){if(typeof e!="object")return e;try{var t=JSON.parse(JSON.stringify(e));return Object.keys(t).forEach(function(n){typeof n=="string"&&["auth","code"].some(function(o){return n.includes(o)})&&(t[n]="***")}),t}catch{return e}},an=function(e,t){var n,o;(o=(n=window._AirwallexSDKs)===null||n===void 0?void 0:n.airTracker)===null||o===void 0||o.error(e,ct(ct({},t),{context:"components-sdk"}))},hy=function(e,t){var n;(n=window._AirwallexSDKs.airTracker)===null||n===void 0||n.warn(e,ct(ct({},t),{context:"components-sdk"}))},Do=function(e,t){var n;(n=window._AirwallexSDKs.airTracker)===null||n===void 0||n.info(e,ct(ct({},t),{context:"components-sdk"}))},Md=(function(e){Qa(t,e);function t(n){var o=e.call(this,n)||this;return o.code="LOAD_SCRIPT_ERROR",o}return t})(Error),sn,ln,Ee;(function(e){e.dev="dev",e.staging="staging",e.demo="demo",e.prod="prod",e.sandbox="sandbox"})(Ee||(Ee={}));var py=(sn={},sn[Ee.dev]="https://checkout-staging.airwallex.com",sn[Ee.staging]="https://checkout-staging.airwallex.com",sn[Ee.demo]="https://checkout-demo.airwallex.com",sn[Ee.prod]="https://checkout.airwallex.com",sn[Ee.sandbox]="https://checkout.sandbox.airwallex.com",sn),my=(ln={},ln[Ee.dev]="https://static-staging.airwallex.com",ln[Ee.staging]="https://static-staging.airwallex.com",ln[Ee.demo]="https://static-demo.airwallex.com",ln[Ee.prod]="https://static.airwallex.com",ln[Ee.sandbox]="https://static.sandbox.airwallex.com",ln),Ld="sdkController",Od="payments",fy={kyc:"/widgets/kyc/sdk/v1/index.js",rfi:"/widgets/kycRfi/sdk/v1/index.js",paymentsKyb:"/widgets/paymentsKyb/sdk/v1/index.js",sdkController:"/widgets/sdk-controller/sdk/v1/index.js",payouts:"/widgets/payouts/sdk/v1/index.js",payments:"/assets/elements.bundle.min.js",sca:"/hosted-sca/sdk/v1/index.js",taxForm:"/widgets/taxForm/sdk/v1/index.js",billing:"/widgets/checkout/sdk/v1/index.js"},yy={kyc:"kyc",paymentsKyb:"paymentsKyb",kycRfi:"rfi",transactionRfi:"rfi",paymentEnablementRfi:"rfi",lendingRfi:"rfi",mrmRfi:"rfi",payoutForm:"payouts",beneficiaryForm:"payouts",hpp:"payments",cvc:"payments",card:"payments",expiry:"payments",dropIn:"payments",cardNumber:"payments",applePayButton:"payments",googlePayButton:"payments",krCardNumber:"payments",krCardIdentifier:"payments",krCardExpiry:"payments",krCardPswFirstTwo:"payments",scaSetup:"sca",scaVerify:"sca",scaManagement:"sca",taxForm:"taxForm",embeddedCheckout:"billing"},Bd={payments:["hpp","cvc","card","expiry","dropIn","cardNumber","applePayButton","googlePayButton","krCardNumber","krCardIdentifier","krCardExpiry","krCardPswFirstTwo"],payouts:["payoutForm","beneficiaryForm"],onboarding:["kyc","paymentsKyb"],risk:["scaSetup","scaVerify","scaManagement","transactionRfi","kycRfi","paymentEnablementRfi","lendingRfi","mrmRfi"],billing:["embeddedCheckout"]},gy={billing:["payments"]},Vd=["payments","sca","billing"],by=(function(e){Qa(t,e);function t(n){var o=e.call(this,n)||this;return o.code="INVALID_STATIC_RESOURCE_ERROR",o}return t})(Error),vy=Date.now(),Cy=function(e){return Object.keys(Bd).includes(e)},_y=function(e){return e===void 0&&(e=500),new Promise(function(t){return window.setTimeout(t,e)})},Ud=function(e){return yy[e]},wy=function(e,t){var n=e===Od?py:my;return n[t]||n.prod},Hd=function(e){var t=e.reduce(function(n,o){return n.concat(Cy(o)?Bd[o]:o)},[]);return Array.from(new Set(t)).map(function(n){return{elementName:n,sdkName:Ud(n)}})},Sy=function(e){return Array.from(new Set(Hd(e).map(function(t){var n=t.sdkName;return n}).filter(function(t){return Vd.includes(t)})))},No=function(e){return e==="payments"?"payment":e},Kd=function(e){var t=e.name,n=e.env,o=n===void 0?Ee.prod:n,r=wy(t,o),i=fy[t];if(!i)throw an("[components-sdk] Element static resource not found",{sdkName:t}),new by("Element ".concat(t," static resource URL is invalid."));return"".concat(r).concat(i,"?ts=").concat(vy)},ky=function(){return Vd.reduce(function(e,t){var n;return ct(ct({},e),(n={},n[t]=window._AirwallexSDKs.__controller__.internalSDKs[t],n))},{})},Ey=function(e){return gy[e]||[]},Ht=function(){return Math.floor(performance.now())},xy=function(e){var t=document.createElement("script");t.src=e,t.type="module";var n=document.head||document.body;return n.appendChild(t),t},Py=3,Ty=function(e){return Po(void 0,void 0,void 0,function(){var t,n;return To(this,function(o){switch(o.label){case 0:if(typeof window>"u")throw new Error("Please load script in browser environment");t=0,n=function(){return Po(void 0,void 0,void 0,function(){var r,i,a;return To(this,function(s){return r=Ht(),t>0&&e.includes("?ts=")&&(i=new URL(e,window.location.href),i.searchParams.set("ts","".concat(Date.now())),e=i.toString()),a=xy(e),[2,new Promise(function(l,c){a.addEventListener("load",function(){var d=Ht();Do("[components-sdk] SDK script loaded",{scriptUrl:e,start:r,latency:d-r,end:d,retryCount:t}),l(!0)}),a.addEventListener("error",function(d){a.remove(),console.error(d);var p=Ht();an("[components-sdk] Failed to load script",{scriptUrl:e,error:d,start:r,latency:p-r,end:p,retryCount:t}),c(new Md("Failed to load Airwallex SDK scripts: ".concat(e)))})})]})})},o.label=1;case 1:if(!(t<Py))return[3,7];o.label=2;case 2:return o.trys.push([2,4,,6]),[4,n()];case 3:return[2,o.sent()];case 4:return o.sent(),t++,[4,_y()];case 5:return o.sent(),[3,6];case 6:return[3,1];case 7:throw an("[components-sdk] Failed to load script after retry",{scriptUrl:e,retryCount:t}),new Md("Failed to load Airwallex SDK scripts: ".concat(e))}})})},jd=(function(e){Qa(t,e);function t(n){var o=e.call(this,n)||this;return o.code="INSTANCE_NOT_FOUND_ERROR",o}return t})(Error),Lr,zd=new Map,Ja=function(e){var t=e.env,n=e.scriptName,o=Kd({name:n,env:t}),r=zd.get(n);if(r)return r;var i=Ty(o);return zd.set(n,i),i},Xa=function(e){var t=e.env,n=e.scriptName;return Po(void 0,void 0,void 0,function(){var o;return To(this,function(r){switch(r.label){case 0:return o=Ey(n),o.length>0?[4,Promise.all(o.map(function(i){return Ja({env:t,scriptName:i})}))]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2,Ja({env:t,scriptName:n})]}})})},qd=function(e){return Po(void 0,void 0,void 0,function(){return To(this,function(t){if(typeof window>"u")throw new Error("Please call the `init()` function in a browser environment.");return uy(e.env,e.clientId),Do("[components-sdk] SDK init start",{options:Mr(e),start:Ht()}),Lr=new Promise(function(n,o){var r,i=ct(ct({},e),{env:e.env&&Ee[e.env]?e.env:Ee.prod});window.AirwallexComponentsSDK.__env__=i.env;var a=Ja({env:i.env,scriptName:Ld}).then(function(){return window._AirwallexSDKs.__controller__.init(i)}),s=(r=e.enabledElements)!==null&&r!==void 0?r:[],l=Sy(s),c=l.map(function(h){return Xa({env:i.env,scriptName:h}).then(function(){return a}).then(function(){var m=window._AirwallexSDKs[No(h)];if(!m)throw an("[components-sdk] SDK instance not found",{functionsNamespace:h,windowSDKInstanceName:No(h)}),new jd("SDK instance not found");return window._AirwallexSDKs.__controller__.registerFunctions({functionsNamespace:h,instance:m})})}),d=Hd(s),p=d.map(function(h){var m=h.sdkName,f=h.elementName;return Xa({scriptName:m,env:i.env}).then(function(){return a}).then(function(){var y=window._AirwallexSDKs[No(m)];if(!y)throw an("[components-sdk] SDK instance not found",{sdkName:m,windowSDKInstanceName:No(m)}),new jd("SDK instance not found");return window._AirwallexSDKs.__controller__.registerElement({sdkName:m,elementName:f,instance:y})})});Promise.all(Fd(Fd([a],c,!0),p)).then(function(){Do("[components-sdk] SDK initialized",{options:Mr(e),start:Ht()}),n(ky())}).catch(function(h){h.code||an("[components-sdk] Unexpected errors when init",{error:h}),o(h)})}),[2,Lr]})})},Ao=function(e,t){return Po(void 0,void 0,void 0,function(){var n,o,r,i,a;return To(this,function(s){switch(s.label){case 0:if(!e)throw new Error("Element type is missing. Please specify a valid element.");if(Do("[components-sdk] SDK createElement start",{elementName:e,options:Mr(t),timestamp:Ht()}),!Lr)throw hy("[components-sdk] Did not call init before createElement"),new Error("Please initialize the Element before creating it.");return[4,Lr];case 1:if(s.sent(),n=Ud(e),!n)throw new Error("`createElement()` with type `".concat(e,"` is not supported. Please specify a valid Element type."));o=Ht(),s.label=2;case 2:return s.trys.push([2,6,,7]),[4,Xa({scriptName:n,env:window.AirwallexComponentsSDK.__env__||Ee.prod})];case 3:return s.sent(),[4,window._AirwallexSDKs.__controller__.registerElement({sdkName:n,elementName:e,instance:window._AirwallexSDKs[No(n)]})];case 4:return s.sent(),[4,window._AirwallexSDKs.__controller__.createElement(e,t)];case 5:return r=s.sent(),i=Ht(),Do("[components-sdk] SDK createElement being called",{elementName:e,options:Mr(t),start:o,latency:i-o,end:i}),[3,7];case 6:if(a=s.sent(),!a.code)an("[components-sdk] Unexpected errors when createElement",{error:a});else throw a;return[3,7];case 7:return[2,r]}})})},Dy=[Ld,Od],Wd=function(){Dy.forEach(function(e){var t=Kd({name:e,env:Ee.prod}),n=document.createElement("link");n.href=t,n.rel="modulepreload",n.as="script";var o=document.head||document.body;o.appendChild(n)})},Ny=typeof document>"u"||typeof window>"u";Ny||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Wd):Wd()),typeof window<"u"&&(window.AirwallexComponentsSDK||Object.defineProperties(window,{AirwallexComponentsSDK:{value:{},writable:!1},_AirwallexSDKs:{value:{},writable:!1}}),window.AirwallexComponentsSDK.init=qd,window.AirwallexComponentsSDK.createElement=Ao);const es={base:{fontSize:"14px",color:"#09090b","::placeholder":{color:"#a1a1aa"}}},Ay={visa:"visa",mastercard:"mastercard",amex:"amex",jcb:"jcb",cup:"unionpay"};let ts=null;function Gd(e){return ts||(ts=qd({env:du(e),enabledElements:["payments"],locale:"en"}).then(()=>{})),ts}async function Iy(e){await Gd(e.apiBase);const t=mu("fy-awx-auth"),n=P("div",{class:"h-10 rounded-lg border border-zinc-200 px-3"}),o=P("div",{class:"h-10 rounded-lg border border-zinc-200 px-3"}),r=P("div",{class:"h-10 rounded-lg border border-zinc-200 px-3"}),i=P("form",{class:"mt-4 flex flex-col gap-3"},[ns("Card number",n),P("div",{class:"grid grid-cols-2 gap-3"},[ns("Expiry",o),ns("CVC",r)]),P("div",{id:t})]),a=Zr(`Pay ${Ln(e.amount,e.currency)}`);i.append(a),e.container.append(i);const s={id:e.intentId,client_secret:e.clientSecret,currency:e.currency},l=e.allowedBrands?.map(m=>Ay[m.toLowerCase()]).filter(Boolean),[c,d,p]=await Promise.all([Ao("cardNumber",{intent:s,style:es,authFormContainer:t,allowedCardNetworks:l?.length?l:void 0,autoCapture:e.autoCapture}),Ao("expiry",{style:es}),Ao("cvc",{style:es})]);if(!c||!d||!p)throw new Error("Could not create card input fields.");c.mount(n),d.mount(o),p.mount(r);const h=async m=>{m.preventDefault(),a.disabled=!0;try{await c.confirm({intent_id:e.intentId,client_secret:e.clientSecret}),e.onSuccess()}catch(f){e.onError(f instanceof Error?f.message:"Card payment failed"),a.disabled=!1}};return i.addEventListener("submit",h),a.addEventListener("click",h),()=>{i.removeEventListener("submit",h),c.destroy?.(),d.destroy?.(),p.destroy?.()}}async function Ry(e){if(e.wallet==="applepay"&&!qr())return e.container.append(Oe("Apple Pay is not supported in this browser.")),()=>{};if(e.wallet==="googlepay"&&!Wr())return e.container.append(Oe("Google Pay is not supported in this browser.")),()=>{};await Gd(e.apiBase);const t=P("div",{class:"mt-4 min-h-[48px]"}),n=Bn(`Loading ${e.wallet==="applepay"?"Apple Pay":"Google Pay"}…`);e.container.append(n,t);const o=dd(e.currency),r={value:e.amount,currency:e.currency},i=e.wallet==="applepay"?"applePayButton":"googlePayButton",a=await Ao(i,{intent_id:e.intentId,client_secret:e.clientSecret,countryCode:o,amount:r,autoCapture:e.autoCapture,buttonType:"pay",buttonColor:"black"});if(!a)return n.remove(),e.container.append(Oe("Could not create wallet button.")),()=>{};a.mount(t),n.remove();const s=()=>e.onSuccess(),l=c=>{e.onError(c?.detail?.message||"Wallet payment failed.")};return a.on("success",s),a.on("error",l),()=>{a.destroy?.()}}function ns(e,t){return P("label",{class:"flex flex-col gap-1 text-sm font-medium text-zinc-700"},[P("span",{text:e}),t])}function $y(e,t,n){const o=P("p",{class:"mt-2 text-sm text-zinc-500"});e.append(o);function r(){const a=t-Date.now();if(a<=0){o.textContent="This QR code has expired.",n();return}const s=Math.floor(a/1e3),l=Math.floor(s/3600),c=Math.floor(s%3600/60),d=s%60,p=h=>String(h).padStart(2,"0");o.textContent=l>0?`Expires in ${l}:${p(c)}:${p(d)}`:`Expires in ${p(c)}:${p(d)}`}r();const i=window.setInterval(r,1e3);return()=>window.clearInterval(i)}const Fy=3e3,My=7200*1e3,Ly=600*1e3,Oy={wechatpay:"Open the WeChat app on your phone, scan this QR code, and complete the payment.",paynow:"Open your banking or PayNow app, scan this QR code, and complete the payment.",alipaycn:"Open the Alipay app on your phone, scan this QR code, and complete the payment.",alipayhk:"Open the AlipayHK app on your phone, scan this QR code, and complete the payment.",alipay:"Open the Alipay app on your phone and complete the payment."};function Or(e){return new $o(e.apiKey,e.apiBase)}async function Yd(e,t,n){return Or(e).createPayment({amount:t.amount,currency:t.currency,orderId:t.orderId,items:t.items,returnUrl:t.returnUrl,autoCapture:t.autoCapture,metadata:t.metadata,paymentMethod:n})}function Zd(e){const t=e.result.provider||e.result.payment.platform,n=e.result.paymentData||e.result.paymentIntent||{},o=e.result.paymentIntent||n,r=o?.next_action,i=r?.qrcode||e.result.paymentData?.action?.qrCodeData,a=r?.type==="redirect_iframe",s=r?.type==="redirect"?r.url:!i&&!a?r?.url:void 0,l=zr(s),c=e.method.type,d=[];if(c==="card"){if(hd(t)){const m=P("div",{class:"mt-4"});return e.host.append(m),ud({container:m,client:Or(e.ctx),paymentId:String(e.result.payment.id),methodType:c,paymentData:n,amount:e.options.amount,currency:e.options.currency,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError}).then(f=>d.push(f)).catch(f=>{e.onError(f instanceof Error?f.message:"Failed to load card form")}),()=>d.forEach(f=>f())}const p=o?.id,h=o?.client_secret;return!p||!h?(e.host.append(Oe("Card payment is unavailable — missing payment intent credentials.")),()=>{}):(Iy({container:e.host,apiBase:e.ctx.apiBase,intentId:p,clientSecret:h,currency:e.options.currency,amount:e.options.amount,autoCapture:e.options.autoCapture,allowedBrands:e.method.brands,onSuccess:e.onSuccess,onError:e.onError}).then(m=>d.push(m)).catch(m=>{e.onError(m instanceof Error?m.message:"Failed to load card form")}),()=>d.forEach(m=>m()))}if(nh(c)){if(hd(t)){const m=P("div",{class:"mt-4"});return e.host.append(m),ud({container:m,client:Or(e.ctx),paymentId:String(e.result.payment.id),methodType:c,paymentData:n,amount:e.options.amount,currency:e.options.currency,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError}).then(f=>d.push(f)).catch(f=>{e.onError(f instanceof Error?f.message:"Failed to load wallet")}),()=>d.forEach(f=>f())}const p=o?.id,h=o?.client_secret;return!p||!h?(e.host.append(Oe(`${e.method.name} is unavailable — missing payment intent credentials.`)),()=>{}):(Ry({container:e.host,apiBase:e.ctx.apiBase,wallet:c,intentId:p,clientSecret:h,currency:e.options.currency,amount:e.options.amount,autoCapture:e.options.autoCapture,allowedBrands:e.method.brands,onSuccess:e.onSuccess,onError:e.onError}).then(m=>d.push(m)).catch(m=>{e.onError(m instanceof Error?m.message:"Failed to load wallet")}),()=>d.forEach(m=>m()))}if(i&&(oh(c)||xs(c)))return By({host:e.host,ctx:e.ctx,qrcode:i,method:e.method,paymentId:String(e.result.payment.id),onSuccess:e.onSuccess,onError:e.onError});if(xs(c)&&(l||a)){if(a&&l)return Ar({url:l,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError});if(l)return e.host.append(P("p",{class:"mt-4 text-sm text-zinc-600",text:"Redirecting…"})),window.location.assign(l),()=>{}}if(l)return e.host.append(P("p",{class:"mt-4 text-sm text-zinc-600",text:"Redirecting…"})),window.location.assign(l),()=>{};if(a&&r?.url){const p=zr(r.url);if(p)return Ar({url:p,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError})}return e.host.append(Oe("This payment method could not be displayed.")),()=>{}}function By(e){const t=e.method.type==="wechatpay"?My:Ly,n=Date.now()+t,o=Oy[e.method.type.toLowerCase()]??"Scan this QR code with your mobile app to complete the payment.",r=P("div",{class:"mt-4 flex flex-col items-center"});r.append(Yr(e.method.type,e.method.name)),r.append(P("p",{class:"mt-3 text-sm text-zinc-600 text-center",text:o}));let i=!1,a=!1;const s=P("canvas",{class:"mt-4 rounded-lg border border-zinc-200 bg-white"});try{Vy(s,e.qrcode),r.append(s)}catch{return r.append(Oe("Could not display QR code.")),e.host.append(r),()=>{}}const l=P("div");r.append(l);const c=$y(l,n,()=>{i=!0,e.onError("This QR code has expired.")});e.host.append(r);const d=Or(e.ctx),p=window.setInterval(async()=>{if(i||a)return;const h=await d.getPayment(e.paymentId);if(!h)return;const m=Xu(h);m==="success"?(a=!0,e.onSuccess()):m==="failed"&&(a=!0,e.onError(h.paymentAttempt?.failure_details?.message||eh(h)))},Fy);return()=>{c(),window.clearInterval(p)}}function Vy(e,t){const n=Gu(t,"raw",{ecc:"high",scale:1}),o=e.getContext("2d",{alpha:!1});if(!o)throw new Error("canvas");const r=window.devicePixelRatio||1,i=240;e.width=i*r,e.height=i*r,e.style.width=`${i}px`,e.style.height=`${i}px`,o.scale(r,r),o.fillStyle="#fff",o.fillRect(0,0,i,i);const a=Math.floor(i/n.length),s=Math.floor((i-n.length*a)/2);o.fillStyle="#111";for(let l=0;l<n.length;l++)for(let c=0;c<n[l].length;c++)n[l]?.[c]&&o.fillRect(s+c*a,s+l*a,a,a)}class Uy extends Mo{constructor(){super(...arguments),this.methods=[],this.selected=null,this.step="list",this.stopPay=null,this.loading=!1,this.loadingMethods=!1,this.payResult=null}onUnmount(){this.stopPay?.(),this.stopPay=null,super.onUnmount()}render(){if(!this.root)return;if(this.step==="pay"&&this.selected){this.drawPay(this.payResult??void 0);return}if(this.methods.length){this.drawList();return}if(this.loadingMethods)return;this.loadingMethods=!0,this.root.replaceChildren(Bn("Loading payment methods…")),new $o(this.ctx.apiKey,this.ctx.apiBase).getPaymentMethods().then(n=>{this.methods=Gr(n),this.selected=this.methods[0]??null,this.drawList()}).catch(n=>{this.root&&this.root.replaceChildren(Oe(n instanceof Error?n.message:"Could not load payment methods"))}).finally(()=>{this.loadingMethods=!1})}drawList(){if(!this.root)return;if(!this.methods.length){this.root.replaceChildren(Oe("No payment methods are available for this outlet."));return}const t=P("div",{class:"flex flex-col gap-2",role:"radiogroup"});for(const r of this.methods){const i=this.selected?.type===r.type,a=P("button",{type:"button",role:"radio","aria-checked":i?"true":"false",class:Fo("flex w-full items-start gap-3 rounded-xl border p-3 text-left transition",i?"border-blue-600 bg-blue-50":"border-zinc-200 hover:border-zinc-300")});a.append(Yr(r.type,r.name));const s=P("div",{class:"min-w-0 flex-1"});s.append(P("p",{class:"text-sm font-medium",text:r.name}));const l=cs(r.brands);l&&s.append(l),a.append(s),a.addEventListener("click",()=>{this.selected=r,this.emit("select",r),this.drawList()}),t.append(a)}const n=Zr(this.loading?"Continuing…":"Continue",{disabled:this.loading||!this.selected,onClick:()=>{this.startPay()}}),o=P("div",{class:"flex flex-col gap-4"},[P("h3",{class:"text-base font-semibold",text:"Select a payment method"}),P("p",{class:"text-sm text-zinc-500",text:`Amount due ${Ln(this.options.amount,this.options.currency)}`}),t,n]);this.showWordmark&&o.append(P("div",{class:"mt-2 flex justify-center"},[On()])),this.root.replaceChildren(o)}async startPay(){if(!this.selected||this.loading)return;this.loading=!0,this.drawList();const t=await Yd(this.ctx,this.options,this.selected);if(this.loading=!1,!t.ok){this.drawList(),this.root?.append(Oe(t.message)),this.emit("error",{message:t.message});return}this.step="pay",this.payResult=t.data,this.drawPay(t.data)}drawPay(t){if(!this.root||!this.selected)return;this.stopPay?.();const n=Zr("← Change payment method",{variant:"ghost",onClick:()=>{this.stopPay?.(),this.stopPay=null,this.payResult=null,this.step="list",this.drawList()}}),o=P("div");if(this.root.replaceChildren(n,P("h3",{class:"mt-2 text-base font-semibold",text:`Pay with ${this.selected.name}`}),P("p",{class:"mt-1 text-sm text-zinc-500",text:`Paying ${Ln(this.options.amount,this.options.currency)}`}),o),this.showWordmark&&this.root.append(P("div",{class:"mt-6 flex justify-center"},[On()])),!t){o.append(Bn("Starting payment…")),this.startPay();return}this.stopPay=Zd({host:o,ctx:this.ctx,method:this.selected,options:this.options,result:t,onSuccess:()=>this.emit("success",{paymentId:String(t.payment.id),orderId:this.options.orderId,resultCode:"Authorised",status:"success"}),onError:r=>this.emit("error",{message:r})})}}class Hy extends Mo{constructor(){super(...arguments),this.selected=null,this.methods=[],this.loadingMethods=!1}render(){if(!this.root)return;if(this.methods.length){this.drawList(this.methods);return}if(this.loadingMethods)return;this.loadingMethods=!0,this.root.replaceChildren(Bn("Loading payment methods…")),new $o(this.ctx.apiKey,this.ctx.apiBase).getPaymentMethods().then(n=>{this.methods=Gr(n),this.drawList(this.methods)}).catch(n=>{this.root&&this.root.replaceChildren(Oe(n instanceof Error?n.message:"Could not load payment methods"))}).finally(()=>{this.loadingMethods=!1})}drawList(t){if(!this.root)return;if(!t.length){this.root.replaceChildren(Oe("No payment methods are available for this outlet."));return}(!this.selected||!t.some(o=>o.type===this.selected?.type))&&(this.selected=t[0]);const n=P("div",{class:"flex flex-col gap-2",role:"radiogroup"});for(const o of t){const r=this.selected?.type===o.type,i=P("button",{type:"button",role:"radio","aria-checked":r?"true":"false",class:Fo("flex w-full items-start gap-3 rounded-xl border p-3 text-left transition",r?"border-blue-600 bg-blue-50":"border-zinc-200 hover:border-zinc-300")});i.append(Yr(o.type,o.name));const a=P("div",{class:"min-w-0 flex-1"});a.append(P("p",{class:"text-sm font-medium",text:o.name}));const s=cs(o.brands);s&&a.append(s),i.append(a),i.addEventListener("click",()=>{this.selected=o,this.emit("select",o),this.emit("change",{paymentMethod:o}),this.drawList(t)}),n.append(i)}this.root.replaceChildren(n)}}class yt extends Mo{constructor(){super(...arguments),this.stopPay=null}withForcedType(t){return this.lockedType=t,this}onUnmount(){this.stopPay?.(),this.stopPay=null,super.onUnmount()}render(){if(!this.root)return;this.stopPay?.();const t=this.options,n=this.resolveMethod(t);if(!n){this.root.replaceChildren(Oe("A paymentMethod is required for this element."));return}this.root.replaceChildren(P("div",{class:"flex flex-col gap-2"},[P("h3",{class:"text-base font-semibold",text:`Pay with ${n.name}`}),P("p",{class:"text-sm text-zinc-500",text:`Paying ${Ln(t.amount,t.currency)}`}),Bn("Starting payment…")])),Yd(this.ctx,t,n).then(o=>{if(!this.root)return;if(!o.ok){this.root.replaceChildren(Oe(o.message)),this.emit("error",{message:o.message});return}const r=P("div");this.root.replaceChildren(P("h3",{class:"text-base font-semibold",text:`Pay with ${n.name}`}),P("p",{class:"mt-1 text-sm text-zinc-500",text:`Paying ${Ln(t.amount,t.currency)}`}),r),this.showWordmark&&this.root.append(P("div",{class:"mt-6 flex justify-center"},[On()])),this.stopPay=Zd({host:r,ctx:this.ctx,method:n,options:t,result:o.data,onSuccess:()=>this.emitSuccess(o.data.payment.id,t.orderId),onError:i=>this.emit("error",{message:i})})})}resolveMethod(t){return this.lockedType?t.paymentMethod??{type:this.lockedType,name:Ky(this.lockedType)}:t.paymentMethod??null}emitSuccess(t,n){const o={paymentId:t,orderId:n,resultCode:"Authorised",status:"success"};this.emit("success",o)}}function Ky(e){return{card:"Credit Card",applepay:"Apple Pay",googlepay:"Google Pay",paynow:"PayNow",wechatpay:"WeChat Pay",alipay:"Alipay",alipaycn:"Alipay CN",alipayhk:"Alipay HK"}[e]??e}class jy extends yt{resolveMethod(t){return t.paymentMethod??{type:"card",name:"Credit Card"}}}class zy extends yt{}class qy extends yt{}class Wy extends yt{resolveMethod(t){const n=t.paymentMethod;return n||{type:"alipay",name:"Alipay"}}}class Gy extends yt{}class Yy extends yt{constructor(...t){super(...t),this.withForcedType("paynow")}}class Zy extends yt{constructor(...t){super(...t),this.withForcedType("wechatpay")}}class Qy extends yt{constructor(...t){super(...t),this.withForcedType("applepay")}}class Jy extends yt{constructor(...t){super(...t),this.withForcedType("googlepay")}}class Xy extends yt{constructor(...t){super(...t),this.withForcedType("alipaycn")}}class e4 extends yt{constructor(...t){super(...t),this.withForcedType("alipayhk")}}class t4 extends Mo{render(){if(!this.root)return;const t=this.options.status??"pending",r=P("div",{class:"flex flex-col items-center gap-2 py-8 text-center"},[P("h3",{class:`text-lg font-semibold ${t==="success"?"text-emerald-600":t==="failed"?"text-red-600":"text-zinc-600"}`,text:t==="success"?"Payment successful":t==="failed"?"Payment failed":"Payment pending"}),this.options.message?P("p",{class:"text-sm text-zinc-500",text:this.options.message}):null,this.options.paymentId?P("p",{class:"text-xs text-zinc-400",text:`Payment ${this.options.paymentId}`}):null]);this.showWordmark&&r.append(P("div",{class:"mt-4"},[On()])),this.root.replaceChildren(r)}}function n4(e,t,n){switch(e){case"checkout":return new Uy(e,t,n);case"payment-method-list":return new Hy(e,t,n);case"card":return new jy(e,t,n);case"qr":return new zy(e,t,n);case"wallet":return new qy(e,t,n);case"alipay":return new Wy(e,t,n);case"redirect":return new Gy(e,t,n);case"payment-result":return new t4(e,t,n);case"paynow":return new Yy(e,t,n);case"wechatpay":return new Zy(e,t,n);case"applepay":return new Qy(e,t,n);case"googlepay":return new Jy(e,t,n);case"alipaycn":return new Xy(e,t,n);case"alipayhk":return new e4(e,t,n);default:throw new Error(`[@finyxpay/ui] Unknown element type: "${e}"`)}}class os{constructor(t){if(this.methodsCache=null,!t.apiKey?.trim())throw new Error("[@finyxpay/ui] A public API key is required.");this.apiKey=t.apiKey.trim(),this.apiBase=jr(this.apiKey,t.apiBase),this.locale=t.locale??"en",this.appearance={showWordmark:!0,...t.appearance},this.client=new $o(this.apiKey,this.apiBase),this.client.getPaymentMethods().then(n=>{this.methodsCache=n}).catch(()=>{})}context(){return{apiKey:this.apiKey,apiBase:this.apiBase,locale:this.locale,appearance:this.appearance}}async createElement(t,n){return n4(t,n,this.context())}async getPaymentMethods(){if(this.methodsCache)return this.methodsCache;const t=await this.client.getPaymentMethods();return this.methodsCache=t,t}}let cn=null;async function Qd(e){return cn&&cn.apiKey===e.apiKey.trim()||(cn=new os(e)),cn}function o4(){if(!cn)throw new Error("[@finyxpay/ui] Call init({ apiKey }) before createElement.");return cn}async function Jd(e,t){return o4().createElement(e,t)}const r4={init:Qd,createElement:Jd,Finyx:os,resolveApiBase:jr,resolveElementType:Es};typeof window<"u"&&(window.Finyx=r4),ze.Finyx=os,ze.createElement=Jd,ze.filterPaymentMethodsByBrowserSupport=Gr,ze.init=Qd,ze.isApplePaySupported=qr,ze.isGooglePaySupported=Wr,ze.resolveApiBase=jr,ze.resolveElementType=Es,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})}));
|
|
137
|
+
`);const s=t.session?t.session?.configuration?.installmentOptions??uo.installmentOptions:a;return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&t.brand==="bcmc"||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?uo.billingAddressMode:t.billingAddressMode,brand:t.brand??g.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:s,enableStoreDetails:n,showStoreDetailsCheckbox:r,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...o&&{storedPaymentMethodId:o}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:qo.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId,holderName:this.props.holderName??""},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource},...this.state.fastlaneData&&{fastlaneData:btoa(JSON.stringify(this.state.fastlaneData))}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...a0(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}beforeRender(t){if(t?.originalAction)return;const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.oneClick&&{isStoredPaymentMethod:!0,brand:t.brand}});this.analytics.sendAnalytics(n)}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}processBinLookupResponse(t,n=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,n),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}onBinLookup(t){if(!t.isReset){const n=Ei("supportedBrandsRaw").from(t);this.props.onBinLookup?.(n)}}get storePaymentMethodPayload(){return this.props.storedPaymentMethodId?.length>0?{}:this.props.amount?.value===0?this.props.enableStoreDetails?{storePaymentMethod:!0}:{}:this.props.showStoreDetailsCheckbox&&this.state.storePaymentMethod!==void 0?{storePaymentMethod:!!this.state.storePaymentMethod}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:n}=this.props;return t?t.map(r=>({icon:n?.[r]?.icon??this.props.modules.resources.getImage()(r),name:r})):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||qo.type}get accessibleName(){return(this.props.name||qo.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return _o()}renderCardInput(t=!0){return u(pc,{setComponentRef:this.setComponentRef,...this.props,...this.state,onSubmitAnalytics:this.submitAnalytics,onChange:this.setState,onSubmit:this.submit,handleKeyDown:this.handleKeyDown,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:t,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onConfigSuccess:this.onConfigSuccess})}componentToRender(){return u(G1,{configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},t=>this.renderCardInput(t))}constructor(t,n){super(t,n),st(this,"clickToPayService",void 0),st(this,"clickToPayRef",null),st(this,"setClickToPayRef",r=>{this.clickToPayRef=r}),st(this,"onBrand",r=>{this.props.onBrand?.(r)}),st(this,"handleClickToPaySubmit",r=>{this.setState({data:{...r},valid:{},errors:{},isValid:!0}),this.submit()}),st(this,"onConfigSuccess",r=>{const o=new Te({component:this.type,type:ge.configured});this.submitAnalytics(o),this.props.onConfigSuccess?.(r)}),st(this,"onFocus",r=>{const o=new Te({component:this.type,type:ge.focus,target:Fi(r.fieldType)});this.submitAnalytics(o),_n(r.fieldType)?this.props.onFocus?.(r.event):this.props.onFocus?.(r)}),st(this,"onBlur",r=>{const o=new Te({component:this.type,type:ge.unfocus,target:Fi(r.fieldType)});this.submitAnalytics(o),_n(r.fieldType)?this.props.onBlur?.(r.event):this.props.onBlur?.(r)}),st(this,"onBinValue",Zm(this)),st(this,"payButton",r=>{const o=this.props.amount?.value===0,i=this.props.storedPaymentMethodId?.length>0;return u(ga,{...r,label:o&&!i?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})}),n&&!n._disableClickToPay&&this.props.fundingSource!=="prepaid"&&(this.clickToPayService=y1(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment,this.analytics),this.clickToPayService?.initialize())}};st(Do,"type",g.scheme),st(Do,"defaultProps",{showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0,...Ei(["type","setComponentRef"]).from(uo)});let Fc=class extends Ne{componentDidMount(){this.formEl.submit(),this.props.onFormSubmit(`${this.props.inputName} sent`)}render({name:t,action:n,target:r,inputName:o,inputValue:i}){return u("form",{ref:a=>{this.formEl=a},method:"POST",className:I(["adyen-checkout__threeds2__form",`adyen-checkout__threeds2__form--${t}`]),name:t,action:n,target:r,style:{display:"none"}},u("input",{name:o,value:i}))}constructor(...t){var n,r,o;super(...t),o=void 0,(r="formEl")in(n=this)?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o}};const ba=(e,t,n,r)=>o=>{const i={};if(o.origin!==e)return"Message was not sent from the expected domain";if(typeof o.data!="string")return"Event data from expected domain but not in expected form";if(!o.data.length)return"Event data from expected domain, in expected form, but empty";try{const a=JSON.parse(o.data);return a&&typeof a=="object"&&Y(a,"type")?a.type===r?(t(a),!0):'Event data has "type" but the object is not in the expected form':"Event data had no type"}catch{return i.type=`${r}-JSON-parse-error`,i.comment="failed to JSON parse event.data",i.extraInfo=`event.data = ${o.data}`,i.eventDataRaw=o.data,console.debug("get-process-message-handler::CATCH::Un-parseable JSON:: parseErrorObj=",i),!1}},Lc="threeDS2Fingerprint",mr="3DS2Fingerprint_Error",va="callSubmit3DS2Fingerprint_Response",Oc="threeDS2Challenge",kt="3DS2Challenge_Error",rf="threeDS2",Ao="3DS2",Dn='Missing "token" property from threeDS2 action',Bc="02",of=1e4,af=6e5,fr="timeout",sf={result:{transStatus:"U"},type:"challengeResult",errorCode:fr},lf={result:{threeDSCompInd:"N"},type:"fingerPrintResult",errorCode:fr},cf="payment *; publickey-credentials-get *",df="payment *; publickey-credentials-get *; publickey-credentials-create *",uf="allow-forms allow-same-origin allow-scripts allow-pointer-lock allow-popups",Vc={"01":["250px","400px"],"02":["390px","400px"],"03":["500px","600px"],"04":["600px","400px"],"05":["100%","100%"]},Ca=e=>{const t=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(e);if(!t)return null;const[,n,r,o,i]=t;return n&&r&&o?`${n}:${r}${o}${i?`:${i}`:""}`:null},No=e=>"success"in e&&!e.success,Uc=e=>{const t=Tn.decode(e);if(t.success&&t.data)try{return JSON.parse(t.data)}catch{return{success:!1,error:"Could not JSON parse token"}}return t},Hc=e=>{if(!e||!Object.keys(e).length)throw new Error("No (populated) data object to encode");return Tn.encode(JSON.stringify(e))},Kc=e=>{const t=e.length===1?`0${e}`:e;return Object.prototype.hasOwnProperty.call(Vc,t)?t:Bc},hf=e=>Vc[Kc(e)],pf=({token:e,size:t})=>{const n=Uc(e);if(No(n))return n;const{acsTransID:r,acsURL:o,messageVersion:i,threeDSNotificationURL:a,threeDSServerTransID:s}=n,l=Ca(a??"");return{acsURL:o??"",cReqData:{acsTransID:r??"",messageVersion:i??"",threeDSServerTransID:s??"",messageType:"CReq",challengeWindowSize:Kc(t)},iframeSizeArr:hf(t),postMessageDomain:l}},mf=({token:e,notificationURL:t})=>{const n=Uc(e);if(No(n))return n;const{threeDSMethodNotificationURL:r,threeDSMethodUrl:o,threeDSServerTransID:i}=n,a=t??r??"";return{threeDSServerTransID:i??"",threeDSMethodURL:o??"",threeDSMethodNotificationURL:a,postMessageDomain:Ca(a)}},ff=(e,t,n)=>({data:{[e]:Hc({threeDSCompInd:t.threeDSCompInd}),paymentData:n}}),yf=(e,t,n)=>({data:{details:{[e]:Hc({transStatus:t,authorisationToken:n})}}}),jc=e=>{let t=window.btoa(e).split("=")[0];return t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_"),t},gf=(e,t)=>e==="fingerprint"?{showSpinner:!t.isDropin,statusType:"loading",...t.elementRef&&{elementRef:t.elementRef}}:{statusType:"custom",i18n:t.i18n,elementRef:t.elementRef},_a=(e,t,n)=>{let r;return{promise:new Promise((o,i)=>{r=setTimeout(()=>{i(n)},e),t.then(a=>{clearTimeout(r),o(a)}).catch(a=>{clearTimeout(r),i(a)})}),cancel:()=>{clearTimeout(r)}}};function wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zc="threeDSIframe";let bf=class extends Ne{get3DS2ChallengePromise(){return new Promise((t,n)=>{this.processMessageHandler=ba(this.props.postMessageDomain,t,n,"challengeResult"),window.addEventListener("message",this.processMessageHandler)})}componentDidMount(){this.challengePromise=_a(af,this.get3DS2ChallengePromise(),sf),this.challengePromise.promise.then(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onCompleteChallenge(t)}).catch(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onErrorChallenge(t)})}componentWillUnmount(){this.challengePromise&&this.challengePromise.cancel(),window.removeEventListener("message",this.processMessageHandler)}render({acsURL:t,cReqData:n,iframeSizeArr:r,onFormSubmit:o,usePasskeyIFrameAttributes:i},{base64URLencodedData:a,status:s}){const[l,c]=r;return u("div",{className:I(["adyen-checkout__threeds2__challenge",`adyen-checkout__threeds2__challenge--${n.challengeWindowSize}`])},s!=="iframeLoaded"&&u(kn,null),u(ur,{name:zc,width:l,height:c,callback:this.iframeCallback,allow:i?df:cf,sandbox:i?uf:void 0}),u(Fc,{name:"cReqForm",action:t,target:zc,inputName:"creq",inputValue:a??"",onFormSubmit:o}))}constructor(t){super(t),wa(this,"processMessageHandler",void 0),wa(this,"challengePromise",void 0),wa(this,"iframeCallback",()=>{this.setState({status:"iframeLoaded"}),this.state.status==="init"&&this.props.onActionHandled?.({componentType:"3DS2Challenge",actionDescription:`${Ao} challenge iframe loaded`})});const n=JSON.stringify(this.props.cReqData),r=jc(n);this.state={base64URLencodedData:r,status:"init"}}};function qc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Wc extends Ne{componentDidMount(){if(No(this.state.challengeData)){const t=this.state.challengeData.error,n=t.includes(Dn)?pe.THREEDS2_ACTION_IS_MISSING_TOKEN:pe.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED;this.setError({errorInfo:`${n}: ${this.props.i18n.get("err.gen.9102")}`},!0);const r=new Re({component:this.props.type,code:n,errorType:Ie.threeDS2,message:`${kt}: ${t}`});this.props.onSubmitAnalytics(r),console.debug("### PrepareChallenge3DS2::exiting:: no challengeData")}else{const t=this.props.environment==="test"&&this.props._environmentUrls?.api?.includes("http://localhost:8080"),{acsURL:n,postMessageDomain:r}=this.state.challengeData,o=Lt(n,t),i=Lt(r,t);if(!o||!i){const c=o?pe.THREEDS2_CHALLENGE_TOKEN_IS_MISSING_THREEDSNOTIFICATIONURL:pe.THREEDS2_TOKEN_IS_MISSING_ACSURL,d=o?"threeDSNotificationURL":"acsURL";this.setError({errorInfo:`${c}: ${this.props.i18n.get("err.gen.9102")}`},!0);const p=new Re({component:this.props.type,code:c,errorType:Ie.threeDS2,message:`${kt}: Decoded token is missing a valid ${d} property`});return this.props.onSubmitAnalytics(p),void console.debug(`### PrepareChallenge3DS2::exiting:: no valid ${d}.${i?"":` postMessageDomain=${r}`}`)}const{acsTransID:a,messageVersion:s,threeDSServerTransID:l}=this.state.challengeData.cReqData;if(!a||!s||!l){this.setError({errorInfo:`${pe.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS}: ${this.props.i18n.get("err.gen.9102")}`},!0);const c=new Re({component:this.props.type,code:pe.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS,errorType:Ie.threeDS2,message:`${kt}: Decoded token is missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)`});return this.props.onSubmitAnalytics(c),void console.debug("### PrepareChallenge3DS2::exiting:: missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)")}this.setState({status:"performingChallenge"})}}setStatusComplete(t,n=null){this.setState({status:"complete"},()=>{const r=yf(this.props.dataKey,t.transStatus,this.props.paymentData);let o;n&&console.debug("### PrepareChallenge3DS2::errorCodeObject::",n);const i=n||t;if(i.errorCode){const s={code:i.errorCode==="timeout"?pe.THREEDS2_TIMEOUT:pe.THREEDS2_NO_TRANSSTATUS,errorType:Ie.threeDS2};o=new Re({component:this.props.type,message:i.message,...s}),this.props.onSubmitAnalytics(o)}let a;switch(t?.transStatus){case"Y":a="success";break;case"N":a="failed";break;case"U":a=n?"timeout":"cancelled"}t?.errorCode&&(a="noTransStatus"),o=new Ze({component:this.props.type,type:it.threeDS2,subType:St.challengeCompleted,message:`${Ao} challenge has completed`,result:a}),this.props.onSubmitAnalytics(o),this.props.onComplete(r)})}setError(t,n){this.setState({status:"error",errorInfo:t.errorInfo}),n&&this.props.onError(new M(ro,t.errorInfo,{cause:t.errorObj}))}render(t,{challengeData:n}){const r=n,o=Pe();return this.state.status==="performingChallenge"?u(bf,{onCompleteChallenge:i=>{let a=null;if(Y(i.result,"errorCode")&&i.result.errorCode.length&&(a={errorCode:i.result.errorCode,message:`${kt}: ${i.result.errorDescription?i.result.errorDescription:"no transStatus could be retrieved"}`},this.props.isMDFlow&&this.props.onError(new M(ro,`${kt}: ${i.result.errorDescription?i.result.errorDescription:"no transStatus could be retrieved"}`,{cause:i.result.errorCode}))),!i.result){this.setError({errorInfo:`${kt}: ${this.props.i18n.get("3ds.chal.805",{values:{result:'"result"'}})}`,errorObj:i},!0);const s=new Re({component:this.props.type,code:pe.THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP,errorType:Ie.threeDS2,message:`${kt}: challenge resolved without a "result" object`});return this.props.onSubmitAnalytics(s),void console.debug('### PrepareChallenge3DS2::exiting:: challenge resolved without a "result" object')}this.setStatusComplete(i.result,a)},onErrorChallenge:i=>{if(Y(i,"errorCode")){const a={errorCode:i.errorCode,message:`${Oc}: ${i.errorCode}`};return this.props.isMDFlow&&this.props.onError(new M(ro,`${kt}: '3DS2 challenge timed out'`,{cause:i.errorCode})),void this.setStatusComplete(i.result,a)}},...r,onActionHandled:this.props.onActionHandled,onFormSubmit:this.onFormSubmit,usePasskeyIFrameAttributes:this.props.usePasskeyIFrameAttributes}):this.state.status==="error"?u("div",{className:"adyen-checkout__threeds2-challenge-error"},u(fe,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--error",src:o({imageFolder:"components/"})("error"),alt:""}),u("div",{className:"adyen-checkout__status__text"},this.state.errorInfo?this.state.errorInfo:this.props.i18n.get("error.message.unknown"))):null}constructor(t){if(super(t),qc(this,"onFormSubmit",n=>{const r=new Ze({component:this.props.type,type:it.threeDS2,subType:St.challengeDataSentWeb,message:n});this.props.onSubmitAnalytics(r)}),this.props.token){const n=pf({token:this.props.token,size:this.props.challengeWindowSize||this.props.size});this.state={status:"init",challengeData:n}}else this.state={challengeData:{success:!1,error:Dn}},console.debug(`${kt}: ${Dn}`)}}qc(Wc,"defaultProps",{onComplete:()=>{},onError:()=>{},isMDFlow:!1});function Sa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ka=class extends Dt{beforeRender(){}onComplete(t){this.props.isMDFlow?this.props.on3DS2RedirectFlowComplete?.(t,this.elementRef):super.onComplete(t),this.unmount()}componentToRender(){if(!Tt(this.props.paymentData)){const t=Y(this.props,"isMDFlow")?"paymentData":"authorisationToken";this.props.onError(new M(Mi,`No ${t} received. 3DS2 Challenge cannot proceed`));const n=new Re({component:this.type,code:pe.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA,errorType:Ie.threeDS2,message:`${kt}: Missing 'paymentData' property from threeDS2 action`});return this.submitAnalytics(n),null}return u(Wc,{...this.props,onComplete:this.onComplete,onSubmitAnalytics:this.submitAnalytics,onActionHandled:this.onActionHandled})}constructor(...t){super(...t),Sa(this,"onActionHandled",n=>{const r=new Ze({component:this.type,type:it.threeDS2,subType:St.challengeIframeLoaded,message:n.actionDescription});this.submitAnalytics(r),super.onActionHandled(n)})}};Sa(ka,"type",g.threeDS2Challenge),Sa(ka,"defaultProps",{dataKey:"threeDSResult",size:Bc,type:Oc});function Ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gc="threeDSMethodIframe";let Yc=class extends Ne{get3DS2MethodPromise(){return new Promise((t,n)=>{this.processMessageHandler=ba(this.props.postMessageDomain,t,n,"fingerPrintResult"),window.addEventListener("message",this.processMessageHandler)})}componentDidMount(){this.fingerPrintPromise=_a(of,this.get3DS2MethodPromise(),lf),this.fingerPrintPromise.promise.then(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onCompleteFingerprint(t)}).catch(t=>{window.removeEventListener("message",this.processMessageHandler),this.props.onErrorFingerprint(t)})}componentWillUnmount(){this.fingerPrintPromise&&this.fingerPrintPromise.cancel(),window.removeEventListener("message",this.processMessageHandler)}render({threeDSMethodURL:t,onActionHandled:n,onFormSubmit:r},{base64URLencodedData:o}){return u("div",{className:"adyen-checkout__3ds2-device-fingerprint"},this.props.showSpinner&&u(kn,null),u("div",{style:{display:"none"}},u(ur,{name:Gc,callback:()=>{n?.({componentType:"3DS2Fingerprint",actionDescription:`${Ao} fingerprint iframe loaded`})}}),u(Fc,{name:"threeDSMethodForm",action:t,target:Gc,inputName:"threeDSMethodData",inputValue:o,onFormSubmit:r})))}constructor(t){super(t),Ea(this,"processMessageHandler",void 0),Ea(this,"fingerPrintPromise",void 0);const{threeDSServerTransID:n,threeDSMethodNotificationURL:r}=this.props,o=JSON.stringify({threeDSServerTransID:n,threeDSMethodNotificationURL:r}),i=jc(o);this.state={base64URLencodedData:i}}};Ea(Yc,"defaultProps",{showSpinner:!0});function xa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Pa extends Ne{componentDidMount(){if(No(this.state.fingerPrintData)){const t=this.state.fingerPrintData.error,n=t.includes(Dn)?pe.THREEDS2_ACTION_IS_MISSING_TOKEN:pe.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED;this.setStatusComplete({threeDSCompInd:"N"},{errorCode:n,message:`${mr}: ${t}`}),console.debug("### PrepareFingerprint3DS2:: token does not exist or could not be base64 decoded &/or JSON.parsed")}else{const t=this.props.environment==="test"&&this.props._environmentUrls?.api?.includes("http://localhost:8080"),{threeDSMethodURL:n,threeDSMethodNotificationURL:r,postMessageDomain:o,threeDSServerTransID:i}=this.state.fingerPrintData;if(!Lt(n,t))return this.setStatusComplete({threeDSCompInd:"U"},{errorCode:pe.THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL,message:`${mr}: Decoded token is missing a valid threeDSMethodURL property`}),void console.debug("### PrepareFingerprint3DS2::exiting:: no valid threeDSMethodURL");const a=Lt(r,t),s=Lt(o,t),l=i?.length;if(!a||!s||!l)return this.setStatusComplete({threeDSCompInd:"N"},{errorCode:pe.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS,message:`${mr}: Decoded token is missing one or more of the following properties (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)`}),void console.debug("### PrepareFingerprint3DS2::exiting:: Decoded token is missing one or more of the following properties (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)");this.setState({status:"retrievingFingerPrint"})}}setStatusComplete(t,n=null){this.setState({status:"complete"},()=>{const r=ff(this.props.dataKey,t,this.props.paymentData);let o;const i=n||t;if(i.errorCode){const s={code:i.errorCode===fr?pe.THREEDS2_TIMEOUT:i.errorCode,errorType:Ie.threeDS2};o=new Re({component:this.props.type,message:i.message,...s}),this.props.onSubmitAnalytics(o)}let a;switch(t?.threeDSCompInd){case"Y":a="success";break;case"N":a=n?n.errorCode===fr?fr:"failedInternal":"failed";break;case"U":a="noThreeDSMethodURL"}o=new Ze({component:this.props.type,type:it.threeDS2,subType:St.fingerprintCompleted,message:`${Ao} fingerprinting has completed`,result:a}),this.props.onSubmitAnalytics(o),this.props.onComplete(r)})}render({showSpinner:t},{status:n,fingerPrintData:r}){return n==="retrievingFingerPrint"?u(Yc,{onCompleteFingerprint:o=>{this.setStatusComplete(o.result)},onErrorFingerprint:o=>{const i={errorCode:o.errorCode,message:`${Lc}: ${o.errorCode}`};this.setStatusComplete(o.result,i)},showSpinner:t,...r,onActionHandled:this.props.onActionHandled,onFormSubmit:this.onFormSubmit}):null}constructor(t){super(t),xa(this,"onFormSubmit",o=>{const i=new Ze({component:this.props.type,type:it.threeDS2,subType:St.fingerprintDataSentWeb,message:o});this.props.onSubmitAnalytics(i)});const{token:n,notificationURL:r}=this.props;if(n){const o=mf({token:n,notificationURL:r});this.state={status:"init",fingerPrintData:o}}else this.state={fingerPrintData:{success:!1,error:Dn}},console.debug(`${mr}: ${Dn}`)}}xa(Pa,"type","scheme"),xa(Pa,"defaultProps",{onComplete:()=>{},onError:()=>{},paymentData:"",showSpinner:!0,isMDFlow:!1});const Bt="v1",An={makePayments:"620",submitPaymentDetails:"621",submitThreeDS2Fingerprint:"622",createOrder:"624",donationCampaigns:"627",donations:"628"};function vf({data:e}){Ve({path:`v1/submitThreeDS2Fingerprint?token=${this.props.clientKey}`,loadingContext:this.props.loadingContext,errorLevel:"fatal",errorCode:An.submitThreeDS2Fingerprint},{...e}).then(t=>{let n;if(t.type==="completed"){const{details:o}=t;return t.details?this.onComplete({data:{details:o}}):(console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no details object in a response indicating either a "frictionless" flow, or a "refused" response. resData=',t),n=new Re({component:"threeDS2Fingerprint",code:pe.THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED,errorType:Ie.threeDS2,message:`${va}: no details object in a response indicating either a "frictionless" flow, or a "refused" response`}),void this.submitAnalytics(n))}if(!t.action)return console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no action object in a response indicating a "challenge". resData=',t),n=new Re({component:"threeDS2Fingerprint",code:pe.THREEDS2_NO_ACTION_FOR_CHALLENGE,errorType:Ie.threeDS2,message:`${va}: no action object in a response indicating a "challenge" flow`}),void this.submitAnalytics(n);const r=this.props.elementRef??this;return r?t.action?.type==="threeDS2"?r.handleAction(t.action,ki("challengeWindowSize","usePasskeyIFrameAttributes").from(this.props)):t.action?.type==="redirect"?r.handleAction(t.action):void 0:(console.debug("Handled Error::callSubmit3DS2Fingerprint::FAILED:: no actionHandler"),n=new Re({component:"threeDS2Fingerprint",code:pe.THREEDS2_NO_COMPONENT_FOR_ACTION,errorType:Ie.threeDS2,message:`${va}: no component defined to handle the action response`}),void this.submitAnalytics(n))}).catch(t=>{this.handleError(t)})}function Io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ta=class extends Dt{beforeRender(){}onComplete(t){this.props.isMDFlow?this.props.on3DS2RedirectFlowComplete?.(t,this.elementRef):super.onComplete(t),this.unmount()}componentToRender(){if(!Tt(this.props.paymentData)){this.props.onError(new M(Mi,"No paymentData received. 3DS2 Fingerprint cannot proceed"));const t=new Re({component:this.type,code:pe.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA,errorType:Ie.threeDS2,message:`${mr}: Missing 'paymentData' property from threeDS2 action`});return this.submitAnalytics(t),null}return u(Pa,{...this.props,onComplete:this.props.isMDFlow?this.onComplete:this.callSubmit3DS2Fingerprint,onSubmitAnalytics:this.submitAnalytics,onActionHandled:this.onActionHandled})}constructor(...t){super(...t),Io(this,"callSubmit3DS2Fingerprint",vf.bind(this)),Io(this,"onActionHandled",n=>{const r=new Ze({component:this.type,type:it.threeDS2,subType:St.fingerprintIframeLoaded,message:n.actionDescription});this.submitAnalytics(r),super.onActionHandled(n)})}};Io(Ta,"type",g.threeDS2Fingerprint),Io(Ta,"defaultProps",{dataKey:"fingerprintResult",type:Lc});function Cf({label:e=null,icon:t=null,payButton:n,onSubmit:r,name:o,showPayButton:i,...a}){const{i18n:s}=O(),[l,c]=w("ready"),{amount:d}=sr();if(this.setStatus=p=>{c(p)},i)return u(G,null,n({...a,status:l,icon:t,classNameModifiers:["standalone"],label:e||(d&&{}.hasOwnProperty.call(d,"value")&&d.value===0?`${s.get("preauthorizeWith")} ${o}`:`${s.get("continueTo")} ${o}`),onClick:r}))}const _f=({buttonStyle:e,buttonType:t,buttonLocale:n,onClick:r})=>u("apple-pay-button",{"data-testid":"apple-pay-button",buttonstyle:e,type:t,locale:n,onclick:r});function Zc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let wf=class{begin(){return this.session.begin()}onvalidatemerchant(t,n){return new Promise((r,o)=>{n(r,o,t.validationURL)}).then(r=>{this.session.completeMerchantValidation(r)}).catch(r=>{console.error(r),this.session.abort(),this.options.onError(r)})}onpaymentauthorized(t,n){return new Promise((r,o)=>n(r,o,t)).then(r=>{this.session.completePayment(r)}).catch(r=>{this.session.completePayment(r)})}onpaymentmethodselected(t,n){return new Promise((r,o)=>n(r,o,t)).then(r=>{this.session.completePaymentMethodSelection(r)}).catch(r=>{this.session.completePaymentMethodSelection(r)})}onshippingcontactselected(t,n){return new Promise((r,o)=>n(r,o,t)).then(r=>{this.session.completeShippingContactSelection(r)}).catch(r=>{this.session.completeShippingContactSelection(r)})}onshippingmethodselected(t,n){return new Promise((r,o)=>n(r,o,t)).then(r=>{this.session.completeShippingMethodSelection(r)}).catch(r=>{this.session.completeShippingMethodSelection(r)})}oncouponcodechanged(t,n){return new Promise((r,o)=>n(r,o,t)).then(r=>{this.session.completeCouponCodeChange(r)}).catch(r=>{this.session.completeCouponCodeChange(r)})}oncancel(t,n){n(t)}constructor(t,n){Zc(this,"session",void 0),Zc(this,"options",void 0),this.options=n,this.session=new ApplePaySession(n.version,t),this.session.onvalidatemerchant=r=>{this.onvalidatemerchant(r,n.onValidateMerchant)},this.session.onpaymentauthorized=r=>{this.onpaymentauthorized(r,n.onPaymentAuthorized)},this.session.oncancel=r=>{this.oncancel(r,n.onCancel)},typeof n.onPaymentMethodSelected=="function"&&(this.session.onpaymentmethodselected=r=>{this.onpaymentmethodselected(r,n.onPaymentMethodSelected)}),typeof n.onShippingContactSelected=="function"&&(this.session.onshippingcontactselected=r=>{this.onshippingcontactselected(r,n.onShippingContactSelected)}),typeof n.onShippingMethodSelected=="function"&&(this.session.onshippingmethodselected=r=>{this.onshippingmethodselected(r,n.onShippingMethodSelected)}),typeof n.onCouponCodeChanged=="function"&&(this.session.oncouponcodechanged=r=>{this.oncouponcodechanged(r,n.onCouponCodeChanged)})}};const Sf={isExpress:!1,amount:{currency:"USD",value:0},totalPriceStatus:"final",initiative:"web",merchantCapabilities:["supports3DS"],supportedNetworks:["amex","discover","masterCard","visa"],buttonType:"plain",buttonColor:"black",onClick:e=>e()},kf=e=>{const{countryCode:t,companyName:n,amount:r,...o}=e,i=(a=>String(fa(a.value,a.currency)))(r);return t||console.warn("Apple Pay - Make sure to set the countryCode in the AdyenCheckout configuration or in the Checkout Session creation"),{countryCode:t,currencyCode:r.currency,total:{label:o.totalPriceLabel,amount:i,type:o.totalPriceStatus},lineItems:o.lineItems,shippingContactEditingMode:o.shippingContactEditingMode,shippingMethods:o.shippingMethods,shippingType:o.shippingType,recurringPaymentRequest:o.recurringPaymentRequest,merchantCapabilities:o.merchantCapabilities,supportedCountries:o.supportedCountries,supportedNetworks:o.supportedNetworks,requiredShippingContactFields:o.requiredShippingContactFields,requiredBillingContactFields:o.requiredBillingContactFields,billingContact:o.billingContact,shippingContact:o.shippingContact,applicationData:o.applicationData,couponCode:o.couponCode,supportsCouponCode:o.supportsCouponCode}};function Ef(e){try{for(let t=e;t>0;t--)if(typeof ApplePaySession?.supportsVersion=="function"&&ApplePaySession.supportsVersion(t))return t}catch(t){console.warn(t)}return null}function Qc(e,t){if(e)return{city:e.locality,country:e.countryCode,houseNumberOrName:"ZZ",postalCode:e.postalCode,street:e.addressLines?.join(" ").trim(),...e.administrativeArea&&{stateOrProvince:e.administrativeArea},...t&&{firstName:e.givenName,lastName:e.familyName}}}function xf(e){const t={mc:"masterCard",amex:"amex",visa:"visa",elodebit:"elo",elo:"elo",interac:"interac",discover:"discover",jcb:"jcb",electron:"electron",maestro:"maestro",girocard:"girocard",cartebancaire:"cartesBancaires",eftpos_australia:"eftpos"};return e.reduce((n,r)=>(t[r]&&!n.includes(t[r])&&n.push(t[r]),n),[])}function Jc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pf="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js";let Tf=class{async load(){try{const t=new cr({src:Pf,component:"applepay",attributes:{crossOrigin:"anonymous"},analytics:this.analytics});return this.sdkLoadingPromise=t.load(),await this.sdkLoadingPromise,window?.ApplePaySession}catch(t){throw new M("SCRIPT_ERROR","ApplePaySDK failed to load",{cause:t})}}isSdkLoaded(){return this.sdkLoadingPromise===void 0?Promise.reject():this.sdkLoadingPromise}constructor({analytics:t}){Jc(this,"sdkLoadingPromise",void 0),Jc(this,"analytics",void 0),this.analytics=t}};const Df=()=>{if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}};function yr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Nn extends Dt{formatProps(t){const n=t.brands?.length?xf(t.brands):t.supportedNetworks;return{...t,configuration:t.configuration,supportedNetworks:n,buttonLocale:t.buttonLocale??t.i18n?.locale,totalPriceLabel:t.totalPriceLabel||t.configuration?.merchantName,renderApplePayCodeAs:t.renderApplePayCodeAs??(Df()?"window":"modal")}}formatData(){const{applePayToken:t,billingAddress:n,deliveryAddress:r}=this.state,{isExpress:o}=this.props;return{paymentMethod:{type:Nn.type,applePayToken:t,...o&&{subtype:"express"}},...n&&{billingAddress:n},...r&&{deliveryAddress:r}}}beforeRender(t){const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.isExpress&&{isExpress:t.isExpress},...t?.expressPage&&{expressPage:t.expressPage}});this.analytics.sendAnalytics(n)}get isValid(){return!0}async applePayCapabilities(t){const n=t||this.props.configuration.merchantId;try{return await this.sdkLoader.isSdkLoaded(),await ApplePaySession?.applePayCapabilities(n)}catch(r){throw new M("ERROR","Apple Pay: Error when requesting applePayCapabilities()",{cause:r})}}async isAvailable(){if(window.location.protocol!=="https:")return Promise.reject(new M("IMPLEMENTATION_ERROR","Trying to start an Apple Pay session from an insecure document"));try{return await this.sdkLoader.isSdkLoaded(),ApplePaySession?.canMakePayments()?Promise.resolve():Promise.reject(new M("ERROR","Apple Pay is not available on this device"))}catch(t){return Promise.reject(new M("ERROR","Apple Pay SDK failed to load",{cause:t}))}}defineApplePayVersionNumber(){window.location.protocol==="https:"&&(this.applePayVersionNumber=this.props.version||Ef(14))}configureApplePayWebOptions(){if(window.ApplePayWebOptions){const{renderApplePayCodeAs:t,onApplePayCodeClose:n}=this.props;window.ApplePayWebOptions.set({renderApplePayCodeAs:t,...n&&{onApplePayCodeClose:n}})}}startSession(){const{onValidateMerchant:t,onPaymentMethodSelected:n,onShippingMethodSelected:r,onShippingContactSelected:o,onCouponCodeChanged:i}=this.props,a=kf({companyName:this.props.configuration.merchantName,countryCode:this.core.options.countryCode,...this.props}),s=new wf(a,{version:this.applePayVersionNumber,onError:l=>{this.handleError(new M("ERROR","ApplePay - Something went wrong on ApplePayService",{cause:l}))},onCancel:l=>{this.handleError(new M("CANCEL","ApplePay UI dismissed",{cause:l}))},onPaymentMethodSelected:n,onShippingMethodSelected:r,onShippingContactSelected:o,onCouponCodeChanged:i,onValidateMerchant:t||this.validateMerchant,onPaymentAuthorized:(l,c,d)=>{const p=Qc(d.payment.billingContact),h=Qc(d.payment.shippingContact,!0);this.setState({applePayToken:btoa(JSON.stringify(d.payment.token.paymentData)),authorizedEvent:d,...p&&{billingAddress:p},...h&&{deliveryAddress:h}}),this.handleAuthorization().then(this.makePaymentsCall).then(hr).then(pr).then(this.collectOrderTrackingDetailsIfNeeded).then(({paymentResponse:m,orderDetails:f})=>(l({status:ApplePaySession.STATUS_SUCCESS,...f&&{orderDetails:f}}),m)).then(m=>{this.handleResponse(m)}).catch(m=>{const f=m?.error?.applePayError;c({status:ApplePaySession.STATUS_FAILURE,errors:f?Array.isArray(f)?f:[f]:void 0});const y={...m,error:{applePayError:f}};this.handleFailedResult(y)})}});return new Promise((l,c)=>this.props.onClick(l,c)).then(()=>{s.begin()}).catch(()=>({}))}async handleAuthorization(){return new Promise((t,n)=>{this.props.onAuthorized||t();const{authorizedEvent:r,billingAddress:o,deliveryAddress:i}=this.state;this.props.onAuthorized({authorizedEvent:r,...o&&{billingAddress:o},...i&&{deliveryAddress:i}},{resolve:t,reject:n})}).catch(t=>{const n={error:{applePayError:t}};return Promise.reject(n)})}async collectOrderTrackingDetailsIfNeeded(t){return new Promise((n,r)=>{if(!this.props.onOrderTrackingRequest)return n();this.props.onOrderTrackingRequest(n,r)}).then(n=>({paymentResponse:t,...n&&{orderDetails:n}})).catch(()=>({paymentResponse:t}))}async validateMerchant(t,n){const{hostname:r}=window.location,{clientKey:o,configuration:i,loadingContext:a,initiative:s,domainName:l}=this.props,{merchantName:c,merchantId:d}=i,p={loadingContext:a,path:`v1/applePay/sessions?clientKey=${o}`},h={displayName:c,domainName:l||r,initiative:s,merchantIdentifier:d};try{const m=await Ve(p,h),f=Tn.decode(m.data);f.success?t(JSON.parse(f.data)):n("Could not decode Apple Pay session")}catch{n("Could not get Apple Pay session")}}componentToRender(){return this.props.showPayButton?u(_f,{buttonStyle:this.props.buttonColor,buttonType:this.props.buttonType,buttonLocale:this.props.buttonLocale,onClick:this.submit}):null}constructor(t,n){super(t,n),yr(this,"sdkLoader",void 0),yr(this,"applePayVersionNumber",void 0),yr(this,"submit",()=>{if(this.props.isInstantPayment){const a=new Te({component:this.type,type:ge.selected,target:xn.instantPaymentButton});this.submitAnalytics(a)}this.startSession()});const{isExpress:r,onShippingContactSelected:o,onShippingMethodSelected:i}=this.props;if(r===!1&&(o||i))throw new M("IMPLEMENTATION_ERROR",'ApplePay - You must set "isExpress" flag to "true" in order to use "onShippingContactSelected" and/or "onShippingMethodSelected" callbacks');this.startSession=this.startSession.bind(this),this.submit=this.submit.bind(this),this.validateMerchant=this.validateMerchant.bind(this),this.collectOrderTrackingDetailsIfNeeded=this.collectOrderTrackingDetailsIfNeeded.bind(this),this.handleAuthorization=this.handleAuthorization.bind(this),this.defineApplePayVersionNumber=this.defineApplePayVersionNumber.bind(this),this.configureApplePayWebOptions=this.configureApplePayWebOptions.bind(this),this.sdkLoader=new Tf({analytics:this.analytics}),this.sdkLoader.load().then(this.defineApplePayVersionNumber).then(this.configureApplePayWebOptions).catch(a=>{this.handleError(a)})}}yr(Nn,"type",g.applepay),yr(Nn,"defaultProps",Sf);var In={API_VERSION:2,API_VERSION_MINOR:0,GATEWAY:"adyen",URL:"https://pay.google.com/gp/p/js/pay.js"};function Af({allowedAuthMethods:e,allowedCardNetworks:t,existingPaymentMethodRequired:n=!1}){return{apiVersion:In.API_VERSION,apiVersionMinor:In.API_VERSION_MINOR,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:e,allowedCardNetworks:t},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{}}}],existingPaymentMethodRequired:n}}function Nf({amount:e,countryCode:t="US",totalPriceStatus:n="FINAL",...r}){const o=String(fa(e.value,e.currency));return{countryCode:t,currencyCode:e.currency,totalPrice:o,totalPriceStatus:n,...r.transactionInfo}}function Xc({configuration:e,...t},n){return{apiVersion:In.API_VERSION,apiVersionMinor:In.API_VERSION_MINOR,transactionInfo:Nf({countryCode:n,...t}),merchantInfo:{merchantId:e.merchantId,merchantName:e.merchantName,...e.merchantOrigin?{merchantOrigin:e.merchantOrigin}:{},...e.authJwt?{authJwt:e.authJwt}:{}},allowedPaymentMethods:[{type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:In.GATEWAY,gatewayMerchantId:e.gatewayMerchantId}},parameters:{allowedAuthMethods:t.allowedAuthMethods,allowedCardNetworks:t.allowedCardNetworks,assuranceDetailsRequired:t.assuranceDetailsRequired,allowPrepaidCards:t.allowPrepaidCards,allowCreditCards:t.allowCreditCards,allowedIssuerCountryCodes:t.allowedIssuerCountryCodes,blockedIssuerCountryCodes:t.blockedIssuerCountryCodes,billingAddressRequired:t.billingAddressRequired,billingAddressParameters:t.billingAddressParameters}}],emailRequired:t.emailRequired,shippingAddressRequired:t.shippingAddressRequired,shippingAddressParameters:t.shippingAddressParameters,shippingOptionRequired:t.shippingOptionRequired,shippingOptionParameters:t.shippingOptionParameters,callbackIntents:t.callbackIntents}}function If(e="PRODUCTION"){switch(e){case"beta":case"test":return"TEST";default:return"PRODUCTION"}}function ed(e,t){if(e)return{postalCode:e.postalCode,country:e.countryCode,street:[e.address1,e.address2,e.address3].join(" ").trim(),houseNumberOrName:"ZZ",city:e.locality||"",...e.administrativeArea&&{stateOrProvince:e.administrativeArea},...t&&{firstName:e.name}}}const Rf=["en","ar","bg","ca","cs","da","de","el","es","et","fi","fr","hr","id","it","ja","ko","ms","nl","no","pl","pt","ru","sk","sl","sr","sv","th","tr","uk","zh"];function $f(e=""){const t=e.toLowerCase().substring(0,2);return Rf.includes(t)?t:null}function td(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Mf=class{async getGooglePaymentsClient(t){return window.google?.payments||await new cr({src:In.URL,component:"googlepay",analytics:this.analytics}).load(),new google.payments.api.PaymentsClient(t)}isReadyToPay(t){return this.paymentsClient?this.paymentsClient.then(n=>n.isReadyToPay(Af(t))):Promise.reject(new Error("Google Pay is not available"))}prefetchPaymentData(t,n){if(!this.paymentsClient)throw new Error("Google Pay is not available");const r=Xc(t,n);this.paymentsClient.then(o=>o.prefetchPaymentData(r))}initiatePayment(t,n){if(!this.paymentsClient)throw new Error("Google Pay is not available");const r=Xc(t,n);return this.paymentsClient.then(o=>o.loadPaymentData(r))}constructor(t,n,r){td(this,"analytics",void 0),td(this,"paymentsClient",void 0);const o=If(t);this.analytics=n,this.paymentsClient=this.getGooglePaymentsClient({environment:o,paymentDataCallbacks:r})}};const Ff=e=>{const t=W(void 0);return R(()=>{const{onClick:n,buttonRadius:r,buttonColor:o,buttonType:i,buttonLocale:a,buttonSizeMode:s,buttonRootNode:l,paymentsClient:c}=e;c.then(d=>d.createButton({onClick:n,buttonType:i,buttonColor:o,buttonLocale:a,buttonSizeMode:s,buttonRootNode:l,...r!==void 0&&{buttonRadius:r}})).then(d=>{t.current&&t.current.appendChild(d)})},[e.buttonColor,e.buttonType,e.buttonLocale,e.buttonSizeMode,e.buttonRootNode,e.paymentsClient]),u("div",{"data-testid":"googlepay-button-container",className:"adyen-checkout__paywithgoogle",ref:t})},Lf={isExpress:!1,existingPaymentMethodRequired:!1,buttonColor:"default",buttonType:"buy",buttonSizeMode:"fill",configuration:{gatewayMerchantId:"",merchantId:"",merchantName:""},amount:{value:0,currency:"USD"},totalPriceStatus:"FINAL",onClick:e=>e(),allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowCreditCards:!0,allowPrepaidCards:!0,billingAddressRequired:!1,billingAddressParameters:void 0,assuranceDetailsRequired:!1,emailRequired:!1,shippingAddressRequired:!1,shippingAddressParameters:void 0,shippingOptionRequired:!1,shippingOptionParameters:void 0,callbackIntents:[]},Of=Object.freeze({mc:"MASTERCARD",amex:"AMEX",visa:"VISA",elodebit:"ELO_DEBIT",elo:"ELO",interac:"INTERAC",discover:"DISCOVER",jcb:"JCB",electron:"ELECTRON",maestro:"MAESTRO"});function Bf(e){const t=e.map(n=>Of[n]).filter(n=>!!n);return[...new Set(t)]}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vf=["AMEX","DISCOVER","JCB","MASTERCARD","VISA"];class gr extends Dt{getPaymentMethodFromPaymentMethodsResponse(t,n){return n?this.core.paymentMethodsResponse.findById(n):this.core.paymentMethodsResponse.find(t||this.constructor.type)||this.core.paymentMethodsResponse.find(g.paywithgoogle)}formatProps(t){const n=t.buttonSizeMode??(t.isDropin?"fill":"static"),r=$f(t.buttonLocale??t.i18n?.locale),o=[...t.callbackIntents,"PAYMENT_AUTHORIZATION"],i=this.createAllowedCardNetworksValues({allowedCardNetworks:t.allowedCardNetworks,brands:t.brands});return{...t,allowedCardNetworks:i,configuration:t.configuration,buttonSizeMode:n,buttonLocale:r,callbackIntents:o}}formatData(){const{googlePayCardNetwork:t,googlePayToken:n,billingAddress:r,deliveryAddress:o}=this.state,{isExpress:i}=this.props;return{paymentMethod:{type:this.type,googlePayCardNetwork:t,googlePayToken:n,...i&&{subtype:"express"}},browserInfo:this.browserInfo,origin:!!window&&window.location.origin,...r&&{billingAddress:r},...o&&{deliveryAddress:o}}}createAllowedCardNetworksValues({allowedCardNetworks:t,brands:n}){return t?.length>0?t:n?.length>0?Bf(n):Vf}beforeRender(t){if(t?.originalAction)return;const n=new Te({type:ge.rendered,component:this.type,configData:{...t,showPayButton:this.props.showPayButton},...t?.isExpress&&{isExpress:t.isExpress},...t?.expressPage&&{expressPage:t.expressPage}});this.analytics.sendAnalytics(n)}showGooglePayPaymentSheet(){this.googlePay.initiatePayment(this.props,this.core.options.countryCode).catch(t=>{this.handleError(new M(t.statusCode==="CANCELED"?"CANCEL":"ERROR",t.toString(),{cause:t}))})}async handleAuthorization(){return new Promise((t,n)=>{this.props.onAuthorized||t();const{authorizedEvent:r,billingAddress:o,deliveryAddress:i}=this.state;this.props.onAuthorized({authorizedEvent:r,...o&&{billingAddress:o},...i&&{deliveryAddress:i}},{resolve:t,reject:n})}).catch(t=>{const n={error:{googlePayError:t}};return Promise.reject(n)})}get isValid(){return!0}async isAvailable(){return this.isReadyToPay().then(t=>{if(!t.result)throw new M("ERROR","GooglePay is not available");if(t.paymentMethodPresent===!1)throw new M("ERROR","GooglePay - No paymentMethodPresent");return Promise.resolve()}).catch(t=>Promise.reject(t))}get browserInfo(){return _o()}get icon(){return this.props.icon??this.resources.getImage()("googlepay")}componentToRender(){return this.props.showPayButton?u(Ff,{buttonColor:this.props.buttonColor,buttonType:this.props.buttonType,buttonSizeMode:this.props.buttonSizeMode,buttonLocale:this.props.buttonLocale,buttonRootNode:this.props.buttonRootNode,buttonRadius:this.props.buttonRadius,paymentsClient:this.googlePay.paymentsClient,onClick:this.submit}):null}constructor(t,n){super(t,n),Vt(this,"googlePay",void 0),Vt(this,"submit",()=>{if(this.props.isInstantPayment){const i=new Te({component:this.type,type:ge.selected,target:xn.instantPaymentButton});this.submitAnalytics(i)}new Promise((i,a)=>this.props.onClick(i,a)).then(this.showGooglePayPaymentSheet).catch(()=>{})}),Vt(this,"onPaymentAuthorized",async i=>{const a=ed(i.paymentMethodData.info.billingAddress),s=ed(i.shippingAddress,!0);return this.setState({authorizedEvent:i,googlePayToken:i.paymentMethodData.tokenizationData.token,googlePayCardNetwork:i.paymentMethodData.info.cardNetwork,...a&&{billingAddress:a},...s&&{deliveryAddress:s}}),new Promise(l=>{this.handleAuthorization().then(this.makePaymentsCall).then(hr).then(pr).then(c=>(l({transactionState:"SUCCESS"}),c)).then(c=>{this.handleResponse(c)}).catch(c=>{this.setElementStatus("ready");const d=c?.error?.googlePayError,p=this.props.i18n.get("error.subtitle.payment"),h=typeof d=="string"?{intent:"PAYMENT_AUTHORIZATION",reason:"OTHER_ERROR",message:d||p}:{intent:d?.intent||"PAYMENT_AUTHORIZATION",reason:d?.reason||"OTHER_ERROR",message:d?.message||p};l({transactionState:"ERROR",error:h});const m={...c,error:{googlePayError:h}};this.handleFailedResult(m)})})}),Vt(this,"isReadyToPay",()=>this.googlePay.isReadyToPay(this.props)),Vt(this,"prefetch",()=>this.googlePay.prefetchPaymentData(this.props,this.core.options.countryCode)),this.handleAuthorization=this.handleAuthorization.bind(this),this.showGooglePayPaymentSheet=this.showGooglePayPaymentSheet.bind(this);const{isExpress:r,paymentDataCallbacks:o}=this.props;if(r===!1&&o?.onPaymentDataChanged)throw new M("IMPLEMENTATION_ERROR",'GooglePay - You must set "isExpress" flag to "true" in order to use "onPaymentDataChanged" callback');if(!this.props.configuration.merchantId)throw new M("IMPLEMENTATION_ERROR","GooglePay - Missing merchantId. Please ensure that it is correctly configured in your customer area.");this.googlePay=new Mf(this.props.environment,this.analytics,{...r&&o?.onPaymentDataChanged&&{onPaymentDataChanged:o.onPaymentDataChanged},onPaymentAuthorized:this.onPaymentAuthorized})}}Vt(gr,"type",g.googlepay),Vt(gr,"txVariants",[g.googlepay,g.paywithgoogle]),Vt(gr,"defaultProps",Lf);var nd=()=>{try{if(window.parent.location.href)return window.location!==window.parent.location}catch{return!1}};function rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let od=class extends Ne{componentDidMount(){new Promise((t,n)=>{this.props.beforeRedirect(t,n,{url:this.props.url,method:this.props.method,...this.props.data?{data:this.props.data}:{}})}).then(()=>{this.props.onActionHandled?.({componentType:this.props.paymentMethodType,actionDescription:"performing-redirect"}),this.postForm?this.postForm.submit():this.props.redirectFromTopWhenInIframe&&nd()?window.top.location.assign?.(this.props.url):window.location.assign(this.props.url)}).catch(()=>{this.props.onRedirectError()})}render({url:t,method:n,data:r={}}){return n==="POST"?u("form",{method:"post","data-testid":"redirect-shopper-form",action:t,style:{display:"none"},ref:o=>{this.postForm=o},...this.props.redirectFromTopWhenInIframe&&nd()&&{target:"_top"}},Object.keys(r).map(o=>u("input",{type:"hidden",name:o,key:o,value:r[o]}))):null}constructor(...t){super(...t),rd(this,"postForm",void 0)}};rd(od,"defaultProps",{beforeRedirect:e=>e(),onRedirectError:()=>{},method:"GET"});function Da(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class br extends Dt{formatData(){return{paymentMethod:{type:this.type},browserInfo:this.browserInfo}}get isRedirecting(){return!!this.props.url&&!!this.props.method}get isValid(){return!0}get browserInfo(){return _o()}componentToRender(){return this.isRedirecting?u(od,{url:this.props.url,...this.props,onActionHandled:this.onActionHandled,onRedirectError:this.handleRedirectError}):this.props.showPayButton?u(Cf,{...this.props,showPayButton:this.props.showPayButton,name:this.displayName,onSubmit:this.submit,payButton:this.payButton,ref:t=>{this.componentRef=t}}):null}constructor(...t){super(...t),Da(this,"handleRedirectError",()=>{const n=new Re({component:this.props.paymentMethodType,errorType:Ie.redirect,code:pe.REDIRECT});super.submitAnalytics(n)})}}Da(br,"type",g.redirect),Da(br,"defaultProps",{type:br.type});const Uf={test:"https://checkoutshopper-test.adyen.com/checkoutshopper/",live:"https://checkoutshopper-live.adyen.com/checkoutshopper/","live-us":"https://checkoutshopper-live-us.adyen.com/checkoutshopper/","live-au":"https://checkoutshopper-live-au.adyen.com/checkoutshopper/","live-apse":"https://checkoutshopper-live-apse.adyen.com/checkoutshopper/","live-in":"https://checkoutshopper-live-in.adyen.com/checkoutshopper/","live-nea":"https://checkoutshopper-live-nea.adyen.com/checkoutshopper/",fallback:"https://checkoutshopper-live.adyen.com/checkoutshopper/"},id={test:"https://checkoutshopper-test.cdn.adyen.com/checkoutshopper/",live:"https://checkoutshopper-live.cdn.adyen.com/checkoutshopper/","live-us":"https://checkoutshopper-live-us.cdn.adyen.com/checkoutshopper/","live-au":"https://checkoutshopper-live-au.cdn.adyen.com/checkoutshopper/","live-apse":"https://checkoutshopper-live-apse.cdn.adyen.com/checkoutshopper/","live-in":"https://checkoutshopper-live-in.cdn.adyen.com/checkoutshopper/","live-nea":"https://checkoutshopper-live-nea.cdn.adyen.com/checkoutshopper/",fallback:"https://checkoutshopper-live.cdn.adyen.com/checkoutshopper/"},Hf={test:"https://checkoutanalytics-test.adyen.com/checkoutanalytics/",live:"https://checkoutanalytics-live.adyen.com/checkoutanalytics/","live-us":"https://checkoutanalytics-live-us.adyen.com/checkoutanalytics/","live-au":"https://checkoutanalytics-live-au.adyen.com/checkoutanalytics/","live-apse":"https://checkoutanalytics-live-apse.adyen.com/checkoutanalytics/","live-in":"https://checkoutanalytics-live-in.adyen.com/checkoutanalytics/","live-nea":"https://checkoutanalytics-live-nea.adyen.com/checkoutanalytics/",fallback:"https://checkoutanalytics-live.adyen.com/checkoutanalytics/"},Ro=(e,t,n)=>n||t[e]||t.fallback,Kf=(e,t)=>({apiUrl:Ro(e,Uf,t?.api),analyticsUrl:Ro(e,Hf,t?.analytics),cdnImagesUrl:Ro(e,id,t?.cdn?.images),cdnTranslationsUrl:Ro(e,id,t?.cdn?.translations)});function jf(e){return Object.keys(e).reduce((t,n)=>(bm.includes(n)&&(t[n]=e[n]),t),{})}function zf(e){const t=(n=>n)(["session","environment","_environmentUrls","showPayButton","clientKey","locale","translations","paymentMethodsResponse","amount","secondaryAmount","countryCode","allowPaymentMethods","removePaymentMethods","srConfig","analytics","risk","order","donation","exposeLibraryMetadata","beforeRedirect","beforeSubmit","onPaymentCompleted","onPaymentFailed","onSubmit","onAdditionalDetails","onActionHandled","onChange","onError","onBalanceCheck","onOrderRequest","onPaymentMethodsRequest","onOrderCancel","onOrderUpdated","loadingContext","onEnterKeyPressed","afterAdditionalDetails"]);Object.keys(e).forEach(n=>{t.includes(n)||console.warn(`AdyenCheckout - Configuration property "${n}" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to "paymentMethodsConfiguration" object`)})}function ad({logoUrl:e="",nonprofitName:t="",causeName:n="",bannerUrl:r=""}){return u(G,null,u(fe,{className:"adyen-checkout__campaign-background-image",style:{backgroundImage:`url(${r})`},backgroundUrl:r}),u("div",{className:"adyen-checkout__campaign-content"},e&&u("img",{src:e,className:"adyen-checkout__campaign-logo",alt:t}),u("div",null,t&&u("div",{className:"adyen-checkout__campaign-title"},t),n&&u("div",{className:"adyen-checkout__campaign-cause"},n))))}function qf({logoUrl:e="",nonprofitDescription:t="",nonprofitName:n="",causeName:r="",nonprofitUrl:o="",bannerUrl:i=""}){return u("div",{className:"adyen-checkout__campaign"},o?u("a",{href:o,className:"adyen-checkout__campaign-link",target:"_blank",rel:"noopener noreferrer"},u(ad,{logoUrl:e,nonprofitName:n,causeName:r,bannerUrl:i})):u(ad,{logoUrl:e,nonprofitName:n,causeName:r,bannerUrl:i}),t&&u("div",{className:"adyen-checkout__campaign-description"},t))}const Wf=({options:e=[],name:t,onChange:n})=>u("div",{className:"adyen-checkout__button-group"},e.map(({label:r,selected:o,value:i,disabled:a},s)=>u("label",{key:`${t}${s}`,className:I({"adyen-checkout__button":!0,"adyen-checkout__button--selected":o,"adyen-checkout__button--disabled":a})},u("input",{type:"radio",className:"adyen-checkout__button-group__input",value:i,checked:o,onChange:n,disabled:a}),u("span",{className:"adyen-checkout__button-text"},r)))),sd=(e,t)=>e-t%e,Aa=(e,{value:t,currency:n})=>e.amount(t,n),Gf=(e,{maxRoundupAmount:t,commercialTxAmount:n,currency:r})=>Aa(e,{value:sd(t,n),currency:r});function Yf(e){const{currency:t,values:n,selectedAmount:r,status:o,onAmountSelected:i,onDonateButtonClicked:a}=e,{i18n:s}=O();return u(G,null,u("div",{className:"adyen-checkout__amounts"},u(Wf,{options:n.map(l=>({value:l,label:Aa(s,{value:l,currency:t}),disabled:o==="loading",selected:l===r})),name:"amount",onChange:i})),u(Ge,{classNameModifiers:["donate"],onClick:a,label:s.get("donateButton"),disabled:r===null,status:o}))}function Zf(e){const{status:t,donationAmount:n,originalPaymentAmount:r,onDonateButtonClicked:o}=e,{i18n:i}=O();return u(G,null,u(Ge,{classNameModifiers:["donate"],onClick:o,label:`${i.get("donateButton")} ${n}`,status:t}),u("span",{className:"adyen-checkout-roundup-description"},i.get("donationRoundUpDescription",{values:{donationAmount:n,originalPaymentAmount:r}})))}function ld(e){const{donation:t,commercialTxAmount:n,onAmountSelected:r,onCancel:o,onDonate:i,showCancelButton:a=!0,termsAndConditionsUrl:s}=e,{i18n:l}=O(),c=Pe(),{currency:d,type:p}=t,h=p==="roundup",[m,f]=w("ready"),[y,b]=w(h),[v,C]=w({currency:d,value:h?sd(t.maxRoundupAmount,n):null});this.setStatus=S=>{f(S)};const _=()=>{f("loading"),i({data:{amount:v}})};return R(()=>{e.onChange({data:{amount:v},isValid:y})},[v,y]),m==="error"?u("div",{className:"adyen-checkout__adyen-giving"},u(fe,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--error",src:c({imageFolder:"components/"})("error"),alt:l.get("error.message.unknown")}),u("div",{className:"adyen-checkout__status__text"},l.get("error.message.unknown"))):m==="success"?u("div",{className:"adyen-checkout__adyen-giving"},u(fe,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--success",src:c({imageFolder:"components/"})("heart"),alt:l.get("thanksForYourSupport")}),u("div",{className:"adyen-checkout__status__text"},l.get("thanksForYourSupport"))):u("div",{className:"adyen-checkout__adyen-giving"},u(qf,e),u("div",{className:"adyen-checkout__adyen-giving-actions"},s&&u(ta,{message:l.get("donationTermsCondition"),urls:[s]}),h?u(Zf,{donationAmount:Gf(l,{maxRoundupAmount:t.maxRoundupAmount,commercialTxAmount:n,currency:d}),originalPaymentAmount:Aa(l,{value:n,currency:d}),status:m,onDonateButtonClicked:_}):u(Yf,{selectedAmount:v.value,values:t.values,currency:d,status:m,onAmountSelected:({target:S})=>{const x=parseInt(S.value,10);b(!0),C(E=>({...E,value:x})),r({data:{amount:{...v,value:x}}})},onDonateButtonClicked:_}),a&&u(Ge,{classNameModifiers:["decline"],variant:"ghost",onClick:()=>{f("ready"),o({data:{amount:v},isValid:y})},disabled:m==="loading",label:`${l.get("notNowButton")} ›`})))}ld.defaultProps={onCancel:()=>{},onChange:()=>{},onDonate:()=>{},donation:{},showCancelButton:!0};function Rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Qf=`Donation instantiation error:: You need to set donation.autoMount to false if you wish to display the Donation component in a different container.
|
|
138
|
+
The Donation component will be displayed in the default container.`;let cd=class gu{async initialise(){const[t]=await Promise.all([this.callSessionsDonationCampaigns(),new Promise(n=>setTimeout(n,this.delayMS))]);return t}async callSessionsDonationCampaigns(){const t=new Ze({component:gu.type,type:it.apiRequest,subType:St.donationCampaigns,message:"Sessions flow: calling donationCampaigns endpoint"});this.core.modules.analytics.sendAnalytics(t);const n=await this.makeSessionsDonationCampaignsCall(),[r]=n?.donationCampaigns||[];return r?this.handleDonationCampaign(r):null}handleDonationCampaign(t){const{id:n,campaignName:r,...o}=t,i=o.donation.type,a={...o,onCancel:s=>{this.onDonationCompleted?.({didDonate:!1})},onDonate:(s,l)=>{const c={amount:s.data.amount,donationCampaignId:n,donationType:i};this.callSessionsDonations(c,l)},commercialTxAmount:this.commercialTxAmount};if(i==="roundup"&&!this.commercialTxAmount)throw new Error(`The donation type is "roundup" and the commercialTxAmount is not set.
|
|
139
|
+
It will not be possible to mount a Donation component.`);return a}async callSessionsDonations(t,n){try{const r=await this.makeSessionDonationsCall(t);r.resultCode==="Authorised"?(n.setStatus("success"),this.onDonationCompleted?.({didDonate:!0})):(n.setStatus("error"),this.onDonationFailed?.(r.resultCode))}catch(r){n.setStatus("error"),this.onDonationFailed?.(r)}}async makeSessionsDonationCampaignsCall(){if(!this.core.session)throw new Error("DonationCampaignService requires a session to be configured");return await this.core.session.fetchDonationCampaigns()}async makeSessionDonationsCall(t){if(!this.core.session)throw new Error("DonationCampaignService requires a session to be configured");return await this.core.session.makeDonation(t)}constructor(t,n){Rn(this,"core",void 0),Rn(this,"commercialTxAmount",0),Rn(this,"onDonationCompleted",void 0),Rn(this,"onDonationFailed",void 0),Rn(this,"delayMS",void 0),this.core=t,this.onDonationCompleted=t.options.donation?.onDonationSuccess,this.onDonationFailed=t.options.donation?.onDonationFailure,this.commercialTxAmount=n.commercialTxAmount,this.delayMS=t.options.donation?.delay??3e3}};Rn(cd,"type","donationCampaignService");function Na(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ia=class Mr extends Dt{static isServiceMode(t){return"rootNode"in t&&!!t.rootNode}async initialiseServiceMode(t,n){if(t.session)if(t.session.sessionsDonationInitiated)console.error(Qf);else{t.session.sessionsDonationInitiated=!0;try{const r=await new cd(t,n).initialise();r&&(this.props={...this.props,...r},this.mount(n.rootNode))}catch(r){t.options.donation?.onDonationFailure?.(r)}}}get data(){return this.state.data}get isValid(){return this.state.isValid}setState(t){this.state={...this.state,...t}}donate(){const t=new Ze({component:Mr.type,type:it.submit,subType:St.donation,message:"Making donation"});this.core.modules.analytics.sendAnalytics(t);const{data:n,isValid:r}=this;this.props.onDonate({data:n,isValid:r},this)}cancel(){const t=new Ze({component:Mr.type,type:it.closed,subType:St.donation,message:"Opting to not make donation"});this.core.modules.analytics.sendAnalytics(t);const{data:n,isValid:r}=this;this.isInServiceMode&&this.unmount(),this.props.onCancel({data:n,isValid:r})}amountSelected(t){const n=new Te({component:Mr.type,type:ge.selected,selectedValue:JSON.stringify(t.data.amount),target:xn.donationAmountButton});this.core.modules.analytics.sendAnalytics(n)}componentToRender(){return u(ld,{...this.props,ref:t=>{this.componentRef=t},onChange:this.setState,onDonate:this.donate,onCancel:this.cancel,onAmountSelected:this.amountSelected})}constructor(t,n){const r=Mr.isServiceMode(n);super(t,r?void 0:n),Na(this,"isInServiceMode",!1),this.donate=this.donate.bind(this),this.cancel=this.cancel.bind(this),this.amountSelected=this.amountSelected.bind(this),this.isInServiceMode=r,t.session&&r&&this.initialiseServiceMode(t,n)}};Na(Ia,"type",g.donation),Na(Ia,"defaultProps",{onCancel:()=>{},onDonate:()=>{}});function $o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Jf=class{get length(){return Object.keys(this.storage).length}key(t){return Object.keys(this.storage)[t]??null}getItem(t){return this.storage[t]||null}setItem(t,n){this.storage[t]=n}removeItem(t){delete this.storage[t]}clear(){this.storage={}}constructor(){$o(this,"storage",void 0),this.storage={}}},dd=class{get(){try{const t=this.storage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}set(t){this.storage.setItem(this.key,JSON.stringify(t))}remove(){this.storage.removeItem(this.key)}clear(){this.storage.clear()}keyByIndex(t){return this.storage.key(t)}get length(){return this.storage.length}constructor(t,n){$o(this,"prefix","adyen-checkout__"),$o(this,"key",void 0),$o(this,"storage",void 0);try{if(this.storage=n?window[n]:window.localStorage,!this.storage)throw new Error("storage does not exist")}catch{this.storage=new Jf}this.key=this.prefix+t}};function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xf=km;let ey=class{get checkoutAttemptId(){return this._checkoutAttemptId}set checkoutAttemptId(t){this._checkoutAttemptId=t}async setUp({sessionId:t,checkoutStage:n,locale:r}={}){try{const o=this.storage.get(),i=(function(d){if(!d?.timestamp)return!1;const p=Date.now()-9e5;return d.timestamp>p})(o),{applicationInfo:a,checkoutAttemptId:s}=Wm(this.analyticsData)??{},l=i?o?.id:s,c={version:aa,buildType:ec,channel:sa.WEB,platform:la,locale:r,referrer:window.location.href,screenWidth:window.screen.width,checkoutStage:n||"checkout",level:this.enabled?"all":"initial",...a&&{applicationInfo:a},...t&&{sessionId:t},...l&&{checkoutAttemptId:l}};this.checkoutAttemptId=await this.service.requestCheckoutAttemptId(c),this.dispatchPendingAnalytics(),this.storage.set({id:this.checkoutAttemptId,timestamp:i?o.timestamp:Date.now()})}catch(o){this.enabled=!1,console.warn("Analytics: Error setting up",o)}}sendAnalytics(t){if(this.enabled)try{this.addEventToQueue(t)}catch(n){console.warn("Analytics: Error adding event to queue",n)}}async sendFlavor(t){this.isFlavorReported||(this.checkoutAttemptId?await this.dispatchFlavor(t):this.pendingFlavor||(this.pendingFlavor=t))}async dispatchFlavor(t){if(!this.isFlavorReported&&this.checkoutAttemptId){this.isFlavorReported=!0;try{await this.service.reportIntegrationFlavor(t,this.checkoutAttemptId)}catch(n){console.warn("Analytics: Error reporting flavor",n)}}}flush(){this.sendEvents()}addEventToQueue(t){this.eventsQueue.add(t),t.getEventCategory()===Qt.info?this.debouncedSendInfoEvents():this.debouncedSendEvents()}async sendEvents(){if(!this.checkoutAttemptId||!this.enabled||!this.eventsQueue.hasEvents)return;const t={channel:sa.WEB,platform:la,info:this.eventsQueue.infoEvents,errors:this.eventsQueue.errorEvents,logs:this.eventsQueue.logEvents};this.eventsQueue.clear();try{await this.service.sendEvents(t,this.checkoutAttemptId)}catch(n){console.warn("Analytics: Error sending events",n)}}dispatchPendingAnalytics(){if(!this.isFlavorReported&&this.pendingFlavor){const t=this.pendingFlavor;this.pendingFlavor=void 0,this.dispatchFlavor(t)}this.sendEvents()}constructor({service:t,eventQueue:n,enabled:r,analyticsData:o}){Et(this,"analyticsData",void 0),Et(this,"service",void 0),Et(this,"eventsQueue",void 0),Et(this,"storage",new dd("checkout-attempt-id","sessionStorage")),Et(this,"debouncedSendInfoEvents",void 0),Et(this,"debouncedSendEvents",void 0),Et(this,"_checkoutAttemptId",void 0),Et(this,"enabled",!0),Et(this,"isFlavorReported",!1),Et(this,"pendingFlavor",void 0),this.service=t,this.eventsQueue=n,this.debouncedSendInfoEvents=da(this.sendEvents.bind(this),1e4),this.debouncedSendEvents=da(this.sendEvents.bind(this),Xf),r!==void 0&&(this.enabled=r),o&&(this.analyticsData=o)}};function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ty=class{add(t){const n=t.getEventCategory();n===Qt.info&&this.info.push(t),n===Qt.error&&this.errors.push(t),n===Qt.log&&this.logs.push(t)}get infoEvents(){return this.info}get errorEvents(){return this.errors}get logEvents(){return this.logs}get hasEvents(){return this.info.length>0||this.errors.length>0||this.logs.length>0}clear(){this.info=[],this.errors=[],this.logs=[]}constructor(){Ra(this,"info",[]),Ra(this,"errors",[]),Ra(this,"logs",[])}};function ud(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $a="v3/analytics";let ny=class{async requestCheckoutAttemptId(t){const n={loadingContext:this.analyticsContext,path:`${$a}?clientKey=${this.clientKey}`};try{const{checkoutAttemptId:r}=await Ve(n,t);return r}catch(r){throw new M("NETWORK_ERROR","requestCheckoutAttemptId() - failed to get checkout attempt ID",{cause:r})}}async sendEvents(t,n){if(!n)throw new M("IMPLEMENTATION_ERROR","sendEvents() - checkoutAttemptId is required");if(!t.info.length&&!t.errors.length&&!t.logs.length)return Promise.resolve();const r={loadingContext:this.analyticsContext,path:`${$a}/${n}?clientKey=${this.clientKey}`};try{await Ve(r,t)}catch(o){throw new M("NETWORK_ERROR","sendEvents() - failed to send events",{cause:o})}}async reportIntegrationFlavor(t,n){if(!t||!n)throw new M("IMPLEMENTATION_ERROR","reportIntegrationFlavor() - flavor or checkoutAttemptId is required");const r={loadingContext:this.analyticsContext,path:`${$a}?clientKey=${this.clientKey}`},o={flavor:t,checkoutAttemptId:n};try{await Ve(r,o)}catch(i){throw new M("NETWORK_ERROR","reportIntegrationFlavor() - failed to send flavor",{cause:i})}}constructor({clientKey:t,analyticsContext:n}){ud(this,"clientKey",void 0),ud(this,"analyticsContext",void 0),this.clientKey=t,this.analyticsContext=n}};var Ma={payButton:"Pay","payButton.redirecting":"Redirecting...","payButton.with":"Pay %{value} with %{maskedData}","payButton.saveDetails":"Save details",close:"Close",storeDetails:"Save for my next payment",readMore:"Read more","creditCard.holderName":"Name on card","creditCard.holderName.invalid":"Enter name as shown on card","creditCard.expiryDateField.month":"Month","creditCard.expiryDateField.year":"Year","creditCard.storeDetailsButton":"Remember for next time","creditCard.dualBrand.title":"Card Brand","creditCard.dualBrand.description":"You can select the card brand you prefer to pay with. This is optional.",installments:"Number of installments",installmentOption:"%{times}x %{partialValue}",installmentOptionMonths:"%{times} months","installments.oneTime":"One time payment","installments.installments":"Installments payment","installments.revolving":"Revolving payment","installments.bonus":"Bonus payment","sepaDirectDebit.ibanField.invalid":"Invalid account number","sepa.ownerName":"Holder Name","sepa.ibanNumber":"Account Number (IBAN)","error.title":"Error","error.subtitle.redirect":"Redirect failed","error.subtitle.payment":"Payment failed","error.subtitle.refused":"Payment refused","error.message.unknown":"An unknown error occurred","errorPanel.title":"Existing errors","idealIssuer.selectField.title":"Bank","creditCard.success":"Payment Successful",loading:"Loading…",loaded:"Loaded",continue:"Continue",continueTo:"Continue to","wechatpay.timetopay":"You have %@ to pay","sr.wechatpay.timetopay":"You have %#minutes%# %#seconds%# to pay","wechatpay.scanqrcode":"Scan QR code",personalDetails:"Personal details",companyDetails:"Company details","companyDetails.name":"Company name","companyDetails.registrationNumber":"Registration number",socialSecurityNumber:"Social security number",firstName:"First name","firstName.invalid":"Enter your first name",infix:"Prefix",lastName:"Last name","lastName.invalid":"Enter your last name",mobileNumber:"Mobile number","mobileNumber.invalid":"Invalid mobile number",city:"City",postalCode:"Postal code","postalCode.optional":"Postal code (optional)",countryCode:"Country Code",telephoneNumber:"Telephone number",telephonePrefix:"Prefix",dateOfBirth:"Date of birth",shopperEmail:"Email address",gender:"Gender","gender.notselected":"Select your gender",male:"Male",female:"Female",billingAddress:"Billing address",street:"Street",stateOrProvince:"State or province",country:"Country/Region",houseNumberOrName:"House number",separateDeliveryAddress:"Specify a separate delivery address",deliveryAddress:"Delivery Address","deliveryAddress.firstName":"Recipient first name","deliveryAddress.lastName":"Recipient last name",zipCode:"Zip code",apartmentSuite:"Apartment / Suite",provinceOrTerritory:"Province or Territory",cityTown:"City / Town",address:"Address","address.search.contextualText":"Type to start searching your address","address.errors.incomplete":"Enter an address to continue","address.enterManually":"Enter address manually",state:"State",payAmountFormat:"Pay %@","field.title.optional":"(optional)","issuerList.selectField.contextualText":"Select your bank to continue","issuerList.selectField.label":"Bank selection",privacyPolicy:"Privacy policy","afterPay.agreement":"I agree with the %@ of Riverty","riverty.termsAndConditions":"I agree with the general %#Terms & Conditions%# for the Riverty Payment Method. The privacy policy of Riverty can be found %#here%#.",paymentConditions:"payment conditions",openApp:"Open the app","voucher.readInstructions":"Read instructions","voucher.introduction":"Thank you for your purchase, please use the following coupon to complete your payment.","voucher.expirationDate":"Expiration Date","voucher.alternativeReference":"Alternative Reference","voucher.paymentReferenceLabel":"Payment Reference","voucher.surcharge":"Incl. %@ surcharge","voucher.introduction.doku":"Thank you for your purchase, please use the following information to complete your payment.","voucher.shopperName":"Shopper Name","voucher.merchantName":"Merchant","voucher.introduction.econtext":"Thank you for your purchase, please use the following information to complete your payment.","voucher.telephoneNumber":"Phone Number","voucher.shopperReference":"Shopper Reference","voucher.collectionInstitutionNumber":"Collection Institution Number","voucher.econtext.telephoneNumber.invalid":"Telephone number must be 10 or 11 digits long","boletobancario.btnLabel":"Generate Boleto","boleto.sendCopyToEmail":"Send a copy to my email","button.copy":"Copy","button.copied":"Copied!","button.download":"Download","boleto.socialSecurityNumber":"CPF/CNPJ","boleto.socialSecurityNumber.invalid":"Enter a valid CPF/CNPJ number","creditCard.storedCard.description.ariaLabel":"Stored card ends in %@","voucher.entity":"Entity",donateButton:"Donate",donationTermsCondition:"By donating you agree to the %#terms and conditions%#",donationRoundUpDescription:"%{donationAmount} is a round up from your original payment (%{originalPaymentAmount})",notNowButton:"Not now",thanksForYourSupport:"Thanks for your support!","resultMessages.preauthorized":"Details saved",preauthorizeWith:"Preauthorize with",confirmPreauthorization:"Confirm preauthorization",confirmPurchase:"Confirm purchase",applyGiftcard:"Redeem",giftcardBalance:"Gift card balance",deductedBalance:"Deducted balance","creditCard.taxNumber":"Cardholder birthdate or Corporate registration number","creditCard.taxNumber.label":"Cardholder birthdate (YYMMDD) or Corporate registration number (10 digits)","creditCard.taxNumber.labelAlt":"Corporate registration number (10 digits)","creditCard.taxNumber.invalid":"Invalid Cardholder birthdate or Corporate registration number","storedPaymentMethod.disable.button":"Remove","storedPaymentMethod.disable.confirmation":"Remove stored payment method","storedPaymentMethod.disable.confirmButton":"Yes, remove","storedPaymentMethod.disable.cancelButton":"Cancel","ach.bankAccount":"Bank account","ach.bankAccount.title":"Bank account details","ach.bankAccount.label":"Account type","ach.bankAccount.placeholder":"Choose an account type","ach.bankAccount.nothing-selected-error":"Choose an account type","ach.bankAccount.option.personal-checking":"Personal Checking Account","ach.bankAccount.option.personal-savings":"Personal Savings Account","ach.bankAccount.option.business-checking":"Business Checking Account","ach.bankAccount.option.business-savings":"Business Savings Account","ach.bankAccountNumberVerification.label":"Verify account number","ach.bankAccountNumberVerification.error.not-match":"Account number does not match","ach.bankAccountNumberVerification.error.empty":"Enter the provided account number to verify the account number","ach.routingNumber.label":"Routing number","ach.accountHolderNameField.title":"Account holder name","ach.accountHolderNameField.contextualText":"Located on the front of your card","ach.accountHolderNameField.invalid":"Invalid account holder name","ach.accountNumberField.invalid":"Invalid account number","ach.accountLocationField.invalid":"Invalid ABA routing number","ach.savedBankAccount":"Saved bank account","ach.savings":"Savings account","ach.checking":"Checking account","select.state":"Select state","select.stateOrProvince":"Select state or province","select.provinceOrTerritory":"Select province or territory","select.country":"Select country/region","select.noOptionsFound":"No options found","select.results":"%{count} results available","telephoneNumber.invalid":"Invalid telephone number",qrCodeOrApp:"or","paypal.processingPayment":"Processing payment...",generateQRCode:"Generate QR code","await.waitForConfirmation":"Waiting for confirmation","mbway.confirmPayment":"Confirm your payment on the MB WAY app","shopperEmail.invalid":"Invalid email address","dateOfBirth.format":"DD/MM/YYYY","dateOfBirth.invalid":"Enter a valid date of birth that indicates you are at least 18 years old","blik.confirmPayment":"Open your banking app to confirm the payment.","blik.invalid":"Enter 6 numbers","blik.code":"6-digit code","blik.help":"Get the code from your banking app.","swish.pendingMessage":"After you scan, the status can be pending for up to 10 minutes. Attempting to pay again within this time may result in multiple charges.","field.valid":"Field valid","field.invalid":"Field not valid","field.error.required":"Enter the %{label}","field.error.invalid":"Enter a valid %{label}","field.error.invalidCharacters":"Some special characters are not allowed, enter a valid %{label}","error.giftcard.no-balance":"This gift card has zero balance","error.giftcard.card-error":"In our records we have no gift card with this number","error.giftcard.currency-error":"Gift cards are only valid in the currency they were issued in","err.gen.9100":"Incomplete field","err.gen.9101":"Field not valid","err.gen.9102":"Data parsing error","3ds.chal.805":"Challenge resolved without a %{result} object","cc.num.902":"Enter a valid card number","cc.num.900":"Enter the card number","cc.num.903":"Enter a supported card brand","cc.num.901":"Enter the complete card number","cc.num.904":"This card type is not supported","cc.dat.912":"Enter a valid expiry date. Front of card in MM/YY format.","cc.dat.913":"Enter a valid expiry date. Front of card in MM/YY format.","cc.dat.914":"Credit card about to expire","cc.dat.910":"Enter the expiry date. Front of card in MM/YY format.","cc.dat.911":"Enter the complete expiry date. Front of card in MM/YY format.","cc.mth.915":"Enter the expiry month","cc.yr.917":"Enter the expiry year","cc.yr.918":"Enter the complete expiry year","cc.cvc.920":"Enter the security code. 3 digits on back of card.","cc.cvc.921":"Enter the complete security code. 3 digits on back of card.","cc.cvc.920.amex":"Enter the security code. 4 digits on front of card.","cc.cvc.921.amex":"Enter the complete security code. 4 digits on front of card.","ach.num.945":"Enter the bank account number","ach.num.946":"Enter the complete bank account number","ach.loc.947":"Enter the bank routing number","ach.loc.948":"Enter the complete bank routing number","kcp.pwd.940":"Enter the password","kcp.pwd.941":"Enter the complete password","amazonpay.signout":"Sign out from Amazon","amazonpay.changePaymentDetails":"Change payment details","order.paymentMethod.description":"%{name} ending in %{lastFour}","partialPayment.warning":"Select another payment method to pay the remaining","partialPayment.remainingBalance":"Remaining balance will be %{amount}","bankTransfer.beneficiary":"Beneficiary name","bankTransfer.iban":"IBAN","bankTransfer.bic":"BIC","bankTransfer.reference":"Reference","bankTransfer.accountNumber":"Account number","bankTransfer.sortCode":"Sort code","bankTransfer.routingNumber":"Routing number","bankTransfer.branchCode":"Branch code","bankTransfer.bankCode":"Bank code","bankTransfer.introduction":"Press ‘Continue’ to create a new bank transfer payment. You can use the details in the following screen to finalize this payment.","bankTransfer.instructions":"Thank you for your purchase, please use the following information to complete your payment.","bankTransfer.shopperEmail.contextualText":"A copy of the payment details will be sent to your email so you can complete the payment later.","bankTransfer.details.title":"Payment details","bankTransfer.instruction.title":"Payment process","bankTransfer.instruction.step1":"Open your banking app","bankTransfer.instruction.step2":"Start a new transfer","bankTransfer.instruction.step3":"Enter the account details provided below","bankTransfer.instruction.step4":"Review and confirm the payment","bacs.accountHolderName":"Bank account holder name","bacs.accountHolderName.invalid":"Invalid bank account holder name","bacs.accountNumber":"Bank account number","bacs.accountNumber.invalid":"Invalid bank account number","bacs.bankLocationId":"Sort code","bacs.bankLocationId.invalid":"Invalid sort code","bacs.consent.amount":"I agree that the above amount will be deducted from my bank account.","bacs.consent.account":"I confirm the account is in my name and I am the only signatory required to authorise the Direct Debit on this account.",edit:"Edit","bacs.confirm":"Confirm and pay","bacs.result.introduction":"Download your Direct Debit Instruction (DDI / Mandate)","download.pdf":"Download PDF","creditCard.encryptedCardNumber.aria.iframeTitle":"Card number","creditCard.encryptedExpiryDate.aria.iframeTitle":"Expiry date","creditCard.encryptedExpiryMonth.aria.iframeTitle":"Expiry month","creditCard.encryptedExpiryYear.aria.iframeTitle":"Expiry year","creditCard.encryptedSecurityCode.aria.iframeTitle":"Security code","creditCard.encryptedPassword.aria.iframeTitle":"Password","giftcard.encryptedCardNumber.aria.iframeTitle":"Card number","giftcard.encryptedSecurityCode.aria.iframeTitle":"Pin",giftcardTransactionLimit:"Max. %{amount} allowed per transaction on this gift card","pix.instructions":"Use your banking app to scan the QR code or copy the PIX code below to complete your payment.","pix.code.label":"PIX code","pix.code.copy.label":"Copy PIX code","pix.code.copied.label":"PIX code copied","twint.saved":"saved",orPayWith:"or pay with","invalid.format.expects":"%{label} Invalid format. Expected format: %{format}","upi.qrCodeWaitingMessage":"Scan the QR code using your preferred UPI app to complete the payment","upi.vpaWaitingMessage":"Open your UPI app to confirm the payment","upi.modeSelection":"How would you like to use UPI?","upi.completePayment":"Complete your payment","upi.mode.enterUpiId":"UPI ID","upi.mode.qrCode":"QR code","upi.mode.payByAnyUpi":"UPI apps","upi.collect.dropdown.label":"Enter UPI ID","upi.collect.instruction":"Enter your UPI ID","upi.collect.field.label":"UPI ID","upi.collect.field.contextualText":"Enter the UPI ID connected to your account and press continue","upi.collect.field.invalid-id-error":"Enter a valid UPI","upi.error.noAppSelected":"Select your preferred UPI app to continue","upi.intent.instruction":"Select your preferred UPI app","upi.qrCode.instruction":"After generating the QR code you can use your preferred UPI app to complete the payment.","onlineBanking.termsAndConditions":"By continuing you agree with the %#terms and conditions%#","onlineBankingPL.termsAndConditions":"By continuing you agree with the %#regulations%# and %#information obligation%# of Przelewy24","ctp.loading.poweredByCtp":"Powered by Click to Pay","ctp.loading.intro":"We are checking to see if you have any saved cards with Click to Pay...","ctp.login.title":"Continue to Click to Pay","ctp.login.subtitle":"Enter the email address that is connected to Click to Pay to continue.","ctp.login.inputLabel":"Email","ctp.logout.notYou":"Not you?","ctp.logout.notYourCards":"Not your cards?","ctp.logout.notYourCard":"Not your card?","ctp.logout.notYourProfile":"Not your profile?","ctp.otp.fieldLabel":"One time code","ctp.otp.resendCode":"Resend code","ctp.otp.codeResent":"Code resent","ctp.otp.title":"Access your Click to Pay cards","ctp.otp.subtitle":"Enter the code %@ sent to %@ to verify it‘s you.","ctp.otp.saveCookiesCheckbox.label":"Skip verification next time","ctp.otp.saveCookiesCheckbox.information":"Select to be remembered on your device and browser at participating stores for faster checkout. Not recommended for shared devices.","ctp.otp.saveCookiesCheckbox.shorterInfo":"Select to be remembered on your device and browser","ctp.emptyProfile.message":"No cards registered in this Click to Pay profile","ctp.separatorText":"or use","ctp.cards.title":"Complete payment with Click to Pay","ctp.cards.subtitle":"Select a card to use.","ctp.cards.expiredCard":"Expired","ctp.manualCardEntry":"Manual card entry","ctp.aria.infoModalButton":"What is Click to Pay","ctp.infoPopup.title":"Click to Pay brings the ease of contactless, online","ctp.infoPopup.subtitle":"A fast, secure payment method supported by Mastercard, Visa and other payment cards.","ctp.infoPopup.benefit1":"Click to Pay uses encryption to keep your information safe and secure","ctp.infoPopup.benefit2":"Use it with merchants worldwide","ctp.infoPopup.benefit3":"Set up once for hassle-free payments in the future","ctp.errors.AUTH_INVALID":"Authentication Invalid","ctp.errors.NOT_FOUND":"No account found, enter a valid email or continue using manual card entry","ctp.errors.ID_FORMAT_UNSUPPORTED":"Format not supported","ctp.errors.FRAUD":"The user account was locked or disabled","ctp.errors.CONSUMER_ID_MISSING":"Consumer identity is missing in the request","ctp.errors.ACCT_INACCESSIBLE":"This account is currently not available, e.g it is locked","ctp.errors.CODE_INVALID":"Incorrect verification code","ctp.errors.CODE_EXPIRED":"This code has expired","ctp.errors.RETRIES_EXCEEDED":"The limit for the number of retries for OTP generation was exceeded","ctp.errors.OTP_SEND_FAILED":"The OTP could not be sent to the recipient","ctp.errors.REQUEST_TIMEOUT":"Something went wrong, try again or use the manual card entry","ctp.errors.UNKNOWN_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.SERVICE_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.SERVER_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.INVALID_PARAMETER":"Something went wrong, try again or use the manual card entry","ctp.errors.AUTH_ERROR":"Something went wrong, try again or use the manual card entry","ctp.errors.INVALID_EMAIL":"Enter a valid email address (e.g. name@example.com)","paymentMethodsList.aria.label":"Choose a payment method","paymentMethodsList.storedPayments.label":"Saved payment methods","paymentMethodsList.otherPayments.label":"More payment options","paymentMethodsList.otherPayments.buttonLabel":"Show %{count} more","paymentMethodsList.promotedPayments.label":"Other","companyDetails.name.invalid":"Enter the company name","companyDetails.registrationNumber.invalid":"Enter the registration number","consent.checkbox.invalid":"You must agree with the terms & conditions","form.instruction":"All fields are required unless marked otherwise.","trustly.descriptor":"Instant Bank Payment","trustly.description1":"Pay directly from any of your bank accounts, backed by bank-level security","trustly.description2":"No cards, no app download, no registration","ancv.input.label":"Your ANCV identification","ancv.confirmPayment":"Use your ANCV application to confirm the payment.","ancv.form.instruction":"The Cheque-Vacances application is necessary to validate this payment.","ancv.beneficiaryId.invalid":"Enter a valid email address or ANCV ID","creditCard.cardNumber.label":"Card number","creditCard.expiryDate.label":"Expiry date","creditCard.expiryDate.contextualText":"Front of card in MM/YY format","creditCard.securityCode.label":"Security code","creditCard.securityCode.label.optional":"Security code (optional)","creditCard.securityCode.contextualText.3digits":"3 digits on back of card","creditCard.securityCode.contextualText.4digits":"4 digits on front of card","creditCard.expiryMonth.label":"Expiry month","creditCard.expiryYear.label":"Expiry year","creditCard.pin.label":"Pin","creditCard.password.label":"First 2 digits of card password","giftcard.cardNumber.label":"Card Number","giftcard.expiryDate.label":"Expiry date","giftcard.securityCode.label":"Pin","ach.bankAccountNumber.label":"Account number","ach.bankLocationId.label":"ABA routing number","dragonpayVoucher.selectField.contextualText.nonBank":"Select your provider","dragonpayVoucher.selectField.contextualText.bank":"Select your bank","payme.openPayMeApp":"Complete your payment in the PayMe app by authorizing the payment in the app and wait for the confirmation.","payme.redirectButtonLabel":"Open PayMe app","payme.scanQrCode":"Complete your payment by QR code","payme.timeToPay":"This QR code is valid for %@","payme.instructions.steps":"Open the PayMe app.%@Scan the QR code to authorize the payment.%@Complete the payment in the app and wait for confirmation.","payme.instructions.footnote":"Please do not close this page before the payment is completed","payByBankAISDD.disclaimer.header":"Use Pay by Bank to pay instantly from any bank account.","payByBankAISDD.disclaimer.body":"By connecting your bank account you are authorizing debits to your account for any amount owed for use of our services and/or purchase of our products, until this authorization is revoked.","paymentMethodBrand.other":"other","paynow.scanQrCode":"Scan the QR code using the PayNow app to complete the payment","paynow.mobileViewInstruction.step1":"Take a screenshot of the QR code.","paynow.mobileViewInstruction.step2":"Open the PayNow bank or payment app.","paynow.mobileViewInstruction.step3":"Select the option to scan a QR code.","paynow.mobileViewInstruction.step4":"Choose the option to upload a QR and select the screenshot.","paynow.mobileViewInstruction.step5":"Complete the transaction.","payto.payid.description":"Enter the PayID and account details that are connected to your PayTo account.","payto.payid.label.identifier":"Identifier","payto.payid.label.orgid":"Organization ID","payto.payid.option.phone":"Mobile","payto.payid.option.email":"Email","payto.payid.option.orgid":"Organization ID","payto.bsb.description":"Enter the bank account number and the Bank State Branch that is connected to your account to continue","payto.bsb.label.bankAccountNumber":"Bank account number","payto.instructions.steps":"Log into your PayTo banking app@Authorize the PayTo agreement@Approve the payment terms@Complete the transaction","payto.confirmPayment":"Thank you for your purchase, complete your payment by following the instructions below.","payto.mandate.amount.label":"Amount","payto.mandate.frequency.label":"Frequency","payto.mandate.remarks.label":"Description","payto.mandate.startsAt.label":"First payment date","payto.mandate.endsAt.label":"End date","payto.mandate.payee.label":"Payee","payto.mandate.amount.max":"Up to %{amount} per transaction","payto.mandate.frequency.adhoc-no-count":"Ad Hoc","payto.mandate.frequency.adhoc":"%{count} time(s)","payto.mandate.frequency.daily":"%{count} payment(s) Daily","payto.mandate.frequency.weekly":"%{count} payment(s) Weekly","payto.mandate.frequency.biWeekly":"%{count} payment(s) Fortnightly","payto.mandate.frequency.monthly":"%{count} payment(s) Monthly","payto.mandate.frequency.quarterly":"%{count} payment(s) Quarterly","payto.mandate.frequency.halfYearly":"%{count} payment(s) Bi-Annual","payto.mandate.frequency.yearly":"%{count} payment(s) Yearly","payto.label.firstName":"Account holder first name","payto.label.lastName":"Account holder last name","payto.await.waitForConfirmation":"Awaiting your approval","payto.errors.accountHolderFirstName.invalid":"Enter your account holder first name","payto.errors.accountHolderLastName.invalid":"Enter your account holder last name","payto.bsb.option.label":"BSB and account number","card.fastlane.a11y.logo":"Fastlane by Paypal logo","card.fastlane.a11y.openDialog":"Read more about Fastlane","card.fastlane.a11y.closeDialog":"Close dialog","card.fastlane.mobileInputLabel":"Mobile number","card.fastlane.consentToggle":"Save your info with Fastlane for faster checkouts and more","card.fastlane.consentText":"By saving your info, you agree to get codes by text to use Fastlane everywhere it's available. Fastlane will text the number provided. You also agree to this %#terms%# and %#privacy statement%#.","card.fastlane.modal.benefit1.header":"Autofill your checkouts","card.fastlane.modal.benefit1.text":"Get one-time codes to use card and addresses you’ve saved.","card.fastlane.modal.benefit2.header":"Protect your info","card.fastlane.modal.benefit2.text":"Your payment info is encrypted when it’s stored and sent to places you shop.","card.fastlane.modal.benefit3.header":"Use across stores","card.fastlane.modal.benefit3.text":"Speed through checkout everywhere Fastlane is available.","paybybankpix.redirectBtn.label":"Continue to PIX through OpenBanking","paybybankpix.issuerList.disclaimer":"By continuing, you agree to the %#Consent Notice%# and will be redirected to your bank.","paybybankpix.issuerList.selectField.label":"Bank","paybybankpix.issuerList.introduction.logo.content":"Connect your favorite PIX keys to pay through Open Finance","paybybankpix.await.waitForConfirmation":"Waiting for your confirmation...","paybybankpix.await.timeToPay":"This process will take approximately %{numberOfMin} minute(s)","paybybankpix.await.withOpenFinance":"With the ease of Open Finance","paybybankpix.await.logoAlt.openFinance":"Open Finance","paybybankpix.storedPayment.payButton.label":"Continue payment","paybybankpix.storedPayment.additionalLabel":"%{receiver} account through PIX","paybybankpix.await.fetchDetails":"Fetching details...","eftpad-canada.input.accountHolderName.label":"Account holder name","eftpad-canada.input.accountHolderName.error":"Enter an account holder name","eftpad-canada.input.accountNumber.label":"Account number","eftpad-canada.input.accountNumber.contextualText":"Between 7 and 12 digits","eftpad-canada.input.accountNumber.error":"Enter an account number that is between 7 and 12 digits","eftpad-canada.input.institutionNumber.label":"Institution number","eftpad-canada.input.institutionNumber.contextualText":"3 digits","eftpad-canada.input.institutionNumber.error":"Enter an institution number that consists of 3 digits","eftpad-canada.input.transitNumber.label":"Transit number","eftpad-canada.input.transitNumber.contextualText":"5 digits","eftpad-canada.input.transitNumber.error":"Enter a transit number that consists of 5 digits","eftpad-canada.settlement-info":"The funds will be withdrawn from your bank account within 1–3 business days.","upi.mandate.intro":"You’re setting up a UPI Autopay recurring payment","upi.mandate.max.extraText":"You’ll approve a higher limit to allow future plan changes","upi.mandate.upTo":"up to %{amount}","upi.mandate.frequency.monthly":"/month","upi.mandate.frequency.weekly":"/week","upi.mandate.frequency.adhoc":" as presented",bankList:"Bank list",qrCode:"QR code","iris.instructions.generateQrCode":"After generating the QR code you can use your preferred banking app to complete the payment.","iris.instructions.payment.step1":"Open your preferred banking app.","iris.instructions.payment.step2":"Scan the QR code with your banking app.","iris.instructions.payment.step3":"Complete the payment in the app and wait for the confirmation here.","econtext.customerNumber":"Customer number","econtext.confirmationNumber":"Confirmation number","econtext.useBefore":"Use before","econtext.paymentInformation":"Payment information","issuerList.separatorText":"or choose from list","upi.intent.apps.title":"Options","upi.intent.apps.dropdown.label":"UPI apps","upi.intent.apps.dropdown.placeholder":"Choose preferred app","emi.subtitle":"Installment plans on credit cards","emi.title":"EMI plan","emi.instructions":"Choose your preferred combination from the options listed below and continue to enter your card details","emi.provider":"Provider","emi.plan":"Plan","emi.planSummary":"Plan summary","emi.itemPrice":"Item price","emi.amountReservedOnCard":"Amount reserved on card","emi.interestChargedByBank":"Interest charged by bank @%{interest}","emi.totalAmountOverTime":"Total amount to be paid over time","emi.upcomingMonthlyPayment":"Upcoming monthly payment","emi.discount":"Discount","emi.discountApplied":"%{amount} discount offer applied for using %{provider}","emi.noCost":"No cost","emi.lowCost":"Low cost","emi.discountAvailable":"discount available","emi.perAnnum":"p.a","emi.cardDetailsInstructions":"Enter card details that are associated with a %{provider} card","emi.cardDetails":"Card details"};function At(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ry{async requestTranslations(){const t=await this.service.fetchTranslationsFromCdn(this.locale);this._translations={...Ma,...t,...!!this.customTranslations[this.locale]&&this.customTranslations[this.locale]}}get translations(){return this._translations}get(t,n){const r=J0(this._translations,t,n);return r!==null?r:t}amount(t,n,r){return F1(t,this.locale,n,r)}date(t,n={}){if(t===void 0)return"";const r={year:"numeric",month:"2-digit",day:"2-digit",...n};return new Date(t).toLocaleDateString(this.locale,r)}dateTime(t){return t===void 0?"":this.timeAndDateFormatter.format(new Date(t))}createSupportedLocalesList(t){if(!t)return Ji;const n=new Set([...Ji,...Object.keys(t)]);return Array.from(n).sort((r,o)=>r.localeCompare(o))}constructor(t){At(this,"locale",void 0),At(this,"languageCode",void 0),At(this,"service",void 0),At(this,"customTranslations",void 0),At(this,"supportedLocales",void 0),At(this,"_translations",{}),At(this,"timeFormatOptions",{hour:"numeric",minute:"numeric"}),At(this,"timeAndDateFormatOptions",{year:"numeric",month:"2-digit",day:"2-digit",...this.timeFormatOptions}),At(this,"timeAndDateFormatter",void 0);const{locale:n,customTranslations:r,service:o}=t;this.service=o,this.customTranslations=Q0(r),this.supportedLocales=this.createSupportedLocalesList(this.customTranslations),this.locale=Z0(n||bo,this.supportedLocales),this.languageCode=this.locale.split("-")[0],this.timeAndDateFormatter=Intl.DateTimeFormat(this.locale,this.timeAndDateFormatOptions)}}const oy="1.0.0",iy="1.0.0",Mo="deviceFingerprint",ay=2e4,sy={result:{type:Mo,value:"df-timedOut"},errorCode:"timeout"},ly={UNKNOWN:"unknownError"},hd={timeout:"iframe loading timed out",wrongOrigin:"Result did not come from the expected origin",wrongDataType:"Result data was not of the expected type",missingProperty:"Result data did not contain the expected properties",unknownError:"An unknown error occurred"};function Fa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class cy extends Ne{getDfpPromise(){return new Promise((t,n)=>{this.processMessageHandler=ba(this.postMessageDomain,t,n,Mo),window.addEventListener("message",this.processMessageHandler)})}componentDidMount(){this.deviceFingerPrintPromise=_a(ay,this.getDfpPromise(),sy),this.deviceFingerPrintPromise.promise.then(t=>{this.props.onCompleteFingerprint(t),window.removeEventListener("message",this.processMessageHandler)}).catch(t=>{this.props.onErrorFingerprint(t),window.removeEventListener("message",this.processMessageHandler)})}render({dfpURL:t}){return u("div",{className:"adyen-checkout-risk__device-fingerprint"},u(ur,{name:"dfIframe",src:t,allow:"geolocation; microphone; camera;",title:"devicefingerprinting iframe"}))}constructor(t){super(t),Fa(this,"postMessageDomain",void 0),Fa(this,"processMessageHandler",void 0),Fa(this,"deviceFingerPrintPromise",void 0),this.postMessageDomain=Ca(this.props.loadingContext)||this.props.loadingContext}}const dy=e=>({errorCode:e,message:hd[e]||hd[ly.UNKNOWN],type:Mo});let pd=class extends Ne{setStatusComplete(t){this.setState({status:"complete"},()=>{this.props.onComplete(t)})}render({loadingContext:t},{dfpURL:n}){return this.state.status==="retrievingFingerPrint"?u("div",{className:"adyen-checkout-risk__device-fingerprint--wrapper",style:{position:"absolute",width:0,height:0}},u(cy,{loadingContext:t,dfpURL:n,onCompleteFingerprint:r=>{this.setStatusComplete(r)},onErrorFingerprint:r=>{this.props.onError(dy(r.errorCode)),this.setStatusComplete(r.result)}})):null}constructor(t){super(t),t.clientKey&&(this.state={status:"retrievingFingerPrint",dfpURL:`${this.props.loadingContext}assets/html/${t.clientKey}/dfp.${iy}.html`})}};var La,Oa,Ba;Ba={onComplete:()=>{},onError:()=>{}},(Oa="defaultProps")in(La=pd)?Object.defineProperty(La,Oa,{value:Ba,enumerable:!0,configurable:!0,writable:!0}):La[Oa]=Ba;function $n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Va=class bu extends ko{formatProps(t){return{...t,risk:{...bu.defaultProps.risk,...t.risk}}}get isValid(){return this.state.isValid}get data(){if(this.isValid){const t={version:oy,...this.state.data};return Tn.encode(JSON.stringify(t))}return!1}get enabled(){return this.props.risk.enabled}componentWillUnmount(){this.cleanUp()}render(){return u(pd,{...this.props,loadingContext:this.props.loadingContext,onComplete:this.onComplete,onError:this.onError})}constructor(t,n){super(t,n),$n(this,"nodeRiskContainer",null),$n(this,"onComplete",o=>{const i={...this.state.data,[o.type]:o.value,persistentCookie:o.persistentCookie,components:o.components};this.setState({data:i,isValid:!0}),this.props.risk.onComplete(this.data),this.cleanUp()}),$n(this,"onError",o=>{this.props.risk.onError(o),this.cleanUp()}),$n(this,"cleanUp",()=>{this.nodeRiskContainer&&this.nodeRiskContainer.parentNode&&this.nodeRiskContainer.parentNode.removeChild(this.nodeRiskContainer)});const r={[Mo]:null};this.setState({data:r}),this.props.risk.enabled===!0&&(document.querySelector(this.props.risk.node)?(this.nodeRiskContainer=document.createElement("div"),document.querySelector(this.props.risk.node).appendChild(this.nodeRiskContainer),this.mount(this.nodeRiskContainer)):this.onError({message:"RiskModule node was not found"}))}};$n(Va,"type","risk"),$n(Va,"defaultProps",{risk:{enabled:!0,onComplete:()=>{},onError:()=>{},node:"body"}});function md(e){return!this.length||this.includes(e.type)}function fd(e){return!this.length||!this.includes(e.type)}function uy(e){return!!e&&!!e.supportedShopperInteractions&&e.supportedShopperInteractions.includes("Ecommerce")}const hy=["scheme","blik","twint","ach","cashapp","paybybank_AIS_DD","payto","paybybank_pix","eft_directdebit_CA"];function py(e){return!!e&&!!e.type&&hy.includes(e.type)}function my(e){return{...e,_id:Be()}}const fy=(e,{allowPaymentMethods:t=[],removePaymentMethods:n=[]})=>e?e.filter(md,t).filter(fd,n).map(my):[],yy=(e,{allowPaymentMethods:t=[],removePaymentMethods:n=[]},r=[])=>e?e.filter(py).filter(md,t).filter(fd,n).filter(uy).map(o=>((i,a)=>{const s=(function(l,c){if(l.type!=="scheme")return;const d=l.brand;return d?c.find(h=>h.type==="scheme"&&h.brands?.includes(d))?.fundingSource:void 0})(i,a);return{...i,storedPaymentMethodId:i.id,isStoredPaymentMethod:!0,...s&&{fundingSource:s}}})(o,r)):[],gy=e=>{if(typeof e=="string")throw new Error('paymentMethodsResponse was provided but of an incorrect type (should be an object but a string was provided).Try JSON.parse("{...}") your paymentMethodsResponse.');if(e instanceof Array)throw new Error("paymentMethodsResponse was provided but of an incorrect type (should be an object but an array was provided).Please check you are passing the whole response.");!e||e?.paymentMethods?.length||e?.storedPaymentMethods?.length||console.warn("paymentMethodsResponse was provided but no payment methods were found.")};function yd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let by=class{mapCreatedComponentType(t){return t==="card"?"scheme":t}has(t){return!!this.paymentMethods.find(n=>n.type===this.mapCreatedComponentType(t))}find(t){return this.paymentMethods.find(n=>n.type===this.mapCreatedComponentType(t))}findByFundingSource(t,n){const r=this.mapCreatedComponentType(t);return this.paymentMethods.find(o=>o.type===r&&o.fundingSource===n)}findById(t){return this.paymentMethods.find(n=>n._id===t)}findStoredPaymentMethod(t){return this.storedPaymentMethods.find(n=>n.id===t)}constructor(t,n={}){yd(this,"paymentMethods",[]),yd(this,"storedPaymentMethods",[]),gy(t),this.paymentMethods=t?fy(t.paymentMethods,n):[],this.storedPaymentMethods=t?yy(t.storedPaymentMethods,n,t.paymentMethods||[]):[]}};const Ua=(e,t,n,r)=>{const o=t.getComponent(n);if(!o)throw Error(`Action Element of type ${n} not found in the registry`);return new o(e,{...r,id:`${n}-${Be()}`})},vr=e=>(t,n,r,o)=>{const i={...o,...r,onError:o.onError,statusType:e,originalAction:r};return Ua(t,n,r.paymentMethodType,i)},vy={redirect:(e,t,n,r)=>{const o={...r,...n,statusType:"redirect",originalAction:n};return Ua(e,t,"redirect",o)},threeDS2:(e,t,n,r)=>{const o=n.subtype==="fingerprint"?"threeDS2DeviceFingerprint":"threeDS2Challenge",i=n.subtype==="fingerprint"||r.isMDFlow?n.paymentData:n.authorisationToken,a={core:e,token:n.token,paymentData:i,onActionHandled:r.onActionHandled,on3DS2RedirectFlowComplete:r.on3DS2RedirectFlowComplete,onAdditionalDetails:r.onAdditionalDetails,onError:r.onError,isDropin:!!r.isDropin,loadingContext:r.loadingContext,clientKey:r.clientKey,paymentMethodType:r.paymentMethodType,challengeWindowSize:r.challengeWindowSize,usePasskeyIFrameAttributes:r.usePasskeyIFrameAttributes,isMDFlow:r.isMDFlow,modules:{analytics:r.modules?.analytics,resources:r.modules?.resources},...gf(n.subtype,r)};return Ua(e,t,o,a)},voucher:vr("custom"),qrCode:vr("custom"),await:vr("custom"),bankTransfer:vr("custom"),sdk:vr("custom")};function Cy(e,t,n,r={}){const o=vy[n.type];if(o&&typeof o=="function")return o(e,t,n,r);throw new Error("Invalid Action")}function _y(e,t){const n=`${Bt}/sessions/${t.id}/payments?clientKey=${t.clientKey}`,r={sessionData:t.data,...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal",errorCode:An.makePayments},r)}function wy(e,t){const n=`${Bt}/sessions/${t.id}/paymentDetails?clientKey=${t.clientKey}`,r={...t.data&&{sessionData:t.data},...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal",errorCode:An.submitPaymentDetails},r)}function Sy(e){const t=`${Bt}/sessions/${e.id}/donationCampaigns?clientKey=${e.clientKey}`,n={...e.data&&{sessionData:e.data}};return Ve({loadingContext:e.loadingContext,path:t,errorLevel:"fatal",errorCode:An.donationCampaigns},n)}function ky(e,t){const n=`${Bt}/sessions/${t.id}/donations?clientKey=${t.clientKey}`,r={...t.data&&{sessionData:t.data},...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal",errorCode:An.donations},r)}function Ey(e,t){const n=`${Bt}/sessions/${e.id}/setup?clientKey=${e.clientKey}`,r={browserInfo:t.browserInfo,sessionData:e.data,...t.order?{order:{orderData:t.order.orderData,pspReference:t.order.pspReference}}:{}};return Ve({loadingContext:e.loadingContext,path:n,errorLevel:"fatal"},r)}function xy(e,t){const n=`${Bt}/sessions/${t.id}/paymentMethodBalance?clientKey=${t.clientKey}`,r={sessionData:t.data,...e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal"},r)}function Py(e){const t=`${Bt}/sessions/${e.id}/orders?clientKey=${e.clientKey}`,n={sessionData:e.data};return Ve({loadingContext:e.loadingContext,path:t,errorLevel:"fatal",errorCode:An.createOrder},n)}function Ty(e){if(!e||!e.id)throw new M("IMPLEMENTATION_ERROR","Invalid session");const{shopperLocale:t,shopperEmail:n,telephoneNumber:r,id:o}=e;return{id:o,...e.sessionData?{sessionData:e.sessionData}:{},...t&&{shopperLocale:t},...n&&{shopperEmail:n},...r&&{telephoneNumber:r}}}function Dy(e,t){const n=`${Bt}/sessions/${t.id}/orders/cancel?clientKey=${t.clientKey}`,r={sessionData:t.data,order:e};return Ve({loadingContext:t.loadingContext,path:n,errorLevel:"fatal"},r)}function Mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ay{get shopperLocale(){return this.session.shopperLocale}get id(){return this.session.id}get data(){return this.session.sessionData}set sessionsDonationInitiated(t){this._sessionsDonationInitiated=t}get sessionsDonationInitiated(){return this._sessionsDonationInitiated}updateSessionData(t){this.session.sessionData=t,this.storeSession()}setupSession(t){const n={...t,browserInfo:_o()};return Ey(this,n).then(r=>(r.configuration&&(this.configuration={...r.configuration}),r.sessionData&&this.updateSessionData(r.sessionData),r))}submitPayment(t){return _y(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}submitDetails(t){return wy(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}fetchDonationCampaigns(){return Sy(this).then(t=>(t.sessionData&&this.updateSessionData(t.sessionData),t))}makeDonation(t){return ky(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}checkBalance(t){return xy(t,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}createOrder(){return Py(this).then(t=>(t.sessionData&&this.updateSessionData(t.sessionData),t))}cancelOrder(t){return Dy(t.order,this).then(n=>(n.sessionData&&this.updateSessionData(n.sessionData),n))}getStoredSession(){const t=this.storage.get();return this.id===t?.id?t:this.session}storeSession(){this.storage.set({id:this.session.id,sessionData:this.session.sessionData})}removeStoredSession(){this.storage.remove()}constructor(t,n,r){Mn(this,"storage",void 0),Mn(this,"session",void 0),Mn(this,"clientKey",void 0),Mn(this,"loadingContext",void 0),Mn(this,"configuration",void 0),Mn(this,"_sessionsDonationInitiated",void 0);const o=Ty(t);if(!n)throw new Error("No clientKey available");if(!r)throw new Error("No loadingContext available");this.storage=new dd("session","localStorage"),this.clientKey=n,this.loadingContext=r,this.session=o,this._sessionsDonationInitiated=!1,this.session.sessionData?this.storeSession():this.session=this.getStoredSession()}}function Ha(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ny=class{getImage(t={}){return this.getImageUrl({...t,resourceContext:this.resourceContext})}constructor(t){if(Ha(this,"resourceContext",void 0),Ha(this,"returnImage",({name:n,resourceContext:r,imageFolder:o="",parentFolder:i="",extension:a,size:s="",subFolder:l=""})=>`${r}images/${o}${l}${i}${n}${s}.${a}`),Ha(this,"getImageUrl",({resourceContext:n,extension:r="svg",...o})=>i=>{const a={extension:r,resourceContext:n,imageFolder:"logos/",parentFolder:"",name:i,...o};return this.returnImage(a)}),!t)throw new M("IMPLEMENTATION_ERROR",'Resources module: "environmentsUrls.cdn" is not a valid URL');this.resourceContext=t}};function Iy({setComponentRef:e}){const t=W({});Object.keys(t.current).length||e?.(t.current);const[n,r]=w(null),o=W(null),i=W(0),[a,s]=w(0);return t.current.setMessages=l=>{const c=o.current;l?.length&&c?.length===l.length&&c.every((d,p)=>d===l[p])&&(i.current+=1,s(i.current)),r(l)},o.current=n,n?u(G,null,n.map(l=>u("div",{key:`${a}-${l}`,className:"adyen-checkout-sr-panel__msg"},l))):null}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ka extends ko{get enabled(){return this._enabled}get moveFocus(){return this._moveFocus}setAriaProps(t){if(!this.props.enabled)return;const n=document.querySelector('[class^="adyen-checkout-sr-panel"]');if(n){for(const[r,o]of Object.entries(t))n.setAttribute(r,o);this.props={...this.props,ariaAttributes:{...this.props.ariaAttributes,...t}}}else console.error("SRPanel: Failed to set aria props because no panel was found")}render(){return this.props.enabled?u("div",{className:this.showPanel?"adyen-checkout-sr-panel":"adyen-checkout-sr-panel--sr-only",role:"log",...this.props.ariaAttributes},u(Iy,{setComponentRef:this.setComponentRef})):null}constructor(t,n){if(super(t,n),xt(this,"srPanelContainer",null),xt(this,"id",void 0),xt(this,"showPanel",void 0),xt(this,"_enabled",void 0),xt(this,"_moveFocus",void 0),xt(this,"componentRef",void 0),xt(this,"setComponentRef",r=>{this.componentRef=r}),xt(this,"setMessages",r=>{if(!this.props.enabled)return;let o=null;r&&(o=Array.isArray(r)?r:[r]),this.componentRef.setMessages(o)}),this.id=this.props.id,this.showPanel=!1,this._enabled=!1,this._moveFocus=this.props.moveFocus??!0,this.props.enabled){this._enabled=!0;const r=document.querySelector(this.props.node);if(!r)throw new Error("Component could not mount. Root node was not found.");{const o=document.getElementById(this.id);o&&r.removeChild(o),this.srPanelContainer=document.createElement("div"),this.srPanelContainer.className="sr-panel-holder",this.srPanelContainer.id=this.id,r.appendChild(this.srPanelContainer),this.mount(this.srPanelContainer)}}}}xt(Ka,"type","srPanel"),xt(Ka,"defaultProps",{enabled:!0,node:"body",showPanel:!1,id:"ariaLiveSRPanel",ariaAttributes:{"aria-relevant":"all","aria-live":"polite","aria-atomic":"true"}});function gd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ry={[g.redirect]:br,[g.threeDS2Challenge]:ka,[g.threeDS2DeviceFingerprint]:Ta,[g.donation]:Ia};var Cr=new class{add(...e){this.componentsMap={...this.componentsMap,...this.createComponentsMap(e)}}getComponent(e){return this.componentsMap[e]||(this.supportedTxVariants.has(e)?void 0:br)}createComponentsMap(e){return e.reduce((t,n)=>{var r;return typeof(r=n).type=="string"&&r.type?(n.type==="dropin"||[n.type,...n.txVariants].filter(o=>o).forEach(o=>{t={...t,[o]:n}}),t):(console.error("CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement"),t)},{})}constructor(){gd(this,"componentsMap",Ry),gd(this,"supportedTxVariants",new Set(Object.values(g)))}};const $y={exposeLibraryMetadata:!0,showPayButton:!0};function bd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class My{async fetchTranslationsFromCdn(t){const n=this.matchLocaleWithCdnSupportedLocales(t);if(n==="en-US")return Ma;try{return await rc({loadingContext:this.cdnUrl,errorLevel:"fatal",errorMessage:`Translations: Failed to fetch translations for locale "${n}"`,path:`sdk/${this.sdkVersion}/translations/${n}.json`})}catch(r){return console.warn(`LanguageService - fetchTranslationsFromCdn(): Failed to fetch locale "${n}."`,r),Ma}}matchLocaleWithCdnSupportedLocales(t){return Wl(t,Ji)||bo}constructor({cdnUrl:t,sdkVersion:n}){bd(this,"cdnUrl",void 0),bd(this,"sdkVersion",void 0),this.cdnUrl=t,this.sdkVersion=n}}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Nt{static setBundleType(t){Nt.metadata.bundleType=t}static register(...t){Cr.add(...t)}register(...t){Cr.add(...t)}getComponent(t){return Cr.getComponent(t)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),this.createCoreModules(),this.assignLocaleToCore(),this.requestAnalyticsAttemptId(),await this.requestTranslations(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then(t=>{const{amount:n,shopperLocale:r,countryCode:o,paymentMethods:i,...a}=t;return this.setOptions({...a,amount:this.options.order?this.options.order.remainingAmount:n,locale:this.options.locale||r,countryCode:this.options.countryCode||o}),this.createPaymentMethodsList(i),this}).catch(t=>(this.options.onError&&this.options.onError(t),Promise.reject(t))):(this.createPaymentMethodsList(),Promise.resolve(this))}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new M($i,"You must specify a countryCode when initializing checkout.")}submitDetails(t){let n=null;this.options.onAdditionalDetails&&(n=new Promise((r,o)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:r,reject:o})})),this.session&&(n=this.session.submitDetails(t).catch(r=>(this.options.onError?.(r),Promise.reject(r)))),n?n.then(hr).then(pr).then(this.afterAdditionalDetails).then(r=>{Eo(r),this.options.onPaymentCompleted?.(r)}).catch(r=>{r instanceof To||(Eo(r),this.options.onPaymentFailed?.(r))}):this.options.onError?.(new M("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,n={}){if(!t||!t.type)throw Y(t,"action")&&Y(t,"resultCode")?new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?'):new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property');if(t.type){const r=t.type===rf?`${t.type}${t.subtype}`:t.paymentMethodType,o=new Ze({type:it.action,subType:Ze.getSubtypeFromActionType(t.type),message:`${r} action was handled by the SDK`,component:r});this.modules.analytics.sendAnalytics(o);const i={...this.getCorePropsForComponent(),...n};return Cy(this,Cr,t,i)}return this.handleCreateError()}update(t={},{shouldReinitializeCheckout:n=!0}={}){if(n)return this.setOptions(t),this.initialize().then(()=>(this.components.forEach(i=>{const a={...t.order?.remainingAmount?{amount:t.order.remainingAmount}:{amount:this.options.amount},...this.session&&{session:this.session},...t};i.update(a)}),this));const{amount:r,secondaryAmount:o}=t;return(r||o)&&this.triggerAmountUpdate(r,o),Promise.resolve(this)}triggerAmountUpdate(t,n){ya(t)?!n||ya(n)?(this.setOptions({amount:t,...n&&{secondaryAmount:n}}),this.components.forEach(r=>{r.updateAmount(t,n)})):console.warn("Core update(): Update canceled. Invalid secondary amount object"):console.warn("Core update(): Update canceled. Invalid amount object")}getCorePropsForComponent(){return{...jf(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const n=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(n)}createPaymentMethodsList(t){this.paymentMethodsResponse=new by(this.options.paymentMethodsResponse||t,this.options)}createCoreModules(){this.modules||(this.modules=Object.freeze({risk:new Va(this,{...this.options,loadingContext:this.loadingContext}),analytics:new ey({eventQueue:new ty,service:new ny({analyticsContext:this.analyticsContext,clientKey:this.options.clientKey}),enabled:this.options.analytics?.enabled,analyticsData:this.options.analytics?.analyticsData}),resources:new Ny(this.cdnImagesUrl),i18n:new ry({locale:this.options.locale,customTranslations:this.options.translations,service:new My({cdnUrl:this.cdnTranslationsUrl,sdkVersion:Nt.metadata.version}),onError:this.options?.onError}),srPanel:new Ka(this,{...this.options.srConfig})}))}assignLocaleToCore(){this.options.locale=this.modules.i18n.locale}async requestTranslations(){try{await this.modules.i18n.requestTranslations()}catch(t){console.warn("Core - requestTranslations(): Something went wrong.",t)}}async requestAnalyticsAttemptId(){await this.modules.analytics.setUp({locale:this.options.locale,...this.session?.id&&{sessionId:this.session.id}})}constructor(t){He(this,"session",void 0),He(this,"paymentMethodsResponse",void 0),He(this,"modules",void 0),He(this,"options",void 0),He(this,"analyticsContext",void 0),He(this,"loadingContext",void 0),He(this,"cdnImagesUrl",void 0),He(this,"cdnTranslationsUrl",void 0),He(this,"components",[]),He(this,"afterAdditionalDetails",s=>{if(this.options.afterAdditionalDetails&&s?.action){const l=this.createFromAction(s.action);return this.options.afterAdditionalDetails(l),Promise.reject(new To("Handled by afterAdditionalDetails"))}return Promise.resolve(s)}),He(this,"remove",s=>(this.components=this.components.filter(l=>l._id!==s._id),s.unmount(),this)),He(this,"setOptions",s=>{this.options={...this.options,...s,locale:s?.locale||this.options?.locale,environment:String.prototype.toLowerCase.apply(s?.environment||this.options?.environment)}}),zf(t),this.createFromAction=this.createFromAction.bind(this),this.update=this.update.bind(this),this.setOptions({...$y,...t});const{apiUrl:n,analyticsUrl:r,cdnImagesUrl:o,cdnTranslationsUrl:i}=Kf(this.options.environment,this.options._environmentUrls);this.loadingContext=n,this.analyticsContext=r,this.cdnImagesUrl=o,this.cdnTranslationsUrl=i,this.session=this.options.session&&new Ay(this.options.session,this.options.clientKey,this.loadingContext);const a=this.options.clientKey?.substring(0,4);if((a==="test"||a==="live")&&!this.loadingContext.includes(a))throw new M("IMPLEMENTATION_ERROR",`Error: you are using a ${a} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);a==="pub."&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${this.options.clientKey?.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`),this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=Nt.metadata)}}He(Nt,"metadata",{version:aa,bundleType:ec}),He(Nt,"registry",Cr);async function Fo(e){return await new Nt(e).initialize()}Fo.register=(...e)=>{Nt.register(...e)},Fo.setBundleType=e=>{Nt.setBundleType(e)};function Fn(e){const t=k("div",{class:"fy fy-threeds-overlay",role:"dialog","aria-modal":"true"}),n=k("div",{class:"fy-threeds-box"}),r=k("div",{class:"flex items-center justify-between border-b border-zinc-200 px-4 py-3"}),o=k("div",{class:"flex flex-col gap-0.5"});o.append(k("p",{class:"text-sm font-semibold",text:"Secure authentication"})),e.showWordmark!==!1&&o.append(yn());const i=k("button",{type:"button",class:"rounded-md px-2 py-1 text-sm text-zinc-500 hover:bg-zinc-100",text:"Close"});r.append(o,i);const a=k("div",{class:"relative min-h-0 flex-1 bg-white"});let s=null;e.url&&(s=k("iframe",{src:e.url,title:"3-D Secure authentication",allow:"payment"}),s.style.cssText="width:100%;height:100%;border:0;display:block;",a.append(s)),n.append(r,a),t.append(n),document.body.append(t);const l=d=>{const p=d.data;if(!(!p||typeof p!="object")){if("code"in p&&p.code==="3DS-Success"){c(),e.onSuccess();return}if("code"in p&&p.code==="3DS-Error"){c(),e.onError(p.error?.message||p.resultCode||"3-D Secure failed");return}"success"in p&&p.success===!1&&(c(),e.onError(p.message||"3-D Secure failed"))}};window.addEventListener("message",l);function c(){window.removeEventListener("message",l),t.remove()}return i.addEventListener("click",()=>{c(),e.onError("Authentication cancelled")}),e.mountAdyen&&e.mountAdyen(a),c}function Fy(e){return e==="applepay"?Nn:e==="googlepay"?gr:Do}async function vd(e){const t=e.paymentData.clientKey;if(!t)throw new Error("Adyen client key is missing.");let n=null,r=null;const o=await Fo({clientKey:t,environment:e.paymentData.environment||"test",locale:e.paymentData.locale||"en-US",countryCode:Fr(e.currency),amount:{value:Math.round(e.amount*100),currency:e.currency},onSubmit:async(s,l)=>{if(!s.isValid)return;const c=s.data;await a({paymentMethod:c.paymentMethod,browserInfo:c.browserInfo},l)},onAdditionalDetails:async s=>{const l=s.data;await a({details:l.details,paymentData:l.paymentData},n)},onError:s=>{e.onError(s?.message||"Adyen checkout error")}}),i=Fy(e.methodType);n=new i(o,{showPayButton:!0}).mount(e.container);async function a(s,l){const c=await e.client.confirmPayment(e.paymentId,s);if(!c.ok){e.onError(c.message);return}const d=c.data.paymentData?.action,p=c.data.paymentData?.resultCode;if(d){const h=String(d.type||""),m=Br(d.url);if((h==="redirect"||h==="redirect_iframe")&&m){r=Fn({url:m,showWordmark:e.showWordmark,onSuccess:e.onSuccess,onError:e.onError});return}r=Fn({showWordmark:e.showWordmark,onSuccess:e.onSuccess,onError:e.onError,mountAdyen:f=>{f.append(e.container);try{l?.handleAction?.(d)}catch{f.append("Could not present 3-D Secure challenge.")}}});return}if(p==="Authorised"||c.data.payment.transactionStatus==="Authorised"){e.onSuccess();return}p&&p!=="Pending"&&p!=="Received"&&e.onError(p)}return()=>{r?.(),n?.unmount?.()}}function Cd(e){return String(e||"").toUpperCase()==="ADYEN"}function Ly(e){return e==="applepay"?Nn:e==="googlepay"?gr:Do}async function Oy(e){const t=await e.ctx.client.getClientConfig();let n=null,r=null,o=e.options.existingPaymentId||"";const i=await Fo({clientKey:t.clientKey,environment:t.environment||"test",locale:t.locale||"en-US",countryCode:Fr(e.options.currency),amount:{value:Math.round(e.options.amount*100),currency:e.options.currency},onSubmit:async(c,d)=>{if(!c.isValid)return;const p=c.data,h={...p.paymentMethod||{},type:us(e.method.type)},m=await e.ctx.client.createPayment({amount:e.options.amount,currency:e.options.currency,orderId:e.options.orderId,items:e.options.items,returnUrl:e.options.returnUrl,autoCapture:e.options.autoCapture,metadata:e.options.metadata,existingOrderId:e.options.existingOrderId,existingPaymentId:e.options.existingPaymentId,paymentMethod:e.method,encryptedPaymentMethod:h,browserInfo:p.browserInfo});await l(m,d)},onAdditionalDetails:async c=>{const d=c.data;await s({details:d.details,paymentData:d.paymentData},n)},onError:c=>{e.onError(c?.message||"Adyen checkout error")}}),a=Ly(e.method.type);n=new a(i,{showPayButton:!0}).mount(e.container);async function s(c,d){const p=await e.ctx.client.confirmPayment(o,c);await l(p,d)}async function l(c,d){if(!c.ok){e.onError(c.message);return}o=String(c.data.payment.id||o);const p=c.data.paymentData?.action,h=c.data.paymentData?.resultCode;if(p){const m=String(p.type||""),f=Br(typeof p.url=="string"?p.url:void 0);if((m==="redirect"||h==="RedirectShopper")&&f){window.location.assign(f);return}if(m==="redirect_iframe"&&f){r=Fn({url:f,showWordmark:e.showWordmark,onSuccess:()=>e.onSuccess(o),onError:e.onError});return}r=Fn({showWordmark:e.showWordmark,onSuccess:()=>e.onSuccess(o),onError:e.onError,mountAdyen:y=>{y.append(e.container);try{d?.handleAction?.(p)}catch{y.append("Could not present 3-D Secure challenge.")}}});return}if(h==="Authorised"||c.data.payment.transactionStatus==="Authorised"){e.onSuccess(o);return}h&&h!=="Pending"&&h!=="Received"&&e.onError(h)}return()=>{r?.(),n?.unmount?.()}}function ja(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function By(e){if(Array.isArray(e))return e}function Vy(e){if(Array.isArray(e))return ja(e)}function _d(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){n(c);return}s.done?t(l):Promise.resolve(l).then(r,o)}function _r(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(l){_d(i,r,o,a,s,"next",l)}function s(l){_d(i,r,o,a,s,"throw",l)}a(void 0)})}}function za(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qa(e,t,n){return t&&Uy(e.prototype,t),e}function Wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Hy(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ky(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,s;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(l){i=!0,s=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function jy(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zy(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Wa(e,o,n[o])})}return e}function qy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}function Lo(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qy(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function wd(e,t){return By(e)||Ky(e,t)||kd(e,t)||jy()}function Sd(e){return Vy(e)||Hy(e)||kd(e)||zy()}function wr(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function kd(e,t){if(e){if(typeof e=="string")return ja(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ja(e,t)}}function Sr(e,t){var n,r,o,i,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=c[0]&2?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(c[0]===6&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(d){c=[6,d],r=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var an=(function(e){return e.production="prod",e.demo="demo",e.staging="staging",e})(an||{}),sn="airTracker_unknown",Wy={appName:sn,appVersion:sn,env:"staging",isWebappContainer:!1,delay:2e3,errorRepeatTime:3,enableErrorMonitoring:!1,assetSpeedMonitoringWhiteList:[],enableDetectPageChange:!1,enableRecordPageRetention:!1,hideSearchParams:!1,useSessionStorageForSessionId:!1,assetSpeedMonitoringWhiteListByMFE:{}},Gy={appName:sn,env:"staging",sessionId:sn,deviceId:sn},Yy=function(e){return!e||/^\s*$/.test(e)?!1:(e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@"),e=e.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]"),e=e.replace(/(?:^|:|,)(?:\s*\[)+/g,""),/^[\],:{}\s]*$/.test(e))},Ed=function(){var e=new WeakSet;return function(t,n){if(Ut(n,Error))return"Error.message: ".concat(n.message,`
|
|
140
|
+
Error.stack: `).concat(n.stack);if((typeof n>"u"?"undefined":wr(n))==="object"&&n!==null){if(e.has(n))return"[Circular ".concat(t||"root","]");e.add(n)}return typeof n=="function"?"function":(typeof n>"u"?"undefined":wr(n))==="symbol"?"symbol":typeof n>"u"?null:n}},Ln=function(e){if(typeof e=="string")return e;try{return Ut(e,Error)?(JSON.stringify(e,Ed())||"undefined").replace(/"/gim,""):JSON.stringify(e,Ed())}catch{return'{"error":"error happen when airTracker stringify"}'}},Oo=function(e){var t=e.method,n=t===void 0?"post":t,r=e.url,o=e.data,i=e.success,a=e.fail;if(Yy(o)){var s=new XMLHttpRequest;s.addEventListener("readystatechange",function(){s.readyState===4&&(s.status>=400||s.status===0?a?.(s.response):i?.(s.response))}),s.open(n,r),s.setRequestHeader("Content-Type","application/json"),s.send(o)}},It={onInit:"onInit",onConfigInit:"onConfigInit",onCommonDataInit:"onCommonDataInit",onCommonUpdated:"onCommonUpdated"},xd="AIR_ANALYTICS_DEVICE_ID",Pd="AIR_ANALYTICS_SESSION_ID",Zy="AWX_RISK_ID",Qy=function(e){return e=="prod"?"https://o11y.airwallex.com/airtracker/logs":e=="demo"?"https://o11y-demo.airwallex.com/airtracker/logs":"https://o11y-staging.airwallex.com/airtracker/logs"},Jy=function(e){return e=="prod"?"https://o11y.airwallex.com/airtracker/metrics":e=="demo"?"https://o11y-demo.airwallex.com/airtracker/metrics":"https://o11y-staging.airwallex.com/airtracker/metrics"},Bo=function(){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=Math.random()*16|0,r=t==="x"?n:n&3|8;return r.toString(16)});return e},kr=function(e){var t,n,r;return e.config.getMFEName?e.config.getMFEName():((r=location)===null||r===void 0||(n=r.pathname)===null||n===void 0||(t=n.split("/"))===null||t===void 0?void 0:t[2])||"unknown"},Xy=function(){try{var e=window.sessionStorage.getItem(Pd);return e||(e=Bo(),window.sessionStorage.setItem(Pd,e)),e}catch{return Bo()}},e2=function(){try{var e=window.localStorage.getItem(xd);return e||(e=Bo(),window.localStorage.setItem(xd,e)),e}catch{}},t2=function(){try{var e=window.localStorage.getItem(Zy);return e||void 0}catch{}},n2=function(){var e,t="",n=navigator.userAgent.match(/NetType\/(\w+)/);if(n){var r;r=wd(n,2),t=r[1]}else if(!((e=navigator)===null||e===void 0)&&e.connection){var o,i,a,s;t=((i=navigator)===null||i===void 0||(o=i.connection)===null||o===void 0?void 0:o.effectiveType)||((s=navigator)===null||s===void 0||(a=s.connection)===null||a===void 0?void 0:a.type)}return t||(t="unknown"),r2(t)},r2=function(e){return e=String(e).toLowerCase(),e.indexOf("4g")>=0?"net4g":e.indexOf("wifi")>=0?"wifi":e.indexOf("5g")>=0?"net5g":e.indexOf("3g")>=0?"net3g":e.indexOf("2g")>=0?"net2g":"unknown"},o2=function(){return typeof window.performance<"u"&&typeof window.performance.clearResourceTimings=="function"&&typeof window.performance.getEntriesByType=="function"&&typeof window.performance.now=="function"},i2=function(e){if(typeof e=="string"){var t=e.split("?")[0]||"";return t.slice(0,200)}return e},a2=function(e){return typeof e=="string"?e.split("?")[1]||"":e},s2=function(e){var t=typeof e=="string"&&e.startsWith("//");return t?typeof location<"u"&&location.protocol==="https:":/^https/.test(e)},Td=function(e,t){return typeof e=="number"||typeof e=="string"?e:-1},l2=function(e,t){var n,r=!1;if(!t.config.isWebappContainer)return r=Ga(e,t.config.assetSpeedMonitoringWhiteList),r;var o=kr(t);return r||Ga(e,(n=t.config.assetSpeedMonitoringWhiteListByMFE)===null||n===void 0?void 0:n[o])},Ga=function(e,t){if(!t?.length)return!1;for(var n=0;n<t.length;n++){var r=t[n];if(Ut(r,RegExp)&&r.test(e)||typeof r=="string"&&e.includes(r))return!0}return!1},On=function(e,t){var n=100;return Math.round((e-t)*n)/n},Dd=function(e){return function(t){var n,r,o=kr(e),i=e.config.isWebappContainer?ft({},e.commonData||{},((n=e.MFECommonDataMap)===null||n===void 0?void 0:n[o])||{}):e.commonData,a=Array.isArray(t)?t:[t];if(a.length!==0){var s={commonData:i,data:a},l=Ln(s),c={method:"post",url:Qy(e.commonData.env),data:l};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)=="function"){var d=navigator.sendBeacon(c.url,l);d||Oo(c)}else Oo(c)}}},c2=function(e){return function(t){var n,r,o=kr(e),i=e.config.isWebappContainer?ft({},e.commonData||{},((n=e.MFECommonDataMap)===null||n===void 0?void 0:n[o])||{}):e.commonData,a={commonData:i,data:Array.isArray(t)?t:[t]},s=Ln(a),l={method:"post",url:Jy(e.commonData.env),data:s};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)=="function"){var c=navigator.sendBeacon(l.url,s);c||Oo(l)}else Oo(l)}},Ad=function(e,t){var n,r=[],o=e.config;return window.addEventListener("beforeunload",function(){r.length>0&&(e.immediateSendPipe(r.splice(0,r.length)),n&&clearTimeout(n))}),function(i,a){if(r.push(i),e.lifeCycle.on(It.onCommonUpdated,function(){r.length>0&&(a?.(r.splice(0,r.length)),e.lifeCycle.remove(It.onCommonUpdated),n&&clearTimeout(n))}),r.length>=t){a?.(r.splice(0,r.length)),n&&clearTimeout(n);return}n&&clearTimeout(n),n=setTimeout(function(){n=null,r.length>0&&(a?.(r.splice(0,r.length)),e.lifeCycle.remove(It.onCommonUpdated))},o.delay)}},d2=function(e){var t={};return function(n,r){var o=typeof e.config.errorRepeatTime=="number"?e.config.errorRepeatTime:5;if(o===0)return r?.(n);r?.(n.filter(function(i){return i.severity=="autoDetectError"?(t[i.error]=t[i.error]||0,t[i.error]+=1,!(t[i.error]>o)):!0}))}},Nd=function(){},Id=function(e){if(!e||!e.reduce||!e.length)throw new TypeError("createPipeline need at least one function param");return e.length===1?function(t,n){e[0](t,n||Nd)}:e.reduce(function(t,n){return function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nd;return t(r,function(i){return n?.(i,o)})}})},u2=(function(){function e(){var t=this;za(this,e),this.emit=function(n,r){if(t){var o=t.eventsList[n],i;if(o?.length){o=o.slice();for(var a=0;a<o.length;a++){i=o[a];try{var s=i.callback.apply(t,[r]);if(i.type===1&&t.remove(n,i.callback),s===!1)break}catch(l){throw l}}}return t}},this.eventsList={}}return qa(e,[{key:"indexOf",value:function(n,r){for(var o=0;o<n.length;o++)if(n[o].callback===r)return o;return-1}},{key:"on",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(this){var i=this.eventsList[n];if(i||(this.eventsList[n]=[],i=this.eventsList[n]),this.indexOf(i,r)===-1){var a={name:n,type:o||0,callback:r};return i.push(a),this}return this}}},{key:"one",value:function(n,r){this.on(n,r,1)}},{key:"remove",value:function(n,r){if(this){var o=this.eventsList[n];if(!o)return null;if(!r){try{delete this.eventsList[n]}catch{}return null}if(o.length){var i=this.indexOf(o,r);o.splice(i,1)}return this}}},{key:"clear",value:function(){this.eventsList={}}}]),e})(),Er=(function(){function e(t){za(this,e),this.name="",this.isInit=!1,this.name=t.name,this.option=t}return qa(e,[{key:"patch",value:function(n){if(!this.isInit){var r,o;this.isInit=!0,(o=this.option)===null||o===void 0||(r=o.setUp)===null||r===void 0||r.call(this.option,n)}}},{key:"uninstall",value:function(){var n,r;(r=this.option)===null||r===void 0||(n=r.destroy)===null||n===void 0||n.apply(this),this.isInit=!1}}]),e})(),Vo,Rd=function(e){var t="".concat(Ln(e.message)||""," @ (").concat(Ln(e.filename)||"",":").concat(e.lineno||0,":").concat(e.colno||0,`)
|
|
141
|
+
`).concat(Ln(e.error||""));Vo.normalLogPipeLine({severity:"autoDetectError",eventName:"windowOnError",extraInfo:{error:t}})},$d=function(e){var t=e&&Ln(e.reason);Vo.normalLogPipeLine({severity:"autoDetectError",eventName:"promiseError",extraInfo:{error:t}})},Md=function(e){var t=e?.target||e?.srcElement;if(t){var n=t?.src||t?.href,r=t.tagName,o="unknown";if(typeof n=="string"&&r){if(window.location.href.indexOf(n)>-1)return;if(/\.js$/.test(n))o="script";else if(/\.css$/.test(n))o="css";else switch(r.toLowerCase()){case"script":o="script";break;case"link":o="css";break;case"img":o="image";break;case"audio":case"video":o="media";break;default:return}Vo.normalLogPipeLine({severity:"autoDetectError",eventName:"staticFileLoadError",extraInfo:{staticFileType:o,error:"".concat(r," load fail: ").concat(n)}})}}},h2=new Er({name:"errorDetectionPlugin",setUp:function(e){Vo=e,window.addEventListener("error",Rd),window.addEventListener("unhandledrejection",$d),window.document.addEventListener("error",Md,!0)},destroy:function(){window.removeEventListener("unhandledrejection",$d),window.document.removeEventListener("error",Md,!0),window.removeEventListener("error",Rd)}}),p2=["img","css","script","link","audio","video","iframe"],Ya="resource",m2=function(e){var t=e.name;return{url:i2(t),method:"get",duration:Number(e.duration.toFixed(2)),type:"static",isHttps:s2(t),urlQuery:a2(t),domainLookup:Td(e.domainLookupEnd-e.domainLookupStart),connectTime:Td(e.connectEnd-e.connectStart)}},Za=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];p2.indexOf(o.initiatorType)!==-1&&l2(o.name,t)&&t.normalLogPipeLine({severity:"performance",eventName:"assets_speed",extraInfo:{log:m2(o)}})}},Qa,xr,f2=new Er({name:"assetsSpeedPlugin",setUp:function(e){if(o2()){var t=0;window.performance.onresourcetimingbufferfull=function(){t=0,window.performance.clearResourceTimings()},typeof window.PerformanceObserver=="function"?(Za(window.performance.getEntriesByType(Ya),e),xr=new window.PerformanceObserver(function(n){Za(n.getEntries(),e)}),xr.observe({entryTypes:[Ya]})):Qa=setInterval(function(){var n=window.performance.getEntriesByType(Ya),r=n.slice(t);t=n.length,Za(r,e)},3e3)}},destroy:function(){xr?.disconnect(),Qa&&clearInterval(Qa)}}),Pr,y2=new Er({name:"onPageChangePlugin",setUp:(function(){var e=_r(function(t){var n,r,o,i,a;return Sr(this,function(s){return r=(n=location)===null||n===void 0?void 0:n.href,o=document.querySelector("body"),i=function(l){var c=l.prevHref,d,p,h,m,f;t.normalLogPipeLine({severity:"autoDetectEvent",eventName:"onPageChange",extraInfo:{prevHref:c,href:((d=location)===null||d===void 0?void 0:d.href)||"",hostname:(p=location)===null||p===void 0?void 0:p.hostname,pathName:(h=location)===null||h===void 0?void 0:h.pathname,protocol:(m=location)===null||m===void 0?void 0:m.protocol,search:(f=location)===null||f===void 0?void 0:f.search}})},i({prevHref:""}),Pr=new MutationObserver(function(){if(location.href!==r){var l=r;r=location.href,i({prevHref:l})}}),a={subtree:!0,childList:!0},Pr.observe(o||document,a),[2]})});return function(t){return e.apply(this,arguments)}})(),destroy:function(){Pr?.disconnect()}}),Tr,g2=new Er({name:"onPageRetentionPlugin",setUp:(function(){var e=_r(function(t){var n,r,o,i,a,s,l;return Sr(this,function(c){return typeof document.visibilityState>"u"?[2]:(r=(n=location)===null||n===void 0?void 0:n.href,o=document.querySelector("body"),a=function(){i=Date.now()},a(),document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"?s({href:location.href,leftReason:"visibilityChange"}):document.visibilityState==="visible"&&a()}),window.addEventListener("beforeunload",function(){s({href:location.href,sendImmediate:!0,leftReason:"pageClose"})}),s=function(d){var p=d.href,h=d.sendImmediate,m=d.leftReason;if(i){var f=Date.now()-i;if(f!==0){i=void 0;var y={severity:"autoDetectEvent",eventName:"onPageRetention",extraInfo:{href:p,duration:f,leftReason:m}};if(h){t.ImmediatePipeline(y);return}t.normalLogPipeLine(y)}}},Tr=new MutationObserver(function(){if(location.href!==r){var d=r;r=location.href,s({href:d,leftReason:"nextPage"}),a()}}),l={subtree:!0,childList:!0},Tr.observe(o||document,l),[2])})});return function(t){return e.apply(this,arguments)}})(),destroy:function(){Tr?.disconnect()}}),Fd=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2,15)},Ld=function(e,t){var n=[/^https?:\/\/[^\/]*\.airwallex\.com($|\/)/],r=[/authenticate\/heartbeat/,/papluginlogs\/.*/,/airtracker\/.*/,/o11y(-staging|-demo)?\.airwallex\.com/,/\.(png|jpe?g|gif|svg|ico|webp|avif|css|js|json|woff2?|ttf|eot|map|txt|csv|xml)(\?.*)?(#.*)?$/i];return r.some(function(o){return o.test(e)})?!1:Ga(e,t||n)},b2=function(e){var t=e.startTime,n=e.endTime,r=e.entries;if(r.length!==0){if(r.length===1)return r[0];var o=r.filter(function(i){return i.startTime>=t&&n&&i.responseEnd<=n}).sort(function(i,a){return i.startTime-a.startTime});return o?.[0]}},Od=function(e){return Math.round(e*100)/100},v2=function(e){var t=e.startTime,n=e.duration,r=e.responseStart,o=e.connectEnd,i=e.connectStart,a=e.domainLookupEnd,s=e.domainLookupStart,l=e.requestStart,c=e.secureConnectionStart,d=e.redirectEnd,p=e.redirectStart,h=e.responseStatus,m=e.responseEnd,f=e.encodedBodySize,y=e.decodedBodySize,b=e.transferSize,v=e.deliveryType,C=e.initiatorType;return{startTime:Od(t),totalDuration:Od(n),timeToFirstByte:On(r,t),tcpDuration:On(o,i),dnsDuration:On(a,s),tlsDuration:On(l,c),redirectDuration:On(d,p),responseDuration:On(m,r),encodeResponseSize:f,decodeResponseSize:y,transferSize:b,deliveryType:v,statusCode:h,initiatorType:C}},Bd=function(e,t){var n=e.url,r=e.method,o=e.errorType,i=e.errorDetail,a=b2(e),s=new URL(n,window.location.href),l=s.href,c=s.protocol,d=a?v2(a):{},p={severity:"autoDetectEvent",eventName:"httpClientMetrics",extraInfo:ft(Lo(ft({httpUrl:l,method:r,scheme:c},o&&{errorType:o},i&&{errorDetail:i},d),{statusCode:d?.statusCode||e?.responseStatus,startTime:d?.startTime||e?.startTime,initiatorType:d?.initiatorType||e?.initiatorType}),t)};return p},Vd=function(e){return e&&(typeof e>"u"?"undefined":wr(e))==="object"&&"errors"in e&&Array.isArray(e.errors)&&e.errors.every(function(t){return t&&(typeof t>"u"?"undefined":wr(t))==="object"&&"message"in t})},lt="awx_airtracker_api_performance_queue",Ud="awx_airtracker_api_performance_plugin_loaded",C2=300,_2=1e4,Ke=typeof window<"u"?window:typeof global<"u"?global:{};Ke[lt]=Ke[lt]||[];var Bn=function(e,t,n){setTimeout(function(){var r=Bd(e,n);t.observerPipeline(r),Ke[lt]=Ke[lt].filter(function(o){return o.id!==e.id})},C2)},Hd=function(e,t){setTimeout(function(){var n=Ke[lt].find(function(o){return o.id===e});if(n){var r=Bd(n,{exceptionType:"timeout-without-response"});t.observerPipeline(r),Ke[lt]=Ke[lt].filter(function(o){return o.id!==e})}},_2)},w2=function(e){var t=XMLHttpRequest.prototype.open,n=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(o,i,a,s,l){try{var c,d=Fd();this.__requestId=d;var p=Ut(i,URL)?i.href:new URL(i,window.location.href).href;if(!Ld(p,(c=e.config)===null||c===void 0?void 0:c.enableRecordAPIPerformanceWhitelist))return t.call(this,o,i,a??!0,s,l);var h={id:d,startTime:performance.now(),method:o,url:p,entries:[],initiatorType:"xmlhttprequest"};return Ke[lt].push(h),Hd(d,e),t.call(this,o,i,a??!0,s,l)}catch(m){return e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject XHR open error",error:m}}),t.call(this,o,i,a??!0,s,l)}},XMLHttpRequest.prototype.send=function(){for(var o=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];try{var l=Ke[lt].find(function(d){return d.id===o.__requestId});if(!l)return n.apply(this,a);var c=this;return this.addEventListener("loadend",_r(function(){var d,p,h,m,f,y,b;return Sr(this,function(v){switch(v.label){case 0:if(d=performance.now(),p=d-l.startTime,h=c.status,h===0)return[2];l.endTime=d,l.duration=p,l.responseStatus=h,v.label=1;case 1:return v.trys.push([1,6,,7]),c.responseType===""||c.responseType==="text"?(m=c.responseText,[3,5]):[3,2];case 2:return c.responseType!=="json"?[3,3]:(m=c.response,[3,5]);case 3:return c.responseType!=="blob"?[3,5]:(f=c.response,f?.type!=="application/json"?[3,5]:[4,f.text()]);case 4:m=v.sent(),v.label=5;case 5:return y=m&&typeof m=="string"?JSON.parse(m):m,y&&Vd(y)&&(l.errorType="graphqlError",l.errorDetail=y.errors),[3,7];case 6:return b=v.sent(),e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in XHR",url:l?.url,error:b}}),[3,7];case 7:return Bn(l,e),[2]}})})),this.addEventListener("error",function(){Bn(l,e,{exceptionType:"network-error"})}),this.addEventListener("abort",function(){Bn(l,e,{exceptionType:"abort-error"})}),this.addEventListener("timeout",function(){Bn(l,e,{exceptionType:"timeout-error"})}),n.apply(this,a)}catch(d){throw e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"InjectXHR send error",error:d}}),d}}},S2=function(e){var t=window.fetch;window.fetch=_r(function(){var n,r,o,i,a,s,l,c,d,p,h,m,f,y,b,v,C=arguments;return Sr(this,function(_){switch(_.label){case 0:for(n=C.length,r=new Array(n),o=0;o<n;o++)r[o]=C[o];return s=new URL(Ut(r[0],Request)?r[0].url:String(r[0]),window.location.href).href,Ld(s,(i=e.config)===null||i===void 0?void 0:i.enableRecordAPIPerformanceWhitelist)?[3,2]:[4,t.apply(this,r)];case 1:return[2,_.sent()];case 2:return _.trys.push([2,9,,10]),c=performance.now(),d=Fd(),a={id:d,startTime:c,method:((l=Ut(r[0],Request)?r[0]:r[1])===null||l===void 0?void 0:l.method)||"GET",url:s,entries:[],initiatorType:"fetch"},Ke[lt].push(a),Hd(d,e),[4,t.apply(this,r)];case 3:p=_.sent(),h=performance.now(),a.endTime=h,a.duration=h-c,a.responseStatus=p.status,m=p.clone(),_.label=4;case 4:return _.trys.push([4,7,,8]),m.ok?[4,m.json()]:[3,6];case 5:f=_.sent(),f&&Vd(f)&&(a.errorType="graphqlError",a.errorDetail=f.errors),_.label=6;case 6:return[3,8];case 7:return y=_.sent(),e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in fetch",url:a?.url,error:y}}),[3,8];case 8:return Bn(a,e),[2,p];case 9:throw b=_.sent(),a&&a.id&&Ke[lt].find(function(S){return S.id===a?.id})?(v="fetch-error",Ut(b,TypeError)?v="network-error":Ut(b,DOMException)&&b.name==="AbortError"&&(v="abort-error"),Bn(a,e,{exceptionType:v})):e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject fetch error",error:b}}),b;case 10:return[2]}})})},k2=function(e){var t;if(w2(e),S2(e),!((t=window)===null||t===void 0)&&t.PerformanceObserver){var n=new window.PerformanceObserver(function(r){var o=r.getEntries();o.forEach(function(i){var a=i;if(a.initiatorType==="fetch"||a.initiatorType==="xmlhttprequest"){var s=Ke[lt].filter(function(l){return l.url===a.name});s.forEach(function(l){l.entries.push(a)})}})});n.observe({entryTypes:["resource"],buffered:!0})}else e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{error:"PerformanceObserver Not Supported"}})},E2=new Er({name:"apiPerformancePlugin",setUp:(function(){var e=_r(function(t){var n,r;return Sr(this,function(o){return Ke[Ud]?[2]:(!((n=t.config)===null||n===void 0)&&n.enableRecordAPIPerformance&&Math.random()<(((r=t.config)===null||r===void 0?void 0:r.enableRecordAPIPerformancePercentage)||0)&&(Ke[Ud]=!0,k2(t)),[2])})});return function(t){return e.apply(this,arguments)}})()}),x2="3.1.0",P2=(function(){function e(t){var n=this,r=t.config,o=t.plugins,i=o===void 0?[]:o;za(this,e),this.config=Wy,this.lifeCycle=new u2,this.plugins=[],this._commonData=Gy,this._MFECommonDataMap={},this.timeMap={},this.packedDataConvert=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d,p,h=ft({severity:s,eventName:l,currentHref:n.config.hideSearchParams?(((d=location)===null||d===void 0?void 0:d.href)||"").split("?")[0]||"":((p=location)===null||p===void 0?void 0:p.href)||""},c);return n.config.isWebappContainer&&(h.MFEName=kr(n)),h},this.normalPipelineObj=Id([Ad(this,8),d2(this),Dd(this)]),this.observerPipelineObj=Id([Ad(this,8),c2(this)]),this.immediateSendPipe=Dd(this),this.observerPipeline=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d=n.packedDataConvert({severity:s,eventName:l,extraInfo:c});return n.observerPipelineObj(d)},this.normalLogPipeLine=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d=n.packedDataConvert({severity:s,eventName:l,extraInfo:c});return n.config.disableThrottle?n.immediateSendPipe(d):n.normalPipelineObj(d)},this.ImmediatePipeline=function(a){var s=a.severity,l=a.eventName,c=a.extraInfo,d=n.packedDataConvert({severity:s,eventName:l,extraInfo:c});return n.immediateSendPipe(d)},this.plugins=Sd(i),this.setConfig(r),this.initCommonData(r),this.lifeCycle.emit(It.onInit),r.enableErrorMonitoring&&this.plugins.push(h2),(r?.assetSpeedMonitoringWhiteList&&r.assetSpeedMonitoringWhiteList.length>0||r.isWebappContainer)&&this.plugins.push(f2),r?.enableDetectPageChange&&this.plugins.push(y2),r?.enableRecordPageRetention&&this.plugins.push(g2),r?.enableRecordAPIPerformance&&r?.enableRecordAPIPerformancePercentage&&r.enableRecordAPIPerformancePercentage>0&&r.enableRecordAPIPerformancePercentage<=1&&this.plugins.push(E2),this.installPlugins()}return qa(e,[{key:"installPlugins",value:function(){var n=this;this.plugins.forEach(function(r){r.patch(n)})}},{key:"commonData",get:function(){return this._commonData}},{key:"MFECommonDataMap",get:function(){return this._MFECommonDataMap}},{key:"initCommonData",value:function(n){this._commonData.sessionId=n.useSessionStorageForSessionId?Xy():Bo(),this._commonData.deviceId=e2()||sn,this._commonData.riskDeviceId=t2(),this._commonData.networkType=n2()||"unknown",this._commonData.env=n.env||this._commonData.env,this._commonData.accountId=n.accountId||sn,this._commonData.appVersion=n.appVersion,this._commonData.appName=n.appName,this._commonData.sdkVersion=x2,this.lifeCycle.emit(It.onCommonDataInit,this.commonData)}},{key:"updateCommonDataBasedOnConfig",value:function(n){this.lifeCycle.emit(It.onCommonUpdated,this._commonData),this._commonData.env=n.env||this._commonData.env,this._commonData.appName=n.appName||this._commonData.appName,this._commonData.env=n.env||this._commonData.env,this._commonData.accountId=n.accountId||this._commonData.accountId,this._commonData.appVersion=n.appVersion||this._commonData.appVersion}},{key:"updateCommonData",value:function(n){this.lifeCycle.emit(It.onCommonUpdated,this._commonData),this._commonData=ft({},this._commonData,n)}},{key:"removeCommonDataByKey",value:function(n){var r=this;this.lifeCycle.emit(It.onCommonUpdated,this._commonData),setTimeout(function(){n.forEach(function(o){delete r._commonData[o]})},1e3)}},{key:"addToMFECommonData",value:function(n){var r=n.MFEName,o=n.MFECommonData,i;this.config.isWebappContainer&&(!r||!o||(this._MFECommonDataMap=Lo(ft({},this._MFECommonDataMap||{}),Wa({},r,ft({},((i=this._MFECommonDataMap)===null||i===void 0?void 0:i[r])||{},o)))))}},{key:"setConfig",value:function(n){var r=this;if(!this.config.isWebappContainer){var o=function(i,a){r.config[i]=a};Object.entries(n).forEach(function(i){var a=wd(i,2),s=a[0],l=a[1];(typeof l>"u"?"undefined":wr(l))!==void 0&&o(s,l)}),this.lifeCycle.emit(It.onConfigInit,this.config),this.updateCommonDataBasedOnConfig(n)}}},{key:"verbose",value:function(n,r){this.normalLogPipeLine({severity:"verbose",eventName:n,extraInfo:r})}},{key:"httpLog",value:function(n,r){this.normalLogPipeLine({severity:"http",eventName:n,extraInfo:r})}},{key:"info",value:function(n,r){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:r})}},{key:"warn",value:function(n,r){this.normalLogPipeLine({severity:"warn",eventName:n,extraInfo:r})}},{key:"error",value:function(n,r){console.error("error",n),this.normalLogPipeLine({severity:"error",eventName:n,extraInfo:r})}},{key:"businessLog",value:function(n,r){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:Lo(ft({},r),{isBusinessLog:!0})})}},{key:"reportDuration",value:function(n,r,o){if(typeof n!="string"){console.warn("reportDuration: eventName (first param) must be a string");return}if(typeof r!="number"){console.warn("reportDuration: duration (second param) must be number");return}if(r<0||r>6e4){console.warn("reportDuration: duration (second param) must between 0 and 60000");return}this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:ft({duration:r},o)})}},{key:"getTimerKey",value:function(n){var r=kr(this);return this.config.isWebappContainer?"".concat(r,"_").concat(n):n}},{key:"timeStart",value:function(n){if(typeof n!="string"){console.warn("time: first param must be a string");return}this.timeMap[this.getTimerKey(n)]&&console.warn("Timer ".concat(n," already exists")),this.timeMap[this.getTimerKey(n)]=Date.now()}},{key:"timeEnd",value:function(n,r){if(typeof n!="string"){console.warn("timeEnd: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){var o=Date.now()-this.timeMap[this.getTimerKey(n)]+(r||0);this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:{duration:o}}),delete this.timeMap[this.getTimerKey(n)]}else console.warn("Timer key :".concat(n," does not exist"))}},{key:"addToAssetSpeedWhiteListByMFE",value:function(n){var r=n.MFEName,o=n.whiteList,i;if(this.config.isWebappContainer&&!(!r||!o?.length))if(this.config.assetSpeedMonitoringWhiteListByMFE||(this.config.assetSpeedMonitoringWhiteListByMFE={}),!(!((i=this.config.assetSpeedMonitoringWhiteListByMFE)===null||i===void 0)&&i[r]))this.config.assetSpeedMonitoringWhiteListByMFE=Lo(ft({},this.config.assetSpeedMonitoringWhiteListByMFE),Wa({},r,o));else{var a,s,l;(l=this.config.assetSpeedMonitoringWhiteListByMFE)===null||l===void 0||(s=l[r])===null||s===void 0||(a=s).push.apply(a,Sd(o))}}},{key:"destroy",value:function(){this.config.isWebappContainer||this.plugins.forEach(function(n){n.uninstall()})}}]),e})(),T2=P2,Ja=function(e,t){return Ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Ja(e,t)};function Xa(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ja(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ct=function(){return ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ct.apply(this,arguments)};function Dr(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(d){try{c(r.next(d))}catch(p){a(p)}}function l(d){try{c(r.throw(d))}catch(p){a(p)}}function c(d){d.done?i(d.value):o(d.value).then(s,l)}c((r=r.apply(e,[])).next())})}function Ar(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(d){return l([c,d])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(d){c=[6,d],o=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Kd(e,t,n){for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var D2="1.35.0",A2={version:D2},N2={dev:an.staging,staging:an.staging,demo:an.demo,prod:an.production},I2=function(e,t){return e===void 0&&(e=an.production),window._AirwallexSDKs.airTracker||(window._AirwallexSDKs.airTracker=new T2({config:{appName:"components-sdk",appVersion:A2.version,env:N2[e]||an.production}}),window._AirwallexSDKs.airTracker.updateCommonData({clientId:t})),window._AirwallexSDKs.airTracker},Uo=function(e){if(typeof e!="object")return e;try{var t=JSON.parse(JSON.stringify(e));return Object.keys(t).forEach(function(n){typeof n=="string"&&["auth","code"].some(function(r){return n.includes(r)})&&(t[n]="***")}),t}catch{return e}},ln=function(e,t){var n,r;(r=(n=window._AirwallexSDKs)===null||n===void 0?void 0:n.airTracker)===null||r===void 0||r.error(e,ct(ct({},t),{context:"components-sdk"}))},R2=function(e,t){var n;(n=window._AirwallexSDKs.airTracker)===null||n===void 0||n.warn(e,ct(ct({},t),{context:"components-sdk"}))},Nr=function(e,t){var n;(n=window._AirwallexSDKs.airTracker)===null||n===void 0||n.info(e,ct(ct({},t),{context:"components-sdk"}))},jd=(function(e){Xa(t,e);function t(n){var r=e.call(this,n)||this;return r.code="LOAD_SCRIPT_ERROR",r}return t})(Error),cn,dn,Ee;(function(e){e.dev="dev",e.staging="staging",e.demo="demo",e.prod="prod",e.sandbox="sandbox"})(Ee||(Ee={}));var $2=(cn={},cn[Ee.dev]="https://checkout-staging.airwallex.com",cn[Ee.staging]="https://checkout-staging.airwallex.com",cn[Ee.demo]="https://checkout-demo.airwallex.com",cn[Ee.prod]="https://checkout.airwallex.com",cn[Ee.sandbox]="https://checkout.sandbox.airwallex.com",cn),M2=(dn={},dn[Ee.dev]="https://static-staging.airwallex.com",dn[Ee.staging]="https://static-staging.airwallex.com",dn[Ee.demo]="https://static-demo.airwallex.com",dn[Ee.prod]="https://static.airwallex.com",dn[Ee.sandbox]="https://static.sandbox.airwallex.com",dn),zd="sdkController",qd="payments",F2={kyc:"/widgets/kyc/sdk/v1/index.js",rfi:"/widgets/kycRfi/sdk/v1/index.js",paymentsKyb:"/widgets/paymentsKyb/sdk/v1/index.js",sdkController:"/widgets/sdk-controller/sdk/v1/index.js",payouts:"/widgets/payouts/sdk/v1/index.js",payments:"/assets/elements.bundle.min.js",sca:"/hosted-sca/sdk/v1/index.js",taxForm:"/widgets/taxForm/sdk/v1/index.js",billing:"/widgets/checkout/sdk/v1/index.js"},L2={kyc:"kyc",paymentsKyb:"paymentsKyb",kycRfi:"rfi",transactionRfi:"rfi",paymentEnablementRfi:"rfi",lendingRfi:"rfi",mrmRfi:"rfi",payoutForm:"payouts",beneficiaryForm:"payouts",hpp:"payments",cvc:"payments",card:"payments",expiry:"payments",dropIn:"payments",cardNumber:"payments",applePayButton:"payments",googlePayButton:"payments",krCardNumber:"payments",krCardIdentifier:"payments",krCardExpiry:"payments",krCardPswFirstTwo:"payments",scaSetup:"sca",scaVerify:"sca",scaManagement:"sca",taxForm:"taxForm",embeddedCheckout:"billing"},Wd={payments:["hpp","cvc","card","expiry","dropIn","cardNumber","applePayButton","googlePayButton","krCardNumber","krCardIdentifier","krCardExpiry","krCardPswFirstTwo"],payouts:["payoutForm","beneficiaryForm"],onboarding:["kyc","paymentsKyb"],risk:["scaSetup","scaVerify","scaManagement","transactionRfi","kycRfi","paymentEnablementRfi","lendingRfi","mrmRfi"],billing:["embeddedCheckout"]},O2={billing:["payments"]},Gd=["payments","sca","billing"],B2=(function(e){Xa(t,e);function t(n){var r=e.call(this,n)||this;return r.code="INVALID_STATIC_RESOURCE_ERROR",r}return t})(Error),V2=Date.now(),U2=function(e){return Object.keys(Wd).includes(e)},H2=function(e){return e===void 0&&(e=500),new Promise(function(t){return window.setTimeout(t,e)})},Yd=function(e){return L2[e]},K2=function(e,t){var n=e===qd?$2:M2;return n[t]||n.prod},Zd=function(e){var t=e.reduce(function(n,r){return n.concat(U2(r)?Wd[r]:r)},[]);return Array.from(new Set(t)).map(function(n){return{elementName:n,sdkName:Yd(n)}})},j2=function(e){return Array.from(new Set(Zd(e).map(function(t){var n=t.sdkName;return n}).filter(function(t){return Gd.includes(t)})))},Ir=function(e){return e==="payments"?"payment":e},Qd=function(e){var t=e.name,n=e.env,r=n===void 0?Ee.prod:n,o=K2(t,r),i=F2[t];if(!i)throw ln("[components-sdk] Element static resource not found",{sdkName:t}),new B2("Element ".concat(t," static resource URL is invalid."));return"".concat(o).concat(i,"?ts=").concat(V2)},z2=function(){return Gd.reduce(function(e,t){var n;return ct(ct({},e),(n={},n[t]=window._AirwallexSDKs.__controller__.internalSDKs[t],n))},{})},q2=function(e){return O2[e]||[]},Ht=function(){return Math.floor(performance.now())},W2=function(e){var t=document.createElement("script");t.src=e,t.type="module";var n=document.head||document.body;return n.appendChild(t),t},G2=3,Y2=function(e){return Dr(void 0,void 0,void 0,function(){var t,n;return Ar(this,function(r){switch(r.label){case 0:if(typeof window>"u")throw new Error("Please load script in browser environment");t=0,n=function(){return Dr(void 0,void 0,void 0,function(){var o,i,a;return Ar(this,function(s){return o=Ht(),t>0&&e.includes("?ts=")&&(i=new URL(e,window.location.href),i.searchParams.set("ts","".concat(Date.now())),e=i.toString()),a=W2(e),[2,new Promise(function(l,c){a.addEventListener("load",function(){var d=Ht();Nr("[components-sdk] SDK script loaded",{scriptUrl:e,start:o,latency:d-o,end:d,retryCount:t}),l(!0)}),a.addEventListener("error",function(d){a.remove(),console.error(d);var p=Ht();ln("[components-sdk] Failed to load script",{scriptUrl:e,error:d,start:o,latency:p-o,end:p,retryCount:t}),c(new jd("Failed to load Airwallex SDK scripts: ".concat(e)))})})]})})},r.label=1;case 1:if(!(t<G2))return[3,7];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,n()];case 3:return[2,r.sent()];case 4:return r.sent(),t++,[4,H2()];case 5:return r.sent(),[3,6];case 6:return[3,1];case 7:throw ln("[components-sdk] Failed to load script after retry",{scriptUrl:e,retryCount:t}),new jd("Failed to load Airwallex SDK scripts: ".concat(e))}})})},Jd=(function(e){Xa(t,e);function t(n){var r=e.call(this,n)||this;return r.code="INSTANCE_NOT_FOUND_ERROR",r}return t})(Error),Ho,Xd=new Map,es=function(e){var t=e.env,n=e.scriptName,r=Qd({name:n,env:t}),o=Xd.get(n);if(o)return o;var i=Y2(r);return Xd.set(n,i),i},ts=function(e){var t=e.env,n=e.scriptName;return Dr(void 0,void 0,void 0,function(){var r;return Ar(this,function(o){switch(o.label){case 0:return r=q2(n),r.length>0?[4,Promise.all(r.map(function(i){return es({env:t,scriptName:i})}))]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2,es({env:t,scriptName:n})]}})})},eu=function(e){return Dr(void 0,void 0,void 0,function(){return Ar(this,function(t){if(typeof window>"u")throw new Error("Please call the `init()` function in a browser environment.");return I2(e.env,e.clientId),Nr("[components-sdk] SDK init start",{options:Uo(e),start:Ht()}),Ho=new Promise(function(n,r){var o,i=ct(ct({},e),{env:e.env&&Ee[e.env]?e.env:Ee.prod});window.AirwallexComponentsSDK.__env__=i.env;var a=es({env:i.env,scriptName:zd}).then(function(){return window._AirwallexSDKs.__controller__.init(i)}),s=(o=e.enabledElements)!==null&&o!==void 0?o:[],l=j2(s),c=l.map(function(h){return ts({env:i.env,scriptName:h}).then(function(){return a}).then(function(){var m=window._AirwallexSDKs[Ir(h)];if(!m)throw ln("[components-sdk] SDK instance not found",{functionsNamespace:h,windowSDKInstanceName:Ir(h)}),new Jd("SDK instance not found");return window._AirwallexSDKs.__controller__.registerFunctions({functionsNamespace:h,instance:m})})}),d=Zd(s),p=d.map(function(h){var m=h.sdkName,f=h.elementName;return ts({scriptName:m,env:i.env}).then(function(){return a}).then(function(){var y=window._AirwallexSDKs[Ir(m)];if(!y)throw ln("[components-sdk] SDK instance not found",{sdkName:m,windowSDKInstanceName:Ir(m)}),new Jd("SDK instance not found");return window._AirwallexSDKs.__controller__.registerElement({sdkName:m,elementName:f,instance:y})})});Promise.all(Kd(Kd([a],c,!0),p)).then(function(){Nr("[components-sdk] SDK initialized",{options:Uo(e),start:Ht()}),n(z2())}).catch(function(h){h.code||ln("[components-sdk] Unexpected errors when init",{error:h}),r(h)})}),[2,Ho]})})},Rr=function(e,t){return Dr(void 0,void 0,void 0,function(){var n,r,o,i,a;return Ar(this,function(s){switch(s.label){case 0:if(!e)throw new Error("Element type is missing. Please specify a valid element.");if(Nr("[components-sdk] SDK createElement start",{elementName:e,options:Uo(t),timestamp:Ht()}),!Ho)throw R2("[components-sdk] Did not call init before createElement"),new Error("Please initialize the Element before creating it.");return[4,Ho];case 1:if(s.sent(),n=Yd(e),!n)throw new Error("`createElement()` with type `".concat(e,"` is not supported. Please specify a valid Element type."));r=Ht(),s.label=2;case 2:return s.trys.push([2,6,,7]),[4,ts({scriptName:n,env:window.AirwallexComponentsSDK.__env__||Ee.prod})];case 3:return s.sent(),[4,window._AirwallexSDKs.__controller__.registerElement({sdkName:n,elementName:e,instance:window._AirwallexSDKs[Ir(n)]})];case 4:return s.sent(),[4,window._AirwallexSDKs.__controller__.createElement(e,t)];case 5:return o=s.sent(),i=Ht(),Nr("[components-sdk] SDK createElement being called",{elementName:e,options:Uo(t),start:r,latency:i-r,end:i}),[3,7];case 6:if(a=s.sent(),!a.code)ln("[components-sdk] Unexpected errors when createElement",{error:a});else throw a;return[3,7];case 7:return[2,o]}})})},Z2=[zd,qd],tu=function(){Z2.forEach(function(e){var t=Qd({name:e,env:Ee.prod}),n=document.createElement("link");n.href=t,n.rel="modulepreload",n.as="script";var r=document.head||document.body;r.appendChild(n)})},Q2=typeof document>"u"||typeof window>"u";Q2||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",tu):tu()),typeof window<"u"&&(window.AirwallexComponentsSDK||Object.defineProperties(window,{AirwallexComponentsSDK:{value:{},writable:!1},_AirwallexSDKs:{value:{},writable:!1}}),window.AirwallexComponentsSDK.init=eu,window.AirwallexComponentsSDK.createElement=Rr);const ns={base:{fontSize:"14px",color:"#09090b","::placeholder":{color:"#a1a1aa"}}},J2={visa:"visa",mastercard:"mastercard",amex:"amex",jcb:"jcb",cup:"unionpay"};let rs=null;function nu(e){return rs||(rs=eu({env:Nu(e),enabledElements:["payments"],locale:"en"}).then(()=>{})),rs}async function X2(e){await nu(e.apiBase);const t=Mu("fy-awx-auth"),n=k("div",{class:"h-10 rounded-lg border border-zinc-200 px-3"}),r=k("div",{class:"h-10 rounded-lg border border-zinc-200 px-3"}),o=k("div",{class:"h-10 rounded-lg border border-zinc-200 px-3"}),i=k("form",{class:"mt-4 flex flex-col gap-3"},[os("Card number",n),k("div",{class:"grid grid-cols-2 gap-3"},[os("Expiry",r),os("CVC",o)]),k("div",{id:t})]),a=ei(`Pay ${fn(e.amount,e.currency)}`);i.append(a),e.container.append(i);const s={id:e.intentId,client_secret:e.clientSecret,currency:e.currency},l=e.allowedBrands?.map(m=>J2[m.toLowerCase()]).filter(Boolean),[c,d,p]=await Promise.all([Rr("cardNumber",{intent:s,style:ns,authFormContainer:t,allowedCardNetworks:l?.length?l:void 0,autoCapture:e.autoCapture}),Rr("expiry",{style:ns}),Rr("cvc",{style:ns})]);if(!c||!d||!p)throw new Error("Could not create card input fields.");c.mount(n),d.mount(r),p.mount(o);const h=async m=>{m.preventDefault(),a.disabled=!0;try{await c.confirm({intent_id:e.intentId,client_secret:e.clientSecret}),e.onSuccess()}catch(f){e.onError(f instanceof Error?f.message:"Card payment failed"),a.disabled=!1}};return i.addEventListener("submit",h),a.addEventListener("click",h),()=>{i.removeEventListener("submit",h),c.destroy?.(),d.destroy?.(),p.destroy?.()}}async function e4(e){if(e.wallet==="applepay"&&!Zo())return e.container.append(Oe("Apple Pay is not supported in this browser.")),()=>{};if(e.wallet==="googlepay"&&!Qo())return e.container.append(Oe("Google Pay is not supported in this browser.")),()=>{};await nu(e.apiBase);const t=k("div",{class:"mt-4 min-h-[48px]"}),n=Hn(`Loading ${e.wallet==="applepay"?"Apple Pay":"Google Pay"}…`);e.container.append(n,t);const r=Fr(e.currency),o={value:e.amount,currency:e.currency},i=e.wallet==="applepay"?"applePayButton":"googlePayButton",a=await Rr(i,{intent_id:e.intentId,client_secret:e.clientSecret,countryCode:r,amount:o,autoCapture:e.autoCapture,buttonType:"pay",buttonColor:"black"});if(!a)return n.remove(),e.container.append(Oe("Could not create wallet button.")),()=>{};a.mount(t),n.remove();const s=()=>e.onSuccess(),l=c=>{e.onError(c?.detail?.message||"Wallet payment failed.")};return a.on("success",s),a.on("error",l),()=>{a.destroy?.()}}function os(e,t){return k("label",{class:"flex flex-col gap-1 text-sm font-medium text-zinc-700"},[k("span",{text:e}),t])}function t4(e,t,n){const r=k("p",{class:"mt-2 text-sm text-zinc-500"});e.append(r);function o(){const a=t-Date.now();if(a<=0){r.textContent="This QR code has expired.",n();return}const s=Math.floor(a/1e3),l=Math.floor(s/3600),c=Math.floor(s%3600/60),d=s%60,p=h=>String(h).padStart(2,"0");r.textContent=l>0?`Expires in ${l}:${p(c)}:${p(d)}`:`Expires in ${p(c)}:${p(d)}`}o();const i=window.setInterval(o,1e3);return()=>window.clearInterval(i)}const n4=3e3,r4=7200*1e3,o4=600*1e3,i4={wechatpay:"Open the WeChat app on your phone, scan this QR code, and complete the payment.",paynow:"Open your banking or PayNow app, scan this QR code, and complete the payment.",alipaycn:"Open the Alipay app on your phone, scan this QR code, and complete the payment.",alipayhk:"Open the AlipayHK app on your phone, scan this QR code, and complete the payment.",alipay:"Open the Alipay app on your phone and complete the payment."};function Ko(e){return e.client}function is(e,t){return e.apiVersion==="v2"&&(t==="card"||$s(t))}async function ru(e,t,n){return Ko(e).createPayment({amount:t.amount,currency:t.currency,orderId:t.orderId,items:t.items,returnUrl:t.returnUrl,autoCapture:t.autoCapture,metadata:t.metadata,existingOrderId:t.existingOrderId,existingPaymentId:t.existingPaymentId,paymentMethod:n})}function ou(e){const t=e.result.provider||e.result.payment.platform,n=e.result.paymentData||e.result.paymentIntent||{},r=e.result.paymentIntent||n,o=r?.next_action,i=e.result.paymentData?.action,a=o?.qrcode||i?.qrCodeData,s=o?.type==="redirect_iframe"||i?.type==="redirect_iframe",l=o?.type==="redirect"?o.url:i?.type==="redirect"||i?.type==="redirect_iframe"?typeof i.url=="string"?i.url:void 0:!a&&!s?o?.url:void 0,c=Br(l),d=e.method.type,p=[];if(d==="card"){if(Cd(t)){const f=k("div",{class:"mt-4"});return e.host.append(f),vd({container:f,client:Ko(e.ctx),paymentId:String(e.result.payment.id),methodType:d,paymentData:n,amount:e.options.amount,currency:e.options.currency,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError}).then(y=>p.push(y)).catch(y=>{e.onError(y instanceof Error?y.message:"Failed to load card form")}),()=>p.forEach(y=>y())}const h=r?.id,m=r?.client_secret;return!h||!m?(e.host.append(Oe("Card payment is unavailable — missing payment intent credentials.")),()=>{}):(X2({container:e.host,apiBase:e.ctx.apiBase,intentId:h,clientSecret:m,currency:e.options.currency,amount:e.options.amount,autoCapture:e.options.autoCapture,allowedBrands:e.method.brands,onSuccess:e.onSuccess,onError:e.onError}).then(f=>p.push(f)).catch(f=>{e.onError(f instanceof Error?f.message:"Failed to load card form")}),()=>p.forEach(f=>f()))}if($s(d)){if(Cd(t)){const f=k("div",{class:"mt-4"});return e.host.append(f),vd({container:f,client:Ko(e.ctx),paymentId:String(e.result.payment.id),methodType:d,paymentData:n,amount:e.options.amount,currency:e.options.currency,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError}).then(y=>p.push(y)).catch(y=>{e.onError(y instanceof Error?y.message:"Failed to load wallet")}),()=>p.forEach(y=>y())}const h=r?.id,m=r?.client_secret;return!h||!m?(e.host.append(Oe(`${e.method.name} is unavailable — missing payment intent credentials.`)),()=>{}):(e4({container:e.host,apiBase:e.ctx.apiBase,wallet:d,intentId:h,clientSecret:m,currency:e.options.currency,amount:e.options.amount,autoCapture:e.options.autoCapture,allowedBrands:e.method.brands,onSuccess:e.onSuccess,onError:e.onError}).then(f=>p.push(f)).catch(f=>{e.onError(f instanceof Error?f.message:"Failed to load wallet")}),()=>p.forEach(f=>f()))}if(a&&(Sh(d)||Ms(d)))return a4({host:e.host,ctx:e.ctx,qrcode:a,method:e.method,paymentId:String(e.result.payment.id),onSuccess:e.onSuccess,onError:e.onError});if(Ms(d)&&(c||s)){if(s&&c)return Fn({url:c,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError});if(c)return e.host.append(k("p",{class:"mt-4 text-sm text-zinc-600",text:"Redirecting…"})),window.location.assign(c),()=>{}}if(c)return e.host.append(k("p",{class:"mt-4 text-sm text-zinc-600",text:"Redirecting…"})),window.location.assign(c),()=>{};if(s&&o?.url){const h=Br(o.url);if(h)return Fn({url:h,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError})}return e.host.append(Oe("This payment method could not be displayed.")),()=>{}}function a4(e){const t=e.method.type==="wechatpay"?r4:o4,n=Date.now()+t,r=i4[e.method.type.toLowerCase()]??"Scan this QR code with your mobile app to complete the payment.",o=k("div",{class:"mt-4 flex flex-col items-center"});o.append(Xo(e.method.type,e.method.name)),o.append(k("p",{class:"mt-3 text-sm text-zinc-600 text-center",text:r}));let i=!1,a=!1;const s=k("canvas",{class:"mt-4 rounded-lg border border-zinc-200 bg-white"});try{s4(s,e.qrcode),o.append(s)}catch{return o.append(Oe("Could not display QR code.")),e.host.append(o),()=>{}}const l=k("div");o.append(l);const c=t4(l,n,()=>{i=!0,e.onError("This QR code has expired.")});e.host.append(o);const d=Ko(e.ctx),p=window.setInterval(async()=>{if(i||a)return;const h=await d.getPayment(e.paymentId);if(!h)return;const m=Ch(h);m==="success"?(a=!0,e.onSuccess()):m==="failed"&&(a=!0,e.onError(h.paymentAttempt?.failure_details?.message||_h(h)))},n4);return()=>{c(),window.clearInterval(p)}}function s4(e,t){const n=fh(t,"raw",{ecc:"high",scale:1}),r=e.getContext("2d",{alpha:!1});if(!r)throw new Error("canvas");const o=window.devicePixelRatio||1,i=240;e.width=i*o,e.height=i*o,e.style.width=`${i}px`,e.style.height=`${i}px`,r.scale(o,o),r.fillStyle="#fff",r.fillRect(0,0,i,i);const a=Math.floor(i/n.length),s=Math.floor((i-n.length*a)/2);r.fillStyle="#111";for(let l=0;l<n.length;l++)for(let c=0;c<n[l].length;c++)n[l]?.[c]&&r.fillRect(s+c*a,s+l*a,a,a)}function iu(e){const t=k("div",{class:"mt-4"});e.host.append(t);const n=[];return Oy({container:t,ctx:e.ctx,method:e.method,options:e.options,showWordmark:e.ctx.appearance.showWordmark!==!1,onSuccess:e.onSuccess,onError:e.onError}).then(r=>n.push(r)).catch(r=>{e.onError(r instanceof Error?r.message:"Failed to load payment form")}),()=>n.forEach(r=>r())}class l4 extends Vr{constructor(){super(...arguments),this.methods=[],this.selected=null,this.step="list",this.stopPay=null,this.loading=!1,this.loadingMethods=!1,this.payResult=null}onUnmount(){this.stopPay?.(),this.stopPay=null,super.onUnmount()}render(){if(this.root){if(this.step==="pay"&&this.selected){this.drawPay(this.payResult??void 0);return}if(this.methods.length){this.drawList();return}this.loadingMethods||(this.loadingMethods=!0,this.root.replaceChildren(Hn("Loading payment methods…")),this.ctx.client.getPaymentMethods({amount:this.options.amount,currency:this.options.currency}).then(t=>{this.methods=Jo(ms(t,this.options.allowedPaymentMethods)),this.selected=this.methods[0]??null,this.drawList()}).catch(t=>{this.root&&this.root.replaceChildren(Oe(t instanceof Error?t.message:"Could not load payment methods"))}).finally(()=>{this.loadingMethods=!1}))}}drawList(){if(!this.root)return;if(!this.methods.length){this.root.replaceChildren(Oe("No payment methods are available for this outlet."));return}const t=k("div",{class:"flex flex-col gap-2",role:"radiogroup"});for(const o of this.methods){const i=this.selected?.type===o.type,a=k("button",{type:"button",role:"radio","aria-checked":i?"true":"false",class:Or("flex w-full items-start gap-3 rounded-xl border p-3 text-left transition",i?"border-blue-600 bg-blue-50":"border-zinc-200 hover:border-zinc-300")});a.append(Xo(o.type,o.name));const s=k("div",{class:"min-w-0 flex-1"});s.append(k("p",{class:"text-sm font-medium",text:o.name}));const l=gs(o.brands);l&&s.append(l),a.append(s),a.addEventListener("click",()=>{this.selected=o,this.emit("select",o),this.drawList()}),t.append(a)}const n=ei(this.loading?"Continuing…":"Continue",{disabled:this.loading||!this.selected,onClick:()=>{this.startPay()}}),r=k("div",{class:"flex flex-col gap-4"},[k("h3",{class:"text-base font-semibold",text:"Select a payment method"}),k("p",{class:"text-sm text-zinc-500",text:`Amount due ${fn(this.options.amount,this.options.currency)}`}),t,n]);this.showWordmark&&r.append(k("div",{class:"mt-2 flex justify-center"},[yn()])),this.root.replaceChildren(r)}async startPay(){if(!this.selected||this.loading)return;if(is(this.ctx,this.selected.type)){this.step="pay",this.payResult=null,this.drawPay();return}this.loading=!0,this.drawList();const t=await ru(this.ctx,this.options,this.selected);if(this.loading=!1,!t.ok){this.drawList(),this.root?.append(Oe(t.message)),this.emit("error",{message:t.message});return}this.step="pay",this.payResult=t.data,this.drawPay(t.data)}drawPay(t){if(!this.root||!this.selected)return;this.stopPay?.();const n=ei("← Change payment method",{variant:"ghost",onClick:()=>{this.stopPay?.(),this.stopPay=null,this.payResult=null,this.step="list",this.drawList()}}),r=k("div");if(this.root.replaceChildren(n,k("h3",{class:"mt-2 text-base font-semibold",text:`Pay with ${this.selected.name}`}),k("p",{class:"mt-1 text-sm text-zinc-500",text:`Paying ${fn(this.options.amount,this.options.currency)}`}),r),this.showWordmark&&this.root.append(k("div",{class:"mt-6 flex justify-center"},[yn()])),is(this.ctx,this.selected.type)&&!t){this.stopPay=iu({host:r,ctx:this.ctx,method:this.selected,options:this.options,onSuccess:o=>this.emit("success",{paymentId:o,orderId:this.options.orderId,resultCode:"Authorised",status:"success"}),onError:o=>this.emit("error",{message:o})});return}if(!t){r.append(Hn("Starting payment…")),this.startPay();return}this.stopPay=ou({host:r,ctx:this.ctx,method:this.selected,options:this.options,result:t,onSuccess:()=>this.emit("success",{paymentId:String(t.payment.id),orderId:this.options.orderId,resultCode:"Authorised",status:"success"}),onError:o=>this.emit("error",{message:o})})}}class c4 extends Vr{constructor(){super(...arguments),this.selected=null,this.methods=[],this.loadingMethods=!1}render(){if(this.root){if(this.methods.length){this.drawList(this.methods);return}this.loadingMethods||(this.loadingMethods=!0,this.root.replaceChildren(Hn("Loading payment methods…")),this.ctx.client.getPaymentMethods({amount:this.options.amount,currency:this.options.currency}).then(t=>{this.methods=Jo(ms(t)),this.drawList(this.methods)}).catch(t=>{this.root&&this.root.replaceChildren(Oe(t instanceof Error?t.message:"Could not load payment methods"))}).finally(()=>{this.loadingMethods=!1}))}}drawList(t){if(!this.root)return;if(!t.length){this.root.replaceChildren(Oe("No payment methods are available for this outlet."));return}(!this.selected||!t.some(r=>r.type===this.selected?.type))&&(this.selected=t[0]);const n=k("div",{class:"flex flex-col gap-2",role:"radiogroup"});for(const r of t){const o=this.selected?.type===r.type,i=k("button",{type:"button",role:"radio","aria-checked":o?"true":"false",class:Or("flex w-full items-start gap-3 rounded-xl border p-3 text-left transition",o?"border-blue-600 bg-blue-50":"border-zinc-200 hover:border-zinc-300")});i.append(Xo(r.type,r.name));const a=k("div",{class:"min-w-0 flex-1"});a.append(k("p",{class:"text-sm font-medium",text:r.name}));const s=gs(r.brands);s&&a.append(s),i.append(a),i.addEventListener("click",()=>{this.selected=r,this.emit("select",r),this.emit("change",{paymentMethod:r}),this.drawList(t)}),n.append(i)}this.root.replaceChildren(n)}}class yt extends Vr{constructor(){super(...arguments),this.stopPay=null}withForcedType(t){return this.lockedType=t,this}onUnmount(){this.stopPay?.(),this.stopPay=null,super.onUnmount()}render(){if(!this.root)return;this.stopPay?.();const t=this.options,n=this.resolveMethod(t);if(!n){this.root.replaceChildren(Oe("A paymentMethod is required for this element."));return}if(this.root.replaceChildren(k("div",{class:"flex flex-col gap-2"},[k("h3",{class:"text-base font-semibold",text:`Pay with ${n.name}`}),k("p",{class:"text-sm text-zinc-500",text:`Paying ${fn(t.amount,t.currency)}`}),Hn("Starting payment…")])),is(this.ctx,n.type)){const r=k("div");this.root.replaceChildren(k("h3",{class:"text-base font-semibold",text:`Pay with ${n.name}`}),k("p",{class:"mt-1 text-sm text-zinc-500",text:`Paying ${fn(t.amount,t.currency)}`}),r),this.showWordmark&&this.root.append(k("div",{class:"mt-6 flex justify-center"},[yn()])),this.stopPay=iu({host:r,ctx:this.ctx,method:n,options:t,onSuccess:o=>this.emitSuccess(o,t.orderId),onError:o=>this.emit("error",{message:o})});return}ru(this.ctx,t,n).then(r=>{if(!this.root)return;if(!r.ok){this.root.replaceChildren(Oe(r.message)),this.emit("error",{message:r.message});return}const o=k("div");this.root.replaceChildren(k("h3",{class:"text-base font-semibold",text:`Pay with ${n.name}`}),k("p",{class:"mt-1 text-sm text-zinc-500",text:`Paying ${fn(t.amount,t.currency)}`}),o),this.showWordmark&&this.root.append(k("div",{class:"mt-6 flex justify-center"},[yn()])),this.stopPay=ou({host:o,ctx:this.ctx,method:n,options:t,result:r.data,onSuccess:()=>this.emitSuccess(r.data.payment.id,t.orderId),onError:i=>this.emit("error",{message:i})})})}resolveMethod(t){return this.lockedType?t.paymentMethod??{type:this.lockedType,name:d4(this.lockedType)}:t.paymentMethod??null}emitSuccess(t,n){const r={paymentId:t,orderId:n,resultCode:"Authorised",status:"success"};this.emit("success",r)}}function d4(e){return{card:"Credit Card",applepay:"Apple Pay",googlepay:"Google Pay",paynow:"PayNow",wechatpay:"WeChat Pay",alipay:"Alipay",alipaycn:"Alipay CN",alipayhk:"Alipay HK"}[e]??e}class u4 extends yt{resolveMethod(t){return t.paymentMethod??{type:"card",name:"Credit Card"}}}class h4 extends yt{}class p4 extends yt{}class m4 extends yt{resolveMethod(t){const n=t.paymentMethod;return n||{type:"alipay",name:"Alipay"}}}class f4 extends yt{}class y4 extends yt{constructor(...t){super(...t),this.withForcedType("paynow")}}class g4 extends yt{constructor(...t){super(...t),this.withForcedType("wechatpay")}}class b4 extends yt{constructor(...t){super(...t),this.withForcedType("applepay")}}class v4 extends yt{constructor(...t){super(...t),this.withForcedType("googlepay")}}class C4 extends yt{constructor(...t){super(...t),this.withForcedType("alipaycn")}}class _4 extends yt{constructor(...t){super(...t),this.withForcedType("alipayhk")}}class w4 extends Vr{render(){if(!this.root)return;const t=this.options.status??"pending",o=k("div",{class:"flex flex-col items-center gap-2 py-8 text-center"},[k("h3",{class:`text-lg font-semibold ${t==="success"?"text-emerald-600":t==="failed"?"text-red-600":"text-zinc-600"}`,text:t==="success"?"Payment successful":t==="failed"?"Payment failed":"Payment pending"}),this.options.message?k("p",{class:"text-sm text-zinc-500",text:this.options.message}):null,this.options.paymentId?k("p",{class:"text-xs text-zinc-400",text:`Payment ${this.options.paymentId}`}):null]);this.showWordmark&&o.append(k("div",{class:"mt-4"},[yn()])),this.root.replaceChildren(o)}}function S4(e,t,n){switch(e){case"checkout":return new l4(e,t,n);case"payment-method-list":return new c4(e,t,n);case"card":return new u4(e,t,n);case"qr":return new h4(e,t,n);case"wallet":return new p4(e,t,n);case"alipay":return new m4(e,t,n);case"redirect":return new f4(e,t,n);case"payment-result":return new w4(e,t,n);case"paynow":return new y4(e,t,n);case"wechatpay":return new g4(e,t,n);case"applepay":return new b4(e,t,n);case"googlepay":return new v4(e,t,n);case"alipaycn":return new C4(e,t,n);case"alipayhk":return new _4(e,t,n);default:throw new Error(`[@finyxpay/ui] Unknown element type: "${e}"`)}}function au(e){return e==="v2"?"v2":"v4"}class as{constructor(t){if(this.methodsCache=null,!t.apiKey?.trim())throw new Error("[@finyxpay/ui] A public API key is required.");this.apiKey=t.apiKey.trim(),this.apiBase=Yo(this.apiKey,t.apiBase),this.locale=t.locale??"en",this.appearance={showWordmark:!0,...t.appearance},this.apiVersion=au(t.apiVersion),this.client=Du(this.apiKey,this.apiBase,this.apiVersion),this.apiVersion==="v4"&&this.client.getPaymentMethods().then(n=>{this.methodsCache=n}).catch(()=>{})}context(){return{apiKey:this.apiKey,apiBase:this.apiBase,locale:this.locale,appearance:this.appearance,apiVersion:this.apiVersion,client:this.client}}async createElement(t,n){return S4(t,n,this.context())}async getPaymentMethods(t){if(this.methodsCache)return this.methodsCache;const n=await this.client.getPaymentMethods(t);return this.methodsCache=n,n}}let Kt=null;async function su(e){const t=au(e.apiVersion);return Kt&&Kt.apiKey===e.apiKey.trim()&&Kt.apiVersion===t||(Kt=new as(e)),Kt}function k4(){if(!Kt)throw new Error("[@finyxpay/ui] Call init({ apiKey }) before createElement.");return Kt}async function lu(e,t){return k4().createElement(e,t)}const E4={init:su,createElement:lu,Finyx:as,resolveApiBase:Yo,resolveElementType:Rs};typeof window<"u"&&(window.Finyx=E4),ze.Finyx=as,ze.createElement=lu,ze.filterPaymentMethodsByBrowserSupport=Jo,ze.init=su,ze.isApplePaySupported=Zo,ze.isGooglePaySupported=Qo,ze.resolveApiBase=Yo,ze.resolveElementType=Rs,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})}));
|
|
142
142
|
//# sourceMappingURL=finyx.umd.cjs.map
|