From d6d8f1aa632b8efdab358646a7ee109b3e8ee44b Mon Sep 17 00:00:00 2001 From: Shani <31096696+shanikantsingh@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:38:33 +0200 Subject: [PATCH 1/9] Enabling github actions for SFRA 7 (#1075) * test: support SFRA v7 in e2e tests * test: support SFRA v7 in e2e tests --- .github/workflows/E2E_SFRA.yml | 16 +- tests/playwright/data/environments.mjs | 9 + tests/playwright/fixtures/BRL.spec.mjs | 2 +- tests/playwright/fixtures/DKK.spec.mjs | 2 +- tests/playwright/fixtures/INR.spec.mjs | 2 +- tests/playwright/fixtures/JPY.spec.mjs | 2 +- tests/playwright/fixtures/NOK.spec.mjs | 2 +- tests/playwright/fixtures/SEK.spec.mjs | 2 +- tests/playwright/fixtures/USD.spec.mjs | 18 +- .../fixtures/countriesEUR/AT.spec.mjs | 4 +- .../fixtures/countriesEUR/BE.spec.mjs | 4 +- .../fixtures/countriesEUR/DE.spec.mjs | 4 +- .../fixtures/countriesEUR/FR.spec.mjs | 12 +- .../fixtures/countriesEUR/NL.spec.mjs | 8 +- .../fixtures/countriesEUR/PT.spec.mjs | 6 +- tests/playwright/package-lock.json | 1346 ++++++++++++----- 16 files changed, 997 insertions(+), 442 deletions(-) diff --git a/.github/workflows/E2E_SFRA.yml b/.github/workflows/E2E_SFRA.yml index 2f597d8da..570e24881 100644 --- a/.github/workflows/E2E_SFRA.yml +++ b/.github/workflows/E2E_SFRA.yml @@ -15,11 +15,17 @@ jobs: matrix: include: - sfra-version: 'v5.3.0' + node-version: '14' sfcc-hostname-secret: 'SFCC_HOSTNAME_SFRA5' code-version-secret: 'SFCC_CODE_VERSION_SFRA5' - sfra-version: 'v6.1.0' + node-version: '14' sfcc-hostname-secret: 'SFCC_HOSTNAME_SFRA6' code-version-secret: 'SFCC_CODE_VERSION_SFRA6' + - sfra-version: 'v7.0.0' + node-version: '18' + sfcc-hostname-secret: 'SFCC_HOSTNAME_SFRA7' + code-version-secret: 'SFCC_CODE_VERSION_SFRA7' steps: - name: Checkout SFRA code uses: actions/checkout@v3 @@ -31,7 +37,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '14' + node-version: ${{ matrix.node-version }} - name: Checkout uses: actions/checkout@v3 with: @@ -75,16 +81,22 @@ jobs: matrix: include: - sfra-version: 'v5.3.0' + node-version: '16' sfcc-hostname-secret: 'SFCC_STOREFRONT_URL_SFRA5' code-version-secret: 'SFCC_CODE_VERSION_SFRA5' - sfra-version: 'v6.1.0' + node-version: '16' sfcc-hostname-secret: 'SFCC_STOREFRONT_URL_SFRA6' code-version-secret: 'SFCC_CODE_VERSION_SFRA6' + - sfra-version: 'v7.0.0' + node-version: '18' + sfcc-hostname-secret: 'SFCC_STOREFRONT_URL_SFRA7' + code-version-secret: 'SFCC_CODE_VERSION_SFRA7' steps: - name: setup Node uses: actions/setup-node@v3 with: - node-version: '16' + node-version: ${{ matrix.node-version }} - name: Checkout uses: actions/checkout@v3 with: diff --git a/tests/playwright/data/environments.mjs b/tests/playwright/data/environments.mjs index b072e9b31..490f0617a 100644 --- a/tests/playwright/data/environments.mjs +++ b/tests/playwright/data/environments.mjs @@ -23,4 +23,13 @@ if (process.env.SFRA_VERSION === 'v6.1.0') { }); } +if (process.env.SFRA_VERSION === 'v7.0.0') { + environments.push({ + name: 'SFRA v7.0.0', + CheckoutPage: CheckoutPageSFRA6, + urlExtension: '/s/RefArch/home', + AccountPage: AccountPageSFRA, + }); +} + diff --git a/tests/playwright/fixtures/BRL.spec.mjs b/tests/playwright/fixtures/BRL.spec.mjs index 10482c2be..813d0efbd 100644 --- a/tests/playwright/fixtures/BRL.spec.mjs +++ b/tests/playwright/fixtures/BRL.spec.mjs @@ -24,7 +24,7 @@ for (const environment of environments) { await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.BR); await checkoutPage.setShopperDetails(shopperData.BR); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/DKK.spec.mjs b/tests/playwright/fixtures/DKK.spec.mjs index 674555249..e24b70422 100644 --- a/tests/playwright/fixtures/DKK.spec.mjs +++ b/tests/playwright/fixtures/DKK.spec.mjs @@ -17,7 +17,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.DK); await checkoutPage.setShopperDetails(shopperData.DK); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/INR.spec.mjs b/tests/playwright/fixtures/INR.spec.mjs index 00858d94a..b8cdb4371 100644 --- a/tests/playwright/fixtures/INR.spec.mjs +++ b/tests/playwright/fixtures/INR.spec.mjs @@ -17,7 +17,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.IN); await checkoutPage.setShopperDetails(shopperData.IN); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/JPY.spec.mjs b/tests/playwright/fixtures/JPY.spec.mjs index 69a6e1784..abd8dad8e 100644 --- a/tests/playwright/fixtures/JPY.spec.mjs +++ b/tests/playwright/fixtures/JPY.spec.mjs @@ -16,7 +16,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.JP); await checkoutPage.setShopperDetails(shopperData.JP); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/NOK.spec.mjs b/tests/playwright/fixtures/NOK.spec.mjs index 93eb005f5..65f9c7c7a 100644 --- a/tests/playwright/fixtures/NOK.spec.mjs +++ b/tests/playwright/fixtures/NOK.spec.mjs @@ -17,7 +17,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.NO); await checkoutPage.setShopperDetails(shopperData.NO); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/SEK.spec.mjs b/tests/playwright/fixtures/SEK.spec.mjs index 59e58820a..60a48c0c0 100644 --- a/tests/playwright/fixtures/SEK.spec.mjs +++ b/tests/playwright/fixtures/SEK.spec.mjs @@ -20,7 +20,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.SE); await checkoutPage.setShopperDetails(shopperData.SE); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/USD.spec.mjs b/tests/playwright/fixtures/USD.spec.mjs index 13fd5dfa4..dba1ec5e6 100644 --- a/tests/playwright/fixtures/USD.spec.mjs +++ b/tests/playwright/fixtures/USD.spec.mjs @@ -36,8 +36,8 @@ for (const environment of environments) { await page.goto(`${environment.urlExtension}`); await goToBillingWithFullCartGuestUser(); - // SFRA 6 email setting flow is different - if (environment.name.indexOf('v6') === -1) { + // SFRA 5 email setting flow is different + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); } }); @@ -95,7 +95,7 @@ for (const environment of environments) { test('GiftCard Only Success @quick', async () => { await goToBillingWithFullCartGuestUser(); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; await cards.doGiftCardPayment(cardData.giftCard); @@ -105,7 +105,7 @@ for (const environment of environments) { test('GiftCard & Card Success @quick', async () => { await goToBillingWithFullCartGuestUser(3); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; await cards.doGiftCardPayment(cardData.giftCard); @@ -116,7 +116,7 @@ for (const environment of environments) { test('Remove Gift Card', async ({ page }) => { await goToBillingWithFullCartGuestUser(3); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); } await cards.doGiftCardPayment(cardData.giftCard); @@ -135,7 +135,7 @@ for (const environment of environments) { await page.goto(`/s/RefArch/25720033M.html?lang=${locale}`); await page.locator('.add-to-cart').click(); await checkoutPage.navigateToCheckout(regionsEnum.US); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.checkoutGuest.click(); } await checkoutPage.submitShipping(); @@ -155,7 +155,7 @@ for (const environment of environments) { test('Affirm Fail', async ({ page }) => { redirectShopper = new RedirectShopper(page); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; await redirectShopper.doAffirmPayment(shopperData.US); @@ -165,7 +165,7 @@ for (const environment of environments) { }); test.skip('CashApp Renders', async ({ page }) => { - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; await new PaymentMethodsPage(page).initiateCashAppPayment(); @@ -180,7 +180,7 @@ for (const environment of environments) { accountPage = new environment.AccountPage(page); cards = new Cards(page); await goToBillingWithFullCartLoggedInUser(); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/countriesEUR/AT.spec.mjs b/tests/playwright/fixtures/countriesEUR/AT.spec.mjs index 733c9ab44..2527fc5ac 100644 --- a/tests/playwright/fixtures/countriesEUR/AT.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/AT.spec.mjs @@ -16,8 +16,8 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.AT); - // SFRA 6 email setting flow is different - if (environment.name.indexOf('v6') === -1) { + // SFRA 5 email setting flow is different + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/countriesEUR/BE.spec.mjs b/tests/playwright/fixtures/countriesEUR/BE.spec.mjs index 6c9301bd2..f6ab2ce97 100644 --- a/tests/playwright/fixtures/countriesEUR/BE.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/BE.spec.mjs @@ -21,8 +21,8 @@ for (const environment of environments) { cards = new Cards(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.BE); - // SFRA 6 email setting flow is different - if (environment.name.indexOf('v6') === -1) { + // SFRA 5 email setting flow is different + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/countriesEUR/DE.spec.mjs b/tests/playwright/fixtures/countriesEUR/DE.spec.mjs index 5eab553c5..1100ce836 100644 --- a/tests/playwright/fixtures/countriesEUR/DE.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/DE.spec.mjs @@ -18,8 +18,8 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.DE); - // SFRA 6 email setting flow is different - if (environment.name.indexOf('v6') === -1) { + // SFRA 5 email setting flow is different + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); diff --git a/tests/playwright/fixtures/countriesEUR/FR.spec.mjs b/tests/playwright/fixtures/countriesEUR/FR.spec.mjs index 164524219..823954b34 100644 --- a/tests/playwright/fixtures/countriesEUR/FR.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/FR.spec.mjs @@ -20,7 +20,7 @@ for (const environment of environments) { }); test('Oney Success', async ({ page }) => { // Skipping the test for SFRA5 - if (environment.name.indexOf('v6') === -1) test.skip(); + if (environment.name.indexOf('v5') !== -1) test.skip(); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU, 4); await checkoutPage.setShopperDetails(shopperData.FR); @@ -34,8 +34,8 @@ for (const environment of environments) { test('Oney Fail', async ({ page }) => { await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU, 1); await checkoutPage.setShopperDetails(shopperData.FR); - // SFRA 6 email setting flow is different - if (environment.name.indexOf('v6') === -1) { + // SFRA 5 email setting flow is different + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; redirectShopper = new RedirectShopper(page); @@ -55,7 +55,7 @@ test.describe.parallel(`${environment.name} EUR FR`, () => { test('No 3DS Amazon Pay @quick', async ({ page }) => { await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.FR); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); } redirectShopper = new RedirectShopper(page); @@ -67,7 +67,7 @@ test.describe.parallel(`${environment.name} EUR FR`, () => { test('3DS2 Amazon Pay', async ({ page }) => { await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.FR); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); } redirectShopper = new RedirectShopper(page); @@ -90,7 +90,7 @@ test.describe.parallel(`${environment.name} EUR FR`, () => { test('Amazon Pay Failure', async ({ page }) => { await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.FR); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); } redirectShopper = new RedirectShopper(page); diff --git a/tests/playwright/fixtures/countriesEUR/NL.spec.mjs b/tests/playwright/fixtures/countriesEUR/NL.spec.mjs index 693cbfc25..f495754e9 100644 --- a/tests/playwright/fixtures/countriesEUR/NL.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/NL.spec.mjs @@ -18,7 +18,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.NL); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); @@ -59,7 +59,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.NL); - if (environment.name.indexOf("v6") === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); @@ -94,8 +94,8 @@ for (const environment of environments) { test('Google Pay Success', async ({ page }) => { pendingPayments = new PendingPayments(page); - // SFRA 6 email setting flow is different - if (environment.name.indexOf("v6") === -1) { + // SFRA 5 email setting flow is different + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); } await pendingPayments.doGooglePayPayment(); diff --git a/tests/playwright/fixtures/countriesEUR/PT.spec.mjs b/tests/playwright/fixtures/countriesEUR/PT.spec.mjs index a8df84f57..f0711cb7e 100644 --- a/tests/playwright/fixtures/countriesEUR/PT.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/PT.spec.mjs @@ -18,7 +18,7 @@ for (const environment of environments) { checkoutPage = new environment.CheckoutPage(page); await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU); await checkoutPage.setShopperDetails(shopperData.PT); - if (environment.name.indexOf('v6') === -1) { + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); }; }); @@ -37,8 +37,8 @@ for (const environment of environments) { test.fixme('MBWay Success', async ({ page }) => { pendingPayments = new PendingPayments(page); - // SFRA 6 email setting flow is different - if (environment.name.indexOf("v6") === -1) { + // SFRA 5 email setting flow is different + if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); } await pendingPayments.doMBWayPayment(); diff --git a/tests/playwright/package-lock.json b/tests/playwright/package-lock.json index 0d43fcc6f..b71140fce 100644 --- a/tests/playwright/package-lock.json +++ b/tests/playwright/package-lock.json @@ -1,629 +1,962 @@ { "name": "adyen_salesforce_e2e_tests", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@babel/code-frame": { + "packages": { + "": { + "name": "adyen_salesforce_e2e_tests", + "version": "1.0.0", + "dependencies": { + "agent-base": "^6.0.2", + "ansi-regex": "^5.0.1", + "ansi-styles": "^3.2.1", + "babel-plugin-dynamic-import-node": "^2.3.3", + "balanced-match": "^1.0.2", + "brace-expansion": "^1.1.11", + "braces": "^3.0.2", + "browserslist": "^4.20.3", + "buffer-crc32": "^0.2.13", + "call-bind": "^1.0.2", + "caniuse-lite": "^1.0.30001342", + "chalk": "^2.4.2", + "color-convert": "^1.9.3", + "color-name": "^1.1.3", + "colors": "1.4.0", + "commander": "^8.3.0", + "concat-map": "^0.0.1", + "convert-source-map": "^1.8.0", + "debug": "^4.3.3", + "define-lazy-prop": "^2.0.0", + "define-properties": "^1.1.4", + "diff-sequences": "^27.5.1", + "electron-to-chromium": "^1.4.137", + "end-of-stream": "^1.4.4", + "escalade": "^3.1.1", + "escape-string-regexp": "^1.0.5", + "expect": "^27.2.5", + "extract-zip": "^2.0.1", + "fd-slicer": "^1.1.0", + "fill-range": "^7.0.1", + "fs.realpath": "^1.0.0", + "function-bind": "^1.1.1", + "gensync": "^1.0.0-beta.2", + "get-intrinsic": "^1.1.1", + "get-stream": "^5.2.0", + "glob": "^7.2.3", + "globals": "^11.12.0", + "graceful-fs": "^4.2.10", + "has": "^1.0.3", + "has-flag": "^3.0.0", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "https-proxy-agent": "^5.0.0", + "inflight": "^1.0.6", + "inherits": "^2.0.4", + "ip": "^1.1.8", + "is-docker": "^2.2.1", + "is-number": "^7.0.0", + "is-wsl": "^2.2.0", + "jest-diff": "^27.5.1", + "jest-get-type": "^27.5.1", + "jest-matcher-utils": "^27.2.5", + "jest-message-util": "^27.5.1", + "jest-regex-util": "^27.5.1", + "jpeg-js": "^0.4.3", + "js-tokens": "^4.0.0", + "jsesc": "^2.5.2", + "json5": "^2.2.1", + "micromatch": "^4.0.5", + "mime": "^3.0.0", + "minimatch": "^3.0.4", + "ms": "^2.1.3", + "node-releases": "^2.0.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "once": "^1.4.0", + "open": "^8.4.0", + "path-is-absolute": "^1.0.1", + "pend": "^1.2.0", + "picocolors": "^1.0.0", + "picomatch": "^2.3.1", + "pirates": "^4.0.4", + "pixelmatch": "^5.2.1", + "playwright-core": "^1.21.0", + "pngjs": "^6.0.0", + "pretty-format": "^27.5.1", + "progress": "^2.0.3", + "proper-lockfile": "^4.1.2", + "proxy-from-env": "^1.1.0", + "pump": "^3.0.0", + "react-is": "^17.0.2", + "retry": "^0.12.0", + "rimraf": "^3.0.2", + "safe-buffer": "^5.1.2", + "semver": "^6.3.0", + "signal-exit": "^3.0.7", + "slash": "^3.0.0", + "smart-buffer": "^4.2.0", + "socks": "^2.6.2", + "socks-proxy-agent": "^6.1.1", + "source-map": "^0.5.7", + "source-map-support": "^0.4.18", + "stack-utils": "^2.0.5", + "supports-color": "^5.5.0", + "to-fast-properties": "^2.0.0", + "to-regex-range": "^5.0.1", + "wrappy": "^1.0.2", + "ws": "^8.4.2", + "yauzl": "^2.10.0", + "yazl": "^2.5.1" + }, + "devDependencies": { + "@playwright/test": "^1.38.0" + } + }, + "node_modules/@babel/code-frame": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "requires": { + "dependencies": { "@babel/highlight": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/helper-validator-identifier": { + "node_modules/@babel/helper-validator-identifier": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==" + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "engines": { + "node": ">=6.9.0" + } }, - "@babel/highlight": { + "node_modules/@babel/highlight": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "requires": { + "dependencies": { "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "@jest/types": { + "node_modules/@jest/types": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", - "requires": { + "dependencies": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", "@types/yargs": "^16.0.0", "chalk": "^4.0.0" }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "@playwright/test": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.33.0.tgz", - "integrity": "sha512-YunBa2mE7Hq4CfPkGzQRK916a4tuZoVx/EpLjeWlTVOnD4S2+fdaQZE0LJkbfhN5FTSKNLdcl7MoT5XB37bTkg==", - "dev": true, - "requires": { - "@types/node": "*", - "fsevents": "2.3.2", - "playwright-core": "1.33.0" + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { - "playwright-core": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.33.0.tgz", - "integrity": "sha512-aizyPE1Cj62vAECdph1iaMILpT0WUDCq3E6rW6I+dleSbBoGbktvJtzS6VHkZ4DKNEOG9qJpiom/ZxO+S15LAw==", - "dev": true - } + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@playwright/test": { + "version": "1.43.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.1.tgz", + "integrity": "sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA==", + "dev": true, + "dependencies": { + "playwright": "1.43.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" } }, - "@types/istanbul-lib-coverage": { + "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==" }, - "@types/istanbul-lib-report": { + "node_modules/@types/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", - "requires": { + "dependencies": { "@types/istanbul-lib-coverage": "*" } }, - "@types/istanbul-reports": { + "node_modules/@types/istanbul-reports": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", - "requires": { + "dependencies": { "@types/istanbul-lib-report": "*" } }, - "@types/node": { + "node_modules/@types/node": { "version": "18.11.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" }, - "@types/stack-utils": { + "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==" }, - "@types/yargs": { + "node_modules/@types/yargs": { "version": "16.0.4", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", - "requires": { + "dependencies": { "@types/yargs-parser": "*" } }, - "@types/yargs-parser": { + "node_modules/@types/yargs-parser": { "version": "21.0.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==" }, - "@types/yauzl": { + "node_modules/@types/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", "optional": true, - "requires": { + "dependencies": { "@types/node": "*" } }, - "agent-base": { + "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { + "dependencies": { "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" } }, - "ansi-regex": { + "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } }, - "ansi-styles": { + "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { + "dependencies": { "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "babel-plugin-dynamic-import-node": { + "node_modules/babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "requires": { + "dependencies": { "object.assign": "^4.1.0" } }, - "balanced-match": { + "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "braces": { + "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { + "dependencies": { "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" } }, - "browserslist": { + "node_modules/browserslist": { "version": "4.21.4", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", - "requires": { + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { "caniuse-lite": "^1.0.30001400", "electron-to-chromium": "^1.4.251", "node-releases": "^2.0.6", "update-browserslist-db": "^1.0.9" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "buffer-crc32": { + "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==" + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "engines": { + "node": "*" + } }, - "call-bind": { + "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { + "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "caniuse-lite": { + "node_modules/caniuse-lite": { "version": "1.0.30001431", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz", - "integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==" + "integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] }, - "chalk": { + "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { + "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "color-convert": { + "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - }, "dependencies": { - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - } + "color-name": "1.1.3" } }, - "color-name": { + "node_modules/color-convert/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "colors": { + "node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "engines": { + "node": ">=0.1.90" + } }, - "commander": { + "node_modules/commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==" + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "engines": { + "node": ">= 12" + } }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "convert-source-map": { + "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, - "debug": { + "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { + "dependencies": { "ms": "2.1.2" }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true } } }, - "define-lazy-prop": { + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==" + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "engines": { + "node": ">=8" + } }, - "define-properties": { + "node_modules/define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "requires": { + "dependencies": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "diff-sequences": { + "node_modules/diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", - "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==" + "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } }, - "electron-to-chromium": { + "node_modules/electron-to-chromium": { "version": "1.4.284", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==" }, - "end-of-stream": { + "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { + "dependencies": { "once": "^1.4.0" } }, - "escalade": { + "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } }, - "escape-string-regexp": { + "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } }, - "expect": { + "node_modules/expect": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/expect/-/expect-27.5.1.tgz", "integrity": "sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw==", - "requires": { + "dependencies": { "@jest/types": "^27.5.1", "jest-get-type": "^27.5.1", "jest-matcher-utils": "^27.5.1", "jest-message-util": "^27.5.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "extract-zip": { + "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "requires": { - "@types/yauzl": "^2.9.1", + "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" } }, - "fd-slicer": { + "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "requires": { + "dependencies": { "pend": "~1.2.0" } }, - "fill-range": { + "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { + "dependencies": { "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "fsevents": { + "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "optional": true + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } }, - "function-bind": { + "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, - "gensync": { + "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } }, - "get-intrinsic": { + "node_modules/get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", - "requires": { + "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "get-stream": { + "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "requires": { + "dependencies": { "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "glob": { + "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "requires": { + "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "globals": { + "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } }, - "graceful-fs": { + "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, - "has": { + "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { + "dependencies": { "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" } }, - "has-flag": { + "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } }, - "has-property-descriptors": { + "node_modules/has-property-descriptors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "requires": { + "dependencies": { "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "has-symbols": { + "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "https-proxy-agent": { + "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "requires": { + "dependencies": { "agent-base": "6", "debug": "4" + }, + "engines": { + "node": ">= 6" } }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "requires": { + "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ip": { + "node_modules/ip": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" }, - "is-docker": { + "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==" + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "is-number": { + "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } }, - "is-wsl": { + "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "requires": { + "dependencies": { "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" } }, - "jest-diff": { + "node_modules/jest-diff": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", - "requires": { + "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^27.5.1", "jest-get-type": "^27.5.1", "pretty-format": "^27.5.1" }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "jest-get-type": { + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-diff/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-diff/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-get-type": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==" + "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } }, - "jest-matcher-utils": { + "node_modules/jest-matcher-utils": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz", "integrity": "sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==", - "requires": { + "dependencies": { "chalk": "^4.0.0", "jest-diff": "^27.5.1", "jest-get-type": "^27.5.1", "pretty-format": "^27.5.1" }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" } }, - "jest-message-util": { + "node_modules/jest-matcher-utils/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-message-util": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", - "requires": { + "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^27.5.1", "@types/stack-utils": "^2.0.0", @@ -634,378 +967,579 @@ "slash": "^3.0.0", "stack-utils": "^2.0.3" }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-message-util/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-message-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "jest-regex-util": { + "node_modules/jest-regex-util": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", - "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==" + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } }, - "jpeg-js": { + "node_modules/jpeg-js": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==" }, - "js-tokens": { + "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, - "jsesc": { + "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } }, - "json5": { + "node_modules/json5": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==" + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } }, - "micromatch": { + "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "requires": { + "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" } }, - "mime": { + "node_modules/mime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==" + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } }, - "minimatch": { + "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { + "dependencies": { "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "ms": { + "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "node-releases": { + "node_modules/node-releases": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==" }, - "object-keys": { + "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } }, - "object.assign": { + "node_modules/object.assign": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "requires": { + "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { + "dependencies": { "wrappy": "1" } }, - "open": { + "node_modules/open": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "requires": { + "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } }, - "pend": { + "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" }, - "picocolors": { + "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, - "picomatch": { + "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } }, - "pirates": { + "node_modules/pirates": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", - "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==" + "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "engines": { + "node": ">= 6" + } }, - "pixelmatch": { + "node_modules/pixelmatch": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-5.3.0.tgz", "integrity": "sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==", - "requires": { + "dependencies": { "pngjs": "^6.0.0" + }, + "bin": { + "pixelmatch": "bin/pixelmatch" + } + }, + "node_modules/playwright": { + "version": "1.43.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.1.tgz", + "integrity": "sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA==", + "dev": true, + "dependencies": { + "playwright-core": "1.43.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } }, - "playwright-core": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.28.0.tgz", - "integrity": "sha512-nJLknd28kPBiCNTbqpu6Wmkrh63OEqJSFw9xOfL9qxfNwody7h6/L3O2dZoWQ6Oxcm0VOHjWmGiCUGkc0X3VZA==" + "node_modules/playwright-core": { + "version": "1.43.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.1.tgz", + "integrity": "sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg==", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } }, - "pngjs": { + "node_modules/pngjs": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", - "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==" + "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", + "engines": { + "node": ">=12.13.0" + } }, - "pretty-format": { + "node_modules/pretty-format": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", - "requires": { + "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" }, - "dependencies": { - "ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==" - } + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "progress": { + "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "engines": { + "node": ">=0.4.0" + } }, - "proper-lockfile": { + "node_modules/proper-lockfile": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", - "requires": { + "dependencies": { "graceful-fs": "^4.2.4", "retry": "^0.12.0", "signal-exit": "^3.0.2" } }, - "proxy-from-env": { + "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, - "pump": { + "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { + "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, - "react-is": { + "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, - "retry": { + "node_modules/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "engines": { + "node": ">= 4" + } }, - "rimraf": { + "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { + "dependencies": { "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "safe-buffer": { + "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "semver": { + "node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } }, - "signal-exit": { + "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, - "slash": { + "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "engines": { + "node": ">=8" + } }, - "smart-buffer": { + "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } }, - "socks": { + "node_modules/socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", - "requires": { + "dependencies": { "ip": "^2.0.0", "smart-buffer": "^4.2.0" }, - "dependencies": { - "ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" - } + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" } }, - "socks-proxy-agent": { + "node_modules/socks-proxy-agent": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", - "requires": { + "dependencies": { "agent-base": "^6.0.2", "debug": "^4.3.3", "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" } }, - "source-map": { + "node_modules/socks/node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + }, + "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==" + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } }, - "source-map-support": { + "node_modules/source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "requires": { + "dependencies": { "source-map": "^0.5.6" } }, - "stack-utils": { + "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", - "requires": { + "dependencies": { "escape-string-regexp": "^2.0.0" }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" - } + "engines": { + "node": ">=10" } }, - "supports-color": { + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { + "dependencies": { "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "to-fast-properties": { + "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==" + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } }, - "to-regex-range": { + "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { + "dependencies": { "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" } }, - "update-browserslist-db": { + "node_modules/update-browserslist-db": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", - "requires": { + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" + }, + "bin": { + "browserslist-lint": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" } }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, - "ws": { + "node_modules/ws": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==" + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } }, - "yauzl": { + "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "requires": { + "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } }, - "yazl": { + "node_modules/yazl": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", - "requires": { + "dependencies": { "buffer-crc32": "~0.2.3" } } From 125e268ea2b7de574fa5fe8557ead7fc809882ed Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 7 May 2024 14:32:44 +0200 Subject: [PATCH 2/9] Updated web components and added exposeExpiryDate to card config (#1078) --- .../client/default/js/adyen_checkout/checkoutConfiguration.js | 1 + .../int_adyen_SFRA/cartridge/adyen/config/constants.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js index 9e2b4cd3b..95d726430 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js @@ -20,6 +20,7 @@ function getCardConfig() { shopperEmail: window.customerEmail, merchantDisplayName: window.merchantAccount, }, + exposeExpiryDate: false, onChange(state) { store.isValid = state.isValid; const method = state.data.paymentMethod.storedPaymentMethodId diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js index ac9aa6fd9..41f1684ed 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js @@ -98,6 +98,6 @@ module.exports = { APPLE_DOMAIN_URL: '/.well-known/apple-developer-merchantid-domain-association', - CHECKOUT_COMPONENT_VERSION: '5.61.0', + CHECKOUT_COMPONENT_VERSION: '5.64.0', VERSION: '24.2.0', }; From 953500d95b72bba4eee52629b3186084111bb451 Mon Sep 17 00:00:00 2001 From: Shani <31096696+shanikantsingh@users.noreply.github.com> Date: Tue, 7 May 2024 15:04:42 +0200 Subject: [PATCH 3/9] Calculate correct tax for applePay express (#1079) * fix: calculate correct tax for applePay express * test: update unit tests --- .../client/default/js/applePayExpress.js | 1 + .../__tests__/shippingMethods.test.js | 27 +++++++++++++++++++ .../expressPayments/shippingMethods.js | 20 +++++++++++--- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js index d5c7900cf..97aa4066e 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js @@ -233,6 +233,7 @@ initializeCheckout() country: shippingContact.country, countryCode: shippingContact.countryCode, stateCode: shippingContact.administrativeArea, + postalCode: shippingContact.postalCode, })}`, ); if (shippingMethods.ok) { diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/__tests__/shippingMethods.test.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/__tests__/shippingMethods.test.js index 3053a0210..44fbf2982 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/__tests__/shippingMethods.test.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/__tests__/shippingMethods.test.js @@ -1,4 +1,5 @@ /* eslint-disable global-require */ +const BasketMgr = require('dw/order/BasketMgr'); const AdyenHelper = require('*/cartridge/adyen/utils/adyenHelper'); let res; @@ -6,6 +7,7 @@ let req; const next = jest.fn(); const callGetShippingMethods = require('../shippingMethods'); +const Logger = require("../../../../../../../../jest/__mocks__/dw/system/Logger"); beforeEach(() => { jest.clearAllMocks(); @@ -15,6 +17,7 @@ beforeEach(() => { city: 'Amsterdam', countryCode: 'NL', stateCode: 'AMS', + postalCode: '1001', shipmentUUID: 'mocked_uuid', }, locale: { id: 'nl_NL' }, @@ -52,4 +55,28 @@ describe('Shipping methods', () => { callGetShippingMethods(req, res, next); expect(res.json).not.toHaveBeenCalled(); }); + it('Should update shipping address for the basket', () => { + const Logger = require('../../../../../../../../jest/__mocks__/dw/system/Logger'); + const setCityMock = jest.fn() + const setPostalCodeMock = jest.fn() + const setStateCodeMock = jest.fn() + const setCountryCodeMock = jest.fn() + const currentBasketMock = { + getDefaultShipment: jest.fn(() =>({ + createShippingAddress: jest.fn(() => ({ + setCity: setCityMock, + setPostalCode: setPostalCodeMock, + setStateCode: setStateCodeMock, + setCountryCode: setCountryCodeMock + })) + })), + }; + BasketMgr.getCurrentBasket.mockReturnValueOnce(currentBasketMock); + callGetShippingMethods(req, res, next); + expect(setCityMock).toHaveBeenCalledWith('Amsterdam'); + expect(setPostalCodeMock).toHaveBeenCalledWith('1001'); + expect(setStateCodeMock).toHaveBeenCalledWith('AMS'); + expect(setCountryCodeMock).toHaveBeenCalledWith('NL'); + expect(Logger.error.mock.calls.length).toBe(0); + }); }); \ No newline at end of file diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js index a745806ea..ad35bf6d9 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js @@ -1,4 +1,5 @@ const BasketMgr = require('dw/order/BasketMgr'); +const Transaction = require('dw/system/Transaction'); const AdyenLogs = require('*/cartridge/adyen/logs/adyenCustomLogs'); const AdyenHelper = require('*/cartridge/adyen/utils/adyenHelper'); @@ -13,14 +14,25 @@ function callGetShippingMethods(req, res, next) { city: req.querystring.city, countryCode: req.querystring.countryCode, stateCode: req.querystring.stateCode, + postalCode: req.querystring.postalCode, }; } const currentBasket = BasketMgr.getCurrentBasket(); + const shipment = currentBasket.getDefaultShipment(); + Transaction.wrap(() => { + let { shippingAddress } = shipment; + if (!shippingAddress) { + shippingAddress = currentBasket + .getDefaultShipment() + .createShippingAddress(); + } + shippingAddress.setCity(address.city); + shippingAddress.setPostalCode(address.postalCode); + shippingAddress.setStateCode(address.stateCode); + shippingAddress.setCountryCode(address.countryCode); + }); const currentShippingMethodsModels = - AdyenHelper.getApplicableShippingMethods( - currentBasket.getDefaultShipment(), - address, - ); + AdyenHelper.getApplicableShippingMethods(shipment, address); res.json({ shippingMethods: currentShippingMethodsModels, }); From 37f384ac9b7e210ccb8da0fd0674f4a692f7fbfe Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Thu, 16 May 2024 15:30:47 +0200 Subject: [PATCH 4/9] Unit tests for amazon pay express and apple pay express (#1082) --- .../__tests__/amazonPayExpressPart2.test.js | 66 +++++++++++++++++- .../__tests__/applePayExpress.test.js | 67 +++++++++++++++++++ .../default/js/amazonPayExpressPart2.js | 20 ++++-- .../client/default/js/applePayExpress.js | 1 + 4 files changed, 147 insertions(+), 7 deletions(-) diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/amazonPayExpressPart2.test.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/amazonPayExpressPart2.test.js index e5cd6fb14..990bca30b 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/amazonPayExpressPart2.test.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/amazonPayExpressPart2.test.js @@ -4,7 +4,7 @@ let select; let data; -const saveShopperDetails = require('../../amazonPayExpressPart2'); +const {saveShopperDetails, constructAddress, wrapChangeAddressButton, showAddressDetails} = require('../../amazonPayExpressPart2'); beforeEach(async () => { document.body.innerHTML = ` @@ -38,4 +38,68 @@ describe('AmazonPay Express', () => { select.innerHTML.includes('EUR002'), ); }); + + it('Should construct address correctly', () => { + const shopperDetails = { + shippingAddress: { + name: 'John Doe', + street: '123 Main St', + city: 'Anytown', + country: 'USA' + }, + paymentDescriptor: 'Visa ending in 1234' + }; + const expectedAddress = "John Doe\n123 Main St Anytown USA "; + expect(constructAddress(shopperDetails)).toBe(expectedAddress); + }); + + it('Should wrap change address button', () => { + document.body.innerHTML = ` + + + `; + wrapChangeAddressButton(); + const changeDetailsBtn = document.querySelector('.adyen-checkout__button.adyen-checkout__button--ghost.adyen-checkout__amazonpay__button--changeAddress'); + const editAddressBtn = document.querySelector('.editAddressBtn'); + editAddressBtn.click(); + expect(changeDetailsBtn.classList.contains('invisible')).toBe(true); + }); + + it('Should show address details', () => { + document.body.innerHTML = ` +
+
+
+ +
+ + +
+
Child #1
+
+ `; + + const shopperDetails = { + shippingAddress: { + name: 'John Doe', + street: '123 Main St', + city: 'Anytown', + country: 'USA' + }, + paymentDescriptor: 'Visa ending in 1234' + }; + + showAddressDetails(shopperDetails); + + const addressElement = document.getElementById('address'); + const paymentDescriptorElement = document.getElementById('paymentStr'); + const payBtn = document.querySelector('.adyen-checkout__button.adyen-checkout__button--standalone.adyen-checkout__button--pay'); + + expect(addressElement.innerText).toBe("John Doe\n123 Main St Anytown USA "); + expect(paymentDescriptorElement.innerText).toBe('Visa ending in 1234'); + expect(payBtn.style.background).toBe('rgb(0, 161, 224)'); + }); }); diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/applePayExpress.test.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/applePayExpress.test.js index 315b45152..90e358062 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/applePayExpress.test.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/__tests__/applePayExpress.test.js @@ -7,8 +7,10 @@ const { handleError, handleApplePayResponse, callPaymentFromComponent, + formatCustomerObject, } = require('../../applePayExpress'); + beforeEach(() => { jest.clearAllMocks(); @@ -97,4 +99,69 @@ describe('Apple Pay Express', () => { JSON.stringify(response.fullResponse), ); }); + + it('Should format customer and billing data correctly', () => { + const customerData = { + addressLines: ['123 Main St', 'Apt 2'], + locality: 'City', + country: 'United States', + countryCode: 'US', + givenName: 'John', + familyName: 'Doe', + emailAddress: 'john@example.com', + postalCode: '12345', + administrativeArea: 'State', + phoneNumber: '+1234567890', + }; + const billingData = { + addressLines: ['456 Oak St'], + locality: 'Town', + country: 'United States', + countryCode: 'US', + givenName: 'Jane', + familyName: 'Doe', + postalCode: '54321', + administrativeArea: 'Province', + }; + const formattedData = formatCustomerObject(customerData, billingData); + expect(formattedData).toEqual({ + addressBook: { + addresses: {}, + preferredAddress: { + address1: '123 Main St', + address2: 'Apt 2', + city: 'City', + countryCode: { + displayValue: 'United States', + value: 'US', + }, + firstName: 'John', + lastName: 'Doe', + ID: 'john@example.com', + postalCode: '12345', + stateCode: 'State', + }, + }, + billingAddressDetails: { + address1: '456 Oak St', + address2: null, + city: 'Town', + countryCode: { + displayValue: 'United States', + value: 'US', + }, + firstName: 'Jane', + lastName: 'Doe', + postalCode: '54321', + stateCode: 'Province', + }, + customer: {}, + profile: { + firstName: 'John', + lastName: 'Doe', + email: 'john@example.com', + phone: '+1234567890', + }, + }); + }); }); diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js index fc37d5ea2..9da564676 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js @@ -35,10 +35,12 @@ function constructAddress(shopperDetails) { return addressStr; } -function positionElementBefore(elm) { - const addressDetails = document.querySelector('#amazonPayAddressDetails'); - const containerNode = addressDetails.parentNode.parentNode.parentNode; - containerNode.insertBefore(addressDetails, document.querySelector(elm)); +function positionElementBefore(elm, target) { + const targetNode = document.querySelector(target); + const addressDetails = document.querySelector(elm); + if (targetNode && addressDetails) { + targetNode.parentNode.insertBefore(addressDetails, targetNode); + } } function wrapChangeAddressButton() { @@ -63,7 +65,7 @@ function showAddressDetails(shopperDetails) { addressElement.innerText = addressText; paymentDiscriptorElement.innerText = shopperDetails.paymentDescriptor; - positionElementBefore('.coupons-and-promos'); + positionElementBefore('#amazonPayAddressDetails', '.coupons-and-promos'); wrapChangeAddressButton(); @@ -117,4 +119,10 @@ async function mountAmazonPayComponent() { mountAmazonPayComponent(); -module.exports = saveShopperDetails; +module.exports = { + saveShopperDetails, + constructAddress, + positionElementBefore, + wrapChangeAddressButton, + showAddressDetails, +}; diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js index 97aa4066e..696599ddd 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js @@ -307,4 +307,5 @@ module.exports = { handleError, handleApplePayResponse, callPaymentFromComponent, + formatCustomerObject, }; From ed858b6ff9edbb4191e970a368dd2c5f29fff4fe Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Wed, 29 May 2024 14:25:48 +0200 Subject: [PATCH 5/9] PSP hyperlink is navigable (#1083) * fix: adjusting the href for CA * chore: triggering quick pipeline * chore: removing extra space added to trigger the quick pipeline --- .../templates/default/order/PaymentInstrumentInfo_Adyen.isml | 2 +- .../default/order/PaymentInstrumentInfo_Adyen_Component.isml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml b/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml index 2d12c1758..25bd36677 100644 --- a/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml +++ b/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml @@ -26,7 +26,7 @@ - PSP reference + PSP reference Payment Method Eventcode diff --git a/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml b/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml index 01a9ba00c..bb973a55d 100644 --- a/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml +++ b/src/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml @@ -27,7 +27,7 @@ - PSP reference + PSP reference Payment Method Eventcode From 022c921074dc924b9050ecdd74d9b96d7595972d Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:17:10 +0100 Subject: [PATCH 6/9] Bumping the version to 24.2.1 (#1092) --- package-lock.json | 4 ++-- package.json | 4 ++-- .../int_adyen_SFRA/cartridge/adyen/config/constants.js | 2 +- tests/playwright/pages/PaymentMethodsPage.mjs | 9 +++------ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1f2a87d3f..6bb27e586 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "app_adyen_SFRA", - "version": "24.2.0", + "version": "24.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "app_adyen_SFRA", - "version": "24.2.0", + "version": "24.2.1", "hasInstallScript": true, "dependencies": { "mobx": "^6.0.0", diff --git a/package.json b/package.json index a5a26ca22..f7ea7a137 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "app_adyen_SFRA", - "version": "24.2.0", - "description": "Adyen's official cartridge for SFRA and controllers-based SiteGenesis", + "version": "24.2.1", + "description": "Adyen's official cartridge for SFRA", "main": "index.js", "paths": { "base": "../storefront-reference-architecture/cartridges/app_storefront_base/", diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js index 41f1684ed..433cfe25d 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js @@ -99,5 +99,5 @@ module.exports = { '/.well-known/apple-developer-merchantid-domain-association', CHECKOUT_COMPONENT_VERSION: '5.64.0', - VERSION: '24.2.0', + VERSION: '24.2.1', }; diff --git a/tests/playwright/pages/PaymentMethodsPage.mjs b/tests/playwright/pages/PaymentMethodsPage.mjs index 090f99291..e3d840fe7 100644 --- a/tests/playwright/pages/PaymentMethodsPage.mjs +++ b/tests/playwright/pages/PaymentMethodsPage.mjs @@ -435,14 +435,11 @@ export default class PaymentMethodsPage { cancelKlarnaPayment = async () => { await this.waitForKlarnaLoad(); await this.page.waitForLoadState('networkidle', { timeout: 20000 }); - this.klarnaIframe = this.page.frameLocator( - '#klarna-apf-iframe', - ); - this.firstCancelButton = this.klarnaIframe.locator('#collectPhonePurchaseFlow__nav-bar__right-icon-wrapper'); - this.secondCancelButton = this.klarnaIframe.locator("button[title='Close']"); + this.firstCancelButton = this.page.locator('#collectPhonePurchaseFlow__nav-bar__right-icon-wrapper'); + this.secondCancelButton = this.page.locator("button[title='Close']"); await this.firstCancelButton.waitFor({ state: 'visible', - timeout: 20000, + timeout: 25000, }); await this.firstCancelButton.click(); await this.secondCancelButton.first().click(); From 6641c6d3bb921c8d9385b8d6217d72321e31cf5d Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:12:43 +0200 Subject: [PATCH 7/9] Added a check to set address properties in case they are available (#1093) * fix: added a check to set address properties in case they are available * chore: adding function description --- .../expressPayments/shippingMethods.js | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js index ad35bf6d9..b9e95ad76 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js @@ -3,6 +3,27 @@ const Transaction = require('dw/system/Transaction'); const AdyenLogs = require('*/cartridge/adyen/logs/adyenCustomLogs'); const AdyenHelper = require('*/cartridge/adyen/utils/adyenHelper'); +const addressMapping = { + city: 'setCity', + countryCode: 'setCountryCode', + stateCode: 'setStateCode', + postalCode: 'setPostalCode', +}; + +/** + * Sets address properties for express PM + * @param {dw.order.shippingAddress} shippingAddress - shippingAddress for the default shipment + * @param {object} inputAddress - address coming from the input field based on shopper selection + * @param {object} mapping - address mapping between property and setter for that property + */ +function setAddressProperties(shippingAddress, inputAddress, mapping) { + Object.keys(inputAddress).forEach((key) => { + if (inputAddress[key] && mapping[key]) { + shippingAddress[mapping[key]](inputAddress[key]); + } + }); +} + /** * Make a request to Adyen to get shipping methods */ @@ -26,10 +47,9 @@ function callGetShippingMethods(req, res, next) { .getDefaultShipment() .createShippingAddress(); } - shippingAddress.setCity(address.city); - shippingAddress.setPostalCode(address.postalCode); - shippingAddress.setStateCode(address.stateCode); - shippingAddress.setCountryCode(address.countryCode); + if (address) { + setAddressProperties(shippingAddress, address, addressMapping); + } }); const currentShippingMethodsModels = AdyenHelper.getApplicableShippingMethods(shipment, address); From aeb46b97e6f8ec08cd4d4a14b0fea5dc273d430d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 11 Jun 2024 12:19:14 +0000 Subject: [PATCH 8/9] chore: committing the built /cartridge folder --- .../client/default/js/adyenAccount.js | 4 +-- .../adyen_checkout/checkoutConfiguration.js | 7 ++-- .../default/js/adyen_checkout/helpers.js | 2 +- .../js/adyen_checkout/makePartialPayment.js | 4 +-- .../adyen_checkout/renderGenericComponent.js | 14 ++++---- .../adyen_checkout/renderGiftcardComponent.js | 2 +- .../js/adyen_checkout/renderPaymentMethod.js | 6 ++-- .../client/default/js/amazonPayCheckout.js | 6 ++-- .../default/js/amazonPayExpressPart1.js | 4 +-- .../default/js/amazonPayExpressPart2.js | 24 ++++++++----- .../client/default/js/applePayExpress.js | 12 ++++--- .../client/default/js/commons/index.js | 4 +-- .../js/expressPaymentMethodsVisibility.js | 14 ++++---- .../static/default/js/adyenAccount.js | 6 ++-- .../static/default/js/adyenCheckout.js | 16 ++++----- .../static/default/js/amazonPayCheckout.js | 6 ++-- .../default/js/amazonPayExpressPart1.js | 6 ++-- .../default/js/amazonPayExpressPart2.js | 6 ++-- .../static/default/js/applePayExpress.js | 8 ++--- .../cartridge/static/default/js/checkout.js | 16 ++++----- .../js/expressPaymentMethodsVisibility.js | 6 ++-- .../app_adyen_SFRA/cartridge/store/index.js | 14 ++++---- .../order/PaymentInstrumentInfo_Adyen.isml | 2 +- ...PaymentInstrumentInfo_Adyen_Component.isml | 2 +- .../cartridge/adyen/config/constants.js | 4 +-- .../expressPayments/selectShippingMethods.js | 2 +- .../expressPayments/shippingMethods.js | 36 +++++++++++++++++-- .../processor/middlewares/processForm.js | 2 +- .../middlewares/savePaymentInformation.js | 2 +- .../cancelPartialPaymentOrder.js | 2 +- .../scripts/partialPayments/checkBalance.js | 2 +- .../scripts/partialPayments/partialPayment.js | 2 +- .../partialPayments/partialPaymentsOrder.js | 2 +- .../adyen/scripts/payments/adyenCheckout.js | 2 +- .../payments/adyenLevelTwoThreeData.js | 2 +- .../cartridge/adyen/utils/adyenHelper.js | 2 +- .../cartridge/adyen/webhooks/handleNotify.js | 6 ++-- .../payment_instruments/savePayment.js | 2 +- .../cartridge/models/createPayment.js | 2 +- 39 files changed, 152 insertions(+), 109 deletions(-) diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenAccount.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenAccount.js index 3d154255b..5db72bd82 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenAccount.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenAccount.js @@ -1,8 +1,8 @@ "use strict"; function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _require = require('./commons'), onFieldValid = _require.onFieldValid, diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js index 43eca7b13..86d7d498e 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js @@ -4,11 +4,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var helpers = require('./helpers'); var _require = require('./makePartialPayment'), makePartialPayment = _require.makePartialPayment; @@ -32,6 +32,7 @@ function getCardConfig() { shopperEmail: window.customerEmail, merchantDisplayName: window.merchantAccount }, + exposeExpiryDate: false, onChange: function onChange(state) { store.isValid = state.isValid; var method = state.data.paymentMethod.storedPaymentMethodId ? "storedCard".concat(state.data.paymentMethod.storedPaymentMethodId) : constants.SCHEME; diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js index 3eb8ddf77..be090cef1 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../../store'); diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js index e5aba0668..625cc5f27 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js @@ -1,8 +1,8 @@ "use strict"; var _excluded = ["giftCards"]; -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } -function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } +function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } +function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; } var store = require('../../../../store'); var _require = require('./renderGenericComponent'), initializeCheckout = _require.initializeCheckout; diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js index e38526dce..416863523 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js @@ -7,17 +7,17 @@ exports.initializeCheckout = initializeCheckout; var _document$getElementB; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable no-unsafe-optional-chaining */ diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js index 7b6652373..de451c54a 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../../store'); diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js index d1785a970..3bcc52fa3 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js @@ -2,11 +2,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../../store'); diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js index d9921e739..5a05cf992 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js @@ -2,11 +2,11 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../store'); diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js index 226d2ca83..753eb035a 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js @@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var _require = require('./commons'), checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady, updateLoadedExpressMethods = _require.updateLoadedExpressMethods, diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js index c0c2ef7dd..e2da3bc99 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js @@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var _require = require('./commons'), getPaymentMethods = _require.getPaymentMethods; function saveShopperDetails(details) { @@ -39,10 +39,12 @@ function constructAddress(shopperDetails) { } return addressStr; } -function positionElementBefore(elm) { - var addressDetails = document.querySelector('#amazonPayAddressDetails'); - var containerNode = addressDetails.parentNode.parentNode.parentNode; - containerNode.insertBefore(addressDetails, document.querySelector(elm)); +function positionElementBefore(elm, target) { + var targetNode = document.querySelector(target); + var addressDetails = document.querySelector(elm); + if (targetNode && addressDetails) { + targetNode.parentNode.insertBefore(addressDetails, targetNode); + } } function wrapChangeAddressButton() { // hide component button and use custom "Edit" buttons instead @@ -61,7 +63,7 @@ function showAddressDetails(shopperDetails) { var paymentDiscriptorElement = document.querySelector('#paymentStr'); addressElement.innerText = addressText; paymentDiscriptorElement.innerText = shopperDetails.paymentDescriptor; - positionElementBefore('.coupons-and-promos'); + positionElementBefore('#amazonPayAddressDetails', '.coupons-and-promos'); wrapChangeAddressButton(); var payBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--standalone adyen-checkout__button--pay')[0]; payBtn.style.background = '#00a1e0'; @@ -139,4 +141,10 @@ function _mountAmazonPayComponent() { return _mountAmazonPayComponent.apply(this, arguments); } mountAmazonPayComponent(); -module.exports = saveShopperDetails; \ No newline at end of file +module.exports = { + saveShopperDetails: saveShopperDetails, + constructAddress: constructAddress, + positionElementBefore: positionElementBefore, + wrapChangeAddressButton: wrapChangeAddressButton, + showAddressDetails: showAddressDetails +}; \ No newline at end of file diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js index 9d04c8bb7..6413f9d47 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js @@ -4,11 +4,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var helpers = require('./adyen_checkout/helpers'); var _require = require('./commons'), checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady; @@ -320,7 +320,8 @@ initializeCheckout().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regener city: shippingContact.locality, country: shippingContact.country, countryCode: shippingContact.countryCode, - stateCode: shippingContact.administrativeArea + stateCode: shippingContact.administrativeArea, + postalCode: shippingContact.postalCode }))); case 3: shippingMethods = _context3.sent; @@ -426,5 +427,6 @@ module.exports = { handleAuthorised: handleAuthorised, handleError: handleError, handleApplePayResponse: handleApplePayResponse, - callPaymentFromComponent: callPaymentFromComponent + callPaymentFromComponent: callPaymentFromComponent, + formatCustomerObject: formatCustomerObject }; \ No newline at end of file diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js index 80108b255..90e353eff 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js @@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var store = require('../../../../store'); module.exports.onFieldValid = function onFieldValid(data) { if (data.endDigits) { diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js index 9f8be6311..69cd228ad 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js @@ -2,14 +2,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } +function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var _require = require('./commons'), checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady; function handleExpressPaymentsVisibility() { diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js index 6359d35cd..30fb25640 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onFieldValid = _require.onFieldValid,\n onBrand = _require.onBrand;\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar checkout;\nvar card;\n\n// Store configuration\nstore.checkoutConfiguration.amount = {\n value: 0,\n currency: 'EUR'\n};\nstore.checkoutConfiguration.paymentMethodsConfiguration = {\n card: {\n enableStoreDetails: false,\n hasHolderName: true,\n holderNameRequired: true,\n installments: [],\n onBrand: onBrand,\n onFieldValid: onFieldValid,\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n store.componentState = state;\n }\n }\n};\n\n// Handle Payment action\nfunction handleAction(action) {\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n}\n\n// confirm onAdditionalDetails event and paymentsDetails response\nstore.checkoutConfiguration.onAdditionalDetails = function (state) {\n $.ajax({\n type: 'POST',\n url: 'Adyen-PaymentsDetails',\n data: JSON.stringify({\n data: state.data\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.isSuccessful) {\n window.location.href = window.redirectUrl;\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n handleAction(data.action);\n } else {\n $('#action-modal').modal('hide');\n document.getElementById('cardError').style.display = 'block';\n }\n }\n });\n};\nfunction initializeCardComponent() {\n return _initializeCardComponent.apply(this, arguments);\n}\nfunction _initializeCardComponent() {\n _initializeCardComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var cardNode;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n cardNode = document.getElementById('card');\n _context.next = 3;\n return AdyenCheckout(store.checkoutConfiguration);\n case 3:\n checkout = _context.sent;\n card = checkout.create('card').mount(cardNode);\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _initializeCardComponent.apply(this, arguments);\n}\nvar formErrorsExist = false;\nfunction submitAddCard() {\n var form = $(document.getElementById('payment-form'));\n $.ajax({\n type: 'POST',\n url: form.attr('action'),\n data: form.serialize(),\n async: false,\n success: function success(data) {\n if (data.redirectAction) {\n handleAction(data.redirectAction);\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n } else if (data.error) {\n formErrorsExist = true;\n }\n }\n });\n}\ninitializeCardComponent();\n\n// Add Payment Button event handler\n$('button[value=\"add-new-payment\"]').on('click', function (event) {\n if (store.isValid) {\n document.querySelector('#adyenStateData').value = JSON.stringify(store.componentState.data);\n submitAddCard();\n if (formErrorsExist) {\n return;\n }\n event.preventDefault();\n } else {\n var _card;\n (_card = card) === null || _card === void 0 ? void 0 : _card.showValidation();\n }\n});\nmodule.exports = {\n initializeCardComponent: initializeCardComponent,\n submitAddCard: submitAddCard\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenAccount.js?"); +eval("\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onFieldValid = _require.onFieldValid,\n onBrand = _require.onBrand;\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar checkout;\nvar card;\n\n// Store configuration\nstore.checkoutConfiguration.amount = {\n value: 0,\n currency: 'EUR'\n};\nstore.checkoutConfiguration.paymentMethodsConfiguration = {\n card: {\n enableStoreDetails: false,\n hasHolderName: true,\n holderNameRequired: true,\n installments: [],\n onBrand: onBrand,\n onFieldValid: onFieldValid,\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n store.componentState = state;\n }\n }\n};\n\n// Handle Payment action\nfunction handleAction(action) {\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n}\n\n// confirm onAdditionalDetails event and paymentsDetails response\nstore.checkoutConfiguration.onAdditionalDetails = function (state) {\n $.ajax({\n type: 'POST',\n url: 'Adyen-PaymentsDetails',\n data: JSON.stringify({\n data: state.data\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.isSuccessful) {\n window.location.href = window.redirectUrl;\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n handleAction(data.action);\n } else {\n $('#action-modal').modal('hide');\n document.getElementById('cardError').style.display = 'block';\n }\n }\n });\n};\nfunction initializeCardComponent() {\n return _initializeCardComponent.apply(this, arguments);\n}\nfunction _initializeCardComponent() {\n _initializeCardComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var cardNode;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n cardNode = document.getElementById('card');\n _context.next = 3;\n return AdyenCheckout(store.checkoutConfiguration);\n case 3:\n checkout = _context.sent;\n card = checkout.create('card').mount(cardNode);\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _initializeCardComponent.apply(this, arguments);\n}\nvar formErrorsExist = false;\nfunction submitAddCard() {\n var form = $(document.getElementById('payment-form'));\n $.ajax({\n type: 'POST',\n url: form.attr('action'),\n data: form.serialize(),\n async: false,\n success: function success(data) {\n if (data.redirectAction) {\n handleAction(data.redirectAction);\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n } else if (data.error) {\n formErrorsExist = true;\n }\n }\n });\n}\ninitializeCardComponent();\n\n// Add Payment Button event handler\n$('button[value=\"add-new-payment\"]').on('click', function (event) {\n if (store.isValid) {\n document.querySelector('#adyenStateData').value = JSON.stringify(store.componentState.data);\n submitAddCard();\n if (formErrorsExist) {\n return;\n }\n event.preventDefault();\n } else {\n var _card;\n (_card = card) === null || _card === void 0 ? void 0 : _card.showValidation();\n }\n});\nmodule.exports = {\n initializeCardComponent: initializeCardComponent,\n submitAddCard: submitAddCard\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenAccount.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runti /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js index dde412641..8a45b7ff1 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js @@ -106,7 +106,7 @@ eval("\n\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/a /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : constants.SCHEME;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(_x, _x2, _x3) {\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction _makeGiftcardPaymentRequest() {\n _makeGiftcardPaymentRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(giftCardData, giftcardBalance, reject) {\n var brandSelect, selectedBrandIndex, giftcardBrand, partialPaymentRequest, partialPaymentResponse;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n brandSelect = document.getElementById('giftCardSelect');\n selectedBrandIndex = brandSelect.selectedIndex;\n giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n _context2.next = 6;\n return makePartialPayment(partialPaymentRequest);\n case 6:\n partialPaymentResponse = _context2.sent;\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x4) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n getGiftCardConfig: getGiftCardConfig,\n getApplePayConfig: getApplePayConfig,\n getCashAppConfig: getCashAppConfig,\n getKlarnaConfig: getKlarnaConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n exposeExpiryDate: false,\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : constants.SCHEME;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(_x, _x2, _x3) {\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction _makeGiftcardPaymentRequest() {\n _makeGiftcardPaymentRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(giftCardData, giftcardBalance, reject) {\n var brandSelect, selectedBrandIndex, giftcardBrand, partialPaymentRequest, partialPaymentResponse;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n brandSelect = document.getElementById('giftCardSelect');\n selectedBrandIndex = brandSelect.selectedIndex;\n giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n _context2.next = 6;\n return makePartialPayment(partialPaymentRequest);\n case 6:\n partialPaymentResponse = _context2.sent;\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x4) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n getGiftCardConfig: getGiftCardConfig,\n getApplePayConfig: getApplePayConfig,\n getCashAppConfig: getCashAppConfig,\n getKlarnaConfig: getKlarnaConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -142,7 +142,7 @@ eval("\n\nmodule.exports.installmentLocales = ['pt_BR', 'ja_JP', 'tr_TR', 'es_MX /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction makePartialPayment(requestData) {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: window.partialPaymentUrl,\n type: 'POST',\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8'\n }).done(function (response) {\n if (response.error) {\n reject(new Error(\"Partial payment error \".concat(response === null || response === void 0 ? void 0 : response.error)));\n } else {\n var giftCards = response.giftCards,\n rest = _objectWithoutProperties(response, _excluded);\n store.checkout.options.amount = rest.remainingAmount;\n store.adyenOrderData = rest.partialPaymentsOrder;\n store.partialPaymentsOrderObj = rest;\n sessionStorage.setItem('partialPaymentsObj', JSON.stringify(rest));\n store.addedGiftCards = giftCards;\n helpers.setOrderFormData(response);\n initializeCheckout();\n resolve();\n }\n }).fail(function () {\n reject(new Error('makePartialPayment request failed'));\n });\n });\n}\nmodule.exports = {\n makePartialPayment: makePartialPayment\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js?"); +eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction makePartialPayment(requestData) {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: window.partialPaymentUrl,\n type: 'POST',\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8'\n }).done(function (response) {\n if (response.error) {\n reject(new Error(\"Partial payment error \".concat(response === null || response === void 0 ? void 0 : response.error)));\n } else {\n var giftCards = response.giftCards,\n rest = _objectWithoutProperties(response, _excluded);\n store.checkout.options.amount = rest.remainingAmount;\n store.adyenOrderData = rest.partialPaymentsOrder;\n store.partialPaymentsOrderObj = rest;\n sessionStorage.setItem('partialPaymentsObj', JSON.stringify(rest));\n store.addedGiftCards = giftCards;\n helpers.setOrderFormData(response);\n initializeCheckout();\n resolve();\n }\n }).fail(function () {\n reject(new Error('makePartialPayment request failed'));\n });\n });\n}\nmodule.exports = {\n makePartialPayment: makePartialPayment\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js?"); /***/ }), @@ -154,7 +154,7 @@ eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(so /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.initializeCheckout = initializeCheckout;\nvar _document$getElementB;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n getPaymentMethods = _require3.getPaymentMethods,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x, _x2, _x3) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var paymentMethodsResponse, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return getPaymentMethods();\n case 2:\n paymentMethodsResponse = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n setCheckoutConfiguration(paymentMethodsResponse);\n store.checkoutConfiguration.paymentMethodsResponse = _objectSpread(_objectSpread({}, paymentMethodsResponse.AdyenPaymentMethods), {}, {\n imagePath: paymentMethodsResponse.imagePath\n });\n _context3.next = 10;\n return AdyenCheckout(store.checkoutConfiguration);\n case 10:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setInstallments(paymentMethodsResponse.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n }); // Rendering stored payment methods if one-click is enabled in BM\n if (window.adyenRecurringPaymentsEnabled) {\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath);\n }\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath, paymentMethodsResponse.adyenDescriptions);\n case 22:\n renderPosTerminals(paymentMethodsResponse.adyenConnectedTerminals);\n renderGiftCardLogo(paymentMethodsResponse.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls getPaymentMethods and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n setInstallments: setInstallments,\n setAmazonPayConfig: setAmazonPayConfig,\n renderStoredPaymentMethods: renderStoredPaymentMethods,\n renderPaymentMethods: renderPaymentMethods,\n renderPosTerminals: renderPosTerminals,\n isCartModified: isCartModified,\n resolveUnmount: resolveUnmount,\n renderGiftCardLogo: renderGiftCardLogo,\n setGiftCardContainerVisibility: setGiftCardContainerVisibility,\n applyGiftCards: applyGiftCards,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.initializeCheckout = initializeCheckout;\nvar _document$getElementB;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n getPaymentMethods = _require3.getPaymentMethods,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x, _x2, _x3) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var paymentMethodsResponse, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return getPaymentMethods();\n case 2:\n paymentMethodsResponse = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n setCheckoutConfiguration(paymentMethodsResponse);\n store.checkoutConfiguration.paymentMethodsResponse = _objectSpread(_objectSpread({}, paymentMethodsResponse.AdyenPaymentMethods), {}, {\n imagePath: paymentMethodsResponse.imagePath\n });\n _context3.next = 10;\n return AdyenCheckout(store.checkoutConfiguration);\n case 10:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setInstallments(paymentMethodsResponse.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n }); // Rendering stored payment methods if one-click is enabled in BM\n if (window.adyenRecurringPaymentsEnabled) {\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath);\n }\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath, paymentMethodsResponse.adyenDescriptions);\n case 22:\n renderPosTerminals(paymentMethodsResponse.adyenConnectedTerminals);\n renderGiftCardLogo(paymentMethodsResponse.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls getPaymentMethods and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n setInstallments: setInstallments,\n setAmazonPayConfig: setAmazonPayConfig,\n renderStoredPaymentMethods: renderStoredPaymentMethods,\n renderPaymentMethods: renderPaymentMethods,\n renderPosTerminals: renderPosTerminals,\n isCartModified: isCartModified,\n resolveUnmount: resolveUnmount,\n renderGiftCardLogo: renderGiftCardLogo,\n setGiftCardContainerVisibility: setGiftCardContainerVisibility,\n applyGiftCards: applyGiftCards,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); /***/ }), @@ -166,7 +166,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n initializeCheckout();\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n var giftCardAmount = store.partialPaymentsOrderObj.remainingAmount ? store.partialPaymentsOrderObj.remainingAmount : store.checkout.options.amount;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name,\n amount: giftCardAmount\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n initializeCheckout();\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n var giftCardAmount = store.partialPaymentsOrderObj.remainingAmount ? store.partialPaymentsOrderObj.remainingAmount : store.checkout.options.amount;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name,\n amount: giftCardAmount\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); /***/ }), @@ -178,7 +178,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); /***/ }), @@ -202,7 +202,7 @@ eval("\n\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridge /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -226,7 +226,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js index 1728aa759..8deda6d6a 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction handleAuthorised(response) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5;\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError() {\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleAmazonResponse(response, component) {\n var _response$fullRespons6;\n if ((_response$fullRespons6 = response.fullResponse) !== null && _response$fullRespons6 !== void 0 && _response$fullRespons6.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.resultCode === window.resultCodeAuthorised) {\n handleAuthorised(response);\n } else {\n // first try the amazon decline flow\n component.handleDeclineFlow();\n // if this does not trigger a redirect, try the regular handleError flow\n handleError();\n }\n}\nfunction paymentFromComponent(data, component) {\n var partialPaymentsOrder = sessionStorage.getItem('partialPaymentsObj');\n var requestData = partialPaymentsOrder ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: JSON.parse(partialPaymentsOrder)\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: 'amazonpay',\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n },\n success: function success(response) {\n sessionStorage.removeItem('partialPaymentsObj');\n helpers.setOrderFormData(response);\n handleAmazonResponse(response, component);\n }\n });\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var amazonPayNode, checkout, amazonConfig, amazonPayComponent;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 3;\n return AdyenCheckout(window.Configuration);\n case 3:\n checkout = _context.sent;\n amazonConfig = {\n showOrderButton: false,\n returnUrl: window.returnURL,\n configuration: {\n merchantId: window.amazonMerchantID,\n storeId: window.amazonStoreID,\n publicKeyId: window.amazonPublicKeyID\n },\n amazonCheckoutSessionId: window.amazonCheckoutSessionId,\n onSubmit: function onSubmit(state, component) {\n document.querySelector('#adyenStateData').value = JSON.stringify(state.data);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n state.data.paymentMethod = 'amazonpay';\n $.ajax({\n type: 'post',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n success: function success(data) {\n if (data.isSuccessful) {\n handleAuthorised(data);\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n checkout.createFromAction(data.action).mount('#amazon-container');\n } else {\n $('#action-modal').modal('hide');\n handleError();\n }\n }\n });\n }\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n $('#dwfrm_billing').submit(function apiRequest(e) {\n e.preventDefault();\n var form = $(this);\n var url = form.attr('action');\n $.ajax({\n type: 'POST',\n url: url,\n data: form.serialize(),\n async: false,\n success: function success(data) {\n store.formErrorsExist = 'fieldErrors' in data;\n }\n });\n });\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n amazonPayComponent.submit();\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js?"); +eval("\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction handleAuthorised(response) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5;\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError() {\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleAmazonResponse(response, component) {\n var _response$fullRespons6;\n if ((_response$fullRespons6 = response.fullResponse) !== null && _response$fullRespons6 !== void 0 && _response$fullRespons6.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.resultCode === window.resultCodeAuthorised) {\n handleAuthorised(response);\n } else {\n // first try the amazon decline flow\n component.handleDeclineFlow();\n // if this does not trigger a redirect, try the regular handleError flow\n handleError();\n }\n}\nfunction paymentFromComponent(data, component) {\n var partialPaymentsOrder = sessionStorage.getItem('partialPaymentsObj');\n var requestData = partialPaymentsOrder ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: JSON.parse(partialPaymentsOrder)\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: 'amazonpay',\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n },\n success: function success(response) {\n sessionStorage.removeItem('partialPaymentsObj');\n helpers.setOrderFormData(response);\n handleAmazonResponse(response, component);\n }\n });\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var amazonPayNode, checkout, amazonConfig, amazonPayComponent;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 3;\n return AdyenCheckout(window.Configuration);\n case 3:\n checkout = _context.sent;\n amazonConfig = {\n showOrderButton: false,\n returnUrl: window.returnURL,\n configuration: {\n merchantId: window.amazonMerchantID,\n storeId: window.amazonStoreID,\n publicKeyId: window.amazonPublicKeyID\n },\n amazonCheckoutSessionId: window.amazonCheckoutSessionId,\n onSubmit: function onSubmit(state, component) {\n document.querySelector('#adyenStateData').value = JSON.stringify(state.data);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n state.data.paymentMethod = 'amazonpay';\n $.ajax({\n type: 'post',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n success: function success(data) {\n if (data.isSuccessful) {\n handleAuthorised(data);\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n checkout.createFromAction(data.action).mount('#amazon-container');\n } else {\n $('#action-modal').modal('hide');\n handleError();\n }\n }\n });\n }\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n $('#dwfrm_billing').submit(function apiRequest(e) {\n e.preventDefault();\n var form = $(this);\n var url = form.attr('action');\n $.ajax({\n type: 'POST',\n url: url,\n data: form.serialize(),\n async: false,\n success: function success(data) {\n store.formErrorsExist = 'fieldErrors' in data;\n }\n });\n });\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n amazonPayComponent.submit();\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js?"); /***/ }), @@ -130,7 +130,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js index 9915e415a..a238b7404 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady,\n updateLoadedExpressMethods = _require.updateLoadedExpressMethods,\n getPaymentMethods = _require.getPaymentMethods;\nvar AMAZON_PAY = 'amazonpay';\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _paymentMethodsRespon, data, paymentMethodsResponse, applicationInfo, checkout, amazonPayConfig, amazonPayButtonConfig, amazonPayButton;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return getPaymentMethods();\n case 3:\n data = _context.sent;\n paymentMethodsResponse = data === null || data === void 0 ? void 0 : data.AdyenPaymentMethods;\n applicationInfo = data === null || data === void 0 ? void 0 : data.applicationInfo;\n _context.next = 8;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale,\n analytics: {\n analyticsData: {\n applicationInfo: applicationInfo\n }\n }\n });\n case 8:\n checkout = _context.sent;\n amazonPayConfig = paymentMethodsResponse === null || paymentMethodsResponse === void 0 ? void 0 : (_paymentMethodsRespon = paymentMethodsResponse.paymentMethods.find(function (pm) {\n return pm.type === AMAZON_PAY;\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 12;\n break;\n }\n return _context.abrupt(\"return\");\n case 12:\n amazonPayButtonConfig = {\n showPayButton: true,\n productType: 'PayAndShip',\n configuration: amazonPayConfig,\n returnUrl: window.returnUrl,\n isExpress: true\n };\n amazonPayButton = checkout.create(AMAZON_PAY, amazonPayButtonConfig);\n amazonPayButton.mount('#amazonpay-container');\n updateLoadedExpressMethods(AMAZON_PAY);\n checkIfExpressMethodsAreReady();\n _context.next = 21;\n break;\n case 19:\n _context.prev = 19;\n _context.t0 = _context[\"catch\"](0);\n case 21:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 19]]);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady,\n updateLoadedExpressMethods = _require.updateLoadedExpressMethods,\n getPaymentMethods = _require.getPaymentMethods;\nvar AMAZON_PAY = 'amazonpay';\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _paymentMethodsRespon, data, paymentMethodsResponse, applicationInfo, checkout, amazonPayConfig, amazonPayButtonConfig, amazonPayButton;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return getPaymentMethods();\n case 3:\n data = _context.sent;\n paymentMethodsResponse = data === null || data === void 0 ? void 0 : data.AdyenPaymentMethods;\n applicationInfo = data === null || data === void 0 ? void 0 : data.applicationInfo;\n _context.next = 8;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale,\n analytics: {\n analyticsData: {\n applicationInfo: applicationInfo\n }\n }\n });\n case 8:\n checkout = _context.sent;\n amazonPayConfig = paymentMethodsResponse === null || paymentMethodsResponse === void 0 ? void 0 : (_paymentMethodsRespon = paymentMethodsResponse.paymentMethods.find(function (pm) {\n return pm.type === AMAZON_PAY;\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 12;\n break;\n }\n return _context.abrupt(\"return\");\n case 12:\n amazonPayButtonConfig = {\n showPayButton: true,\n productType: 'PayAndShip',\n configuration: amazonPayConfig,\n returnUrl: window.returnUrl,\n isExpress: true\n };\n amazonPayButton = checkout.create(AMAZON_PAY, amazonPayButtonConfig);\n amazonPayButton.mount('#amazonpay-container');\n updateLoadedExpressMethods(AMAZON_PAY);\n checkIfExpressMethodsAreReady();\n _context.next = 21;\n break;\n case 19:\n _context.prev = 19;\n _context.t0 = _context[\"catch\"](0);\n case 21:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 19]]);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js index b0e12124d..f2fab7cf8 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n getPaymentMethods = _require.getPaymentMethods;\nfunction saveShopperDetails(details) {\n $.ajax({\n url: window.saveShopperDetailsURL,\n type: 'post',\n data: {\n shopperDetails: JSON.stringify(details),\n paymentMethod: 'amazonpay'\n },\n success: function success(data) {\n var select = document.querySelector('#shippingMethods');\n select.innerHTML = '';\n data.shippingMethods.forEach(function (shippingMethod) {\n var option = document.createElement('option');\n option.setAttribute('data-shipping-id', shippingMethod.ID);\n option.innerText = \"\".concat(shippingMethod.displayName, \" (\").concat(shippingMethod.estimatedArrivalTime, \")\");\n select.appendChild(option);\n });\n select.options[0].selected = true;\n select.dispatchEvent(new Event('change'));\n }\n });\n}\nfunction constructAddress(shopperDetails) {\n var addressKeys = Object.keys(shopperDetails.shippingAddress);\n var addressValues = Object.values(shopperDetails.shippingAddress);\n var addressStr = \"\".concat(shopperDetails.shippingAddress.name, \"\\n\");\n for (var i = 0; i < addressKeys.length; i += 1) {\n if (addressValues[i] && addressKeys[i] !== 'name') {\n addressStr += \"\".concat(addressValues[i], \" \");\n }\n }\n return addressStr;\n}\nfunction positionElementBefore(elm) {\n var addressDetails = document.querySelector('#amazonPayAddressDetails');\n var containerNode = addressDetails.parentNode.parentNode.parentNode;\n containerNode.insertBefore(addressDetails, document.querySelector(elm));\n}\nfunction wrapChangeAddressButton() {\n // hide component button and use custom \"Edit\" buttons instead\n var changeDetailsBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--ghost adyen-checkout__amazonpay__button--changeAddress')[0];\n changeDetailsBtn.classList.add('invisible');\n var editAddressBtns = document.querySelectorAll('.editAddressBtn');\n editAddressBtns.forEach(function (btn) {\n btn.addEventListener('click', function () {\n changeDetailsBtn.click();\n });\n });\n}\nfunction showAddressDetails(shopperDetails) {\n var addressText = constructAddress(shopperDetails);\n var addressElement = document.querySelector('#address');\n var paymentDiscriptorElement = document.querySelector('#paymentStr');\n addressElement.innerText = addressText;\n paymentDiscriptorElement.innerText = shopperDetails.paymentDescriptor;\n positionElementBefore('.coupons-and-promos');\n wrapChangeAddressButton();\n var payBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--standalone adyen-checkout__button--pay')[0];\n payBtn.style.background = '#00a1e0';\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _paymentMethodsRespon, amazonPayNode, data, paymentMethodsResponse, applicationInfo, checkout, amazonPayConfig, amazonConfig, amazonPayComponent, shopperDetails;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 4;\n return getPaymentMethods();\n case 4:\n data = _context.sent;\n paymentMethodsResponse = data === null || data === void 0 ? void 0 : data.AdyenPaymentMethods;\n applicationInfo = data === null || data === void 0 ? void 0 : data.applicationInfo;\n _context.next = 9;\n return AdyenCheckout({\n environment: window.Configuration.environment,\n clientKey: window.Configuration.clientKey,\n locale: window.Configuration.locale,\n analytics: {\n analyticsData: {\n applicationInfo: applicationInfo\n }\n }\n });\n case 9:\n checkout = _context.sent;\n amazonPayConfig = paymentMethodsResponse === null || paymentMethodsResponse === void 0 ? void 0 : (_paymentMethodsRespon = paymentMethodsResponse.paymentMethods.find(function (pm) {\n return pm.type === 'amazonpay';\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 13;\n break;\n }\n return _context.abrupt(\"return\");\n case 13:\n amazonConfig = {\n showOrderButton: true,\n configuration: {\n merchantId: amazonPayConfig.merchantId,\n storeId: amazonPayConfig.storeId,\n region: amazonPayConfig.region,\n publicKeyId: amazonPayConfig.publicKeyId\n },\n returnUrl: window.returnUrl,\n showChangePaymentDetailsButton: true,\n amount: JSON.parse(window.basketAmount),\n amazonCheckoutSessionId: window.amazonCheckoutSessionId\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n _context.next = 17;\n return amazonPayComponent.getShopperDetails();\n case 17:\n shopperDetails = _context.sent;\n saveShopperDetails(shopperDetails);\n showAddressDetails(shopperDetails);\n _context.next = 24;\n break;\n case 22:\n _context.prev = 22;\n _context.t0 = _context[\"catch\"](0);\n case 24:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 22]]);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\nmodule.exports = saveShopperDetails;\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n getPaymentMethods = _require.getPaymentMethods;\nfunction saveShopperDetails(details) {\n $.ajax({\n url: window.saveShopperDetailsURL,\n type: 'post',\n data: {\n shopperDetails: JSON.stringify(details),\n paymentMethod: 'amazonpay'\n },\n success: function success(data) {\n var select = document.querySelector('#shippingMethods');\n select.innerHTML = '';\n data.shippingMethods.forEach(function (shippingMethod) {\n var option = document.createElement('option');\n option.setAttribute('data-shipping-id', shippingMethod.ID);\n option.innerText = \"\".concat(shippingMethod.displayName, \" (\").concat(shippingMethod.estimatedArrivalTime, \")\");\n select.appendChild(option);\n });\n select.options[0].selected = true;\n select.dispatchEvent(new Event('change'));\n }\n });\n}\nfunction constructAddress(shopperDetails) {\n var addressKeys = Object.keys(shopperDetails.shippingAddress);\n var addressValues = Object.values(shopperDetails.shippingAddress);\n var addressStr = \"\".concat(shopperDetails.shippingAddress.name, \"\\n\");\n for (var i = 0; i < addressKeys.length; i += 1) {\n if (addressValues[i] && addressKeys[i] !== 'name') {\n addressStr += \"\".concat(addressValues[i], \" \");\n }\n }\n return addressStr;\n}\nfunction positionElementBefore(elm, target) {\n var targetNode = document.querySelector(target);\n var addressDetails = document.querySelector(elm);\n if (targetNode && addressDetails) {\n targetNode.parentNode.insertBefore(addressDetails, targetNode);\n }\n}\nfunction wrapChangeAddressButton() {\n // hide component button and use custom \"Edit\" buttons instead\n var changeDetailsBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--ghost adyen-checkout__amazonpay__button--changeAddress')[0];\n changeDetailsBtn.classList.add('invisible');\n var editAddressBtns = document.querySelectorAll('.editAddressBtn');\n editAddressBtns.forEach(function (btn) {\n btn.addEventListener('click', function () {\n changeDetailsBtn.click();\n });\n });\n}\nfunction showAddressDetails(shopperDetails) {\n var addressText = constructAddress(shopperDetails);\n var addressElement = document.querySelector('#address');\n var paymentDiscriptorElement = document.querySelector('#paymentStr');\n addressElement.innerText = addressText;\n paymentDiscriptorElement.innerText = shopperDetails.paymentDescriptor;\n positionElementBefore('#amazonPayAddressDetails', '.coupons-and-promos');\n wrapChangeAddressButton();\n var payBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--standalone adyen-checkout__button--pay')[0];\n payBtn.style.background = '#00a1e0';\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _paymentMethodsRespon, amazonPayNode, data, paymentMethodsResponse, applicationInfo, checkout, amazonPayConfig, amazonConfig, amazonPayComponent, shopperDetails;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 4;\n return getPaymentMethods();\n case 4:\n data = _context.sent;\n paymentMethodsResponse = data === null || data === void 0 ? void 0 : data.AdyenPaymentMethods;\n applicationInfo = data === null || data === void 0 ? void 0 : data.applicationInfo;\n _context.next = 9;\n return AdyenCheckout({\n environment: window.Configuration.environment,\n clientKey: window.Configuration.clientKey,\n locale: window.Configuration.locale,\n analytics: {\n analyticsData: {\n applicationInfo: applicationInfo\n }\n }\n });\n case 9:\n checkout = _context.sent;\n amazonPayConfig = paymentMethodsResponse === null || paymentMethodsResponse === void 0 ? void 0 : (_paymentMethodsRespon = paymentMethodsResponse.paymentMethods.find(function (pm) {\n return pm.type === 'amazonpay';\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 13;\n break;\n }\n return _context.abrupt(\"return\");\n case 13:\n amazonConfig = {\n showOrderButton: true,\n configuration: {\n merchantId: amazonPayConfig.merchantId,\n storeId: amazonPayConfig.storeId,\n region: amazonPayConfig.region,\n publicKeyId: amazonPayConfig.publicKeyId\n },\n returnUrl: window.returnUrl,\n showChangePaymentDetailsButton: true,\n amount: JSON.parse(window.basketAmount),\n amazonCheckoutSessionId: window.amazonCheckoutSessionId\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n _context.next = 17;\n return amazonPayComponent.getShopperDetails();\n case 17:\n shopperDetails = _context.sent;\n saveShopperDetails(shopperDetails);\n showAddressDetails(shopperDetails);\n _context.next = 24;\n break;\n case 22:\n _context.prev = 22;\n _context.t0 = _context[\"catch\"](0);\n case 24:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 22]]);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\nmodule.exports = {\n saveShopperDetails: saveShopperDetails,\n constructAddress: constructAddress,\n positionElementBefore: positionElementBefore,\n wrapChangeAddressButton: wrapChangeAddressButton,\n showAddressDetails: showAddressDetails\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js index 527d8554a..82823c869 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nvar _require2 = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n updateLoadedExpressMethods = _require2.updateLoadedExpressMethods,\n getPaymentMethods = _require2.getPaymentMethods;\nvar _require3 = __webpack_require__(/*! ./constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\"),\n APPLE_PAY = _require3.APPLE_PAY;\nvar checkout;\nvar shippingMethodsData;\nvar paymentMethodsResponse;\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var _paymentMethodsRespon3;\n var shippingMethods, applicationInfo;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return getPaymentMethods();\n case 2:\n paymentMethodsResponse = _context5.sent;\n _context5.next = 5;\n return fetch(window.shippingMethodsUrl);\n case 5:\n shippingMethods = _context5.sent;\n _context5.next = 8;\n return shippingMethods.json();\n case 8:\n shippingMethodsData = _context5.sent;\n applicationInfo = (_paymentMethodsRespon3 = paymentMethodsResponse) === null || _paymentMethodsRespon3 === void 0 ? void 0 : _paymentMethodsRespon3.applicationInfo;\n _context5.next = 12;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale,\n analytics: {\n analyticsData: {\n applicationInfo: applicationInfo\n }\n }\n });\n case 12:\n checkout = _context5.sent;\n case 13:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\nfunction createApplePayButton(_x) {\n return _createApplePayButton.apply(this, arguments);\n}\nfunction _createApplePayButton() {\n _createApplePayButton = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(applePayButtonConfig) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n return _context6.abrupt(\"return\", checkout.create(APPLE_PAY, applePayButtonConfig));\n case 1:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return _createApplePayButton.apply(this, arguments);\n}\nfunction formatCustomerObject(customerData, billingData) {\n return {\n addressBook: {\n addresses: {},\n preferredAddress: {\n address1: customerData.addressLines[0],\n address2: customerData.addressLines.length > 1 ? customerData.addressLines[1] : null,\n city: customerData.locality,\n countryCode: {\n displayValue: customerData.country,\n value: customerData.countryCode\n },\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n ID: customerData.emailAddress,\n postalCode: customerData.postalCode,\n stateCode: customerData.administrativeArea\n }\n },\n billingAddressDetails: {\n address1: billingData.addressLines[0],\n address2: billingData.addressLines.length > 1 ? billingData.addressLines[1] : null,\n city: billingData.locality,\n countryCode: {\n displayValue: billingData.country,\n value: billingData.countryCode\n },\n firstName: billingData.givenName,\n lastName: billingData.familyName,\n postalCode: billingData.postalCode,\n stateCode: billingData.administrativeArea\n },\n customer: {},\n profile: {\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n email: customerData.emailAddress,\n phone: customerData.phoneNumber\n }\n };\n}\nfunction handleAuthorised(response, resolveApplePay) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5, _response$fullRespons6, _response$fullRespons7;\n resolveApplePay();\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod,\n donationToken: (_response$fullRespons6 = response.fullResponse) === null || _response$fullRespons6 === void 0 ? void 0 : _response$fullRespons6.donationToken,\n amount: (_response$fullRespons7 = response.fullResponse) === null || _response$fullRespons7 === void 0 ? void 0 : _response$fullRespons7.amount\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError(rejectApplePay) {\n rejectApplePay();\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleApplePayResponse(response, resolveApplePay, rejectApplePay) {\n if (response.resultCode === 'Authorised') {\n handleAuthorised(response, resolveApplePay);\n } else {\n handleError(rejectApplePay);\n }\n}\nfunction callPaymentFromComponent(data, resolveApplePay, rejectApplePay) {\n return $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(data),\n paymentMethod: APPLE_PAY\n },\n success: function success(response) {\n helpers.createShowConfirmationForm(window.showConfirmationAction);\n helpers.setOrderFormData(response);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(data);\n handleApplePayResponse(response, resolveApplePay, rejectApplePay);\n }\n }).fail(function () {\n rejectApplePay();\n });\n}\ninitializeCheckout().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _paymentMethodsRespon, _paymentMethodsRespon2;\n var applePayPaymentMethod, applePayConfig, applePayButtonConfig, cartContainer, applePayButton, isApplePayButtonAvailable, expressCheckoutNodesIndex;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n applePayPaymentMethod = (_paymentMethodsRespon = paymentMethodsResponse) === null || _paymentMethodsRespon === void 0 ? void 0 : (_paymentMethodsRespon2 = _paymentMethodsRespon.AdyenPaymentMethods) === null || _paymentMethodsRespon2 === void 0 ? void 0 : _paymentMethodsRespon2.paymentMethods.find(function (pm) {\n return pm.type === APPLE_PAY;\n });\n if (applePayPaymentMethod) {\n _context4.next = 5;\n break;\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n return _context4.abrupt(\"return\");\n case 5:\n applePayConfig = applePayPaymentMethod.configuration;\n applePayButtonConfig = {\n showPayButton: true,\n isExpress: true,\n configuration: applePayConfig,\n amount: JSON.parse(window.basketAmount),\n requiredShippingContactFields: ['postalAddress', 'email', 'phone'],\n requiredBillingContactFields: ['postalAddress', 'phone'],\n shippingMethods: shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n }),\n onAuthorized: function () {\n var _onAuthorized = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject, event) {\n var customerData, billingData, customer, stateData, resolveApplePay;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n customerData = event.payment.shippingContact;\n billingData = event.payment.billingContact;\n customer = formatCustomerObject(customerData, billingData);\n stateData = {\n paymentMethod: {\n type: APPLE_PAY,\n applePayToken: event.payment.token.paymentData\n },\n paymentType: 'express'\n };\n resolveApplePay = function resolveApplePay() {\n // ** is used instead of Math.pow\n var value = applePayButtonConfig.amount.value * Math.pow(10, parseInt(window.digitsNumber, 10));\n var finalPriceUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: \"\".concat(Math.round(value))\n }\n };\n resolve(finalPriceUpdate);\n };\n _context.next = 8;\n return callPaymentFromComponent(_objectSpread(_objectSpread({}, stateData), {}, {\n customer: customer\n }), resolveApplePay, reject);\n case 8:\n _context.next = 13;\n break;\n case 10:\n _context.prev = 10;\n _context.t0 = _context[\"catch\"](0);\n reject(_context.t0);\n case 13:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 10]]);\n }));\n function onAuthorized(_x2, _x3, _x4) {\n return _onAuthorized.apply(this, arguments);\n }\n return onAuthorized;\n }(),\n onSubmit: function onSubmit() {\n // This handler is empty to prevent sending a second payment request\n // We already do the payment in paymentFromComponent\n },\n onShippingMethodSelected: function () {\n var _onShippingMethodSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject, event) {\n var shippingMethod, matchingShippingMethod, calculationResponse, newCalculation, applePayShippingMethodUpdate;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n shippingMethod = event.shippingMethod;\n matchingShippingMethod = shippingMethodsData.shippingMethods.find(function (sm) {\n return sm.ID === shippingMethod.identifier;\n });\n _context2.next = 4;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: matchingShippingMethod.shipmentUUID,\n methodID: matchingShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 4:\n calculationResponse = _context2.sent;\n if (!calculationResponse.ok) {\n _context2.next = 14;\n break;\n }\n _context2.next = 8;\n return calculationResponse.json();\n case 8:\n newCalculation = _context2.sent;\n applePayButtonConfig.amount = {\n value: newCalculation.grandTotalAmount.value,\n currency: newCalculation.grandTotalAmount.currency\n };\n applePayShippingMethodUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingMethodUpdate);\n _context2.next = 15;\n break;\n case 14:\n reject();\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function onShippingMethodSelected(_x5, _x6, _x7) {\n return _onShippingMethodSelected.apply(this, arguments);\n }\n return onShippingMethodSelected;\n }(),\n onShippingContactSelected: function () {\n var _onShippingContactSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve, reject, event) {\n var shippingContact, shippingMethods, _shippingMethodsData$, selectedShippingMethod, calculationResponse, shippingMethodsStructured, newCalculation, applePayShippingContactUpdate;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n shippingContact = event.shippingContact;\n _context3.next = 3;\n return fetch(\"\".concat(window.shippingMethodsUrl, \"?\").concat(new URLSearchParams({\n city: shippingContact.locality,\n country: shippingContact.country,\n countryCode: shippingContact.countryCode,\n stateCode: shippingContact.administrativeArea\n })));\n case 3:\n shippingMethods = _context3.sent;\n if (!shippingMethods.ok) {\n _context3.next = 28;\n break;\n }\n _context3.next = 7;\n return shippingMethods.json();\n case 7:\n shippingMethodsData = _context3.sent;\n if (!((_shippingMethodsData$ = shippingMethodsData.shippingMethods) !== null && _shippingMethodsData$ !== void 0 && _shippingMethodsData$.length)) {\n _context3.next = 25;\n break;\n }\n selectedShippingMethod = shippingMethodsData.shippingMethods[0];\n _context3.next = 12;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: selectedShippingMethod.shipmentUUID,\n methodID: selectedShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 12:\n calculationResponse = _context3.sent;\n if (!calculationResponse.ok) {\n _context3.next = 22;\n break;\n }\n shippingMethodsStructured = shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n });\n _context3.next = 17;\n return calculationResponse.json();\n case 17:\n newCalculation = _context3.sent;\n applePayShippingContactUpdate = {\n newShippingMethods: shippingMethodsStructured,\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingContactUpdate);\n _context3.next = 23;\n break;\n case 22:\n reject();\n case 23:\n _context3.next = 26;\n break;\n case 25:\n reject();\n case 26:\n _context3.next = 29;\n break;\n case 28:\n reject();\n case 29:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function onShippingContactSelected(_x8, _x9, _x10) {\n return _onShippingContactSelected.apply(this, arguments);\n }\n return onShippingContactSelected;\n }()\n };\n cartContainer = document.getElementsByClassName(APPLE_PAY);\n _context4.next = 10;\n return createApplePayButton(applePayButtonConfig);\n case 10:\n applePayButton = _context4.sent;\n _context4.next = 13;\n return applePayButton.isAvailable();\n case 13:\n isApplePayButtonAvailable = _context4.sent;\n if (isApplePayButtonAvailable) {\n for (expressCheckoutNodesIndex = 0; expressCheckoutNodesIndex < cartContainer.length; expressCheckoutNodesIndex += 1) {\n applePayButton.mount(cartContainer[expressCheckoutNodesIndex]);\n }\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n case 17:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n})))[\"catch\"](function () {\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n});\nmodule.exports = {\n handleAuthorised: handleAuthorised,\n handleError: handleError,\n handleApplePayResponse: handleApplePayResponse,\n callPaymentFromComponent: callPaymentFromComponent\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nvar _require2 = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n updateLoadedExpressMethods = _require2.updateLoadedExpressMethods,\n getPaymentMethods = _require2.getPaymentMethods;\nvar _require3 = __webpack_require__(/*! ./constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\"),\n APPLE_PAY = _require3.APPLE_PAY;\nvar checkout;\nvar shippingMethodsData;\nvar paymentMethodsResponse;\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var _paymentMethodsRespon3;\n var shippingMethods, applicationInfo;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return getPaymentMethods();\n case 2:\n paymentMethodsResponse = _context5.sent;\n _context5.next = 5;\n return fetch(window.shippingMethodsUrl);\n case 5:\n shippingMethods = _context5.sent;\n _context5.next = 8;\n return shippingMethods.json();\n case 8:\n shippingMethodsData = _context5.sent;\n applicationInfo = (_paymentMethodsRespon3 = paymentMethodsResponse) === null || _paymentMethodsRespon3 === void 0 ? void 0 : _paymentMethodsRespon3.applicationInfo;\n _context5.next = 12;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale,\n analytics: {\n analyticsData: {\n applicationInfo: applicationInfo\n }\n }\n });\n case 12:\n checkout = _context5.sent;\n case 13:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\nfunction createApplePayButton(_x) {\n return _createApplePayButton.apply(this, arguments);\n}\nfunction _createApplePayButton() {\n _createApplePayButton = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(applePayButtonConfig) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n return _context6.abrupt(\"return\", checkout.create(APPLE_PAY, applePayButtonConfig));\n case 1:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return _createApplePayButton.apply(this, arguments);\n}\nfunction formatCustomerObject(customerData, billingData) {\n return {\n addressBook: {\n addresses: {},\n preferredAddress: {\n address1: customerData.addressLines[0],\n address2: customerData.addressLines.length > 1 ? customerData.addressLines[1] : null,\n city: customerData.locality,\n countryCode: {\n displayValue: customerData.country,\n value: customerData.countryCode\n },\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n ID: customerData.emailAddress,\n postalCode: customerData.postalCode,\n stateCode: customerData.administrativeArea\n }\n },\n billingAddressDetails: {\n address1: billingData.addressLines[0],\n address2: billingData.addressLines.length > 1 ? billingData.addressLines[1] : null,\n city: billingData.locality,\n countryCode: {\n displayValue: billingData.country,\n value: billingData.countryCode\n },\n firstName: billingData.givenName,\n lastName: billingData.familyName,\n postalCode: billingData.postalCode,\n stateCode: billingData.administrativeArea\n },\n customer: {},\n profile: {\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n email: customerData.emailAddress,\n phone: customerData.phoneNumber\n }\n };\n}\nfunction handleAuthorised(response, resolveApplePay) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5, _response$fullRespons6, _response$fullRespons7;\n resolveApplePay();\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod,\n donationToken: (_response$fullRespons6 = response.fullResponse) === null || _response$fullRespons6 === void 0 ? void 0 : _response$fullRespons6.donationToken,\n amount: (_response$fullRespons7 = response.fullResponse) === null || _response$fullRespons7 === void 0 ? void 0 : _response$fullRespons7.amount\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError(rejectApplePay) {\n rejectApplePay();\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleApplePayResponse(response, resolveApplePay, rejectApplePay) {\n if (response.resultCode === 'Authorised') {\n handleAuthorised(response, resolveApplePay);\n } else {\n handleError(rejectApplePay);\n }\n}\nfunction callPaymentFromComponent(data, resolveApplePay, rejectApplePay) {\n return $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(data),\n paymentMethod: APPLE_PAY\n },\n success: function success(response) {\n helpers.createShowConfirmationForm(window.showConfirmationAction);\n helpers.setOrderFormData(response);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(data);\n handleApplePayResponse(response, resolveApplePay, rejectApplePay);\n }\n }).fail(function () {\n rejectApplePay();\n });\n}\ninitializeCheckout().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _paymentMethodsRespon, _paymentMethodsRespon2;\n var applePayPaymentMethod, applePayConfig, applePayButtonConfig, cartContainer, applePayButton, isApplePayButtonAvailable, expressCheckoutNodesIndex;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n applePayPaymentMethod = (_paymentMethodsRespon = paymentMethodsResponse) === null || _paymentMethodsRespon === void 0 ? void 0 : (_paymentMethodsRespon2 = _paymentMethodsRespon.AdyenPaymentMethods) === null || _paymentMethodsRespon2 === void 0 ? void 0 : _paymentMethodsRespon2.paymentMethods.find(function (pm) {\n return pm.type === APPLE_PAY;\n });\n if (applePayPaymentMethod) {\n _context4.next = 5;\n break;\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n return _context4.abrupt(\"return\");\n case 5:\n applePayConfig = applePayPaymentMethod.configuration;\n applePayButtonConfig = {\n showPayButton: true,\n isExpress: true,\n configuration: applePayConfig,\n amount: JSON.parse(window.basketAmount),\n requiredShippingContactFields: ['postalAddress', 'email', 'phone'],\n requiredBillingContactFields: ['postalAddress', 'phone'],\n shippingMethods: shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n }),\n onAuthorized: function () {\n var _onAuthorized = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject, event) {\n var customerData, billingData, customer, stateData, resolveApplePay;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n customerData = event.payment.shippingContact;\n billingData = event.payment.billingContact;\n customer = formatCustomerObject(customerData, billingData);\n stateData = {\n paymentMethod: {\n type: APPLE_PAY,\n applePayToken: event.payment.token.paymentData\n },\n paymentType: 'express'\n };\n resolveApplePay = function resolveApplePay() {\n // ** is used instead of Math.pow\n var value = applePayButtonConfig.amount.value * Math.pow(10, parseInt(window.digitsNumber, 10));\n var finalPriceUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: \"\".concat(Math.round(value))\n }\n };\n resolve(finalPriceUpdate);\n };\n _context.next = 8;\n return callPaymentFromComponent(_objectSpread(_objectSpread({}, stateData), {}, {\n customer: customer\n }), resolveApplePay, reject);\n case 8:\n _context.next = 13;\n break;\n case 10:\n _context.prev = 10;\n _context.t0 = _context[\"catch\"](0);\n reject(_context.t0);\n case 13:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 10]]);\n }));\n function onAuthorized(_x2, _x3, _x4) {\n return _onAuthorized.apply(this, arguments);\n }\n return onAuthorized;\n }(),\n onSubmit: function onSubmit() {\n // This handler is empty to prevent sending a second payment request\n // We already do the payment in paymentFromComponent\n },\n onShippingMethodSelected: function () {\n var _onShippingMethodSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject, event) {\n var shippingMethod, matchingShippingMethod, calculationResponse, newCalculation, applePayShippingMethodUpdate;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n shippingMethod = event.shippingMethod;\n matchingShippingMethod = shippingMethodsData.shippingMethods.find(function (sm) {\n return sm.ID === shippingMethod.identifier;\n });\n _context2.next = 4;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: matchingShippingMethod.shipmentUUID,\n methodID: matchingShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 4:\n calculationResponse = _context2.sent;\n if (!calculationResponse.ok) {\n _context2.next = 14;\n break;\n }\n _context2.next = 8;\n return calculationResponse.json();\n case 8:\n newCalculation = _context2.sent;\n applePayButtonConfig.amount = {\n value: newCalculation.grandTotalAmount.value,\n currency: newCalculation.grandTotalAmount.currency\n };\n applePayShippingMethodUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingMethodUpdate);\n _context2.next = 15;\n break;\n case 14:\n reject();\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function onShippingMethodSelected(_x5, _x6, _x7) {\n return _onShippingMethodSelected.apply(this, arguments);\n }\n return onShippingMethodSelected;\n }(),\n onShippingContactSelected: function () {\n var _onShippingContactSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve, reject, event) {\n var shippingContact, shippingMethods, _shippingMethodsData$, selectedShippingMethod, calculationResponse, shippingMethodsStructured, newCalculation, applePayShippingContactUpdate;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n shippingContact = event.shippingContact;\n _context3.next = 3;\n return fetch(\"\".concat(window.shippingMethodsUrl, \"?\").concat(new URLSearchParams({\n city: shippingContact.locality,\n country: shippingContact.country,\n countryCode: shippingContact.countryCode,\n stateCode: shippingContact.administrativeArea,\n postalCode: shippingContact.postalCode\n })));\n case 3:\n shippingMethods = _context3.sent;\n if (!shippingMethods.ok) {\n _context3.next = 28;\n break;\n }\n _context3.next = 7;\n return shippingMethods.json();\n case 7:\n shippingMethodsData = _context3.sent;\n if (!((_shippingMethodsData$ = shippingMethodsData.shippingMethods) !== null && _shippingMethodsData$ !== void 0 && _shippingMethodsData$.length)) {\n _context3.next = 25;\n break;\n }\n selectedShippingMethod = shippingMethodsData.shippingMethods[0];\n _context3.next = 12;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: selectedShippingMethod.shipmentUUID,\n methodID: selectedShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 12:\n calculationResponse = _context3.sent;\n if (!calculationResponse.ok) {\n _context3.next = 22;\n break;\n }\n shippingMethodsStructured = shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n });\n _context3.next = 17;\n return calculationResponse.json();\n case 17:\n newCalculation = _context3.sent;\n applePayShippingContactUpdate = {\n newShippingMethods: shippingMethodsStructured,\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingContactUpdate);\n _context3.next = 23;\n break;\n case 22:\n reject();\n case 23:\n _context3.next = 26;\n break;\n case 25:\n reject();\n case 26:\n _context3.next = 29;\n break;\n case 28:\n reject();\n case 29:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function onShippingContactSelected(_x8, _x9, _x10) {\n return _onShippingContactSelected.apply(this, arguments);\n }\n return onShippingContactSelected;\n }()\n };\n cartContainer = document.getElementsByClassName(APPLE_PAY);\n _context4.next = 10;\n return createApplePayButton(applePayButtonConfig);\n case 10:\n applePayButton = _context4.sent;\n _context4.next = 13;\n return applePayButton.isAvailable();\n case 13:\n isApplePayButtonAvailable = _context4.sent;\n if (isApplePayButtonAvailable) {\n for (expressCheckoutNodesIndex = 0; expressCheckoutNodesIndex < cartContainer.length; expressCheckoutNodesIndex += 1) {\n applePayButton.mount(cartContainer[expressCheckoutNodesIndex]);\n }\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n case 17:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n})))[\"catch\"](function () {\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n});\nmodule.exports = {\n handleAuthorised: handleAuthorised,\n handleError: handleError,\n handleApplePayResponse: handleApplePayResponse,\n callPaymentFromComponent: callPaymentFromComponent,\n formatCustomerObject: formatCustomerObject\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/applePayExpress.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -142,7 +142,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js index f008bd8d9..c11713377 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js @@ -250,7 +250,7 @@ eval("\n\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/a /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : constants.SCHEME;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(_x, _x2, _x3) {\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction _makeGiftcardPaymentRequest() {\n _makeGiftcardPaymentRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(giftCardData, giftcardBalance, reject) {\n var brandSelect, selectedBrandIndex, giftcardBrand, partialPaymentRequest, partialPaymentResponse;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n brandSelect = document.getElementById('giftCardSelect');\n selectedBrandIndex = brandSelect.selectedIndex;\n giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n _context2.next = 6;\n return makePartialPayment(partialPaymentRequest);\n case 6:\n partialPaymentResponse = _context2.sent;\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x4) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n getGiftCardConfig: getGiftCardConfig,\n getApplePayConfig: getApplePayConfig,\n getCashAppConfig: getCashAppConfig,\n getKlarnaConfig: getKlarnaConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n exposeExpiryDate: false,\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : constants.SCHEME;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(_x, _x2, _x3) {\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction _makeGiftcardPaymentRequest() {\n _makeGiftcardPaymentRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(giftCardData, giftcardBalance, reject) {\n var brandSelect, selectedBrandIndex, giftcardBrand, partialPaymentRequest, partialPaymentResponse;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n brandSelect = document.getElementById('giftCardSelect');\n selectedBrandIndex = brandSelect.selectedIndex;\n giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n _context2.next = 6;\n return makePartialPayment(partialPaymentRequest);\n case 6:\n partialPaymentResponse = _context2.sent;\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _makeGiftcardPaymentRequest.apply(this, arguments);\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x4) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n getGiftCardConfig: getGiftCardConfig,\n getApplePayConfig: getApplePayConfig,\n getCashAppConfig: getCashAppConfig,\n getKlarnaConfig: getKlarnaConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); /***/ }), @@ -262,7 +262,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -286,7 +286,7 @@ eval("\n\nmodule.exports.installmentLocales = ['pt_BR', 'ja_JP', 'tr_TR', 'es_MX /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction makePartialPayment(requestData) {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: window.partialPaymentUrl,\n type: 'POST',\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8'\n }).done(function (response) {\n if (response.error) {\n reject(new Error(\"Partial payment error \".concat(response === null || response === void 0 ? void 0 : response.error)));\n } else {\n var giftCards = response.giftCards,\n rest = _objectWithoutProperties(response, _excluded);\n store.checkout.options.amount = rest.remainingAmount;\n store.adyenOrderData = rest.partialPaymentsOrder;\n store.partialPaymentsOrderObj = rest;\n sessionStorage.setItem('partialPaymentsObj', JSON.stringify(rest));\n store.addedGiftCards = giftCards;\n helpers.setOrderFormData(response);\n initializeCheckout();\n resolve();\n }\n }).fail(function () {\n reject(new Error('makePartialPayment request failed'));\n });\n });\n}\nmodule.exports = {\n makePartialPayment: makePartialPayment\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js?"); +eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction makePartialPayment(requestData) {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: window.partialPaymentUrl,\n type: 'POST',\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8'\n }).done(function (response) {\n if (response.error) {\n reject(new Error(\"Partial payment error \".concat(response === null || response === void 0 ? void 0 : response.error)));\n } else {\n var giftCards = response.giftCards,\n rest = _objectWithoutProperties(response, _excluded);\n store.checkout.options.amount = rest.remainingAmount;\n store.adyenOrderData = rest.partialPaymentsOrder;\n store.partialPaymentsOrderObj = rest;\n sessionStorage.setItem('partialPaymentsObj', JSON.stringify(rest));\n store.addedGiftCards = giftCards;\n helpers.setOrderFormData(response);\n initializeCheckout();\n resolve();\n }\n }).fail(function () {\n reject(new Error('makePartialPayment request failed'));\n });\n });\n}\nmodule.exports = {\n makePartialPayment: makePartialPayment\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js?"); /***/ }), @@ -298,7 +298,7 @@ eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(so /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.initializeCheckout = initializeCheckout;\nvar _document$getElementB;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n getPaymentMethods = _require3.getPaymentMethods,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x, _x2, _x3) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var paymentMethodsResponse, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return getPaymentMethods();\n case 2:\n paymentMethodsResponse = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n setCheckoutConfiguration(paymentMethodsResponse);\n store.checkoutConfiguration.paymentMethodsResponse = _objectSpread(_objectSpread({}, paymentMethodsResponse.AdyenPaymentMethods), {}, {\n imagePath: paymentMethodsResponse.imagePath\n });\n _context3.next = 10;\n return AdyenCheckout(store.checkoutConfiguration);\n case 10:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setInstallments(paymentMethodsResponse.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n }); // Rendering stored payment methods if one-click is enabled in BM\n if (window.adyenRecurringPaymentsEnabled) {\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath);\n }\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath, paymentMethodsResponse.adyenDescriptions);\n case 22:\n renderPosTerminals(paymentMethodsResponse.adyenConnectedTerminals);\n renderGiftCardLogo(paymentMethodsResponse.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls getPaymentMethods and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n setInstallments: setInstallments,\n setAmazonPayConfig: setAmazonPayConfig,\n renderStoredPaymentMethods: renderStoredPaymentMethods,\n renderPaymentMethods: renderPaymentMethods,\n renderPosTerminals: renderPosTerminals,\n isCartModified: isCartModified,\n resolveUnmount: resolveUnmount,\n renderGiftCardLogo: renderGiftCardLogo,\n setGiftCardContainerVisibility: setGiftCardContainerVisibility,\n applyGiftCards: applyGiftCards,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.initializeCheckout = initializeCheckout;\nvar _document$getElementB;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n getPaymentMethods = _require3.getPaymentMethods,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x, _x2, _x3) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var paymentMethodsResponse, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return getPaymentMethods();\n case 2:\n paymentMethodsResponse = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n setCheckoutConfiguration(paymentMethodsResponse);\n store.checkoutConfiguration.paymentMethodsResponse = _objectSpread(_objectSpread({}, paymentMethodsResponse.AdyenPaymentMethods), {}, {\n imagePath: paymentMethodsResponse.imagePath\n });\n _context3.next = 10;\n return AdyenCheckout(store.checkoutConfiguration);\n case 10:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setInstallments(paymentMethodsResponse.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n }); // Rendering stored payment methods if one-click is enabled in BM\n if (window.adyenRecurringPaymentsEnabled) {\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath);\n }\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, paymentMethodsResponse.imagePath, paymentMethodsResponse.adyenDescriptions);\n case 22:\n renderPosTerminals(paymentMethodsResponse.adyenConnectedTerminals);\n renderGiftCardLogo(paymentMethodsResponse.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls getPaymentMethods and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n setInstallments: setInstallments,\n setAmazonPayConfig: setAmazonPayConfig,\n renderStoredPaymentMethods: renderStoredPaymentMethods,\n renderPaymentMethods: renderPaymentMethods,\n renderPosTerminals: renderPosTerminals,\n isCartModified: isCartModified,\n resolveUnmount: resolveUnmount,\n renderGiftCardLogo: renderGiftCardLogo,\n setGiftCardContainerVisibility: setGiftCardContainerVisibility,\n applyGiftCards: applyGiftCards,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); /***/ }), @@ -310,7 +310,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n initializeCheckout();\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n var giftCardAmount = store.partialPaymentsOrderObj.remainingAmount ? store.partialPaymentsOrderObj.remainingAmount : store.checkout.options.amount;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name,\n amount: giftCardAmount\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n initializeCheckout = _require.initializeCheckout;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n initializeCheckout();\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n var giftCardAmount = store.partialPaymentsOrderObj.remainingAmount ? store.partialPaymentsOrderObj.remainingAmount : store.checkout.options.amount;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name,\n amount: giftCardAmount\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.paymentMethodsResponse.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); /***/ }), @@ -322,7 +322,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); /***/ }), @@ -394,7 +394,7 @@ eval("\n\nvar customerHelpers = __webpack_require__(/*! base/checkout/customer * /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -418,7 +418,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js index 5b16ba089..ef9294129 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\n\n/**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\nmodule.exports.getPaymentMethods = /*#__PURE__*/function () {\n var _getPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getPaymentMethods() {\n return _getPaymentMethods.apply(this, arguments);\n }\n return getPaymentMethods;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nfunction handleExpressPaymentsVisibility() {\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nfunction _handleExpressPaymentsVisibility() {\n _handleExpressPaymentsVisibility = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _window, expressMethodsOrder, sortOrder, container, toSort;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _window = window, expressMethodsOrder = _window.expressMethodsOrder;\n if (expressMethodsOrder) {\n sortOrder = expressMethodsOrder.split(',');\n container = document.getElementById('express-container');\n toSort = Array.prototype.slice.call(container.children, 0);\n toSort.sort(function (a, b) {\n return sortOrder.indexOf(a.dataset.method) - sortOrder.indexOf(b.dataset.method);\n });\n container.innerHTML = '';\n _toConsumableArray(toSort).map(function (node) {\n return container.appendChild(node);\n });\n }\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nhandleExpressPaymentsVisibility();\ncheckIfExpressMethodsAreReady();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nfunction handleExpressPaymentsVisibility() {\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nfunction _handleExpressPaymentsVisibility() {\n _handleExpressPaymentsVisibility = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _window, expressMethodsOrder, sortOrder, container, toSort;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _window = window, expressMethodsOrder = _window.expressMethodsOrder;\n if (expressMethodsOrder) {\n sortOrder = expressMethodsOrder.split(',');\n container = document.getElementById('express-container');\n toSort = Array.prototype.slice.call(container.children, 0);\n toSort.sort(function (a, b) {\n return sortOrder.indexOf(a.dataset.method) - sortOrder.indexOf(b.dataset.method);\n });\n container.innerHTML = '';\n _toConsumableArray(toSort).map(function (node) {\n return container.appendChild(node);\n });\n }\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nhandleExpressPaymentsVisibility();\ncheckIfExpressMethodsAreReady();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/store/index.js b/cartridges/app_adyen_SFRA/cartridge/store/index.js index 36739e31b..4be419096 100644 --- a/cartridges/app_adyen_SFRA/cartridge/store/index.js +++ b/cartridges/app_adyen_SFRA/cartridge/store/index.js @@ -4,15 +4,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == var _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; } -function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); } +function _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; } +function _initializerWarningHelper(r, e) { throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform."); } // eslint-disable-next-line var _require = require('mobx'), observable = _require.observable, diff --git a/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml b/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml index 2d12c1758..25bd36677 100644 --- a/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml +++ b/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen.isml @@ -26,7 +26,7 @@ - PSP reference + PSP reference Payment Method Eventcode diff --git a/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml b/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml index 01a9ba00c..bb973a55d 100644 --- a/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml +++ b/cartridges/bm_adyen/cartridge/templates/default/order/PaymentInstrumentInfo_Adyen_Component.isml @@ -27,7 +27,7 @@ - PSP reference + PSP reference Payment Method Eventcode diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js b/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js index cf1929c97..e7c749857 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js @@ -83,6 +83,6 @@ module.exports = { EXTERNAL_PLATFORM_NAME: 'SalesforceCommerceCloud', EXTERNAL_PLATFORM_VERSION: 'SFRA', APPLE_DOMAIN_URL: '/.well-known/apple-developer-merchantid-domain-association', - CHECKOUT_COMPONENT_VERSION: '5.61.0', - VERSION: '24.2.0' + CHECKOUT_COMPONENT_VERSION: '5.64.0', + VERSION: '24.2.1' }; \ No newline at end of file diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/selectShippingMethods.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/selectShippingMethods.js index 8c2d436ea..45f497abd 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/selectShippingMethods.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/selectShippingMethods.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js index a45104d55..f7d40efab 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/expressPayments/shippingMethods.js @@ -1,8 +1,29 @@ "use strict"; var BasketMgr = require('dw/order/BasketMgr'); +var Transaction = require('dw/system/Transaction'); var AdyenLogs = require('*/cartridge/adyen/logs/adyenCustomLogs'); var AdyenHelper = require('*/cartridge/adyen/utils/adyenHelper'); +var addressMapping = { + city: 'setCity', + countryCode: 'setCountryCode', + stateCode: 'setStateCode', + postalCode: 'setPostalCode' +}; + +/** + * Sets address properties for express PM + * @param {dw.order.shippingAddress} shippingAddress - shippingAddress for the default shipment + * @param {object} inputAddress - address coming from the input field based on shopper selection + * @param {object} mapping - address mapping between property and setter for that property + */ +function setAddressProperties(shippingAddress, inputAddress, mapping) { + Object.keys(inputAddress).forEach(function (key) { + if (inputAddress[key] && mapping[key]) { + shippingAddress[mapping[key]](inputAddress[key]); + } + }); +} /** * Make a request to Adyen to get shipping methods @@ -14,11 +35,22 @@ function callGetShippingMethods(req, res, next) { address = { city: req.querystring.city, countryCode: req.querystring.countryCode, - stateCode: req.querystring.stateCode + stateCode: req.querystring.stateCode, + postalCode: req.querystring.postalCode }; } var currentBasket = BasketMgr.getCurrentBasket(); - var currentShippingMethodsModels = AdyenHelper.getApplicableShippingMethods(currentBasket.getDefaultShipment(), address); + var shipment = currentBasket.getDefaultShipment(); + Transaction.wrap(function () { + var shippingAddress = shipment.shippingAddress; + if (!shippingAddress) { + shippingAddress = currentBasket.getDefaultShipment().createShippingAddress(); + } + if (address) { + setAddressProperties(shippingAddress, address, addressMapping); + } + }); + var currentShippingMethodsModels = AdyenHelper.getApplicableShippingMethods(shipment, address); res.json({ shippingMethods: currentShippingMethodsModels }); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/processForm.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/processForm.js index 9bba5f7f5..a7dcbf3b9 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/processForm.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/processForm.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var COHelpers = require('*/cartridge/scripts/checkout/checkoutHelpers'); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js index 73966b9fe..352431e2d 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var CustomerMgr = require('dw/customer/CustomerMgr'); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/cancelPartialPaymentOrder.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/cancelPartialPaymentOrder.js index 181e9e315..01c6979b7 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/cancelPartialPaymentOrder.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/cancelPartialPaymentOrder.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/checkBalance.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/checkBalance.js index 52351a09f..7958dd27f 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/checkBalance.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/checkBalance.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPayment.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPayment.js index 01ff943a6..da93738b6 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPayment.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPayment.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Transaction = require('dw/system/Transaction'); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPaymentsOrder.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPaymentsOrder.js index dc46f98c8..ad8c645bb 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPaymentsOrder.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/partialPayments/partialPaymentsOrder.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenCheckout.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenCheckout.js index 3e8fa0a62..aae503949 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenCheckout.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenCheckout.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenLevelTwoThreeData.js b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenLevelTwoThreeData.js index 08c4109a4..968ae8184 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenLevelTwoThreeData.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/scripts/payments/adyenLevelTwoThreeData.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/utils/adyenHelper.js b/cartridges/int_adyen_SFRA/cartridge/adyen/utils/adyenHelper.js index 26b451074..57c350e92 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/utils/adyenHelper.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/utils/adyenHelper.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/handleNotify.js b/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/handleNotify.js index 80d3bf0a0..126f4e99f 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/handleNotify.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/handleNotify.js @@ -1,8 +1,8 @@ "use strict"; -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /** * ###### * ###### diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js index df1940a95..5e71dd552 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var server = require('server'); diff --git a/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js b/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js index 25a6dc786..581aebc3f 100644 --- a/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js +++ b/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js @@ -3,7 +3,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function getField(name, obj) { From dcec2c80d8a0ffd8f93ea8dcb52b17d8a4520a9c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 11 Jun 2024 12:19:29 +0000 Subject: [PATCH 9/9] chore: committing the project files --- cartridges/app_adyen_SFRA/.project | 2 +- cartridges/bm_adyen/.project | 2 +- cartridges/int_adyen_SFRA/.project | 2 +- cartridges/int_custom_cartridge/.project | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cartridges/app_adyen_SFRA/.project b/cartridges/app_adyen_SFRA/.project index 4e9508430..8f854dbed 100644 --- a/cartridges/app_adyen_SFRA/.project +++ b/cartridges/app_adyen_SFRA/.project @@ -1,7 +1,7 @@ app_adyen_SFRA - v24.2.0 + v24.2.1 diff --git a/cartridges/bm_adyen/.project b/cartridges/bm_adyen/.project index a47d22d74..1075d9832 100644 --- a/cartridges/bm_adyen/.project +++ b/cartridges/bm_adyen/.project @@ -1,7 +1,7 @@ bm_adyen - v24.2.0 + v24.2.1 diff --git a/cartridges/int_adyen_SFRA/.project b/cartridges/int_adyen_SFRA/.project index 5c92925d7..57b68f17d 100644 --- a/cartridges/int_adyen_SFRA/.project +++ b/cartridges/int_adyen_SFRA/.project @@ -1,7 +1,7 @@ int_adyen_SFRA - v24.2.0 + v24.2.1 diff --git a/cartridges/int_custom_cartridge/.project b/cartridges/int_custom_cartridge/.project index 4fa820c2a..8b96d4963 100644 --- a/cartridges/int_custom_cartridge/.project +++ b/cartridges/int_custom_cartridge/.project @@ -1,7 +1,7 @@ int_custom_cartridge - v24.2.0 + v24.2.1