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,YACIrD,KAAKa,UAAY,CACrB,CAEA2B,YACIxC,KAAKa,UAAY,CACrB,CAEAmC,SAASU,GACL,MAAMC,EAAwB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,KACtEC,EAAqBF,EAAMG,IAE5BF,EAAYG,SAASF,IACtBF,EAAMK,gBAEd,GA5BiBR,GAAcjC,EAAAA,EAAAA,IAAA,EAHlC0C,EAAAA,EAAAA,IAAU,CACPnC,KAAM,oBAEW0B,G,UCP4c,I,eCO7dU,GAAY,OACd,EACAjC,EACAsB,GACA,EACA,KACA,KACA,MAIF,QAAeW,EAAiB,O","sources":["webpack://website-js/./src/services/RecipeService.ts","webpack://website-js/./src/store/modules/RecipeModule.ts","webpack://website-js/./src/components/recipe/RecipePortions.vue","webpack://website-js/./src/components/recipe/RecipePortions.vue?928b","webpack://website-js/./src/components/recipe/RecipePortions.vue?47bd","webpack://website-js/./src/components/recipe/RecipePortions.vue?2116"],"sourcesContent":["import { AddedRecipe, RecipeCalculationRequest, RecipeCalculationResponse } from '@/models/Recipe';\r\nimport axios, { AxiosResponse } from 'axios';\r\n\r\nexport default class RecipeService {\r\n\r\n private profileId: string = (window as any).CbxApiContextKey;\r\n private endpoint: string;\r\n\r\n constructor(args: any = {}) {\r\n if (args.profileId)\r\n this.profileId = args.profileId;\r\n this.endpoint = `/contextapi/${this.profileId}/v1/recipe`;\r\n }\r\n \r\n public async calculate(data: RecipeCalculationRequest): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.post(`${this.endpoint}/calculate`, data);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n }\r\n \r\n public async getAdded(): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.post(`${this.endpoint}/added`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n } \r\n \r\n public async removeAdded(id: string): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.post(`${this.endpoint}/remove/${id}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n } \r\n}\r\n","import { Module, VuexModule, Mutation, getModule, Action } from 'vuex-module-decorators';\r\nimport store from '@/store';\r\nimport { AddedRecipe } from '@/models/Recipe';\r\nimport RecipeService from '@/services/RecipeService';\r\n\r\n@Module({\r\n store,\r\n dynamic: true,\r\n name: 'recipe',\r\n namespaced: true,\r\n})\r\nclass RecipeModule extends VuexModule {\r\n\r\n private service: RecipeService = new RecipeService();\r\n\r\n private portions: number = 1;\r\n private added: AddedRecipe[] = [];\r\n\r\n get PORTIONS(): number {\r\n return this.portions;\r\n }\r\n\r\n get ADDED(): AddedRecipe[] {\r\n return this.added;\r\n }\r\n\r\n @Mutation\r\n public SET_PORTIONS(args: number) {\r\n this.portions = args;\r\n }\r\n\r\n @Action({ commit: 'SET_ADDED' })\r\n public async GET_ADDED() {\r\n return await this.service.getAdded();\r\n }\r\n @Action({ commit: 'SET_ADDED' })\r\n public async REMOVE_ADDED(id: string) {\r\n return await this.service.removeAdded(id);\r\n }\r\n @Mutation\r\n public SET_ADDED(payload: AddedRecipe[]) {\r\n this.added = payload;\r\n }\r\n\r\n}\r\n\r\nexport default getModule(RecipeModule);\r\n","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"recipe-portions\"},[_c('button',{staticClass:\"uk-icon-button\",attrs:{\"uk-icon\":\"minus-circle\"},on:{\"click\":_vm.decrement}}),_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(_vm.portions),expression:\"portions\",modifiers:{\"number\":true}}],staticClass:\"uk-input\",attrs:{\"type\":\"text\"},domProps:{\"value\":(_vm.portions)},on:{\"keypress\":function($event){return _vm.isNumber($event)},\"input\":function($event){if($event.target.composing)return;_vm.portions=_vm._n($event.target.value)},\"blur\":function($event){return _vm.$forceUpdate()}}}),_c('button',{staticClass:\"uk-icon-button\",attrs:{\"uk-icon\":\"plus-circle\"},on:{\"click\":_vm.increment}})])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport RecipeModule from '@/store/modules/RecipeModule';\r\nimport { Component, Vue } from 'vue-property-decorator';\r\n\r\n@Component({\r\n name: 'RecipePortions',\r\n})\r\nexport default class RecipePortions extends Vue {\r\n\r\n get portions(): number {\r\n return RecipeModule.PORTIONS;\r\n }\r\n set portions(input: number)\r\n {\r\n if (input <= 0)\r\n input = 1;\r\n\r\n RecipeModule.SET_PORTIONS(input);\r\n }\r\n\r\n increment() {\r\n this.portions += 1;\r\n }\r\n\r\n decrement() {\r\n this.portions -= 1;\r\n }\r\n\r\n isNumber(event: KeyboardEvent) {\r\n const keysAllowed: string[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\r\n const keyPressed: string = event.key;\r\n \r\n if (!keysAllowed.includes(keyPressed)) {\r\n event.preventDefault();\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??clonedRuleSet-41.use[0]!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??clonedRuleSet-41.use[3]!../../../node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!../../../node_modules/@vue/cli-service/lib/config/vue-loader-v15-resolve-compat/vue-loader.js??vue-loader-options!./RecipePortions.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??clonedRuleSet-41.use[0]!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??clonedRuleSet-41.use[3]!../../../node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!../../../node_modules/@vue/cli-service/lib/config/vue-loader-v15-resolve-compat/vue-loader.js??vue-loader-options!./RecipePortions.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./RecipePortions.vue?vue&type=template&id=06a1f690&\"\nimport script from \"./RecipePortions.vue?vue&type=script&lang=ts&\"\nexport * from \"./RecipePortions.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/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"],"names":["RecipeService","constructor","args","_defineProperty","window","CbxApiContextKey","profileId","this","endpoint","async","data","res","axios","e","console","log","id","RecipeModule","VuexModule","PORTIONS","portions","ADDED","added","SET_PORTIONS","service","getAdded","removeAdded","SET_ADDED","payload","__decorate","Mutation","Action","commit","Module","store","dynamic","name","namespaced","getModule","render","_vm","_c","_self","_setupProxy","staticClass","attrs","on","decrement","directives","rawName","value","expression","modifiers","domProps","$event","isNumber","target","composing","_n","$forceUpdate","increment","staticRenderFns","RecipePortions","Vue","input","event","keysAllowed","keyPressed","key","includes","preventDefault","Component","component"],"sourceRoot":""}