{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./assets/js/src/utils/dom.js","webpack:///./assets/js/src/utils/form.js","webpack:///./assets/js/src/utils/index.js","webpack:///./assets/js/src/frontend/elements/index.js","webpack:///./node_modules/@babel/runtime/regenerator/index.js","webpack:///external \"jQuery\"","webpack:///./assets/js/src/frontend/checkout/payment-methods.js","webpack:///./node_modules/@babel/runtime/helpers/typeof.js","webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./assets/js/src/frontend/checkout/payment.js","webpack:///./node_modules/es6-promise-promise/index.js","webpack:///./assets/js/src/frontend/checkout/index.js","webpack:///./assets/js/src/utils/api-request.js","webpack:///./node_modules/lodash.foreach/index.js","webpack:///./assets/js/src/utils/notice.js","webpack:///./assets/js/src/frontend/elements/intents.js","webpack:///./assets/js/src/utils/polyfill-includes.js","webpack:///./node_modules/regenerator-runtime/runtime.js","webpack:///./node_modules/es6-promise-promise/node_modules/es6-promise/dist/es6-promise.js","webpack:///./node_modules/process/browser.js","webpack:///(webpack)/buildin/global.js","webpack:///./assets/js/src/frontend/profile-editor/actions.js","webpack:///./assets/js/src/frontend/profile-editor/add-new.js","webpack:///./assets/js/src/frontend/profile-editor/index.js","webpack:///./assets/js/src/frontend/payment-receipt/update-payment-method.js","webpack:///./assets/js/src/frontend/payment-receipt/index.js","webpack:///./assets/js/src/frontend/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","domReady","forEach","arguments","callback","document","addEventListener","getNextSiblings","el","siblings","sibling","nextElementSibling","nodeType","push","hasValidInputs","form","plainInputsValid","querySelectorAll","input","checkValidity","triggerBrowserValidation","submit","createElement","type","style","display","appendChild","click","remove","fieldValueOrNull","field","mountCardElement","elementsInstance","toMount","elementsOptions","rpress_stripe_vars","cardNameEl","querySelector","inputStyles","window","getComputedStyle","styleTag","innerHTML","getPropertyValue","body","base","color","fontFamily","fontSize","fontWeight","fontSmoothing","card","toMountEl","event","errorsContainer","error","generateNotice","message","handleElementError","mount","getPaymentMethod","billingDetailsForm","cardElement","selectedPaymentMethod","$","length","val","Promise","resolve","id","exists","rpressStripe","createPaymentMethod","billing_details","getBillingDetails","then","result","paymentMethod","address","line1","line2","city","state","postal_code","country","jQuery","paymentMethods","getBillingFieldsToggle","toggleBillingFields","e","target","checked","existingPaymentMethods","existingPaymentMethod","paymentSource","isNew","newCardForm","billingAddressToggle","removeClass","closest","addClass","addressFieldMap","card_address","card_address_2","card_city","card_state","card_zip","billing_country","addressEl","addressField","getElementById","selected","addressString","billingDetailsEl","billingDetails","dataset","required","changeEvent","createEvent","initEvent","dispatchEvent","ajaxSuccess","xhr","options","data","includes","responseText","stateField","address_state","billingAddressPreview","innerText","join","onPaymentSourceChange","currentPaymentMethod","paymentMethodChangeEvent","isVisible","updateAddressWrapperEl","billingFieldWrappers","wrap","_typeof2","obj","iterator","constructor","_typeof","info","gen","arg","reject","done","_next","_throw","fn","self","this","args","apply","asyncGeneratorStep","err","undefined","configurable","writable","paymentForm","elements","off","onSubmit","on","watchInitialValidation","a","formData","serialize","paymentMethodId","paymentMethodExists","apiRequest","form_data","payment_method_id","payment_method_exists","checkoutForm","handleIntent","intent","handledIntent","rpressPayment","captureIntent","finalIntent","status","cancellation_reason","completePayment","location","replace","successPageUri","failurePageUri","handleException","enableForm","trim","onSubmitDelay","preventDefault","trigger","rpress_global_vars","complete_purchase","hide","attr","notice","generic_error","checkout_error_anchor","before","setup","rpress_scripts","is_checkout","singleGateway","gateway","action","dataType","xhrFields","withCredentials","url","ajaxurl","deferred","Deferred","jqXHR","ajax","response","success","rejectWith","fail","promise","abort","MAX_SAFE_INTEGER","argsTag","funcTag","genTag","reIsUint","arrayEach","array","iteratee","index","func","transform","objectProto","objectToString","toString","propertyIsEnumerable","nativeKeys","keys","arrayLikeKeys","inherited","isArray","isObjectLike","isArrayLike","isArrayLikeObject","isArguments","Array","baseTimes","String","skipIndexes","isIndex","eachFunc","fromRight","baseEach","baseFor","collection","iterable","keysFunc","props","createBaseFor","baseKeys","Ctor","proto","test","isLength","tag","isObject","isFunction","identity","classList","add","clear","retrieve","intentId","intentType","intent_id","intent_type","confirm","capture","update","handle","confirmedIntent","updatedIntent","next_action","cardHandler","confirmation_method","client_secret","setupIntent","paymentIntent","search","start","indexOf","runtime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","GenStateSuspendedStart","method","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","GenStateSuspendedYield","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","invoke","__await","unwrapped","TypeError","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","factory","x","len","vertxNext","customSchedulerFn","asap","queue","flush","scheduleFlush","browserWindow","browserGlobal","BrowserMutationObserver","MutationObserver","WebKitMutationObserver","isNode","process","isWorker","Uint8ClampedArray","importScripts","MessageChannel","useSetTimeout","globalSetTimeout","setTimeout","channel","iterations","observer","node","onFulfillment","onRejection","_arguments","parent","child","noop","PROMISE_ID","makePromise","_state","invokeCallback","_result","subscribe","_resolve","nextTick","createTextNode","observe","characterData","port1","onmessage","port2","postMessage","vertx","runOnLoop","runOnContext","attemptVertx","Math","random","substring","PENDING","FULFILLED","REJECTED","GET_THEN_ERROR","ErrorObject","getThen","handleMaybeThenable","maybeThenable","then$$","thenable","fulfill","_reject","reason","handleOwnThenable","sealed","fulfillmentHandler","rejectionHandler","tryThen","_label","handleForeignThenable","publishRejection","_onerror","publish","_subscribers","subscribers","settled","detail","TRY_CATCH_ERROR","hasCallback","succeeded","failed","Enumerator","Constructor","_instanceConstructor","_input","_remaining","_enumerate","resolver","needsResolver","initializePromise","needsNew","polyfill","local","global","P","promiseToString","cast","_eachEntry","resolve$$","_then","_settledAt","_willSettleAt","enumerator","all","entries","race","_","_setScheduler","scheduleFn","_setAsap","asapFn","_asap","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","clearTimeout","currentQueue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","run","marker","runClearTimeout","Item","title","browser","env","argv","version","versions","addListener","once","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","g","paymentMethodAction","payment_method","nonce","handleNotice","reload","onToggleUpdateForm","source","cardActionsEl","isFormVisible","onUpdatePaymentMethod","fieldName","submitButton","disabled","loading","onDeletePaymentMethod","onSetDefaultPaymentMethod","alert","item","insertBefore","onToggleForm","formFields","cancelButton","submitEvent","onAddPaymentMethod","billingForm","addPaymentMethod","catch","updateButton","deleteButton","setDefaultButton","updatePaymentMethodForm","setPaymentMethods","onAuthorizePayment","disableForm","retrieveIntent","authorization","payment","container","Stripe","publishable_key","_plugin","confirmIntent","setupCheckout","setupProfile","setupPaymentHistory"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,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iBACAsZ,mBACAjf,oBAIDrF,YACC8kB,IACAC,EACAC,GAEA,MAAQ1hB,GACT8f,MAAO9f,EAAME,UAzBf","file":"assets/js/build/app.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 25);\n","/**\n * Internal dependencies.\n */\n/**\n * External dependencies\n */\nimport { forEach } from 'utils';\n\n/**\n * forEach implementation that can handle anything.\n */\nexport { default as forEach } from 'lodash.foreach';\n\n/**\n * DOM ready.\n *\n * Handles multiple callbacks.\n *\n * @param {Function} Callback function to run.\n */\nexport function domReady() {\n\tforEach( arguments, ( callback ) => {\n\t\tdocument.addEventListener( 'DOMContentLoaded', callback );\n\t} );\n}\n\n/**\n * Retrieves all following siblings of an element.\n *\n * @param {HTMLElement} el Starting element.\n * @return {Array} siblings List of sibling elements.\n */\nexport function getNextSiblings( el ) {\n\tconst siblings = [];\n\tlet sibling = el.nextElementSibling;\n\n\twhile ( sibling ) {\n\t\tif ( sibling.nodeType === 1 ) {\n\t\t\tsiblings.push( sibling );\n\t\t}\n\n\t\tsibling = sibling.nextElementSibling;\n\t}\n\n\treturn siblings;\n}\n","/**\n * Internal dependencies.\n */\n/**\n * External dependencies\n */\nimport { forEach } from 'utils';\n\n/**\n * Checks is a form passes HTML5 validation.\n *\n * @param {HTMLElement} form Form to trigger validation on.\n * @return {Bool} If the form has valid inputs.\n */\nexport function hasValidInputs( form ) {\n\tlet plainInputsValid = true;\n\n\tforEach( form.querySelectorAll( 'input' ), function( input ) {\n\t\tif ( input.checkValidity && ! input.checkValidity() ) {\n\t\t\tplainInputsValid = false;\n\t\t}\n\t} );\n\n\treturn plainInputsValid;\n}\n\n/**\n * Triggers HTML5 browser validation.\n *\n * @param {HTMLElement} form Form to trigger validation on.\n */\nexport function triggerBrowserValidation( form ) {\n\tconst submit = document.createElement( 'input' );\n\tsubmit.type = 'submit';\n\tsubmit.style.display = 'none';\n\n\tform.appendChild( submit );\n\tsubmit.click();\n\tsubmit.remove();\n}\n\n/**\n * Returns an input's value, or null.\n *\n * @param {HTMLElement} field Field to retrieve value from.\n * @return {null|string} Value if the field has a value.\n */\nexport function fieldValueOrNull( field ) {\n\tif ( ! field ) {\n\t\treturn null;\n\t}\n\n\tif ( '' === field.value ) {\n\t\treturn null;\n\t}\n\n\treturn field.value;\n}\n","import './polyfill-includes.js';\n\nexport * from './api-request.js';\nexport * from './dom.js';\nexport * from './notice.js';\nexport * from './form.js';\n","/* global $, rpress_stripe_vars */\n\n/**\n * Internal dependencies.\n */\nimport { generateNotice, fieldValueOrNull } from 'utils'; // eslint-disable-line @wordpress/dependency-group\n\n// Intents.\nexport * from './intents.js';\n\n/**\n * Mounts an Elements Card to the DOM and adds event listeners to submission.\n *\n * @link https://stripe.com/docs/stripe-js/reference#the-elements-object\n *\n * @param {Elements} elementsInstance Stripe Elements instance.\n * @param {string} toMount Selector to mount Element on.\n * @return {Element} Stripe Element.\n */\nexport function mountCardElement( elementsInstance, toMount = '#rpress-stripe-card-element' ) {\n\tconst elementsOptions = rpress_stripe_vars.elementsOptions || {};\n\n\t// Try to mimick existing input styles.\n\tconst cardNameEl = document.querySelector( '.card-name.rpress-input' );\n\n\tif ( cardNameEl ) {\n\t\tconst inputStyles = window.getComputedStyle( cardNameEl );\n\n\t\t// Inject inline CSS instead of applying to the Element so it can be overwritten.\n\t\tconst styleTag = document.createElement( 'style' );\n\t\tstyleTag.innerHTML = `.StripeElement {\n\t\t\tbackground-color: ${ inputStyles.getPropertyValue( 'background-color' ) };\n\t\t\tborder-color: ${ inputStyles.getPropertyValue( 'border-color' ) };\n\t\t\tborder-width: ${ inputStyles.getPropertyValue( 'border-width' ) };\n\t\t\tborder-style: ${ inputStyles.getPropertyValue( 'border-style' ) };\n\t\t\tborder-radius: ${ inputStyles.getPropertyValue( 'border-radius' ) };\n\t\t\tpadding: ${ inputStyles.getPropertyValue( 'padding' ) };\n\t\t}`;\n\t\tdocument.body.appendChild( styleTag );\n\n\t\t// Add default styles for the iframe input if none exist.\n\t\tif ( ! elementsOptions.style ) {\n\t\t\telementsOptions.style = {\n\t\t\t\tbase: {\n\t\t\t\t\tcolor: inputStyles.getPropertyValue( 'color' ),\n\t\t\t\t\tfontFamily: inputStyles.getPropertyValue( 'font-family' ),\n\t\t\t\t\tfontSize: inputStyles.getPropertyValue( 'font-size' ),\n\t\t\t\t\tfontWeight: inputStyles.getPropertyValue( 'font-weight' ),\n\t\t\t\t\tfontSmoothing: inputStyles.getPropertyValue( '-webkit-font-smoothing' ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\tconst card = elementsInstance\n\t\t.create( 'card', elementsOptions );\n\n\tconst toMountEl = document.querySelector( toMount );\n\n\tcard\n\t\t.addEventListener( 'change', ( event ) => {\n\t\t\thandleElementError( event, toMountEl );\n\t\t} )\n\t\t.mount( toMountEl );\n\n\treturn card;\n}\n\n/**\n * Handles error output for Elements Card.\n *\n * @param {Event} event Change event on the Card Element.\n * @param {HTMLElement} toMountEl Element the card field is being mounted on.\n */\nfunction handleElementError( event, toMountEl ) {\n\tconst errorsContainer = toMountEl.nextElementSibling;\n\n\t// Only show one error at once.\n\terrorsContainer.innerHTML = '';\n\n\tif ( event.error ) {\n\t\terrorsContainer.appendChild( generateNotice( event.error.message ) );\n\t}\n}\n\n/**\n * Retrieves (or creates) a PaymentMethod.\n *\n * @param {HTMLElement} billingDetailsForm Form to find data from.\n * @return {Object} PaymentMethod ID and if it previously existed.\n */\nexport function getPaymentMethod( billingDetailsForm, cardElement ) {\n\tconst selectedPaymentMethod = $( 'input[name=\"rpress_stripe_existing_card\"]:checked' );\n\n\t// An existing PaymentMethod is selected.\n\tif ( selectedPaymentMethod.length > 0 && 'new' !== selectedPaymentMethod.val() ) {\n\t\treturn Promise.resolve( {\n\t\t\tid: selectedPaymentMethod.val(),\n\t\t\texists: true,\n\t\t} );\n\t}\n\n\t// Create a PaymentMethod using the Element data.\n\treturn window.rpressStripe\n\t\t.createPaymentMethod(\n\t\t\t'card',\n\t\t\tcardElement,\n\t\t\t{\n\t\t\t\tbilling_details: getBillingDetails( billingDetailsForm ),\n\t\t\t}\n\t\t)\n\t\t.then( function( result ) {\n\t\t\tif ( result.error ) {\n\t\t\t\tthrow result.error;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tid: result.paymentMethod.id,\n\t\t\t\texists: false,\n\t\t\t};\n\t\t} );\n}\n\n/**\n * Retrieves billing details from the Billing Details sections of a form.\n *\n * @param {HTMLElement} form Form to find data from.\n * @return {Object} Billing details\n */\nexport function getBillingDetails( form ) {\n\treturn {\n\t\t// @todo add Phone\n\t\t// @todo add Email\n\t\tname: fieldValueOrNull( form.querySelector( '.card-name' ) ),\n\t\taddress: {\n\t\t\tline1: fieldValueOrNull( form.querySelector( '.card-address' ) ),\n\t\t\tline2: fieldValueOrNull( form.querySelector( '.card-address-2' ) ),\n\t\t\tcity: fieldValueOrNull( form.querySelector( '.card-city' ) ),\n\t\t\tstate: fieldValueOrNull( form.querySelector( '.card_state' ) ),\n\t\t\tpostal_code: fieldValueOrNull( form.querySelector( '.card-zip' ) ),\n\t\t\tcountry: fieldValueOrNull( form.querySelector( '#billing_country' ) ),\n\t\t},\n\t};\n}\n","module.exports = require(\"regenerator-runtime\");\n","module.exports = jQuery;","/* global $ */\n\n/**\n * Internal dependencies.\n */\nimport { forEach, getNextSiblings } from 'utils'; // eslint-disable-line @wordpress/dependency-group\n\n/**\n *\n */\nexport function paymentMethods() {\n\t// Toggle only shows if using Full Address (for some reason).\n\tif ( getBillingFieldsToggle() ) {\n\t\t// Hide fields initially.\n\t\ttoggleBillingFields( false );\n\n\t\t/**\n\t\t * Binds change event to \"Update billing address\" toggle to show/hide address fields.\n\t\t *\n\t\t * @param {Event} e Change event.\n\t\t */\n\t\tgetBillingFieldsToggle().addEventListener( 'change', function( e ) {\n\t\t\treturn toggleBillingFields( e.target.checked );\n\t\t} );\n\t}\n\n\t// Payment method toggles.\n\tconst existingPaymentMethods = document.querySelectorAll( '.rpress-stripe-existing-card' );\n\n\tif ( 0 !== existingPaymentMethods.length ) {\n\t\tforEach( existingPaymentMethods, function( existingPaymentMethod ) {\n\t\t\t/**\n\t\t\t * Binds change event to credit card toggles.\n\t\t\t *\n\t\t\t * @param {Event} e Change event.\n\t\t\t */\n\t\t\treturn existingPaymentMethod.addEventListener( 'change', function( e ) {\n\t\t\t\treturn onPaymentSourceChange( e.target );\n\t\t\t} );\n\t\t} );\n\n\t\t// Simulate change of payment method to populate current fields.\n\t\tlet currentPaymentMethod = document.querySelector( '.rpress-stripe-existing-card:checked' );\n\n\t\tif ( ! currentPaymentMethod ) {\n\t\t\tcurrentPaymentMethod = document.querySelector( '.rpress-stripe-existing-card:first-of-type' );\n\t\t\tcurrentPaymentMethod.checked = true;\n\t\t}\n\n\t\tconst paymentMethodChangeEvent = document.createEvent( 'Event' );\n\t\tpaymentMethodChangeEvent.initEvent( 'change', true, false );\n\t\tcurrentPaymentMethod.dispatchEvent( paymentMethodChangeEvent );\n\t}\n}\n\n/**\n * Determines if the billing fields can be toggled.\n *\n * @return {Bool} True if the toggle exists.\n */\nfunction getBillingFieldsToggle() {\n\treturn document.getElementById( 'rpress-stripe-update-billing-address' );\n}\n\n/**\n * Toggles billing fields visiblity.\n *\n * Assumes the toggle control is the first item in the \"Billing Details\" fieldset.\n *\n * @param {Bool} isVisible Billing item visibility.\n */\nfunction toggleBillingFields( isVisible ) {\n\tconst updateAddressWrapperEl = document.querySelector( '.rpress-stripe-update-billing-address-wrapper' );\n\n\tif ( ! updateAddressWrapperEl ) {\n\t\treturn;\n\t}\n\n\t// Find all elements after the toggle.\n\tconst billingFieldWrappers = getNextSiblings( updateAddressWrapperEl );\n\tconst billingAddressPreview = document.querySelector( '.rpress-stripe-update-billing-address-current' );\n\n\tbillingFieldWrappers.forEach( function( wrap ) {\n\t\twrap.style.display = isVisible ? 'block' : 'none';\n\t} );\n\n\t// Hide address preview.\n\tif ( billingAddressPreview ) {\n\t\tbillingAddressPreview.style.display = isVisible ? 'none' : 'block';\n\t}\n}\n\n/**\n * Manages UI state when the payment source changes.\n *\n * @param {HTMLElement} paymentSource Selected payment source. (Radio element with data).\n */\nfunction onPaymentSourceChange( paymentSource ) {\n\tconst isNew = 'new' === paymentSource.value;\n\tconst newCardForm = document.querySelector( '.rpress-stripe-new-card' );\n\tconst billingAddressToggle = document.querySelector( '.rpress-stripe-update-billing-address-wrapper' );\n\n\t// Toggle card details field.\n\tnewCardForm.style.display = isNew ? 'block' : 'none';\n\n\tif ( billingAddressToggle ) {\n\t\tbillingAddressToggle.style.display = isNew ? 'none' : 'block';\n\t}\n\n\t// @todo don't be lazy.\n\t$( '.rpress-stripe-card-radio-item' ).removeClass( 'selected' );\n\t$( paymentSource ).closest( '.rpress-stripe-card-radio-item' ).addClass( 'selected' );\n\n\tconst addressFieldMap = {\n\t\tcard_address: 'address_line1',\n\t\tcard_address_2: 'address_line2',\n\t\tcard_city: 'address_city',\n\t\tcard_state: 'address_state',\n\t\tcard_zip: 'address_zip',\n\t\tbilling_country: 'address_country',\n\t};\n\n\t// New card is being used, show fields and reset them.\n\tif ( isNew ) {\n\t\t// Reset all fields.\n\t\tfor ( const addressEl in addressFieldMap ) {\n\t\t\tif ( ! addressFieldMap.hasOwnProperty( addressEl ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst addressField = document.getElementById( addressEl );\n\n\t\t\tif ( addressField ) {\n\t\t\t\taddressField.value = '';\n\t\t\t\taddressField.selected = '';\n\t\t\t}\n\t\t}\n\n\t\t// Show billing fields.\n\t\ttoggleBillingFields( true );\n\n\t\t// Existing card is being used.\n\t\t// Ensure the billing fields are hidden, and update their values with saved information.\n\t} else {\n\t\tconst addressString = [];\n\t\tconst billingDetailsEl = document.getElementById( paymentSource.id + '-billing-details' );\n\n\t\tif ( ! billingDetailsEl ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide billing fields.\n\t\ttoggleBillingFields( false );\n\n\t\t// Uncheck \"Update billing address\"\n\t\tif ( getBillingFieldsToggle() ) {\n\t\t\tgetBillingFieldsToggle().checked = false;\n\t\t}\n\n\t\t// Update billing address fields with saved card values.\n\t\tconst billingDetails = billingDetailsEl.dataset;\n\n\t\tfor ( const addressEl in addressFieldMap ) {\n\t\t\tif ( ! addressFieldMap.hasOwnProperty( addressEl ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst addressField = document.getElementById( addressEl );\n\n\t\t\tif ( ! addressField ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst value = billingDetails[ addressFieldMap[ addressEl ] ];\n\n\t\t\t// Set field value.\n\t\t\taddressField.value = value;\n\n\t\t\t// Generate an address string from values.\n\t\t\tif ( '' !== value ) {\n\t\t\t\taddressString.push( value );\n\t\t\t}\n\n\t\t\t// This field is required but does not have a saved value, show all fields.\n\t\t\tif ( addressField.required && '' === value ) {\n\t\t\t\t// @todo DRY up some of this DOM usage.\n\t\t\t\ttoggleBillingFields( true );\n\n\t\t\t\tif ( getBillingFieldsToggle() ) {\n\t\t\t\t\tgetBillingFieldsToggle().checked = true;\n\t\t\t\t}\n\n\t\t\t\tif ( billingAddressToggle ) {\n\t\t\t\t\tbillingAddressToggle.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Trigger change event when the Country field is updated.\n\t\t\tif ( 'billing_country' === addressEl ) {\n\t\t\t\tconst changeEvent = document.createEvent( 'Event' );\n\t\t\t\tchangeEvent.initEvent( 'change', true, true );\n\t\t\t\taddressField.dispatchEvent( changeEvent );\n\t\t\t}\n\t\t}\n\n\t\t// SUPER ghetto way to watch for core form state because no consistent events are in place.\n\t\t// Core calls `rpress_cart_billing_address_updated` but only on checkout. These methods\n\t\t// can be used anywhere.\n\t\t$( document ).ajaxSuccess( function( event, xhr, options ) {\n\t\t\tif ( ! options || ! options.data || ! xhr ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\toptions.data.includes( 'action=rpress_get_shop_states' ) &&\n\t\t\t\toptions.data.includes( 'field_name=card_state' ) &&\n\t\t\t\t( xhr.responseText && xhr.responseText.includes( 'card_state' ) )\n\t\t\t) {\n\t\t\t\tconst stateField = document.getElementById( 'card_state' );\n\n\t\t\t\tif ( stateField ) {\n\t\t\t\t\tstateField.value = billingDetails.address_state;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t// Update address string summary.\n\t\tconst billingAddressPreview = document.querySelector( '.rpress-stripe-update-billing-address-current' );\n\n\t\tif ( billingAddressPreview ) {\n\t\t\tbillingAddressPreview.innerText = addressString.join( ', ' );\n\t\t}\n\t}\n}\n","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","/* global $, rpress_stripe_vars, rpress_global_vars */\n\n/**\n * Internal dependencies\n */\n/**\n * External dependencies\n */\nimport {\n\tmountCardElement,\n\tgetPaymentMethod,\n\tcapture as captureIntent,\n\thandle as handleIntent,\n} from 'frontend/elements'; // eslint-disable-line @wordpress/dependency-group\n\nimport { apiRequest, generateNotice } from 'utils'; // eslint-disable-line @wordpress/dependency-group\n\n/**\n * Binds Payment submission functionality.\n *\n * Resets before rebinding to avoid duplicate events\n * during gateway switching.\n */\nexport function paymentForm() {\n\t// Mount Card Element.\n\twindow.rpressStripe.cardElement = mountCardElement( window.rpressStripe.elements() );\n\n\t// Bind form submission.\n\t// Needs to be jQuery since that is what core submits against.\n\t$( '#rpress_purchase_form' ).off( 'submit', onSubmit );\n\t$( '#rpress_purchase_form' ).on( 'submit', onSubmit );\n\n\t// SUPER ghetto way to watch for core form validation because no events are in place.\n\t// Called after the purchase form is submitted (via `click` or `submit`)\n\t$( document ).off( 'ajaxSuccess', watchInitialValidation );\n\t$( document ).on( 'ajaxSuccess', watchInitialValidation );\n}\n\n/**\n * Processes Stripe gateway-specific functionality after core AJAX validation has run.\n */\nasync function onSubmitDelay() {\n\ttry {\n\t\t// Form data to send to intent requests.\n\t\tconst formData = $( '#rpress_purchase_form' ).serialize();\n\n\t\t// Retrieve or create a PaymentMethod.\n\t\tconst paymentMethod = await getPaymentMethod( document.getElementById( 'rpress_purchase_form' ), window.rpressStripe.cardElement );\n\n\t\t// Run the modified `_rpress_stripe_process_purchase_form` and create an Intent.\n\t\tconst checkoutForm = await processForm( paymentMethod.id, paymentMethod.exists );\n\n\t\t// Handle any actions required by the Intent State Machine (3D Secure, etc).\n\t\tconst handledIntent = await handleIntent(\n\t\t\tcheckoutForm.intent,\n\t\t\t{\n\t\t\t\tform_data: formData,\n\t\t\t}\n\t\t);\n\n\t\t// Create an RPRESS payment record.\n\t\tconst rpressPayment = await createPayment( handledIntent );\n\n\t\t// Capture any unpcaptured intents.\n\t\tconst finalIntent = await captureIntent(\n\t\t\trpressPayment.intent,\n\t\t\t{\n\t\t\t\tform_data: formData,\n\t\t\t}\n\t\t);\n\n\t\t// Attempt to transition payment status and redirect.\n\t\t// @todo Maybe confirm payment status as well? Would need to generate a custom\n\t\t// response because the private RPRESS_Payment properties are not available.\n\t\tif (\n\t\t\t( 'succeeded' === finalIntent.status ) ||\n\t\t\t( 'canceled' === finalIntent.status && 'abandoned' === finalIntent.cancellation_reason )\n\t\t) {\n\t\t\tawait completePayment( finalIntent );\n\n\t\t\twindow.location.replace( rpress_stripe_vars.successPageUri );\n\t\t} else {\n\t\t\twindow.location.replace( rpress_stripe_vars.failurePageUri );\n\t\t}\n\t} catch ( error ) {\n\t\thandleException( error );\n\t\tenableForm();\n\t}\n}\n\n/**\n * Processes the purchase form.\n *\n * Generates purchase data for the current session and\n * uses the PaymentMethod to generate an Intent based on data.\n *\n * @param {string} paymentMethodId PaymentMethod ID.\n * @param {Bool} paymentMethodExists If the PaymentMethod has already been attached to a customer.\n * @return {Promise} jQuery Promise.\n */\nexport function processForm( paymentMethodId, paymentMethodExists ) {\n\treturn apiRequest( 'rpress_stripe_process_purchase_form', {\n\t\t// Send available form data.\n\t\tform_data: $( '#rpress_purchase_form' ).serialize(),\n\t\tpayment_method_id: paymentMethodId,\n\t\tpayment_method_exists: paymentMethodExists,\n\t} );\n}\n\n/**\n * Complete a Payment in RPRESS.\n *\n * @param {object} intent Intent.\n * @return {Promise} jQuery Promise.\n */\nexport function createPayment( intent ) {\n\treturn apiRequest( 'rpress_stripe_create_payment', {\n\t\t// Send available form data.\n\t\tform_data: $( '#rpress_purchase_form' ).serialize(),\n\t\tintent,\n\t} );\n}\n\n/**\n * Complete a Payment in RPRESS.\n *\n * @param {object} intent Intent.\n * @return {Promise} jQuery Promise.\n */\nexport function completePayment( intent ) {\n\treturn apiRequest( 'rpress_stripe_complete_payment', {\n\t\tform_data: $( '#rpress_purchase_form' ).serialize(),\n\t\tintent,\n\t} );\n}\n\n\n/**\n * Listen for initial RPRESS core validation.\n *\n * @param {Object} event Event.\n * @param {Object} xhr AJAX request.\n * @param {Object} options Request options.\n */\nfunction watchInitialValidation( event, xhr, options ) {\n\tif ( ! options || ! options.data || ! xhr ) {\n\t\treturn;\n\t}\n\n\tif (\n\t\toptions.data.includes( 'action=rpress_process_checkout' ) &&\n\t\toptions.data.includes( 'rpress-gateway=stripe' ) &&\n\t\t( xhr.responseText && 'success' === xhr.responseText.trim() )\n\t) {\n\t\treturn onSubmitDelay();\n\t}\n};\n\n/**\n * RPRESS core listens to a a `click` event on the Checkout form submit button.\n *\n * This submit event handler captures true submissions and triggers a `click`\n * event so RPRESS core can take over as normoal.\n *\n * @param {Object} event submit Event.\n */\nfunction onSubmit( event ) {\n\t// Ensure we are dealing with the Stripe gateway.\n\tif ( ! (\n\t\t// Stripe is selected gateway and total is larger than 0.\n\t\t$( 'input[name=\"rpress-gateway\"]' ).val() === 'stripe'\t&&\n\t\t$( '.rpress_cart_total .rpress_cart_amount' ).data( 'total' ) > 0\n\t) ) {\n\t\treturn;\n\t}\n\n\t// While this function is tied to the submit event, block submission.\n\tevent.preventDefault();\n\n\t// Simulate a mouse click on the Submit button.\n\t//\n\t// If the form is submitted via the \"Enter\" key we need to ensure the core\n\t// validation is run.\n\t//\n\t// When that is run and then the form is resubmitted\n\t// the click event won't do anything because the button will be disabled.\n\t$( '#rpress_purchase_form #rpress_purchase_submit [type=submit]' ).trigger( 'click' );\n}\n\n/**\n * Enables the Checkout form for further submissions.\n */\nfunction enableForm() {\n\t// Update button text.\n\tdocument.querySelector( '#rpress_purchase_form #rpress_purchase_submit [type=submit]' ).value = rpress_global_vars.complete_purchase;\n\n\t// Enable form.\n\t$( '.rpress-loading-ajax' ).remove();\n\t$( '.rpress_errors' ).remove();\n\t$( '.rpress-error' ).hide();\n\t$( '#rpress-purchase-button' ).attr( 'disabled', false );\n}\n\n/**\n * Handles error output for stripe.js promises, or jQuery AJAX promises.\n *\n * @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/assets/js/rpress-ajax.js#L390\n *\n * @param {Object} error Error data.\n */\nfunction handleException( error ) {\n\tconst notice = generateNotice( ( error && error.message ) ? error.message : rpress_stripe_vars.generic_error );\n\n\t// Hide previous messages.\n\t// @todo These should all be in a container, but that's not how core works.\n\t$( '.rpress-stripe-alert' ).remove();\n\t$( rpress_global_vars.checkout_error_anchor ).before( notice );\n\t$( document.body ).trigger( 'rpress_checkout_error', [ error ] );\n}\n","module.exports = require('es6-promise').Promise;\n","/* global $, rpress_scripts */\n\n/**\n * Internal dependencies\n */\nimport { paymentForm } from './payment.js';\nimport { paymentMethods } from './payment-methods.js';\n\nexport * from './payment.js';\nexport * from './payment-methods.js';\n\nexport function setup() {\n\tif ( '1' !== rpress_scripts.is_checkout ) {\n\t\treturn;\n\t}\n\n\t// Initial load for single gateway.\n\tconst singleGateway = document.querySelector( 'input[name=\"rpress-gateway\"]' );\n\n\tif ( singleGateway && 'stripe' === singleGateway.value ) {\n\t\tpaymentForm();\n\t\tpaymentMethods();\n\t}\n\n\t// Gateway switch.\n\t$( document.body ).on( 'rpress_gateway_loaded', ( e, gateway ) => {\n\t\tif ( 'stripe' !== gateway ) {\n\t\t\treturn;\n\t\t}\n\n\t\tpaymentForm();\n\t\tpaymentMethods();\n\t} );\n}\n","/* global $, rpress_scripts */\n\n/**\n * Sends an API request to admin-ajax.php\n *\n * @link https://github.com/WordPress/WordPress/blob/master/wp-includes/js/wp-util.js#L49\n *\n * @param {string} action AJAX action to send to admin-ajax.php\n * @param {Object} data Additional data to send to the action.\n * @return {Promise} jQuery Promise.\n */\nexport function apiRequest( action, data ) {\n\tconst options = {\n\t\ttype: 'POST',\n\t\tdataType: 'json',\n\t\txhrFields: {\n\t\t\twithCredentials: true,\n\t\t},\n\t\turl: rpress_scripts.ajaxurl,\n\t\tdata: {\n\t\t\taction,\n\t\t\t...data,\n\t\t},\n\t};\n\n\tconst deferred = $.Deferred( function( deferred ) {\n\t\t// Use with PHP's wp_send_json_success() and wp_send_json_error()\n\t\tdeferred.jqXHR = $.ajax( options ).done( function( response ) {\n\t\t\t// Treat a response of 1 or 'success' as successful for backward compatibility with existing handlers.\n\t\t\tif ( response === '1' || response === 1 ) {\n\t\t\t\tresponse = { success: true };\n\t\t\t}\n\n\t\t\tif ( typeof response === 'object' && typeof response.success !== undefined ) {\n\t\t\t\tdeferred[ response.success ? 'resolveWith' : 'rejectWith' ]( this, [ response.data ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( this, [ response ] );\n\t\t\t}\n\t\t} ).fail( function() {\n\t\t\tdeferred.rejectWith( this, arguments );\n\t\t} );\n\t} );\n\n\tconst promise = deferred.promise();\n\tpromise.abort = function() {\n\t\tdeferred.jqXHR.abort();\n\t\treturn this;\n\t};\n\n\treturn promise;\n}\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, typeof iteratee == 'function' ? iteratee : identity);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = forEach;\n","/* global $, rpress_stripe_vars */\n\n/**\n * Generates a notice element.\n *\n * @param {string} message The notice text.\n * @param {string} type The type of notice. alert or success.\n * @return {Element} HTML element containing errors.\n */\nexport function generateNotice( message, type = 'error' ) {\n\tconst notice = document.createElement( 'p' );\n\tnotice.classList.add( 'rpress-alert' );\n\tnotice.classList.add( 'rpress-stripe-alert' );\n\tnotice.style.clear = 'both';\n\n\tif ( 'error' === type ) {\n\t\tnotice.classList.add( 'rpress-alert-error' );\n\t} else {\n\t\tnotice.classList.add( 'rpress-alert-success' );\n\t}\n\n\tnotice.innerText = message || rpress_stripe_vars.generic_error;\n\n\treturn notice;\n}\n\n/**\n * Outputs a notice.\n */\nexport function outputNotice( {\n\terrorType,\n\terrorMessage,\n\terrorContainer,\n\terrorContainerReplace = true,\n} ) {\n\tconst $errorContainer = $( errorContainer );\n\tconst notice = generateNotice( errorMessage, errorType );\n\n\tif ( true === errorContainerReplace ) {\n\t\t$errorContainer.html( notice );\n\t} else {\n\t\t$errorContainer.before( notice );\n\t}\n}\n","/**\n * Internal dependencies\n */\nimport { apiRequest } from 'utils'; // eslint-disable-line @wordpress/dependency-group\n\n/**\n * Retrieve a PaymentIntent.\n *\n * @param {string} intentId Intent ID.\n * @param {string} intentType Intent type. payment_intent or setup_intent.\n * @return {Promise} jQuery Promise.\n */\nexport function retrieve( intentId, intentType = 'payment_intent' ) {\n\treturn apiRequest( 'rpress_stripe_get_intent', {\n\t\tintent_id: intentId,\n\t\tintent_type: intentType,\n\t} )\n\t\t// Returns just the PaymentIntent object.\n\t\t.then( function( response ) {\n\t\t\treturn response.intent;\n\t\t} );\n}\n\n/**\n * Confirm a PaymentIntent.\n *\n * @param {Object} intent Stripe PaymentIntent or SetupIntent.\n * @return {Promise} jQuery Promise.\n */\nexport function confirm( intent ) {\n\treturn apiRequest( 'rpress_stripe_confirm_intent', {\n\t\tintent_id: intent.id,\n\t\tintent_type: intent.object,\n\t} )\n\t\t// Returns just the PaymentIntent object for easier reprocessing.\n\t\t.then( function( response ) {\n\t\t\treturn response.intent;\n\t\t} );\n}\n\n/**\n * Capture a PaymentIntent.\n *\n * @param {Object} intent Stripe PaymentIntent or SetupIntent.\n * @param {Object} data Extra data to pass to the intent action.\n * @return {Promise} jQuery Promise.\n */\nexport function capture( intent, data ) {\n\tif ( 'requires_capture' !== intent.status ) {\n\t\treturn Promise.resolve( intent );\n\t}\n\n\treturn apiRequest( 'rpress_stripe_capture_intent', {\n\t\tintent_id: intent.id,\n\t\tintent_type: intent.object,\n\t\t...data,\n\t} )\n\t\t// Returns just the PaymentIntent object for easier reprocessing.\n\t\t.then( function( response ) {\n\t\t\treturn response.intent;\n\t\t} );\n}\n\n/**\n * Update a PaymentIntent.\n *\n * @param {Object} intent Stripe PaymentIntent or SetupIntent.\n * @param {Object} data PaymentIntent data to update.\n * @return {Promise} jQuery Promise.\n */\nexport function update( intent, data ) {\n\treturn apiRequest( 'rpress_stripe_update_intent', {\n\t\tintent_id: intent.id,\n\t\tintent_type: intent.object,\n\t\t...data,\n\t} )\n\t\t// Returns just the PaymentIntent object for easier reprocessing.\n\t\t.then( function( response ) {\n\t\t\treturn response.intent;\n\t\t} );\n}\n\n/**\n * Determines if the PaymentIntent requires further action.\n *\n * @link https://stripe.com/docs/stripe-js/reference\n *\n * @param {Object} intent Stripe PaymentIntent or SetupIntent.\n * @param {Object} data Extra data to pass to the intent action.\n */\nexport async function handle( intent, data ) {\n\t// requires_confirmation\n\tif ( 'requires_confirmation' === intent.status ) {\n\t\t// Attempt to capture.\n\t\tconst confirmedIntent = await confirm( intent );\n\n\t\t// Run through again.\n\t\treturn await handle( confirmedIntent );\n\t}\n\n\t// requires_payment_method\n\t// @link https://stripe.com/docs/payments/intents#intent-statuses\n\tif (\n\t\t'requires_payment_method' === intent.status ||\n\t\t'requires_source' === intent.status\n\t) {\n\t\t// Attempt to update.\n\t\tconst updatedIntent = await update( intent, data );\n\n\t\t// Run through again.\n\t\treturn await handle( updatedIntent, data );\n\t}\n\n\t// requires_action\n\t// @link https://stripe.com/docs/payments/intents#intent-statuses\n\tif (\n\t\t( 'requires_action' === intent.status && 'use_stripe_sdk' === intent.next_action.type ) ||\n\t\t( 'requires_source_action' === intent.status && 'use_stripe_sdk' === intent.next_action.type )\n\t) {\n\t\tlet cardHandler = 'setup_intent' === intent.object ? 'handleCardSetup' : 'handleCardAction';\n\n\t\tif ( 'automatic' === intent.confirmation_method ) {\n\t\t\tcardHandler = 'handleCardPayment';\n\t\t}\n\n\t\treturn window.rpressStripe[ cardHandler ]( intent.client_secret )\n\t\t\t.then( async ( result ) => {\n\t\t\t\tif ( result.error ) {\n\t\t\t\t\tthrow result.error;\n\t\t\t\t}\n\n\t\t\t\tconst {\n\t\t\t\t\tsetupIntent,\n\t\t\t\t\tpaymentIntent,\n\t\t\t\t} = result;\n\n\t\t\t\t// Run through again.\n\t\t\t\treturn await handle( setupIntent || paymentIntent );\n\t\t\t} );\n\t}\n\n\t// Nothing done, return Intent.\n\treturn intent;\n}\n","// Polyfill string.contains\n// @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill\nif ( ! String.prototype.includes ) {\n\tString.prototype.includes = function( search, start ) {\n\t\t'use strict';\n\n\t\tif ( typeof start !== 'number' ) {\n\t\t\tstart = 0;\n\t\t}\n\n\t\tif ( start + search.length > this.length ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn this.indexOf(search, start) !== -1;\n\t\t}\n\t};\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version 3.3.1\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n return typeof x === 'function' || typeof x === 'object' && x !== null;\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\nvar _isArray = undefined;\nif (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n} else {\n _isArray = Array.isArray;\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = undefined;\nvar customSchedulerFn = undefined;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n return function () {\n vertxNext(flush);\n };\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = undefined;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var _arguments = arguments;\n\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n (function () {\n var callback = _arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n })();\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(16);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar GET_THEN_ERROR = new ErrorObject();\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n GET_THEN_ERROR.error = error;\n return GET_THEN_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n _resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n _reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n _reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n _reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return _resolve(promise, value);\n }, function (reason) {\n return _reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$) {\n if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$ === GET_THEN_ERROR) {\n _reject(promise, GET_THEN_ERROR.error);\n } else if (then$$ === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$)) {\n handleForeignThenable(promise, maybeThenable, then$$);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction _resolve(promise, value) {\n if (promise === value) {\n _reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction _reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = undefined,\n callback = undefined,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction ErrorObject() {\n this.error = null;\n}\n\nvar TRY_CATCH_ERROR = new ErrorObject();\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = undefined,\n error = undefined,\n succeeded = undefined,\n failed = undefined;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n _reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n _resolve(promise, value);\n } else if (failed) {\n _reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n _reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n _resolve(promise, value);\n }, function rejectPromise(reason) {\n _reject(promise, reason);\n });\n } catch (e) {\n _reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this._input = input;\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate();\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n _reject(this.promise, validationError());\n }\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nEnumerator.prototype._enumerate = function () {\n var length = this.length;\n var _input = this._input;\n\n for (var i = 0; this._state === PENDING && i < length; i++) {\n this._eachEntry(_input[i], i);\n }\n};\n\nEnumerator.prototype._eachEntry = function (entry, i) {\n var c = this._instanceConstructor;\n var resolve$$ = c.resolve;\n\n if (resolve$$ === resolve) {\n var _then = getThen(entry);\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$) {\n return resolve$$(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$(entry), i);\n }\n};\n\nEnumerator.prototype._settledAt = function (state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n _reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n};\n\nEnumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n};\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n*/\nfunction Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n}\n\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = resolve;\nPromise.reject = reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;\n\nPromise.prototype = {\n constructor: Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n \n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n \n Chaining\n --------\n \n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n \n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n \n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n \n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n \n Assimilation\n ------------\n \n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n \n If the assimliated promise rejects, then the downstream promise will also reject.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n \n Simple Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let result;\n \n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n \n Advanced Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let author, books;\n \n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n \n function foundBooks(books) {\n \n }\n \n function failure(reason) {\n \n }\n \n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n \n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: then,\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n \n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n \n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n \n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n \n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nfunction polyfill() {\n var local = undefined;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}\n\npolyfill();\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\n\nreturn Promise;\n\n})));\n//# sourceMappingURL=es6-promise.map","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* global rpress_stripe_vars, location */\n\n/**\n * Internal dependencies\n */\nimport { apiRequest, generateNotice, fieldValueOrNull, forEach } from 'utils'; // eslint-disable-line @wordpress/dependency-group\n\n/**\n * Binds events for card actions.\n */\nexport function cardActions() {\n\t// Update.\n\tforEach( document.querySelectorAll( '.rpress-stripe-update-card' ), function( updateButton ) {\n\t\tupdateButton.addEventListener( 'click', onToggleUpdateForm );\n\t} );\n\n\tforEach( document.querySelectorAll( '.rpress-stripe-cancel-update' ), function( cancelButton ) {\n\t\tcancelButton.addEventListener( 'click', onToggleUpdateForm );\n\t} );\n\n\tforEach( document.querySelectorAll( '.card-update-form' ), function( updateButton ) {\n\t\tupdateButton.addEventListener( 'submit', onUpdatePaymentMethod );\n\t} );\n\n\t// Delete.\n\tforEach( document.querySelectorAll( '.rpress-stripe-delete-card' ), function( deleteButton ) {\n\t\tdeleteButton.addEventListener( 'click', onDeletePaymentMethod );\n\t} );\n\n\t// Set Default.\n\tforEach( document.querySelectorAll( '.rpress-stripe-default-card' ), function( setDefaultButton ) {\n\t\tsetDefaultButton.addEventListener( 'click', onSetDefaultPaymentMethod );\n\t} );\n}\n\n/**\n * Handle a generic Payment Method action (set default, update, delete).\n *\n * @param {string} action Payment action.\n * @param {string} paymentMethodId PaymentMethod ID.\n * @param {null|Object} data Additional AJAX data.\n * @return {Promise} jQuery Promise.\n */\nfunction paymentMethodAction( action, paymentMethodId, data = {} ) {\n\treturn apiRequest( action, {\n\t\tpayment_method: paymentMethodId,\n\t\tnonce: document.getElementById( 'card_update_nonce_' + paymentMethodId ).value,\n\t\t...data,\n\t} )\n\t\t/**\n\t\t * Shows an error when the API request fails.\n\t\t *\n\t\t * @param {Object} response API Request response.\n\t\t */\n\t\t.fail( function( response ) {\n\t\t\thandleNotice( paymentMethodId, response );\n\t\t} )\n\t\t/**\n\t\t * Shows a success notice and automatically redirect.\n\t\t *\n\t\t * @param {Object} response API Request response.\n\t\t */\n\t\t.done( function( response ) {\n\t\t\thandleNotice( paymentMethodId, response, 'success' );\n\n\t\t\t// Automatically redirect on success.\n\t\t\tsetTimeout( function() {\n\t\t\t\tlocation.reload();\n\t\t\t}, 1500 );\n\t\t} );\n}\n\n/**\n *\n * @param {Event} e\n */\nfunction onToggleUpdateForm( e ) {\n\te.preventDefault();\n\n\tconst source = e.target.dataset.source;\n\n\tconst form = document.getElementById( source + '-update-form' );\n\tconst cardActionsEl = document.getElementById( source + '-card-actions' );\n\tconst isFormVisible = 'block' === form.style.display;\n\n\tform.style.display = ! isFormVisible ? 'block' : 'none';\n\tcardActionsEl.style.display = ! isFormVisible ? 'none' : 'block';\n}\n\n/**\n *\n * @param {Event} e\n */\nfunction onUpdatePaymentMethod( e ) {\n\te.preventDefault();\n\n\tconst form = e.target;\n\tconst data = {};\n\n\t// Gather form data.\n\tconst updateFields = [\n\t\t'address_city',\n\t\t'address_country',\n\t\t'address_line1',\n\t\t'address_line2',\n\t\t'address_zip',\n\t\t'address_state',\n\t\t'exp_month',\n\t\t'exp_year',\n\t];\n\n\tupdateFields.forEach( function( fieldName ) {\n\t\tconst field = form.querySelector( '[name=\"' + fieldName + '\"]' );\n\t\tdata[ fieldName ] = fieldValueOrNull( field );\n\t} );\n\n\tconst submitButton = form.querySelector( 'input[type=\"submit\"]' );\n\n\tsubmitButton.disabled = true;\n\tsubmitButton.value = submitButton.dataset.loading;\n\n\tpaymentMethodAction( 'rpress_stripe_update_payment_method', e.target.dataset.source, data )\n\t\t.fail( function( response ) {\n\t\t\tsubmitButton.disabled = false;\n\t\t\tsubmitButton.value = submitButton.dataset.submit;\n\t\t} );\n}\n\n/**\n *\n * @param {Event} e\n */\nfunction onDeletePaymentMethod( e ) {\n\te.preventDefault();\n\n\tpaymentMethodAction( 'rpress_stripe_delete_payment_method', e.target.dataset.source );\n}\n\n/**\n *\n * @param {Event} e\n */\nfunction onSetDefaultPaymentMethod( e ) {\n\te.preventDefault();\n\n\tpaymentMethodAction( 'rpress_stripe_set_payment_method_default', e.target.dataset.source );\n}\n\n/**\n * Handles a notice (success or error) for card actions.\n *\n * @param {string} paymentMethodId\n * @param {Object} error Error with message to output.\n * @param {string} type Notice type.\n */\nexport function handleNotice( paymentMethodId, error, type = 'error' ) {\n\t// Create the new notice.\n\tconst notice = generateNotice(\n\t\t( error && error.message ) ? error.message : rpress_stripe_vars.generic_error,\n\t\ttype\n\t);\n\n\t// Hide previous notices.\n\tforEach( document.querySelectorAll( '.rpress-stripe-alert' ), function( alert ) {\n\t\talert.remove();\n\t} );\n\n\tconst item = document.getElementById( paymentMethodId + '_card_item' );\n\n\t// Show new notice.\n\titem.insertBefore( notice, item.querySelector( '.card-details' ) );\n}\n","/* global rpress_stripe_vars, location */\n\n/**\n * Internal dependencies.\n */\n/**\n * External dependencies\n */\nimport { mountCardElement, getBillingDetails } from 'frontend/elements';\nimport { apiRequest, hasValidInputs, triggerBrowserValidation, generateNotice, forEach } from 'utils';\n\n/**\n * Binds events and sets up \"Add New\" form.\n */\nexport function addNewForm() {\n\t// Mount Card Element.\n\twindow.rpressStripe.cardElement = mountCardElement( window.rpressStripe.elements() );\n\n\t// Toggles and submission.\n\tdocument.querySelector( '.rpress-stripe-add-new' ).addEventListener( 'click', onToggleForm );\n\tdocument.getElementById( 'rpress-stripe-add-new-cancel' ).addEventListener( 'click', onToggleForm );\n\tdocument.getElementById( 'rpress-stripe-add-new-card' ).addEventListener( 'submit', onAddPaymentMethod );\n\n\t// Set \"Card Name\" field as required by HTML5\n\tdocument.getElementById( 'card_name' ).required = true;\n}\n\n/**\n * Handles toggling of \"Add New\" form button and submission.\n *\n * @param {Event} e click event.\n */\nfunction onToggleForm( e ) {\n\te.preventDefault();\n\n\tconst form = document.getElementById( 'rpress-stripe-add-new-card' );\n\tconst formFields = form.querySelector( '.rpress-stripe-add-new-card' );\n\tconst isFormVisible = 'block' === formFields.style.display;\n\n\tconst cancelButton = form.querySelector( '#rpress-stripe-add-new-cancel' );\n\n\t// Trigger a `submit` event.\n\tif ( isFormVisible && cancelButton !== e.target ) {\n\t\tconst submitEvent = document.createEvent( 'Event' );\n\n\t\tsubmitEvent.initEvent( 'submit', true, true );\n\t\tform.dispatchEvent( submitEvent );\n\t// Toggle form.\n\t} else {\n\t\tformFields.style.display = ! isFormVisible ? 'block' : 'none';\n\t\tcancelButton.style.display = ! isFormVisible ? 'inline-block' : 'none';\n\t}\n}\n\n/**\n * Adds a new Source to the Customer.\n *\n * @param {Event} e submit event.\n */\nfunction onAddPaymentMethod( e ) {\n\te.preventDefault();\n\n\tconst form = e.target;\n\n\tif ( ! hasValidInputs( form ) ) {\n\t\ttriggerBrowserValidation( form );\n\t} else {\n\t\ttry {\n\t\t\tdisableForm();\n\n\t\t\tcreatePaymentMethod( form )\n\t\t\t\t.then( addPaymentMethod )\n\t\t\t\t.catch( ( error ) => {\n\t\t\t\t\thandleNotice( error );\n\t\t\t\t\tenableForm();\n\t\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\thandleNotice( error );\n\t\t\tenableForm();\n\t\t}\n\t}\n}\n\n/**\n * Add a PaymentMethod.\n *\n * @param {Object} paymentMethod\n */\nexport function addPaymentMethod( paymentMethod ) {\n\tapiRequest( 'rpress_stripe_add_payment_method', {\n\t\tpayment_method_id: paymentMethod.id,\n\t\tnonce: document.getElementById( 'rpress-stripe-add-card-nonce' ).value,\n\t} )\n\t\t/**\n\t\t * Shows an error when the API request fails.\n\t\t *\n\t\t * @param {Object} response API Request response.\n\t\t */\n\t\t.fail( handleNotice )\n\t\t/**\n\t\t * Shows a success notice and automatically redirect.\n\t\t *\n\t\t * @param {Object} response API Request response.\n\t\t */\n\t\t.done( function( response ) {\n\t\t\thandleNotice( response, 'success' );\n\n\t\t\t// Automatically redirect on success.\n\t\t\tsetTimeout( function() {\n\t\t\t\tlocation.reload();\n\t\t\t}, 1500 );\n\t\t} );\n}\n\n/**\n * Creates a PaymentMethod from a card and billing form.\n *\n * @param {HTMLElement} billingForm Form with billing fields to retrieve data from.\n * @return {Object} Stripe PaymentMethod.\n */\nfunction createPaymentMethod( billingForm ) {\n\treturn window.rpressStripe\n\t\t// Create a PaymentMethod with stripe.js\n\t\t.createPaymentMethod(\n\t\t\t'card',\n\t\t\twindow.rpressStripe.cardElement,\n\t\t\t{\n\t\t\t\tbilling_details: getBillingDetails( billingForm ),\n\t\t\t}\n\t\t)\n\t\t/**\n\t\t * Handles PaymentMethod creation response.\n\t\t *\n\t\t * @param {Object} result PaymentMethod creation result.\n\t\t */\n\t\t.then( function( result ) {\n\t\t\tif ( result.error ) {\n\t\t\t\tthrow result.error;\n\t\t\t}\n\n\t\t\treturn result.paymentMethod;\n\t\t} );\n}\n\n/**\n * Disables \"Add New\" form.\n */\nfunction disableForm() {\n\tconst submit = document.querySelector( '.rpress-stripe-add-new' );\n\n\tsubmit.value = submit.dataset.loading;\n\tsubmit.disabled = true;\n}\n\n/**\n * Enables \"Add New\" form.\n */\nfunction enableForm() {\n\tconst submit = document.querySelector( '.rpress-stripe-add-new' );\n\n\tsubmit.value = submit.dataset.submit;\n\tsubmit.disabled = false;\n}\n\n/**\n * Handles a notice (success or error) for card actions.\n *\n * @param {Object} error Error with message to output.\n * @param {string} type Notice type.\n */\nexport function handleNotice( error, type = 'error' ) {\n\t// Create the new notice.\n\tconst notice = generateNotice(\n\t\t( error && error.message ) ? error.message : rpress_stripe_vars.generic_error,\n\t\ttype\n\t);\n\n\t// Hide previous notices.\n\tforEach( document.querySelectorAll( '.rpress-stripe-alert' ), function( alert ) {\n\t\talert.remove();\n\t} );\n\n\t// Show new notice.\n\tdocument.querySelector( '.rpress-stripe-add-card-actions' )\n\t\t.insertBefore( notice, document.querySelector( '.rpress-stripe-add-new' ) );\n}\n","/**\n * Internal dependencies\n */\nimport { cardActions } from './actions.js';\nimport { addNewForm } from './add-new.js';\n\nexport function setup() {\n\tif ( ! document.getElementById( 'rpress-stripe-manage-cards' ) ) {\n\t\treturn;\n\t}\n\n\tcardActions();\n\taddNewForm();\n}\n","/* global rpress_stripe_vars */\n\n/**\n * Internal dependencies\n */\n/* eslint-disable */\nimport {\n\tgetPaymentMethod,\n\tmountCardElement,\n\thandle as handleIntent,\n\tretrieve as retrieveIntent,\n} from 'frontend/elements';\n\nimport { paymentMethods } from 'frontend/checkout/payment-methods.js';\nimport { generateNotice, apiRequest } from 'utils';\n/* eslint-enable */\n\n/**\n * Binds events and sets up \"Update Payment Method\" form.\n */\nexport function updatePaymentMethodForm() {\n\t// Mount Card Element.\n\twindow.rpressStripe.cardElement = mountCardElement( window.rpressStripe.elements() );\n\n\t// Setup payment method selector.\n\tsetPaymentMethods();\n\n\tdocument.getElementById( 'rpress-stripe-update-payment-method' ).addEventListener( 'submit', onAuthorizePayment );\n}\n\n/**\n * Setup PaymentMethods.\n *\n * Moves the active item to the currently authenticating PaymentMethod.\n */\nfunction setPaymentMethods() {\n\tpaymentMethods();\n\n\tconst form = document.getElementById( 'rpress-stripe-update-payment-method' );\n\tconst input = document.getElementById( form.dataset.paymentMethod );\n\n\t// Select the correct PaymentMethod after load.\n\tif ( input ) {\n\t\tconst changeEvent = document.createEvent( 'Event' );\n\n\t\tchangeEvent.initEvent( 'change', true, true );\n\t\tinput.checked = true;\n\t\tinput.dispatchEvent( changeEvent );\n\t}\n}\n\n/**\n * Authorize a PaymentIntent.\n *\n * @param {Event} e submtit event.\n */\nasync function onAuthorizePayment( e ) {\n\te.preventDefault();\n\n\tconst form = document.getElementById( 'rpress-stripe-update-payment-method' );\n\n\tdisableForm();\n\n\ttry {\n\t\tconst paymentMethod = await getPaymentMethod( form, window.rpressStripe.cardElement );\n\n\t\t// Handle PaymentIntent.\n\t\tconst intent = await retrieveIntent( form.dataset.paymentIntent, 'payment_method' );\n\n\t\tconst handledIntent = await handleIntent( intent, {\n\t\t\tpayment_method: paymentMethod.id,\n\t\t} );\n\n\t\t// Attempt to transition payment status and redirect.\n\t\tconst authorization = await completeAuthorization( handledIntent.id );\n\n\t\tif ( authorization.payment ) {\n\t\t\twindow.location.reload();\n\t\t} else {\n\t\t\tthrow authorization;\n\t\t}\n\t} catch ( error ) {\n\t\thandleException( error );\n\t\tenableForm();\n\t}\n}\n\n/**\n * Complete a Payment after the Intent has been authorized.\n *\n * @param {string} intentId Intent ID.\n * @return {Promise} jQuery Promise.\n */\nexport function completeAuthorization( intentId ) {\n\treturn apiRequest( 'rpress_stripe_complete_payment_authorization', {\n\t\tintent_id: intentId,\n\t} );\n}\n\n/**\n * Disables \"Add New\" form.\n */\nfunction disableForm() {\n\tconst submit = document.getElementById( 'rpress-stripe-update-payment-method-submit' );\n\n\tsubmit.value = submit.dataset.loading;\n\tsubmit.disabled = true;\n}\n\n/**\n * Enables \"Add New\" form.\n */\nfunction enableForm() {\n\tconst submit = document.getElementById( 'rpress-stripe-update-payment-method-submit' );\n\n\tsubmit.value = submit.dataset.submit;\n\tsubmit.disabled = false;\n}\n\n/**\n * Handles a notice (success or error) for authorizing a card.\n *\n * @param {Object} error Error with message to output.\n */\nexport function handleException( error ) {\n\t// Create the new notice.\n\tconst notice = generateNotice(\n\t\t( error && error.message ) ? error.message : rpress_stripe_vars.generic_error,\n\t\t'error'\n\t);\n\n\tconst container = document.getElementById( 'rpress-stripe-update-payment-method-errors' );\n\n\tcontainer.innerHTML = '';\n\tcontainer.appendChild( notice );\n}\n","/**\n * Internal dependencies\n */\nimport { updatePaymentMethodForm } from './update-payment-method';\n\nexport function setup() {\n\tif ( ! document.getElementById( 'rpress-stripe-update-payment-method' ) ) {\n\t\treturn;\n\t}\n\n\tupdatePaymentMethodForm();\n}\n","/* global Stripe, rpress_stripe_vars */\n\n/**\n * Internal dependencies\n */\n/**\n * External dependencies\n */\nimport { domReady, apiRequest, generateNotice } from 'utils';\n\nimport {\n\tsetup as setupCheckout,\n\tpaymentMethods,\n} from './checkout';\n\nimport { setup as setupProfile } from './profile-editor';\n\nimport { setup as setupPaymentHistory } from './payment-receipt';\n\nimport {\n\tmountCardElement,\n\tgetBillingDetails,\n\tgetPaymentMethod,\n\tconfirm as confirmIntent,\n\thandle as handleIntent,\n\tretrieve as retrieveIntent,\n} from 'frontend/elements';\n\n( () => {\n\ttry {\n\t\twindow.rpressStripe = new Stripe( rpress_stripe_vars.publishable_key );\n\n\t\t// Alias some functionality for external plugins.\n\t\twindow.rpressStripe._plugin = {\n\t\t\tdomReady,\n\t\t\tapiRequest,\n\t\t\tgenerateNotice,\n\t\t\tmountCardElement,\n\t\t\tgetBillingDetails,\n\t\t\tgetPaymentMethod,\n\t\t\tconfirmIntent,\n\t\t\thandleIntent,\n\t\t\tretrieveIntent,\n\t\t\tpaymentMethods,\n\t\t};\n\n\t\t// Setup frontend components when DOM is ready.\n\t\tdomReady(\n\t\t\tsetupCheckout,\n\t\t\tsetupProfile,\n\t\t\tsetupPaymentHistory\n\t\t);\n\t} catch ( error ) {\n\t\talert( error.message );\n\t}\n} )();\n"],"sourceRoot":""}