{"version":3,"file":"frontend/block-checkout.js","mappings":"kCAAAA,EAAOC,QAAUC,OAAW,GAAc,U,GCCtCC,EAA2B,CAAC,EAGhC,SAASC,oBAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,qBAG/CJ,EAAOC,OACf,CCrBAG,oBAAoBK,EAAKT,IACxB,IAAIU,EAASV,GAAUA,EAAOW,WAC7B,IAAOX,EAAiB,QACxB,IAAM,EAEP,OADAI,oBAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,oBAAoBQ,EAAI,CAACX,EAASa,KACjC,IAAI,IAAIC,KAAOD,EACXV,oBAAoBY,EAAEF,EAAYC,KAASX,oBAAoBY,EAAEf,EAASc,IAC5EE,OAAOC,eAAejB,EAASc,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,oBAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,G,gCCGjEI,EAAAA,EAAAA,YAAW,oBAAqB,CAAC,E","sources":["webpack://acima-leasing-payment-gateway/external window [\"wc\",\"wcSettings\"]","webpack://acima-leasing-payment-gateway/webpack/bootstrap","webpack://acima-leasing-payment-gateway/webpack/runtime/compat get default export","webpack://acima-leasing-payment-gateway/webpack/runtime/define property getters","webpack://acima-leasing-payment-gateway/webpack/runtime/hasOwnProperty shorthand","webpack://acima-leasing-payment-gateway/./resources/js/frontend/block-checkout.js"],"sourcesContent":["module.exports = window[\"wc\"][\"wcSettings\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { AcimaCreditCheckout } from './acima-credit-checkout';\nimport { getSetting } from '@woocommerce/settings';\n\nconst settings = getSetting('acima_credit_data', {});\n\nconst processAcimaPayment = async (paymentData) => {\n try {\n const response = await fetch('/wp-json/wc-acima-credit/v1/process-payment', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-WP-Nonce': window.acimaBlockCheckout.nonce || '',\n },\n body: JSON.stringify({\n payment_method: window.acimaCredit.payment_method,\n order_id: paymentData.transactionData.orderId,\n }),\n });\n\n const data = await response.json();\n\n if (data.success) {\n const checkout = new AcimaCreditCheckout(\n settings,\n data.customer_data,\n data.transaction_data,\n data.thank_you_page,\n paymentData.transactionData.orderId,\n paymentData.orderNonce,\n paymentData.storeApiNonce\n );\n const result = await checkout.initCheckout();\n return {\n success: data.success,\n isAcimaCredit: true,\n ...result\n };\n } else {\n throw new Error(data.message || 'Payment processing failed.');\n }\n } catch (error) {\n console.error('Error during Acima payment processing:', error);\n throw error;\n }\n};\n\nexport { processAcimaPayment };"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","getSetting"],"sourceRoot":""}