{"version":3,"names":["$","$lists","debouncedResize","window","_debounce","adjustListItemHeights","rowCount","setTimeout","each","this","find","length","surfaceItemCount","s03ItemCount","columnCount","getColumnCount","isFinite","Math","round","i","ele","css","list","columns","items","children","clearHeight","heights","li","push","max","parseInt","getRowHeight","h","c","eq","setRowHeight","setItemHeights","outerWidth","on","resize","jQuery"],"sources":["assets/feature/Composites/List/js/_L01-list.js"],"sourcesContent":["(function ($) {\r\n\r\n\tvar $lists = $('.component.list');\r\n\tvar debouncedResize = window._debounce(adjustListItemHeights, 100);\r\n\tvar rowCount = 0;\r\n\r\n\t$(window)\r\n\t\t.on('load resize', adjustListItemHeights)\r\n\t\t.resize(debouncedResize);\r\n\r\n\t$(adjustListItemHeights);\r\n\r\n\tfunction adjustListItemHeights() {\r\n setTimeout(function() {\r\n $lists.each(function () {\r\n\t\t\tif ($(this).find('.component.s01-surfaced-item').length || $(this).find(\".s03-surfaced-item\").length) {\r\n\t\t\t\tvar surfaceItemCount = ($(this).find('.component.s01-surfaced-item').length);\r\n\t\t\t\tvar s03ItemCount = $(this).find(\".s03-surfaced-item\").length;\r\n\t\t\t\tvar columnCount = getColumnCount($(this));\r\n\t\t\t\tif (isFinite(columnCount)) {\r\n\t\t\t\t\tif (surfaceItemCount > 0) {\r\n\t\t\t\t\t\tvar rowCounts01 = Math.round(surfaceItemCount / columnCount);\r\n\t\t\t\t\t\tif (rowCounts01 > 1) {\r\n\t\t\t\t\t\t\t$('.component.list .component.s01-surfaced-item').each(function (i, ele) {\r\n\t\t\t\t\t\t\t\t$(this).css('margin-bottom', '2rem');\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (s03ItemCount > 0) {\r\n\t\t\t\t\t\tvar rowCounts03 = Math.round(s03ItemCount / columnCount);\r\n\t\t\t\t\t\tif (rowCounts03 > 1) {\r\n\t\t\t\t\t\t\t$('.component.list .s03-surfaced-item').each(function (i, ele) {\r\n\t\t\t\t\t\t\t\t$(this).css('margin-bottom', '2rem');\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\r\n\t\t\t}\r\n\t\t\tvar list = $(this);\r\n\t\t\tvar columns = getColumnCount(list);\r\n\t\t\t\tif (isFinite(columns)) {\r\n\t\t\t\t\tsetItemHeights(list, columns);\r\n\t\t\t\t}\r\n\t\t});\r\n },2000);\r\n\t\t\r\n\t}\r\n\r\n\tfunction getColumnCount(list) {\r\n\t\treturn Math.round(1 / (list.children('li:first').outerWidth() / list.outerWidth()), 0);\r\n\t}\r\n\r\n\tfunction setItemHeights(list, columns) {\r\n\t\tvar items = list.children('li');\r\n\t\tclearHeight(items);\r\n\t\tif (columns === 1) return;\r\n\t\tvar heights = getRowHeight(items, columns);\r\n\t\trowCount = heights.length;\r\n\t\tsetRowHeight(items, columns, heights);\r\n\t}\r\n\r\n\tfunction clearHeight(items) {\r\n\t\titems.css('height', 'auto');\r\n\t}\r\n\r\n\tfunction getRowHeight(items, columns) {\r\n\t\tvar heights = [];\r\n\t\titems.each(function (i) {\r\n\t\t\tif (i % columns === 0) heights.push(0);\r\n\t\t\theights[heights.length - 1] = Math.max(heights[heights.length - 1], getItemHeight($(this)));\r\n\t\t});\r\n\t\treturn heights;\r\n\t}\r\n\r\n\tfunction setRowHeight(items, columns, heights) {\r\n\t\tfor (var h = 0; h < heights.length; h++) {\r\n\t\t\tfor (var c = 0; c < columns; c++) {\r\n\t\t\t\titems.eq((h * columns) + c).css('height', heights[h]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (rowCount > 1) {\r\n\t\t\titems.each(function () {\r\n\t\t\t\t$(this).css('margin-bottom', '2rem');\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction getItemHeight(li) {\r\n\t\tli.css('height', 'auto');\r\n\t\treturn parseInt(li.css('height'));\r\n\t}\r\n\r\n}(window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