{"version":3,"sources":["webpack:///./src/views/pages/ControleInfinity/Renew/Index.vue?0d44","webpack:///./src/views/pages/ControleInfinity/checkSubscription.js","webpack:///./src/views/pages/ControleInfinity/Renew/Index.vue?2612","webpack:///./src/views/pages/ControleInfinity/Renew/IndexMixin.js","webpack:///./src/views/pages/ControleInfinity/Renew/PurchaseMixin.js","webpack:///src/views/pages/ControleInfinity/Renew/Index.vue","webpack:///./src/views/pages/ControleInfinity/Renew/Index.vue?ec2c","webpack:///./src/views/pages/ControleInfinity/Renew/Index.vue"],"names":["mounted","check","methods","mapActions","url","$http","get","catch","e","response","data","addAbility","removeAbility","updateLocalStorage","$router","push","name","this","render","_vm","_h","$createElement","_c","_self","staticClass","_l","item","index","key","attrs","directives","rawName","value","expression","_v","_s","plan","price","JSON","parse","details","loading","on","$event","stopPropagation","purchasePlanConfirm","staticRenderFns","plans","subscription","getPlans","getSubscription","then","res","finally","getStartInFreeTrial","status","$swal","title","icon","text","type","confirmButtonText","customClass","confirmButton","confirmed","html","showCancelButton","cancelButtonText","cancelButton","result","purchasePlan","id","message","noBalance","SwalMessages","no_balance","buttons","isConfirmed","components","BCard","BCardTitle","BCardText","BRow","BCol","BBadge","BButton","BSpinner","BListGroup","BListGroupItem","mixins","IndexMixin","PurchaseMixin","checkSubscription","component"],"mappings":"kHAAA,W,6GCEe,QACPA,QADO,WACI,wKACT,EAAKC,QADI,8CAGjBC,QAAS,iCACJC,eAAW,OAAQ,CAAC,aAAc,gBAAiB,wBADjD,IAECF,MAFC,WAEQ,qKACPG,EAAM,6CADC,SAGP,EAAKC,MAAMC,IAAIF,GAClBG,MADG,yDACG,WAAMC,GAAN,oFACmB,4CAApBA,EAAEC,SAASC,KADV,gCAEG,EAAKC,WAAW,gBAFnB,uBAGG,EAAKC,cAAc,gBAHtB,uBAIG,EAAKC,qBAJR,OAMH,EAAKC,QAAQC,KAAK,CAAEC,KAAM,gCANvB,2CADH,kCAAAC,KAAA,gBAHO,kD,yCCRnB,IAAIC,EA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,OACIC,KAAJ,OACIC,OAAJ,OACIC,QAAJ,OACIC,SAAJ,OACIC,WAAJ,OACIC,eAAJ,QAEEC,OAAQ,CAACC,EAAYC,EAAeC,EAAtC,OCjF4X,I,wBCQxXC,EAAY,eACd,EACA3E,EACA4B,GACA,EACA,KACA,KACA,MAIa,aAAA+C,E","file":"js/chunk-5bf3989d.cd0cc9ba.js","sourcesContent":["export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=style&index=0&lang=scss&\"","import { mapActions } from 'vuex'\n\nexport default {\n async mounted () {\n await this.check()\n },\n methods: {\n ...mapActions('user', ['addAbility', 'removeAbility', 'updateLocalStorage']),\n async check () {\n const url = '/user/controle_infinity/subscription/check'\n\n await this.$http.get(url)\n .catch(async e => {\n if (e.response.data === 'You do not have an active subscription.') {\n await this.addAbility('controle.buy')\n await this.removeAbility('controle.all')\n await this.updateLocalStorage()\n\n this.$router.push({ name: 'Controle Infinity (Assinar)' })\n }\n })\n }\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',{staticClass:\"pricing-card\"},_vm._l((_vm.plans),function(item,index){return _c('b-col',{key:index,staticClass:\"mx-auto\",attrs:{\"md\":\"4\"}},[_c('b-card',{attrs:{\"align\":\"center\"}},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(true),expression:\"true\"}],staticClass:\"pricing-badge text-center\"},[_c('b-badge',{staticClass:\"font-small-4\",attrs:{\"variant\":\"light-info\",\"pill\":\"\"}},[_c('span',{staticClass:\"py-1 px-1\"},[_vm._v(\" \"+_vm._s(item.plan)+\" \")])])],1),_c('div',{staticClass:\"annual-plan\"},[_c('div',{staticClass:\"plan-price mt-2\"},[_c('sup',{staticClass:\"font-medium-1 font-weight-bold text-primary\"},[_vm._v(\"R$ \")]),_c('span',{staticClass:\"pricing-basic-value font-weight-bolder text-primary\"},[_vm._v(_vm._s(item.price))])])]),_c('b-list-group',{staticClass:\"list-group-circle text-left d-flex justify-content-center\"},_vm._l((JSON.parse(item.details)),function(details){return _c('b-list-group-item',{key:details},[_vm._v(\" \"+_vm._s(details)+\" \")])}),1),_c('b-button',{staticClass:\"mt-1\",attrs:{\"block\":\"\",\"variant\":\"relief-primary\",\"disabled\":_vm.loading},on:{\"click\":function($event){$event.stopPropagation();return _vm.purchasePlanConfirm(item)}}},[(!_vm.loading)?_c('span',[_vm._v(\"Comprar\")]):_c('b-spinner',{attrs:{\"small\":\"\"}})],1)],1)],1)}),1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default {\n data: () => ({\n loading: false,\n plans: [],\n subscription: []\n }),\n async mounted () {\n await this.getPlans()\n await this.getSubscription()\n },\n methods: {\n async getPlans () {\n this.loading = true\n\n const url = '/user/controle_infinity/get_plans'\n await this.$http.get(url)\n .then(res => {\n this.plans = res.data\n }).finally(() => {\n this.loading = false\n })\n },\n async getSubscription () {\n this.loading = true\n\n const url = '/user/controle_infinity/subscription'\n await this.$http.get(url)\n .then(res => {\n this.subscription = res.data\n }).finally(() => {\n this.loading = false\n })\n }\n }\n}\n","import { mapActions } from 'vuex'\nimport SwalMessages from '@/views/pages/BuyServices/utils/SwalMessages'\n\nexport default {\n data: () => ({\n loading: false\n }),\n methods: {\n ...mapActions('user', ['addAbility', 'removeAbility', 'updateLocalStorage']),\n async getStartInFreeTrial () {\n this.loading = true\n const url = '/user/controle_infinity/free_trial'\n\n await this.$http.get(url)\n .then(async res => {\n if (res.status === 201 && res.data === 'Free trial applied') {\n await this.addAbility('controle.all')\n await this.removeAbility('controle.buy')\n await this.updateLocalStorage()\n\n this.$swal({\n title: 'Sucesso!',\n icon: 'success',\n text: 'Você está no modo de teste gratuito!',\n type: 'success',\n confirmButtonText: 'Ok',\n customClass: {\n confirmButton: 'btn btn-success'\n }\n })\n .then(confirmed => {\n if (confirmed) {\n this.$router.push({ name: 'Controle Infinity (Minha Assinatura)' })\n }\n })\n }\n })\n .catch(() => {\n this.$swal({\n title: 'Erro!',\n icon: 'error',\n text: 'Você não pode iniciar uma assinatura gratuita!',\n type: 'error',\n confirmButtonText: 'Ok',\n customClass: {\n confirmButton: 'btn btn-danger'\n }\n })\n })\n .finally(() => {\n this.loading = false\n })\n },\n purchasePlanConfirm (plan) {\n this.$swal({\n title: 'Renovar Plano?',\n type: 'info',\n html: `

Você está prestes a renovar o plano para ${plan.plan}.

`,\n icon: 'warning',\n showCancelButton: true,\n confirmButtonText: 'Sim!',\n cancelButtonText: 'Cancelar',\n customClass: {\n confirmButton: 'btn btn-primary',\n cancelButton: 'btn btn-danger ml-1'\n }\n }).then(result => {\n if (result.value) {\n this.purchasePlan(plan)\n }\n })\n },\n async purchasePlan (plan) {\n const url = `/user/controle_infinity/purchase/${plan.id}`\n this.loading = true\n\n this.$http.get(url)\n .then(async res => {\n if (res.status === 201 && res.data === 'Plan applied') {\n await this.addAbility('controle.all')\n await this.removeAbility('controle.buy')\n await this.updateLocalStorage()\n\n this.$swal({\n title: 'Sucesso!',\n icon: 'success',\n text: 'Sua assinatura está ativa!',\n type: 'success',\n confirmButtonText: 'Ok',\n customClass: {\n confirmButton: 'btn btn-success'\n }\n })\n .then(confirmed => {\n if (confirmed) {\n this.$router.push({ name: 'Controle Infinity (Minha Assinatura)' })\n }\n })\n }\n if (res.data.message === 'no balance.' && res.status === 200) this.noBalance()\n })\n .finally(() => {\n this.loading = false\n })\n },\n noBalance () {\n this.$swal(SwalMessages.no_balance).then(buttons => (buttons.isConfirmed\n ? this.$router.push({ name: 'Adicionar Saldo' })\n : null))\n }\n }\n}\n","\n\n\n\n\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Index.vue?vue&type=template&id=4f2b209a&\"\nimport script from \"./Index.vue?vue&type=script&lang=js&\"\nexport * from \"./Index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Index.vue?vue&type=style&index=0&lang=scss&\"\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 null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}