{"version":3,"sources":["webpack:///./src/components/vModal.vue?f088","webpack:///./src/models/Recipes/Nutritions.ts","webpack:///./src/utils/Helpers.ts","webpack:///./src/models/Ingredient/NutrientType.ts","webpack:///./src/models/NutritionLabels/LabelTypeMetadata.ts","webpack:///./src/utils/API/IngredientsRepository.ts","webpack:///./src/models/Recipes/DailyValueCalculationMethod.ts","webpack:///./src/components/vModal.vue","webpack:///./src/components/vModal.vue?9dbe","webpack:///./src/components/vModal.vue?4636","webpack:///./src/components/vModal.vue?1836"],"names":["Nutritions","totalNutrientsPerServing","servingUnitOfMeasurement","weight","weightPerServing","rawWeight","rawWeightPerServing","volume","rawVolume","volumePerServing","rawVolumePerServing","quantityPerServingInUnitOfMeasurement","arguments","length","undefined","displayServingQuantityAndMeasure","servingQuantityInUnitOfMeasurementOverride","servingUnitOfMeasurementOverride","labelType","LabelTypeMetadata","BackOfPack","additionalLabelInformation","_classCallCheck","_defineProperty","this","_createClass","key","value","_len","nutrientNames","Array","_key","nameKey","map","x","NutrientType","join","find","nutrient","nutrientName","nutrientInfo","getNutrientInfo","apply","roundedValue","roundedDailyValue","exactValue","exactDailyValue","debounce","callback","time","intervalId","localStorage","getItem","clearTimeout","setTimeout","setItem","getBoldString","mainString","subString","concat","index","toLowerCase","indexOf","startIndex","substring","endIndex","highlightedString","round","number","decimalPlaces","Math","pow","shorten","text","newText","replace","parts","split","part","substr","desanitizeString","html","txt","document","createElement","innerHTML","getErrorMessage","error","translations","response","data","errorMessages","userVisibleMessage","get","dVCheck","roundedDv","exactDv","dailyValueCalculationMethod","roundingCheck","DailyValueCalculationMethod","Unrounded","Number","isInteger","toFixed","Rounded","mapNutritions","nutritions","nutrientType","originalNutrientAnalysis","item1","item2","groupBy","items","reduce","acc","item","group","values","push","set","Map","resource","listIngredientSearch","listRequest","Repository","post","withCredentials","listRestaurantIngredients","createRestaurantIngredient","updateRestaurantIngredient","deleteRestaurantIngredients","searchIngredients","searchIngredientsByFoodCode","getIngredientDetails","ingredientId","getAutoCorrectSerchTerm","searchTerms","SearchTerms","createIngredientSearchFailure","failure","listIngredientSearchFailures","searchCategoryDensities","searchTerm","categoryDensityId","render","_vm","_c","_self","_setupProxy","attrs","show","staticClass","modalId","class","size","_v","_s","modalTitle","on","cancelModal","_t","_e","staticRenderFns","vModal","_Vue","_this","args","_callSuper","_inherits","htmlBodyElement","getElementsByTagName","classList","add","$emit","remove","_this2","addEventListener","e","keyCode","Vue","__decorate","Prop","Watch","Component","component"],"mappings":"kHAAA,W,knCCKO,IAAMA,EAAU,WA4HrB,SAAAA,EACEC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAY2D,IAX3DC,EAAAC,UAAAC,OAAA,SAAAC,IAAAF,UAAA,IAAAA,UAAA,IAGI,KACJG,EAAAH,UAAAC,OAAA,SAAAC,IAAAF,UAAA,IAAAA,UAAA,IAGI,KACJI,EAAAJ,UAAAC,OAAA,SAAAC,IAAAF,UAAA,IAAAA,UAAA,IAAqD,KACrDK,EAAAL,UAAAC,OAAA,SAAAC,IAAAF,UAAA,IAAAA,UAAA,IAA2C,KAC3CM,EAAAN,UAAAC,OAAA,SAAAC,IAAAF,UAAA,IAAAA,UAAA,IAA8DO,OAAkBC,WAChFC,EAAAT,UAAAC,OAAA,SAAAC,IAAAF,UAAA,IAAAA,UAAA,IAAyD,GAAEU,EAAA,KAAAtB,GAjJ7DuB,EAAA,sCACyC,GA4FzCA,EAAA,gCAE4E,IAAEA,EAAA,gCAC3C,KAAGA,EAAA,cAErB,GAACA,EAAA,wBACS,GAACA,EAAA,iBACR,GAACA,EAAA,2BACS,GAACA,EAAA,sBAAAA,EAAA,yBAAAA,EAAA,gCAAAA,EAAA,mCAAAA,EAAA,qDAAAA,EAAA,gDAAAA,EAAA,0DAAAA,EAAA,gDAAAA,EAAA,yBAAAA,EAAA,0CA8C7BC,KAAKvB,yBAA2BA,EAChCuB,KAAKtB,yBAA2BA,EAChCsB,KAAKrB,OAASA,EACdqB,KAA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AAA6I,GAAA,QAAAvI,EAAAhB,UAAAC,OAAAyJ,EAAA,IAAAxI,MAAAF,GAAAG,EAAA,EAAAA,EAAAH,EAAAG,IAAAuI,EAAAvI,GAAAnB,UAAAmB,GAAA,OAAAsI,EAAAE,EAAA,KAAAJ,EAAA,GAAAxG,OAAA2G,IAAA/I,EAAA8I,EAAA,eAAA9I,EAAA8I,EAAA,qBAAA9I,EAAA8I,EAAA,eAAA9I,EAAA8I,EAAA,kBAAAA,EAAA,OAAAG,EAAAL,EAAAC,GAAA3I,EAAA0I,EAAA,EAAAzI,IAAA,YAAAC,MAOzB,WACE,IAAI8I,EAAkBtF,SAASuF,qBAAqB,QAAQ,GACxDlJ,KAAK8H,MACPmB,EAAgBE,UAAUC,IAAI,aAC9BpJ,KAAKqJ,MAAM,cAIXJ,EAAgBE,UAAUG,OAAO,eAEpC,CAAApJ,IAAA,YAAAC,MAED,WACEH,KAAKqJ,MAAM,eACZ,CAAAnJ,IAAA,cAAAC,MAED,WACEH,KAAKqJ,MAAM,iBACZ,CAAAnJ,IAAA,UAAAC,MAED,WAAO,IAAAoJ,EAAA,KACL5F,SAAS6F,iBAAiB,WAAW,SAACC,GAChCF,EAAKzB,MAAqB,IAAb2B,EAAEC,SACjBH,EAAKhB,qBA9Bc,CAASoB,QAC1BC,eAAA,CAAPC,kB,2BACOD,eAAA,CAAPC,kB,iCACOD,eAAA,CAAPC,kB,2BACOD,eAAA,CAAPC,kB,8BAGDD,eAAA,CADCE,eAAM,S,8BANYnB,EAAMiB,eAAA,CAD1BG,QACoBpB,WCJ2W,I,wBCQ5XqB,EAAY,eACd,EACAxC,EACAkB,GACA,EACA,KACA,WACA,MAIa,OAAAsB,E","file":"js/chunk-5195146b.eb322616.js","sourcesContent":["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!./vModal.vue?vue&type=style&index=0&id=88baf142&prod&scoped=true&lang=css\"","import { LabelTypeMetadata } from \"../NutritionLabels/LabelTypeMetadata\";\r\nimport { NutrientType } from \"../Ingredient/NutrientType\";\r\nimport {NutrientAnalysis} from \"@/models/Nutrient/NutrientAnalysis\";\r\nimport {AdditionalLabelInformation} from \"@/models/NutritionLabels/AdditionalLabelInformation\";\r\n\r\nexport class Nutritions {\r\n // addedSugarPerServing: number = 0;\r\n unadjustedAddedSugarPerServing: number = 0;\r\n // sugarAlcohols: number = 0;\r\n // alcoholSugarDv: number = 0;\r\n // ironDv: number = 0;\r\n // iron: number = 0;\r\n // calciumDv: number = 0;\r\n // calcium: number = 0;\r\n // potassiumDv: number = 0;\r\n // potassium: number = 0;\r\n // vitaminDDv: number = 0;\r\n // vitaminD: number = 0;\r\n // vitaminC: number = 0;\r\n // sodiumDv: number = 0;\r\n // sodium: number = 0;\r\n // cholesterol: number = 0;\r\n // cholesterolDv: number = 0;\r\n // protein: number = 0;\r\n // sugarsDv: number = 0;\r\n // sugars: number = 0;\r\n // fibreDv: number = 0;\r\n // fibre: number = 0;\r\n // carbohydrate: number = 0;\r\n // carbohydrateDv: number = 0;\r\n // transFatDv: number = 0;\r\n // transFat : number = 0;\r\n // saturatedFatDv: number = 0;\r\n // saturatedFat: number = 0;\r\n // fatDv: number = 0;\r\n // fat: number = 0;\r\n // calories: number = 0;\r\n // servingWeight: number = 0;\r\n // saturatedAndTransDv: number = 0;\r\n // servingQuantityInUnitOfMeasurement: number = 0;\r\n // erythritol: number = 0;\r\n // isomalt: number = 0;\r\n // mannitol: number = 0;\r\n // xylitol: number = 0;\r\n // lactitol: number = 0;\r\n // sorbitol: number = 0;\r\n // maltitol: number = 0;\r\n // monounsaturatedFats: number = 0;\r\n // polyunsaturatedFats: number = 0;\r\n // omega3: number = 0;\r\n // omega6: number = 0;\r\n // caffeine: number = 0;\r\n // ash: number = 0;\r\n // water: number = 0;\r\n // moisture: number = 0;\r\n // biotin: number = 0;\r\n // choline: number = 0;\r\n // folate: number = 0;\r\n // niacin: number = 0;\r\n // pantothenicAcid: number = 0;\r\n // riboflavin: number = 0;\r\n // thiamine: number = 0;\r\n // betaCarotene: number = 0;\r\n // retinol: number = 0;\r\n // vitaminB6: number = 0;\r\n // vitaminB12: number = 0;\r\n // vitaminE: number = 0;\r\n // vitaminK: number = 0;\r\n // chromium: number = 0;\r\n // chloride: number = 0;\r\n // copper: number = 0;\r\n // iodine: number = 0;\r\n // magnesium: number = 0;\r\n // manganese: number = 0;\r\n // molybdenum: number = 0;\r\n // phosphorus: number = 0;\r\n // selenium: number = 0;\r\n // zinc: number = 0;\r\n // lAlanine: number = 0;\r\n // lArginine: number = 0;\r\n // lAsparagine: number = 0;\r\n // lAsparticAcid: number = 0;\r\n // lCysteine: number = 0;\r\n // lGlutamicAcid: number = 0;\r\n // lGlutamine: number = 0;\r\n // glycine: number = 0;\r\n // lHistidine: number = 0;\r\n // lIsoleucine: number = 0;\r\n // lLeucine: number = 0;\r\n // lLysine: number = 0;\r\n // lMethionine: number = 0;\r\n // lPhenylalanine: number = 0;\r\n // lProline: number = 0;\r\n // lSerine: number = 0;\r\n // lThreonine: number = 0;\r\n // lTyrosine: number = 0;\r\n // lValine: number = 0;\r\n // greenTeaExtract: number = 0;\r\n // taurine: number = 0;\r\n // phosphatidylserine: number = 0;\r\n\r\n totalNutrientsPerServing: (NutrientAnalysis & { nutrientName: string })[] = [];\r\n servingUnitOfMeasurement: string = 'g';\r\n\r\n weight: number = 0;\r\n weightPerServing: number = 0;\r\n rawWeight: number = 0;\r\n rawWeightPerServing: number = 0;\r\n\r\n volume: number | null;\r\n rawVolume: number | null;\r\n volumePerServing: number | null;\r\n rawVolumePerServing: number | null;\r\n\r\n quantityPerServingInUnitOfMeasurement: {\r\n item1: number; // quantity\r\n item2: string; // unit of measurement\r\n } | null;\r\n\r\n displayServingQuantityAndMeasure: {\r\n item1: number; // quantity\r\n item2: string; // unit of measurement\r\n } | null;\r\n servingQuantityInUnitOfMeasurementOverride: number;\r\n servingUnitOfMeasurementOverride: number;\r\n labelType : LabelTypeMetadata | LabelTypeMetadata.BackOfPack;\r\n\r\n additionalLabelInformation: AdditionalLabelInformation;\r\n\r\n constructor(\r\n totalNutrientsPerServing: (NutrientAnalysis & { nutrientName: string })[],\r\n servingUnitOfMeasurement: string,\r\n weight: number,\r\n weightPerServing: number,\r\n rawWeight: number,\r\n rawWeightPerServing: number,\r\n volume: number | null,\r\n rawVolume: number | null,\r\n volumePerServing: number | null,\r\n rawVolumePerServing: number | null,\r\n quantityPerServingInUnitOfMeasurement: {\r\n item1: number; // quantity\r\n item2: string; // unit of measurement\r\n } = null,\r\n displayServingQuantityAndMeasure: {\r\n item1: number;\r\n item2: string;\r\n } = null,\r\n servingQuantityInUnitOfMeasurementOverride: number = null,\r\n servingUnitOfMeasurementOverride: number = null,\r\n labelType: LabelTypeMetadata | LabelTypeMetadata.BackOfPack = LabelTypeMetadata.BackOfPack,\r\n additionalLabelInformation: AdditionalLabelInformation = {}\r\n ) {\r\n this.totalNutrientsPerServing = totalNutrientsPerServing;\r\n this.servingUnitOfMeasurement = servingUnitOfMeasurement;\r\n this.weight = weight;\r\n this.weightPerServing = weightPerServing;\r\n this.rawWeight = rawWeight;\r\n this.rawWeightPerServing = rawWeightPerServing;\r\n this.volume = volume;\r\n this.rawVolume = rawVolume;\r\n this.volumePerServing = volumePerServing;\r\n this.rawVolumePerServing = rawVolumePerServing;\r\n this.quantityPerServingInUnitOfMeasurement = quantityPerServingInUnitOfMeasurement;\r\n this.displayServingQuantityAndMeasure = displayServingQuantityAndMeasure;\r\n this.servingQuantityInUnitOfMeasurementOverride = servingQuantityInUnitOfMeasurementOverride;\r\n this.servingUnitOfMeasurementOverride = servingUnitOfMeasurementOverride;\r\n this.labelType = labelType;\r\n this.additionalLabelInformation = additionalLabelInformation;\r\n }\r\n\r\n getNutrientInfo(...nutrientNames: NutrientType[]): NutrientAnalysis | null {\r\n const nameKey = nutrientNames.map((x) => NutrientType[x]).join('');\r\n\r\n // Find by name\r\n return this.totalNutrientsPerServing.find(\r\n (nutrient) => nutrient.nutrientName === nameKey\r\n ) || null;\r\n }\r\n\r\n getRoundedValue(...nutrientNames: NutrientType[]): number {\r\n const nutrientInfo = this.getNutrientInfo(...nutrientNames);\r\n return nutrientInfo ? nutrientInfo.roundedValue : 0;\r\n }\r\n\r\n getRoundedDailyValue(...nutrientNames: NutrientType[]): number {\r\n const nutrientInfo = this.getNutrientInfo(...nutrientNames);\r\n return nutrientInfo ? nutrientInfo.roundedDailyValue : 0;\r\n }\r\n\r\n getExactValue(...nutrientNames: NutrientType[]): number {\r\n const nutrientInfo = this.getNutrientInfo(...nutrientNames);\r\n return nutrientInfo ? nutrientInfo.exactValue : 0;\r\n }\r\n\r\n getExactDailyValue(...nutrientNames: NutrientType[]): number {\r\n const nutrientInfo = this.getNutrientInfo(...nutrientNames);\r\n return nutrientInfo ? nutrientInfo.exactDailyValue : 0;\r\n }\r\n}","import { DailyValueCalculationMethod } from \"@/models/Recipes/DailyValueCalculationMethod\";\r\nimport { Nutritions } from \"@/models/Recipes/Nutritions\";\r\nimport {NutrientAnalysis} from \"@/models/Nutrient/NutrientAnalysis\";\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 getBoldString(mainString: string, subString: string) {\r\n if(subString == \"\"){\r\n return `${mainString}`;\r\n }\r\n else{\r\n const index = mainString.toLowerCase().indexOf(subString.toLowerCase());\r\n if (index !== -1) {\r\n const startIndex = mainString.substring(0, index);\r\n const endIndex = mainString.substring(index + subString.length);\r\n const highlightedString = startIndex + \"\" + mainString.substring(index, index + subString.length) + \"\" + endIndex;\r\n return highlightedString;\r\n }\r\n return mainString;\r\n }\r\n}\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 let 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// Following functions are used to simplify the object nutritionAnalysis returned from backend\r\n\r\nfunction dVCheck(roundedDv: number, exactDv: number, dailyValueCalculationMethod: DailyValueCalculationMethod): number {\r\n return dailyValueCalculationMethod ? exactDv : roundedDv;\r\n}\r\n\r\nfunction roundingCheck(\r\n value: NutrientAnalysis,\r\n dailyValueCalculationMethod: DailyValueCalculationMethod\r\n): string | number {\r\n if (dailyValueCalculationMethod === undefined) {\r\n return value.roundedValue;\r\n }\r\n\r\n else {\r\n if (dailyValueCalculationMethod === DailyValueCalculationMethod.Unrounded) {\r\n return Number.isInteger(value.exactValue) ? value.exactValue : value.exactValue.toFixed(2);\r\n }\r\n\r\n else if (dailyValueCalculationMethod === DailyValueCalculationMethod.Rounded) {\r\n return Number.isInteger(value.roundedValue) ? value.roundedValue : value.roundedValue.toFixed(2);\r\n }\r\n\r\n return value.roundedValue;\r\n }\r\n}\r\n\r\nexport function mapNutritions(nutritions: any, dailyValueCalculationMethod?: DailyValueCalculationMethod): Nutritions {\r\n return new Nutritions(\r\n nutritions.totalNutrientsPerServing.map((nutrient: any) => ({\r\n nutrientName: nutrient.nutrientName,\r\n exactValue: roundingCheck(nutrient, dailyValueCalculationMethod),\r\n exactDailyValue: dVCheck(\r\n nutrient.roundedDailyValue,\r\n nutrient.exactDailyValue,\r\n dailyValueCalculationMethod\r\n ),\r\n roundedValue: roundingCheck(nutrient, dailyValueCalculationMethod),\r\n roundedDailyValue: dVCheck(\r\n nutrient.roundedDailyValue,\r\n nutrient.exactDailyValue,\r\n dailyValueCalculationMethod\r\n ),\r\n nutrientType: nutrient.nutrientType,\r\n originalNutrientAnalysis: nutrient.originalNutrientAnalysis,\r\n })),\r\n nutritions.servingUnitOfMeasurement || 'g',\r\n nutritions.weight,\r\n nutritions.weightPerServing,\r\n nutritions.rawWeight,\r\n nutritions.rawWeightPerServing,\r\n nutritions.volume,\r\n nutritions.rawVolume,\r\n nutritions.volumePerServing,\r\n nutritions.rawVolumePerServing,\r\n {\r\n item1: nutritions.quantityPerServingInUnitOfMeasurement.item1,\r\n item2: nutritions.quantityPerServingInUnitOfMeasurement.item2\r\n },\r\n {\r\n item1: nutritions.displayServingQuantityAndMeasure.item1,\r\n item2: nutritions.displayServingQuantityAndMeasure.item2\r\n },\r\n nutritions.servingQuantityInUnitOfMeasurementOverride,\r\n nutritions.servingUnitOfMeasurementOverride,\r\n nutritions.labelType,\r\n nutritions.additionalLabelInformation\r\n );\r\n}\r\n\r\nexport function groupBy(items: K[], key: (item: K) => V): Map {\r\n return items.reduce((acc, item) => {\r\n const group = key(item);\r\n const values = acc.get(group) || [];\r\n values.push(item);\r\n acc.set(group, values);\r\n return acc;\r\n }, new Map());\r\n}","export enum NutrientType {\r\n Energy,\r\n Fat,\r\n SaturatedFattyAcids,\r\n TransFattyAcids,\r\n Cholesterol,\r\n Sodium,\r\n Carbohydrate,\r\n Fibre,\r\n Sugars,\r\n Protein,\r\n VitaminD,\r\n Potassium,\r\n Calcium,\r\n Iron,\r\n AddedSugars,\r\n SugarAlcohols,\r\n VitaminC,\r\n Water,\r\n VitaminA,\r\n Erythritol = 30,\r\n Isomalt,\r\n Lactitol,\r\n Mannitol,\r\n Sorbitol,\r\n Xylitol,\r\n Maltitol,\r\n UnspecifiedSugarAlcohol,\r\n MonoUnsaturatedFats, // 38\r\n PolyUnsaturatedFats, // 39\r\n Omega3, // 40\r\n Omega6, // 41\r\n Biotin, // 42\r\n Choline, // 43\r\n Folate, // 44\r\n FolateDfe, // 45\r\n Niacin, // 46\r\n NiacinEq, // 47\r\n NiacinVitb3Eq, // 48\r\n PantothenicAcid, // 49\r\n Riboflavin, // 50\r\n Thiamine, // 51\r\n BetaCarotene, // 52\r\n Retinol, // 53\r\n VitaminB12, // 54 (Vitamin D, another form)\r\n VitaminE, // 55\r\n VitaminEToco, // 56\r\n VitaminETocoEq, // 57\r\n VitaminK, // 58\r\n Chromium, // 59\r\n Chloride, // 60\r\n Copper, // 61\r\n Iodine, // 62\r\n Magnesium, // 63\r\n Manganese, // 64\r\n Molybdenum, // 65\r\n Phosphorus, // 66\r\n Selenium, // 67\r\n Zinc, // 68\r\n LAlanine, // 69\r\n LArginine, // 70\r\n LAsparagine, // 71\r\n LAsparticAcid, // 72\r\n LCysteine, // 73\r\n LGlutamicAcid, // 74\r\n LGlutamine, // 75\r\n Glycine, // 76\r\n LHistidine, // 77\r\n LIsoleucine, // 78\r\n LLeucine, // 79\r\n LLysine, // 80\r\n LMethionine, // 81\r\n LPhenylalanine, // 82\r\n LProline, // 83\r\n LSerine, // 84\r\n LThreonine, // 85\r\n LTyrosine, // 86\r\n LValine, // 87\r\n Caffeine, // 88\r\n GreenTeaExtract, // 89\r\n Taurine, // 90\r\n Ash, // 91\r\n Moisture, // 92\r\n Phosphatidylserine, // 93\r\n VitaminB6, // 94\r\n FolicAcid, // 95\r\n Boron, // 96\r\n Fluoride, // 97\r\n Other = 99,\r\n SaturatedAndTrans, // 100\r\n}","export enum LabelTypeMetadata {\r\n BackOfPack = 1,\r\n FrontOfPack = 2,\r\n SupplementFact = 4,\r\n}","import Repository from './Repository';\r\nimport ListRequest from '@/models/ListRequest';\r\nimport { CreateRestaurantIngredient } from '@/models/Ingredient/CreateRestaurantIngredient';\r\nimport { UpdateRestaurantIngredient } from '@/models/Ingredient/UpdateRestaurantIngredient';\r\nimport { DeleteRestaurantIngredients } from '@/models/Ingredient/DeleteRestaurantIngredients';\r\nimport { SearchIngredients } from '@/models/Ingredient/SearchIngredients';\r\nimport { Ingredient } from '@/models/Ingredient/Ingredient';\r\nimport { AxiosResponse } from 'axios';\r\nimport { MethodResult } from './ResultTypes/MethodResult';\r\n\r\n\r\nconst resource = '/ingredients';\r\n\r\nexport default {\r\n listIngredientSearch(listRequest: ListRequest) {\r\n return Repository.post(`${resource}/ListIngredientSearch`, listRequest, { withCredentials: true });\r\n },\r\n listRestaurantIngredients(listRequest: ListRequest) {\r\n return Repository.post(`${resource}/ListRestaurantIngredients`, listRequest, { withCredentials: true });\r\n },\r\n // getRestaurantIngredientDetails(ingredientId: number){\r\n // return Repository.post(`${resource}/GetRestaurantIngredientDetails`, { ingredientId }, { withCredentials: true });\r\n // },\r\n createRestaurantIngredient(createRestaurantIngredient: CreateRestaurantIngredient) {\r\n return Repository.post(`${resource}/CreateRestaurantIngredient`, createRestaurantIngredient, { withCredentials: true });\r\n },\r\n updateRestaurantIngredient(updateRestaurantIngredient: UpdateRestaurantIngredient) {\r\n return Repository.post(`${resource}/UpdateRestaurantIngredient`, updateRestaurantIngredient, { withCredentials: true });\r\n },\r\n deleteRestaurantIngredients(deleteRestaurantIngredients: DeleteRestaurantIngredients) {\r\n return Repository.post(`${resource}/DeleteRestaurantIngredients`, deleteRestaurantIngredients, { withCredentials: true });\r\n },\r\n searchIngredients(searchIngredients: SearchIngredients) {\r\n return Repository.post(`${resource}/SearchIngredients`, searchIngredients, { withCredentials: true });\r\n },\r\n searchIngredientsByFoodCode(searchIngredients: SearchIngredients) {\r\n return Repository.post(`${resource}/SearchIngredientsByFoodCode`, searchIngredients, { withCredentials: true });\r\n },\r\n getIngredientDetails(ingredientId: number) {\r\n return Repository.post<{ingredientId: number}, AxiosResponse>>(\r\n `${resource}/GetIngredientDetails`,\r\n { ingredientId },\r\n { withCredentials: true }\r\n );\r\n },\r\n getAutoCorrectSerchTerm(searchTerms: string[]) {\r\n return Repository.post(`${resource}/AutoCorrectSearchTerm`, { SearchTerms: searchTerms }, { withCredentials: true });\r\n },\r\n createIngredientSearchFailure(failure: any) {\r\n return Repository.post(`${resource}/CreateIngredientSearchFailure`, failure, { withCredentials: true });\r\n },\r\n listIngredientSearchFailures(failure: any) {\r\n return Repository.post(`${resource}/ListIngredientSearchFailures`, failure, { withCredentials: true });\r\n },\r\n searchCategoryDensities(searchTerm: string, categoryDensityId: number|string) {\r\n return Repository.get(`${resource}/SearchCategoryDensities?searchTerm=${searchTerm}&categoryDensityId=${categoryDensityId}`, { withCredentials: true });\r\n },\r\n};\r\n","export enum DailyValueCalculationMethod {\r\n Rounded = 0,\r\n Unrounded = 1,\r\n}","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('transition',{attrs:{\"name\":\"modal\",\"role\":\"dialog\"}},[(_vm.show)?_c('div',{staticClass:\"modal-mask\"},[_c('div',{staticClass:\"modal-wrapper\",attrs:{\"id\":_vm.modalId}},[_c('div',{staticClass:\"modal-dialog\",class:{'modal-small':_vm.size === 's', 'modal-medium':_vm.size==='m' || typeof _vm.size === 'undefined', 'modal-large':_vm.size === 'l', 'modal-x-large':_vm.size === 'xl'}},[_c('div',{staticClass:\"modal-content\"},[_c('div',{staticClass:\"modal-header\"},[_c('h3',{staticClass:\"modal-title\"},[_vm._v(_vm._s(_vm.modalTitle))]),_c('button',{staticClass:\"close\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.cancelModal}},[_c('span',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"×\")])])]),_c('div',{staticClass:\"modal-body\"},[_vm._t(\"default\")],2)])])])]):_vm._e()])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { Vue, Component, Prop, Watch } from \"vue-property-decorator\";\r\n\r\n@Component\r\nexport default class vModal extends Vue {\r\n @Prop() show!: boolean;\r\n @Prop() modalTitle!: string;\r\n @Prop() size?: string;\r\n @Prop() modalId?: string;\r\n\r\n @Watch(\"show\")\r\n showModal() {\r\n let htmlBodyElement = document.getElementsByTagName(\"body\")[0];\r\n if (this.show) {\r\n htmlBodyElement.classList.add(\"modalOpen\");\r\n this.$emit(\"openModal\");\r\n }\r\n\r\n else {\r\n htmlBodyElement.classList.remove(\"modalOpen\");\r\n }\r\n }\r\n\r\n hideModal() {\r\n this.$emit(\"hideModal\");\r\n }\r\n\r\n cancelModal() {\r\n this.$emit(\"cancelModal\");\r\n }\r\n\r\n mounted() {\r\n document.addEventListener(\"keydown\", (e) => {\r\n if (this.show && e.keyCode == 27) {\r\n this.cancelModal();\r\n }\r\n });\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!./vModal.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!./vModal.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./vModal.vue?vue&type=template&id=88baf142&scoped=true\"\nimport script from \"./vModal.vue?vue&type=script&lang=ts\"\nexport * from \"./vModal.vue?vue&type=script&lang=ts\"\nimport style0 from \"./vModal.vue?vue&type=style&index=0&id=88baf142&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 \"88baf142\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}