define([
  'jquery',
  'require',

  './select2/core',
  './select2/defaults'
], function ($, require, Select2, Defaults) {
  // Force jQuery.mousewheel to be loaded if it hasn't already
  require('jquery.mousewheel');

  if ($.fn.select2 == null) {
    // All methods that should return the element
    var thisMethods = ['open', 'close', 'destroy'];

    $.fn.select2 = function (options) {
      options = options || {};

      if (typeof options === 'object') {
        this.each(function () {
          var instanceOptions = $.extend({}, options, true);

          var instance = new Select2($(this), instanceOptions);
        });

        return this;
      } else if (typeof options === 'string') {
        var instance = this.data('select2');

        if (instance == null && window.console && console.error) {
          console.error(
            'The select2(\'' + options + '\') method was called on an ' +
            'element that is not using Select2.'
          );
        }

        var args = Array.prototype.slice.call(arguments, 1);

        var ret = instance[options].apply(instance, args);

        // Check if we should be returning `this`
        if ($.inArray(options, thisMethods) > -1) {
          return this;
        }

        return ret;
      } else {
        throw new Error('Invalid arguments for Select2: ' + options);
      }
    };
  }

  if ($.fn.select2.defaults == null) {
    $.fn.select2.defaults = Defaults;
  }

  return Select2;
});

@@ -695,24 +695,76 @@
 'string') %7B%0A
+        var ret;%0A%0A        this.each(function () %7B%0A  
         var 
@@ -774,20 +774,23 @@
 tance = 
+$(
 this
+)
 .data('s
@@ -796,24 +796,26 @@
 select2');%0A%0A
+  
         if (
@@ -865,24 +865,26 @@
 le.error) %7B%0A
+  
           co
@@ -908,16 +908,18 @@
         
+  
 'The sel
@@ -984,16 +984,18 @@
         
+  
 'element
@@ -1033,19 +1033,23 @@
         
+ 
+ 
 );%0A
+  
         
@@ -1043,32 +1043,34 @@
 );%0A          %7D%0A%0A
+  
         var args
@@ -1119,27 +1119,25 @@
 );%0A%0A        
-var
+ 
  ret = insta
@@ -1171,16 +1171,28 @@
 , args);
+%0A        %7D);
 %0A%0A      

Fix select2('') calls on multiple elements