{"version":3,"file":"js/chunks/bonus-products-view.js","sources":["webpack:///./org_colony/cartridge/js/bonus-products-view.js"],"sourcesContent":["const dialog = require('./dialog');\nconst page = require('./page');\nconst util = require('./util');\n\nconst selectedList = [];\nlet maxItems = 1;\nlet bliUUID = '';\n\n/**\n * @private\n * @function\n * description Gets a list of bonus products related to a promoted product\n */\nfunction getBonusProducts() {\n const bonusproducts = [];\n for (let i = 0, len = selectedList.length; i < len; i += 1) {\n const p = {\n pid: selectedList[i].pid,\n qty: selectedList[i].qty,\n options: {},\n };\n const bp = selectedList[i];\n if (bp.options) {\n for (let a = 0, alen = bp.options.length; a < alen; a += 1) {\n const opt = bp.options[a];\n p.options = {optionName: opt.name, optionValue: opt.value};\n }\n }\n bonusproducts.push({product: p});\n }\n return {bonusproducts};\n}\n\nfunction selectedItemTemplate(data) {\n let attributes = '';\n Object.keys(data.attributes).forEach((attrID) => {\n const attr = data.attributes[attrID];\n attributes += `