{"version":3,"sources":["webpack:///./src/utils/Helpers.ts","webpack:///./src/views/User/Ingredients.vue?4e01","webpack:///./src/components/vBreadcrumbs.vue","webpack:///./src/components/vBreadcrumbs.vue?361d","webpack:///./src/components/vBreadcrumbs.vue?72f9","webpack:///./src/components/vBreadcrumbs.vue?06cf","webpack:///./src/views/User/Ingredients.vue?b6aa","webpack:///./src/assets/Customer/assets/img/apple-profile.jpg","webpack:///./src/views/User/Ingredients.vue","webpack:///./src/views/User/Ingredients.vue?73cb","webpack:///./src/views/User/Ingredients.vue?e10a","webpack:///./src/views/User/Ingredients.vue?1ff3","webpack:///./src/utils/API/RecipesRepository.ts"],"names":["debounce","callback","time","arguments","length","undefined","intervalId","localStorage","getItem","clearTimeout","setTimeout","setItem","round","number","decimalPlaces","Math","pow","shorten","text","newText","replace","parts","split","map","part","substr","join","toCamelCase","i","charAt","toUpperCase","slice","cammeled","desanitizeString","html","txt","document","createElement","innerHTML","value","getErrorMessage","error","translations","response","data","errorMessages","userVisibleMessage","get","mapNutritions","nutritions","dailyCalculation","dvCheck","roundedDv","exactDv","floor","roundingCheck","roundedValue","Number","isInteger","exactValue","toFixed","addedSugarPerServing","unadjustedAddedSugarPerServing","sugarAlcohols","alcoholSugarPerServing","alcoholSugarDv","roundedDailyValue","exactDailyValue","iron","ironPerServing","ironDv","calciumDv","calciumPerServing","calcium","potassiumDv","potassiumPerServing","potassium","vitaminDDv","vitaminDPerServing","vitaminD","vitaminC","vitaminCPerServing","sodiumDv","sodiumPerServing","sodium","cholesterol","cholesterolPerServing","cholesterolDv","protein","proteinPerServing","sugarsDv","sugarPerServing","sugars","fibre","fibrePerServing","fibreDv","carbohydrate","carbohydratePerServing","carbohydrateDv","transFatDv","transFatPerServing","transFat","saturatedFatDv","saturatedFatPerServing","saturatedFat","fatDv","fatPerServing","fat","calories","energyPerServing","servingWeight","weightPerServing","saturatedAndTransDv","saturatedAndTransFatPerServing","monounsaturatedFats","monounsaturatedFatPerServing","polyunsaturatedFats","polyunsaturatedFatPerServing","omega3","omega3PerServing","omega6","omega6PerServing","caffeine","caffeinePerServing","ash","ashPerServing","water","waterPerServing","moisture","moisturePerServing","servingQuantityInUnitOfMeasurement","quantityPerServingInUnitOfMeasurement","item1","servingUnitOfMeasurement","item2","volume","weight","mapNutritionsForDish","render","_vm","this","_c","_self","_setupProxy","staticClass","attrs","_l","$route","meta","breadCrumbs","crumb","key","class","indexOf","name","_v","_s","staticRenderFns","vBreadcrumbs","_Vue","_classCallCheck","_callSuper","_inherits","_createClass","localizationState","Vue","__decorate","Component","computed","_objectSpread","mapState","state","LocalizationModule","component","module","exports","$store","getters","getUserDetails","staticStyle","require","toLowerCase","_m","on","$event","preventDefault","add","apply","content","exportToExcelURL","tableHeaders","transformIngredients","ingredientsState","count","totalCount","pageSize","loading","changePage","onRecipeClick","edit","prepareDeletePrompt","order","showDeletePrompt","deletePromptTitle","resetState","confirmDelete","modalTitle","showModal","ingredient","editMode","submit","_e","recipesModal","isOpen","recipes","recipe","id","$router","push","params","concat","vSelectFx","vIngredientManagement","_","Ingredients","_this","page","filters","orders","field","orderType","OrderType","Asc","removeList","ingredients","createDefaultIngredient","nutrients","additionalNutrients","searchString","showAll","customIngredient","position","splice","unitHelper","selectedUnit","process","ids","_this2","$snotify","async","Promise","resolve","reject","IngredientsRepository","deleteRestaurantIngredients","then","body","requestIngredients","ListRequest","catch","message","timeout","closeOnClick","args","orderings","ordering","flag","nutrientHeaders","_this3","formatTableHeadersForVitaminC","formatTableDataForVitaminC","element","index","all","nutrientUnit","nutrient","nutrientType","NutrientType","Other","conversionCoeficient","e1","parseFloat","weightInGrams","link","searchable","sortable","serving","header","units","unit","listRequest","_this4","listRestaurantIngredients","result","populateTable","headers","indexC","findIndex","x","VitaminC","indexD","VitaminD","arraymove","tableData","_step","_iterator","_createForOfIteratorHelper","s","n","done","err","e","f","arr","fromIndex","toIndex","brand","components","energy","nutrientUnitId","ingredientId","saturatedFattyAcids","transFattyAcids","addedSugars","erythritol","isomalt","mannitol","xylitol","lactitol","sorbitol","maltitol","unspecifiedSugarAlcohol","allMeasurements","unitOfMeasurement","quantityInUnitOfMeasurement","hasVolumeUnitOfMeasurement","categoryDensityId","subIngredients","ingr","cloneDeep","find","_toConsumableArray","measurement","submitEdit","submitNew","_this5","updateIngredient","measurements","updateRestaurantIngredient","_this6","newIngredient","createRestaurantIngredient","_this7","RecipesRepository","listRecipesThatUseIngredient","getAllRecipesThatUseIngredient","_this8","dispatch","TRANSLATIONS_FETCH","category","collections","title","_this9","window","$","Pages","init","select2","allowClear","width","ajax","delay","transport","success","failure","term","processResults","r","results","eventData","target","vTable","vModal","resource","createRecipeCategory","Repository","post","withCredentials","listRecipeCategories","deleteRecipeCategory","listRecipes","getRecipeDetails","recipeId","createRecipe","deleteRecipe","udateRecipe","updateRecipe","searchSubRecipes","searchRecipes","renameCategory","updateCategory","moveRecipesToCategory","filterRecipesNames","recipesSearchTerm","recipeSearchTerm","calculate","recCalc","copyRecipe","saveRecipeLabel","getRecipeLabel","deleteRecipes","listRestaurantRecipesAsLookups","restaurantId","listCookingMethods","listFoodGroupClasses","listFoodGroupSubClasses","updateRecipeFoodClassifications","updateRecipeServingSize","updateCaloriesCalculationMethod","hasRecipeWithIngredientsFromSpecificDatabase","nutrientSource"],"mappings":"2IAEM,SAAUA,EAASC,GAAyB,IAAVC,EAAIC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAEvCG,EAAkBC,aAAaC,QAAQ,+BAEvCF,GACAG,aAAaH,GAGjBA,EAAaI,YAAW,WACpBT,MACDC,GAEHK,aAAaI,QAAQ,8BAA+BL,GAGlD,SAAUM,EAAMC,EAAgBC,GAClC,OAAOC,KAAKH,MAAMC,EAASE,KAAKC,IAAI,GAAIF,IAAkBC,KAAKC,IAAI,GAAIF,GAGrE,SAAUG,EAAQC,GAEpB,IAAIC,EAAUD,EAAKE,QAAQ,IAAK,IAChCD,EAAUA,EAAQC,QAAQ,IAAK,IAE/B,IA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,yBAAyB,CAAEI,iBAAiB,KAEjF4B,wBAAuB,SAACnX,GACpB,OAAOqV,OAAWC,KAAK,GAADtK,OAAImK,EAAQ,4BAA4BnV,EAAM,CAAEuV,iBAAiB,KAE3F6B,gCAA+B,SAACpX,GAC5B,OAAOqV,OAAWC,KAAK,GAADtK,OAAImK,EAAQ,oCAAoCnV,EAAM,CAAEuV,iBAAiB,KAEnG8B,wBAAuB,SAACrX,GACpB,OAAOqV,OAAWC,KAAK,GAADtK,OAAImK,EAAQ,4BAA4BnV,EAAM,CAAEuV,iBAAiB,KAE3F+B,gCAA+B,SAACtX,GAC5B,OAAOqV,OAAWC,KAAK,GAADtK,OAAImK,EAAQ,6BAA6BnV,EAAM,CAAEuV,iBAAiB,KAE5FgC,6CAA4C,SAACC,GACzC,OAAOnC,OAAWC,KAAK,GAADtK,OAAImK,EAAQ,iDAAiD,CAAEqC,eAAgBA,GAAkB,CAAEjC,iBAAiB,KAE9IjC,6BAA4B,SAAClC,GACzB,OAAOiE,OAAWlV,IAAI,GAAD6K,OAAImK,EAAQ,+CAAAnK,OAA8CoG,GAAgB,CAAEmE,iBAAiB","file":"js/chunk-3840b8f5.9eda71ce.js","sourcesContent":["import { Nutritions } from \"@/models/Recipes/Nutritions\";\r\n\r\nexport function debounce(callback: any, time = 250) {\r\n\r\n let intervalId: any = localStorage.getItem(\"some-unique-key-interval-id\");\r\n\r\n if (intervalId) {\r\n clearTimeout(intervalId);\r\n }\r\n\r\n intervalId = setTimeout(() => {\r\n callback();\r\n }, time);\r\n\r\n localStorage.setItem(\"some-unique-key-interval-id\", intervalId);\r\n}\r\n\r\nexport function round(number: number, decimalPlaces: number) {\r\n return Math.round(number * Math.pow(10, decimalPlaces)) / Math.pow(10, decimalPlaces);\r\n}\r\n\r\nexport function shorten(text: string) {\r\n\r\n let newText = text.replace(',', '');\r\n newText = newText.replace('.', '');\r\n\r\n let parts = newText.split(' ');\r\n parts = parts.map(part => {\r\n if (part.length > 3)\r\n return part.substr(0, 3) + '.';\r\n else {\r\n return part;\r\n }\r\n });\r\n\r\n return parts.join(' ');\r\n}\r\n\r\nexport function toCamelCase(text: string) {\r\n\r\n let parts = text.split(' ');\r\n for (let i = 0; i < parts.length; i++) {\r\n\r\n parts[i] = parts[i].charAt(0).toUpperCase() + parts[i].slice(1);\r\n }\r\n\r\n let cammeled = parts.join('');\r\n cammeled = cammeled.replace(',', '');\r\n\r\n return cammeled;\r\n}\r\n\r\nexport function desanitizeString(html: string) {\r\n var txt = document.createElement(\"textarea\");\r\n txt.innerHTML = html;\r\n return txt.value;\r\n}\r\n\r\nexport function getErrorMessage(error: any, translations: any) {\r\n return error.response &&\r\n error.response.data.errorMessages[0].userVisibleMessage\r\n ? error.response.data.errorMessages[0].userVisibleMessage\r\n : translations.get(\"toastr_network_error\");\r\n}\r\n\r\n// Fallowing functions are used to simplify the object nutritionAnalysis returned from backend\r\n\r\nexport function mapNutritions(nutritions: any, dailyCalculation?: number): Nutritions {\r\n const dvCheck = (value: number, roundedDv: number, exactDv: number): number => {\r\n return dailyCalculation ? Math.floor(exactDv) : roundedDv;\r\n };\r\n\r\n const roundingCheck = (value: any) => {\r\n if (dailyCalculation == undefined) {\r\n return value.roundedValue\r\n } else {\r\n if (dailyCalculation == 1) {\r\n return Number.isInteger(value.exactValue) ? value.exactValue: value.exactValue.toFixed(2)\r\n } else if(dailyCalculation == 0) {\r\n return Number.isInteger(value.roundedValue) ? value.roundedValue: value.roundedValue.toFixed(2)\r\n } else {\r\n return value.roundedValue\r\n }\r\n }\r\n }\r\n\r\n return {\r\n addedSugarPerServing: nutritions.addedSugarPerServing.exactValue,\r\n unadjustedAddedSugarPerServing: nutritions.unadjustedAddedSugarPerServing.exactValue,\r\n sugarAlcohols: roundingCheck(nutritions.alcoholSugarPerServing),\r\n alcoholSugarDv: dvCheck(\r\n nutritions.alcoholSugarPerServing.roundedValue,\r\n nutritions.alcoholSugarPerServing.roundedDailyValue,\r\n nutritions.alcoholSugarPerServing.exactDailyValue\r\n ),\r\n iron: roundingCheck(nutritions.ironPerServing),\r\n ironDv: dvCheck(\r\n nutritions.ironPerServing.roundedValue,\r\n nutritions.ironPerServing.roundedDailyValue,\r\n nutritions.ironPerServing.exactDailyValue\r\n ),\r\n calciumDv: dvCheck(\r\n nutritions.calciumPerServing.roundedValue,\r\n nutritions.calciumPerServing.roundedDailyValue,\r\n nutritions.calciumPerServing.exactDailyValue\r\n ),\r\n calcium: roundingCheck(nutritions.calciumPerServing),\r\n potassiumDv: dvCheck(\r\n nutritions.potassiumPerServing.roundedValue,\r\n nutritions.potassiumPerServing.roundedDailyValue,\r\n nutritions.potassiumPerServing.exactDailyValue\r\n ),\r\n potassium: roundingCheck(nutritions.potassiumPerServing),\r\n vitaminDDv: dvCheck(\r\n nutritions.vitaminDPerServing.roundedValue,\r\n nutritions.vitaminDPerServing.roundedDailyValue,\r\n nutritions.vitaminDPerServing.exactDailyValue\r\n ),\r\n vitaminD: roundingCheck(nutritions.vitaminDPerServing),\r\n vitaminC: roundingCheck(nutritions.vitaminCPerServing),\r\n sodiumDv: dvCheck(\r\n nutritions.sodiumPerServing.roundedValue,\r\n nutritions.sodiumPerServing.roundedDailyValue,\r\n nutritions.sodiumPerServing.exactDailyValue\r\n ),\r\n sodium: roundingCheck(nutritions.sodiumPerServing),\r\n cholesterol: roundingCheck(nutritions.cholesterolPerServing),\r\n cholesterolDv: dvCheck(\r\n nutritions.cholesterolPerServing.roundedValue,\r\n nutritions.cholesterolPerServing.roundedDailyValue,\r\n nutritions.cholesterolPerServing.exactDailyValue\r\n ),\r\n protein: roundingCheck(nutritions.proteinPerServing),\r\n sugarsDv: dvCheck(\r\n nutritions.sugarPerServing.roundedValue,\r\n nutritions.sugarPerServing.roundedDailyValue,\r\n nutritions.sugarPerServing.exactDailyValue\r\n ),\r\n sugars: roundingCheck(nutritions.sugarPerServing),\r\n fibre: roundingCheck(nutritions.fibrePerServing),\r\n fibreDv: dvCheck(\r\n nutritions.fibrePerServing.roundedValue,\r\n nutritions.fibrePerServing.roundedDailyValue,\r\n nutritions.fibrePerServing.exactDailyValue\r\n ),\r\n carbohydrate: roundingCheck(nutritions.carbohydratePerServing),\r\n carbohydrateDv: dvCheck(\r\n nutritions.carbohydratePerServing.roundedValue,\r\n nutritions.carbohydratePerServing.roundedDailyValue,\r\n nutritions.carbohydratePerServing.exactDailyValue\r\n ),\r\n transFatDv: dvCheck(\r\n nutritions.transFatPerServing.roundedValue,\r\n nutritions.transFatPerServing.roundedDailyValue,\r\n nutritions.transFatPerServing.exactDailyValue\r\n ),\r\n transFat: roundingCheck(nutritions.transFatPerServing),\r\n saturatedFatDv: dvCheck(\r\n nutritions.saturatedFatPerServing.roundedValue,\r\n nutritions.saturatedFatPerServing.roundedDailyValue,\r\n nutritions.saturatedFatPerServing.exactDailyValue\r\n ),\r\n saturatedFat: roundingCheck(nutritions.saturatedFatPerServing),\r\n fatDv: dvCheck(\r\n nutritions.fatPerServing.roundedValue,\r\n nutritions.fatPerServing.roundedDailyValue,\r\n nutritions.fatPerServing.exactDailyValue\r\n ),\r\n fat: roundingCheck(nutritions.fatPerServing),\r\n calories: roundingCheck(nutritions.energyPerServing),\r\n servingWeight: nutritions.weightPerServing,\r\n saturatedAndTransDv: dvCheck(\r\n nutritions.saturatedAndTransFatPerServing.roundedValue,\r\n nutritions.saturatedAndTransFatPerServing.roundedDailyValue,\r\n nutritions.saturatedAndTransFatPerServing.exactDailyValue\r\n ),\r\n monounsaturatedFats: roundingCheck(nutritions.monounsaturatedFatPerServing),\r\n polyunsaturatedFats: roundingCheck(nutritions.polyunsaturatedFatPerServing),\r\n omega3: roundingCheck(nutritions.omega3PerServing),\r\n omega6: roundingCheck(nutritions.omega6PerServing),\r\n caffeine: roundingCheck(nutritions.caffeinePerServing),\r\n ash: roundingCheck(nutritions.ashPerServing),\r\n water: roundingCheck(nutritions.waterPerServing),\r\n moisture: roundingCheck(nutritions.moisturePerServing),\r\n servingQuantityInUnitOfMeasurement: nutritions.quantityPerServingInUnitOfMeasurement.item1,\r\n servingUnitOfMeasurement: nutritions.quantityPerServingInUnitOfMeasurement.item2,\r\n volume: nutritions.volume,\r\n weight: nutritions.weight\r\n };\r\n}\r\n\r\nexport function mapNutritionsForDish(nutritions: any): Nutritions {\r\n return {\r\n calories: nutritions.energyPerServing.roundedValue,\r\n fat: nutritions.fatPerServing.roundedValue,\r\n fatDv: nutritions.fatPerServing.roundedDailyValue,\r\n saturatedFat: nutritions.saturatedFatPerServing.roundedValue,\r\n transFat: nutritions.transFatPerServing.roundedValue,\r\n saturatedAndTransDv: nutritions.saturatedAndTransFatPerServing.roundedDailyValue,\r\n cholesterol: nutritions.cholesterolPerServing.roundedValue,\r\n sodium: nutritions.sodiumPerServing.roundedValue,\r\n sodiumDv: nutritions.sodiumPerServing.roundedDailyValue,\r\n carbohydrate: nutritions.carbohydratePerServing.roundedValue,\r\n fibre: nutritions.fibrePerServing.roundedValue,\r\n fibreDv: nutritions.fibrePerServing.roundedDailyValue,\r\n sugars: nutritions.sugarPerServing.roundedValue,\r\n sugarsDv: nutritions.sugarPerServing.roundedDailyValue,\r\n protein: nutritions.proteinPerServing.roundedValue,\r\n vitaminD: nutritions.vitaminDPerServing.roundedValue,\r\n vitaminDDv: nutritions.vitaminDPerServing.roundedDailyValue,\r\n vitaminC: nutritions.vitaminCPerServing.roundedValue,\r\n potassium: nutritions.potassiumPerServing.roundedValue,\r\n potassiumDv: nutritions.potassiumPerServing.roundedDailyValue,\r\n calcium: nutritions.calciumPerServing.roundedValue,\r\n calciumDv: nutritions.calciumPerServing.roundedDailyValue,\r\n iron: nutritions.ironPerServing.roundedValue,\r\n ironDv: nutritions.ironPerServing.roundedDailyValue,\r\n monounsaturatedFats: nutritions.monounsaturatedFatPerServing.roundedValue,\r\n polyunsaturatedFats: nutritions.polyunsaturatedFatPerServing.roundedValue,\r\n omega3: nutritions.omega3PerServing.roundedValue,\r\n omega6: nutritions.omega6PerServing.roundedValue,\r\n caffeine: nutritions.caffeinePerServing.roundedValue,\r\n ash: nutritions.ashPerServing.roundedValue,\r\n water: nutritions.waterPerServing.roundedValue,\r\n moisture: nutritions.moisturePerServing.roundedValue,\r\n servingWeight: nutritions.weightPerServing\r\n }\r\n}","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Ingredients.vue?vue&type=style&index=0&id=765ebd5f&prod&scoped=true&lang=css\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"jumbotron\",attrs:{\"data-pages\":\"parallax\"}},[_c('div',{staticClass:\"container-fluid container-fixed-lg sm-p-l-0 sm-p-r-0 p-t-10\"},[_c('div',{staticClass:\"inner\"},[_c('ol',{staticClass:\"breadcrumb\"},_vm._l((_vm.$route.meta.breadCrumbs),function(crumb){return _c('li',{key:crumb,staticClass:\"breadcrumb-item\",class:{'active': _vm.$route.meta.breadCrumbs.length === _vm.$route.meta.breadCrumbs.indexOf(crumb)+1}},[(_vm.$route.meta.breadCrumbs.length !== _vm.$route.meta.breadCrumbs.indexOf(crumb)+1)?_c('router-link',{attrs:{\"to\":{name: crumb}}},[_vm._v(_vm._s(_vm.translations.get(crumb)))]):[_vm._v(_vm._s(_vm.translations.get(crumb)))]],2)}),0)])])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { Vue, Component, Prop } from \"vue-property-decorator\";\r\nimport UserDetails from \"@/models/User/UserDetails\";\r\nimport { mapState } from 'vuex';\r\n\r\n@Component({\r\n computed: {\r\n ...mapState({\r\n localizationState: (state: any) => state.LocalizationModule,\r\n })\r\n }\r\n})\r\nexport default class vBreadcrumbs extends Vue {\r\n localizationState: any;\r\n\r\n get translations() {\r\n return this.localizationState.translations;\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./vBreadcrumbs.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./vBreadcrumbs.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./vBreadcrumbs.vue?vue&type=template&id=70e14e92&scoped=true\"\nimport script from \"./vBreadcrumbs.vue?vue&type=script&lang=ts\"\nexport * from \"./vBreadcrumbs.vue?vue&type=script&lang=ts\"\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 \"70e14e92\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Ingredients.vue?vue&type=style&index=1&id=765ebd5f&prod&lang=css\"","module.exports = __webpack_public_path__ + \"img/apple-profile.93e9aeab.jpg\";","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"page-content-wrapper\"},[_c('div',{staticClass:\"content\"},[_c('vBreadcrumbs',{attrs:{\"userDetails\":_vm.$store.getters.getUserDetails}}),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-md-12\"},[_c('h2',[_c('img',{staticClass:\"img-thumbnail img-circle\",staticStyle:{\"width\":\"75px\"},attrs:{\"src\":require(\"../../assets/Customer/assets/img/apple-profile.jpg\"),\"alt\":\"Profile picture\"}}),_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr_title\"))+\":\\n \"),_c('small',[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ing_title_combine_yours\"))+\"\\n \"),_c('router-link',{attrs:{\"to\":\"/recipes\"}},[_vm._v(_vm._s(_vm.translations.get(\"recipes\").toLowerCase()))]),_c('span',{staticStyle:{\"font-size\":\"16px\"}},[_vm._v(\" (\"+_vm._s(_vm.translations.get(\"ingr_description\"))+\")\")])],1)])])])]),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"row search-add\"},[_vm._m(0),_c('div',{staticClass:\"col-md-8 col-12\"},[_c('a',{staticClass:\"btn btn-sm btn-primary\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.add.apply(null, arguments)}}},[_c('i',{staticClass:\"fa fa-plus\",attrs:{\"aria-hidden\":\"true\"}}),_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr_add_button\").toUpperCase())+\"\\n \")]),_c('form',{staticClass:\"form-inline pull-right export\"},[_c('div',{staticClass:\"form-group\"},[_c('vSelectFx',{attrs:{\"options\":[\n {\n value: '0',\n content: this.translations.get('ingr_export_to_excel'),\n },\n ]}})],1),_c('a',{staticClass:\"btn down-btn\",attrs:{\"href\":_vm.exportToExcelURL}},[_c('i',{staticClass:\"fa fa-download\",attrs:{\"aria-hidden\":\"true\"}})])])])])]),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"card card-default brown lighten-5\"},[_c('div',{staticClass:\"card-header\"},[_c('h4',{staticClass:\"card-title\"},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr_table_title\"))+\"\\n \")])]),_c('div',{staticClass:\"card-body no-pad-top\"},[_c('vTable',{staticClass:\"table-ingredients\",attrs:{\"tableHeaders\":this.tableHeaders,\"selectErase\":true,\"results\":_vm.transformIngredients,\"total\":_vm.ingredientsState.count,\"totalCount\":_vm.ingredientsState.totalCount,\"pageSize\":_vm.ingredientsState.pageSize,\"editable\":true,\"loading\":_vm.ingredientsState.loading,\"showRecipeIcon\":true},on:{\"changePage\":_vm.changePage,\"onRecipeClick\":_vm.onRecipeClick,\"edit\":_vm.edit,\"remove\":_vm.prepareDeletePrompt,\"order\":_vm.order}})],1)])])],1),_c('vModal',{attrs:{\"show\":_vm.showDeletePrompt,\"modalTitle\":_vm.deletePromptTitle},on:{\"cancelModal\":_vm.resetState}},[_c('form',{staticClass:\"p-t-15\",attrs:{\"role\":\"form\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.confirmDelete.apply(null, arguments)}}},[_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"form-group col-md-6\"},[_c('button',{staticClass:\"btn btn-primary btn-cons m-t-10\",attrs:{\"type\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(this.translations.get(\"yes\"))+\"\\n \")]),_c('button',{staticClass:\"btn btn-cons m-t-10\",attrs:{\"type\":\"reset\"},on:{\"click\":_vm.resetState}},[_vm._v(\"\\n \"+_vm._s(this.translations.get(\"cancel\"))+\"\\n \")])])])])]),_c('vModal',{attrs:{\"modalTitle\":_vm.modalTitle,\"show\":_vm.showModal,\"size\":'l'},on:{\"cancelModal\":_vm.resetState}},[(_vm.showModal)?_c('vIngredientManagement',{attrs:{\"ingredient\":_vm.ingredientsState.ingredient,\"editMode\":_vm.editMode},on:{\"submit\":_vm.submit,\"cancel\":_vm.resetState}}):_vm._e()],1),_c('vModal',{attrs:{\"modalTitle\":_vm.translations.get('ingr_modal_usage'),\"show\":_vm.recipesModal.isOpen,\"size\":'s'},on:{\"cancelModal\":function($event){_vm.recipesModal.isOpen = false}}},[(_vm.recipesModal.recipes.length > 0)?_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-2\"},[_c('img',{staticClass:\"img-thumbnail img-circle\",staticStyle:{\"width\":\"75px\"},attrs:{\"src\":require(\"../../assets/Customer/assets/img/dashboard/my-recipes-book-sm.jpg\"),\"alt\":\"Recipe book thumbnail\"}})]),_c('div',{staticClass:\"col-9\"},[_c('div',{staticClass:\"recipe-modal-subtitle\"},[_c('span',[_vm._v(_vm._s(_vm.translations.get(\"ingr_used_by_recipes\"))+\":\")])]),_vm._l((_vm.recipesModal.recipes),function(recipe){return _c('ul',{key:recipe.id},[_c('li',{staticClass:\"recipe-name\"},[_c('span',{on:{\"click\":function($event){$event.preventDefault();return _vm.$router.push({\n name: 'recipesEdit',\n params: { id: `${recipe.id}` },\n })}}},[_vm._v(_vm._s(recipe.name))])])])})],2)]):_c('div',[_vm._v(\"\\n \"+_vm._s(this.translations.get(\"ingr_not_contained_in_recipe\"))+\"!\\n \")]),_c('div',{staticStyle:{\"float\":\"right\"}},[_c('button',{staticClass:\"btn btn-cons m-t-10\",on:{\"click\":function($event){_vm.recipesModal.isOpen = false}}},[_vm._v(\"\\n \"+_vm._s(this.translations.get(\"cancel\"))+\"\\n \")])])])],1)\n}\nvar staticRenderFns = [function (){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"col-12 col-md-4\"},[_c('form',{attrs:{\"role\":\"form\"}},[_c('div',{staticClass:\"form-group\"},[_c('select',{staticClass:\"full-width select2-hidden-accessible\",attrs:{\"data-placeholder\":\"Search\",\"data-init-plugin\":\"select2\",\"aria-hidden\":\"true\",\"id\":\"select2Ingredients\"}})])])])\n}]\n\nexport { render, staticRenderFns }","\r\nimport { Component, Vue, Prop } from \"vue-property-decorator\";\r\nimport vBreadcrumbs from \"@/components/vBreadcrumbs.vue\";\r\nimport vTable from \"@/components/vTable.vue\";\r\nimport { mapState } from \"vuex\";\r\nimport { TRANSLATIONS_FETCH } from \"@/store/ActionTypes\";\r\nimport ListRequest, { Ordering, Filter, OrderType } from \"@/models/ListRequest\";\r\nimport { createDefaultIngredient, Ingredient } from \"@/models/Ingredient/Ingredient\";\r\nimport RecipesRepository from \"@/utils/API/RecipesRepository\";\r\nimport IngredientsRepository from \"@/utils/API/IngredientsRepository\";\r\nimport { CreateRestaurantIngredient } from \"@/models/Ingredient/CreateRestaurantIngredient\";\r\nimport { UpdateRestaurantIngredient } from \"@/models/Ingredient/UpdateRestaurantIngredient\";\r\n\r\nimport SystemConfigurationRepository from \"../../utils/API/SystemConfigurationRepository\";\r\nimport { NutrientUnit } from \"../../models/Ingredient/NutrientUnit\";\r\nimport { NutrientUnitList } from \"../../models/Ingredient/NutrientUnitList\";\r\nimport { NutrientType } from \"../../models/Ingredient/NutrientType\";\r\nimport { shorten, round, toCamelCase } from \"@/utils/Helpers\";\r\n\r\nimport vModal from \"@/components/vModal.vue\";\r\nimport { Snotify } from \"vue-snotify\";\r\nconst vSelectFx = () => import(\"@/components/vSelectFx.vue\");\r\nconst vIngredientManagement = () =>\r\n import(\"@/components/vIngredientManagement.vue\");\r\n\r\nvar _ = require(\"lodash\");\r\n\r\nexport interface IngredientsState {\r\n count: number;\r\n totalCount: number;\r\n page: number;\r\n pageSize: number;\r\n filters: Filter[];\r\n orders: Ordering;\r\n loading: boolean;\r\n removeList: number[];\r\n\r\n ingredients: Ingredient[];\r\n\r\n ingredient: Ingredient;\r\n\r\n // not in use\r\n additionalNutrients: {\r\n unitHelper: NutrientUnitList | null;\r\n selectedUnit: NutrientUnit | null;\r\n value: number | null;\r\n }[];\r\n\r\n nutrients: NutrientUnitList[];\r\n}\r\n\r\n@Component({\r\n components: {\r\n vBreadcrumbs,\r\n vTable,\r\n vModal,\r\n vSelectFx,\r\n vIngredientManagement,\r\n },\r\n computed: {\r\n ...mapState({\r\n localizationState: (state: any) => state.LocalizationModule,\r\n }),\r\n },\r\n})\r\nclass Ingredients extends Vue {\r\n localizationState: any;\r\n\r\n ingredientsState: IngredientsState = {\r\n count: 0,\r\n totalCount: 0,\r\n page: 1,\r\n pageSize: 25,\r\n filters: [],\r\n orders: { field: \"\", orderType: OrderType.Asc },\r\n loading: true,\r\n removeList: [],\r\n ingredients: [],\r\n ingredient: createDefaultIngredient(),\r\n nutrients: [],\r\n additionalNutrients: [],\r\n };\r\n\r\n // modals\r\n showModal = false;\r\n showDeletePrompt = false;\r\n deletePromptTitle = \"\";\r\n modalTitle = \"\";\r\n\r\n // user input on the search field\r\n searchString = \"\";\r\n\r\n editMode = false;\r\n\r\n // Dynamic table data\r\n tableHeaders: any[] = [];\r\n transformIngredients: any = {};\r\n\r\n // currently not in use as no additional nutrients are implemented\r\n showAll: boolean = false;\r\n recipesModal = {\r\n isOpen: false,\r\n customIngredient: null,\r\n recipes: [],\r\n };\r\n /**\r\n * NYI\r\n */\r\n removeAdditionalNutrient(position: number) {\r\n this.ingredientsState.additionalNutrients.splice(position, 1);\r\n }\r\n\r\n /**\r\n * NYI\r\n */\r\n addAdditionalNutrient() {\r\n this.ingredientsState.additionalNutrients.push({\r\n unitHelper: null,\r\n selectedUnit: null,\r\n value: null,\r\n });\r\n }\r\n\r\n get exportToExcelURL() {\r\n return `${process.env.VUE_APP_BASE_DOMAIN}/api/Processes/Ingredients/ExportIngredients`;\r\n }\r\n\r\n /**\r\n * Prepare the modal for deletion prompt and populate the list of ids for deletion\r\n *\r\n * @param {number[]} ids\r\n */\r\n prepareDeletePrompt(ids: number[]) {\r\n this.ingredientsState.removeList = ids;\r\n this.deletePromptTitle = this.translations.get(\r\n \"ingr_delete_prompt_message\",\r\n ids.length\r\n );\r\n this.showDeletePrompt = true;\r\n }\r\n\r\n /**\r\n * Method invoked after user confirms deletion in modal prompt\r\n */\r\n confirmDelete() {\r\n this.$snotify.async(\r\n this.translations.get(\r\n \"ingr_toastr_deleting\",\r\n this.ingredientsState.removeList.length\r\n ),\r\n () =>\r\n new Promise((resolve, reject) => {\r\n IngredientsRepository.deleteRestaurantIngredients({\r\n ids: this.ingredientsState.removeList,\r\n })\r\n .then((response) => {\r\n resolve({\r\n body: this.translations.get(\r\n \"ingr_toastr_deleted\",\r\n this.ingredientsState.removeList.length\r\n ),\r\n });\r\n\r\n this.ingredientsState.page = 1;\r\n\r\n this.requestIngredients(\r\n new ListRequest({\r\n page: this.ingredientsState.page,\r\n pageSize: this.ingredientsState.pageSize,\r\n filters: this.ingredientsState.filters,\r\n orders: [this.ingredientsState.orders],\r\n })\r\n );\r\n\r\n this.ingredientsState.removeList = [];\r\n })\r\n .catch((error) => {\r\n let message = \"\";\r\n if (error.response) {\r\n message =\r\n error.response.data.errorMessages[0].userVisibleMessage;\r\n } else {\r\n message = this.translations.get(\"network_error\");\r\n }\r\n reject({ body: message });\r\n });\r\n }),\r\n {\r\n timeout: 3000,\r\n closeOnClick: true,\r\n }\r\n );\r\n this.resetState();\r\n }\r\n\r\n /**\r\n * Used by vTable after @change event is caught\r\n */\r\n changePage(args: any) {\r\n const orderings: Ordering[] = [];\r\n orderings.push({ ...args[3] });\r\n\r\n this.requestIngredients(\r\n new ListRequest({\r\n page: args[0],\r\n pageSize: this.ingredientsState.pageSize,\r\n filters: this.ingredientsState.filters,\r\n orders: orderings,\r\n })\r\n );\r\n this.ingredientsState.page = args[0];\r\n this.ingredientsState.orders = { ...args[3] };\r\n }\r\n\r\n order(filters: Filter[], ordering: Ordering) {\r\n const orderings: Ordering[] = [];\r\n orderings.push({ ...ordering });\r\n\r\n this.requestIngredients(\r\n new ListRequest({\r\n page: this.ingredientsState.page,\r\n pageSize: this.ingredientsState.pageSize,\r\n filters: this.ingredientsState.filters,\r\n orders: orderings,\r\n })\r\n );\r\n\r\n this.ingredientsState.orders = { ...ordering };\r\n }\r\n\r\n /**\r\n * NYI\r\n */\r\n showAllNutrients(flag: boolean) {\r\n this.showAll = flag;\r\n //this.populateTable();\r\n }\r\n\r\n /**\r\n * Method for dynamically populating the vTable grid based on the headers from API\r\n */\r\n populateTable(nutrientHeaders: any) {\r\n // Format the table headers and table data to put vitamin c next to vitamin d\r\n this.formatTableHeadersForVitaminC(nutrientHeaders);\r\n this.formatTableDataForVitaminC(this.ingredientsState.ingredients);\r\n\r\n // for each ingredient generate vTable friendly data\r\n this.transformIngredients = this.ingredientsState.ingredients.map(\r\n (element: Ingredient, index: number) => {\r\n let all: any = {};\r\n // we start from 2 to n+2 because Serving is static field on the table, not part of the nutrient list\r\n for (let i = 2; i < element.nutrients.length + 2; i++) {\r\n // NYI part - go to else\r\n if (this.showAll) {\r\n all[`e${i}`] = element.nutrients[i - 2]\r\n ? round(\r\n element.nutrients[i - 2].value *\r\n element.nutrients[i - 2].nutrientUnit.conversionCoeficient,\r\n 2\r\n )\r\n : 0;\r\n } else {\r\n // filter nutrients with type Other\r\n if (\r\n element.nutrients[i - 2].nutrientUnit.nutrient.nutrientType !==\r\n NutrientType.Other\r\n ) {\r\n // starting from position 2 we get the nutrient on position n-2,\r\n all[`e${i}`] = element.nutrients[i - 2]\r\n ? round(\r\n element.nutrients[i - 2].value *\r\n element.nutrients[i - 2].nutrientUnit\r\n .conversionCoeficient,\r\n 2\r\n )\r\n : 0;\r\n }\r\n }\r\n }\r\n // vTable friendly data\r\n return {\r\n // spread the dynamically generated list\r\n ...all,\r\n // the static part\r\n e1: parseFloat(\r\n (Math.round(element.weightInGrams * 100) / 100).toFixed(2)\r\n ),\r\n meta: {\r\n id: element.id,\r\n link: element.name,\r\n },\r\n };\r\n }\r\n );\r\n\r\n // Grid will queue refresh @ this point\r\n\r\n // reset headers\r\n this.tableHeaders.length = 0;\r\n\r\n let all: any = [];\r\n\r\n // static\r\n let name: any = {\r\n name: this.translations.get(\"ingr_table_name\"),\r\n key: \"Name\",\r\n searchable: true,\r\n searchString: \"\",\r\n sortable: true,\r\n };\r\n // static\r\n let serving: any = {\r\n name: this.translations.get(\"ingr_table_serving\"),\r\n key: \"WeightInGrams\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true,\r\n };\r\n\r\n nutrientHeaders.map((header: any) => {\r\n // NYI skip to else\r\n if (this.showAll) {\r\n all.push({\r\n name: shorten(header.name) + ` (${header.units[0].unit.name})`,\r\n key: toCamelCase(header.name),\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n });\r\n } else {\r\n // all non Other nutrients\r\n if (header.nutrientType !== NutrientType.Other) {\r\n all.push({\r\n name: shorten(header.name) + ` (${header.units[0].unit.name})`,\r\n key: toCamelCase(header.name),\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true,\r\n });\r\n }\r\n }\r\n });\r\n\r\n // vTable friendly data\r\n this.tableHeaders = [name, serving, ...all];\r\n\r\n // Grid will queue refresh @ this point\r\n }\r\n\r\n /**\r\n * Centralized place to request ingredients\r\n *\r\n * @param {ListRequest} listRequest\r\n */\r\n requestIngredients(listRequest: ListRequest) {\r\n this.ingredientsState.loading = true;\r\n\r\n IngredientsRepository.listRestaurantIngredients(listRequest)\r\n .then((response) => {\r\n this.ingredientsState.count = response.data.result.ingredients.count;\r\n this.ingredientsState.totalCount =\r\n response.data.result.ingredients.totalCount;\r\n this.ingredientsState.ingredients =\r\n response.data.result.ingredients.result;\r\n this.ingredientsState.loading = false;\r\n\r\n this.populateTable(response.data.result.nutrientHeaders);\r\n })\r\n .catch((error) => {\r\n if (error.response) {\r\n this.$snotify.error(\r\n error.response.data.errorMessages[0].userVisibleMessage\r\n );\r\n } else this.$snotify.error(this.translations.get(\"network-error\"));\r\n });\r\n }\r\n /**\r\n * Format the headers to set the position of vitamin c next to vitamin d\r\n */\r\n formatTableHeadersForVitaminC(headers: any) {\r\n const indexC = headers.findIndex(\r\n (x: any) => x.nutrientType === NutrientType.VitaminC\r\n );\r\n const indexD = headers.findIndex(\r\n (x: any) => x.nutrientType === NutrientType.VitaminD\r\n );\r\n\r\n if (indexC != -1 && indexD != -1) {\r\n this.arraymove(headers, indexC, indexD + 1);\r\n }\r\n }\r\n /**\r\n * Format the headers to set the position of vitamin c next to vitamin d\r\n */\r\n formatTableDataForVitaminC(tableData: any) {\r\n for (const element of tableData) {\r\n const indexC = element.nutrients.findIndex(\r\n (x: any) =>\r\n x.nutrientUnit.nutrient.nutrientType === NutrientType.VitaminC\r\n );\r\n const indexD = element.nutrients.findIndex(\r\n (x: any) =>\r\n x.nutrientUnit.nutrient.nutrientType === NutrientType.VitaminD\r\n );\r\n if (indexC != -1 && indexD != -1) {\r\n this.arraymove(element.nutrients, indexC, indexD + 1);\r\n }\r\n }\r\n }\r\n /**\r\n * Move element in array from one position to another\r\n */\r\n arraymove(arr: any, fromIndex: number, toIndex: number) {\r\n const element = arr[fromIndex];\r\n arr.splice(fromIndex, 1);\r\n arr.splice(toIndex, 0, element);\r\n }\r\n /**\r\n * Hides all modals and resets variables\r\n */\r\n resetState() {\r\n this.showModal = false;\r\n this.showDeletePrompt = false;\r\n this.editMode = false;\r\n (this.ingredientsState.ingredient = {\r\n id: 0,\r\n name: \"\",\r\n brand: \"\",\r\n components: \"\",\r\n energy: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n fat: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n saturatedFattyAcids: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n transFattyAcids: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n cholesterol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n sodium: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n carbohydrate: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n fibre: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n sugars: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n protein: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n vitaminD: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n vitaminC: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n potassium: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n calcium: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n iron: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n addedSugars: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n sugarAlcohols: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n monounsaturatedFats: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n polyunsaturatedFats: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n omega3: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n omega6: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n caffeine: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n ash: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n water: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n moisture: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0\r\n },\r\n erythritol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n isomalt: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n mannitol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n xylitol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n lactitol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n sorbitol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n maltitol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n unspecifiedSugarAlcohol: {\r\n id: 0,\r\n value: 0,\r\n nutrientUnitId: 0,\r\n nutrientUnit: null,\r\n ingredientId: 0,\r\n },\r\n allMeasurements: [],\r\n additionalNutrients: [],\r\n weightInGrams: 100,\r\n unitOfMeasurement: 1,\r\n quantityInUnitOfMeasurement: 100,\r\n hasVolumeUnitOfMeasurement: false,\r\n categoryDensityId: null,\r\n nutrients: [],\r\n subIngredients: \"\",\r\n }),\r\n (this.ingredientsState.additionalNutrients.length = 0);\r\n }\r\n\r\n /**\r\n * Prepare edit mode\r\n */\r\n edit(id: number) {\r\n let ingr = _.cloneDeep(\r\n this.ingredientsState.ingredients.find((i) => i.id === id)\r\n );\r\n if (ingr) {\r\n this.ingredientsState.ingredient = { ...ingr };\r\n\r\n // we have to make another copy because of shallow cloning\r\n this.ingredientsState.ingredient.allMeasurements = [\r\n ...ingr.allMeasurements,\r\n ];\r\n // Round measurement weight in gram to two decimals\r\n this.ingredientsState.ingredient.allMeasurements.map((measurement) => {\r\n measurement.weightInGrams = parseFloat(\r\n (Math.round(measurement.weightInGrams * 100) / 100).toFixed(2)\r\n );\r\n });\r\n\r\n // this.ingredientsState.ingredient.additionalNutrients.map(nutrient => {\r\n // let unitHelper = this.ingredientsState.nutrients.find(n =>\r\n // nutrient.nutrientUnit\r\n // ? n.id === nutrient.nutrientUnit.nutrientId\r\n // : false\r\n // );\r\n // if (unitHelper) {\r\n // let selectedUnit = unitHelper.units\r\n // ? unitHelper.units.find(u => u.id === nutrient.nutrientUnitId)\r\n // : null;\r\n // if (selectedUnit)\r\n // this.ingredientsState.additionalNutrients.push({\r\n // unitHelper: unitHelper,\r\n // value: nutrient.value ? nutrient.value : 0,\r\n // selectedUnit: selectedUnit\r\n // });\r\n // }\r\n // });\r\n }\r\n this.showModal = true;\r\n this.editMode = true;\r\n this.modalTitle = this.translations.get(\"ingr_modal_edit_title\");\r\n }\r\n\r\n /**\r\n * Prepare add mode\r\n */\r\n add() {\r\n this.showModal = true;\r\n this.modalTitle = this.translations.get(\"ingr_modal_add_title\");\r\n }\r\n\r\n /**\r\n * Router method, see submitEdit() and submitNew()\r\n */\r\n submit(\r\n ingredient: Ingredient,\r\n nutrients: {\r\n value: number;\r\n nutrientUnitId: number;\r\n }[]\r\n ) {\r\n if (this.editMode) {\r\n this.submitEdit(nutrients);\r\n } else {\r\n this.submitNew(nutrients);\r\n }\r\n }\r\n\r\n submitEdit(\r\n nutrients: {\r\n value: number;\r\n nutrientUnitId: number;\r\n }[]\r\n ) {\r\n // update ingredien model\r\n let updateIngredient: UpdateRestaurantIngredient = {\r\n measurements: this.ingredientsState.ingredient.allMeasurements,\r\n id: this.ingredientsState.ingredient.id,\r\n name: this.ingredientsState.ingredient.name,\r\n weightInGrams: this.ingredientsState.ingredient.weightInGrams,\r\n unitOfMeasurement: this.ingredientsState.ingredient.unitOfMeasurement,\r\n categoryDensityId: this.ingredientsState.ingredient.categoryDensityId,\r\n quantityInUnitOfMeasurement:\r\n this.ingredientsState.ingredient.quantityInUnitOfMeasurement,\r\n // the model from above\r\n nutrients: nutrients,\r\n subIngredients: this.ingredientsState.ingredient.subIngredients,\r\n };\r\n\r\n // actual submit of the model\r\n this.$snotify.async(\r\n this.translations.get(\"ingr_toastr_updating\"),\r\n () =>\r\n new Promise((resolve, reject) => {\r\n IngredientsRepository.updateRestaurantIngredient(updateIngredient)\r\n .then((response) => {\r\n resolve({\r\n body: this.translations.get(\r\n \"ingr_toastr_updated\",\r\n updateIngredient.name\r\n ),\r\n });\r\n\r\n this.requestIngredients(\r\n new ListRequest({\r\n page: this.ingredientsState.page,\r\n pageSize: this.ingredientsState.pageSize,\r\n filters: this.ingredientsState.filters,\r\n orders: [this.ingredientsState.orders],\r\n })\r\n );\r\n\r\n this.resetState();\r\n })\r\n .catch((error) => {\r\n let message = \"\";\r\n this.edit(this.ingredientsState.ingredient.id);\r\n if (error.response) {\r\n message =\r\n error.response.data.errorMessages[0].userVisibleMessage;\r\n } else {\r\n message = this.translations.get(\"network_error\");\r\n }\r\n reject({ body: message });\r\n });\r\n }),\r\n {\r\n timeout: 3000,\r\n closeOnClick: true,\r\n }\r\n );\r\n }\r\n\r\n submitNew(\r\n nutrients: {\r\n value: number;\r\n nutrientUnitId: number;\r\n }[]\r\n ) {\r\n // ingredient creation model\r\n let newIngredient: CreateRestaurantIngredient = {\r\n name: this.ingredientsState.ingredient.name,\r\n weightInGrams: this.ingredientsState.ingredient.weightInGrams,\r\n measurements: this.ingredientsState.ingredient.allMeasurements,\r\n unitOfMeasurement: this.ingredientsState.ingredient.unitOfMeasurement,\r\n categoryDensityId: this.ingredientsState.ingredient.categoryDensityId,\r\n quantityInUnitOfMeasurement:\r\n this.ingredientsState.ingredient.quantityInUnitOfMeasurement,\r\n // the model from above\r\n nutrients: nutrients,\r\n subIngredients: this.ingredientsState.ingredient.subIngredients,\r\n };\r\n\r\n // the request\r\n this.$snotify.async(\r\n this.translations.get(\"ingr_toastr_adding\"),\r\n () =>\r\n new Promise((resolve, reject) => {\r\n IngredientsRepository.createRestaurantIngredient(newIngredient)\r\n .then((response) => {\r\n resolve({\r\n body: this.translations.get(\r\n \"ingr_toastr_added\",\r\n newIngredient.name\r\n ),\r\n });\r\n\r\n this.requestIngredients(\r\n new ListRequest({\r\n page: this.ingredientsState.page,\r\n pageSize: this.ingredientsState.pageSize,\r\n filters: this.ingredientsState.filters,\r\n orders: [this.ingredientsState.orders],\r\n })\r\n );\r\n\r\n this.resetState();\r\n })\r\n .catch((error) => {\r\n let message = \"\";\r\n if (error.response) {\r\n message =\r\n error.response.data.errorMessages[0].userVisibleMessage;\r\n } else {\r\n message = this.translations.get(\"network_error\");\r\n }\r\n reject({ body: message });\r\n });\r\n }),\r\n {\r\n timeout: 3000,\r\n closeOnClick: true,\r\n }\r\n );\r\n }\r\n //Get all recipes that are using chosen custom ingredient\r\n getAllRecipesThatUseIngredient() {\r\n RecipesRepository.listRecipesThatUseIngredient(\r\n this.recipesModal.customIngredient\r\n )\r\n .then((response) => {\r\n this.recipesModal.recipes = response.data.result;\r\n })\r\n .catch((error) => {\r\n if (error.response) {\r\n this.$snotify.error(\r\n error.response.data.errorMessages[0].userVisibleMessage\r\n );\r\n } else this.$snotify.error(this.translations.get(\"network-error\"));\r\n });\r\n }\r\n onRecipeClick(id: number) {\r\n this.recipesModal.customIngredient = id;\r\n this.recipesModal.isOpen = true;\r\n this.getAllRecipesThatUseIngredient();\r\n }\r\n get translations() {\r\n return this.localizationState.translations;\r\n }\r\n\r\n created() {\r\n this.$store\r\n .dispatch(TRANSLATIONS_FETCH, {\r\n category: \"pages\",\r\n collections: [\"common\", \"ingredients\"],\r\n })\r\n .then(() => {\r\n document.title =\r\n this.translations.get(\"ingr_title\") +\r\n \" \" +\r\n this.translations.get(\"meta_title_postfix\");\r\n })\r\n .catch((error) => {\r\n if (error.response) {\r\n this.$snotify.error(\r\n error.response.data.errorMessages[0].userVisibleMessage\r\n );\r\n } else this.$snotify.error(this.translations.get(\"network-error\"));\r\n });\r\n\r\n this.requestIngredients(\r\n new ListRequest({ page: 1, pageSize: this.ingredientsState.pageSize })\r\n );\r\n\r\n // initial table headers before dynamic population\r\n this.tableHeaders = [\r\n {\r\n name: this.translations.get(\"ingr_table_name\"),\r\n key: \"Name\",\r\n searchable: true,\r\n searchString: \"\",\r\n sortable: true,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_ene\"),\r\n key: \"Energy\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_fat\") + \" (g)\",\r\n key: \"Fat\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_sat\") + \" (g)\",\r\n key: \"SaturatedFattyAcids\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_trans\") + \" (g)\",\r\n key: \"TransFattyAcids\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_chol\") + \" (g)\",\r\n key: \"Cholesterol\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_sod\") + \" (mg)\",\r\n key: \"Sodium\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_carb\") + \" (g)\",\r\n key: \"Carbohydrate\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_fib\") + \" (g)\",\r\n key: \"Fibre\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_sug\") + \" (g)\",\r\n key: \"Sugars\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_prot\") + \" (g)\",\r\n key: \"Protein\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_vitD\") + \" (mcg)\",\r\n key: \"VitaminD\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_vitc\") + \" (mg)\",\r\n key: \"VitaminC\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_pot\") + \" (mg)\",\r\n key: \"Potassium\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_calc\") + \" (mg)\",\r\n key: \"Calcium\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n {\r\n name: this.translations.get(\"ingr_table_iron\") + \" (mg)\",\r\n key: \"Iron\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: false,\r\n },\r\n ];\r\n }\r\n mounted() {\r\n (window).$.Pages.init();\r\n\r\n ($(\"#select2Ingredients\"))\r\n .select2({\r\n allowClear: false,\r\n width: \"100%\",\r\n ajax: {\r\n delay: 500,\r\n transport: (params: any, success: any, failure: any) => {\r\n IngredientsRepository.listRestaurantIngredients(\r\n new ListRequest({\r\n page: this.ingredientsState.page,\r\n pageSize: this.ingredientsState.pageSize,\r\n filters: [\r\n {\r\n name: \"Name\",\r\n value: params.data.term ? params.data.term : \"\",\r\n },\r\n ],\r\n orders: [this.ingredientsState.orders],\r\n })\r\n ).then((response) => {\r\n success(response);\r\n });\r\n },\r\n processResults: (response: any, page: any) => {\r\n let data: any[] = [];\r\n data.push({ id: 0, text: \"All Custom Ingredients\" });\r\n response.data.result.ingredients.result.map((r: any) => {\r\n data.push({ id: r.id, text: r.name });\r\n });\r\n\r\n return { results: data };\r\n },\r\n },\r\n })\r\n .on(\"select2:select\", (eventData: any) => {\r\n this.ingredientsState.page = 1;\r\n this.ingredientsState.orders = { field: \"\", orderType: OrderType.Asc };\r\n\r\n if (eventData.target.value == 0) {\r\n this.ingredientsState.filters.length = 0;\r\n } else {\r\n this.ingredientsState.filters = [\r\n { name: \"Id\", value: eventData.target.value },\r\n ];\r\n }\r\n\r\n IngredientsRepository.listRestaurantIngredients(\r\n new ListRequest({\r\n page: this.ingredientsState.page,\r\n pageSize: this.ingredientsState.pageSize,\r\n filters: this.ingredientsState.filters,\r\n orders: [this.ingredientsState.orders],\r\n })\r\n ).then((response) => {\r\n this.ingredientsState.ingredients =\r\n response.data.result.ingredients.result;\r\n this.ingredientsState.count = response.data.result.ingredients.count;\r\n this.ingredientsState.totalCount =\r\n response.data.result.ingredients.totalCount;\r\n this.ingredientsState.loading = false;\r\n\r\n // populate when select is performed\r\n this.populateTable(response.data.result.nutrientHeaders);\r\n });\r\n });\r\n }\r\n}\r\nexport default Ingredients;\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Ingredients.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Ingredients.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./Ingredients.vue?vue&type=template&id=765ebd5f&scoped=true\"\nimport script from \"./Ingredients.vue?vue&type=script&lang=ts\"\nexport * from \"./Ingredients.vue?vue&type=script&lang=ts\"\nimport style0 from \"./Ingredients.vue?vue&type=style&index=0&id=765ebd5f&prod&scoped=true&lang=css\"\nimport style1 from \"./Ingredients.vue?vue&type=style&index=1&id=765ebd5f&prod&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 \"765ebd5f\",\n null\n \n)\n\nexport default component.exports","import Repository from './Repository';\r\nimport { CreateRecipeCategory } from '@/models/Recipes/CreateRecipeCategory';\r\nimport { DeleteRecipeCategory } from '@/models/Recipes/DeleteRecipeCategory';\r\nimport ListRequest from '@/models/ListRequest';\r\nimport { CreateRecipe } from '@/models/Recipes/CreateRecipe';\r\nimport { UpdateRecipe } from '@/models/Recipes/UpdateRecipe';\r\nimport { SearchSubRecipes } from '@/models/Recipes/SearchSubRecipes';\r\nimport { SearchRecipes } from '@/models/Recipes/SearchRecipes';\r\nimport { UpdateRecipeCategory } from '@/models/Recipes/UpdateRecipeCategory';\r\nimport { RecipeCalculate } from '@/models/Recipes/RecipeCalculate';\r\n\r\n\r\nconst resource = '/recipes';\r\n\r\nexport default {\r\n createRecipeCategory(createRecipeCategory: CreateRecipeCategory) {\r\n return Repository.post(`${resource}/CreateRecipeCategory`, createRecipeCategory, { withCredentials: true });\r\n },\r\n listRecipeCategories() {\r\n return Repository.get(`${resource}/ListRecipeCategories`, { withCredentials: true });\r\n },\r\n deleteRecipeCategory(deleteRecipeCategory: DeleteRecipeCategory) {\r\n return Repository.post(`${resource}/DeleteRecipeCategory`, deleteRecipeCategory, { withCredentials: true });\r\n },\r\n listRecipes(listRequest: ListRequest) {\r\n return Repository.post(`${resource}/ListRecipes`, listRequest, { withCredentials: true });\r\n },\r\n getRecipeDetails(id: number) {\r\n return Repository.post(`${resource}/GetRecipeDetails`, { recipeId: id }, { withCredentials: true });\r\n },\r\n createRecipe(createRecipe: CreateRecipe) {\r\n return Repository.post(`${resource}/CreateRecipe`, createRecipe, { withCredentials: true });\r\n },\r\n deleteRecipe(id: number) {\r\n return Repository.post(`${resource}/DeleteRecipe`, { recipeId: id }, { withCredentials: true });\r\n },\r\n udateRecipe(updateRecipe: UpdateRecipe) {\r\n return Repository.post(`${resource}/UpdateRecipe`, updateRecipe, { withCredentials: true });\r\n },\r\n searchSubRecipes(searchSubRecipes: SearchSubRecipes) {\r\n return Repository.post(`${resource}/SearchSubRecipes`, searchSubRecipes, { withCredentials: true });\r\n },\r\n searchRecipes(searchRecipes: SearchRecipes) {\r\n return Repository.post(`${resource}/SearchRecipes`, searchRecipes, { withCredentials: true });\r\n },\r\n // deleteRecipes(recipeIds: number[]) {\r\n // return Repository.post(`${resource}/DeleteRecipes`, { recipeIds }, { withCredentials: true });\r\n // },\r\n renameCategory(updateCategory: any) {\r\n return Repository.post(`${resource}/RenameRecipeCategory`, updateCategory, { withCredentials: true });\r\n },\r\n moveRecipesToCategory(moveRecipesToCategory: any) {\r\n return Repository.post(`${resource}/MoveRecipesToRecipeCategory`, moveRecipesToCategory, { withCredentials: true });\r\n },\r\n filterRecipesNames(recipesSearchTerm: any) {\r\n return Repository.post(`${resource}/filterRecipesNames`, { recipeSearchTerm: recipesSearchTerm }, { withCredentials: true });\r\n },\r\n calculate(recCalc: RecipeCalculate) {\r\n return Repository.post(`${resource}/CalculateRecipeNutritions`, recCalc, { withCredentials: true });\r\n },\r\n copyRecipe(data: any) {\r\n return Repository.post(`${resource}/CopyRecipe`, data, { withCredentials: true });\r\n },\r\n saveRecipeLabel(data: any) {\r\n return Repository.post(`${resource}/SaveRecipeLabel`, data, { withCredentials: true });\r\n },\r\n getRecipeLabel(data: any) {\r\n return Repository.post(`${resource}/GetRecipeLabel`, data, { withCredentials: true });\r\n },\r\n deleteRecipes(data: any) {\r\n return Repository.post(`${resource}/DeleteRecipes`, data, { withCredentials: true });\r\n },\r\n listRestaurantRecipesAsLookups(restaurantId: number) {\r\n return Repository.get(`${resource}/ListRestaurantRecipesAsLookups?restaurantId=${restaurantId}`, { withCredentials: true });\r\n },\r\n listCookingMethods() {\r\n return Repository.get(`${resource}/ListCookingMethods`, { withCredentials: true });\r\n },\r\n listFoodGroupClasses() {\r\n return Repository.get(`${resource}/ListFoodGroupClasses`, { withCredentials: true });\r\n },\r\n listFoodGroupSubClasses(data: any) {\r\n return Repository.post(`${resource}/ListFoodGroupSubClasses`, data, { withCredentials: true });\r\n },\r\n updateRecipeFoodClassifications(data: any) {\r\n return Repository.post(`${resource}/UpdateRecipeFoodClassifications`, data, { withCredentials: true });\r\n },\r\n updateRecipeServingSize(data: any) {\r\n return Repository.post(`${resource}/UpdateRecipeServingSize`, data, { withCredentials: true });\r\n },\r\n updateCaloriesCalculationMethod(data: any) {\r\n return Repository.post(`${resource}/UpdateCalculationMethods`, data, { withCredentials: true });\r\n },\r\n hasRecipeWithIngredientsFromSpecificDatabase(nutrientSource: any) {\r\n return Repository.post(`${resource}/HasRecipeWithIngredientsFromSpecificDatabase`, { nutrientSource: nutrientSource }, { withCredentials: true })\r\n },\r\n listRecipesThatUseIngredient(ingredientId: number) {\r\n return Repository.get(`${resource}/ListRecipesThatUseIngredient?IngredientId=${ingredientId}`, { withCredentials: true });\r\n },\r\n};\r\n"],"sourceRoot":""}