define(function(require, exports, module) {
    "use strict";

    main.consumes = ["Plugin", "ui"];
    main.provides = ["smartface.ui-editor.ui-editor-styles"];
    return main;

    function main(options, imports, register) {
        var ui = imports.ui;
        var Plugin = imports.Plugin;
        var plugin = new Plugin("Smartface", main.consumes);
        var drawn = false;
        var noop = function() {};

        plugin.on("load", noop);
        plugin.on("unload", noop);

        plugin.once("draw", function(options) {
            if (drawn)
                return;
            drawn = true;

            var designer = require("text!./designer.less");
            var explorer = require("text!./explorer.less");
            var properties = require("text!./properties.less");
            var tExplorer = require("text!./template-explorer.less");
            var themes = require("text!./themes.less");
            var toolbox = require("text!./toolbox.less");
            var panel = require("text!./ui-editor-panel.less");

            ui.insertCss(designer, options.staticPrefix, plugin);
            ui.insertCss(explorer, options.staticPrefix, plugin);
            ui.insertCss(properties, options.staticPrefix, plugin);
            ui.insertCss(tExplorer, options.staticPrefix, plugin);
            ui.insertCss(themes, options.staticPrefix, plugin);
            ui.insertCss(toolbox, options.staticPrefix, plugin);
            ui.insertCss(panel, options.staticPrefix, plugin);
        });

        plugin.freezePublicAPI({});
        register(null, {
            "smartface.ui-editor.ui-editor-styles": plugin,
        });
    }
});
