{"version":3,"sources":["vendd.globalHelpers.js","postMessages.js","functions.js","localstorage.js","scriptsActivator.js","vendd.service.js","recipe.library.js","callbacks.js","init.js"],"names":["venddSetCookie","cname","cvalue","exdays","d","Date","setTime","getTime","expires","toUTCString","document","cookie","venddGetCookie","name","ca","split","i","length","c","charAt","substring","indexOf","toArrayBuffer","buf","ab","ArrayBuffer","view","Uint8Array","decodeEntities","element","createElement","str","replace","innerHTML","textContent","allowOnlyNumbersInput","$container","$","keyup","value","this","stringToNumber","returnValue","currency","decimal","val","LhApp","Context","Currency","Symbol","DecimalSeparator","trim","parseFloat","toFixed","venddProjectConfigs","NumberOfDecimals","numberToString","addCurrency","clearZeros","fractional","RegExp","test","PostMessages","intervalId","lastHash","attachedCallback","window","receiveMessage","callback","sourceOrigin","e","origin","Object","prototype","toString","call","clearInterval","setInterval","hash","location","re","data","message","Action","InlineAdmin","UsernameAsLoginName","Vendd","MessageBus","publishAsync","UserSelect","Messages","SubmitSetInterfaceUserInlineAdmin","LoginName","UserName","RedirectToAccount","UserEmail","OrderId","InLineAdminEndpoint","Function","Url","QueryString","String","Tracking","Actions","ActionsType","ORDER_COMPLETION","StorageType","SESSION","PERSISTENT","CROSS_TABS_SESSION","Counter","actionsType","storageType","actionIdentifier","storekey","storage","localStorage","sessionStorage","action","getCount","store","JSON","parse","getItem","parseInt","increment","setItem","stringify","reset","undefined","updateTrackingData","updateData","TrackingData","extend","ga","canTrack","InitGoogleAnalytics","apply","arguments","cookieType","Consents","ConsentsManager","CheckoutConsentsManager","cookiesStatus","IsConsentsEnabled","getTrackingModel","trackingModel","IsTrackingEnabled","getTracker","trackerCode","tracker","Trackers","toLowerCase","Properties","getFeedItemId","product","datasource","FeedCodes","FeedCodeField","productId","colorId","sizeId","dim3Id","dim4Id","dim5Id","dim6Id","merchantId","ParentProductId","colors","Dimensions","find","IsColor","sizes","IsSize","dim3s","IsDim3","dim4s","IsDim4","dim5s","IsDim5","dim6s","IsDim6","merchants","IsMerchant","color","Versions","ProductId","SelectedProductId","size","dim3","dim4","dim5","dim6","merchant","VersionId","ColorId","SizeId","Dim3Id","Dim4Id","Dim5Id","Dim6Id","MerchantId","SplitFeedBySize","SplitFeedByDim3","SplitFeedByDim4","SplitFeedByDim5","SplitFeedByDim6","SplitFeedByMerchant","gtag","dataLayer","push","InitGoogleTagManager","tagManagerCode","GoogleTagManagerCode","googleTagManagerInitialized","consentsManager","LoadTagManagerWhenConsentsGranted","marketingCookies","statisticCookies","functionalityCookies","EnableGoogleTagManagerConsents","ad_storage","analytics_storage","functionality_storage","w","s","l","gtm.start","event","f","getElementsByTagName","j","async","src","parentNode","insertBefore","consentsCookie","Cookies","getJSON","functionalityCookiesEnabled","marketingCookiesEnabled","statisticCookiesEnabled","userHasSetCookies","CookiesDefaultActive","analyticsCode","GoogleAnalyticsCode","googleAnalyticsInitialized","o","r","q","a","m","getServiceEndpoint","url","rewritedUrl","Request","BaseUrl","unescape","FriendlyUrl","queryString","initialQueryString","iid","getValueOf","RawUrl","Item","Id","domainUrl","qsrt","qArray","qparts","qpart","qparams","parts","pName","decodeURIComponent","pValue","parameterKey","parameterValue","href","parameters","pair","setParameterValue","setParameterValueOnUrl","hasQueryString","join","removeParameter","parameterKeys","removeParametersFromUrl","removeParameterFromUrl","removeParameters","newUrl","each","index","splice","getText","key","Text","match","resource","getTranslatableTextFromServer","result","ajax","type","dataType","contentType","ContentType","success","response","isEmail","text","isAlphaNumeric","initVisitorState","cookieValue","get","checkAndUpdateVisitorState","Service","onSuccess","res","oldUrl","cookieValueAsUrl","removeClass","removeAttr","oldLanguageCode","newLanguageCode","set","secure","IsSecure","samesite","oldCountryCode","newCountryCode","oldCurrencyCode","newCurrencyCode","hideExpandables","wrapper","item","$expandable","bindUndropables","$wrapper","on","preventDefault","bindExpandables","click","stopPropagation","triggerValue","$expandableContainer","$triggers","unbind","wItem","wItemContainer","hasClass","addClass","EventManager","trigger","isButtonDisabled","buttonWrapper","isDisabled","tagName","is","$internalButton","bindHrefButtons","bindScrollable","$this","time","offset","animate","scrollTop","height","top","bindLazyLoadableImages","innerWrapper","$innerWrapper","$lazyLoadOptions","opts","defOptions","effect","$images","fn","lazyload","remove","inArray","events","bind","PageTrackingRequest","dataItem","querystring","query","cookies","Name","Value","Expires","Path","MailChimpEcommerce360Tracking","oId","cId","eId","orderId","campaignId","emailId","applyExchangeRate","price","applyExchangeRateExtended","ExchangeRate","rate","RenderPrice","renderPriceExtended","RenderPriceExtended","isShopDefaultCurrency","separatorSymbol","prefixSymbol","suffixSymbol","renderPrice","symbol","numberOfDigits","NumberOfDigits","symbolShownFirst","SymbolShownFirst","doShowSymbol","DoShowSymbol","ShopDefaultCurrency","formatedPrice","RenderPointsPrice","pointsPrice","renderPointsPriceExtended","RenderPointsPriceExtended","commaSymbol","innerSuffixSymbol","validateClientModel","model","LangCode","Language","CurrCode","Code","ReplacePrices","obj","el","itemId","attr","itemData","filter","DeletedPrice","Price","TotalPointsPrice","TotalPointsGain","PointsPrice","PointsGain","ReplaceAvailabilities","cartEnabled","CanBuy","CanBuyWithPoints","CanAddToList","validateTaxIdentifier","isInvoice","countryCode","taxIdentifier","isNaN","arrTaxId","map","Math","pow","pauseScroll","init","scroll","disqus_config","page","identifier","replaceIframe","idFrame","originalFrame","getElementById","newFrame","id","getAttribute","width","style","display","replaceChild","convertToGreek","closest","toUpperCase","newstr","len","convertCharacters","convertToUppercase","character","removeItem","Storage","_setItem","ready","ScriptsActivator","funcLoaded","markLoaded","statLoaded","loadScripts","scripts","keys","skey","ss","loadFunctionalityScripts","funcFn","loadMarketingScripts","markFn","loadStatisticsScripts","statFn","loadAllScripts","func","mark","stat","removeScriptsElements","script","_recipes","returnResponse","recipeId","statusCode","errorCode","status","ErrorCode","getRecipe","recipeModel","testModel","recipe","_","isArray","first","x","RecipeId","TotalCount","getTotalQuantity","ingredientId","items","RecipeItems","IngredientId","reduce","memo","Quantity","getGroupQuantity","group","GroupId","RecipeLibrary","DeclareState","isValid","GetModel","InitRecipe","force","AFirstInclusion","Ingredients","Groups","Categories","indexCategory","category","indexGroup","VisualGroups","visualgroup","groupItems","vg","sum","IsMultiSelect","MinQuantity","MaxQuantity","DefaultQuantities","sampleOptionItemNone","CanRemove","Category","DefaultQuantity","DeletedPriceText","PriceText","PriceWithoutVat","PriceWithoutVatText","Weight","OrderNumber","Quanta","QuantaText","RecipeGroupId","RecipeGroupName","Stock","TaxClassId","VariantId","IsNullable","Items","unshift","indexItem","HasValidDefaultValues","IsMandatory","Disabled","Checked","IsDefault","ingredient","CategoryCode","ManufacturerProductCode","ProductItemCode","RecipeItemCode","ProductItemId","RecipeItemId","TotalPrice","TotalPriceWithoutVat","IsStandard","SubRecipeId","SubRecipeCode","SubRecipe","HashCode","getRecipeItemsHashCode","ResetRecipe","AddIngredient","quantity","isTotal","g","isCompatible","CheckIncompatibles","responsePrerequisites","CheckPrerequisites","successPrerequisites","BothPrerequisite","recipeIngredient","CheckPrerequisitesAnyOfSet","totalIngredientQuantity","round","priceWithoutVat","ParentRecipeId","parentModel","ParentRecipeItemId","parentIngredient","max","RemoveIngredient","recursive","ingredientsToBeRemoved","Prerequisites","some","ChangeIngredient","ingredientIdFrom","ingredientIdTo","groupFrom","ingredientFrom","GetFullRecipeItems","recipeItems","concat","GetRecipeItems","GetOneDealerData","ManufacturerName","ProductCode","ManufacturerCode","Series","Guid","Prices","OptionalTotalPrice","FixJSFloatBug","OptionalTotalPriceWithoutVat","StandardTotalPrice","StandardTotalPriceWithoutVat","InitialPrice","InitialPriceWithoutVat","ModelImageAbsoluteUrl","ProductImageUrl","cartTypeCode","Attributes","CarTypeCode","fuelTypeCode","FuelTypeCode","attributes","AttributeCode","Type","ValueType","ItemCode","IsPackage","ParentPackageCode","OptionType","SetRecipeItems","GetCheckedRecipeItems","forceOptional","checkedRecipeItems","optionalTotalPrice","optionalTotalItems","standardTotalPrice","standardTotalItems","optionalTotalPriceWithoutVat","standardTotalPriceWithoutVat","indexInArray","groupQuantity","isChecked","selectedItems","isStandard","totalPrice","totalPriceWithoutVat","ImageUrl","subCheckedRecipeItems","CheckedRecipeItems","uncheckedRecipeItems","reject","checked","CheckedItemsOptionalTotal","CheckedItemsStandardTotal","UncheckedRecipeItems","UnitPrice","UnitPriceWithoutVat","GetPrices","prices","ri","defaultQuantity","initialPrice","initialPriceWithoutVat","optionalQuantity","subPrices","GetWeight","weightObj","InitialWeight","OptionalTotalWeight","GetEnabledItems","EnabledItems","DisableItems","GroupErrors","Errors","totalQuantity","extraQuantity","ExtraQuantity","disableAllGroup","indexVisualGroup","visualGroup","canAdd","canRemove","checkIncompatibles","isEnabledIncompatible","BothSelected","checkPrerequisites","isEnabledPrerequisites","checkPrerequisitesAnyOfSet","CanAdd","Incompatibles","MissingPrerequisites","MissingAnyOfPrerequisites","groupErrorCode","CategoryName","incompatibles","missingPrerequisites","bothPrerequisite","hasMissingAnyOfPrerequisites","RequiresAnyOfSet","requiredSetItems","RequiresAnyOfItems","missingAnyOfPrerequisites","IsValid","IngredientsErrors","errorCodes","ErrorCodes","CompareModels","savedModel","ingedientsSavedModel","sortBy","ingedientsSavedModelHashCode","ingedientsModel","ingedientsModelHashCode","groupsSavedModel","savedGroupsModelHashCode","groupsModel","groupsModelHashCode","savedModelHashCode","MaxFreeQuantity","MaxReplaceQuantity","modelHashCode","IngredientsWarnings","savedIngredient","validatedModel","GenerateGlobalId","config","_def","Deferred","defaultConfiguration","Force","FriendlyName","Vin","PartnerId","serviceurl","GlobalId","SavedGlobalIdToLocal","SaveGlobalIdToLocal","SaveRecipeItemsToLocal","resolve","onError","currentHashCode","savedHashCode","GetLocalStorageRecipeItemsHashCode","HtmlData","Body","jsonData","ConvertToSavedModel","requestData","ConfigurationJson","ProductIdentifier","IsShare","error","promise","AssignConfigurationToUser","LoadFromGlobalId","Html","Pdf","compareResult","subrecipeCompareResults","SubRecipes","subrecipeData","globalId","dataLocalStorage","LoadFromLocalRecipeItems","Recipe","ClearLocalStorage","converModelToSaveDataModel","converGroupsToSaveDataModel","converIngedientToSaveDataModel","groups","ingredients","Tests","0","console","log","1","2","options","defOpts","serviceUrl","onErrorInternal","method","rawdata","servicenamespace","onFailure","err","onUnauthenticated","Error","protocol","host","locationQueryParams","serviceQueryParams","_query","_data","param","ex","responseJSON","ExceptionType","pop","Message","failure","recaptchaLoaded","recaptchaMessagePublished","callback_recaptcha","checkAsyncLoad","googleMapsLoaded","googleMapsMessagePublished","callback_googlemaps","venddLoaded","callback_vendd","Plugins","RecaptcaLoaded","GoogleMapsLoaded","checkout_callback_googlemaps","angular","scope","Control","SetMap","Scripts"],"mappings":"AAAA,SAAAA,eAAAC,MAAAC,OAAAC,QACA,IAAAC,EAAA,IAAAC,KACAD,EAAAE,QAAAF,EAAAG,UAAA,GAAAJ,OAAA,GAAA,GAAA,KACA,IAAAK,QAAA,WAAAJ,EAAAK,cACAC,SAAAC,OAAAV,MAAA,IAAAC,OAAA,KAAAM,QAAA,WAGA,SAAAI,eAAAX,OAGA,IAFA,IAAAY,KAAAZ,MAAA,IACAa,GAAAJ,SAAAC,OAAAI,MAAA,KACAC,EAAA,EAAAA,EAAAF,GAAAG,OAAAD,IAAA,CAEA,IADA,IAAAE,EAAAJ,GAAAE,GACA,KAAAE,EAAAC,OAAA,IAAAD,EAAAA,EAAAE,UAAA,GACA,GAAA,GAAAF,EAAAG,QAAAR,MAAA,OAAAK,EAAAE,UAAAP,KAAAI,OAAAC,EAAAD,QAEA,MAAA,GAGA,SAAAK,cAAAC,KAGA,IAFA,IAAAC,GAAA,IAAAC,YAAAF,IAAAN,QACAS,KAAA,IAAAC,WAAAH,IACAR,EAAA,EAAAA,EAAAO,IAAAN,SAAAD,EACAU,KAAAV,GAAAO,IAAAP,GAEA,OAAAQ,GAGA,IAAAI,eAAA,WACA,IAAAC,QAAAnB,SAAAoB,cAAA,OAcA,OAZA,SAAAC,KASA,OARAA,KAAA,iBAAAA,MAEAA,KADAA,IAAAA,IAAAC,QAAA,uCAAA,KACAA,QAAA,wCAAA,IACAH,QAAAI,UAAAF,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,MAAAnsB,KAAAM,UAAA6rB,OACA1gB,QAAA,SAAAC,UAEA,IAAA8H,IAAA9H,SAEAA,SAAA/S,IACA6a,IAAA9H,SAAA/S,IAEA,iBAAA6a,KAAAA,eAAA5U,UACA4U,IAAAxT,KAAAC,MAAAuT,MAEA,mBAAA7D,KAAA,WACAA,KAAAxD,UAAAqH,MAGAkZ,QAAA,SAAAL,IACAf,gBAAAe,KAEA5C,MAAA,SAAA4C,IACAf,gBAAAe,QAKAngB,SAIArO,MAxIA,CA0IAA,OAAA,MC++CA,IAEAgb,UAAA,GC3nDA8T,iBAAA,EACAC,2BAAA,EACAC,mBAAA,WACAF,iBAAA,EACAG,kBAGAC,kBAAA,EACAC,4BAAA,EACAC,oBAAA,WACAF,kBAAA,EACAD,kBAGAI,aAAA,EACAC,eAAA,WACAD,aAAA,EACAJ,kBAGAA,eAAA,WACAI,cAGAP,kBAAAC,4BACA/uB,MAAAC,WAAAC,aAAA,iBAAA,IAAAF,MAAAuvB,QAAAnvB,SAAAovB,gBACAT,2BAAA,GAGAG,mBAAAC,6BACAnvB,MAAAC,WAAAC,aAAA,iBAAA,IAAAF,MAAAuvB,QAAAnvB,SAAAqvB,kBACAN,4BAAA,KAKA,SAAAO,+BAEAC,QAAApzB,QAAA,oBAAA0c,MAAA,WACAlc,EAAA,oBAAA6yB,SAAA7yB,EAAA,oBAAA6yB,QAAAC,SAAA,mBAAA9yB,EAAA,oBAAA6yB,QAAAC,QAAA,QACA9yB,EAAA,oBAAA6yB,QAAAC,QAAAC,QAAA,KCxCA/yB,EAAA3B,UAAA6d,MAAA,WAEAjZ,OAAAA,MAAA+vB,SAAA,mBAAA/vB,MAAA+vB,QAAAzY,OAEAtX,MAAA+vB,QAAAzY,OAEA9Z,OAAAA,MAAA8Z,MAAA,mBAAA9Z,MAAA8Z,MACA9Z,MAAA8Z","file":"vendd.global.min.js","sourcesContent":["function venddSetCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires + \"; \" + \"path=/\";\n}\n\nfunction venddGetCookie(cname) {\n var name = cname + \"=\";\n var ca = document.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1);\n if (c.indexOf(name) == 0) return c.substring(name.length, c.length);\n }\n return \"\";\n}\n\nfunction toArrayBuffer(buf) {\n\tvar ab = new ArrayBuffer(buf.length);\n\tvar view = new Uint8Array(ab);\n\tfor (var i = 0; i < buf.length; ++i) {\n\t\tview[i] = buf[i];\n\t}\n\treturn ab;\n}\n\nvar decodeEntities = (function() {\n var element = document.createElement('div');\n \n function decodeHTMLEntities (str) {\n if(str && typeof str === 'string') {\n str = str.replace(/]*>([\\S\\s]*?)<\\/script>/gmi, '');\n str = str.replace(/<\\/?\\w(?:[^\"'>]|\"[^\"]*\"|'[^']*')*>/gmi, '');\n element.innerHTML = str;\n str = element.textContent;\n element.textContent = '';\n }\n \n return str;\n }\n \n return decodeHTMLEntities;\n })();\n\nfunction allowOnlyNumbersInput($container) {\n\n if (!$container || $container.length < 0) $container = $('html');\n\n $('*[data-only-numbers=\"true\"]', $container).keyup(function () {\n var value = this.value.replace(/[^0-9\\.,]/g, '');\n\n if (this.value != value) {\n this.value = value;\n }\n });\n}\n\nfunction stringToNumber(value) {\n\n var returnValue, currency, decimal, val = \"\" + value;\n\n currency = LhApp.Context.Currency.Symbol;\n decimal = LhApp.Context.Currency.DecimalSeparator;\n returnValue = val.replace(currency, '').replace(decimal, '.').trim();\n\n return parseFloat(returnValue).toFixed(venddProjectConfigs.NumberOfDecimals ? venddProjectConfigs.NumberOfDecimals : 2);\n}\n\nfunction numberToString(value, addCurrency, clearZeros) {\n var returnValue, currency, decimal, fractional, val = \"\" + value;\n\n currency = LhApp.Context.Currency.Symbol;\n decimal = LhApp.Context.Currency.DecimalSeparator;\n returnValue = val.replace(currency, '').replace('.', decimal).trim();\n\n\n if (clearZeros) {\n fractional = returnValue.split(decimal);\n \n if (fractional.length > 1) {\n if (new RegExp(\"^[0\\0]+$\").test(fractional[1])) {\n returnValue = fractional[0];\n }\n } \n }\n \n if (addCurrency)\n returnValue += \" \" + currency;\n\n return returnValue;\n}","var PostMessages = function () {\n\n var intervalId,\n lastHash,\n attachedCallback,\n window = this;\n\n return {\n receiveMessage: function (callback, sourceOrigin) {\n\n if (window['postMessage']) {\n if (callback) {\n attachedCallback = function (e) {\n if ((typeof sourceOrigin === 'string' && e.origin !== sourceOrigin)\n || (Object.prototype.toString.call(sourceOrigin) === \"[object Function]\" && sourceOrigin(e.origin) === !1)) {\n return !1;\n }\n callback(e);\n };\n }\n if (window['addEventListener']) {\n window[callback ? 'addEventListener' : 'removeEventListener']('message', attachedCallback, !1);\n } else {\n window[callback ? 'attachEvent' : 'detachEvent']('onmessage', attachedCallback);\n }\n } else {\n intervalId && clearInterval(intervalId);\n intervalId = null;\n\n if (callback) {\n intervalId = setInterval(function () {\n var hash = document.location.hash,\n re = /^#?\\d+&/;\n if (hash !== lastHash && re.test(hash)) {\n lastHash = hash;\n callback({ data: hash.replace(re, '') });\n }\n }, 100);\n }\n }\n }\n };\n}();\n\nPostMessages.receiveMessage(function (message) {\n\n if (message.data.Action === 'SetUser') {\n if (venddProjectConfigs.InlineAdmin && venddProjectConfigs.InlineAdmin.UsernameAsLoginName) {\n Vendd.MessageBus.publishAsync(Vendd.UserSelect, new Vendd.UserSelect.Messages.SubmitSetInterfaceUserInlineAdmin({ 'LoginName': message.data.UserName.trim(), 'RedirectToAccount': message.data.RedirectToAccount }));\n } else {\n Vendd.MessageBus.publishAsync(Vendd.UserSelect, new Vendd.UserSelect.Messages.SubmitSetInterfaceUserInlineAdmin({ 'LoginName': message.data.UserEmail.trim(), 'RedirectToAccount': message.data.RedirectToAccount }));\n }\n }\n\n if (message.data.Action === 'SetOrder') {\n if (venddProjectConfigs.InlineAdmin && venddProjectConfigs.InlineAdmin.UsernameAsLoginName) {\n Vendd.MessageBus.publishAsync(Vendd.UserSelect, new Vendd.UserSelect.Messages.SubmitSetInterfaceUserInlineAdmin({ 'LoginName': message.data.UserName.trim(), 'RedirectToAccount': message.data.RedirectToAccount, 'OrderId': message.data.OrderId }));\n } else {\n Vendd.MessageBus.publishAsync(Vendd.UserSelect, new Vendd.UserSelect.Messages.SubmitSetInterfaceUserInlineAdmin({ 'LoginName': message.data.UserEmail.trim(), 'RedirectToAccount': message.data.RedirectToAccount, 'OrderId': message.data.OrderId }));\n }\n }\n\n}, LhApp.Context.InLineAdminEndpoint);\n\n","LhApp = LhApp || {};\n\nLhApp.Function = {};\n\nLhApp.Function.Url = {};\nLhApp.Function.QueryString = {};\nLhApp.Function.String = {};\nLhApp.Function.Tracking = {};\nLhApp.Function.Actions = {};\n\n\nLhApp.Function.Actions.ActionsType = { ORDER_COMPLETION: 0 };\nLhApp.Function.Actions.StorageType = { SESSION: 0, PERSISTENT: 1, CROSS_TABS_SESSION: 2 }; /* CROSS_TABS_SESSION : currently unsupported - custom implementation */\nLhApp.Function.Actions.Counter = function (actionsType, storageType, actionIdentifier) {\n var storekey = 'Vendd:Actions.Counter';\n var storage = storageType == LhApp.Function.Actions.ActionsType.PERSISTENT ? localStorage : sessionStorage;\n var action = actionsType + (actionIdentifier ? ':' + actionIdentifier : actionIdentifier);\n\n this.getCount = function () {\n var store = JSON.parse(storage.getItem(storekey)) || {};\n return parseInt(store[action] || 0);\n }\n this.increment = function () {\n var store = JSON.parse(storage.getItem(storekey)) || {};\n store[action] = (parseInt(store[action]) || 0) + 1;\n storage.setItem(storekey, JSON.stringify(store));\n }\n this.reset = function () {\n var store = JSON.parse(storage.getItem(storekey)) || {};\n store[action] = undefined;\n storage.setItem(storekey, JSON.stringify(store));\n }\n}\n\nLhApp.Function.Tracking.updateTrackingData = function (updateData) {\n window.TrackingData = $.extend(true, {}, window.TrackingData, updateData);\n}\n\n//custom ga in\nLhApp.Function.Tracking.ga = function () {\n\n if (!LhApp.Function.Tracking.canTrack('statisticCookies'))\n return false;\n\n if (!LhApp.Function.Tracking.InitGoogleAnalytics())\n return false;\n\n if (typeof (ga) == 'undefined')\n return false;\n\n ga.apply(null, arguments);\n\n return true;\n}\n\nLhApp.Function.Tracking.canTrack = function (cookieType) {\n if (cookieType === \"necessaryCookies\")\n return true;\n\n var Consents = (typeof (ConsentsManager) != \"undefined\" && ConsentsManager) || (typeof (CheckoutConsentsManager) != \"undefined\" && CheckoutConsentsManager);\n if (!Consents)\n return false;\n\n if (!cookieType)\n cookieType = 'marketingCookies';\n\n if (Consents.cookiesStatus[cookieType] === undefined)\n return false;\n\n if (!LhApp.Context.IsConsentsEnabled)\n return true;\n\n return Consents.cookiesStatus[cookieType];\n}\n\nLhApp.Function.Tracking.getTrackingModel = function () {\n var trackingModel = window.TrackingData;\n if (!trackingModel || !trackingModel.IsTrackingEnabled)\n return null;\n\n return JSON.parse(JSON.stringify(trackingModel));//retunr cloned object\n}\n\nLhApp.Function.Tracking.getTracker = function (trackerCode, trackingModel) { \n if (!trackingModel || !trackingModel.IsTrackingEnabled)\n return null;\n\n var tracker = trackingModel.Trackers[trackerCode.toLowerCase()]; // if available than IsActive = 1 in DB\n if (!tracker)\n return null;\n\n if (!tracker.Properties)\n return null;\n\n return tracker;\n}\n\nLhApp.Function.Tracking.getFeedItemId = function (product, datasource, tracker) { \n if (product.FeedCodes && product.FeedCodes[tracker.FeedCodeField])\n return product.FeedCodes[tracker.FeedCodeField];\n\n var productId, colorId, sizeId, dim3Id, dim4Id, dim5Id, dim6Id, merchantId;\n\n if (datasource == 'ProductChanged') {\n productId = product.ParentProductId;\n\n var colors = product.Dimensions.find(function (i) { return i.IsColor });\n var sizes = product.Dimensions.find(function (i) { return i.IsSize });\n var dim3s = product.Dimensions.find(function (i) { return i.IsDim3 });\n var dim4s = product.Dimensions.find(function (i) { return i.IsDim4 });\n var dim5s = product.Dimensions.find(function (i) { return i.IsDim5 });\n var dim6s = product.Dimensions.find(function (i) { return i.IsDim6 });\n var merchants = product.Dimensions.find(function (i) { return i.IsMerchant });\n\n var color = colors && colors.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var size = sizes && sizes.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim3 = dim3s && dim3s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim4 = dim4s && dim4s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim5 = dim5s && dim5s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim6 = dim6s && dim6s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var merchant = merchants && merchants.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n\n colorId = color && color.VersionId;\n sizeId = size && size.VersionId;\n dim3Id = dim3 && dim3.VersionId;\n dim4Id = dim4 && dim4.VersionId;\n dim5Id = dim5 && dim5.VersionId;\n dim6Id = dim6 && dim6.VersionId;\n merchantId = merchant && merchant.VersionId;\n }\n else {\n productId = product.ProductId;\n\n colorId = product.ColorId;\n sizeId = product.SizeId;\n dim3Id = product.Dim3Id;\n dim4Id = product.Dim4Id;\n dim5Id = product.Dim5Id;\n dim6Id = product.Dim6Id;\n merchantId = product.MerchantId;\n }\n\n if (colorId && parseInt(colorId) > 0) {\n productId += \"-\" + colorId;\n }\n if (tracker.SplitFeedBySize && sizeId && parseInt(sizeId) > 0) {\n productId += \"-\" + sizeId;\n }\n if (tracker.SplitFeedByDim3 && dim3Id && parseInt(dim3Id) > 0) {\n productId += \"-\" + dim3Id;\n }\n if (tracker.SplitFeedByDim4 && dim4Id && parseInt(dim4Id) > 0) {\n productId += \"-\" + dim4Id;\n }\n if (tracker.SplitFeedByDim5 && dim5Id && parseInt(dim5Id) > 0) {\n productId += \"-\" + dim5Id;\n }\n if (tracker.SplitFeedByDim6 && dim6Id && parseInt(dim6Id) > 0) {\n productId += \"-\" + dim6Id;\n }\n if (tracker.SplitFeedByMerchant && merchantId && parseInt(merchantId) > 0) {\n productId += \"-M\" + merchantId;\n }\n\n return productId;\n}\n\n//used for tag manager. keep in mind even though can be used for gtag.js vendd does not include gtag.js tags\nLhApp.Function.Tracking.gtag = function () {\n window.dataLayer = window.dataLayer || [];\n dataLayer.push(arguments);\n}\n\nLhApp.Function.Tracking.InitGoogleTagManager = function (tagManagerCode) {\n\n var trackingModel = LhApp.Function.Tracking.getTrackingModel();\n\n if (tagManagerCode === undefined) // if not defined tag manager code\n {\n if (!trackingModel || !trackingModel.GoogleTagManagerCode)\n return false;\n tagManagerCode = trackingModel.GoogleTagManagerCode;\n }\n\n if (!tagManagerCode)\n return false;\n\n //initialization check\n if (window.googleTagManagerInitialized)\n return true;\n\n var consentsManager = window.ConsentsManager || window.CheckoutConsentsManager;\n var cookiesStatus = consentsManager && consentsManager.cookiesStatus;\n\n if (trackingModel.LoadTagManagerWhenConsentsGranted) {\n //if all cookie consents are required to load tag manager\n if (!(cookiesStatus && cookiesStatus.marketingCookies && cookiesStatus.statisticCookies && cookiesStatus.functionalityCookies)){\n return false;\n }\n }\n\n if (trackingModel.EnableGoogleTagManagerConsents) {\n //init consents before tag manager initiation\n LhApp.Function.Tracking.gtag('consent', 'default', {\n 'ad_storage': cookiesStatus && cookiesStatus.marketingCookies ? 'granted' : 'denied',\n 'analytics_storage': cookiesStatus && cookiesStatus.statisticCookies ? 'granted' : 'denied',\n 'functionality_storage': cookiesStatus && cookiesStatus.functionalityCookies ? 'granted' : 'denied'\n });\n } \n\n //init tag manager\n (function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js'\n });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', tagManagerCode);\n //mark tag manager as initialized\n window.googleTagManagerInitialized = true;\n\n /*--DEPRICATED-- Expose Cookie Consents to Data Layer*/\n var consentsCookie = Cookies.getJSON('ConsentChecked');\n if (consentsCookie) {\n window.dataLayer.push({ 'functionalityCookiesEnabled': consentsCookie.functionalityCookies, 'marketingCookiesEnabled': consentsCookie.marketingCookies, 'statisticCookiesEnabled': consentsCookie.statisticCookies });\n }\n\n //custom tag manager event when consents are ready (default active or user has set options in a previous page)\n if (cookiesStatus && (consentsManager.cookiesStatus.userHasSetCookies || LhApp.Context.CookiesDefaultActive)) {\n dataLayer.push({ 'event': 'vendd_consents_ready' });\n }\n\n return true;\n}\n\nLhApp.Function.Tracking.InitGoogleAnalytics = function (analyticsCode) {\n if (analyticsCode === undefined) // if not defined\n {\n var trackingModel = LhApp.Function.Tracking.getTrackingModel();\n if (!trackingModel || !trackingModel.GoogleAnalyticsCode)\n return false;\n analyticsCode = trackingModel.GoogleAnalyticsCode;\n }\n\n if (!analyticsCode)\n return false;\n\n //initialization check\n if (window.googleAnalyticsInitialized)\n return true;\n window.googleAnalyticsInitialized = true;\n\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments)\n }, i[r].l = 1 * new Date();\n a = s.createElement(o),\n m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m)\n })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');\n\n ga(\"create\", analyticsCode, 'auto');\n\n return true;\n}\n\nLhApp.Function.Url.getServiceEndpoint = function (url) {\n var rewritedUrl = LhApp.Context.Request.BaseUrl + '/services/';\n\n rewritedUrl += url;\n\n if (unescape(LhApp.Context.Request.FriendlyUrl).indexOf('?') != -1) {\n\n var queryString = '';\n var initialQueryString = unescape(LhApp.Context.Request.FriendlyUrl).substring(unescape(LhApp.Context.Request.FriendlyUrl).indexOf('?') + 1);\n\n var iid = LhApp.Function.QueryString.getValueOf('iid', unescape(LhApp.Context.Request.RawUrl));\n if (iid != '') queryString = 'iid=' + iid;\n else if (LhApp.Context.Item && LhApp.Context.Item.Id)\n queryString = 'iid=' + LhApp.Context.Item.Id;\n if (rewritedUrl.indexOf(initialQueryString) == -1) {\n\n if (initialQueryString.length > 0) queryString += '&' + initialQueryString;\n\n if (rewritedUrl.indexOf('?') == -1)\n queryString = '?' + queryString;\n else\n queryString = '&' + queryString;\n }\n rewritedUrl += queryString;\n }\n\n rewritedUrl = rewritedUrl.replace(\"?&\", \"?\");\n var domainUrl = rewritedUrl.split('?');\n var qsrt = \"\";\n if (domainUrl.length > 1) {\n \tvar q = domainUrl[1];\n \tvar qArray = q.split('&');\n \tvar operator = '?';\n \tfor (i = 0; i < qArray.length; i++) {\n \t\tif (qArray[i] != \"\" && qArray[i] != \"\" && qsrt.indexOf(qArray[i]) == -1) {\n \t\t\tif (i == 0) {\n \t\t\t\toperator = '?';\n \t\t\t} else {\n \t\t\t\toperator = '&';\n \t\t\t}\n \t\t\tqsrt += operator + qArray[i];\n \t\t}\n \t}\n }\n return domainUrl[0] + qsrt;\n};\n\nLhApp.Function.QueryString.parse = function (url) {\n var qparams = {},\n parts = (url || '').split('?'),\n qparts, qpart,\n i = 0;\n\n if (parts.length <= 1) {\n return qparams;\n } else {\n qparts = parts[1].split('&');\n for (i in qparts) {\n qpart = qparts[i].split('=');\n var pName = decodeURIComponent(qpart[0]).toLowerCase();\n var pValue = decodeURIComponent(qpart[1] || '');\n qparams[pName] = pValue;\n }\n }\n\n return qparams;\n};\n\nLhApp.Function.QueryString.getValueOf = function (parameterKey, url) {\n\n url = url || window.location.href;\n var parameterValue = '';\n\n var queryString = '';\n var hasQueryString = (url.indexOf('?') > -1);\n\n if (hasQueryString) {\n queryString = url.substring(url.indexOf('?') + 1);\n }\n\n var parameters = queryString.split(\"&\");\n\n if (queryString.indexOf(parameterKey) >= 0) {\n\n for (var i = 0; i < parameters.length; i++) {\n var pair = parameters[i].split(\"=\");\n if (pair[0] == parameterKey) {\n parameterValue = pair[1];\n }\n }\n }\n\n return parameterValue;\n};\n\nLhApp.Function.Url.setParameterValue = function (parameterKey, parameterValue) {\n\n var url = window.location.href;\n\n return this.setParameterValueOnUrl(url, parameterKey, parameterValue);\n};\n\nLhApp.Function.Url.setParameterValueOnUrl = function (url, parameterKey, parameterValue) {\n\n var newUrl;\n\n var queryString = '';\n var hasQueryString = (url.indexOf('?') > -1);\n\n if (hasQueryString) {\n queryString = url.substring(url.indexOf('?') + 1);\n }\n\n var parameters = queryString.split(\"&\");\n\n if (queryString.indexOf(parameterKey) >= 0) {\n\n for (var i = 0; i < parameters.length; i++) {\n var pair = parameters[i].split(\"=\");\n if (pair[0] == parameterKey) {\n parameters[i] = pair[0] + \"=\" + parameterValue;\n }\n }\n\n queryString = parameters.join(\"&\");\n\n } else {\n if (hasQueryString) {\n queryString += '&' + parameterKey + '=' + parameterValue;\n } else {\n queryString += '?' + parameterKey + '=' + parameterValue;\n }\n }\n\n if (hasQueryString) {\n newUrl = url.substring(0, url.indexOf('?') + 1) + queryString;\n } else {\n newUrl = url + queryString;\n }\n\n return newUrl;\n};\n\nLhApp.Function.Url.removeParameter = function (parameterKey) {\n\n var url = window.location.href;\n var parameterKeys = [parameterKey];\n\n return this.removeParametersFromUrl(url, parameterKeys);\n};\n\nLhApp.Function.Url.removeParameterFromUrl = function (url, parameterKey) {\n var parameterKeys = [parameterKey];\n\n return this.removeParametersFromUrl(url, parameterKeys);\n};\n\nLhApp.Function.Url.removeParameters = function (parameterKeys) {\n\n var url = window.location.href;\n\n return this.removeParametersFromUrl(url, parameterKeys);\n};\n\nLhApp.Function.Url.removeParametersFromUrl = function (url, parameterKeys) {\n\n var newUrl = url;\n\n $.each(parameterKeys, function (index, parameterKey) {\n\n var queryString = '';\n var hasQueryString = (newUrl.indexOf('?') > -1);\n\n if (hasQueryString) {\n queryString = newUrl.substring(newUrl.indexOf('?') + 1);\n\n var parameters = queryString.split(\"&\");\n\n if (queryString.indexOf(parameterKey) >= 0) {\n\n for (var i = 0; i < parameters.length; i++) {\n var pair = parameters[i].split(\"=\");\n if (pair[0] == parameterKey) {\n parameters.splice(i, 1);\n }\n }\n\n queryString = parameters.join(\"&\");\n if (queryString != \"\")\n newUrl = newUrl.substring(0, newUrl.indexOf('?') + 1) + queryString;\n else\n newUrl = newUrl.substring(0, newUrl.indexOf('?')) + queryString;\n }\n }\n });\n\n return newUrl;\n};\n\nLhApp.Function.getText = function (key) {\n\n if (typeof LhApp.Text == 'undefined')\n return '';\n\n var match = LhApp.Text[key];\n if (match === undefined) {\n var resource = LhApp.Function.getTranslatableTextFromServer(key);\n LhApp.Text[key] = resource;\n match = resource;\n }\n\n return match || '';\n};\n\nLhApp.Function.getTranslatableTextFromServer = function (key) {\n var result = key;\n $.ajax({\n async: false,\n type: 'POST',\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n ContentType: 'application/json; charset=UTF-8',\n url: LhApp.Function.Url.getServiceEndpoint('commonservice.svc/GetTranslatableResource'),\n data: JSON.stringify({\n key: key\n }),\n success: function (response) {\n result = response.d;\n }\n });\n\n return result;\n};\n\nLhApp.Function.String.isEmail = function(text) {\n var re = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,20}|^$/i;\n return re.test(text);\n};\n\nLhApp.Function.String.isAlphaNumeric = function (text) {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n return text.match(letterNumber) || false;\n};\n\nLhApp.Function.initVisitorState = function () {\n\n var cookieValue = Cookies.get(\"VisitorState\");\n if (cookieValue) {\n\n LhApp.Function.checkAndUpdateVisitorState(cookieValue);\n\n } else {\n\n Vendd.Service.call({\n url: 'CmsService.svc/InitVisitorState',\n data: null,\n onSuccess: function (res) {\n\n cookieValue = Cookies.get(\"VisitorState\");\n if (res.success && cookieValue) {\n LhApp.Function.checkAndUpdateVisitorState(cookieValue);\n }\n }\n });\n }\n};\n\nLhApp.Function.checkAndUpdateVisitorState = function (cookieValue) {\n\n if (cookieValue) {\n\n var oldUrl = window.location.href;\n var cookieValueAsUrl = \"?\" + cookieValue;\n\n $('body').removeClass('x-checking-visitor-state').removeAttr('x-checking-visitor-state');\n\n // 1. Checks to update cookie values from querystring\n var oldLanguageCode = LhApp.Function.QueryString.getValueOf(\"languageCode\", cookieValueAsUrl).toLowerCase();\n var newLanguageCode = LhApp.Function.QueryString.getValueOf(\"lang\", oldUrl).toLowerCase();\n\n if (newLanguageCode != '' && newLanguageCode != oldLanguageCode) {\n cookieValue = LhApp.Function.Url.setParameterValueOnUrl(cookieValueAsUrl, \"languageCode\", newLanguageCode).replace(\"?\", \"\");\n Cookies.set(\"VisitorState\", cookieValue, { secure: LhApp.Context.Request.IsSecure, samesite: 'Lax' });\n cookieValueAsUrl = \"?\" + cookieValue;\n }\n\n var oldCountryCode = LhApp.Function.QueryString.getValueOf(\"countryCode\", cookieValueAsUrl).toLowerCase();\n var newCountryCode = LhApp.Function.QueryString.getValueOf(\"country\", oldUrl).toLowerCase();\n\n if (newCountryCode != '' && newCountryCode != oldCountryCode) {\n cookieValue = LhApp.Function.Url.setParameterValueOnUrl(cookieValueAsUrl, \"countryCode\", newCountryCode).replace(\"?\", \"\");\n Cookies.set(\"VisitorState\", cookieValue, { secure: LhApp.Context.Request.IsSecure, samesite: 'Lax' });\n cookieValueAsUrl = \"?\" + cookieValue;\n }\n\n var oldCurrencyCode = LhApp.Function.QueryString.getValueOf(\"currencyCode\", cookieValueAsUrl).toLowerCase();\n var newCurrencyCode = LhApp.Function.QueryString.getValueOf(\"currency\", oldUrl).toLowerCase();\n\n if (newCurrencyCode != '' && newCurrencyCode != oldCurrencyCode) {\n cookieValue = LhApp.Function.Url.setParameterValueOnUrl(cookieValueAsUrl, \"currencyCode\", newCurrencyCode).replace(\"?\", \"\");\n Cookies.set(\"VisitorState\", cookieValue, { secure: LhApp.Context.Request.IsSecure, samesite: 'Lax' });\n cookieValueAsUrl = \"?\" + cookieValue;\n }\n }\n};\n\nLhApp.Function.hideExpandables = function (wrapper) {\n var $expandables = $('*[data-expandablecontainer].x-expanded:not(.x-loading)', $(wrapper));\n $expandables.each(function (i, item) {\n var $expandable = $(item);\n $expandable.removeClass('x-expanded');\n $('*[data-expandabletrigger=\"' + $expandable.data('expandablecontainer') + '\"].x-open', $(wrapper)).removeClass('x-open');\n });\n};\n\nLhApp.Function.bindUndropables = function (wrapper) {\n var $wrapper = $(wrapper);\n\n var $undropableElements = $('*[data-undropable]', $wrapper);\n $undropableElements.on('drop', function (e) {\n if (typeof (e.preventDefault) === 'function')\n e.preventDefault();\n });\n};\n\nLhApp.Function.bindExpandables = function (wrapper) {\n var $wrapper = $(wrapper);\n\n var $expandableContainers = $('*[data-expandablecontainer]', $wrapper);\n $expandableContainers.click(function (e) {\n e.stopPropagation();\n });\n\n var $triggers = $('*[data-expandabletrigger]', $wrapper);\n $triggers.each(function (i, item) {\n var $trigger = $(item);\n\n var triggerValue = $trigger.data('expandabletrigger');\n var $expandableContainer = $('*[data-expandablecontainer=\"' + triggerValue + '\"]', $wrapper);\n\n var $triggers = $('*[data-expandabletrigger=\"' + triggerValue + '\"]', $wrapper);\n\n if ($expandableContainer.length > 0) {\n $triggers.unbind('click');\n $triggers.click(function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n $('*[data-expandablecontainer].x-expanded').each(function (w, wItem) {\n var wItemContainer = $(wItem).data('expandablecontainer');\n if (wItemContainer != triggerValue) {\n $(wItem).removeClass('x-expanded');\n $('*[data-expandabletrigger=\"' + wItemContainer + '\"].x-open').removeClass('x-open');\n }\n });\n\n if ($expandableContainer.hasClass('x-expanded')) {\n $expandableContainer.removeClass('x-expanded');\n $triggers.removeClass('x-open');\n } else {\n $expandableContainer.addClass('x-expanded');\n $triggers.addClass('x-open');\n\n EventManager.trigger('lazyload');\n }\n });\n }\n });\n};\n\nLhApp.Function.isButtonDisabled = function (buttonWrapper) {\n var isDisabled = false;\n\n if ($(buttonWrapper).get(0).tagName.toLowerCase() == 'input') {\n if ($(buttonWrapper).is(':disabled'))\n isDisabled = true;\n }\n else {\n var $internalButton = $(buttonWrapper).find('input:button');\n if ($internalButton.length > 0) {\n if ($internalButton.is(':disabled'))\n isDisabled = true;\n }\n else if ($(buttonWrapper).hasClass('x-disabled')) {\n isDisabled = true;\n }\n }\n\n return isDisabled;\n};\n\nLhApp.Function.bindHrefButtons = function (wrapper) {\n $('*[data-href]', $(wrapper)).click(function (e) {\n if (e !== undefined && typeof (e.preventDefault) == 'function')\n e.preventDefault();\n\n var isDisabled = LhApp.Function.isButtonDisabled(this);\n if (isDisabled) {\n e.preventDefault();\n }\n else {\n document.location = $(this).data('href');\n }\n });\n};\n\nLhApp.Function.bindScrollable = function (wrapper) {\n $('*[data-scroll-to]', $(wrapper)).click(function () {\n var $this = $(this),\n element = $this.data('scroll-to'), time = $this.data('scroll-time'), offset = $this.data('scroll-offset'),\n time = (typeof time == \"undefined\" || time == \"\") ? 600 : time,\n offset = (typeof offset == \"undefined\" || offset == \"\") ? -10 : offset;\n\n if (element == \"\")\n return;\n\n if (element == \"top\") {\n $('html, body').animate({\n scrollTop: 0\n }, time);\n }\n if (element == \"bottom\") {\n $('html, body').animate({\n scrollTop: $('body').height()\n }, time);\n }\n if ($(element).length > 0) {\n $('html, body').animate({\n scrollTop: $(element).offset().top + offset\n }, time);\n }\n });\n};\n\nLhApp.Function.bindLazyLoadableImages = function (wrapper) {\n\n var $selectedWrapper;\n if ($(wrapper).data('lazy-load-init')) {\n $selectedWrapper = $(wrapper);\n } else {\n $selectedWrapper = $('*[data-lazy-load-init]', $(wrapper));\n }\n\n $selectedWrapper.each(function (i, innerWrapper) {\n\n var $innerWrapper = $(innerWrapper);\n var $lazyLoadOptions = $('*[data-input=\"lazy-load-options\"]', $innerWrapper);\n var initLazyLoad = $innerWrapper.data('lazy-load-init');\n\n if (initLazyLoad) {\n\n var opts = {};\n var defOptions = {\n effect: \"fadeIn\"\n };\n\n if ($lazyLoadOptions.length == 1) {\n $.extend(true, opts, defOptions, JSON.parse($lazyLoadOptions.val()));\n } else {\n $.extend(true, opts, defOptions);\n }\n\n var $images = $(\"img[data-lazyload]\", $innerWrapper);\n if ($images.length > 0 && typeof $.fn.lazyload === \"function\") {\n $($images, $innerWrapper).lazyload(opts);\n }\n\n }\n\n if ($lazyLoadOptions.length > 0) {\n $lazyLoadOptions.remove();\n }\n\n });\n\n if ($.inArray('lazyload', EventManager.events) == -1) {\n EventManager.bind('lazyload', function () {\n $(window).trigger('lazyload');\n });\n }\n\n};\n\nLhApp.Function.PageTrackingRequest = function () {\n var url = decodeURIComponent(LhApp.Context.Request.RawUrl);\n var qstr = url.substring(url.indexOf('?') + 1);\n var dataItem = {\n querystring: qstr,\n cookie: document.cookie\n };\n\n Vendd.Service.call({\n url: 'MarkService.svc/PageTracking',\n data: { query: dataItem },\n onSuccess: function (res) {\n\n var cookies = res;\n for (var i = 0; i < cookies.length; i++) {\n document.cookie = cookies[i].Name + \"=\" + cookies[i].Value + \"; expires=\" + (new Date(cookies[i].Expires)).toUTCString() + \"; path=\" + cookies[i].Path;\n }\n }\n });\n};\n\nLhApp.Function.MailChimpEcommerce360Tracking = function (oId, cId, eId) {\n\n Vendd.Service.call({\n url: 'MarkService.svc/MailChimpEcommerce360Tracking',\n data: { orderId: oId, campaignId: cId, emailId: eId }\n });\n};\n\nLhApp.Function.applyExchangeRate = function (price) {\n return LhApp.Function.applyExchangeRateExtended(price, LhApp.Context.Currency.ExchangeRate);\n};\n\nLhApp.Function.applyExchangeRateExtended = function (price, rate) {\n return price * rate;\n};\n\nvar RenderPrice = function (price) {\n return LhApp.Function.renderPriceExtended(price, false, ' ', '', '');\n};\n\nvar RenderPriceExtended = function (price, isShopDefaultCurrency, separatorSymbol, prefixSymbol, suffixSymbol) {\n return LhApp.Function.renderPriceExtended(price, isShopDefaultCurrency, separatorSymbol, prefixSymbol, suffixSymbol);\n};\n\nLhApp.Function.renderPrice = function (price) {\n return LhApp.Function.renderPriceExtended(price, false, ' ', '', '');\n};\n\nLhApp.Function.renderPriceExtended = function (price, isShopDefaultCurrency, separatorSymbol, prefixSymbol, suffixSymbol) {\n\n var symbol = LhApp.Context.Currency.Symbol;\n var numberOfDigits = LhApp.Context.Currency.NumberOfDigits;\n var symbolShownFirst = LhApp.Context.Currency.SymbolShownFirst;\n var doShowSymbol = LhApp.Context.Currency.DoShowSymbol;\n\n if (isShopDefaultCurrency) {\n symbol = LhApp.Context.ShopDefaultCurrency.Symbol;\n numberOfDigits = LhApp.Context.ShopDefaultCurrency.NumberOfDigits;\n symbolShownFirst = LhApp.Context.ShopDefaultCurrency.SymbolShownFirst;\n doShowSymbol = LhApp.Context.ShopDefaultCurrency.DoShowSymbol;\n }\n\n var formatedPrice = price.toFixed(numberOfDigits).replace('.', ',');\n\n if (doShowSymbol) {\n if (!symbolShownFirst) {\n formatedPrice = formatedPrice + separatorSymbol + symbol;\n } else {\n formatedPrice = symbol + separatorSymbol + formatedPrice;\n }\n }\n\n if (prefixSymbol != '') {\n formatedPrice = prefixSymbol + separatorSymbol + formatedPrice;\n }\n\n if (suffixSymbol != '') {\n formatedPrice = formatedPrice + separatorSymbol + suffixSymbol;\n }\n\n return formatedPrice;\n};\n\nvar RenderPointsPrice = function (pointsPrice) {\n return LhApp.Function.renderPointsPriceExtended(pointsPrice, ',', ' ', '', '');\n};\n\nvar RenderPointsPriceExtended = function (pointsPrice, commaSymbol, separatorSymbol, prefixSymbol, suffixSymbol) {\n return LhApp.Function.renderPointsPriceExtended(pointsPrice, commaSymbol, prefixSymbol, suffixSymbol);\n};\n\nLhApp.Function.renderPointsPriceExtended = function (pointsPrice, commaSymbol, separatorSymbol, prefixSymbol, suffixSymbol) {\n\n if (suffixSymbol == '') {\n suffixSymbol = pointsPrice === 1 ? 'point' : 'points';\n }\n\n var innerSuffixSymbol = suffixSymbol.length > 1 ? ' ' + LhApp.Function.getText('Common:PointsPriceSymbol_' + suffixSymbol) : suffixSymbol;\n\n var formatedPrice = pointsPrice.toFixed(2).replace('.00', '').replace('.', commaSymbol);\n\n if (prefixSymbol != '') {\n formatedPrice = prefixSymbol + separatorSymbol + formatedPrice;\n }\n\n if (innerSuffixSymbol != '') {\n formatedPrice = formatedPrice + separatorSymbol + innerSuffixSymbol;\n }\n\n return formatedPrice;\n};\n\nLhApp.Function.validateClientModel = function (model) {\n if (!model) return false;\n\n if (!model.LangCode || model.LangCode != LhApp.Context.Language) return false;\n\n if (!model.CurrCode || model.CurrCode != LhApp.Context.Currency.Code) return false;\n\n return true;\n}\n\nvar ReplacePrices = function (obj) {\n $('.x-product-box[data-productid]').each(function (i, el) {\n var itemId = parseInt($(el).attr('data-productid'));\n\n var itemData = obj.filter(function (a) { return a.Id === itemId })[0]\n\n var DeletedPrice = parseFloat(itemData.DeletedPrice);\n var Price = parseFloat(itemData.Price);\n var TotalPointsPrice = parseFloat(itemData.TotalPointsPrice);\n var TotalPointsGain = parseFloat(itemData.TotalPointsGain);\n var PointsPrice = parseFloat(itemData.PointsPrice);\n var PointsGain = parseFloat(itemData.PointsGain);\n\n // hide all\n $('.prices', el).addClass('hide');\n $('.deleted-price-container', el).addClass('hide');\n $('.current-price-container', el).addClass('hide');\n $('.current-point-price-container.1', el).addClass('hide');\n $('.current-point-price-container.2', el).addClass('hide');\n $('.current-point-price-container.3', el).addClass('hide');\n $('.current-point-price-container.4', el).addClass('hide');\n\n if (DeletedPrice > 0 || Price > 0 || TotalPointsPrice > 0 || TotalPointsGain > 0 || PointsPrice > 0 || PointsGain > 0) {\n $('.prices', el).removeClass('hide');\n\n if ((DeletedPrice > 0) && (DeletedPrice > Price)) {\n $('.deleted-price-container', el).removeClass('hide');\n $('.deleted-price', el).text(RenderPrice(itemData.DeletedPrice));\n }\n\n if (Price > 0) {\n $('.current-price-container', el).removeClass('hide');\n $('.current-price', el).text(RenderPrice(itemData.Price));\n }\n\n if (PointsPrice > 0 && PointsPrice != TotalPointsPrice) {\n $('.current-point-price-container.1', el).removeClass('hide');\n $('.current-point-price-container.1 .points-price', el).text(RenderPointsPrice(PointsPrice));\n }\n\n if (TotalPointsGain > 0) {\n $('.current-point-price-container.2', el).removeClass('hide');\n $('.current-point-price-container.2 .points-gain', el).text(RenderPointsPrice(TotalPointsGain));\n }\n\n if (PointsGain > 0 && TotalPointsGain === 0) {\n $('.current-point-price-container.3', el).removeClass('hide');\n $('.current-point-price-container.3 .points-gain', el).text(RenderPointsPrice(PointsGain));\n }\n\n if (TotalPointsPrice > 0) {\n $('.current-point-price-container.4', el).removeClass('hide');\n $('.current-point-price-container.4 .points-price', el).text(RenderPointsPrice(TotalPointsPrice));\n }\n }\n });\n}\n\nvar ReplaceAvailabilities = function (obj) {\n $('.x-product-box[data-productid]').each(function (i, el) {\n var itemId = parseInt($(el).attr('data-productid'));\n var itemData = obj.filter(function (a) { return a.Id === itemId })[0]\n\n var cartEnabled = itemData.CanBuy === true || itemData.CanBuyWithPoints === true;\n var wishlistEnabled = itemData.CanAddToList === true;\n\n if ($('.buttons .add-to-cart').length > 0 && $('.buttons .add-to-cart input').length > 0) {\n $('.buttons .add-to-cart').addClass('x-disabled');\n $('.buttons .add-to-cart input').attr('disabled', 'disabled');\n\n if (cartEnabled === true) {\n $('.buttons .add-to-cart').removeClass('x-disabled');\n $('.buttons .add-to-cart input').removeAttr('disabled', 'disabled');\n }\n }\n\n //if ($('.buttons .add-to-wishlist').length > 0 && $('.buttons .add-to-wishlist input').length > 0) {\n //$('.buttons .add-to-wishlist').addClass('x-disabled');\n //$('.buttons .add-to-wishlist input').attr('disabled', 'disabled');\n\n //if (wishlistEnabled === true) {\n //$('.buttons .add-to-wishlist').removeClass('x-disabled');\n //$('.buttons .add-to-wishlist input').removeAttr('disabled', 'disabled');\n //}\n //}\n });\n}\n\nLhApp.Function.validateTaxIdentifier = function (isInvoice, countryCode, taxIdentifier) {\n if (isInvoice === true && taxIdentifier.length > 0) {\n if (countryCode === 'GR') {\n if (!isNaN(parseInt(taxIdentifier)) && taxIdentifier.length === 9) {\n var result = 0;\n var arrTaxId = taxIdentifier.split(\"\").map(function (item) {\n return parseInt(item);\n });\n\n for (var i = arrTaxId.length - 2; i >= 0 ; i--) {\n result = result + arrTaxId[i] * Math.pow(2, (8 - i));\n }\n\n if ((result % 11) % 10 === arrTaxId[8]) {\n return true;\n } else {\n return false;\n }\n }\n }\n else\n return true;\n }\n\n return false;\n};\n\nLhApp.pauseScroll = false;\n\nLhApp.init = function () {\n\n LhApp.Function.bindScrollable($('body').get(0));\n LhApp.Function.bindExpandables($('body').get(0));\n LhApp.Function.bindHrefButtons($('body').get(0));\n LhApp.Function.bindUndropables($('body').get(0));\n //LhApp.Function.bindLazyLoadableImages($('body').get(0)); \n\n $('body').click(function (e) {\n LhApp.Function.hideExpandables(this);\n });\n\n $(document).scroll(function (e) {\n if (!LhApp.pauseScroll)\n LhApp.Function.hideExpandables($('body').get(0));\n });\n};\n\nvar disqus_config = function () {\n\n if (LhApp.Context.Item.Id && LhApp.Context.Request.FriendlyUrl) {\n\n this.page.url = LhApp.Context.Request.BaseUrl + LhApp.Context.Request.FriendlyUrl;\n this.page.identifier = LhApp.Context.Item.Id;\n\n }\n};\n\nvar replaceIframe = function (idFrame, url) {\n var originalFrame = document.getElementById(idFrame);\n var newFrame = document.createElement(\"iframe\");\n newFrame.id = originalFrame.getAttribute(\"id\");\n newFrame.width = originalFrame.getAttribute(\"width\");\n newFrame.height = originalFrame.getAttribute(\"height\");\n newFrame.style.display = \"none\";\n newFrame.src = url;\n var parent = originalFrame.parentNode;\n parent.replaceChild(newFrame, originalFrame);\n};\n\nvar convertToGreek = function () {\n $(\"input[type='text'].js-convert-to-greek\").keyup(function () {\n if ($(this).closest('.form-row').find('.js-disable-conversion').is(':checked')) return;\n var str = $(this).val().toUpperCase();\n var newstr = [];\n for (var i = 0, len = str.length; i < len; i++) {\n newstr[i] = convertCharacters(str[i]);\n }\n $(this).val(newstr.join(\"\"));\n $(this).trigger(\"input\"); //just to let angular know\n });\n};\n\nvar convertToUppercase = function () {\n $(\"input[type='text'].js-convert-to-uppercase\").keyup(function () {\n if ($(this).closest('.form-row').find('.js-disable-conversion').is(':checked')) return;\n //convert letter to uppercase\n var str = $(this).val().toUpperCase();\n //remove accents \n str = str.replace(/Ά/g, 'Α')\n .replace(/Έ/g, 'Ε')\n .replace(/Ή/g, 'Η')\n .replace(/Ί/g, 'Ι')\n .replace(/Ό/g, 'Ο')\n .replace(/Ύ/g, 'Υ')\n .replace(/Ώ/g, 'Ω');\n\n $(this).val(str);\n $(this).trigger(\"input\"); //just to let angular know\n });\n};\n\nvar convertCharacters = function(character) {\n switch (character) {\n case \"A\":\n character = 'Α';\n break;\n case \"B\":\n character = 'Β';\n break;\n case \"C\":\n character = 'Ψ';\n break;\n case \"D\":\n character = 'Δ';\n break;\n case \"E\":\n character = 'Ε';\n break;\n case \"F\":\n character = 'Φ';\n break;\n case \"G\":\n character = 'Γ';\n break;\n case \"H\":\n character = 'Η';\n break;\n case \"I\":\n character = 'Ι';\n break;\n case \"J\":\n character = 'Ξ';\n break;\n case \"K\":\n character = 'Κ';\n break;\n case \"L\":\n character = 'Λ';\n break;\n case \"M\":\n character = 'Μ';\n break;\n case \"N\":\n character = 'Ν';\n break;\n case \"O\":\n character = 'Ο';\n break;\n case \"P\":\n character = 'Π';\n break;\n case \"Q\":\n character = 'Κ';\n break;\n case \"R\":\n character = 'Ρ';\n break;\n case \"S\":\n character = 'Σ';\n break;\n case \"T\":\n character = 'Τ';\n break;\n case \"U\":\n character = 'Θ';\n break;\n case \"V\":\n character = 'Ω';\n break;\n case \"W\":\n character = 'Σ';\n break;\n case \"X\":\n character = 'Χ';\n break;\n case \"Y\":\n character = 'Υ';\n break;\n case \"Z\":\n character = 'Ζ';\n break;\n }\n return character;\n}","if (typeof localStorage === 'object') {\n\ttry {\n\t\tlocalStorage.setItem('localStorage', 1);\n\t\tlocalStorage.removeItem('localStorage');\n\t} catch (e) {\n\t\tStorage.prototype._setItem = Storage.prototype.setItem;\n\t\tStorage.prototype.setItem = function () { };\n\t}\n}","$(document).ready(function() {\n\n window.ScriptsActivator.funcLoaded = false;\n window.ScriptsActivator.markLoaded = false;\n window.ScriptsActivator.statLoaded = false;\n\n window.ScriptsActivator.loadScripts = function (scripts) {\n if (Object.keys(scripts).length === 0)\n return;\n\n for (var key in scripts) {\n var s = scripts[key];\n if (typeof s === \"function\") {\n s.call();\n } else {\n for (var skey in s) {\n var ss = s[skey];\n if (typeof ss === \"function\") {\n ss.call();\n }\n }\n }\n }\n }\n\n window.ScriptsActivator.loadFunctionalityScripts = function () {\n this.loadScripts(window.ScriptsActivator.funcFn);\n this.funcLoaded = true;\n };\n\n window.ScriptsActivator.loadMarketingScripts = function () {\n this.loadScripts(window.ScriptsActivator.markFn);\n this.markLoaded = true;\n };\n\n window.ScriptsActivator.loadStatisticsScripts = function () {\n this.loadScripts(window.ScriptsActivator.statFn);\n this.statLoaded = true;\n };\n\n window.ScriptsActivator.loadAllScripts = function (func, mark, stat) {\n if (func && !this.funcLoaded)\n this.loadFunctionalityScripts();\n\n if (mark && !this.markLoaded)\n this.loadMarketingScripts();\n\n if (stat && !this.statLoaded)\n this.loadStatisticsScripts();\n }\n\n window.ScriptsActivator.removeScriptsElements = function() {\n $(\"script[data-script]\").each(function(a,script) {\n if (script) {\n $(script).remove();\n }\n });\n }\n\n window.ScriptsActivator.removeScriptsElements();\n});\n","var Vendd = (function (Vendd) {\n 'use strict';\n\n Vendd.Service = (function (Service) {\n\n Service.call = function (options) {\n var defOpts, opts, serviceUrl, onErrorInternal;\n\n defOpts = {\n async: true,\n method: options.method || 'POST',\n url: '#',\n data: {},\n rawdata: false,\n servicenamespace: options.servicenamespace || 'services',\n onSuccess: function (response) {\n },\n onFailure: function (err) {\n throw err;\n },\n onUnauthenticated: function (url) {\n throw new Error('not implemented: onUnauthenticated(url)');\n }\n };\n\n opts = _.extend(defOpts, options);\n\n serviceUrl = /^([^:]+:)?\\/\\//.test(opts.url) ? // is it an absolute url? dont't touch it\n opts.url :\n document.location.protocol.toLowerCase()\n + '//' + document.location.host.toLowerCase()\n + (opts.servicenamespace ? '/' + opts.servicenamespace : '')\n + '/' + opts.url;\n\n serviceUrl = serviceUrl.split('?')[0];\n\n var locationQueryParams = LhApp.Function.QueryString.parse(window.location.href);\n\n var serviceQueryParams = LhApp.Function.QueryString.parse(opts.url);\n\n ///force current page language in every service request\n if (!serviceQueryParams['lang']) {\n serviceQueryParams['lang'] = (locationQueryParams['lang'] || LhApp.Context.Language).toLowerCase();;\n }\n ///force country in every service request IF PRESENT in current url\n if (!serviceQueryParams['country'] && locationQueryParams['country']) {\n serviceQueryParams['country'] = locationQueryParams['country'].toLowerCase();\n }\n ///force currency in every service request IF PRESENT in current url\n if (!serviceQueryParams['currency'] && locationQueryParams['currency']) {\n serviceQueryParams['currency'] = locationQueryParams['currency'].toLowerCase();\n }\n \n var _data = {};\n var _query;\n //if is get request the data will be posted as query. any key present in queryparams will be overriten by the value of the same key (if exists) in data\n if ((options.method || 'POST').toUpperCase() == 'GET') {\n _.each(opts.data, function (val, key) {\n _data[key.toLowerCase()] = val;\n });\n _data = _.extend(serviceQueryParams, opts.data);\n }\n else {\n _data = opts.data;\n _query = $.param(serviceQueryParams).toString();\n }\n\n if (_query)\n serviceUrl += '?' + _query; \n\n onErrorInternal = function (ex) {\n if (ex && ex.responseJSON && ex.responseJSON.ExceptionType) {\n var typeName = ex.responseJSON.ExceptionType.split('.').pop();\n\n if (typeName === 'AuthenticationServiceException') {\n if (typeof (opts.onUnauthenticated) === 'function') {\n opts.onUnauthenticated(ex.responseJSON.Message);\n }\n else {\n throw ex;\n }\n }\n else {\n if (typeof (opts.onFailure) === 'function') {\n opts.onFailure(ex);\n }\n else {\n throw ex;\n }\n }\n }\n else {\n if (typeof (opts.onFailure) === 'function') {\n opts.onFailure(ex);\n }\n else {\n throw ex;\n }\n }\n };\n\n $.ajax({\n async: opts.async || true,\n type: opts.method,\n dataType: opts.rawdata ? 'text' : 'json',\n contentType: opts.rawdata ? '' : 'application/json; charset=UTF-8',\n ContentType: opts.rawdata ? '' : 'application/json; charset=UTF-8',\n url: serviceUrl,\n data: (opts.method == 'GET') ? _data : opts.rawdata ? _data : JSON.stringify(_data),\n success: function (response) {\n\n var obj = response;\n\n if (response.d)\n obj = response.d;\n\n if (typeof obj === 'string' || obj instanceof String)\n obj = JSON.parse(obj);\n\n if (typeof (opts.onSuccess) === 'function') {\n opts.onSuccess(obj);\n }\n },\n failure: function (ex) {\n onErrorInternal(ex);\n },\n error: function (ex) {\n onErrorInternal(ex);\n }\n });\n };\n\n return Service;\n\n })(Vendd.Service || {});\n\n return Vendd;\n\n})(Vendd || {});","var Vendd = (function (Vendd) {\n 'use strict';\n /*\n * ERROR CODE\n * ---------------\n * 1000 INVALID CONFIGURATOR ITEM ID\n * 1001 CONFIGURATOR NOT FOUND / INITIALIZED\n * 1002 INVALID CONFIGURATOR MODEL DATA\n * 1003 INVALID OPTIONAL ITEM ID\n * 1004 INVALID CONFIGURATOR VALUES \n * 1010 MIN QUANTITY OF OPTIONAL ITEM\n * 1011 MAX QUANTITY OF OPTIONAL ITEM\n * 1012 DEFAULT OPTIONAL ITEM CAN NOT REMOVE\n * 1020 MIN QUANTITY FOR GROUP OF OPTIONAL ITEMS\n * 1021 MAX QUANTITY FOR GROUP OF OPTIONAL ITEMS\n * 1040 MIN QUANTITY FOR ALL ITEMS\n * 1041 MAX QUANTITY FOR ALL ITEMS\n * 1030 INCOMATIBLE OPTIONAL ITEM\n * 1031 PREREQUISITES FOR OPTIONAL ITEM NOT EXIST\n * 1032 ERROR CODE 1030 & ERROR CODE 1031\n * 1033 NOT EXISTS ANY OF REQUIRED INGREDIENTS\n * 1034 INGREDIENT DISABLED FROM SELECTED SUBRECIPE\n * 1035 INGREDIENT DISABLED FROM MASTER RECIPE\n * 1050 NO LOCAL STORAGE CONFIGURATOR MODEL SAVED\n * 1060 ERROR SAVING DATA\n * 1061 ERROR SAVING DATA - NOT SET CONFIGURATOR ITEM ID\n * 1070 OUTDATED LOADED DATA\n * 1071 ERROR LOADING DATA - NOT GLOBALID SET\n * 1072 ERROR LOADING DATA - SAVED INGREDIENT DOES NOT EXISTS ANY MORE\n * 1073 ERROR LOADING DATA - SAVED INGREDIENT CHANGE PRICE\n * 1074 ERROR LOADING DATA - SAVED INGREDIENT CHANGE INCOMPATIBLES\n * 1075 ERROR LOADING DATA - SAVED INGREDIENT CHANGE PREREQUISITES\n * */\n var _recipes = {};\n var _recipesOld = {};\n var returnResponse = function (recipeId, statusCode, errorCode, data) {\n\n\n return {\n success: statusCode === 200,\n data: data || {},\n status: {\n statusCode: statusCode,\n recipeId: recipeId,\n ErrorCode: errorCode || 0\n }\n }\n };\n\n var getRecipe = function (model, recipeId) {\n\n var recipeModel = model ? model : testModel,\n recipe = _.isArray(recipeModel) ? _.first(_.filter(recipeModel, function (x) { return x.RecipeId === recipeId && x.TotalCount > 0; })) : recipeModel;\n\n return $.extend(true, {}, recipe);\n };\n\n var getTotalQuantity = function (model, ingredientId) {\n var items = _.filter(model.RecipeItems, function (item) { return item.IngredientId !== ingredientId; });\n return _.reduce(items, function (memo, item) { return memo + (item.Quantity || 0); }, 0);\n }\n\n var getGroupQuantity = function (model, group, ingredientId) {\n var items = _.filter(model.RecipeItems, function (item) { return item.GroupId === group.Id && item.IngredientId !== ingredientId; });\n return _.reduce(items, function (memo, item) { return memo + (item.Quantity || 0); }, 0);\n }\n\n var getTotalWeight = function (model, ingredientId) {\n var items = _.filter(model.RecipeItems, function (item) { return item.IngredientId !== ingredientId; });\n return _.reduce(items, function (memo, item) { return memo + (item.Weight || 0); }, 0);\n }\n Vendd.RecipeLibrary = Vendd.RecipeLibrary || {};\n\n Vendd.RecipeLibrary.DeclareState = function (model, recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n _recipes[recipeId] = model;\n var data = {};\n data.recipe = $.extend(true, {}, model);\n data.isValid = checkRestrictions(model);\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.GetModel = function (recipeId) {\n\n if (!_recipes[recipeId]) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n return returnResponse(recipeId, 200, 0, _recipes[recipeId]);\n };\n\n Vendd.RecipeLibrary.InitRecipe = function (model, recipeId, force) {\n force = force || false;\n if (_recipes[recipeId] && !force) {\n return returnResponse(recipeId, 500, 1000);\n }\n var recipe = getRecipe(model, recipeId);\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n _recipes[recipeId] = recipe;\n _recipes[recipeId].AFirstInclusion = 1;\n\n _recipes[recipeId].Ingredients = [];\n _recipes[recipeId].Groups = [];\n _recipes[recipeId].RecipeItems = [];\n\n $.each(recipe.Categories, function (indexCategory, category) {\n $.each(category.Groups, function (indexGroup, group) {\n $.each(group.VisualGroups, function (indexGroup, visualgroup) {\n var groupItems = _.reduce(visualgroup, function (vg, sum) { return vg.length + sum; });\n group.IsMultiSelect = !(group.MinQuantity <= 1 && group.MaxQuantity === 1 && groupItems > 1);\n group.DefaultQuantities = 0;\n\n if (!group.IsMultiSelect && group.MinQuantity === 0) {\n var sampleOptionItemNone = {\n CanRemove: true,\n Category: category.Category,\n DefaultQuantity: 0,\n DeletedPrice: 0,\n DeletedPriceText: \"\",\n Price: 0,\n PriceText: \"\",\n PriceWithoutVat: 0,\n PriceWithoutVatText: \"\",\n MinQuantity: 0,\n MaxQuantity: 1,\n Weight: 0,\n Name: \"None of below\",\n OrderNumber: 0,\n Quanta: 1,\n QuantaText: \"\",\n RecipeGroupId: group.Id,\n RecipeGroupName: group.Name,\n IngredientId: 0,\n Stock: 1,\n TaxClassId: 0,\n VariantId: 0,\n IsNullable: true\n };\n visualgroup.Items.unshift(sampleOptionItemNone);\n }\n\n $.each(visualgroup.Items, function (indexItem, item) {\n //fix wrong default value from min-max item quantity\n group.DefaultQuantities += item.DefaultQuantity;\n item.HasValidDefaultValues = item.MinQuantity <= item.DefaultQuantity && item.MaxQuantity >= item.DefaultQuantity;\n item.DefaultQuantity = item.MinQuantity > item.DefaultQuantity ? item.MinQuantity : item.MaxQuantity < item.DefaultQuantity ? item.MaxQuantity : item.DefaultQuantity;\n item.IsMandatory = item.MinQuantity === item.DefaultQuantity || !item.CanRemove;\n item.Disabled = (item.MinQuantity === item.DefaultQuantity && item.MaxQuantity === item.DefaultQuantity && item.DefaultQuantity > 0) || !item.CanRemove;\n item.Checked = item.IsDefault;\n var ingredient = item;\n ingredient.GroupId = group.Id;\n _recipes[recipeId].Ingredients.push(ingredient);\n if (item.Price <= 0) {\n item.Price = 0;\n item.PriceText = \"\";\n }\n if (ingredient.DefaultQuantity > 0) {\n _recipes[recipeId].RecipeItems.push({\n RecipeId: recipeId,\n Category: ingredient.Category,\n CategoryCode: ingredient.CategoryCode,\n ManufacturerProductCode: ingredient.ManufacturerProductCode,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemCode: ingredient.RecipeItemCode,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n Quantity: ingredient.DefaultQuantity,\n Price: 0,//(Math.round(ingredient.Price * 100) / 100) * ingredient.DefaultQuantity,\n PriceWithoutVat: 0,\n TotalPrice: 0,\n TotalPriceWithoutVat: 0,\n Weight: ingredient.Weight || 0,\n IsStandard: ingredient.DefaultQuantity > 0,\n SubRecipeId: ingredient.SubRecipeId,\n SubRecipeCode: ingredient.SubRecipeCode\n });\n }\n });\n group.HasValidDefaultValues = group.MinQuantity <= group.DefaultQuantities && group.MaxQuantity >= group.DefaultQuantities;\n if (!group.IsMultiSelect && group.DefaultQuantities === 0 && group.MinQuantity === 0) {\n var defaultItem = visualgroup.Items[0];\n defaultItem.Checked = true;\n }\n _recipes[recipeId].Groups.push(group);\n });\n });\n });\n\n $.each(_.filter(recipe.Ingredients, function (i) { return i.SubRecipeId && i.SubRecipe; }) || []\n , function (i, s) {\n Vendd.RecipeLibrary.InitRecipe(s.SubRecipe, s.RecipeItemId, force);\n });\n\n _recipes[recipeId].HashCode = getRecipeItemsHashCode(recipeId);\n\n if (localStorage.getItem(\"globalId_\" + recipeId) !== null) {\n localStorage.removeItem(\"globalId_\" + recipeId);\n }\n\n return Vendd.RecipeLibrary.DeclareState(recipe, recipeId);\n };\n\n Vendd.RecipeLibrary.ResetRecipe = function (model, recipeId) {\n\n if (!_recipes[recipeId]) {\n return returnResponse(recipeId, 500, 1000);\n }\n var recipe = getRecipe(model, recipeId);\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n //reinitialize\n delete _recipes[recipeId];\n _recipes[recipeId] = recipe;\n\n if (localStorage.getItem(\"globalId_\" + recipeId) !== null) {\n localStorage.removeItem(\"globalId_\" + recipeId);\n }\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n };\n\n Vendd.RecipeLibrary.AddIngredient = function (model, recipeId, ingredientId, quantity, isTotal) {\n var recipe = _recipes[recipeId];\n\n if (!_recipes[recipeId]) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n\n var group = null;\n var ingredient = _.find(model.Ingredients, function (i) { return i.IngredientId === ingredientId; });\n if (ingredient) group = _.find(model.Groups, function (g) { return g.Id === ingredient.GroupId; });\n\n if (!(ingredient && group)) {\n return returnResponse(recipeId, 500, 1003);\n }\n\n var isCompatible = (Vendd.RecipeLibrary.CheckIncompatibles(recipeId, ingredientId)).success;\n var responsePrerequisites = (Vendd.RecipeLibrary.CheckPrerequisites(recipeId, ingredientId));\n var successPrerequisites = responsePrerequisites.success || (!responsePrerequisites.success && responsePrerequisites.data.BothPrerequisite);\n\n var recipeIngredient = _.first(_.filter(model.RecipeItems, function (x) { return x.IngredientId === ingredientId && x.RecipeId === recipeId; }));\n if (!isCompatible || !successPrerequisites) {\n var errorCode = !isCompatible && !successPrerequisites ? 1032 : !isCompatible ? 1030 : 1031;\n return returnResponse(recipeId, 500, errorCode);\n }\n\n var hasPrerequisitesAnyOfSet = (Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet(recipeId, ingredientId)).success;\n if (!hasPrerequisitesAnyOfSet) {\n return returnResponse(recipeId, 500, 1033);\n }\n var totalIngredientQuantity = isTotal ? quantity : ((recipeIngredient || {}).Quantity || 0) + quantity;\n totalIngredientQuantity = totalIngredientQuantity > 0 ? totalIngredientQuantity : 0;\n\n if (ingredient.MinQuantity && totalIngredientQuantity < ingredient.MinQuantity) {\n return returnResponse(recipeId, 500, 1010);\n }\n if (ingredient.MaxQuantity && totalIngredientQuantity > ingredient.MaxQuantity) {\n return returnResponse(recipeId, 500, 1011);\n }\n var maxGroupQuantity = group.MaxQuantity || 0;\n var groupQuantity = getGroupQuantity(model, group, ingredientId);\n\n if (maxGroupQuantity < groupQuantity + totalIngredientQuantity) {\n return returnResponse(recipeId, 500, 1021);\n }\n var maxQuantity = recipe.MaxQuantity || 0;\n var totalQuantity = getTotalQuantity(model, ingredientId);\n\n if (maxQuantity < totalQuantity + totalIngredientQuantity) {\n return returnResponse(recipeId, 500, 1041);\n }\n\n var price = (Math.round(ingredient.Price * 100) / 100);//* totalIngredientQuantity;\n var priceWithoutVat = (Math.round(ingredient.PriceWithoutVat * 100) / 100);//* totalIngredientQuantity;\n\n\n if (model.ParentRecipeId > 0) {\n var parentModel = Vendd.RecipeLibrary.GetModel(model.ParentRecipeItemId) || {};\n var parentIngredient = _.find(parentModel.Ingredients, function (i) { return i.VariantId === ingredient.VariantId; }) || {};\n if ((parentIngredient.IngredientId || 0) > 0) {\n var recipeAddResult = Vendd.RecipeLibrary.AddIngredient(parentModel, model.ParentRecipeItemId, parentIngredient.IngredientId, ingredient.Quantity, true);\n if (!recipeAddResult.success) {\n return returnResponse(recipeId, 500, 1034);\n };\n }\n }\n\n if (recipeIngredient) {\n recipeIngredient.Quantity = totalIngredientQuantity;\n recipeIngredient.Price = price;\n recipeIngredient.PriceWithoutVat = priceWithoutVat;\n } else {\n model.RecipeItems.push({\n RecipeId: recipeId,\n Category: ingredient.Category,\n CategoryCode: ingredient.CategoryCode,\n ManufacturerProductCode: ingredient.ManufacturerProductCode,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemCode: ingredient.RecipeItemCode,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n Quantity: quantity,\n Price: price,\n PriceWithoutVat: priceWithoutVat,\n TotalPrice: Math.max(totalIngredientQuantity - ingredient.DefaultQuantity, 0) * price,\n TotalPriceWithoutVat: Math.max(totalIngredientQuantity - ingredient.DefaultQuantity, 0) * priceWithoutVat,\n Weight: ingredient.Weight,\n IsStandard: ingredient.DefaultQuantity > 0,\n SubRecipeId: ingredient.SubRecipeId,\n SubRecipeCode: ingredient.SubRecipeCode\n });\n }\n\n model.HashCode = getRecipeItemsHashCode(recipeId);\n\n //if (ingredient.SubRecipeId > 0) {\n // var subRecipeModel = Vendd.RecipeLibrary.GetModel(ingredient.RecipeItemId) || {};\n // _.each(subRecipeModel.RecipeItems || [], function (si) {\n // var subRecipeIngredient = _.find(model.Ingredients, function (i) { return i.VariantId == si.VariantId; }) || {};\n // if ((subRecipeIngredient.IngredientId || 0) > 0) {\n // var subRecipeGroup = _.find(model.Groups, function (g) { return subRecipeIngredient.GroupId == g.Id; });\n // var recipeAddResult;\n // if (subRecipeGroup.IsMultiSelect) {\n // recipeAddResult = Vendd.RecipeLibrary.AddIngredient(model, recipeId, subRecipeIngredient.IngredientId, subRecipeIngredient.Quantity, true);\n // } else {\n // var ingredientIdFrom = (_.find(model.RecipeItems, function (i) { return subRecipeIngredient.GroupId == i.GroupId; }) || {}).IngredientId || 0;\n // if (ingredientIdFrom > 0) {\n // recipeAddResult = Vendd.RecipeLibrary.ChangeIngredient(model, recipeId, ingredientIdFrom, subRecipeIngredient.IngredientId);\n // } else {\n // recipeAddResult = Vendd.RecipeLibrary.AddIngredient(model, recipeId, subRecipeIngredient.IngredientId, subRecipeIngredient.Quantity, true);\n // }\n // }\n // if (!recipeAddResult.success) {\n // var subRecipeRemoveResult = Vendd.RecipeLibrary.RemoveIngredient(subRecipeModel, ingredient.RecipeItemId, si.IngredientId, 0, true, true);\n // //Vendd.RecipeLibrary.DeclareState(subRecipeModel, ingredient.RecipeItemId);\n // }\n // }\n // });\n //}\n\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n };\n\n Vendd.RecipeLibrary.RemoveIngredient = function (model, recipeId, ingredientId, quantity, recursive, force) {\n force = force === undefined ? true : force;\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n\n var group = null;\n var ingredient = _.find(model.Ingredients, function (i) { return i.IngredientId === ingredientId; });\n if (ingredient) group = _.find(model.Groups, function (g) { return g.Id === ingredient.GroupId; });\n\n if (!(ingredient && group)) {\n return returnResponse(recipeId, 500, 1003);\n }\n\n var recipeIngredient = _.first(_.filter(model.RecipeItems, function (x) { return x.IngredientId === ingredientId && x.RecipeId === recipeId; }));\n\n var totalIngredientQuantity = recursive ? 0 : ((recipeIngredient || {}).Quantity || 0) - quantity;\n totalIngredientQuantity = totalIngredientQuantity > 0 ? totalIngredientQuantity : 0;\n\n if (ingredient.MinQuantity && totalIngredientQuantity < ingredient.MinQuantity) {\n return returnResponse(recipeId, 500, 1010);\n }\n\n var minGroupQuantity = group.MinQuantity || 0;\n var groupQuantity = getGroupQuantity(model, group, ingredientId);\n\n if (minGroupQuantity > groupQuantity + totalIngredientQuantity && !force) {\n return returnResponse(recipeId, 500, 1020);\n }\n var minQuantity = recipe.MinQuantity || 0;\n var totalQuantity = getTotalQuantity(model, ingredientId);\n\n if (minQuantity > totalQuantity + totalIngredientQuantity && !force) {\n return returnResponse(recipeId, 500, 1040);\n }\n\n if (recipeIngredient && totalIngredientQuantity > 0) {\n recipeIngredient.Quantity = totalIngredientQuantity;\n recipeIngredient.Price = price;\n } else {\n model.RecipeItems = _.filter(model.RecipeItems, function (x) { return x.IngredientId !== ingredientId; });\n }\n\n var ingredientsToBeRemoved = _.filter(model.Ingredients,\n function (i) {\n return i.Prerequisites && i.Prerequisites.indexOf(ingredientId) > -1 && model.RecipeItems.some(function (item) { return item.IngredientId === i.IngredientId });\n });\n\n for (var i = 0; i < ingredientsToBeRemoved.length; i++) {\n Vendd.RecipeLibrary.RemoveIngredient(model, recipeId, ingredientsToBeRemoved[i].IngredientId, null, true, true);\n }\n\n model.HashCode = getRecipeItemsHashCode(recipeId);\n\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n\n };\n\n Vendd.RecipeLibrary.ChangeIngredient = function (model, recipeId, ingredientIdFrom, ingredientIdTo) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n\n var groupFrom = null;\n var ingredientFrom = _.find(model.Ingredients, function (i) { return i.IngredientId === ingredientIdFrom; });\n if (ingredientFrom) groupFrom = _.find(model.Groups, function (g) { return g.Id === ingredientFrom.GroupId; });\n\n if (!(ingredientFrom && groupFrom)) {\n return returnResponse(recipeId, 500, 1003);\n }\n\n var recipeIngredientFrom = _.first(_.filter(model.RecipeItems, function (x) { return x.IngredientId === ingredientIdFrom && x.RecipeId === recipeId; }));\n\n if (!recipeIngredientFrom) {\n return returnResponse(recipeId, 500, 1002);\n }\n var totalQuantity = 1;\n\n model.RecipeItems = _.filter(model.RecipeItems, function (x) { return x.IngredientId !== ingredientIdFrom; });\n\n var ingredientsToBeRemoved = _.filter(model.Ingredients,\n function (i) {\n return i.Prerequisites && i.Prerequisites.indexOf(ingredientIdFrom) > -1 && model.RecipeItems.some(function (item) { return item.IngredientId === i.IngredientId; });\n });\n\n var prerequisitesResult = [];\n\n for (var i = 0; i < ingredientsToBeRemoved.length; i++) {\n prerequisitesResult = Vendd.RecipeLibrary.RemoveIngredient(model, recipeId, ingredientsToBeRemoved[i].IngredientId, null, true, true);\n }\n\n var result = Vendd.RecipeLibrary.AddIngredient(model, recipeId, ingredientIdTo, 1, true);\n\n model.HashCode = getRecipeItemsHashCode(recipeId);\n\n if (result.success) return result;\n\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n\n };\n\n Vendd.RecipeLibrary.GetFullRecipeItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var recipeItems = recipe.RecipeItems || [];\n _.each(\n _.filter(recipe.Ingredients, function (item) {\n return item.SubRecipeId && (_.find(recipeItems, function (i) { return i.IngredientId === item.IngredientId; }) !== undefined);\n }), function (item) {\n if (!item.IsStandard) {\n _.each(_recipes[item.RecipeItemId].RecipeItems, function (ingredient) { ingredient.IsStandard = false; });\n }\n recipeItems = recipeItems.concat(_recipes[item.RecipeItemId].RecipeItems);\n });\n var data = {};\n data.RecipeItems = recipeItems || [];\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.GetRecipeItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var data = {};\n data.RecipeItems = recipe.RecipeItems || [];\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.GetOneDealerData = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var data = {};\n\n data.ManufacturerName = recipe.ManufacturerName || \"\";\n data.ProductCode = recipe.ManufacturerProductCode || \"\";\n data.ManufacturerCode = recipe.ManufacturerCode || \"\";\n data.Series = recipe.CategoryCode || \"\";\n data.Name = recipe.Name || \"\";\n data.Guid = localStorage.getItem(\"globalId_\" + recipeId);\n\n data.Prices = {};\n data.Prices.OptionalTotalPrice = FixJSFloatBug(recipe.Prices.OptionalTotalPriceWithoutVat);\n data.Prices.StandardTotalPrice = FixJSFloatBug(recipe.Prices.StandardTotalPriceWithoutVat);\n data.Prices.InitialPrice = FixJSFloatBug(recipe.Prices.InitialPriceWithoutVat);\n data.Prices.TotalPrice = FixJSFloatBug(recipe.Prices.TotalPriceWithoutVat);\n\n data.ModelImageAbsoluteUrl = recipe.ProductImageUrl;\n\n var cartTypeCode = _.find(recipe.Attributes, function (i) { return i.Code === \"CarTypeCode\"; }) || {};\n data.CarTypeCode = (cartTypeCode.Value || \"Car\");\n var fuelTypeCode = _.find(recipe.Attributes, function (i) { return i.Code === \"FuelTypeCode\"; }) || {};\n data.FuelTypeCode = (fuelTypeCode.Value || \"\");\n var attributes = _.filter(recipe.Attributes, function (i) { return i.Code !== \"CarTypeCode\" && i.Code !== \"FuelTypeCode\"; }) || [];\n data.Attributes = _.map(attributes, function (i) {\n var item = {};\n item.AttributeCode = i.Code;\n item.Value = i.Value;\n item.Type = i.ValueType;\n return item;\n });\n var recipeItems = recipe.RecipeItems || [];\n _.each(\n _.filter(recipe.Ingredients, function (item) {\n return item.SubRecipeId && (_.find(recipeItems, function (i) { return i.IngredientId === item.IngredientId; }) !== undefined);\n }), function (item) {\n if (!item.IsStandard) {\n _.each(_recipes[item.RecipeItemId].RecipeItems, function (ingredient) { ingredient.IsStandard = false; ingredient.SubRecipeCode = item.ManufacturerProductCode; });\n }\n recipeItems = recipeItems.concat(_recipes[item.RecipeItemId].RecipeItems);\n });\n\n data.RecipeItems = _.map(recipeItems || [], function (i) {\n var item = {};\n item.CategoryCode = i.CategoryCode || \"\";\n item.Name = i.Name;\n item.Quantity = i.Quantity;\n //item.Price = i.Price;\n item.Price = i.PriceWithoutVat;\n item.ItemCode = i.ManufacturerProductCode || \"\";\n item.IsPackage = (i.SubRecipeId || 0) > 0;\n item.ParentPackageCode = i.SubRecipeCode || \"\";\n item.OptionType = i.IsStandard ? 0 : 1;\n return item;\n });\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.SetRecipeItems = function (recipeId, recipeItems) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n recipe.RecipeItems = recipeItems || [];\n\n return Vendd.RecipeLibrary.DeclareState(recipe, recipeId);\n };\n\n Vendd.RecipeLibrary.GetCheckedRecipeItems = function (recipeId, forceOptional) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n forceOptional = forceOptional !== undefined ? forceOptional : false;\n //var checkedItems = _.filter(recipe.Ingredients, function (item) { return item.DefaultQuantity > 0; });\n\n //var checkedRecipeItems = _.filter(recipe.RecipeItems, function (item) { return item.Quantity > 0; });\n\n var checkedRecipeItems = [];\n var optionalTotalPrice = 0;\n var optionalTotalItems = 0;\n var standardTotalPrice = 0;\n var standardTotalItems = 0;\n var optionalTotalPriceWithoutVat = 0;\n var standardTotalPriceWithoutVat = 0;\n\n //var deafaultItems = _.filter(recipe.Ingredients, function (item) { return item.DefaultQuantity > 0; });\n $.each(recipe.Ingredients, function (indexInArray, ingredient) {\n var item = _.find(recipe.RecipeItems, function (i) { return i.IngredientId === ingredient.IngredientId && i.Quantity > 0; });\n var groupQuantity = getGroupQuantity(recipe, { Id: ingredient.GroupId }, ingredient.IngredientId);\n var isMultiSelect = (_.find(recipe.Groups, function (group) { return ingredient.GroupId === group.Id; }) || {}).IsMultiSelect;\n var isChecked = item;\n if (!isMultiSelect) {\n var selectedItems = _.filter(recipe.RecipeItems, function (i) { return i.GroupId === ingredient.GroupId; }) || [];\n if (selectedItems.length > 1) {\n isChecked = isChecked && (selectedItems[0].IngredientId === ingredient.IngredientId);\n }\n }\n var isStandard = forceOptional ? false : (ingredient.IsNullable ? false : ingredient.DefaultQuantity > 0);\n if (isChecked) {\n var price = Math.round(ingredient.Price * 100) / 100;\n var totalPrice = ingredient.DefaultQuantity > 0 ?\n ((item.Quantity || 0) - (ingredient.DefaultQuantity || 0)) * price :\n (item.Quantity || 0) * price;\n var priceWithoutVat = Math.round(ingredient.PriceWithoutVat * 100) / 100;\n var totalPriceWithoutVat = ingredient.DefaultQuantity > 0 ?\n ((item.Quantity || 0) - (ingredient.DefaultQuantity || 0)) * priceWithoutVat :\n (item.Quantity || 0) * priceWithoutVat;\n checkedRecipeItems.push({\n RecipeItemId: recipeId,\n ImageUrl: ingredient.ImageUrl,\n Category: ingredient.Category,\n GroupId: ingredient.GroupId,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n //ParentProductId: recipeId,\n Quantity: item.Quantity,\n Price: price,\n PriceWithoutVat: priceWithoutVat,\n TotalPriceWithoutVat: totalPriceWithoutVat,\n Weight: ingredient.Weight,\n IsStandard: isStandard\n });\n if (isStandard) {\n standardTotalPrice += totalPrice;\n standardTotalPriceWithoutVat += totalPriceWithoutVat;\n standardTotalItems++;\n } else {\n optionalTotalPrice += totalPrice;\n optionalTotalPriceWithoutVat += totalPriceWithoutVat;\n optionalTotalItems++;\n }\n }\n if (ingredient.IsNullable) {\n if (groupQuantity === 0) {\n checkedRecipeItems.push({\n RecipeItemId: recipeId,\n ImageUrl: ingredient.ImageUrl,\n Category: ingredient.Category,\n GroupId: ingredient.GroupId,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n //ParentProductId: recipeId,\n Quantity: 1,\n Price: 0,\n PriceWithoutVat: 0,\n TotalPrice: 0,\n TotalPriceWithoutVat: 0,\n Weight: 0,\n IsStandard: isStandard\n });\n }\n }\n\n if (item && (item.Quantity || 0) > 0 && ingredient.SubRecipe) {\n var subCheckedRecipeItems = Vendd.RecipeLibrary.GetCheckedRecipeItems(ingredient.RecipeItemId, !isStandard) || {};\n if (subCheckedRecipeItems.success) {\n item.TotalPrice = subCheckedRecipeItems.data.Prices.TotalPrice;\n item.TotalPriceWithoutVat = subCheckedRecipeItems.data.Prices.TotalPriceWithoutVat;\n checkedRecipeItems = (checkedRecipeItems || []).concat(subCheckedRecipeItems.data.CheckedRecipeItems || []);\n //checkedRecipeItems = _.extend([], checkedRecipeItems, subCheckedRecipeItems.data.CheckedRecipeItems);\n }\n }\n });\n\n var uncheckedRecipeItems = _.reject(recipe.Ingredients, function (item) { return _.find(checkedRecipeItems, function (checked) { return item.IngredientId === checked.IngredientId; }); });\n\n var data = {};\n data.CheckedItemsOptionalTotal = optionalTotalItems;\n data.CheckedItemsStandardTotal = standardTotalItems;\n data.CheckedRecipeItems = checkedRecipeItems;\n data.UncheckedRecipeItems = uncheckedRecipeItems;\n data.Prices = {};\n data.Prices.OptionalTotalPrice = optionalTotalPrice;\n data.Prices.OptionalTotalPriceWithoutVat = optionalTotalPriceWithoutVat;\n data.Prices.StandardTotalPrice = standardTotalPrice;\n data.Prices.StandardTotalPriceWithoutVat = standardTotalPriceWithoutVat;\n data.Prices.InitialPrice = recipe.UnitPrice;\n data.Prices.InitialPriceWithoutVat = recipe.UnitPriceWithoutVat;\n data.Prices.TotalPrice = optionalTotalPrice + standardTotalPrice + recipe.UnitPrice;\n data.Prices.TotalPriceWithoutVat = optionalTotalPriceWithoutVat + standardTotalPriceWithoutVat + recipe.UnitPriceWithoutVat;\n recipe.Prices = data.Prices;\n\n return returnResponse(recipeId, 200, 0, data);\n\n };\n\n Vendd.RecipeLibrary.GetPrices = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var prices = {};\n prices.OptionalTotalPrice = 0;\n prices.StandardTotalPrice = 0;\n prices.OptionalTotalPriceWithoutVat = 0;\n prices.StandardTotalPriceWithoutVat = 0;\n _.each(recipe.RecipeItems, function (ri) {\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ri.IngredientId; }) || {};\n var defaultQuantity = ingredient.DefaultQuantity || 0;\n var initialPrice = Math.round((ingredient.Price || 0) * 100) / 100;\n var initialPriceWithoutVat = Math.round((ingredient.PriceWithoutVat || 0) * 100) / 100;\n var optionalQuantity = Math.max(ri.Quantity - defaultQuantity);\n var optionalTotalPrice = initialPrice * optionalQuantity;\n var optionalTotalPriceWithoutVat = initialPriceWithoutVat * optionalQuantity;\n var standardTotalPrice = 0;//defaultQuantity > 0 ? initialPrice * defaultQuantity : 0;\n var standardTotalPriceWithoutVat = 0;//defaultQuantity > 0 ? initialPrice * defaultQuantity : 0;\n if (ingredient.SubRecipe && ri.Quantity > 0) {\n var subPrices = Vendd.RecipeLibrary.GetPrices(ingredient.RecipeItemId) || {};\n optionalTotalPrice += (subPrices.OptionalTotalPrice || 0);\n optionalTotalPriceWithoutVat += (subPrices.OptionalTotalPriceWithoutVat || 0);\n standardTotalPrice += (subPrices.StandardTotalPrice || 0);\n standardTotalPriceWithoutVat += (subPrices.StandardTotalPriceWithoutVat || 0);\n }\n prices.OptionalTotalPrice += optionalTotalPrice;\n prices.StandardTotalPrice += standardTotalPrice;\n prices.OptionalTotalPriceWithoutVat += optionalTotalPriceWithoutVat;\n prices.StandardTotalPriceWithoutVat += standardTotalPriceWithoutVat;\n });\n prices.InitialPrice = recipe.UnitPrice;\n prices.InitialPriceWithoutVat = recipe.UnitPriceWithoutVat;\n prices.TotalPrice = prices.OptionalTotalPrice + prices.StandardTotalPrice + prices.InitialPrice;\n prices.TotalPriceWithoutVat = prices.OptionalTotalPriceWithoutVat + prices.StandardTotalPriceWithoutVat + prices.InitialPriceWithoutVat;\n recipe.Prices = prices;\n return prices;\n };\n\n Vendd.RecipeLibrary.GetWeight = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var weightObj = {};\n weightObj.InitialWeight = recipe.Weight || 0;\n weightObj.OptionalTotalWeight = getTotalWeight(recipe, recipeId);\n return weightObj;\n\n };\n\n Vendd.RecipeLibrary.GetEnabledItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var data = {};\n data.EnabledItems = [];\n data.DisableItems = [];\n\n data.GroupErrors = [];\n\n data.Errors = [];\n\n var totalQuantity = getTotalQuantity(recipe);\n var extraQuantity = 0;\n var errorCode = 0;\n if (totalQuantity < recipe.MinQuantity) {\n errorCode = 1042;\n extraQuantity = recipe.MinQuantity - totalQuantity;\n }\n else if (totalQuantity > recipe.MaxQuantity) {\n errorCode = 1043;\n extraQuantity = totalQuantity - recipe.MaxQuantity;\n }\n if (errorCode > 0) {\n data.Errors.push({\n RecipeId: recipeId,\n ErrorCode: errorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: recipe.MinQuantity,\n MaxQuantity: recipe.MaxQuantity,\n Quantity: totalQuantity\n });\n }\n\n //var subRecipeIngredientIds = [];\n\n\n //var subRecipes = _.filter(recipe.Ingredients, function (i) {\n // if (i.SubRecipeId == 0) return false;\n // return recipe.RecipeItems.some(function (r) { return r.VariantId === i.VariantId; });\n //}) || [];\n //_.each(subRecipes, function (sr) {\n // var subRecipe = Vendd.RecipeLibrary.GetModel(sr.RecipeItemId) || {};\n // _.each(subRecipe.Ingredients || [], function (i) {\n // if (i.VariantId > 0) {\n // var i_group = _.find(recipe.Groups, function (g) {\n // return g.Items.some(function (i_g) { return i.VariantId === i_g.VariantId; });\n // });\n // if (i_group.IsMultiSelect) {\n\n // //var ingredients = recipe.Ingredients.filter(function (item) { return item.VariantId === i.VariantId; });\n // var ingredients = _.map(\n // recipe.Ingredients.filter(function (item) { return item.VariantId === i.VariantId; }),\n // function (x) { return x.IngredientId; });\n // } else {\n // //var ingredients = i_group.Items;\n // var ingredients = _.map(i_group.Items, function (item) {\n // return item.IngredientId;\n // });\n // }\n // subRecipeIngredientIds = _.uniq(_.union(subRecipeIngredientIds, ingredients));\n // }\n // });\n //});\n\n $.each(recipe.Categories, function (indexCategory, category) {\n $.each(category.Groups, function (indexGroup, group) {\n //group.IsMultiSelect = !(group.MinQuantity <= 1 && group.MaxQuantity == 1 && group.Items.length > 1);\n var groupQuantity = getGroupQuantity(recipe, group);\n var disableAllGroup = _.filter(recipe.Ingredients, function (i) { return i.GroupId === group.Id && !i.CanRemove && !group.IsMultiSelect; }).length > 0;\n $.each(group.VisualGroups, function (indexVisualGroup, visualGroup) {\n $.each(visualGroup.Items, function (indexItem, ingredient) {\n var recipeIngredient = _.first(_.filter(recipe.RecipeItems, function (x) { return x.IngredientId === ingredient.IngredientId && x.RecipeId === recipeId; })) || {};\n var quantity = recipeIngredient.Quantity || 0;\n //einai project specific gia bjt, prepei na allaxei se general\n var isDisableFromSubRecipe = false; //subRecipeIngredientIds.some(function (x) { return x == ingredient.IngredientId; });\n var isDisabled = !ingredient.CanRemove ||\n (ingredient.MaxQuantity <= quantity && ingredient.MinQuantity > quantity) ||\n //(group.MinQuantity >= groupQuantity && quantity > 0) ||\n (group.MaxQuantity <= groupQuantity && quantity === 0) ||\n //(recipe.MinQuantity >= totalQuantity && quantity > 0) ||\n (recipe.MaxQuantity <= totalQuantity && quantity === 0)\n ;\n var canAdd = ingredient.MaxQuantity > quantity && group.MaxQuantity > groupQuantity;\n var canRemove = ingredient.MinQuantity < quantity && ingredient.CanRemove;\n var isChecked = quantity > 0;\n var checkIncompatibles = (Vendd.RecipeLibrary.CheckIncompatibles(recipeId, ingredient.IngredientId));\n var isEnabledIncompatible = checkIncompatibles.success || (!checkIncompatibles.success && checkIncompatibles.data.BothSelected);\n var checkPrerequisites = (Vendd.RecipeLibrary.CheckPrerequisites(recipeId, ingredient.IngredientId));\n var isEnabledPrerequisites = checkPrerequisites.success || (!checkPrerequisites.success && checkPrerequisites.data.BothPrerequisite);\n var checkPrerequisitesAnyOfSet = (Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet(recipeId, ingredient.IngredientId));\n var errorCode = 0;\n if (!disableAllGroup && ((!group.IsMultiSelect || !isDisabled) && (isEnabledIncompatible && isEnabledPrerequisites && checkPrerequisitesAnyOfSet.success && !isDisableFromSubRecipe) || ingredient.IsNullable)) {\n if (isDisabled && ingredient.DefaultQuantity > 0 && ingredient.MinQuantity === ingredient.DefaultQuantity) errorCode = 1012;\n else if (!checkIncompatibles.success) errorCode = checkIncompatibles.status.ErrorCode;\n else if (!checkPrerequisites.success) errorCode = checkPrerequisites.status.ErrorCode;\n else if (!checkPrerequisitesAnyOfSet.success) errorCode = checkPrerequisitesAnyOfSet.status.ErrorCode;\n data.EnabledItems.push({\n RecipeId: recipeId,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n ErrorCode: errorCode,\n CanAdd: canAdd,\n canRemove: canRemove,\n Incompatibles: checkIncompatibles.data.Incompatibles,\n MissingPrerequisites: checkPrerequisites.data.MissingPrerequisites,\n MissingAnyOfPrerequisites: checkPrerequisitesAnyOfSet.data.MissingAnyOfPrerequisites,\n });\n } else {\n var disableIncompatibles = true;\n if (isDisabled && ingredient.DefaultQuantity > 0 && ingredient.MinQuantity === ingredient.DefaultQuantity) errorCode = 1012;\n //else if (group.MinQuantity >= groupQuantity && group.IsMultiSelect && isChecked) errorCode = 1020;\n else if (group.MaxQuantity <= groupQuantity && group.IsMultiSelect && !isChecked) errorCode = 1021;\n else if (disableAllGroup) errorCode = 1021;\n //else if (recipe.MinQuantity >= totalQuantity && group.IsMultiSelect && isChecked) errorCode = 1040;\n else if (recipe.MaxQuantity <= totalQuantity && group.IsMultiSelect && !isChecked) errorCode = 1041;\n else if (ingredient.MinQuantity > quantity && group.IsMultiSelect && isChecked) errorCode = 1010;\n else if (ingredient.MaxQuantity <= quantity && group.IsMultiSelect && !isChecked) errorCode = 1011;\n else if (!checkIncompatibles.success) errorCode = 1030;\n else if (!checkPrerequisites.success) errorCode = 1031;\n else if (!checkPrerequisitesAnyOfSet.success) errorCode = 1033;\n else if (isDisableFromSubRecipe) errorCode = 1034;\n if (errorCode > 0) {\n data.DisableItems.push({\n RecipeId: recipeId,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n ErrorCode: errorCode,\n CanAdd: canAdd,\n canRemove: canRemove,\n Incompatibles: checkIncompatibles.data.Incompatibles,\n MissingPrerequisites: checkPrerequisites.data.MissingPrerequisites,\n MissingAnyOfPrerequisites: checkPrerequisitesAnyOfSet.data.MissingAnyOfPrerequisites,\n\n });\n }\n }\n });\n });\n var groupErrorCode = 0;\n var extraQuantity = 0;\n if (groupQuantity < group.MinQuantity) {\n groupErrorCode = 1022;\n extraQuantity = group.MinQuantity - groupQuantity;\n }\n else if (groupQuantity > group.MaxQuantity) {\n groupErrorCode = 1023;\n extraQuantity = groupQuantity - group.MaxQuantity;\n }\n if (groupErrorCode > 0) {\n data.GroupErrors.push({\n Id: group.Id,\n RecipeId: recipeId,\n ErrorCode: groupErrorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: group.MinQuantity,\n MaxQuantity: group.MaxQuantity,\n Quantity: groupQuantity,\n Name: group.Name,\n CategoryName: category.Category\n });\n }\n });\n });\n\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.CheckIncompatibles = function (recipeId, ingredientId) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ingredientId; });\n var recipeIngredient = _.first(_.filter(recipe.RecipeItems, function (x) { return x.IngredientId === ingredient.IngredientId; })) || {};\n\n if (!ingredient) {\n return returnResponse(recipeId, 500, 1002);\n }\n\n var data = {};\n var incompatibles = _.filter(ingredient.Incompatibles,\n function (i) {\n return recipe.RecipeItems.some(function (item) { return item.IngredientId === i; });\n }) || [];\n\n if (incompatibles.length > 0) {\n data.Incompatibles = _.filter(recipe.Ingredients, function (item) { return incompatibles.some(function (i) { return item.IngredientId === i; }) });\n data.BothSelected = (recipeIngredient.Quantity || 0) > 0;\n return returnResponse(recipeId, 500, 1030, data);\n }\n\n return returnResponse(recipeId, 200);\n }\n\n Vendd.RecipeLibrary.CheckPrerequisites = function (recipeId, ingredientId) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ingredientId });\n\n if (!ingredient) {\n return returnResponse(recipeId, 500, 1002);\n }\n\n var data = {};\n var missingPrerequisites = _.filter(ingredient.Prerequisites,\n function (i) {\n return !recipe.RecipeItems.some(function (item) { return item.IngredientId === i; });\n }) || [];\n\n if (missingPrerequisites.length > 0) {\n data.MissingPrerequisites = _.filter(recipe.Ingredients, function (item) { return missingPrerequisites.some(function (i) { return item.IngredientId === i; }) });\n var bothPrerequisite = _.filter(data.MissingPrerequisites,\n function (i) {\n return i.Prerequisites.length > 0 && i.Prerequisites.some(function (item) { return item === ingredient.IngredientId; });\n }) || [];\n data.BothPrerequisite = bothPrerequisite.length > 0;\n return returnResponse(recipeId, 500, 1031, data);\n }\n\n return returnResponse(recipeId, 200);\n }\n\n Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet = function (recipeId, ingredientId) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ingredientId });\n\n if (!ingredient) {\n return returnResponse(recipeId, 500, 1002);\n }\n\n var data = {};\n data.MissingAnyOfPrerequisites = [];\n var hasMissingAnyOfPrerequisites = false;\n for (var i = 0; i < (ingredient.RequiresAnyOfSet || []).length; i++) {\n var requiredSetItems = ingredient.RequiresAnyOfSet[i].RequiresAnyOfItems || [];\n var anyOfIngredient = _.filter(requiredSetItems,\n function (i) {\n return recipe.RecipeItems.some(function (item) { return item.IngredientId === i; });\n }) || [];\n\n if (anyOfIngredient.length === 0 && requiredSetItems.length > 0) {\n hasMissingAnyOfPrerequisites = true;\n var missingAnyOfPrerequisites = _.filter(recipe.Ingredients, function (item) { return requiredSetItems.some(function (i) { return item.IngredientId === i; }); });\n data.MissingAnyOfPrerequisites.push(missingAnyOfPrerequisites);\n }\n }\n if (hasMissingAnyOfPrerequisites)\n return returnResponse(recipeId, 500, 1033, data);\n\n return returnResponse(recipeId, 200);\n }\n\n Vendd.RecipeLibrary.IsValid = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var data = {};\n data.Errors = [];\n data.GroupErrors = [];\n data.IngredientsErrors = [];\n\n var totalQuantity = getTotalQuantity(recipe, recipeId);\n var extraQuantity = 0;\n var errorCode = 0;\n if (totalQuantity < recipe.MinQuantity) {\n errorCode = 1042;\n extraQuantity = recipe.MinQuantity - totalQuantity;\n }\n else if (totalQuantity > recipe.MaxQuantity) {\n errorCode = 1043;\n extraQuantity = totalQuantity - recipe.MaxQuantity;\n }\n if (errorCode > 0) {\n data.Errors.push({\n ParentProductId: recipeId,\n ErrorCode: errorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: recipe.MinQuantity,\n MaxQuantity: recipe.MaxQuantity,\n Quantity: totalQuantity\n });\n }\n\n $.each(recipe.Categories, function (indexCategory, category) {\n $.each(category.Groups, function (indexGroup, group) {\n var groupErrorCode = 0;\n var extraQuantity = 0;\n var groupQuantity = getGroupQuantity(recipe, group);\n if (groupQuantity < group.MinQuantity) {\n groupErrorCode = 1022;\n extraQuantity = group.MinQuantity - groupQuantity;\n }\n else if (groupQuantity > group.MaxQuantity) {\n groupErrorCode = 1023;\n extraQuantity = groupQuantity - group.MaxQuantity;\n }\n if (groupErrorCode > 0) {\n data.GroupErrors.push({\n Id: group.Id,\n RecipeId: recipeId,\n ErrorCode: groupErrorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: group.MinQuantity,\n MaxQuantity: group.MaxQuantity,\n Quantity: groupQuantity,\n Name: group.Name,\n CategoryName: category.Category\n });\n }\n $.each(group.VisualGroups, function (indexVisualGroup, visualGroup) {\n $.each(visualGroup.Items, function (indexItem, ingredient) {\n var recipeIngredient = _.first(_.filter(recipe.RecipeItems, function (x) { return x.IngredientId === ingredient.IngredientId; })) || _.find(recipe.RecipeItems, function (i) { return ingredient.RecipeItemId === i.RecipeItemId; }) || {};\n var quantity = recipeIngredient.Quantity || 0;\n var checkIncompatibles = (Vendd.RecipeLibrary.CheckIncompatibles(recipeId, ingredient.IngredientId));\n var checkPrerequisites = (Vendd.RecipeLibrary.CheckPrerequisites(recipeId, ingredient.IngredientId));\n var checkPrerequisitesAnyOfSet = (Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet(recipeId, ingredient.IngredientId));\n var errorCodes = [];\n if (ingredient.MinQuantity > quantity) errorCodes.push(1010);\n else if (ingredient.MaxQuantity < quantity) errorCodes.push(1011);\n else if (!checkIncompatibles.success && quantity > 0) errorCodes.push(1030);\n else if (!checkPrerequisites.success && quantity > 0) errorCodes.push(1031);\n else if (!checkPrerequisitesAnyOfSet.success && quantity > 0) errorCodes.push(1033);\n if (errorCodes.length > 0) {\n data.IngredientsErrors.push({\n RecipeId: recipeId,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ErrorCodes: errorCodes,\n Incompatibles: checkIncompatibles.data.Incompatibles || [],\n MissingPrerequisites: checkPrerequisites.data.MissingPrerequisites || [],\n MissingAnyOfPrerequisites: checkPrerequisitesAnyOfSet.data.MissingAnyOfPrerequisites || [],\n Name: ingredient.Name || \"\",\n Price: ingredient.Price,\n PriceWithoutVat: ingredient.PriceWithoutVat,\n PriceText: ingredient.PriceText,\n PriceWithoutVatText: ingredient.PriceWithoutVatText,\n TotalPrice: ingredient.TotalPrice,\n TotalPriceWithoutVat: ingredient.TotalPriceWithoutVat\n\n });\n }\n });\n });\n });\n });\n data.IsValid = data.Errors.length === 0 && data.GroupErrors.length === 0 && data.IngredientsErrors.length === 0;\n return data;\n }\n\n Vendd.RecipeLibrary.CompareModels = function (recipeId, savedModel) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n //ingredients hash code\n var ingedientsSavedModel = _.sortBy(savedModel.Ingredients, function (i) { return i.IngredientId; });\n var ingedientTemplate = \"{0}_{1}_{2}_{3}_{4}\";\n var ingedientsSavedModelHashCode = _.map(ingedientsSavedModel,\n function (i) {\n return ingedientTemplate\n .replace(\"{0}\", i.IngredientId || \"\")\n .replace(\"{1}\", i.GroupId || \"\")\n .replace(\"{2}\", i.Price || \"\")\n .replace(\"{3}\", (i.Incompatibles || []).join(\",\"))\n .replace(\"{4}\", (i.Prerequisites || []).join(\",\"));\n }).join(\"|\");\n var ingedientsModel = _.sortBy(recipe.Ingredients, function (i) { return i.IngredientId; });\n var ingedientsModelHashCode = _.map(ingedientsModel,\n function (i) {\n return ingedientTemplate\n .replace(\"{0}\", i.IngredientId || \"\")\n .replace(\"{1}\", i.GroupId || \"\")\n .replace(\"{2}\", i.Price || \"\")\n .replace(\"{3}\", (i.Incompatibles || []).join(\",\"))\n .replace(\"{4}\", (i.Prerequisites || []).join(\",\"));\n }).join(\"|\");\n\n //groups hash code\n var groupTemplate = \"{0}_{1}\";\n var groupsSavedModel = _.sortBy(savedModel.Groups, function (i) { return i.Id; });\n var savedGroupsModelHashCode = _.map(groupsSavedModel,\n function (i) {\n return groupTemplate\n .replace(\"{0}\", i.MinQuantity || 0)\n .replace(\"{1}\", i.MaxQuantity || 0);\n }).join(\"|\");\n var groupsModel = _.sortBy(recipe.Groups, function (i) { return i.Id; });\n var groupsModelHashCode = _.map(groupsModel,\n function (i) {\n return groupTemplate\n .replace(\"{0}\", i.MinQuantity || 0)\n .replace(\"{1}\", i.MaxQuantity || 0);\n }).join(\"|\");\n\n //models hash code\n var modelTemplate = \"{0}_{1}_{2}_{3}\";\n var savedModelHashCode = modelTemplate\n .replace(\"{0}\", savedModel.MinQuantity || 0)\n .replace(\"{1}\", savedModel.MaxQuantity || 0)\n .replace(\"{2}\", savedModel.MaxFreeQuantity || 0)\n .replace(\"{3}\", savedModel.MaxReplaceQuantity || 0);\n var modelHashCode = modelTemplate\n .replace(\"{0}\", recipe.MinQuantity || 0)\n .replace(\"{1}\", recipe.MaxQuantity || 0)\n .replace(\"{2}\", recipe.MaxFreeQuantity || 0)\n .replace(\"{3}\", recipe.MaxReplaceQuantity || 0);\n\n //modelHashCode = \"\"; //<----remove this , is test data and only\n if (ingedientsSavedModelHashCode === ingedientsModelHashCode && groupsModelHashCode === savedGroupsModelHashCode && savedModelHashCode === modelHashCode)\n return returnResponse(recipeId, 200);\n\n var recipeItems = [];\n var IngredientsErrors = [];\n var IngredientsWarnings = [];\n var data = {};\n _.each(savedModel.RecipeItems, function (r) {\n var ingredient = _.find(recipe.Ingredients, function (i) { return r.IngredientId === i.IngredientId; }) || _.find(recipe.Ingredients, function (i) { return r.RecipeItemId === i.RecipeItemId; });\n var savedIngredient = _.find(savedModel.Ingredients, function (i) { return r.IngredientId === i.IngredientId; }) || _.find(savedModel.Ingredients, function (i) { return r.RecipeItemId === i.RecipeItemId; });\n if (ingredient === null) {\n IngredientsErrors.push({\n IngredientId: savedIngredient.IngredientId,\n Name: savedIngredient.Name,\n Price: savedIngredient.Price,\n Incompatibles: savedIngredient.Incompatibles,\n Prerequisites: savedIngredient.Prerequisites,\n ErrorCodes: [1072]\n });\n return;\n }\n if (ingredient.Price !== savedIngredient.Price) {\n IngredientsWarnings.push({\n IngredientId: savedIngredient.IngredientId,\n Name: savedIngredient.Name,\n Price: savedIngredient.Price,\n Incompatibles: savedIngredient.Incompatibles,\n Prerequisites: savedIngredient.Prerequisites,\n ErrorCodes: [1073]\n });\n }\n recipeItems.push({\n RecipeId: recipeId,\n Category: ingredient.Category,\n CategoryCode: ingredient.CategoryCode,\n GroupId: ingredient.GroupId,\n IngredientId: ingredient.IngredientId,\n ProductItemCode: ingredient.RecipeItemCode,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n Quantity: (savedIngredient.Quantity || 1),\n Price: savedIngredient.Price,\n TotalPrice: Math.max((savedIngredient.Quantity || 1) - ingredient.DefaultQuantity, 0) * savedIngredient.Price,\n Weight: ingredient.Weight,\n IsStandard: ingredient.DefaultQuantity > 0,\n SubRecipeId: ingredient.SubRecipeId,\n SubRecipeCode: ingredient.SubRecipeCode\n });\n });\n\n var checkModel = $.extend({}, recipe);\n recipe.RecipeItems = _.reject(recipeItems, function (r) { return IngredientsErrors.some(function (i) { return i.IngredientId === r.IngredientId; }); });\n\n var validatedModel = Vendd.RecipeLibrary.IsValid(recipeId);\n\n data.IngredientsErrors = validatedModel.IngredientsErrors.concat(IngredientsErrors);\n data.IngredientsWarnings = IngredientsWarnings;\n\n data = $.extend({}, validatedModel, data || {});\n if (!data.IsValid || data.IngredientsErrors.length > 0 || data.GroupErrors.length > 0 || data.Errors.length > 0) {\n return returnResponse(recipeId, 500, 1004, data);\n }\n return returnResponse(recipeId, 200);\n }\n /*\n * GET GLOBAL ID CONFIGURATION\n * RecipeId the receipe identifier\n * Force if true, although that mighth be cached global id , it will create a new one - default value:false,\n * FriendlyName a friendly name for saving - default value: empty,\n * Vin the vin number - default value: empty,\n * PartnerId the vin number - default value: empty,\n * serviceurl the url service - default value: '/services/api/Product/SaveRecipeConfiguration',\n * onSuccess the function of success saving global identifier,\n * onError the function of error saving global identifier,\n */\n Vendd.RecipeLibrary.GenerateGlobalId = function (config) {\n\n var _def = $.Deferred();\n var data = {};\n\n var defaultConfiguration = {\n Force: false,\n FriendlyName: \"\",\n Vin: \"\",\n PartnerId: \"\",\n serviceurl: \"/services/api/Product/SaveRecipeConfiguration\"\n };\n\n defaultConfiguration.onSuccess = function (response) {\n if (!response.success || !response.data || !response.data.GlobalId) {\n config.onError(response);\n return;\n }\n data.GlobalId = response.data.GlobalId;\n data.SavedGlobalIdToLocal = (Vendd.RecipeLibrary.SaveGlobalIdToLocal(config.RecipeId, data.GlobalId)).success;\n data.SaveRecipeItemsToLocal = (Vendd.RecipeLibrary.SaveRecipeItemsToLocal(config.RecipeId, data.GlobalId)).success;\n data.HashCode = getRecipeItemsHashCode(config.RecipeId, recipe.RecipeItems);\n _recipes[config.RecipeId].HashCode = data.HashCode;\n _def.resolve(returnResponse(config.RecipeId, 200, 0, data));\n };\n defaultConfiguration.onError = function (response) {\n _def.reject(returnResponse(config.RecipeId, 500, 1060, response));\n };\n\n config = $.extend({}, defaultConfiguration, config || {});\n\n if (!config.RecipeId) {\n _def.resolve(returnResponse(null, 500, 1061));\n return;\n }\n var recipe = _recipes[config.RecipeId];\n if (!recipe) {\n _def.resolve(returnResponse(config.RecipeId, 500, 1000));\n return;\n }\n\n var currentHashCode = getRecipeItemsHashCode(config.RecipeId);\n var savedHashCode = Vendd.RecipeLibrary.GetLocalStorageRecipeItemsHashCode(config.RecipeId);\n config.HtmlData.Body = \"\";\n\n if (!config.Force && localStorage.getItem(\"globalId_\" + config.RecipeId) !== null && currentHashCode === savedHashCode) {\n data.GlobalId = localStorage.getItem(\"globalId_\" + config.RecipeId);\n data.HashCode = currentHashCode;\n _recipes[config.RecipeId].HashCode = currentHashCode;\n _def.resolve(returnResponse(config.RecipeId, 200, 0, data));\n } else {\n var jsonData = (Vendd.RecipeLibrary.ConvertToSavedModel(config.RecipeId) || {}).data || {};\n var requestData = JSON.stringify({\n FriendlyName: config.FriendlyName,\n ConfigurationJson: JSON.stringify(jsonData),\n ProductItemId: config.RecipeId,\n ProductIdentifier: config.Vin,\n PartnerId: config.PartnerId !== \"\" ? config.PartnerId : null,\n Url: window.location.href,\n HtmlData: config.HtmlData,\n IsShare: !config.Force\n });\n $.ajax({\n type: \"POST\",\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n url: config.serviceurl,\n async: true,\n data: requestData,\n error: config.onError,\n success: config.onSuccess\n });\n }\n\n return _def.promise();\n };\n\n Vendd.RecipeLibrary.AssignConfigurationToUser = function (config) {\n\n var _def = $.Deferred();\n var data = {};\n\n var defaultConfiguration = {\n serviceurl: \"/services/api/Product/SaveRecipeConfiguration\"\n };\n\n defaultConfiguration.onSuccess = function (response) {\n if (!response.success) {\n config.onError(response);\n return;\n }\n _def.resolve(returnResponse(config.RecipeId, 200, 0, data));\n };\n defaultConfiguration.onError = function (response) {\n _def.reject(returnResponse(config.RecipeId, 500, 1060, response));\n };\n\n config = $.extend({}, defaultConfiguration, config || {});\n\n var requestData = JSON.stringify({\n GlobalId: config.GlobalId || \"\",\n FriendlyName: \"Update User\",\n ConfigurationJson: JSON.stringify({}),\n ProductItemId: config.RecipeItemId,\n Url: window.location.href,\n });\n $.ajax({\n type: \"POST\",\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n url: config.serviceurl,\n async: true,\n data: requestData,\n error: config.onError,\n success: config.onSuccess\n });\n\n return _def.promise();\n };\n\n Vendd.RecipeLibrary.LoadFromGlobalId = function (config) {\n var _def = $.Deferred();\n var data = {};\n\n var defaultConfiguration = {\n serviceurl: \"/services/api/Product/GetRecipeConfiguration\"\n };\n\n defaultConfiguration.onSuccess = function (response) {\n if (!response.success || !response.data || !response.data.GlobalId) {\n config.onError(data);\n return;\n }\n data = JSON.parse(response.data.ConfigurationJson || \"{}\");\n data.GlobalId = response.data.GlobalId;\n data.HtmlData = JSON.parse(response.data.Html || \"{}\");\n data.Pdf = response.data.Pdf || \"\";\n data.IsValid = true;\n data.Errors = [];\n data.GroupErrors = [];\n data.IngredientsErrors = [];\n data.IngredientsWarnings = [];\n\n recipe.RecipeItems = data.RecipeItems;\n var compareResult = Vendd.RecipeLibrary.CompareModels(config.RecipeId, data);\n var subrecipeCompareResults = _.map(data.SubRecipes || [], function (subrecipeData) {\n Vendd.RecipeLibrary.SetRecipeItems(subrecipeData.RecipeItemId, subrecipeData.RecipeItems);\n return Vendd.RecipeLibrary.CompareModels(subrecipeData.RecipeItemId, subrecipeData);\n });\n //console.log(\"compareResult:\", compareResult);\n if (!compareResult.success || subrecipeCompareResults.some(function (r) { return !r.success; })) {\n recipe.IsValid = false;\n recipe.IngredientsErrors = compareResult.data.IngredientsErrors;\n recipe.IngredientsWarnings = compareResult.data.IngredientsWarnings;\n recipe.Errors = compareResult.data.Errors;\n recipe.GroupErrors = compareResult.data.GroupErrors;\n //data.RecipeItems = recipe.RecipeItems;\n _def.resolve(returnResponse(config.RecipeId, 200, 1070, recipe));\n return;\n }\n\n recipe.GlobalId = data.GlobalId;\n recipe.Pdf = data.Pdf;\n recipe.IsValid = data.IsValid;\n recipe.Errors = data.Errors;\n recipe.IngredientsErrors = data.IngredientsErrors;\n recipe.IngredientsWarnings = data.IngredientsWarnings;\n\n _def.resolve(returnResponse(config.RecipeId, 200, 0, recipe));\n return;\n };\n defaultConfiguration.onError = function (data) {\n _def.reject(returnResponse(config.RecipeId, 500, 1070, data));\n return;\n };\n\n config = $.extend({}, defaultConfiguration, config || {});\n\n var recipe = _recipes[config.RecipeId];\n if (!recipe) {\n _def.resolve(returnResponse(config.RecipeId, 500, 1000));\n return;\n }\n\n if ((config.GlobalId || 0) === 0) {\n _def.resolve(returnResponse(config.RecipeId, 500, 1071));\n return;\n }\n\n var requestData = JSON.stringify({\n GlobalId: config.GlobalId\n });\n $.ajax({\n type: \"POST\",\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n url: config.serviceurl,\n async: true,\n data: requestData,\n error: config.onError,\n success: config.onSuccess\n });\n\n return _def.promise();\n };\n\n Vendd.RecipeLibrary.SaveGlobalIdToLocal = function (recipeId, globalId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n localStorage.setItem(\"globalId_\" + recipeId, globalId);\n\n return returnResponse(recipeId, 200, 0);\n };\n\n Vendd.RecipeLibrary.SaveRecipeItemsToLocal = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var recipeItemsData = Vendd.RecipeLibrary.GetFullRecipeItems(recipeId);\n var recipeItems = recipeItemsData.RecipeItems;\n var currentHashCode = getRecipeItemsHashCode(recipeId, recipeItems);\n var savedHashCode = Vendd.RecipeLibrary.GetLocalStorageRecipeItemsHashCode(recipeId);\n if (currentHashCode === savedHashCode) {\n return returnResponse(recipeId, 200);\n }\n\n var dataLocalStorage = {\n RecipeItems: recipe.RecipeItems,\n HashCode: currentHashCode\n };\n\n localStorage.setItem(\"configurator_\" + recipeId, JSON.stringify(dataLocalStorage, null, 2));\n\n return returnResponse(recipeId, 200);\n };\n\n Vendd.RecipeLibrary.LoadFromLocalRecipeItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n if (localStorage.getItem(\"configurator_\" + recipeId) === null) {\n return returnResponse(recipeId, 500, 1050);\n }\n //var savedData = $.cookie(\"model_recipe_\" + recipeId) || [];\n var dataLocalStorage = JSON.parse(localStorage.getItem(\"configurator_\" + recipeId) || \"{}\");\n recipe.RecipeItems = dataLocalStorage.RecipeItems;\n recipe.HashCode = dataLocalStorage.HashCode;\n\n var data = {};\n data.Recipe = recipe;\n data.GlobalId = \"\";\n return returnResponse(recipeId, 200, 0, data);\n };\n\n var getRecipeItemsHashCode = function (recipeId, items) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return null;\n }\n var recipeItems = items || ((Vendd.RecipeLibrary.GetFullRecipeItems(recipeId) || {}).data || {}).RecipeItems;\n var hashCode = recipeId +\n (recipeItems.length > 0\n ? \"_\" + (_.map(_.sortBy(recipeItems, \"IngredientId\"), function (i) { return i.IngredientId + \"_\" + i.Quantity; }) || []).join(\"_\")\n : \"\");\n return hashCode;\n };\n\n Vendd.RecipeLibrary.GetLocalStorageRecipeItemsHashCode = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return null;\n }\n if (localStorage.getItem(\"configurator_\" + recipeId) === null) {\n return null;\n }\n var dataLocalStorage = JSON.parse(localStorage.getItem(\"configurator_\" + recipeId) || \"{}\");\n return dataLocalStorage.HashCode;\n }\n\n Vendd.RecipeLibrary.ClearLocalStorage = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return false;\n }\n if (localStorage.getItem(\"configurator_\" + recipeId) !== null) {\n localStorage.removeItem(\"configurator_\" + recipeId);\n }\n if (localStorage.getItem(\"globalId_\" + recipeId) !== null) {\n localStorage.removeItem(\"globalId_\" + recipeId);\n }\n return true;\n }\n\n Vendd.RecipeLibrary.ConvertToSavedModel = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var data = {};\n data = converModelToSaveDataModel(recipe) || {};\n data.Groups = converGroupsToSaveDataModel(recipe.Groups) || [];\n data.Ingredients = converIngedientToSaveDataModel(recipe.Ingredients) || [];\n data.RecipeItems = Vendd.RecipeLibrary.GetRecipeItems(recipeId).data.RecipeItems || [];\n data.SubRecipes = _.map(\n _.filter(recipe.RecipeItems, function (r) { return r.SubRecipeId > 0 && _recipes[r.ProductItemId]; }) || [],\n function (ri) {\n return (Vendd.RecipeLibrary.ConvertToSavedModel(ri.ProductItemId) || {}).data || {};\n }) || [];\n return returnResponse(recipeId, 200, 0, data);\n };\n\n var converModelToSaveDataModel = function (m) {\n return {\n RecipeId: m.RecipeId,\n RecipeItemId: m.RecipeItemId,\n MinQuantity: m.MinQuantity,\n MaxQuantity: m.MaxQuantity,\n MaxFreeQuantity: m.MaxFreeQuantity,\n MaxReplaceQuantity: m.MaxReplaceQuantity,\n UnitPrice: m.UnitPrice\n };\n };\n\n var converGroupsToSaveDataModel = function (groups) {\n var model = _.map(groups, function (g) {\n return {\n Id: g.Id,\n MinQuantity: g.MinQuantity,\n MaxQuantity: g.MaxQuantity,\n };\n });\n return model;\n };\n\n var converIngedientToSaveDataModel = function (ingredients) {\n var model = _.map(ingredients, function (i) {\n return {\n IngredientId: i.IngredientId,\n Name: i.Name,\n GroupId: i.GroupId,\n Price: i.Price,\n Incompatibles: i.Incompatibles || [],\n Prerequisites: i.Prerequisites || [],\n };\n });\n return model;\n };\n\n function checkRestrictions(recipe) {\n return true;\n };\n\n function FixJSFloatBug(price) {\n return parseFloat((price || 0).toFixed(2));\n }\n\n Vendd.RecipeLibrary.Tests = {\n 0: function () {\n var _rec = 2;\n console.log(Vendd.RecipeLibrary.InitRecipe(null, _rec));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88694, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88691, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88691, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88691, 2, true));\n console.log(Vendd.RecipeLibrary.RemoveIngredient(null, _rec, 88694));\n console.log(Vendd.RecipeLibrary.DeclareState(null, _rec));\n return \"success\";\n },\n 1: function () {\n console.log(Vendd.RecipeLibrary.InitRecipe(null, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88691, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2, true));\n console.log(Vendd.RecipeLibrary.RemoveIngredient(null, 1, 88691));\n console.log(Vendd.RecipeLibrary.DeclareState(null, 1));\n return \"success\";\n },\n 2: function () {\n console.log(Vendd.RecipeLibrary.InitRecipe(null, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88691, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2, true));\n console.log(Vendd.RecipeLibrary.RemoveIngredient(null, 1, 88691));\n console.log(Vendd.RecipeLibrary.DeclareState(null, 1));\n return \"success\";\n }\n };\n return Vendd;\n\n})(Vendd || {});\n\nvar testModel = {};\n","var recaptchaLoaded = false;\nvar recaptchaMessagePublished = false;\nvar callback_recaptcha = function () {\n recaptchaLoaded = true;\n checkAsyncLoad();\n};\n\nvar googleMapsLoaded = false;\nvar googleMapsMessagePublished = false;\nvar callback_googlemaps = function () {\n googleMapsLoaded = true;\n checkAsyncLoad();\n};\n\nvar venddLoaded = false;\nvar callback_vendd = function () {\n venddLoaded = true;\n checkAsyncLoad();\n};\n\nvar checkAsyncLoad = function () {\n if (!venddLoaded) \n return;\n\n if (recaptchaLoaded && !recaptchaMessagePublished) {\n Vendd.MessageBus.publishAsync('checkAsyncLoad', new Vendd.Plugins.Messages.RecaptcaLoaded());\n recaptchaMessagePublished = true;\n }\n \n if (googleMapsLoaded && !googleMapsMessagePublished) {\n Vendd.MessageBus.publishAsync('checkAsyncLoad', new Vendd.Plugins.Messages.GoogleMapsLoaded());\n googleMapsMessagePublished = true;\n }\n\n};\n\nfunction checkout_callback_googlemaps() {\n\n angular.element(\".x-checkoutstore\").ready(function () {\n if ($('.x-checkoutstore').scope() && $('.x-checkoutstore').scope().Control && typeof ($('.x-checkoutstore').scope().Control.SetMap) === 'function') {\n $('.x-checkoutstore').scope().Control.SetMap(true);\n }\n }); \n\n}","$(document).ready(function () {\n\n if (Vendd && Vendd.Scripts && (typeof Vendd.Scripts.init === 'function')) {\n\n Vendd.Scripts.init();\n\n if (LhApp && LhApp.init && (typeof LhApp.init === 'function'))\n LhApp.init();\n } \n});"]}