forked from nutritionix/nutrition-label
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nutritionLabel-min.js
18 lines (18 loc) · 73.8 KB
/
nutritionLabel-min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
***************************************************************************************************************************************************+
* NUTRITIONIX.com |
* |
* This plugin allows you to create a fully customizable nutrition label |
* |
* @authors Leo Joseph Gajitos <[email protected]>, Rommel Malang <[email protected]> and Yurko Fedoriv <[email protected]> |
* @copyright Copyright (c) 2017 Nutritionix. |
* @license This Nutritionix jQuery Nutrition Label is dual licensed under the MIT and GPL licenses. |
* @link http://www.nutritionix.com |
* @github http://github.com/nutritionix/nutrition-label |
* @current version 11.0.13 |
* @stable version 11.0.4 |
* @supported browser Firefox, Chrome, IE8+ |
* @description To be able to create a FDA-style nutrition label with any nutrition data source |
* |
***************************************************************************************************************************************************+
*/ !function($){for(let x=1;x<8;x++){let tab="";for(let y=1;y<=x;y++)tab+=" ";eval("var globalTab"+x+' = "'+tab+'";')}function NutritionLabel(t,e){return this.nutritionLabel=null,this.settings=t,this.$elem=e,this}function cleanSettings(t){let e=["calorieIntake","dailyValueCalcium","dailyValueCarb","dailyValueCholesterol","dailyValueEnergyKcal","dailyValueFiber","dailyValueIron","dailyValuePotassium","dailyValueProtein","dailyValueSalt","dailyValueSatFat","dailyValueSodium","dailyValueSugar","dailyValueTotalFat","dailyValueVitaminD","decimalPlacesForDailyValues","decimalPlacesForNutrition","decimalPlacesForQuantityTextbox","scrollHeightComparison","scrollHeightPixel","scrollLongItemNamePixel","scrollLongItemNamePixel2018Override","valueAddedSugars","valueCaffeine","valueCalcium","valueCalories","valueCholesterol","valueCol1CalorieDiet","valueCol1Dietary","valueCol1DietaryCholesterol","valueCol1DietaryPotassium","valueCol1DietarySatFat","valueCol1DietarySodium","valueCol1DietaryTotalCarb","valueCol1DietaryTotalFat","valueCol2CalorieDiet","valueCol2Dietary","valueCol2DietaryCholesterol","valueCol2DietaryPotassium","valueCol2DietarySatFat","valueCol2DietarySodium","valueCol2DietaryTotalCarb","valueCol2DietaryTotalFat","valueFatCalories","valueFibers","valueIron","valueMonoFat","valuePolyFat","valuePotassium","valueProteins","valueSatFat","valueServingPerContainer","valueServingSize","valueServingUnitQuantity","valueServingWeightGrams","valueSodium","valueSugarAlcohol","valueSugars","valueTotalCarb","valueTotalFat","valueTransFat","valueVitaminA","valueVitaminC","valueVitaminD","width"];return $.each(t,function(n,i){-1!==jQuery.inArray(n,e)&&(t[n]=parseFloat(t[n]),(isNaN(t[n])||void 0===t[n])&&(t[n]=0))}),t.valueServingUnitQuantity<0&&(t.valueServingUnitQuantity=0),t}function updateNutritionValueWithMultiplier(t){let e=["valueAddedSugars","valueCaffeine","valueCalcium","valueCalories","valueCholesterol","valueFatCalories","valueFibers","valueIron","valueMonoFat","valuePolyFat","valuePotassium","valuePotassium_2018","valueProteins","valueSatFat","valueServingWeightGrams","valueSodium","valueSugarAlcohol","valueSugars","valueTotalCarb","valueTotalFat","valueTransFat","valueVitaminA","valueVitaminC","valueVitaminD"];return $.each(t,function(n,i){-1!==jQuery.inArray(n,e)&&(t[n]=parseFloat(t[n]),(isNaN(t[n])||void 0===t[n])&&(t[n]=0),t[n]=parseFloat(t[n])*parseFloat(t.valueServingUnitQuantity)*parseFloat(t.nutritionValueMultiplier))}),0==parseFloat(t.valueServingUnitQuantity)?t.valueServingPerContainer=0:isNaN(t.valueServingPerContainer)||void 0==t.valueServingPerContainer||(t.valueServingPerContainer=parseFloat(t.totalContainerQuantity)/parseFloat(t.valueServingUnitQuantity)),t}function init(t,e){let n=$.extend({},$.fn.nutritionLabel.defaultSettings,t||{}),i=cleanSettings($.extend({},$.fn.nutritionLabel.defaultSettings,t||{}));n.totalContainerQuantity=parseFloat(n.valueServingPerContainer)*parseFloat(n.valueServingUnitQuantity),i.totalContainerQuantity=parseFloat(i.valueServingPerContainer)*parseFloat(i.valueServingUnitQuantity),n=cleanSettings(n),i=cleanSettings(i),n.nutritionValueMultiplier=n.valueServingUnitQuantity<=0?1:1/n.valueServingUnitQuantity;let a=updateNutritionValueWithMultiplier(n);n.originalServingUnitQuantity=a.valueServingUnitQuantity,a.valueServingUnitQuantity<=0&&(i.valueServingUnitQuantity=1,(a=updateNutritionValueWithMultiplier(i)).valueServingUnitQuantity=1);var s=new NutritionLabel(a,e);a.showLegacyVersion?(updateValuesAfterAQuantityChanged(n,s,e,!0,!0,!1),n.showServingUnitQuantityTextbox&&(n.hideTextboxArrows||($("#"+e.attr("id")).on("click",".unitQuantityUp",function(i){i.preventDefault(),changeQuantityByArrow($(this),1,updateTheSettingsAfterAnEvent(n,t),s,e,!0,!1)}),$("#"+e.attr("id")).on("click",".unitQuantityDown",function(i){i.preventDefault(),changeQuantityByArrow($(this),-1,updateTheSettingsAfterAnEvent(n,t),s,e,!0,!1)})),$("#"+e.attr("id")).on("change",".unitQuantityBox",function(i){i.preventDefault(),changeQuantityTextbox($(this),updateTheSettingsAfterAnEvent(n,t),s,e,!0,!1)}),$("#"+e.attr("id")).on("keydown",".unitQuantityBox",function(i){13==i.keyCode&&(i.preventDefault(),changeQuantityTextbox($(this),updateTheSettingsAfterAnEvent(n,t),s,e,!0,!1))}))):a.showUKVersion?(updateValuesAfterAQuantityChanged(n,s,e,!1,!0,!0),n.showServingUnitQuantityTextbox&&(n.hideTextboxArrows||($("#"+e.attr("id")).on("click",".uk_nf-unitQuantityUp",function(i){i.preventDefault(),changeQuantityByArrow($(this),1,updateTheSettingsAfterAnEvent(n,t),s,e,!1,!0)}),$("#"+e.attr("id")).on("click",".uk_nf-unitQuantityDown",function(i){i.preventDefault(),changeQuantityByArrow($(this),-1,updateTheSettingsAfterAnEvent(n,t),s,e,!1,!0)})),$("#"+e.attr("id")).on("change",".uk_nf-unitQuantityBox",function(i){i.preventDefault(),changeQuantityTextbox($(this),updateTheSettingsAfterAnEvent(n,t),s,e,!1,!0)}),$("#"+e.attr("id")).on("keydown",".uk_nf-unitQuantityBox",function(i){13==i.keyCode&&(i.preventDefault(),changeQuantityTextbox($(this),updateTheSettingsAfterAnEvent(n,t),s,e,!1,!0))}))):(updateValuesAfterAQuantityChanged(n,s,e,!1,!0,!1),n.showServingUnitQuantityTextbox&&(n.hideTextboxArrows||($("#"+e.attr("id")).on("click","div.nf-unitQuantityUp",function(i){i.preventDefault(),changeQuantityByArrow($(this),1,updateTheSettingsAfterAnEvent(n,t),s,e,!1,!1)}),$("#"+e.attr("id")).on("click","div.nf-unitQuantityDown",function(i){i.preventDefault(),changeQuantityByArrow($(this),-1,updateTheSettingsAfterAnEvent(n,t),s,e,!1,!1)})),$("#"+e.attr("id")).on("change",".nf-unitQuantityBox",function(i){i.preventDefault(),changeQuantityTextbox($(this),updateTheSettingsAfterAnEvent(n,t),s,e,!1,!1)}),$("#"+e.attr("id")).on("keydown",".nf-unitQuantityBox",function(i){13==i.keyCode&&(i.preventDefault(),changeQuantityTextbox($(this),updateTheSettingsAfterAnEvent(n,t),s,e,!1,!1))}))),e.data("_nutritionLabel",s)}function updateTheSettingsAfterAnEvent(t,e){let n=cleanSettings($.extend({},$.fn.nutritionLabel.defaultSettings,e||{}));return n.originalServingUnitQuantity=t.originalServingUnitQuantity,n.totalContainerQuantity=t.totalContainerQuantity,n.nutritionValueMultiplier=n.valueServingUnitQuantity<=0?1:1/n.valueServingUnitQuantity,n}function addScrollToItemDiv(t,e,n,i){let a=parseInt(e.scrollLongItemNamePixel);i||(a=parseInt(e.scrollLongItemNamePixel2018Override)),void 0!=$("#"+t.attr("id")+" ."+n+".inline").val()?$("#"+t.attr("id")+" ."+n+".inline").height()>a+1&&$("#"+t.attr("id")+" ."+n+".inline").css({"margin-left":"3.90em",height:a+"px","overflow-y":"auto"}):i?$("#"+t.attr("id")+" ."+n).height()>a+1&&$("#"+t.attr("id")+" ."+n).css({height:a+"px","overflow-y":"auto"}):$("#"+t.attr("id")+" ."+n+" div").height()>=a+1&&$("#"+t.attr("id")+" ."+n+" div").css({height:a+"px","overflow-y":"auto"})}function notApplicableHover(t){void 0!==t.attr("id")&&""!==t.attr("id")?($("#"+t.attr("id")+" .notApplicable").on("mouseenter",function(){$("#"+t.attr("id")+" .naTooltip").css({top:$(this).position().top+"px",left:$(this).position().left+10+"px"}).show()}),$("#"+t.attr("id")+" .notApplicable").on("mouseleave",function(){$("#"+t.attr("id")+" .naTooltip").hide()})):($("#"+t.attr("id")+" .notApplicable").on("mouseenter",function(){$(".naTooltip").css({top:$(this).position().top+"px",left:$(this).position().left+10+"px"}).show()}),$("#"+t.attr("id")+" .notApplicable").on("mouseleave",function(){$(".naTooltip").hide()}))}function updateScrollingFeature(t,e,n,i,a){let s;(s=void 0!==t.attr("id")&&""!==t.attr("id")?$("#"+t.attr("id")+" #"+n).parent():$("#"+n).parent()).innerHeight()>i&&s.addClass("scroll").css({height:a+"px"})}function updateValuesAfterAQuantityChanged(t,e,n,i,a,s){let o="ingredientList",l="calcDisclaimerText",r="name";if(i||s?!i&&s&&(o="uk_nf-ingredient-statement",l="uk_nf-disclaimer"):(o="nf-ingredientList",l="nf-calcDisclaimerText",r="nf-item-name block"),a||(t=updateNutritionValueWithMultiplier(t),e=new NutritionLabel(t,n)),i?n.html(e.generateLegacy()):s?n.html(e.generateUK()):n.html(e.generate2018()),t.showIngredients&&t.scrollLongIngredients&&updateScrollingFeature(n,t,o,t.scrollHeightComparison,t.scrollHeightPixel),t.showDisclaimer&&updateScrollingFeature(n,t,l,t.scrollDisclaimerHeightComparison,t.scrollDisclaimer),notApplicableHover(n),!s&&t.scrollLongItemName&&addScrollToItemDiv(n,t,r,i),!a)return t}function handleQuantityChange(t,e,n,i){let a;t.userFunctionOnQuantityChange?a=t.userFunctionOnQuantityChange:t.userFunctionNameOnQuantityChange&&(a=window[t.userFunctionNameOnQuantityChange]),"function"==typeof a&&a(e,n,i)}function changeQuantityTextbox(t,e,n,i,a,s){let o="nixLabelBeforeQuantity",l,r;!a&!s?o="nf-nixLabelBeforeQuantity":!a&s&&(o="uk_nf-nixLabelBeforeQuantity"),l=parseFloat($("#"+i.attr("id")+" #"+o).val()),r=regIsPosNumber(t.val())?parseFloat(t.val()):l,t.val(roundLoDash(r,e.decimalPlacesForQuantityTextbox)),e.valueServingUnitQuantity=r,(e=updateValuesAfterAQuantityChanged(e,n,i,a,!1,s)).allowGoogleAnalyticsEventLog&&window[e.gooleAnalyticsFunctionName]("send","event",e.textGoogleAnalyticsEventCategory,e.textGoogleAnalyticsEventActionTextbox),handleQuantityChange(e,"textbox",roundLoDash(l,e.decimalPlacesForQuantityTextbox),roundLoDash(r,e.decimalPlacesForQuantityTextbox))}function changeQuantityByArrow(t,e,n,i,a,s,o){let l="unitQuantityBox";!s&!o?l="nf-unitQuantityBox":!s&o&&(l="uk_nf-unitQuantityBox");let r=parseFloat(t.parent().parent().find("input."+l).val());isNaN(r)&&(r=1);let u=r;r<=1&&-1==e?r+=e=-.5:r<1&&1==e?r+=e=.5:r<=2&&r>1&&-1==e?r=1:r+=e,r<0&&(r=0),t.parent().parent().find("input."+l).val(roundLoDash(r,n.decimalPlacesForQuantityTextbox)),n.valueServingUnitQuantity=r,(n=updateValuesAfterAQuantityChanged(n,i,a,s,!1,o)).allowGoogleAnalyticsEventLog&&(e>0?window[n.gooleAnalyticsFunctionName]("send","event",n.textGoogleAnalyticsEventCategory,n.textGoogleAnalyticsEventActionUpArrow):window[n.gooleAnalyticsFunctionName]("send","event",n.textGoogleAnalyticsEventCategory,n.textGoogleAnalyticsEventActionDownArrow)),handleQuantityChange(n,e>0?"up arrow":"down arrow",u,r)}function roundToNearestNum(t,e){return e<0?Math.round(t*e)/e:Math.round(t/e)*e}function roundCalories(t,e){return(t=roundCaloriesRule(t))>0&&(t=roundLoDash(t,e)),t}function roundFat(t,e){return(t=roundFatRule(t))>0&&(t=roundLoDash(t,e)),t}function roundSodium(t,e){return(t=roundSodiumRule(t))>0&&(t=roundLoDash(t,e)),t}function roundPotassium(t,e){return(t=roundPotassiumRule(t))>0&&(t=roundLoDash(t,e)),t}function roundCholesterol(t,e){let n=!0,i=roundCholesterolRule(t);return!1===i?n=!1:t=i,n?t>0&&(t=roundLoDash(t,e)):t="< 5",t}function roundCarbFiberSugarProtein(t,e){let n=!0,i=roundCarbFiberSugarProteinRule(t);return!1===i?n=!1:t=i,n?t>0&&(t=roundLoDash(t,e)):t="< 1",t}function roundCaffeine(t,e){return(t=roundToNearestNum(t,1))>0&&(t=roundLoDash(t,e)),t}function roundCaloriesRule(t){return t<5?0:t<=50?roundToNearestNum(t,5):roundToNearestNum(t,10)}function roundFatRule(t){return t<.5?0:t<5?roundToNearestNum(t,.5):roundToNearestNum(t,1)}function roundSodiumRule(t){return t<5?0:t<=140?roundToNearestNum(t,5):roundToNearestNum(t,10)}function roundPotassiumRule(t){return t<5?0:t<=140?roundToNearestNum(t,5):roundToNearestNum(t,10)}function roundCholesterolRule(t){return t<2?0:!(t<=5)&&roundToNearestNum(t,5)}function roundCarbFiberSugarProteinRule(t){return t<.5?0:!(t<1)&&roundToNearestNum(t,1)}function roundVitaminsCalciumIron(t){if(t>0){if(t<1)return 0;if(t<=2)return 2;if(t<10)return roundToNearestNum(t,2);else if(t<50)return roundToNearestNum(t,5);return roundToNearestNum(t,10)}return 0}function roundForUKLabelTotalFatCarbsSugarFiberProtein(t){let e=!0,n=roundForUKLabelTotalFatCarbsSugarFiberProteinRule(t);return!1===n?e=!1:t=n,e&&0==t&&(t="< 0.5"),t}function roundForUKLabelTotalFatCarbsSugarFiberProteinRule(t){return t<=.5?0:t<10?roundLoDash(roundToNearestNum(t,.1),1):roundLoDash(roundToNearestNum(t,1))}function roundForUKLabelSatFat(t){let e=!0,n=roundForUKLabelSatFatRule(t);return!1===n?e=!1:t=n,e&&0==t&&(t="< 0.1"),t}function roundForUKLabelSatFatRule(t){return t<=.1?0:t<10?roundLoDash(roundToNearestNum(t,.1),1):roundLoDash(roundToNearestNum(t,1))}function roundForUKLabelSalt(t){let e=!0,n=roundForUKLabelSaltRule(t);return!1===n?e=!1:t=n,e&&0==t&&(t="< 0.01"),t}function roundForUKLabelSaltRule(t){return t<=.0125?0:t<1?roundLoDash(roundToNearestNum(t,.01),2):roundLoDash(roundToNearestNum(t,.1),1)}function roundFor2018LabelVitaminDIron(t){return(t=roundFor2018LabelVitaminDIronRule(t))>0?roundLoDash(t,1):0}function roundFor2018LabelVitaminDIronRule(t){return roundToNearestNum(t,.1)}function roundFor2018LabelCalciumPotassium(t){return(t=roundFor2018LabelCalciumPotassiumRule(t))>0?t:0}function roundFor2018LabelCalciumPotassiumRule(t){return roundToNearestNum(t,10)}function regIsPosNumber(t){return RegExp("(^[0-9]+[.]?[0-9]+$)|(^[0-9]+$)").test(t)}function itemNameHtmlLegacy(t){let e=globalTab1,n="",i="";if(t.showServingUnitQuantityTextbox&&(null===t.valueServingSizeUnit||""==t.valueServingSizeUnit||""!==t.valueServingSizeUnit&&null!==t.valueServingSizeUnit&&t.originalServingUnitQuantity<=0)){let a="unitQuantityBox";n+=globalTab1+'<div class="cf">\n',n+=globalTab2+'<div class="rel servingSizeField">\n',t.hideTextboxArrows?a="unitQuantityBox arrowsAreHidden":(n+=globalTab3+'<div class="setter">\n',n+=globalTab4+'<a href="'+t.textAriaLabelIncreaseQuantityArrow+'" class="unitQuantityUp" ',n+='aria-label="'+t.textAriaLabelIncreaseQuantityArrow+'" rel="nofollow" tabindex="0"></a>\n',n+=globalTab4+'<a href="'+t.textAriaLabelDecreaseQuantityArrow+'" class="unitQuantityDown" ',n+='aria-label="'+t.textAriaLabelDecreaseQuantityArrow+'" rel="nofollow" tabindex="0"></a>\n',n+=globalTab3+'</div><!-- closing class="setter" -->\n\n'),n+=globalTab3+'<input type="text" data-role="none" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" class="'+a+'" aria-label="'+t.textAriaLabelChangeQuantityTextbox+'">\n',n+=globalTab3+'<input type="hidden" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" id="nixLabelBeforeQuantity">\n',n+=globalTab2+'</div><!-- closing class="servingSizeField" -->\n\n',e=globalTab2,i="inline"}return n+=e+'<div class="name '+i+'" tabindex="0">',n+=t.itemName,t.showBrandName&&null!==t.brandName&&""!=t.brandName&&(n+=" - "+t.brandName),n+="</div>\n",t.showServingUnitQuantityTextbox&&(null===t.valueServingSizeUnit||""==t.valueServingSizeUnit||""!==t.valueServingSizeUnit&&null!==t.valueServingSizeUnit&&t.originalServingUnitQuantity<=0)&&(n+=globalTab1+'</div><!-- closing class="cf" -->\n\n'),n}function sevingUnitQuantityHtmlLegacy(t){let e=!1,n=!1,i="";if(t.showServingUnitQuantity){if(i+=globalTab1+'<div class="serving" tabIndex="0">\n',t.originalServingUnitQuantity>0){let a="",s="";if(i+=globalTab2+'<div class="cf">\n',i+=globalTab3+'<div class="servingSizeText fl">'+t.textServingSize+"</div>\n",i+=t.showServingUnitQuantityTextbox?"":globalTab3+'<div class="servingUnitQuantity fl" itemprop="servingSize">'+roundLoDash(t.originalServingUnitQuantity,t.decimalPlacesForNutrition)+"</div>\n",""!==t.valueServingSizeUnit&&null!==t.valueServingSizeUnit){if(t.showServingUnitQuantityTextbox&&null!==t.valueServingSizeUnit&&""!=t.valueServingSizeUnit){let o="unitQuantityBox";a="unitHasTextbox",s="gramsHasTextbox",i+=globalTab3+'<div class="rel servingSizeField fl">\n',t.hideTextboxArrows?o="unitQuantityBox arrowsAreHidden":(i+=globalTab4+'<div class="setter">\n',i+=globalTab5+'<a href="'+t.textAriaLabelIncreaseQuantityArrow+'" class="unitQuantityUp" ',i+='aria-label="'+t.textAriaLabelIncreaseQuantityArrow+'" rel="nofollow" tabindex="0"></a>\n',i+=globalTab5+'<a href="'+t.textAriaLabelDecreaseQuantityArrow+'" class="unitQuantityDown" ',i+='aria-label="'+t.textAriaLabelDecreaseQuantityArrow+'" rel="nofollow" tabindex="0"></a>\n',i+=globalTab4+'</div><!-- closing class="setter" -->\n\n'),i+=globalTab4+'<input type="text" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" class="'+o+'" aria-label="'+t.textAriaLabelChangeQuantityTextbox+'">\n',i+=globalTab4+'<input type="hidden" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" id="nixLabelBeforeQuantity">\n',i+=globalTab3+'</div><!-- closing class="servingSizeField" -->\n\n'}else t.originalServingUnitQuantity>0&&t.showServingUnitQuantityTextbox&&(i+=globalTab3+'<div class="servingUnitQuantity" itemprop="servingSize">'+roundLoDash(t.originalServingUnitQuantity,t.decimalPlacesForNutrition)+"</div>\n");i+=globalTab3+'<div class="servingUnit fl '+a+'" tabindex="0">'+t.valueServingSizeUnit+(1==t.legacyVersion?"</div>\n":"")}else t.originalServingUnitQuantity>0&&t.showServingUnitQuantityTextbox&&(i+=globalTab3+'<div class="servingUnitQuantity fl" itemprop="servingSize">'+roundLoDash(t.originalServingUnitQuantity,t.decimalPlacesForNutrition)+"</div>\n");t.showServingWeightGrams&&t.valueServingWeightGrams>0&&(i+=globalTab3+"<"+(1==t.legacyVersion?"div":"span")+' class="servingWeightGrams '+(1==t.legacyVersion?"fl":"")+" "+s+'">(<span itemprop="servingSize">'+roundLoDash(t.valueServingWeightGrams,t.decimalPlacesForNutrition)+t.unitServingWeight+"</span>)\n</"+(1==t.legacyVersion?"div":"span")+">\n"),i+=globalTab3+(1==t.legacyVersion?"":"</div>\n"),i+=globalTab2+'</div><!-- closing class="cf" -->\n\n'}else e=!0;t.showServingsPerContainer&&t.valueServingPerContainer>0?i+=globalTab2+'<div tabindex="0">'+t.textServingsPerContainer+" "+roundLoDash(t.valueServingPerContainer,t.decimalPlacesForNutrition)+"</div>\n":n=!0,i+=globalTab1+'</div><!-- closing class="serving" -->\n\n'}return{servingSizeIsHidden:e,servingContainerIsHidden:n,nutritionLabel:i}}function calorieDietHtmlLegacy(t){let e=globalTab2+'<table class="tblCalorieDiet" aria-hidden="true">\n';return e+=globalTab3+"<thead>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<th> </th>\n",e+=globalTab5+"<th>"+t.textCalories+"</th>\n",e+=globalTab5+"<th>"+t.valueCol1CalorieDiet+"</th>\n",e+=globalTab5+"<th>"+t.valueCol2CalorieDiet+"</th>\n",e+=globalTab4+"</tr>\n",e+=globalTab3+"</thead>\n",e+=globalTab3+"<tbody>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<td>"+t.textTotalFat+"</td>\n",e+=globalTab5+"<td>"+t.textCalorieDietHtmlLegacyLessThan+"</td>\n",e+=globalTab5+"<td>"+t.valueCol1DietaryTotalFat+"g</td>\n",e+=globalTab5+"<td>"+t.valueCol2DietaryTotalFat+"g</td>\n",e+=globalTab4+"</tr>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<td> "+t.textSatFat+"</td>\n",e+=globalTab5+"<td>"+t.textCalorieDietHtmlLegacyLessThan+"</td>\n",e+=globalTab5+"<td>"+t.valueCol1DietarySatFat+"g</td>\n",e+=globalTab5+"<td>"+t.valueCol2DietarySatFat+"g</td>\n",e+=globalTab4+"</tr>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<td>"+t.textCholesterol+"</td>\n",e+=globalTab5+"<td>"+t.textCalorieDietHtmlLegacyLessThan+"</td>\n",e+=globalTab5+"<td>"+t.valueCol1DietaryCholesterol+"mg</td>\n",e+=globalTab5+"<td>"+t.valueCol2DietaryCholesterol+"mg</td>\n",e+=globalTab4+"</tr>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<td>"+t.textSodium+"</td>\n",e+=globalTab5+"<td>"+t.textCalorieDietHtmlLegacyLessThan+"</td>\n",e+=globalTab5+"<td>"+t.valueCol1DietarySodium+"mg</td>\n",e+=globalTab5+"<td>"+t.valueCol2DietarySodium+"mg</td>\n",e+=globalTab4+"</tr>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<td>"+t.textPotassium+"</td>\n",e+=globalTab5+"<td>"+t.textCalorieDietHtmlLegacyLessThan+"</td>\n",e+=globalTab5+"<td>"+t.valueCol1DietaryPotassium+"mg</td>\n",e+=globalTab5+"<td>"+t.valueCol2DietaryPotassium+"mg</td>\n",e+=globalTab4+"</tr>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<td>"+t.textTotalCarb+"</td>\n",e+=globalTab5+"<td> </td>\n",e+=globalTab5+"<td>"+t.valueCol1DietaryTotalCarb+"g</td>\n",e+=globalTab5+"<td>"+t.valueCol2DietaryTotalCarb+"g</td>\n",e+=globalTab4+"</tr>\n",e+=globalTab4+"<tr>\n",e+=globalTab5+"<td> "+t.textCalorieDietHtmlLegacyDietary+"</td>\n",e+=globalTab5+"<td> </td>\n",e+=globalTab5+"<td>"+t.valueCol1Dietary+"g</td>\n",e+=globalTab5+"<td>"+t.valueCol2Dietary+"g</td>\n",e+=globalTab4+"</tr>\n",(e+=globalTab3+"</tbody>\n")+globalTab2+"</table>\n"}function ingredientsHtmlLegacy(t){let e="";return t.hidePercentDailyValues||(e+=globalTab3+"<br/>\n"),e+=globalTab3+'<div class="'+(t.hidePercentDailyValues?"ingredientListDivHiddenDailyValues":"ingredientListDiv")+'" tabindex="0">\n',e+=globalTab4+'<strong class="active" id="ingredientList">'+t.ingredientLabel+"</strong>\n",(e+=globalTab4+t.ingredientList+"\n")+globalTab3+'</div><!-- closing class="ingredientListDiv" -->\n\n'}function disclaimerHtmlLegacy(t){let e=globalTab3+"<br/>\n\n";return e+=globalTab3+'<div id="calcDisclaimer">\n',e+=globalTab4+'<span id="calcDisclaimerText" tabindex="0">'+t.valueDisclaimer+"</span>\n",(e+=globalTab3+'</div><!-- closing class="calcDisclaimer" -->\n\n')+globalTab3+"<br/>\n\n"}function bottomLinkHtmlLegacy(t){let e=globalTab1+'<div class="spaceAbove"></div>\n';return(e+=globalTab1+'<a href="'+t.urlBottomLink+'" target="_newSite" class="homeLinkPrint">'+t.nameBottomLink+"</a>\n")+globalTab1+'<div class="spaceBelow"></div>\n'}function generateAttributeWithoutPercentageHtmlLegacy($localSettings,valueIndex,unitIndex,naIndex,attributeText,localTabValue,lineClass,attributeDisplayType,itemPropValue,localExtraTab,roundFunctionName){let localNaValue='<font class="notApplicable" aria-hidden="true">'+$localSettings.textNotApplicable+' </font><font class="sr-only">'+$localSettings.textDataNotAvailable+"</font>\n",localNutritionLabel=localTabValue+'<div class="'+lineClass+'" tabindex="0">';return 1==attributeDisplayType?localNutritionLabel+="<strong>"+$localSettings[attributeText]+'</strong> <span itemprop="'+itemPropValue+'">':2==attributeDisplayType?localNutritionLabel+=$localSettings[attributeText]+" ":3==attributeDisplayType?localNutritionLabel+=localExtraTab+$localSettings[attributeText]+' <span itemprop="'+itemPropValue+'">':4==attributeDisplayType?localNutritionLabel+=$localSettings[attributeText]+' <span itemprop="'+itemPropValue+'">':5==attributeDisplayType&&(localNutritionLabel+=localExtraTab+'<div class="dv">'),localNutritionLabel+=$localSettings[naIndex]?localNaValue:($localSettings.allowFDARounding?eval(roundFunctionName)($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition):roundLoDash($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition))+$localSettings[unitIndex],1==attributeDisplayType||4==attributeDisplayType?localNutritionLabel+="</span></div>\n":2==attributeDisplayType?localNutritionLabel+="</div>\n":3==attributeDisplayType?localNutritionLabel+="\n"+localTabValue+"</span></div>\n":5==attributeDisplayType&&(localNutritionLabel+="</div>\n",localNutritionLabel+=localExtraTab+$localSettings[attributeText]+"\n",localNutritionLabel+=localTabValue+"</div>\n"),localNutritionLabel}function generateAttributeWithPercentageHtmlLegacy($localSettings,valueIndex,dailyValueIndex,unitIndex,naIndex,attributeTexts,lineClass,itemPropValue,roundFunctionName,roundFunctionRuleName,boldName,showPercentageCode){let localNaValue='<font class="notApplicable" aria-hidden="true">'+$localSettings.textNotApplicable+' </font><font class="sr-only">'+$localSettings.textDataNotAvailable+"</font>\n",localNutritionLabel=globalTab1+'<div class="'+lineClass+'" tabindex="0">\n';return boldName?localNutritionLabel+=globalTab2+"<strong>"+$localSettings[attributeTexts]+'</strong> <span itemprop="'+itemPropValue+'">':localNutritionLabel+=globalTab2+$localSettings[attributeTexts]+' <span itemprop="'+itemPropValue+'">',localNutritionLabel+=($localSettings[naIndex]?localNaValue:($localSettings.allowFDARounding?eval(roundFunctionName)($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition):roundLoDash($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition))+$localSettings[unitIndex])+"\n",!$localSettings.hidePercentDailyValues&&showPercentageCode&&(localNutritionLabel+=globalTab2+'<div class="dv">',localNutritionLabel+=$localSettings[naIndex]?localNaValue:"<strong>"+roundLoDash(($localSettings.allowFDARounding?eval(roundFunctionRuleName)($localSettings[valueIndex]):$localSettings[valueIndex])/(0==$localSettings[dailyValueIndex]?1:$localSettings[dailyValueIndex]*roundLoDash(parseFloat($localSettings.calorieIntake)/2e3,2))*100,$localSettings.decimalPlacesForDailyValues)+'</strong>% <span class="sr-only">'+$localSettings.textDailyValues+"</span>",localNutritionLabel+="</div>\n"),localNutritionLabel+(globalTab1+"</span></div>\n")}function generateAttributeHtml2018Version($localSettings,valueIndex,unitIndex,naIndex,attributeText,itemPropValue,topDivClass,showPercentageCode,roundFunctionName,roundFunctionRuleName,labelClass,valueClass,dailyValueIndex){let localNaValue='<font class="notApplicable" aria-hidden="true">'+$localSettings.textNotApplicable+' </font><font class="sr-only">'+$localSettings.textDataNotAvailable+"</font>\n",localNutritionLabel=globalTab1+'<div class="'+topDivClass+'" tabindex="0">\n';if("valueAddedSugars"!=valueIndex?(localNutritionLabel+=globalTab2+'<span class="'+labelClass+'">',localNutritionLabel+=$localSettings[attributeText],localNutritionLabel+="</span>\n",localNutritionLabel+=globalTab2+'<span class="'+valueClass+'" itemprop="'+itemPropValue+'">',localNutritionLabel+=$localSettings[naIndex]?localNaValue:($localSettings.allowFDARounding?eval(roundFunctionName)($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition):roundLoDash($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition))+$localSettings[unitIndex],localNutritionLabel+="</span>\n"):(localNutritionLabel+=globalTab2+'<span class="'+labelClass+'">\n',localNutritionLabel+=$localSettings.textAddedSugars1+"\n",localNutritionLabel+=globalTab3+'<span class="'+valueClass+'" itemprop="'+itemPropValue+'">',localNutritionLabel+=$localSettings[naIndex]?localNaValue:($localSettings.allowFDARounding?eval(roundFunctionName)($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition):roundLoDash($localSettings[valueIndex],$localSettings.decimalPlacesForNutrition))+$localSettings[unitIndex],localNutritionLabel+="</span>\n",localNutritionLabel+=$localSettings.textAddedSugars2,localNutritionLabel+="</span>\n"),showPercentageCode&&!$localSettings.hidePercentDailyValues){if(localNutritionLabel+=globalTab2+'<span class="nf-highlight nf-pr">',-1!==$.inArray(unitIndex,["unitVitaminD_base","unitCalcium_base","unitIron_base","unitPotassium_base"])){let dvDivisor=0==$localSettings[dailyValueIndex]?1:$localSettings[dailyValueIndex]*roundLoDash(parseFloat($localSettings.calorieIntake)/2e3,2),computedPercentDVValue=($localSettings.allowFDARounding?eval(roundFunctionRuleName)($localSettings[valueIndex]):$localSettings[valueIndex])/dvDivisor*100;localNutritionLabel+=$localSettings[naIndex]?localNaValue:$localSettings.allowFDARounding?roundVitaminsCalciumIron($localSettings[valueIndex]/dvDivisor*100):roundLoDash(computedPercentDVValue,$localSettings.decimalPlacesForDailyValues)}else localNutritionLabel+=$localSettings[naIndex]?localNaValue:roundLoDash(($localSettings.allowFDARounding?eval(roundFunctionRuleName)($localSettings[valueIndex]):$localSettings[valueIndex])/(0==$localSettings[dailyValueIndex]?1:$localSettings[dailyValueIndex]*roundLoDash(parseFloat($localSettings.calorieIntake)/2e3,2))*100,$localSettings.decimalPlacesForDailyValues);localNutritionLabel+='% <span class="sr-only">'+$localSettings.textDailyValues+"</span>",localNutritionLabel+="</span>\n"}return localNutritionLabel+(globalTab1+"</div>\n")}function ingredientsHtml2018Version(t){let e="";return t.hidePercentDailyValues||(e+=globalTab3+"<br/>\n\n"),e+=globalTab3+'<div class="'+(t.hidePercentDailyValues?"nf-ingredientListDivHiddenDailyValues":"nf-ingredientListDiv")+'" tabindex="0">\n',e+=globalTab4+'<strong class="active" id="nf-ingredientList">'+t.ingredientLabel+"</strong>\n",(e+=globalTab4+t.ingredientList+"\n")+globalTab3+'</div><!-- closing class="nf-ingredientListDiv" -->\n\n'}function disclaimerHtml2018Version(t){let e=globalTab3+"<br/>\n\n";return e+=globalTab3+'<div id="nf-calcDisclaimer">\n',e+=globalTab4+'<span id="nf-calcDisclaimerText" tabindex="0">'+t.valueDisclaimer+"</span>\n",(e+=globalTab3+'</div><!-- closing class="nf-calcDisclaimer" -->\n\n')+globalTab3+"<br/>\n\n"}function bottomLinkHtml2018Version(t){let e=globalTab1+'<div class="nf-spaceAbove"></div>\n';return(e+=globalTab1+'<a href="'+t.urlBottomLink+'" target="_newSite" class="nf-homeLinkPrint">'+t.nameBottomLink+"</a>\n")+globalTab1+'<div class="nf-spaceBelow"></div>\n'}function generate2018HtmlAndComputeValueGivenThePercentage(t,e,n,i,a,s,o,l,r){let u='<font class="notApplicable" aria-hidden="true">'+t.textNotApplicable+' </font><font class="sr-only">'+t.textDataNotAvailable+"</font>\n",g='<div class="nf-vitamin-column'+(r?" nf-vitamin-column-last":"")+'" tabindex="0">\n';return g+=t[o]+" ",(g+=(t[s]?u:roundLoDash(t[e]/100*t[n],t.decimalPlacesForDailyValues)+t[i]+(l?' <span class="nf-pr">'+roundLoDash(t[e],t.decimalPlacesForDailyValues)+t[a]+"</span>":""))+"\n")+"</div>\n"}function itemNameHtml2018(t){let e="",n="";if(t.showServingUnitQuantityTextbox){if(null===t.valueServingSizeUnit||""==t.valueServingSizeUnit||""!==t.valueServingSizeUnit&&null!==t.valueServingSizeUnit&&t.originalServingUnitQuantity<=0){let i="",a="nf-unitQuantityBox nf-modifier-field";t.hideTextboxArrows?(a="nf-unitQuantityBox nf-modifier-field nf-arrowsAreHidden",i="nf-fixed-serving "):(n+=globalTab3+'<div class="nf-arrows">\n',n+=globalTab4+'<div class="nf-unitQuantityUp nf-arrow-up" aria-label="'+t.textAriaLabelIncreaseQuantityArrow+'" ',n+='rel="nofollow" tabindex="0"></div>\n',n+=globalTab4+'<div class="nf-unitQuantityDown nf-arrow-down" aria-label="'+t.textAriaLabelDecreaseQuantityArrow+'" ',n+='rel="nofollow" tabindex="0"></div>\n',n+=globalTab3+'</div><!-- closing class="nf-arrows v1" -->\n\n'),n+=globalTab3+'<input type="text" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" class="'+a+'" data-role="none" aria-label="'+t.textAriaLabelChangeQuantityTextbox+'">\n',n+=globalTab3+'<input type="hidden" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" id="nf-nixLabelBeforeQuantity">\n\n',e=i}else t.showServingUnitQuantity||(e+="no-indent")}else e+="no-indent";return n+=globalTab3+'<div class="nf-serving-unit-name '+e+'" tabindex="0">\n',t.showServingUnitQuantity&&t.originalServingUnitQuantity>0&&""!==t.valueServingSizeUnit&&null!==t.valueServingSizeUnit&&(n+=globalTab4+t.valueServingSizeUnit+"\n",t.showServingWeightGrams&&t.valueServingWeightGrams>0&&(n+=globalTab4+'(<span itemprop="servingSize">'+roundLoDash(t.valueServingWeightGrams,t.decimalPlacesForNutrition)+t.unitServingWeight+"</span>)\n")),n+=globalTab4+'<div class="nf-item-name block">\n',n+=globalTab5+t.itemName+"\n",t.showBrandName&&null!==t.brandName&&""!=t.brandName&&(n+=" - "+t.brandName),(n+="\n"+globalTab4+"</div>\n")+globalTab3+"</div>\n"}function sevingUnitQuantityHtml2018(t){let e=!1,n=!1,i="";if(t.showServingUnitQuantity){if(t.originalServingUnitQuantity>0){let a=!1;if(i+=globalTab3+'<div tabIndex="0"><!-- opening for serving size div -->\n',i+=globalTab4+t.textServingSize,i+=t.showServingUnitQuantityTextbox?"":' <span itemprop="servingSize">'+roundLoDash(t.originalServingUnitQuantity,t.decimalPlacesForNutrition)+" </span>\n",""!==t.valueServingSizeUnit&&null!==t.valueServingSizeUnit){if(t.showServingUnitQuantityTextbox&&null!==t.valueServingSizeUnit&&""!=t.valueServingSizeUnit){let s="nf-unitQuantityBox nf-modifier-field";a=!0,i+="\n"+globalTab3+"</div><!-- closing for serving size div -->\n\n",t.hideTextboxArrows?s="nf-unitQuantityBox nf-modifier-field nf-arrowsAreHidden":(i+=globalTab5+'<div class="nf-arrows"><!-- opening class="nf-arrows" -->\n',i+=globalTab6+'<div class="nf-unitQuantityUp nf-arrow-up" aria-label="'+t.textAriaLabelIncreaseQuantityArrow+'" ',i+='rel="nofollow" tabindex="0"></div>\n',i+=globalTab6+'<div class="nf-unitQuantityDown nf-arrow-down" aria-label="'+t.textAriaLabelDecreaseQuantityArrow+'" ',i+='rel="nofollow" tabindex="0"></div>\n',i+=globalTab5+'</div><!-- closing class="nf-arrows v2" -->\n\n'),i+=globalTab5+'<input type="text" data-role="none" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" class="'+s+'" aria-label="'+t.textAriaLabelChangeQuantityTextbox+'">\n',i+=globalTab5+'<input type="hidden" value="'+roundLoDash(t.valueServingUnitQuantity,t.decimalPlacesForQuantityTextbox)+'" id="nf-nixLabelBeforeQuantity">\n\n'}else t.originalServingUnitQuantity>0&&t.showServingUnitQuantityTextbox&&(i+=' <span itemprop="servingSize">'+roundLoDash(t.originalServingUnitQuantity,t.decimalPlacesForNutrition)+"</span>\n");t.showItemName||(i+=globalTab5+'<div class="nf-serving-unit-name" tabindex="0">\n',i+=globalTab6+t.valueServingSizeUnit+"\n",t.showServingWeightGrams&&t.valueServingWeightGrams>0&&(i+=globalTab6+"("+roundLoDash(t.valueServingWeightGrams,t.decimalPlacesForNutrition)+t.unitServingWeight+")\n"),i+=globalTab5+"</div>\n")}else t.originalServingUnitQuantity>0&&t.showServingUnitQuantityTextbox&&(i+=' <span itemprop="servingSize">'+roundLoDash(t.originalServingUnitQuantity,t.decimalPlacesForNutrition)+"</span>\n",(""==t.valueServingSizeUnit||null===t.valueServingSizeUnit)&&t.showServingWeightGrams&&t.valueServingWeightGrams>0&&(i+=globalTab4+"("+roundLoDash(t.valueServingWeightGrams,t.decimalPlacesForNutrition)+t.unitServingWeight+")\n"));a||(i+=globalTab3+"</div><!-- closing for serving size div -->\n\n")}else e=!0}else!t.showServingUnitQuantity&&t.showOnlyTheTextServingSize&&(i+=globalTab3+'<div tabIndex="0" class="nf-line">\n',i+=globalTab4+t.textServingSize,i+=globalTab3+"</div>\n\n");return{servingSizeIsHidden:e,servingContainerIsHidden:n,nutritionLabel:i}}function generateAttributeForUK($localSettings,valueIndex,dailyValueIndex,unitIndex,naIndex,attributeTexts,itemPropValue,roundFunctionName,roundFunctionRuleName,showPercentageCode,indentedName){let localNaValue='<font class="notApplicable" aria-hidden="true">'+$localSettings.textNotApplicable+' </font><font class="sr-only">'+$localSettings.textDataNotAvailable+"</font>\n",localNutritionLabel=globalTab2+'<tr tabindex="0">\n',nameClass="",nutritionValueLocal=$localSettings[valueIndex];return indentedName&&(nameClass="uk_nf-indent"),localNutritionLabel+=globalTab3+'<td class="'+nameClass+'">',""!=String(attributeTexts)&&(localNutritionLabel+=$localSettings[attributeTexts]),localNutritionLabel+="</td>\n","valueCalories"==valueIndex&&"unitEnergy_kj"==unitIndex?nutritionValueLocal*=4.184:"valueSodium"==valueIndex&&(nutritionValueLocal*=.0025),localNutritionLabel+=globalTab3+"<td>",localNutritionLabel+=$localSettings[naIndex]?localNaValue:($localSettings.allowFDARounding?"valueCalories"==valueIndex?eval(roundFunctionName)(nutritionValueLocal/$localSettings.valueServingWeightGrams*100,1):eval(roundFunctionName)(nutritionValueLocal/$localSettings.valueServingWeightGrams*100):roundLoDash(nutritionValueLocal/$localSettings.valueServingWeightGrams*100,$localSettings.decimalPlacesForNutrition))+$localSettings[unitIndex],localNutritionLabel+="</td>\n",localNutritionLabel+=globalTab3+'<td itemprop="'+itemPropValue+'">',localNutritionLabel+=$localSettings[naIndex]?localNaValue:($localSettings.allowFDARounding?"valueCalories"==valueIndex?eval(roundFunctionName)(nutritionValueLocal,1):eval(roundFunctionName)(nutritionValueLocal):roundLoDash(nutritionValueLocal,$localSettings.decimalPlacesForNutrition))+$localSettings[unitIndex],localNutritionLabel+="</td>\n",localNutritionLabel+=globalTab3+'<td aria-hidden="true">',!$localSettings.hidePercentDailyValues&&showPercentageCode&&(localNutritionLabel+=$localSettings[naIndex]?localNaValue:roundLoDash(($localSettings.allowFDARounding?"valueCalories"==valueIndex?eval(roundFunctionRuleName)(nutritionValueLocal,1):eval(roundFunctionRuleName)(nutritionValueLocal):nutritionValueLocal)/(0==$localSettings[dailyValueIndex]?1:$localSettings[dailyValueIndex]*roundLoDash(parseFloat($localSettings.calorieIntake)/2e3,2))*100,$localSettings.decimalPlacesForDailyValues)+"%"),localNutritionLabel+"</td>\n"+globalTab2+"</tr>\n"}function referenceIntakeHtmlUKVersion(t){let e=globalTab6+'<div class="referenceIntake" tabindex="0">\n';return e+=globalTab7+"* "+t.textUKReferenceIntake+" ",e+="("+roundToNearestNum(4.184*t.calorieIntake,100)+t.unitEnergy_kj,(e+="/"+t.calorieIntake+t.unitEnergy_kcal+")\n")+globalTab6+'</div>\n<div class="uk_nf-spaceBelow"></div>\n'}function ingredientsHtmlUKVersion(t){let e=globalTab6+'<div class="uk_nf-ingredientListDiv" tabindex="0">\n';return(e+=globalTab7+'<strong class="active" id="uk_nf-ingredient-statement">'+t.ingredientLabel+"</strong> "+t.ingredientList+"\n")+globalTab6+'</div><br/><!-- closing class="uk_nf-ingredientListDiv" -->\n\n'}function disclaimerHtmlUKVersion(t){let e=globalTab6+'<div id="uk_nf-calcDisclaimer">\n';return(e+=globalTab7+'<span id="uk_nf-disclaimer" tabindex="0">'+t.valueDisclaimer+"</span>\n")+globalTab6+'</div><br/><!-- closing id="uk_nf-calcDisclaimer" -->\n\n'}function bottomLinkHtmlUKVersion(t){let e=globalTab6+'<div class="uk_nf-spaceAbove"></div>\n';return(e+=globalTab6+'<a href="'+t.urlBottomLink+'" target="_newSite" class="uk_nf-homeLinkPrint">'+t.nameBottomLink+"</a>\n")+globalTab6+'<div class="uk_nf-spaceBelow"></div>\n'}function createRound(t){let e=Math[t];return(t,n)=>{if(n=null===n?0:n>=0?Math.min(n,292):Math.max(n,-292)){let i=`${t}e`.split("e"),a=e(`${i[0]}e${+i[1]+n}`);return i=`${a}e`.split("e"),+`${i[0]}e${+i[1]-n}`}return e(t)}}$.fn.nutritionLabel=function(t,e){if("object"==typeof t)init(e=t,$(this));else if("string"==typeof t&&""!==t){if("destroy"===t)new NutritionLabel().destroy($(this));else if("hide"===t)new NutritionLabel().hide($(this));else if("show"===t)new NutritionLabel().show($(this));else{let n=[],i=this.each(function(){let i=$(this).data("_nutritionLabel");i?void 0!==$.fn.nutritionLabel.defaultSettings[t]&&(void 0!==e?(i.settings[t]=e,init(i.settings,$(this))):n.push(i.settings[t])):void 0!==$.fn.nutritionLabel.defaultSettings[t]&&void 0!==e&&($.fn.nutritionLabel.defaultSettings[t]=e,init(null,$(this)))});return 1===n.length?n[0]:n.length>0?n:i}}else(void 0===t||""===t)&&init(e,$(this))},$.fn.nutritionLabel.defaultSettings={width:280,allowCustomWidth:!1,widthCustom:"auto",allowNoBorder:!1,allowFDARounding:!1,allowGoogleAnalyticsEventLog:!1,gooleAnalyticsFunctionName:"ga",userFunctionNameOnQuantityChange:null,userFunctionOnQuantityChange:null,hideNotApplicableValues:!1,hidePercentDailyValues:!1,brandName:"Brand where this item belongs to",scrollLongIngredients:!1,scrollHeightComparison:100,scrollHeightPixel:95,decimalPlacesForNutrition:1,decimalPlacesForDailyValues:0,decimalPlacesForQuantityTextbox:1,scrollLongItemName:!0,scrollLongItemNamePixel:36,scrollLongItemNamePixel2018Override:34,useBaseValueFor2018LabelAndNotDVPercentage:!1,showBottomLink:!1,urlBottomLink:"http://www.nutritionix.com",nameBottomLink:"Nutritionix",valueServingUnitQuantity:1,valueServingSizeUnit:"",showServingUnitQuantityTextbox:!0,itemName:"Item / Ingredient Name",showServingUnitQuantity:!0,hideTextboxArrows:!1,showOnlyTheTextServingSize:!1,originalServingUnitQuantity:0,nutritionValueMultiplier:1,totalContainerQuantity:1,calorieIntake:2e3,dailyValueTotalFat:65,dailyValueSatFat:20,dailyValueCholesterol:300,dailyValueSodium:2400,dailyValuePotassium:3500,dailyValuePotassium_2018:4700,dailyValueCarb:300,dailyValueFiber:25,dailyValueCalcium:1300,dailyValueIron:18,dailyValueVitaminD:20,dailyValueAddedSugar:50,dailyValueSugar:100,dailyValueEnergyKcal:2e3,dailyValueProtein:50,dailyValueSalt:6,showCalories:!0,showFatCalories:!0,showTotalFat:!0,showSatFat:!0,showTransFat:!0,showPolyFat:!1,showMonoFat:!1,showCholesterol:!0,showSodium:!0,showPotassium:!1,showPotassium_2018:!0,showTotalCarb:!0,showFibers:!0,showSugars:!0,showAddedSugars:!0,showSugarAlcohol:!1,showProteins:!0,showVitaminA:!0,showVitaminC:!0,showVitaminD:!0,showCalcium:!0,showIron:!0,showCaffeine:!0,showServingWeightGrams:!0,showDailyTotalFat:!0,showDailySatFat:!0,showDailyCholesterol:!0,showDailySodium:!0,showDailyPotassium:!0,showDailyPotassium_2018:!0,showDailyTotalCarb:!0,showDailyFibers:!0,showDailySugars:!1,showDailyAddedSugars:!0,showDailyVitaminD:!0,showDailyCalcium:!0,showDailyIron:!0,showDailyProtein:!0,showDailyEnergy:!0,showAmountPerServing:!0,showServingsPerContainer:!1,showItemName:!0,showItemNameForUK:!1,showBrandName:!1,showIngredients:!0,showCalorieDiet:!1,showCustomFooter:!1,indentSugarAndRemoveBoldStyleFor2018Label:!0,boldCaffeine:!0,showDisclaimer:!1,scrollDisclaimerHeightComparison:100,scrollDisclaimer:95,valueDisclaimer:"Please note that these nutrition values are estimated based on our standard serving portions. As food servings may have a slight variance each time you visit, please expect these values to be with in 10% +/- of your actual meal. If you have any questions about our nutrition calculator, please contact Nutritionix.",ingredientLabel:"INGREDIENTS:",valueCustomFooter:"",naCalories:!1,naFatCalories:!1,naTotalFat:!1,naSatFat:!1,naTransFat:!1,naPolyFat:!1,naMonoFat:!1,naCholesterol:!1,naSodium:!1,naPotassium:!1,naPotassium_2018:!1,naTotalCarb:!1,naFibers:!1,naSugars:!1,naAddedSugars:!1,naSugarAlcohol:!1,naProteins:!1,naVitaminA:!1,naVitaminC:!1,naVitaminD:!1,naCalcium:!1,naIron:!1,naCaffeine:!1,valueServingWeightGrams:0,valueServingPerContainer:1,valueCalories:0,valueFatCalories:0,valueTotalFat:0,valueSatFat:0,valueTransFat:0,valuePolyFat:0,valueMonoFat:0,valueCholesterol:0,valueSodium:0,valuePotassium:0,valuePotassium_2018:0,valueTotalCarb:0,valueFibers:0,valueSugars:0,valueAddedSugars:0,valueSugarAlcohol:0,valueProteins:0,valueVitaminA:0,valueVitaminC:0,valueVitaminD:0,valueCalcium:0,valueIron:0,valueCaffeine:0,unitCalories:"",unitFatCalories:"",unitTotalFat:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitSatFat:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitTransFat:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitPolyFat:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitMonoFat:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitCholesterol:'<span aria-hidden="true">mg</span><span class="sr-only"> milligrams</span>',unitSodium:'<span aria-hidden="true">mg</span><span class="sr-only"> milligrams</span>',unitPotassium:'<span aria-hidden="true">mg</span><span class="sr-only"> milligrams</span>',unitPotassium_base:'<span aria-hidden="true">mg</span><span class="sr-only"> milligrams</span>',unitPotassium_percent:"%",unitTotalCarb:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitFibers:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitSugars:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitAddedSugars:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitSugarAlcohol:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitProteins:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitVitaminA:"%",unitVitaminC:"%",unitVitaminD_base:'<span aria-hidden="true">mcg</span><span class="sr-only"> micrograms</span>',unitVitaminD_percent:"%",unitCalcium:"%",unitCalcium_base:'<span aria-hidden="true">mg</span><span class="sr-only"> milligrams</span>',unitCalcium_percent:"%",unitIron:"%",unitIron_base:'<span aria-hidden="true">mg</span><span class="sr-only"> milligrams</span>',unitIron_percent:"%",unitServingWeight:'<span aria-hidden="true">g</span><span class="sr-only"> grams</span>',unitEnergy_kj:"kj",unitEnergy_kcal:"kcal",unitSalt:"g",unitGramOrMlForThePer100Part:"g",unitCaffeine:"mg",valueCol1CalorieDiet:2e3,valueCol2CalorieDiet:2500,valueCol1DietaryTotalFat:0,valueCol2DietaryTotalFat:0,valueCol1DietarySatFat:0,valueCol2DietarySatFat:0,valueCol1DietaryCholesterol:0,valueCol2DietaryCholesterol:0,valueCol1DietarySodium:0,valueCol2DietarySodium:0,valueCol1DietaryPotassium:0,valueCol2DietaryPotassium:0,valueCol1DietaryTotalCarb:0,valueCol2DietaryTotalCarb:0,valueCol1Dietary:0,valueCol2Dietary:0,textNutritionFacts:"Nutrition Facts",textDailyValues:"Daily Value",textServingSize:"Serving Size:",textServingsPerContainer:"Servings Per Container",textAmountPerServing:"Amount Per Serving",textCalories:"Calories",textFatCalories:"Calories from Fat",textTotalFat:"Total Fat",textSatFat:"Saturated Fat",textTransFat:"<em>Trans</em> Fat",textPolyFat:"Polyunsaturated Fat",textMonoFat:"Monounsaturated Fat",textCholesterol:"Cholesterol",textSodium:"Sodium",textPotassium:"Potassium",textTotalCarb:"Total Carbohydrates",textFibers:"Dietary Fiber",textSugars:"Sugars",textAddedSugars1:"Includes ",textAddedSugars2:" Added Sugars",textSugarAlcohol:"Sugar Alcohol",textProteins:"Protein",textVitaminA:"Vitamin A",textVitaminC:"Vitamin C",textVitaminD:"Vitamin D",textCalcium:"Calcium",textIron:"Iron",textNotApplicable:"-",ingredientList:"None",textPercentDailyPart1:"Percent Daily Values are based on a",textPercentDailyPart2:"calorie diet",textPercentDaily2018VersionPart1:"The % Daily Value (DV) tells you how much a nutrient in a serving of food contributes to a daily diet. ",textPercentDaily2018VersionPart2:" calories a day is used for general nutrition advice.",textGoogleAnalyticsEventCategory:"Nutrition Label",textGoogleAnalyticsEventActionUpArrow:"Quantity Up Arrow Clicked",textGoogleAnalyticsEventActionDownArrow:"Quantity Down Arrow Clicked",textGoogleAnalyticsEventActionTextbox:"Quantity Textbox Changed",textUKTypicalValues:"Typical Values",textUKReferenceIntake:"Reference intake of an average adult",textUKPer100:"Per",textUKDefaultServingNameIfEmpty:"Serving",textDataNotAvailable:"Data not available",textAriaLabelIncreaseQuantityArrow:"Increase the Quantity Arrow",textAriaLabelDecreaseQuantityArrow:"Decrease the Quantity Arrow",textAriaLabelChangeQuantityTextbox:"Change the Quantity Textbox",textCalorieDietHtmlLegacyLessThan:"Less than",textCalorieDietHtmlLegacyDietary:"Dietary",textCaffeine:"Caffeine",showLegacyVersion:!0,showUKVersion:!1,convertEmptyServingNametoServingForUKLabel:!0,legacyVersion:1};let roundLoDash=createRound("round");NutritionLabel.prototype={generateLegacy:function(){let t=this,e="",n="",i=sevingUnitQuantityHtmlLegacy(t.settings),a=i.servingSizeIsHidden,s=i.servingContainerIsHidden,o="addedPadding",l="addedPadding";return t.nutritionLabel?t.nutritionLabel:(t.settings.hideNotApplicableValues&&(t.settings.showCalories=!t.settings.naCalories&&t.settings.showCalories,t.settings.showFatCalories=!t.settings.naFatCalories&&t.settings.showFatCalories,t.settings.showTotalFat=!t.settings.naTotalFat&&t.settings.showTotalFat,t.settings.showSatFat=!t.settings.naSatFat&&t.settings.showSatFat,t.settings.showTransFat=!t.settings.naTransFat&&t.settings.showTransFat,t.settings.showPolyFat=!t.settings.naPolyFat&&t.settings.showPolyFat,t.settings.showMonoFat=!t.settings.naMonoFat&&t.settings.showMonoFat,t.settings.showCholesterol=!t.settings.naCholesterol&&t.settings.showCholesterol,t.settings.showSodium=!t.settings.naSodium&&t.settings.showSodium,t.settings.showPotassium=!t.settings.naPotassium&&t.settings.showPotassium,t.settings.showTotalCarb=!t.settings.naTotalCarb&&t.settings.showTotalCarb,t.settings.showFibers=!t.settings.naFibers&&t.settings.showFibers,t.settings.showSugars=!t.settings.naSugars&&t.settings.showSugars,t.settings.showSugarAlcohol=!t.settings.naSugarAlcohol&&t.settings.showSugarAlcohol,t.settings.showProteins=!t.settings.naProteins&&t.settings.showProteins,t.settings.showVitaminA=!t.settings.naVitaminA&&t.settings.showVitaminA,t.settings.showVitaminC=!t.settings.naVitaminC&&t.settings.showVitaminC,t.settings.showCalcium=!t.settings.naCalcium&&t.settings.showCalcium,t.settings.showIron=!t.settings.naIron&&t.settings.showIron),t.settings.hidePercentDailyValues&&(t.settings.showVitaminA=!1,t.settings.showVitaminC=!1,t.settings.showCalcium=!1,t.settings.showIron=!1),t.settings.allowNoBorder&&(e="border: 0;"),n='<div itemscope itemtype="http://schema.org/NutritionInformation" class="nutritionLabel" role="region" aria-label="nutrition label" style="'+e,t.settings.allowCustomWidth?n+=" width: "+t.settings.widthCustom+';">\n':n+=" width: "+t.settings.width+'px;">\n',n+=globalTab1+'<div class="title" tabindex="0">'+t.settings.textNutritionFacts+"</div>\n",t.settings.showItemName&&(n+=itemNameHtmlLegacy(t.settings)),n+=i.nutritionLabel,(t.settings.showItemName||t.settings.showServingUnitQuantity)&&(t.settings.showItemName||!a||!s)||(n+=globalTab1+'<div class="headerSpacer"></div>\n'),n+=globalTab1+'<div class="bar1"></div>\n',t.settings.showAmountPerServing&&(n+=globalTab1+'<div class="addedPadding m" tabindex="0">',n+="<strong>"+t.settings.textAmountPerServing+"</strong>",n+="</div>\n"),n+=globalTab1+'<div class="'+(t.settings.showAmountPerServing?"line":"addedPadding")+' cf">\n',t.settings.showCalories?n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueCalories","unitCalories","naCalories","textCalories",globalTab2,"fl",1,"calories","","roundCalories"):t.settings.showFatCalories&&(n+=globalTab2+"<div> </div>\n"),t.settings.showFatCalories&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueFatCalories","unitFatCalories","naFatCalories","textFatCalories",globalTab2,"ar",2,"","","roundCalories")),n+=globalTab1+"</div>\n",n+=globalTab1+'<div class="bar2"></div>\n',t.settings.hidePercentDailyValues||(o="line",n+=globalTab1+'<div class="addedPadding ar">',n+="<strong>% "+t.settings.textDailyValues+"<sup>*</sup></strong>",n+="</div>\n"),t.settings.showTotalFat&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valueTotalFat","dailyValueTotalFat","unitTotalFat","naTotalFat","textTotalFat",o,"fatContent","roundFat","roundFatRule",!0,t.settings.showDailyTotalFat),o="line"),t.settings.showSatFat&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valueSatFat","dailyValueSatFat","unitSatFat","naSatFat","textSatFat",o+" indent","saturatedFatContent","roundFat","roundFatRule",!1,t.settings.showDailySatFat),o="line"),t.settings.showTransFat&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueTransFat","unitTransFat","naTransFat","textTransFat",globalTab1,o+" indent",3,"transFatContent",globalTab2,"roundFat"),o="line"),t.settings.showPolyFat&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valuePolyFat","unitPolyFat","naPolyFat","textPolyFat",globalTab1,o+" indent",2,"","","roundFat"),o="line"),t.settings.showMonoFat&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueMonoFat","unitMonoFat","naMonoFat","textMonoFat",globalTab1,o+" indent",2,"","","roundFat"),o="line"),t.settings.showCholesterol&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valueCholesterol","dailyValueCholesterol","unitCholesterol","naCholesterol","textCholesterol",o,"cholesterolContent","roundCholesterol","roundCholesterolRule",!0,t.settings.showDailyCholesterol),o="line"),t.settings.showSodium&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valueSodium","dailyValueSodium","unitSodium","naSodium","textSodium",o,"sodiumContent","roundSodium","roundSodiumRule",!0,t.settings.showDailySodium),o="line"),t.settings.showPotassium&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valuePotassium","dailyValuePotassium","unitPotassium","naPotassium","textPotassium",o,"potassiumContent","roundPotassium","roundPotassiumRule",!0,t.settings.showDailyPotassium),o="line"),t.settings.showTotalCarb&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valueTotalCarb","dailyValueCarb","unitTotalCarb","naTotalCarb","textTotalCarb",o,"carbohydrateContent","roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule",!0,t.settings.showDailyTotalCarb),o="line"),t.settings.showFibers&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valueFibers","dailyValueFiber","unitFibers","naFibers","textFibers",o+" indent","fiberContent","roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule",!1,t.settings.showDailyFibers),o="line"),t.settings.showSugars&&(n+=generateAttributeWithPercentageHtmlLegacy(t.settings,"valueSugars","dailyValueSugar","unitSugars","naSugars","textSugars",o+" indent","sugarContent","roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule",!1,t.settings.showDailySugars),o="line"),t.settings.showSugarAlcohol&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueSugarAlcohol","unitSugarAlcohol","naSugarAlcohol","textSugarAlcohol",globalTab1,o+" indent",4,"","","roundCarbFiberSugarProtein"),o="line"),t.settings.showProteins&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueProteins","unitProteins","naProteins","textProteins",globalTab1,o,1,"proteinContent","","roundCarbFiberSugarProtein"),o="line"),n+=globalTab1+'<div class="bar1"></div>\n',t.settings.showVitaminA&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueVitaminA","unitVitaminA","naVitaminA","textVitaminA",globalTab1,l+" vitaminA",5,"",globalTab2,"roundVitaminsCalciumIron"),l="line"),t.settings.showVitaminC&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueVitaminC","unitVitaminC","naVitaminC","textVitaminC",globalTab1,l+" vitaminC",5,"",globalTab2,"roundVitaminsCalciumIron"),l="line"),t.settings.showCalcium&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueCalcium","unitCalcium","naCalcium","textCalcium",globalTab1,l+" calcium",5,"",globalTab2,"roundVitaminsCalciumIron"),l="line"),t.settings.showIron&&(n+=generateAttributeWithoutPercentageHtmlLegacy(t.settings,"valueIron","unitIron","naIron","textIron",globalTab1,l+" iron",5,"",globalTab2,"roundVitaminsCalciumIron"),l="line"),n+=globalTab1+'<div class="dvCalorieDiet '+l+'">\n',n+=globalTab2+'<div class="calorieNote">\n',t.settings.hidePercentDailyValues||(n+=globalTab3+'<span tabindex="0"><span class="star" aria-hidden="true">*</span> '+t.settings.textPercentDailyPart1+" "+t.settings.calorieIntake+" "+t.settings.textPercentDailyPart2+".</span>\n"),t.settings.showIngredients&&(n+=ingredientsHtmlLegacy(t.settings)),t.settings.showDisclaimer&&(n+=disclaimerHtmlLegacy(t.settings)),n+=globalTab2+'</div><!-- closing class="calorieNote" -->\n\n',t.settings.showCalorieDiet&&(n+=calorieDietHtmlLegacy(t.settings)),n+=globalTab1+'</div><!-- closing class="dvCalorieDiet line" -->\n\n',t.settings.showBottomLink&&(n+=bottomLinkHtmlLegacy(t.settings)),t.settings.showCustomFooter&&(n+=globalTab1+'<div class="customFooter" tabindex="0">'+t.settings.valueCustomFooter+"</div>\n"),n+('<div class="naTooltip">'+t.settings.textDataNotAvailable)+'</div>\n</div><!-- closing class="nutritionLabel" -->\n')},generate2018:function(){let t=this,e="",n="",i,a=sevingUnitQuantityHtml2018(t.settings),s=a.servingSizeIsHidden,o=a.servingContainerIsHidden;if(t.nutritionLabel)return t.nutritionLabel;if(t.settings.hideNotApplicableValues&&(t.settings.showCalories=!t.settings.naCalories&&t.settings.showCalories,t.settings.showFatCalories=!t.settings.naFatCalories&&t.settings.showFatCalories,t.settings.showTotalFat=!t.settings.naTotalFat&&t.settings.showTotalFat,t.settings.showSatFat=!t.settings.naSatFat&&t.settings.showSatFat,t.settings.showTransFat=!t.settings.naTransFat&&t.settings.showTransFat,t.settings.showPolyFat=!t.settings.naPolyFat&&t.settings.showPolyFat,t.settings.showMonoFat=!t.settings.naMonoFat&&t.settings.showMonoFat,t.settings.showCholesterol=!t.settings.naCholesterol&&t.settings.showCholesterol,t.settings.showSodium=!t.settings.naSodium&&t.settings.showSodium,t.settings.showPotassium_2018=!t.settings.naPotassium_2018&&t.settings.showPotassium_2018,t.settings.showTotalCarb=!t.settings.naTotalCarb&&t.settings.showTotalCarb,t.settings.showFibers=!t.settings.naFibers&&t.settings.showFibers,t.settings.showSugars=!t.settings.naSugars&&t.settings.showSugars,t.settings.showAddedSugars=!t.settings.naAddedSugars&&t.settings.showAddedSugars,t.settings.showSugarAlcohol=!t.settings.naSugarAlcohol&&t.settings.showSugarAlcohol,t.settings.showProteins=!t.settings.naProteins&&t.settings.showProteins,t.settings.showVitaminD=!t.settings.naVitaminD&&t.settings.showVitaminD,t.settings.showCalcium=!t.settings.naCalcium&&t.settings.showCalcium,t.settings.showIron=!t.settings.naIron&&t.settings.showIron,t.settings.showCaffeine=!t.settings.naCaffeine&&t.settings.showCaffeine),t.settings.hidePercentDailyValues&&(t.settings.showDailyVitaminD=!1,t.settings.showDailyCalcium=!1,t.settings.showDailyIron=!1,t.settings.showDailyPotassium_2018=!1),t.settings.allowNoBorder&&(e="border: 0;"),n='<div itemscope itemtype="http://schema.org/NutritionInformation" class="nf" role="region" aria-label="nutrition label" style="'+e,t.settings.allowCustomWidth?n+=" width: "+t.settings.widthCustom+';">\n':n+=" width: "+t.settings.width+'px;">\n',n+=globalTab1+'<div class="nf-title" tabindex="0">'+t.settings.textNutritionFacts+"</div>\n",i=t.settings.showItemName||!t.settings.showItemName&&s&&o||!t.settings.showItemName&&t.settings.originalServingUnitQuantity>0&&t.settings.showServingWeightGrams&&t.settings.valueServingWeightGrams>0||t.settings.showServingUnitQuantity&&t.settings.originalServingUnitQuantity>0&&t.settings.showServingsPerContainer&&t.settings.valueServingPerContainer>0,t.settings.showServingUnitQuantity&&t.settings.originalServingUnitQuantity>0&&t.settings.showServingsPerContainer&&t.settings.valueServingPerContainer>0&&(n+=globalTab2+'<div class="nf-per-container" tabindex="0">\n',n+=globalTab3+roundLoDash(t.settings.valueServingPerContainer,t.settings.decimalPlacesForNutrition),n+=" "+t.settings.textServingsPerContainer+"\n",n+=globalTab2+"</div>\n\n"),i&&(n+=globalTab1+'<div class="nf-line">\n'),n+=globalTab2+'<div class="nf-serving">\n',n+=a.nutritionLabel,t.settings.showItemName&&(n+=itemNameHtml2018(t.settings)),n+=globalTab2+'</div><!-- end of class="nf-serving" -->\n\n',i&&(n+=globalTab1+'</div><!-- end of class="nf-line" -->\n\n'),n+=globalTab1+'<div class="nf-bar2"></div>\n',n+=globalTab1+'<div class="nf-amount-per-serving" tabindex="0">'+t.settings.textAmountPerServing+"</div>\n",t.settings.showCalories&&(n+=generateAttributeHtml2018Version(t.settings,"valueCalories","unitCalories","naCalories","textCalories","calories","nf-calories",!1,"roundCalories","","","nf-pr","")),n+=globalTab1+'<div class="nf-bar1"></div>\n',t.settings.hidePercentDailyValues||(n+=globalTab1+'<div class="nf-line nf-text-right">\n',n+=globalTab2+'<span class="nf-highlight nf-percent-dv">% '+t.settings.textDailyValues+"*</span>\n",n+=globalTab1+"</div>\n"),t.settings.showTotalFat&&(n+=generateAttributeHtml2018Version(t.settings,"valueTotalFat","unitTotalFat","naTotalFat","textTotalFat","fatContent","nf-line",t.settings.showDailyTotalFat,"roundFat","roundFatRule","nf-highlight","","dailyValueTotalFat")),t.settings.showSatFat&&(n+=generateAttributeHtml2018Version(t.settings,"valueSatFat","unitSatFat","naSatFat","textSatFat","saturatedFatContent","nf-line nf-indent",t.settings.showDailySatFat,"roundFat","roundFatRule","","","dailyValueSatFat")),t.settings.showTransFat&&(n+=generateAttributeHtml2018Version(t.settings,"valueTransFat","unitTransFat","naTransFat","textTransFat","transFatContent","nf-line nf-indent",!1,"roundFat","","","","")),t.settings.showPolyFat&&(n+=generateAttributeHtml2018Version(t.settings,"valuePolyFat","unitPolyFat","naPolyFat","textPolyFat","","nf-line nf-indent",!1,"roundFat","","","","")),t.settings.showMonoFat&&(n+=generateAttributeHtml2018Version(t.settings,"valueMonoFat","unitMonoFat","naMonoFat","textMonoFat","","nf-line nf-indent",!1,"roundFat","","","","")),t.settings.showCholesterol&&(n+=generateAttributeHtml2018Version(t.settings,"valueCholesterol","unitCholesterol","naCholesterol","textCholesterol","cholesterolContent","nf-line",t.settings.showDailyCholesterol,"roundCholesterol","roundCholesterolRule","nf-highlight","","dailyValueCholesterol")),t.settings.showSodium&&(n+=generateAttributeHtml2018Version(t.settings,"valueSodium","unitSodium","naSodium","textSodium","sodiumContent","nf-line",t.settings.showDailySodium,"roundSodium","roundSodiumRule","nf-highlight","","dailyValueSodium")),t.settings.showTotalCarb&&(n+=generateAttributeHtml2018Version(t.settings,"valueTotalCarb","unitTotalCarb","naTotalCarb","textTotalCarb","carbohydrateContent","nf-line",t.settings.showDailyTotalCarb,"roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule","nf-highlight","","dailyValueCarb")),t.settings.showFibers&&(n+=generateAttributeHtml2018Version(t.settings,"valueFibers","unitFibers","naFibers","textFibers","fiberContent","nf-line nf-indent",t.settings.showDailyFibers,"roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule","","","dailyValueFiber")),t.settings.showSugars&&(t.settings.indentSugarAndRemoveBoldStyleFor2018Label?n+=generateAttributeHtml2018Version(t.settings,"valueSugars","unitSugars","naSugars","textSugars","sugarContent","nf-line nf-indent",t.settings.showDailySugars,"roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule","","","dailyValueSugar"):n+=generateAttributeHtml2018Version(t.settings,"valueSugars","unitSugars","naSugars","textSugars","sugarContent","nf-line",t.settings.showDailySugars,"roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule","nf-highlight","","dailyValueSugar")),t.settings.showAddedSugars&&(n+=generateAttributeHtml2018Version(t.settings,"valueAddedSugars","unitAddedSugars","naAddedSugars","textAddedSugars1","","nf-line nf-indent2",t.settings.showDailyAddedSugars,"roundCarbFiberSugarProtein","roundCarbFiberSugarProteinRule","","","dailyValueAddedSugar")),t.settings.showSugarAlcohol&&(n+=generateAttributeHtml2018Version(t.settings,"valueSugarAlcohol","unitSugarAlcohol","naSugarAlcohol","textSugarAlcohol","","nf-line nf-indent",!1,"roundCarbFiberSugarProtein","","","","")),t.settings.showProteins&&(n+=generateAttributeHtml2018Version(t.settings,"valueProteins","unitProteins","naProteins","textProteins","proteinContent","nf-line",!1,"roundCarbFiberSugarProtein","","nf-highlight","","")),t.settings.showVitaminD||t.settings.showCalcium||t.settings.showIron||t.settings.showPotassium_2018){let l="valueVitaminD",r="valuePotassium_2018";n+=globalTab1+'<div class="nf-bar2"></div>\n',n+=globalTab1+'<div class="nf-vitamins">\n',n+=globalTab2+'<div class="nf-vitamins">\n',!t.settings.useBaseValueFor2018LabelAndNotDVPercentage&&(t.settings.showPotassium_2018?l="valuePotassium_2018":t.settings.showIron?l="valueIron":t.settings.showCalcium&&(l="valueCalcium")),t.settings.useBaseValueFor2018LabelAndNotDVPercentage&&(t.settings.showVitaminD?r="valueVitaminD":t.settings.showCalcium?r="valueCalcium":t.settings.showIron&&(r="valueIron")),t.settings.showVitaminD&&!t.settings.useBaseValueFor2018LabelAndNotDVPercentage?n+=globalTab3+generate2018HtmlAndComputeValueGivenThePercentage(t.settings,"valueVitaminD","dailyValueVitaminD","unitVitaminD_base","unitVitaminD_percent","naVitaminD","textVitaminD",t.settings.showDailyVitaminD,"valueVitaminD"==l):t.settings.showVitaminD&&t.settings.useBaseValueFor2018LabelAndNotDVPercentage&&(n+=generateAttributeHtml2018Version(t.settings,"valueVitaminD","unitVitaminD_base","naVitaminD","textVitaminD","vitaminDContent","valueVitaminD"==r?"":"nf-line",t.settings.showDailyVitaminD,"roundFor2018LabelVitaminDIron","roundFor2018LabelVitaminDIronRule","","","dailyValueVitaminD")),t.settings.showCalcium&&!t.settings.useBaseValueFor2018LabelAndNotDVPercentage?n+=globalTab3+generate2018HtmlAndComputeValueGivenThePercentage(t.settings,"valueCalcium","dailyValueCalcium","unitCalcium_base","unitCalcium_percent","naCalcium","textCalcium",t.settings.showDailyCalcium,"valueCalcium"==l):t.settings.showCalcium&&t.settings.useBaseValueFor2018LabelAndNotDVPercentage&&(n+=generateAttributeHtml2018Version(t.settings,"valueCalcium","unitCalcium_base","naCalcium","textCalcium","calciumContent","valueCalcium"==r?"":"nf-line",t.settings.showDailyCalcium,"roundFor2018LabelCalciumPotassium","roundFor2018LabelCalciumPotassiumRule","","","dailyValueCalcium")),t.settings.showIron&&!t.settings.useBaseValueFor2018LabelAndNotDVPercentage?n+=globalTab3+generate2018HtmlAndComputeValueGivenThePercentage(t.settings,"valueIron","dailyValueIron","unitIron_base","unitIron_percent","naIron","textIron",t.settings.showDailyIron,"valueIron"==l):t.settings.showIron&&t.settings.useBaseValueFor2018LabelAndNotDVPercentage&&(n+=generateAttributeHtml2018Version(t.settings,"valueIron","unitIron_base","naIron","textIron","ironContent","valueIron"==r?"":"nf-line",t.settings.showDailyIron,"roundFor2018LabelVitaminDIron","roundFor2018LabelVitaminDIronRule","","","dailyValueIron")),t.settings.showPotassium_2018&&!t.settings.useBaseValueFor2018LabelAndNotDVPercentage?n+=globalTab3+generate2018HtmlAndComputeValueGivenThePercentage(t.settings,"valuePotassium_2018","dailyValuePotassium_2018","unitPotassium_base","unitPotassium_percent","naPotassium_2018","textPotassium",t.settings.showDailyPotassium_2018,"valuePotassium_2018"==l):t.settings.showPotassium_2018&&t.settings.useBaseValueFor2018LabelAndNotDVPercentage&&(n+=generateAttributeHtml2018Version(t.settings,"valuePotassium_2018","unitPotassium_base","naPotassium_2018","textPotassium","potassiumContent","valuePotassium_2018"==r?"":"nf-line",t.settings.showDailyPotassium_2018,"roundFor2018LabelCalciumPotassium","roundFor2018LabelCalciumPotassiumRule","","","dailyValuePotassium_2018")),n+=globalTab2+"</div>\n",n+=globalTab1+"</div>\n"}if(n+=globalTab1+'<div class="nf-bar2"></div>\n',t.settings.showCaffeine){let u="nf-highlight";t.settings.boldCaffeine||(u=""),n+=generateAttributeHtml2018Version(t.settings,"valueCaffeine","unitCaffeine","naCaffeine","textCaffeine","caffeineContent","",!1,"roundCaffeine","",u,"",""),n+=globalTab1+'<div class="nf-bar1"></div>\n',n+=globalTab1+'<div class="nf-vitamins">\n'}return n+=globalTab1+'<div class="'+(t.settings.hidePercentDailyValues?"nf-footnoteHiddenDailyValues":"nf-footnote")+'">\n',t.settings.hidePercentDailyValues||(n+=globalTab2+'<span tabIndex="0">'+t.settings.textPercentDaily2018VersionPart1,n+=t.settings.calorieIntake,n+=t.settings.textPercentDaily2018VersionPart2+"</span>\n"),t.settings.showIngredients&&(n+=ingredientsHtml2018Version(t.settings)),t.settings.showDisclaimer&&(n+=disclaimerHtml2018Version(t.settings)),n+=globalTab1+"</div>\n",t.settings.showBottomLink&&(n+=bottomLinkHtml2018Version(t.settings)),t.settings.showCustomFooter&&(n+=globalTab1+'<div class="nf-customFooter" tabindex="0">'+t.settings.valueCustomFooter+"</div>\n"),n+('<div class="naTooltip">'+t.settings.textDataNotAvailable)+'</div>\n</div><!-- closing class="nf" -->\n'},generateUK:function(){let t=this,e="",n="";return t.nutritionLabel?t.nutritionLabel:(t.settings.hideNotApplicableValues&&(t.settings.showCalories=!t.settings.naCalories&&t.settings.showCalories,t.settings.showTotalFat=!t.settings.naTotalFat&&t.settings.showTotalFat,t.settings.showSatFat=!t.settings.naSatFat&&t.settings.showSatFat,t.settings.showTotalCarb=!t.settings.naTotalCarb&&t.settings.showTotalCarb,t.settings.showSugars=!t.settings.naSugars&&t.settings.showSugars,t.settings.showFibers=!t.settings.naFibers&&t.settings.showFibers,t.settings.showProteins=!t.settings.naProteins&&t.settings.showProteins,t.settings.showSodium=!t.settings.naSodium&&t.settings.showSodium),t.settings.valueServingWeightGrams<=0&&(t.settings.naCalories=!0,t.settings.naTotalFat=!0,t.settings.naSatFat=!0,t.settings.naTotalCarb=!0,t.settings.naSugars=!0,t.settings.naFibers=!0,t.settings.naProteins=!0,t.settings.naSodium=!0),t.settings.allowNoBorder&&(e="border: 0;"),n='<div itemscope itemtype="http://schema.org/NutritionInformation" role="region" aria-label="nutrition label" class="uk_nf uk" style="'+e,t.settings.allowCustomWidth?n+=" width: "+t.settings.widthCustom+';">\n':n+=" width: "+t.settings.width+'px;">\n',n+=globalTab1+'<div class="uk_nf-title" tabindex="0">'+t.settings.textNutritionFacts+"</div>\n",t.settings.showItemNameForUK&&(n+=globalTab1+'<div class="uk_nf-item-name" tabindex="0">'+t.settings.itemName+"</div>\n"),t.settings.convertEmptyServingNametoServingForUKLabel&&""===String(t.settings.valueServingSizeUnit)&&(t.settings.valueServingSizeUnit=t.settings.textUKDefaultServingNameIfEmpty),n+=globalTab1+"<table>\n",n+=globalTab2+"<thead>\n",n+=globalTab3+"<tr>\n",n+=globalTab4+"<th>"+t.settings.textUKTypicalValues+"</th>\n",n+=globalTab4+"<th>"+t.settings.textUKPer100+" 100"+t.settings.unitGramOrMlForThePer100Part+"</th>\n",n+=globalTab4+"<th>",t.settings.showServingUnitQuantityTextbox?(t.settings.hideTextboxArrows||(n+=globalTab5+'<div class="setter">\n',n+=globalTab6+'<a href="'+t.settings.textAriaLabelIncreaseQuantityArrow+'" class="uk_nf-unitQuantityUp" ',n+='aria-label="'+t.settings.textAriaLabelIncreaseQuantityArrow+'" rel="nofollow" tabindex="0"></a>\n',n+=globalTab6+'<a href="'+t.settings.textAriaLabelDecreaseQuantityArrow+'" class="uk_nf-unitQuantityDown" ',n+='aria-label="'+t.settings.textAriaLabelDecreaseQuantityArrow+'" rel="nofollow" tabindex="0"></a>\n',n+=globalTab5+'</div><!-- closing class="setter" -->\n\n'),n+=globalTab5+'<input type="text" data-role="none" value="'+roundLoDash(t.settings.valueServingUnitQuantity,this.settings.decimalPlacesForQuantityTextbox)+'" ',n+='class="uk_nf-unitQuantityBox uk_nf-modifier-field" aria-label="'+this.settings.textAriaLabelChangeQuantityTextbox+'">\n',n+=globalTab5+'<input type="hidden" value="'+roundLoDash(this.settings.valueServingUnitQuantity,this.settings.decimalPlacesForQuantityTextbox)+'" id="uk_nf-nixLabelBeforeQuantity">\n\n'):n+=globalTab5+t.settings.valueServingUnitQuantity,n+=globalTab5+'<span class="uk_nf-servingUnit">'+t.settings.valueServingSizeUnit,n+=" ("+roundLoDash(t.settings.valueServingWeightGrams)+t.settings.unitGramOrMlForThePer100Part+")</span>\n",n+="</th>\n",n+=globalTab4+"<th>%*("+roundLoDash(t.settings.valueServingWeightGrams)+t.settings.unitGramOrMlForThePer100Part+")</th>\n",n+=globalTab3+"</tr>\n",n+=globalTab2+"</thead>\n",n+=globalTab1+"<tbody>\n",t.settings.showCalories&&(n+=generateAttributeForUK(t.settings,"valueCalories","","unitEnergy_kj","naCalories","textCalories","","roundToNearestNum","roundToNearestNum",!1,!1),n+=generateAttributeForUK(t.settings,"valueCalories","dailyValueEnergyKcal","unitEnergy_kcal","naCalories","","","roundToNearestNum","roundToNearestNum",t.settings.showDailyEnergy,!1)),t.settings.showTotalFat&&(n+=generateAttributeForUK(t.settings,"valueTotalFat","dailyValueTotalFat","unitTotalFat","naTotalFat","textTotalFat","fatContent","roundForUKLabelTotalFatCarbsSugarFiberProtein","roundForUKLabelTotalFatCarbsSugarFiberProteinRule",t.settings.showDailyTotalFat,!1)),t.settings.showSatFat&&(n+=generateAttributeForUK(t.settings,"valueSatFat","dailyValueSatFat","unitSatFat","naSatFat","textSatFat","saturatedFatContent","roundForUKLabelSatFat","roundForUKLabelSatFatRule",t.settings.showDailySatFat,!0)),t.settings.showTotalCarb&&(n+=generateAttributeForUK(t.settings,"valueTotalCarb","dailyValueCarb","unitTotalCarb","naTotalCarb","textTotalCarb","carbohydrateContent","roundForUKLabelTotalFatCarbsSugarFiberProtein","roundForUKLabelTotalFatCarbsSugarFiberProteinRule",t.settings.showDailyTotalCarb,!1)),t.settings.showSugars&&(n+=generateAttributeForUK(t.settings,"valueSugars","dailyValueSugar","unitSugars","naSugars","textSugars","sugarContent","roundForUKLabelTotalFatCarbsSugarFiberProtein","roundForUKLabelTotalFatCarbsSugarFiberProteinRule",t.settings.showDailySugars,!0)),t.settings.showFibers&&(n+=generateAttributeForUK(t.settings,"valueFibers","","unitFibers","naFibers","textFibers","fiberContent","roundForUKLabelTotalFatCarbsSugarFiberProtein","roundForUKLabelTotalFatCarbsSugarFiberProteinRule",!1,!1)),t.settings.showProteins&&(n+=generateAttributeForUK(t.settings,"valueProteins","dailyValueProtein","unitProteins","naProteins","textProteins","proteinContent","roundForUKLabelTotalFatCarbsSugarFiberProtein","roundForUKLabelTotalFatCarbsSugarFiberProteinRule",t.settings.showDailyProtein,!1)),t.settings.showSodium&&(n+=generateAttributeForUK(t.settings,"valueSodium","dailyValueSalt","unitSalt","naSodium","textSodium","sodiumContent","roundForUKLabelSalt","roundForUKLabelSaltRule",t.settings.showDailySodium,!1)),n+=globalTab2+"</tbody>\n",n+=globalTab2+"<tfoot>\n",n+=globalTab3+"<tr>\n",n+=globalTab4+'<td colspan="4">\n',n+=globalTab5+'<div class="uk_nf-footnote">\n',n+=referenceIntakeHtmlUKVersion(t.settings),t.settings.showIngredients&&(n+=ingredientsHtmlUKVersion(t.settings)),t.settings.showDisclaimer&&(n+=disclaimerHtmlUKVersion(t.settings)),t.settings.showBottomLink&&(n+=bottomLinkHtmlUKVersion(t.settings)),t.settings.showCustomFooter&&(n+=globalTab6+'<div class="uk_nf-customFooter" tabindex="0">\n'+globalTab7+t.settings.valueCustomFooter+"\n"+globalTab6+"</div>\n"),n+=globalTab5+"</div>\n",n+=globalTab4+"</td>\n",n+=globalTab3+"</tr>\n",n+=globalTab2+"</tfoot>\n",(n+=globalTab1+"</table>\n")+('<div class="naTooltip">'+t.settings.textDataNotAvailable)+'</div>\n</div><!-- closing class="uk_nf" -->\n')}}}(jQuery);