'use strict';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		// Metadata.
		pkg: grunt.file.readJSON('tablesaw.json'),
		banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
			'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
			'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
			'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.company %>;' +
			' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
		// Task configuration.
		clean: ['<%= concat.cssall.dest %>', '<%= concat.cssstack.dest %>'],
		concat: {
			options: {
				banner: '<%= banner %>',
				stripBanners: true
			},
			jsall: {
				src: [
					'src/tablesaw.js',
					'src/tables.js',
					'src/tables.stack.js',
					'src/tables.btnmarkup.js',
					'src/tables.columntoggle.js',
					'src/tables.swipetoggle.js',
					'src/tables.sortable.js',
					'src/tables.minimap.js',
					'src/tables.modeswitch.js'
				],
				dest: 'dist/<%= pkg.name %>.js'
			},
			jsstack: {
				src: [
					'src/tablesaw.js',
					'src/tables.js',
					'src/tables.stack.js'
				],
				dest: 'dist/<%= pkg.name %>.stackonly.js'
			},
			cssall: {
				src: [
					'src/tables.css',
					'src/tables.toolbar.css',
					'src/tables.skin.css',
					'src/tables.stack.css',
					'src/tables.swipetoggle.css',
					'src/tables.columntoggle.css',
					'src/tables.sortable.css',
					'src/tables.minimap.css',
					'src/tables.modeswitch.css'
				],
				dest: 'dist/<%= pkg.name %>.myth.css'
			},
			cssstack: {
				src: [
					'src/tables.css',
					'src/tables.stack.css'
				],
				dest: 'dist/<%= pkg.name %>.stackonly.myth.css'
			}
		},
		qunit: {
			files: ['test/**/*.html']
		},
		jshint: {
			gruntfile: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: 'Gruntfile.js'
			},
			src: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: ['src/**/*.js']
			},
			test: {
				options: {
					jshintrc: 'test/.jshintrc'
				},
				src: ['test/**/*.js']
			},
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: ['jshint:gruntfile']
			},
			src: {
				files: ['<%= concat.cssall.src %>', '<%= concat.jsall.src %>'],
				tasks: ['src']
			},
			icons: {
				files: ['<%= grunticon.tablesaw.options.src %>/*'],
				tasks: ['grunticon:tablesaw']
			},
			test: {
				files: '<%= jshint.test.src %>',
				tasks: ['jshint:test', 'qunit']
			},
		},
		grunticon: {
			tablesaw: {
				files: [{
					expand: true,
					cwd: 'src/icons/',
					src: ['*.svg'],
					dest: 'dist/icons/'
				}],
				options: {
					loadersnippet: 'grunticon.loader.js',
					customselectors: {
						"arrow-gray-down": [".tablesaw-bar .tablesaw-columntoggle-btnwrap > a.btn"],
						"sort-ascending": [".tablesaw-sortable .sortable-head.sortable-ascending button:after"],
						"sort-descending": [".tablesaw-sortable .sortable-head.sortable-descending button:after"],
						"arrow-gray-right": [".tablesaw-bar .tablesaw-advance > .btn.right"],
						"arrow-gray-left": [".tablesaw-bar .tablesaw-advance > .btn.left"],
						"check": [".tablesaw-bar .btn-selected.btn-checkbox:after"]
					}
				}
			}
		},
		bytesize: {
			dist: {
				src: [
					'dist/<%= pkg.name %>.css',
					'dist/<%= pkg.name %>.js'
				]
			},
			stackonly: {
				src: [
					'dist/<%= pkg.name %>.stackonly.css',
					'dist/<%= pkg.name %>.stackonly.js'
				]
			}
		},
		'gh-pages': {
			options: {},
			src: ['dist/**/*', 'bower_components/**/*', 'demo/**/*', 'test/**/*']
		},
		myth: {
			dist: {
				files: {
					'dist/<%= pkg.name %>.css': '<%= concat.cssall.dest %>',
					'dist/<%= pkg.name %>.stackonly.css': '<%= concat.cssstack.dest %>'
				}
			}
		}
	});

	require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

	// Default task.
	grunt.registerTask('src', ['concat', 'myth']);
	grunt.registerTask('default', ['jshint', 'src', 'clean', 'grunticon:tablesaw', 'qunit', 'bytesize']);

	// Deploy
	grunt.registerTask('deploy', ['default', 'gh-pages']);

};

@@ -3842,16 +3842,25 @@
 , 'myth'
+, 'clean'
 %5D);%0A%09gru
@@ -3907,17 +3907,8 @@
 rc',
- 'clean',
  'gr

Remove myth files in `grunt watch`.