{"version":3,"sources":["webpack:///./src/services/api/payments.service.ts","webpack:///./src/views/Account/Components/Payments.vue?121f","webpack:///./src/views/Account/Components/Payments.vue","webpack:///./src/views/Account/Components/Payments.vue?4ab7","webpack:///./src/views/Account/Components/Payments.vue?743d","webpack:///./src/views/Account/Components/Payments.vue?e2ec"],"names":["controller","PaymentsService","ApiService","constructor","super","process","GetAllReceipt","req","this","getAll","params","CreateSession","payment","post","SaveSubscription","UpdateSubscriptionYear","subscription","CancelSubscription","GetChangedPlan","UpdatePlan","downgrade","RemainingDaysUp","priceId","paymentsService","_c","_vm","attrs","$event","changePageRoute","staticClass","_v","_s","$tc","on","getAllReceipt","model","callback","expression","staticStyle","showSubscriptionPlan","showConfirm","roleIdOld","closeBillingAddress","showConfirmPlan","previousPageManager","roleId","showCancelPlan","staticRenderFns","overlayModule","getModule","OverlayModule","store","authModule","AuthModule","SubscriptionPlanOverview","BillingAddressPage","ConfirmPlan","SubscriptionPlan","CancelPlan","Payments","Vue","required","offertID","nameOffert","descrOffert","price","monthlyBeneficiaries","totalSubjects","firstSupport","secondSupport","expiration","freeTrial","priceMonthID","priceYearID","yearPrice","companyName","companyAddress","city","postalCode","province","countryID","countryDescr","showOverlay","user","userService","GetSubscription","data","setProfileRoleID","context","$route","payments","showCard","showBillingAddress","Promise","all","loadSubscription","getChangedPlan","loadBillingAddress","loadSubscriptionDuration","parse","subscriptionPlan","split","length","subscriptionExpired","Date","getTime","finish","showEmptyState","billingAddress","GetBillingAddressByID","loaderReceipt","receipts","filterDateRange","userId","userID","dateFrom","toDate","dateTo","res","duration","SubscriptionDuration","addTitleSub","openInvoice","url","window","open","previousContext","$router","push","name","value","toggle","month","previousPage","__decorate","Watch","Component","components","component"],"mappings":"yIAAA,kDASA,MAAMA,EAAa,WAEnB,MAAMC,UAAwBC,gBAC5BC,cACEC,MAAMC,SAGRC,cAAcC,GACZ,OAAOC,KAAKC,OAAqBT,EAAH,iBAA+B,CAC3DU,OAAQH,IAIZI,cAAcC,G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AA8BnF,EAC9B,eAAgBE,EAChB,oBAAqBC,EACrB,cAAeC,EACf,kBAAmBH,MAGFI,WChDkZ,I,wBCQna+E,EAAY,eACd,EACA,EACA3F,GACA,EACA,KACA,WACA,MAIa,aAAA2F,E","file":"js/chunk-36c44bcd.45f96be5.js","sourcesContent":["import { ApiService } from \"@zelando/vuelando\";\r\nimport {\r\n PaymentIntentGetRequest,\r\n Receipt,\r\n} from \"@/models/entities/receipt.interfece\";\r\nimport { Downgrade } from \"@/models/entities/downgrade.interface\";\r\nimport { UpgradePayment } from \"@/models/entities/upgrade-payment\";\r\nimport { UpgradeSubYear } from \"@/models/entities/upgrade-sub-year.interface\";\r\n\r\nconst controller = \"payments\";\r\n\r\nclass PaymentsService extends ApiService {\r\n constructor() {\r\n super(process.env.VUE_APP_API_ENDPOINT);\r\n }\r\n\r\n GetAllReceipt(req: PaymentIntentGetRequest) {\r\n return this.getAll(`${controller}/getallreceipt`, {\r\n params: req,\r\n });\r\n }\r\n\r\n CreateSession(payment: UpgradePayment) {\r\n return this.post(\r\n `${controller}/createsession`,\r\n payment\r\n );\r\n }\r\n\r\n SaveSubscription() {\r\n return this.getAll(`${controller}/savesubscription`);\r\n }\r\n\r\n UpdateSubscriptionYear(subscription: UpgradeSubYear) {\r\n return this.post(\r\n `${controller}/upgradesubscriptionyear`,\r\n subscription\r\n );\r\n }\r\n CancelSubscription() {\r\n return this.getAll(`${controller}/cancelsubscription`);\r\n }\r\n GetChangedPlan() {\r\n return this.getAll(`${controller}/getchangedplan`);\r\n }\r\n UpdatePlan(downgrade: Downgrade) {\r\n return this.post(`${controller}/updateplan`, downgrade);\r\n }\r\n\r\n RemainingDaysUp(priceId: string) {\r\n return this.getAll(`${controller}/remainingdaysup/${priceId}`);\r\n }\r\n}\r\n\r\nexport const paymentsService = new PaymentsService();\r\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Payments.vue?vue&type=style&index=0&id=2aac1ff6&prod&scoped=true&lang=css&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return (_vm.finish)?_c('v-container',[(\n !_vm.showCard &&\n !_vm.showSubscriptionPlan &&\n !_vm.showBillingAddress &&\n !_vm.showConfirmPlan &&\n !_vm.showCancelPlan\n )?_c('div',{staticStyle:{\"max-width\":\"1230px\"}},[_c('v-row',{staticClass:\"mt-4\"},[_c('subscription-plan',{attrs:{\"subscriptionPlan\":_vm.subscriptionPlan,\"addTitle\":_vm.addTitleSub,\"cancelledPlan\":_vm.duration == 0 ? true : false}}),_c('v-col',[(_vm.duration === 3 && !_vm.downgrade)?_c('z-basic-button',{attrs:{\"type\":\"primary-color\"},on:{\"click\":function($event){return _vm.changePageRoute('overview')}}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.SubscribePlan\"))+\" \")]):_vm._e(),(\n _vm.duration != 3 &&\n _vm.duration != 0 &&\n !_vm.downgrade &&\n !_vm.subscriptionExpired\n )?_c('z-basic-button',{staticClass:\"mr-2\",attrs:{\"type\":\"primary-color\"},on:{\"click\":function($event){return _vm.changePageRoute('overview')}}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.ChangeSubscription\"))+\" \")]):_vm._e(),(\n _vm.duration != 3 &&\n _vm.duration != 0 &&\n !_vm.downgrade &&\n !_vm.subscriptionExpired\n )?_c('z-basic-button',{attrs:{\"type\":\"neutral\"},on:{\"click\":function($event){return _vm.changePageRoute('cancelplan')}}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.DeleteSubscription\"))+\" \")]):_vm._e(),(\n _vm.duration == 0 ||\n (_vm.subscriptionExpired && !_vm.downgrade && _vm.duration != 3)\n )?_c('z-basic-button',{attrs:{\"type\":\"primary-color\"},on:{\"click\":function($event){return _vm.changePageRoute('overview')}}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.SubscribeAgain\"))+\" \")]):_vm._e(),(_vm.downgrade)?_c('z-basic-button',{attrs:{\"type\":\"primary-color\"},on:{\"click\":function($event){return _vm.changePageRoute('overview')}}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.SeeOverview\"))+\" \")]):_vm._e()],1)],1),_c('v-row',{staticClass:\"my-4\"},[_c('v-col',[_c('v-divider')],1)],1),(\n _vm.billingAddress.companyName != '' && _vm.billingAddress.companyName != null\n )?_c('v-row',[_c('v-col',{staticClass:\"z-pagetitle-bold text-on-background\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.BillingAddress\"))+\" \")]),_c('v-col',{staticClass:\"text-on-background z-body-bold-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(_vm.billingAddress.companyName)+\" \")]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(_vm.billingAddress.companyAddress)+\" \")]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(_vm.billingAddress.city)+\" \")]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(_vm.billingAddress.province)+\" \")]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(_vm.billingAddress.postalCode)+\" \")]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(_vm.billingAddress.countryDescr)+\" \")]),_c('v-spacer'),_c('v-col',{attrs:{\"cols\":\"auto\"}},[_c('z-plain-button',{attrs:{\"icon\":\"pencil\",\"type\":\"neutral\",\"iconOnly\":\"\"},on:{\"click\":function($event){_vm.showBillingAddress = true}}})],1)],1):_c('v-row',[_c('v-col',{staticClass:\"z-pagetitle-bold text-on-background\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.BillingAddress\"))+\" \")]),_c('v-col',[_c('z-plain-button',{attrs:{\"icon\":\"plus\",\"type\":\"neutral\"},on:{\"click\":function($event){return _vm.changePageRoute('billingaddress')}}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.BillingAddressAdd\"))+\" \")])],1)],1),_c('div',{staticClass:\"mb-6 my-4\"},[_c('v-row',[_c('v-col',[_c('v-divider')],1)],1),_c('v-row',{staticClass:\"z-pagetitle-bold text-on-background\"},[_c('v-col',[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.PaymentHistory\"))+\" \")])],1),_c('v-row',{staticClass:\"my-4\"},[_c('v-col',[_c('z-date-range-picker',{attrs:{\"label\":_vm.$tc('payments.PaymentPeriodFilter')},on:{\"change\":_vm.getAllReceipt},model:{value:(_vm.filterDateRange),callback:function ($$v) {_vm.filterDateRange=$$v},expression:\"filterDateRange\"}})],1)],1),(_vm.loaderReceipt)?_c('v-row',{staticClass:\"pt-10\"},[_c('v-col',{staticStyle:{\"text-align\":\"center\"}},[_c('v-progress-circular',{attrs:{\"size\":50,\"color\":\"var(--z-on-background-primary-high)\",\"indeterminate\":\"\"}})],1)],1):(_vm.noReceipts)?_c('v-row',[_c('v-col',[_c('p',[_vm._v(_vm._s(_vm.noReceiptsText))])])],1):_c('div',_vm._l((_vm.receipts),function(recepit,index){return _c('v-row',{key:'s' + index},[_c('v-col',{staticClass:\"text-on-background z-body-bold-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(recepit.date)+\" \")]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"2\",\"align-self\":\"center\"}},[(recepit.cardName != null)?_c('z-tag',{attrs:{\"type\":\"success\",\"text\":_vm.$tc('payments.PaymentAccepted')}}):_c('z-tag',{attrs:{\"type\":\"error\",\"text\":_vm.$tc('payments.PaymentDenied')}})],1),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"1\",\"align-self\":\"center\"}},[(recepit.cardName != null)?_c('span',[_vm._v(\" \"+_vm._s(recepit.cardName)+\" \")]):_c('span',[_vm._v(\" \"+_vm._s(\"--\")+\" \")])]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"2\",\"align-self\":\"center\"}},[(recepit.cardName != null)?_c('span',[_vm._v(\" \"+_vm._s(\"**** **** \" + recepit.lastFourDigits)+\" \")]):_c('span',[_vm._v(\" \"+_vm._s(\"--\")+\" \")])]),_c('v-col',{staticClass:\"text-on-background z-body-regular-small\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(recepit.productName)+\" \")]),_c('v-spacer'),_c('v-col',{staticClass:\"z-body-bold text-title-subscription-plan\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(recepit.cardName != null ? (parseFloat(recepit.amount) / 100).toFixed(2) + \" €\" : \"\")+\" \")]),_c('v-col',{attrs:{\"cols\":\"auto\"}},[_c('z-plain-button',{attrs:{\"icon\":\"maximize-2\",\"type\":\"neutral\",\"iconOnly\":\"\",\"disabled\":recepit.cardName == null},on:{\"click\":function($event){return _vm.openInvoice(recepit.urlDownload)}}})],1)],1)}),1)],1)],1):_vm._e(),(_vm.showSubscriptionPlan)?_c('div',[_c('subscription-plan-overview',{on:{\"back\":function($event){_vm.showSubscriptionPlan = false;\n _vm.changePageRoute('');},\"openConfirmPlan\":_vm.showConfirm}})],1):_vm._e(),(_vm.showBillingAddress)?_c('div',[_c('billing-address',{attrs:{\"previousPage\":_vm.previousPage,\"roleIdOld\":_vm.roleIdOld,\"month\":_vm.month},on:{\"back\":_vm.closeBillingAddress}})],1):_vm._e(),(_vm.showConfirmPlan)?_c('div',[_c('confirm-plan',{attrs:{\"roleId\":_vm.roleId,\"month\":_vm.month},on:{\"previousPage\":function($event){return _vm.previousPageManager(_vm.roleId)},\"back\":function($event){_vm.showConfirmPlan = false}}})],1):_vm._e(),(_vm.showCancelPlan)?_c('div',[_c('cancel-plan',{on:{\"back\":function($event){_vm.showCancelPlan = false;\n _vm.changePageRoute('');}}})],1):_vm._e()]):(_vm.showEmptyState)?_c('v-container',{staticClass:\"mod--empty-container\",attrs:{\"fill-height\":\"\"}},[_c('div',[_c('p',{staticClass:\"z-heading-h1 coloured-title\"},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.EmptyStateTitle\"))+\" \")]),_c('p',{staticClass:\"z-heading-h5\"},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.EmptyStateDescription\"))+\" \")])])]):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport store from \"@/store\";\r\nimport AuthModule from \"@/store/modules/auth.module\";\r\nimport OverlayModule from \"@/store/modules/overlay.module\";\r\nimport { Component, Vue, Watch } from \"vue-property-decorator\";\r\nimport { getModule } from \"vuex-module-decorators\";\r\nimport { required } from \"@/helpers/rules\";\r\nimport { userService } from \"@/services/api/user.service\";\r\nimport { PromotionPlans } from \"@/models/entities/subscription-plan.interface\";\r\nimport { Card } from \"@/models/entities/card.interface\";\r\nimport { paymentsService } from \"@/services/api/payments.service\";\r\nimport { BillingAddress } from \"@/models/entities/billing-address.interface\";\r\nimport {\r\n PaymentIntentGetRequest,\r\n Receipt,\r\n} from \"@/models/entities/receipt.interfece\";\r\n\r\nconst overlayModule = getModule(OverlayModule, store);\r\nconst authModule = getModule(AuthModule, store);\r\n\r\nconst SubscriptionPlanOverview = () =>\r\n import(\"./PaymentsComponents/SubscriptionPlanOverview.vue\");\r\nconst BillingAddressPage = () =>\r\n import(\"./PaymentsComponents/BillingAddressPage.vue\");\r\nconst ConfirmPlan = () => import(\"./PaymentsComponents/ConfirmPlan.vue\");\r\nconst SubscriptionPlan = () =>\r\n import(\"./PaymentsComponents/SubscriptionPlan.vue\");\r\nconst CancelPlan = () => import(\"./PaymentsComponents/CancelPlan.vue\");\r\n\r\ntype CardIssuer =\r\n | \"Visa\"\r\n | \"MasterCard\"\r\n | \"DinersClub\"\r\n | \"AmEx\"\r\n | \"Discover\"\r\n | \"JCB\"\r\n | \"Maestro\"\r\n | \"VisaElectron\";\r\n\r\n@Component({\r\n components: {\r\n \"subscription-plan-overview\": SubscriptionPlanOverview,\r\n \"confirm-plan\": ConfirmPlan,\r\n \"subscription-plan\": SubscriptionPlan,\r\n \"cancel-plan\": CancelPlan,\r\n \"billing-address\": BillingAddressPage,\r\n },\r\n})\r\nexport default class Payments extends Vue {\r\n private required = required;\r\n\r\n private showCard = false;\r\n private showSubscriptionPlan = false;\r\n private showBillingAddress = false;\r\n private showCancelPlan = false;\r\n private showConfirmPlan = false;\r\n private showEmptyState = false;\r\n private roleId = 0;\r\n private month = true;\r\n private duration = null;\r\n private addTitleSub = \"\";\r\n private previousPage = \"\";\r\n private roleIdOld = 0;\r\n private loaderReceipt = false;\r\n private downgrade = false;\r\n private finish = false;\r\n private previousContext = \"\";\r\n filterDateRange: string[] = [];\r\n\r\n private subscriptionPlan: PromotionPlans = {\r\n offertID: 0,\r\n nameOffert: \"\",\r\n descrOffert: \"\",\r\n price: \"\",\r\n monthlyBeneficiaries: \"\",\r\n totalSubjects: \"\",\r\n firstSupport: false,\r\n secondSupport: false,\r\n expiration: \"\",\r\n freeTrial: \"\",\r\n roleId: 0,\r\n priceMonthID: \"\",\r\n priceYearID: \"\",\r\n yearPrice: \"\",\r\n };\r\n\r\n private subscriptionExpired = false;\r\n\r\n private billingAddress: BillingAddress = {\r\n companyName: \"\",\r\n companyAddress: \"\",\r\n city: \"\",\r\n postalCode: \"\",\r\n province: \"\",\r\n countryID: 0,\r\n countryDescr: \"\",\r\n };\r\n\r\n private receipts: Receipt[] = [];\r\n\r\n async created(): Promise {\r\n overlayModule.showOverlay();\r\n const user = (await userService.GetSubscription()).data;\r\n authModule.setProfileRoleID(user.roleId);\r\n const context = this.$route.params.payments;\r\n if (context == \"overview\") {\r\n this.showSubscriptionPlan = true;\r\n this.showCard = false;\r\n this.showBillingAddress = false;\r\n this.showConfirmPlan = false;\r\n this.showCancelPlan = false;\r\n }\r\n\r\n await Promise.all([\r\n this.loadSubscription(),\r\n this.getChangedPlan(),\r\n this.loadBillingAddress(),\r\n this.loadSubscriptionDuration(),\r\n ]);\r\n const parse = this.subscriptionPlan.expiration?.split(\"/\");\r\n if (parse?.length === 3) {\r\n this.subscriptionExpired =\r\n new Date(parse[1] + \"/\" + parse[0] + \"/\" + parse[2]).getTime() <\r\n new Date().getTime();\r\n this.finish = true;\r\n this.getAllReceipt();\r\n } else {\r\n this.showEmptyState = true;\r\n }\r\n }\r\n\r\n private async loadSubscription(): Promise {\r\n overlayModule.showOverlay();\r\n this.subscriptionPlan = (await userService.GetSubscription()).data;\r\n }\r\n\r\n private async getChangedPlan(): Promise {\r\n overlayModule.showOverlay();\r\n this.downgrade = (await paymentsService.GetChangedPlan()).data;\r\n }\r\n\r\n private async loadBillingAddress(): Promise {\r\n overlayModule.showOverlay();\r\n this.billingAddress = (await userService.GetBillingAddressByID()).data;\r\n }\r\n\r\n get noReceipts(): boolean {\r\n return !this.loaderReceipt && this.receipts?.length === 0;\r\n }\r\n\r\n get noReceiptsText(): string {\r\n return this.filterDateRange?.length > 1\r\n ? this.$tc(\"payments.PaymentNoneFiltered\")\r\n : this.$tc(\"payments.PaymentNoFilters\");\r\n }\r\n\r\n private async getAllReceipt(): Promise {\r\n this.loaderReceipt = true;\r\n if (this.filterDateRange?.length === 2) {\r\n const req: PaymentIntentGetRequest = {\r\n userId: authModule.userID,\r\n dateFrom: this.filterDateRange[0].toDate(\"yyyy-MM-dd\"),\r\n dateTo: this.filterDateRange[1].toDate(\"yyyy-MM-dd\"),\r\n };\r\n const res = await paymentsService.GetAllReceipt(req);\r\n if (res?.data) {\r\n this.receipts = res?.data;\r\n }\r\n }\r\n this.loaderReceipt = false;\r\n }\r\n\r\n private async loadSubscriptionDuration(): Promise {\r\n this.duration = (await userService.SubscriptionDuration()).data;\r\n if (this.duration == 3) {\r\n this.addTitleSub = this.$tc(\"payments.FreeSubscription\");\r\n }\r\n }\r\n\r\n private openInvoice(url: string): void {\r\n window.open(url);\r\n }\r\n\r\n private async closeBillingAddress() {\r\n overlayModule.showOverlay();\r\n this.billingAddress = (await userService.GetBillingAddressByID()).data;\r\n this.showBillingAddress = false;\r\n this.changePageRoute(\"\");\r\n }\r\n\r\n @Watch(\"$route.params.payments\")\r\n async contextChanged(): Promise {\r\n let context = this.$route.params.payments;\r\n if (this.previousContext != context) {\r\n this.previousContext = context;\r\n if (context != \"home\") {\r\n this.previousContext = context;\r\n if (context) {\r\n this.$router.push({\r\n name: \"account\",\r\n params: {\r\n context: \"payments\",\r\n payments: context,\r\n },\r\n });\r\n }\r\n } else {\r\n this.changePageRoute(\"\");\r\n }\r\n }\r\n this.showCard = false;\r\n switch (context) {\r\n case \"overview\":\r\n this.showSubscriptionPlan = true;\r\n this.showBillingAddress = false;\r\n this.showConfirmPlan = false;\r\n this.showCancelPlan = false;\r\n break;\r\n case \"home\":\r\n this.showSubscriptionPlan = false;\r\n this.showBillingAddress = false;\r\n this.showConfirmPlan = false;\r\n this.showCancelPlan = false;\r\n this.loadBillingAddress();\r\n break;\r\n case \"cancelplan\":\r\n this.showSubscriptionPlan = false;\r\n this.showBillingAddress = false;\r\n this.showConfirmPlan = false;\r\n this.showCancelPlan = true;\r\n break;\r\n case \"billingaddress\":\r\n this.showSubscriptionPlan = false;\r\n this.showBillingAddress = true;\r\n this.showConfirmPlan = false;\r\n this.showCancelPlan = false;\r\n break;\r\n case \"confirmplan\":\r\n this.showSubscriptionPlan = false;\r\n this.showBillingAddress = false;\r\n this.showConfirmPlan = true;\r\n this.showCancelPlan = false;\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n private async changePageRoute(value: string): Promise {\r\n if (value != this.previousContext || this.previousContext == \"\") {\r\n this.previousContext = value;\r\n if (value != \"\" && value != \"home\") {\r\n this.$router.push({\r\n name: \"account\",\r\n params: {\r\n context: \"payments\",\r\n payments: value,\r\n },\r\n });\r\n } else {\r\n this.$router.push({\r\n name: \"account\",\r\n params: {\r\n context: \"payments\",\r\n },\r\n });\r\n }\r\n }\r\n }\r\n\r\n private showConfirm(roleId: number, toggle: number): void {\r\n this.roleId = roleId;\r\n if (toggle == 0) {\r\n this.month = true;\r\n } else {\r\n this.month = false;\r\n }\r\n this.changePageRoute(\"confirmplan\");\r\n }\r\n\r\n private previousPageManager(roleId: number) {\r\n this.previousPage = \"confirmplan\";\r\n this.roleIdOld = roleId;\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Payments.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Payments.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Payments.vue?vue&type=template&id=2aac1ff6&scoped=true&\"\nimport script from \"./Payments.vue?vue&type=script&lang=ts&\"\nexport * from \"./Payments.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Payments.vue?vue&type=style&index=0&id=2aac1ff6&prod&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"2aac1ff6\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}