define(["require", "exports"], function (require, exports) {
    "use strict";
    var LOREM_IPSUM = ('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut ' +
        'labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut ' +
        'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore ' +
        'eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' +
        'mollit anim id est laborum').split(' ');
    var DATA = {
        'color': ['red', 'blue', 'green', 'yellow'],
        'shape': ['circle', 'square', 'triangle'],
        'location': ['Seattle', 'New York', 'Chicago', 'Los Angeles', 'Portland']
    };
    function createListItems(count, startIndex) {
        if (startIndex === void 0) { startIndex = 0; }
        return Array.apply(null, Array(count)).map(function (item, index) {
            var width = 1000 + Math.round(Math.random() * 2000);
            var height = 1000 + Math.round(Math.random() * 2000);
            var aspectRatio = width / height;
            return {
                thumbnail: "//placekitten.com/" + Math.round(75 * aspectRatio) + "/" + 75,
                key: 'item-' + (index + startIndex) + ' ' + lorem(4),
                name: lorem(5),
                description: lorem(10 + Math.round(Math.random() * 50)),
                color: _randWord(DATA.color),
                shape: _randWord(DATA.shape),
                location: _randWord(DATA.location),
                width: width,
                height: height
            };
        });
    }
    exports.createListItems = createListItems;
    function lorem(wordCount) {
        return Array.apply(null, Array(wordCount))
            .map(function (item) { return _randWord(LOREM_IPSUM); })
            .join(' ');
    }
    exports.lorem = lorem;
    function isGroupable(key) {
        return key === 'color' ||
            key === 'shape' ||
            key === 'location';
    }
    exports.isGroupable = isGroupable;
    function _randWord(array) {
        var index = Math.floor(Math.random() * array.length);
        return array[index];
    }
});
