%PDF- %PDF-
Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/ |
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/subscription-card-modal.js |
exports.ids = [34]; exports.modules = { /***/ 150: /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(163); if(content.__esModule) content = content.default; if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add CSS to SSR context var add = __webpack_require__(6).default module.exports.__inject__ = function (context) { add("ce03f3c6", content, true, context) }; /***/ }), /***/ 162: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_4_oneOf_1_0_node_modules_nuxt_postcss8_node_modules_css_loader_dist_cjs_js_ref_4_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_nuxt_postcss8_node_modules_postcss_loader_dist_cjs_js_ref_4_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubscriptionCardModal_vue_vue_type_style_index_0_id_7d8d7028_lang_postcss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(150); /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_4_oneOf_1_0_node_modules_nuxt_postcss8_node_modules_css_loader_dist_cjs_js_ref_4_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_nuxt_postcss8_node_modules_postcss_loader_dist_cjs_js_ref_4_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubscriptionCardModal_vue_vue_type_style_index_0_id_7d8d7028_lang_postcss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_4_oneOf_1_0_node_modules_nuxt_postcss8_node_modules_css_loader_dist_cjs_js_ref_4_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_nuxt_postcss8_node_modules_postcss_loader_dist_cjs_js_ref_4_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubscriptionCardModal_vue_vue_type_style_index_0_id_7d8d7028_lang_postcss_scoped_true___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_4_oneOf_1_0_node_modules_nuxt_postcss8_node_modules_css_loader_dist_cjs_js_ref_4_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_nuxt_postcss8_node_modules_postcss_loader_dist_cjs_js_ref_4_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubscriptionCardModal_vue_vue_type_style_index_0_id_7d8d7028_lang_postcss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_4_oneOf_1_0_node_modules_nuxt_postcss8_node_modules_css_loader_dist_cjs_js_ref_4_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_nuxt_postcss8_node_modules_postcss_loader_dist_cjs_js_ref_4_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubscriptionCardModal_vue_vue_type_style_index_0_id_7d8d7028_lang_postcss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ 163: /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(5); var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); // Module ___CSS_LOADER_EXPORT___.push([module.i, ".modal[data-v-7d8d7028]{padding-top:20vh}", ""]); // Exports module.exports = ___CSS_LOADER_EXPORT___; /***/ }), /***/ 167: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/financial/Modals/SubscriptionCardModal.vue?vue&type=template&id=7d8d7028&scoped=true& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.value == true),expression:"value == true"}],staticClass:"modal fixed z-50 bottom-0 left-0 w-full h-screen"},[_vm._ssrNode("<div"+(_vm._ssrClass("absolute z-10 top-0 left-0 w-full h-full bg-black bg-opacity-25 cursor-pointer transition duration-100",_vm.isActive == true ? 'opacity-100' : 'opacity-0'))+" data-v-7d8d7028></div> "),_vm._ssrNode("<div"+(_vm._ssrClass("relative z-20 h-full bg-white shadow-lg p-10 pt-16 transition transform duration-100",_vm.isActive == true ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0'))+" data-v-7d8d7028>","</div>",[_vm._ssrNode("<button type=\"button\" class=\"absolute top-6 right-10 uppercase hover:text-blue-light focus:outline-none transition\" data-v-7d8d7028>Close</button> "),_vm._ssrNode("<div class=\"relative h-full bg-gray p-8 overflow-y-auto\" data-v-7d8d7028>","</div>",[_vm._ssrNode("<div class=\"max-w-lg w-full mx-auto\" data-v-7d8d7028>","</div>",[_vm._ssrNode(((_vm.subscription)?("<h2 class=\"mb-8 text-center text-4xl font-bold\" data-v-7d8d7028>Update Card Details</h2>"):("<h2 class=\"mb-8 text-center text-4xl font-bold\" data-v-7d8d7028>Your Card Details</h2>"))+" "+((_vm.payment_methods.length)?("<div class=\"grid grid-cols-1 gap-y-2 mb-6\" data-v-7d8d7028>"+(_vm._ssrList((_vm.payment_methods),function(card,key){return ("<label class=\"flex items-center py-3 px-4 cursor-pointer bg-white rounded-lg\" data-v-7d8d7028><input type=\"radio\""+(_vm._ssrAttr("value",card.id))+(_vm._ssrAttr("checked",_vm._q(_vm.selected_card,card.id)))+" data-v-7d8d7028> <span"+(_vm._ssrClass(null,'icon-'+card.card.brand))+" data-v-7d8d7028></span> <span class=\"px-2\" data-v-7d8d7028>"+_vm._ssrEscape("****"+_vm._s(card.card.last4))+"</span> <span class=\"px-2\" data-v-7d8d7028>"+_vm._ssrEscape(_vm._s(card.card.exp_month+'/'+card.card.exp_year))+"</span></label>")}))+" <div class=\"relative text-center my-6\" data-v-7d8d7028><span class=\"absolute z-10 top-1/2 left-0 transform -translate-y-1/2 block w-full h-0.5 w-full bg-black bg-opacity-10\" data-v-7d8d7028></span> <span class=\"relative z-20 inline-block px-6 bg-gray uppercase\" data-v-7d8d7028>Or add new Card</span></div> "+((_vm.selected_card)?("<div class=\"text-center\" data-v-7d8d7028><button class=\"text-blue-light uppercase\" data-v-7d8d7028>Add New Card</button></div>"):"<!---->")+"</div>"):"<!---->")+" "),_vm._ssrNode("<div"+(_vm._ssrStyle(null,null, { display: (_vm.selected_card == null) ? '' : 'none' }))+" data-v-7d8d7028>","</div>",[_c('ValidationObserver',{ref:"paymentForm"},[_c('form',{attrs:{"role":"form","method":"POST"},on:{"submit":function($event){$event.preventDefault();return _vm.submitForm($event)}}},[_c('ValidationProvider',{attrs:{"rules":"required"},scopedSlots:_vm._u([{key:"default",fn:function(ref){ var errors = ref.errors; return [_c('t-input-group',{attrs:{"label":"Name on Card"}},[_c('t-input',{attrs:{"type":"text","placeholder":"Name on Card"},model:{value:(_vm.card_name),callback:function ($$v) {_vm.card_name=$$v},expression:"card_name"}}),_vm._v(" "),(errors[0])?_c('span',{staticClass:"field-invalid"},[_vm._v(_vm._s(errors[0]))]):_vm._e()],1)]}}])}),_vm._v(" "),_c('t-input-group',{attrs:{"label":"Card Information"}},[_c('div',{staticClass:"px-4 py-4 bg-white border border-black border-opacity-20 rounded-xl",attrs:{"id":"subscription-card-element"}})]),_vm._v(" "),_c('t-input-group',{attrs:{"label":"Discount Code"}},[_c('t-input',{attrs:{"type":"text"},model:{value:(_vm.discount_code),callback:function ($$v) {_vm.discount_code=$$v},expression:"discount_code"}})],1),_vm._v(" "),_c('div',{staticClass:"flex items-center justify-center px-10"},[_c('button',{staticClass:"w-full btn btn-primary btn-small rounded-full",attrs:{"disabled":_vm.working == true,"type":"submit"}},[(_vm.working == false)?_c('div',[_vm._v("Submit")]):_c('span',{staticClass:"flex items-center justify-center"},[_c('svg',{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24"}},[_c('circle',{staticClass:"opacity-25",attrs:{"cx":"12","cy":"12","r":"10","stroke":"currentColor","stroke-width":"4"}}),_vm._v(" "),_c('path',{staticClass:"opacity-75",attrs:{"fill":"currentColor","d":"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),_vm._v(" "),_c('span',[_vm._v("Processing")])])])]),_vm._v(" "),_c('p',{staticClass:"text-sm text-center mt-6 text-black text-opacity-75"},[_vm._v("By subscribing to Take a Seat you are agreeing to all site "),_c('NuxtLink',{staticClass:"text-blue-light hover:underline",attrs:{"to":"/terms-conditions","target":"_blank"}},[_vm._v("Terms and Conditions")]),_vm._v(". Please read carefully before continuing.")],1)],1)])],1),_vm._ssrNode(" "+((_vm.selected_card)?("<div data-v-7d8d7028><div class=\"flex items-center justify-center px-10\" data-v-7d8d7028><button"+(_vm._ssrAttr("disabled",_vm.working == true))+" type=\"button\" class=\"w-full btn btn-primary btn-small rounded-full\" data-v-7d8d7028>"+((_vm.working == false)?("<div data-v-7d8d7028>Submit</div>"):("<span class=\"flex items-center justify-center\" data-v-7d8d7028><svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" class=\"animate-spin -ml-1 mr-3 h-5 w-5 text-current\" data-v-7d8d7028><circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\" class=\"opacity-25\" data-v-7d8d7028></circle> <path fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" class=\"opacity-75\" data-v-7d8d7028></path></svg> <span data-v-7d8d7028>Processing</span></span>"))+"</button></div></div>"):"<!---->"))],2)])],2)],2)} var staticRenderFns = [] // CONCATENATED MODULE: ./components/blocks/Account/financial/Modals/SubscriptionCardModal.vue?vue&type=template&id=7d8d7028&scoped=true& // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/financial/Modals/SubscriptionCardModal.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var SubscriptionCardModalvue_type_script_lang_js_ = ({ props: { value: { required: true } }, data() { return { isActive: false, working: false, card: {}, selected_card: null, card_name: null, discount_code: '' }; }, computed: { setup_intent() { return this.$store.state.account.billing.setupIntent; }, payment_methods() { return this.$store.state.account.billing.paymentMethods; }, default_payment_method() { return this.$store.state.account.billing.defaultPaymentMethod; }, subscription() { return this.$store.state.account.subscription.subscription; } }, mounted() { const elements = this.$stripe.elements(); this.$store.dispatch('account/billing/setupIntent'); this.card = elements.create('card', { style: { base: { fontSize: '15px', fontFamily: 'Poppins, sans-serif' } } }); this.card.mount('#subscription-card-element'); }, methods: { closeModal: function () { this.$emit("input", !this.value); }, submitForm() { this.$refs.paymentForm.validate().then(success => { if (!success) { return; } this.submitCard(); }); }, async submitCard() { if (this.setup_intent !== null) { this.working = true; const { setupIntent, error } = await this.$stripe.confirmCardSetup(this.setup_intent, { payment_method: { card: this.card, billing_details: { name: this.card_name } } }); if (error) { this.$toast.error(error.message).goAway(3000); this.$store.dispatch('account/billing/setupIntent'); this.working = false; } else { if (!this.subscription) { this.startSubscription(setupIntent.payment_method); } else { this.saveCard(setupIntent.payment_method); } } } }, async startSubscription(payment_method) { this.working = true; if (this.working == true) { await this.$store.dispatch('account/subscription/startSubscription', { payment_method: payment_method, discount_code: this.discount_code }).then(() => { this.$store.dispatch('account/subscription/getSubscription'); this.$store.dispatch('account/progress/get', { slug: 'financial' }); this.$toast.success('Successfully started your subscription!').goAway(3000); this.$emit("input", false); this.working = false; }).catch(error => { this.$store.dispatch('account/billing/setupIntent'); this.working = false; this.$toast.error(error.response.data).goAway(3000); }); } }, async saveCard(payment_method) { await this.$store.dispatch('account/billing/savePaymentMethod', { payment_method: payment_method, discount_code: this.discount_code }).then(() => { this.$store.dispatch('account/subscription/getSubscription'); this.$toast.success('Successfully updated your subscription!').goAway(3000); this.$emit("input", false); this.working = false; }).catch(error => { this.working = false; }); } }, watch: { value: function () { if (this.value == true) { setTimeout(() => { this.isActive = true; }, 100); } else { setTimeout(() => { this.isActive = false; }, 100); } } } }); // CONCATENATED MODULE: ./components/blocks/Account/financial/Modals/SubscriptionCardModal.vue?vue&type=script&lang=js& /* harmony default export */ var Modals_SubscriptionCardModalvue_type_script_lang_js_ = (SubscriptionCardModalvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(1); // CONCATENATED MODULE: ./components/blocks/Account/financial/Modals/SubscriptionCardModal.vue function injectStyles (context) { var style0 = __webpack_require__(162) if (style0.__inject__) style0.__inject__(context) } /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( Modals_SubscriptionCardModalvue_type_script_lang_js_, render, staticRenderFns, false, injectStyles, "7d8d7028", "595193e0" ) /* harmony default export */ var SubscriptionCardModal = __webpack_exports__["default"] = (component.exports); /***/ }) };; //# sourceMappingURL=subscription-card-modal.js.map