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/webpack/runtime/compat get default export","webpack://wc_stripe/webpack/runtime/define property getters","webpack://wc_stripe/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe/webpack/runtime/make namespace object","webpack://wc_stripe/external window \"jQuery\"","webpack://wc_stripe/external window [\"wc_stripe\"]","webpack://wc_stripe/./packages/woocommerce-tm-extra-product-options/assets/js/product.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"jQuery\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wc_stripe\"];","import $ from 'jquery';\nimport {product_gateways as gateways} from '@paymentplugins/wc-stripe';\n\nconst handleFieldChange = (e) => {\n let tmcpCalculation = false;\n // when a extra product option field changes, update the cart calculation\n gateways.forEach(gateway => {\n if (gateway.maybe_calculate_cart) {\n tmcpCalculation = true;\n gateway.maybe_calculate_cart();\n tmcpCalculation = false;\n }\n });\n}\n\nconst getExtraProductData = () => {\n const data = $('form.cart .tmcp-field').serializeArray().reduce((carry, obj) => {\n return {...carry, [obj.name]: obj.value};\n }, {});\n return data;\n}\n\n$(() => {\n if (gateways.length) {\n\n gateways.forEach(gateway => {\n // add to cart data function wrapper\n const getAddToCartData = gateway.get_add_to_cart_data;\n gateway.get_add_to_cart_data = () => {\n return {\n ...getAddToCartData.call(gateway),\n ...getExtraProductData()\n }\n }\n });\n\n $(document.body).on('change', 'form.cart .tmcp-field', handleFieldChange);\n }\n})"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","handleFieldChange","e","gateways","forEach","gateway","maybe_calculate_cart","$","length","getAddToCartData","get_add_to_cart_data","_objectSpread","serializeArray","reduce","carry","_defineProperty","name","document","body","on"],"sourceRoot":""}