'use strict'

module.exports = (grunt) => {
  grunt.initConfig({
    clean: ['dist/*'],
    concat: {
      core: {
        options: {
          footer: '<script type="text/javascript" src="js/routes.js"></script><script type="text/javascript" src="js/semitki.js"></script></html>'
        },
        src: ['index.html','views/*.hbs'],
        dest: 'dist/index.html'
      },
      models: {
        options: {
          separator: ';\n',
          banner: "'use strict'",
          process: (src, filepath) => {
            return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1\n');
          }
        },
        src: ['models/*.js'],
        dest: 'dist/js/models.js'
      },
      collections: {
        options: {
          separator: ';\n',
          banner: "'use strict'",
          process: (src, filepath) => {
            return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1\n');
          }
        },
        src: ['collections/*.js'],
        dest: 'dist/js/collections.js'
      },
      views: {
        options: {
          separator: ';\n',
          banner: "'use strict'",
          process: (src, filepath) => {
            return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1\n');
          }
        },
        src: ['views/*.js'],
        dest: 'dist/js/views.js'
      },
    },
    copy: {
      css: {
        expand: true,
        cwd: 'static/css',
        src: '*.css',
        dest: 'dist/css',
        filter: 'isFile'
      },
      js: {
        expand: true,
        cwd: 'static/js',
        src: '*.js',
        dest: 'dist/js',
        filter: 'isFile'
      },
      bootstrap: {
        expand: true,
        cwd: 'bower_components/bootstrap/dist/css',
        src: '*', dest: 'dist/css/', filter: 'isFile'
      },
      bootstrapfonts: {
        expand: true,
        cwd: 'bower_components/bootstrap/dist/fonts',
        src: '*', dest: 'dist/fonts', filter: 'isFile'
      },
      bootstrapdatepicker: {
        expand: true,
        cwd: 'bower_components/eonasdan-bootstrap-datepicker/build/css',
        src: '*', dest: 'dist/css', filter: 'isFile'
      },
      select2: {
        expand: true,
        cwd: 'bower_components/select2/dist',
        src: '*', dest: 'dist/css', filter: 'isFile'
      },
      select2boostrap: {
        expand: true,
        cwd: 'bower_components/select2-bootstrap-theme/dist',
        src: '*', dest: 'dist/css', filter: 'isFile'
      }

    },
    bower: {
      dev: {
        dest: 'dist',
        js_dest: 'dist/js/vendor',
        css_dest: 'dist/css',
        options: {
          packageSpecific: {
            'bootstrap': {
              files: { src:'dist/**', dest:'dist/css' }
            },
            'handlebars': {
              files: ['./*.js']
            }
          }
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-bower');
  grunt.loadNpmTasks('grunt-contrib-clean');

  grunt.registerTask('default', ['clean', 'concat', 'copy', 'bower']);
  grunt.registerTask('prod', ['clean', 'concat', 'copy', 'bower']);

};

@@ -2170,20 +2170,23 @@
  select2
+css
 : %7B%0A
-
         
@@ -2238,24 +2238,28 @@
 select2/dist
+/css
 ',%0A        s
@@ -2294,32 +2294,32 @@
 ilter: 'isFile'%0A
-
       %7D,%0A      s
@@ -2303,32 +2303,184 @@
 sFile'%0A      %7D,%0A
+      select2js: %7B%0A        expand: true,%0A        cwd: 'bower_components/select2/dist/js',%0A        src: '*', dest: 'dist/js', filter: 'isFile'%0A      %7D,%0A%0A
       select2boo

FIX Gruntfile for select2.