require('./src/ng/survey.app');

// libs
require('./src/lib/jquery.kinetic');
require('datatable');

// services
require('./src/ng/survey/resources.service');
require('./src/ng/survey/interceptor.service');
require('./src/ng/survey/actions.service');
require('./src/ng/survey/tracker.service');
require('./src/ng/survey/redirect.service');

// controllers
require('./src/ng/survey/start.controller');
require('./src/ng/survey/intro.controller');
require('./src/ng/survey/finish.controller');
require('./src/ng/survey/review.controller');
require('./src/ng/survey/result.controller');

// directives
require('./src/ng/survey/nav.directive');
require('./src/ng/survey/navbar.directive');

// wrap stencil web component
require('./src/ng/survey/clang-picker.directive');

module.exports = {};

// polyfills
if (!String.format) {
    String.format = function (format) {
        let args = Array.prototype.slice.call(arguments, 1);

        return format.replace(/{(\d+)}/g, function (match, number) {
            return typeof args[number] != 'undefined' ? args[number] : match;
        });
    };
}

if (!String.localise) {
    String.localise = function () {
        return lmsg.apply(this, arguments);
    }
}
