"use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } // Select2 Demo // ============================================================= var Select2Demo = /*#__PURE__*/function () { function Select2Demo() { _classCallCheck(this, Select2Demo); this.init(); } _createClass(Select2Demo, [{ key: "init", value: function init() { // event handlers this.fillSelectFromStates(); this.remoteData(); } }, { key: "getStates", value: function getStates() { return $('#select2-source-states').html(); } }, { key: "fillSelectFromStates", value: function fillSelectFromStates() { $('#select2-single, #select2-multiple').append(this.getStates()); } }, { key: "remoteData", value: function remoteData() { var formatRepo = function formatRepo(repo) { if (repo.loading) return repo.text; var markup = '